query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d9dde76cb3c64215ece1e5dec804049a
Handles responses to an ajax request: sets all responseXXX fields accordingly finds the right dataType (mediates between contenttype and expected dataType) returns the corresponding response
[ { "docid": "3f6d09a0ad855cea854be49e2763c396", "score": "0.77820176", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" } ]
[ { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.8112831", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.8112831", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.8112831", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.8112831", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "797faa51731407d12006ffd2af716cc9", "score": "0.81019294", "text": "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\nif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\nif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\nfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\nfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n// We add the dataType to the list if needed\n// and return the corresponding response\nif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "222801db63d552a509f38e64adc77e03", "score": "0.79927474", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\n\tif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\n\tfinalDataType=finalDataType||firstDataType;}// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "afaa793207c5a9653a0448a06bdc115a", "score": "0.7977215", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType=dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}} // Or just use first one\n\tfinalDataType=finalDataType||firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "5ea54cd2c4e5057ad4947ca96807ee3f", "score": "0.7972035", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\n\tfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "5ea54cd2c4e5057ad4947ca96807ee3f", "score": "0.7972035", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\n\tfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "5ea54cd2c4e5057ad4947ca96807ee3f", "score": "0.7972035", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\n\tfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "bedb24ef78420c9082bce9833c3c452a", "score": "0.7962746", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\r\n\twhile(dataTypes[0]===\"*\"){dataTypes.shift();if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader(\"Content-Type\");}}// Check if we're dealing with a known content-type\r\n\tif(ct){for(type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break;}}}// Check to see if we have a response for the expected dataType\r\n\tif(dataTypes[0]in responses){finalDataType=dataTypes[0];}else{// Try convertible dataTypes\r\n\tfor(type in responses){if(!dataTypes[0]||s.converters[type+\" \"+dataTypes[0]]){finalDataType=type;break;}if(!firstDataType){firstDataType=type;}}// Or just use first one\r\n\tfinalDataType=finalDataType||firstDataType;}// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif(finalDataType){if(finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "3da0f3c7c809785d365c5065a0cb0f26", "score": "0.7955312", "text": "function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes; // Remove auto dataType and get content-type in the process\n\twhile(dataTypes[0] === \"*\") {dataTypes.shift();if(ct === undefined){ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");}} // Check if we're dealing with a known content-type\n\tif(ct){for(type in contents) {if(contents[type] && contents[type].test(ct)){dataTypes.unshift(type);break;}}} // Check to see if we have a response for the expected dataType\n\tif(dataTypes[0] in responses){finalDataType = dataTypes[0];}else { // Try convertible dataTypes\n\tfor(type in responses) {if(!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]){finalDataType = type;break;}if(!firstDataType){firstDataType = type;}} // Or just use first one\n\tfinalDataType = finalDataType || firstDataType;} // If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif(finalDataType){if(finalDataType !== dataTypes[0]){dataTypes.unshift(finalDataType);}return responses[finalDataType];}}", "title": "" }, { "docid": "9d714a9c50f2897a50a1ac86fb7858c4", "score": "0.77919966", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n \n \tvar contents = s.contents,\n \t\tdataTypes = s.dataTypes,\n \t\tresponseFields = s.responseFields,\n \t\tct,\n \t\ttype,\n \t\tfinalDataType,\n \t\tfirstDataType;\n \n \t// Fill responseXXX fields\n \tfor ( type in responseFields ) {\n \t\tif ( type in responses ) {\n \t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n \t\t}\n \t}\n \n \t// Remove auto dataType and get content-type in the process\n \twhile( dataTypes[ 0 ] === \"*\" ) {\n \t\tdataTypes.shift();\n \t\tif ( ct === undefined ) {\n \t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n \t\t}\n \t}\n \n \t// Check if we're dealing with a known content-type\n \tif ( ct ) {\n \t\tfor ( type in contents ) {\n \t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n \t\t\t\tdataTypes.unshift( type );\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \n \t// Check to see if we have a response for the expected dataType\n \tif ( dataTypes[ 0 ] in responses ) {\n \t\tfinalDataType = dataTypes[ 0 ];\n \t} else {\n \t\t// Try convertible dataTypes\n \t\tfor ( type in responses ) {\n \t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n \t\t\t\tfinalDataType = type;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tif ( !firstDataType ) {\n \t\t\t\tfirstDataType = type;\n \t\t\t}\n \t\t}\n \t\t// Or just use first one\n \t\tfinalDataType = finalDataType || firstDataType;\n \t}\n \n \t// If we found a dataType\n \t// We add the dataType to the list if needed\n \t// and return the corresponding response\n \tif ( finalDataType ) {\n \t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n \t\t\tdataTypes.unshift( finalDataType );\n \t\t}\n \t\treturn responses[ finalDataType ];\n \t}\n }", "title": "" }, { "docid": "a06c75b037d4bcaa2999ff4f261ebadc", "score": "0.77904993", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields,\n ct,\n type,\n finalDataType,\n firstDataType;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "a06c75b037d4bcaa2999ff4f261ebadc", "score": "0.77904993", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields,\n ct,\n type,\n finalDataType,\n firstDataType;\n\n // Fill responseXXX fields\n for ( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "5d6788808895abb91630dd214bbc092a", "score": "0.778347", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields,\n ct,\n type,\n finalDataType,\n firstDataType;\n\n // Fill responseXXX fields\n for( type in responseFields ) {\n if ( type in responses ) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "10705bcbab4d59a041a565524a3f772a", "score": "0.7772851", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n // Fill responseXXX fields\n for (type in responseFields) {\n if (type in responses) {\n jqXHR[responseFields[type]] = responses[type];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"content-type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "e40f0d4d6be86d0974c2fd00561d3f34", "score": "0.77648145", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\tvar firstDataType, ct, finalDataType, type,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "9ae73bac3796440b88ecc17d24f350bd", "score": "0.77588147", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType,\n ct,\n finalDataType,\n type,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a205333b6b042e4f8f7d1e269c3ba493", "score": "0.7757148", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar firstDataType, ct, finalDataType, type,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "d60e058c4829147f9cc75a0338c8cbfe", "score": "0.775201", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar contents = s.contents,\n\t\t\tdataTypes = s.dataTypes,\n\t\t\tresponseFields = s.responseFields,\n\t\t\tct,\n\t\t\ttype,\n\t\t\tfinalDataType,\n\t\t\tfirstDataType;\n\t\n\t\t// Fill responseXXX fields\n\t\tfor ( type in responseFields ) {\n\t\t\tif ( type in responses ) {\n\t\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t\t}\n\t\t}\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "4085b7b679cf8281a7dc8a5dad848ced", "score": "0.7751837", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "40bfb23c944fd428fea930f65fcbba39", "score": "0.7749165", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields;\n\n // Fill responseXXX fields\n for (type in responseFields) {\n if (type in responses) {\n jqXHR[ responseFields[type] ] = responses[ type ];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[ 0 ] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[ type ] && contents[ type ].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[ 0 ] in responses) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[ 0 ]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "0f19610fce4c6781917f69ca071bd19e", "score": "0.77358675", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "0f19610fce4c6781917f69ca071bd19e", "score": "0.77358675", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "0f19610fce4c6781917f69ca071bd19e", "score": "0.77358675", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "0f19610fce4c6781917f69ca071bd19e", "score": "0.77358675", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "0f19610fce4c6781917f69ca071bd19e", "score": "0.77358675", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "0f19610fce4c6781917f69ca071bd19e", "score": "0.77358675", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "2db189fcbd87aaa07d5a82cccff74696", "score": "0.7734543", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "a2e24728c2fa728dc691eb800a458dec", "score": "0.77343047", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "c4371a44bdd50c79a2b15e79f2051af4", "score": "0.7734082", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var contents = s.contents,\n dataTypes = s.dataTypes,\n responseFields = s.responseFields,\n ct,\n type,\n finalDataType,\n firstDataType;\n\n // Fill responseXXX fields\n for (type in responseFields) {\n if (type in responses) {\n jqXHR[responseFields[type]] = responses[type];\n }\n }\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"content-type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7733591", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7733591", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7733591", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7733591", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "a9d6f0f5b1b5a259b443f4fed1d23d81", "score": "0.7733591", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\r\n\r\n\tvar ct, type, finalDataType, firstDataType,\r\n\t\tcontents = s.contents,\r\n\t\tdataTypes = s.dataTypes;\r\n\r\n\t// Remove auto dataType and get content-type in the process\r\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\r\n\t\tdataTypes.shift();\r\n\t\tif ( ct === undefined ) {\r\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\r\n\t\t}\r\n\t}\r\n\r\n\t// Check if we're dealing with a known content-type\r\n\tif ( ct ) {\r\n\t\tfor ( type in contents ) {\r\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\r\n\t\t\t\tdataTypes.unshift( type );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Check to see if we have a response for the expected dataType\r\n\tif ( dataTypes[ 0 ] in responses ) {\r\n\t\tfinalDataType = dataTypes[ 0 ];\r\n\t} else {\r\n\r\n\t\t// Try convertible dataTypes\r\n\t\tfor ( type in responses ) {\r\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\r\n\t\t\t\tfinalDataType = type;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif ( !firstDataType ) {\r\n\t\t\t\tfirstDataType = type;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Or just use first one\r\n\t\tfinalDataType = finalDataType || firstDataType;\r\n\t}\r\n\r\n\t// If we found a dataType\r\n\t// We add the dataType to the list if needed\r\n\t// and return the corresponding response\r\n\tif ( finalDataType ) {\r\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\r\n\t\t\tdataTypes.unshift( finalDataType );\r\n\t\t}\r\n\t\treturn responses[ finalDataType ];\r\n\t}\r\n}", "title": "" }, { "docid": "5d6eb80b4a272f0c14bf535a757509d8", "score": "0.7730935", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "5d6eb80b4a272f0c14bf535a757509d8", "score": "0.7730935", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "5d6eb80b4a272f0c14bf535a757509d8", "score": "0.7730935", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "5d6eb80b4a272f0c14bf535a757509d8", "score": "0.7730935", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "5d6eb80b4a272f0c14bf535a757509d8", "score": "0.7730935", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "5d6eb80b4a272f0c14bf535a757509d8", "score": "0.7730935", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "5d6eb80b4a272f0c14bf535a757509d8", "score": "0.7730935", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "fadbc3d050ff648416652ed5ecf815a1", "score": "0.772758", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "fadbc3d050ff648416652ed5ecf815a1", "score": "0.772758", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "e4ee11fb96f9343f3f7225e006fddf81", "score": "0.7726911", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "e4ee11fb96f9343f3f7225e006fddf81", "score": "0.7726911", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "e4ee11fb96f9343f3f7225e006fddf81", "score": "0.7726911", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "e4ee11fb96f9343f3f7225e006fddf81", "score": "0.7726911", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "e4ee11fb96f9343f3f7225e006fddf81", "score": "0.7726911", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "e4ee11fb96f9343f3f7225e006fddf81", "score": "0.7726911", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "e4ee11fb96f9343f3f7225e006fddf81", "score": "0.7726911", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar contents = s.contents,\n\t\tdataTypes = s.dataTypes,\n\t\tresponseFields = s.responseFields,\n\t\tct,\n\t\ttype,\n\t\tfinalDataType,\n\t\tfirstDataType;\n\n\t// Fill responseXXX fields\n\tfor ( type in responseFields ) {\n\t\tif ( type in responses ) {\n\t\t\tjqXHR[ responseFields[type] ] = responses[ type ];\n\t\t}\n\t}\n\n\t// Remove auto dataType and get content-type in the process\n\twhile( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"content-type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "74df01afa4d05771ca06ba2e48858879", "score": "0.7723882", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "7772062ef567d3c1325bbbed71228c04", "score": "0.7722104", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "6d979bd2258f84328ff9af842e82bbca", "score": "0.77168196", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n\t\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\t\tcontents = s.contents,\n\t\t\t\tdataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif ( ct === undefined ) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif ( ct ) {\n\t\t\t\tfor ( type in contents ) {\n\t\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\t\tdataTypes.unshift( type );\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\t// Check to see if we have a response for the expected dataType\n\t\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor ( type in responses ) {\n\t\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif ( finalDataType ) {\n\t\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t\t}\n\t\t\t\treturn responses[ finalDataType ];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "650bb882637bf16239d50a76c3de31f1", "score": "0.77138346", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "e36263eeba01d3bfcc70a57507422526", "score": "0.7713694", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\r\n\r\n var contents = s.contents,\r\n\t\tdataTypes = s.dataTypes,\r\n\t\tresponseFields = s.responseFields,\r\n\t\tct,\r\n\t\ttype,\r\n\t\tfinalDataType,\r\n\t\tfirstDataType;\r\n\r\n // Fill responseXXX fields\r\n for (type in responseFields) {\r\n if (type in responses) {\r\n jqXHR[responseFields[type]] = responses[type];\r\n }\r\n }\r\n\r\n // Remove auto dataType and get content-type in the process\r\n while (dataTypes[0] === \"*\") {\r\n dataTypes.shift();\r\n if (ct === undefined) {\r\n ct = s.mimeType || jqXHR.getResponseHeader(\"content-type\");\r\n }\r\n }\r\n\r\n // Check if we're dealing with a known content-type\r\n if (ct) {\r\n for (type in contents) {\r\n if (contents[type] && contents[type].test(ct)) {\r\n dataTypes.unshift(type);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Check to see if we have a response for the expected dataType\r\n if (dataTypes[0]in responses) {\r\n finalDataType = dataTypes[0];\r\n } else {\r\n // Try convertible dataTypes\r\n for (type in responses) {\r\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\r\n finalDataType = type;\r\n break;\r\n }\r\n if (!firstDataType) {\r\n firstDataType = type;\r\n }\r\n }\r\n // Or just use first one\r\n finalDataType = finalDataType || firstDataType;\r\n }\r\n\r\n // If we found a dataType\r\n // We add the dataType to the list if needed\r\n // and return the corresponding response\r\n if (finalDataType) {\r\n if (finalDataType !== dataTypes[0]) {\r\n dataTypes.unshift(finalDataType);\r\n }\r\n return responses[finalDataType];\r\n }\r\n }", "title": "" }, { "docid": "67c340b902cf729cf009af9011866ec3", "score": "0.77136785", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "a2e4d00d0a0e5dec7cfb2ffbd920a791", "score": "0.7709126", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n var ct, type, finalDataType, firstDataType, contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "1986abb4af2e4c51ae9198dd7f47eacb", "score": "0.770849", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n }", "title": "" }, { "docid": "9b008157e21ae0c0575ac6d7d835248f", "score": "0.7707311", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n }\n else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.76993644", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.76993644", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.76993644", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.76993644", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "dc282e0334840ec4ac58ae7dd42b11d9", "score": "0.76993644", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process\n\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n } // Check if we're dealing with a known content-type\n\n\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n } // Check to see if we have a response for the expected dataType\n\n\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n\n if (!firstDataType) {\n firstDataType = type;\n }\n } // Or just use first one\n\n\n finalDataType = finalDataType || firstDataType;\n } // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n\n\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n\n return responses[finalDataType];\n }\n }", "title": "" }, { "docid": "ef3cedd4af5e9bc97e5fc7b0c47b49bb", "score": "0.7691543", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "ef3cedd4af5e9bc97e5fc7b0c47b49bb", "score": "0.7691543", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "ef3cedd4af5e9bc97e5fc7b0c47b49bb", "score": "0.7691543", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n var ct, type, finalDataType, firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "d1fccf4ae0aa12f4d27c07da800b3b5f", "score": "0.76855", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}", "title": "" }, { "docid": "2f10474f96cd52c8354eeff7872a4e5a", "score": "0.76851416", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "2f10474f96cd52c8354eeff7872a4e5a", "score": "0.76851416", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n var firstDataType, ct, finalDataType, type,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while ( dataTypes[ 0 ] === \"*\" ) {\n dataTypes.shift();\n if ( ct === undefined ) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if ( ct ) {\n for ( type in contents ) {\n if ( contents[ type ] && contents[ type ].test( ct ) ) {\n dataTypes.unshift( type );\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if ( dataTypes[ 0 ] in responses ) {\n finalDataType = dataTypes[ 0 ];\n } else {\n // Try convertible dataTypes\n for ( type in responses ) {\n if ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n finalDataType = type;\n break;\n }\n if ( !firstDataType ) {\n firstDataType = type;\n }\n }\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if ( finalDataType ) {\n if ( finalDataType !== dataTypes[ 0 ] ) {\n dataTypes.unshift( finalDataType );\n }\n return responses[ finalDataType ];\n }\n}", "title": "" }, { "docid": "e80e0f84cef097975df4fe8349c8dc43", "score": "0.7680138", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\n \tvar ct, type, finalDataType, firstDataType,\n \t\tcontents = s.contents,\n \t\tdataTypes = s.dataTypes;\n\n \t// Remove auto dataType and get content-type in the process\n \twhile ( dataTypes[ 0 ] === \"*\" ) {\n \t\tdataTypes.shift();\n \t\tif ( ct === undefined ) {\n \t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n \t\t}\n \t}\n\n \t// Check if we're dealing with a known content-type\n \tif ( ct ) {\n \t\tfor ( type in contents ) {\n \t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n \t\t\t\tdataTypes.unshift( type );\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n\n \t// Check to see if we have a response for the expected dataType\n \tif ( dataTypes[ 0 ] in responses ) {\n \t\tfinalDataType = dataTypes[ 0 ];\n \t} else {\n\n \t\t// Try convertible dataTypes\n \t\tfor ( type in responses ) {\n \t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n \t\t\t\tfinalDataType = type;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tif ( !firstDataType ) {\n \t\t\t\tfirstDataType = type;\n \t\t\t}\n \t\t}\n\n \t\t// Or just use first one\n \t\tfinalDataType = finalDataType || firstDataType;\n \t}\n\n \t// If we found a dataType\n \t// We add the dataType to the list if needed\n \t// and return the corresponding response\n \tif ( finalDataType ) {\n \t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n \t\t\tdataTypes.unshift( finalDataType );\n \t\t}\n \t\treturn responses[ finalDataType ];\n \t}\n }", "title": "" }, { "docid": "c657280a7204366ae84f938094d08b5a", "score": "0.7680131", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "c657280a7204366ae84f938094d08b5a", "score": "0.7680131", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "c657280a7204366ae84f938094d08b5a", "score": "0.7680131", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[0] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "87b6ee412d1c6e0295485f82f555928e", "score": "0.7675149", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\tvar firstDataType, ct, finalDataType, type,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "e7e11af6b8ddda2e53041fb3a474dbfc", "score": "0.76740855", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n\t\t\tvar ct,\n\t\t\t type,\n\t\t\t finalDataType,\n\t\t\t firstDataType,\n\t\t\t contents = s.contents,\n\t\t\t dataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile (dataTypes[0] === \"*\") {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif (ct === undefined) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif (ct) {\n\t\t\t\tfor (type in contents) {\n\t\t\t\t\tif (contents[type] && contents[type].test(ct)) {\n\t\t\t\t\t\tdataTypes.unshift(type);\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\t// Check to see if we have a response for the expected dataType\n\t\t\tif (dataTypes[0] in responses) {\n\t\t\t\tfinalDataType = dataTypes[0];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor (type in responses) {\n\t\t\t\t\tif (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!firstDataType) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif (finalDataType) {\n\t\t\t\tif (finalDataType !== dataTypes[0]) {\n\t\t\t\t\tdataTypes.unshift(finalDataType);\n\t\t\t\t}\n\t\t\t\treturn responses[finalDataType];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e7e11af6b8ddda2e53041fb3a474dbfc", "score": "0.76740855", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n\t\t\tvar ct,\n\t\t\t type,\n\t\t\t finalDataType,\n\t\t\t firstDataType,\n\t\t\t contents = s.contents,\n\t\t\t dataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile (dataTypes[0] === \"*\") {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif (ct === undefined) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif (ct) {\n\t\t\t\tfor (type in contents) {\n\t\t\t\t\tif (contents[type] && contents[type].test(ct)) {\n\t\t\t\t\t\tdataTypes.unshift(type);\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\t// Check to see if we have a response for the expected dataType\n\t\t\tif (dataTypes[0] in responses) {\n\t\t\t\tfinalDataType = dataTypes[0];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor (type in responses) {\n\t\t\t\t\tif (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!firstDataType) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif (finalDataType) {\n\t\t\t\tif (finalDataType !== dataTypes[0]) {\n\t\t\t\t\tdataTypes.unshift(finalDataType);\n\t\t\t\t}\n\t\t\t\treturn responses[finalDataType];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "e7e11af6b8ddda2e53041fb3a474dbfc", "score": "0.76740855", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n\n\t\t\tvar ct,\n\t\t\t type,\n\t\t\t finalDataType,\n\t\t\t firstDataType,\n\t\t\t contents = s.contents,\n\t\t\t dataTypes = s.dataTypes;\n\n\t\t\t// Remove auto dataType and get content-type in the process\n\t\t\twhile (dataTypes[0] === \"*\") {\n\t\t\t\tdataTypes.shift();\n\t\t\t\tif (ct === undefined) {\n\t\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if we're dealing with a known content-type\n\t\t\tif (ct) {\n\t\t\t\tfor (type in contents) {\n\t\t\t\t\tif (contents[type] && contents[type].test(ct)) {\n\t\t\t\t\t\tdataTypes.unshift(type);\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\t// Check to see if we have a response for the expected dataType\n\t\t\tif (dataTypes[0] in responses) {\n\t\t\t\tfinalDataType = dataTypes[0];\n\t\t\t} else {\n\n\t\t\t\t// Try convertible dataTypes\n\t\t\t\tfor (type in responses) {\n\t\t\t\t\tif (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n\t\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (!firstDataType) {\n\t\t\t\t\t\tfirstDataType = type;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Or just use first one\n\t\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t\t}\n\n\t\t\t// If we found a dataType\n\t\t\t// We add the dataType to the list if needed\n\t\t\t// and return the corresponding response\n\t\t\tif (finalDataType) {\n\t\t\t\tif (finalDataType !== dataTypes[0]) {\n\t\t\t\t\tdataTypes.unshift(finalDataType);\n\t\t\t\t}\n\t\t\t\treturn responses[finalDataType];\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7667975", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7667975", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7667975", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7667975", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7667975", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7667975", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7667975", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" }, { "docid": "72471823a93ae1d457b424cc42ccfa11", "score": "0.7667975", "text": "function ajaxHandleResponses( s, jqXHR, responses ) {\n\t\n\t\tvar ct, type, finalDataType, firstDataType,\n\t\t\tcontents = s.contents,\n\t\t\tdataTypes = s.dataTypes;\n\t\n\t\t// Remove auto dataType and get content-type in the process\n\t\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\t\tdataTypes.shift();\n\t\t\tif ( ct === undefined ) {\n\t\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t\t}\n\t\t}\n\t\n\t\t// Check if we're dealing with a known content-type\n\t\tif ( ct ) {\n\t\t\tfor ( type in contents ) {\n\t\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\t\tdataTypes.unshift( type );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t// Check to see if we have a response for the expected dataType\n\t\tif ( dataTypes[ 0 ] in responses ) {\n\t\t\tfinalDataType = dataTypes[ 0 ];\n\t\t} else {\n\t\n\t\t\t// Try convertible dataTypes\n\t\t\tfor ( type in responses ) {\n\t\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\t\tfinalDataType = type;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif ( !firstDataType ) {\n\t\t\t\t\tfirstDataType = type;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// Or just use first one\n\t\t\tfinalDataType = finalDataType || firstDataType;\n\t\t}\n\t\n\t\t// If we found a dataType\n\t\t// We add the dataType to the list if needed\n\t\t// and return the corresponding response\n\t\tif ( finalDataType ) {\n\t\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\t\tdataTypes.unshift( finalDataType );\n\t\t\t}\n\t\t\treturn responses[ finalDataType ];\n\t\t}\n\t}", "title": "" } ]
621e6eeec4e4ebd06b68a2abe99da201
Portal associated with the Portal outlet.
[ { "docid": "cab1d49a695010cfffeb1c0279108714", "score": "0.7564594", "text": "get portal() {\n return this._attachedPortal;\n }", "title": "" } ]
[ { "docid": "b82aa146d05d52e0daeafd264b5ce5d9", "score": "0.78078854", "text": "function PortalOutlet() { }", "title": "" }, { "docid": "572d9720eca253673084ec9e32a248e2", "score": "0.76088405", "text": "get portal() {\n return this._attachedPortal;\n }", "title": "" }, { "docid": "3e1e749c7d1542f965790ec255386739", "score": "0.67281276", "text": "function PortalDemo() {\n return ReactDOM.createPortal( //ReactDOM.createPortal accepts twp parameter\n <div>\n <h1>Portals demo</h1>\n </div>,\n\n document.getElementById('portal-root')\n )\n}", "title": "" }, { "docid": "1ffcbec837d359cda302d77c6bc5395a", "score": "0.67004406", "text": "function initPortal(){\n portal = new Portal;\n info = new OAuthInfo({\n appId: \"OkNkeFOIGhEQYJiD\",\n popup: true\n });\n \n esriId.registerOAuthInfos([info]);\n }", "title": "" }, { "docid": "86eab76ec3702c77e97c9173f531964b", "score": "0.66952395", "text": "function PortalDemo() {\n\treturn ReactDOM.createPortal(\n\t\t<h1>Portals Demo</h1>,\n\t\tdocument.getElementById('portal-root')\n\t);\n}", "title": "" }, { "docid": "7bedfb5fd289dd57b7547913057745fa", "score": "0.6695159", "text": "function setupPortals() {\n mkPortal('popover-portal');\n mkPortal('modal-portal');\n mkPortal('alert-portal');\n}", "title": "" }, { "docid": "42bb48aea40b1a419c86e61cd1929e87", "score": "0.66049254", "text": "_createPortalOutlet(pane) {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_3__.ApplicationRef);\n }\n return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_10__.DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);\n }", "title": "" }, { "docid": "a0f5248bbb2d6d54565e0573abb42e7f", "score": "0.6538465", "text": "function PortalsDemo() {\n return ReactDOM.createPortal(\n <div>\n <h1>this is portal div</h1>\n </div>,\n document.getElementById('portals-root')\n )\n}", "title": "" }, { "docid": "6761133d07b9776b9c16aa1811a62a14", "score": "0.6535295", "text": "_createPortalOutlet(pane) {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ApplicationRef\"]);\n }\n return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__[\"DomPortalOutlet\"](pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);\n }", "title": "" }, { "docid": "6761133d07b9776b9c16aa1811a62a14", "score": "0.6535295", "text": "_createPortalOutlet(pane) {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ApplicationRef\"]);\n }\n return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__[\"DomPortalOutlet\"](pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);\n }", "title": "" }, { "docid": "6761133d07b9776b9c16aa1811a62a14", "score": "0.6535295", "text": "_createPortalOutlet(pane) {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ApplicationRef\"]);\n }\n return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__[\"DomPortalOutlet\"](pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);\n }", "title": "" }, { "docid": "6761133d07b9776b9c16aa1811a62a14", "score": "0.6535295", "text": "_createPortalOutlet(pane) {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ApplicationRef\"]);\n }\n return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__[\"DomPortalOutlet\"](pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);\n }", "title": "" }, { "docid": "bdc9ef83e565d1aa7906e1527a08d954", "score": "0.65278167", "text": "portal(x,y,tx,ty){\r\n return this.set(x,y,T.PortalC(tx,ty))\r\n }", "title": "" }, { "docid": "a8c4ed983984793f124be6618b603cfc", "score": "0.6505968", "text": "_createPortalOutlet(pane) {\n // We have to resolve the ApplicationRef later in order to allow people\n // to use overlay-based providers during app initialization.\n if (!this._appRef) {\n this._appRef = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__[\"ApplicationRef\"]);\n }\n return new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_6__[\"DomPortalOutlet\"](pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);\n }", "title": "" }, { "docid": "1db3291537c6e3c28ce88aba29a7cc73", "score": "0.6476015", "text": "showPortal(portalDef) {\n var portal = compositionFactory.createPortal(portalDef);\n\n if (this.activePortal) {\n this.disposePortal(this.activePortal);\n }\n\n this.setActivePortal(portal);\n\n this.view.renderPortal(portal);\n }", "title": "" }, { "docid": "14f7e1843c8b2a924d786d0cb33e1b96", "score": "0.64269984", "text": "async getPortalInstance() {\n return this.instance;\n }", "title": "" }, { "docid": "4703a1d5ed52fe7489e123a94d08d370", "score": "0.63752335", "text": "function usePortal() {\n arcgisUtils.createMap(webMapVal, \"mapViewDiv\");\n }", "title": "" }, { "docid": "6c2b7f17adda079c10d92e2118d4f893", "score": "0.6374688", "text": "async getPortalInstance() {\r\n return this.instance;\r\n }", "title": "" }, { "docid": "9cdbd32271c280e9bdf034b3082c701d", "score": "0.62599015", "text": "function PortalService() {\n //this.$injector = $injector;\n this.parameter = { action: 'none', itemId: 0 };\n this.panorama = new panorama_1.Panorama(this, 'angular-portal-azure-module');\n //this.$http = $injector.get('$http');\n //this.$httpBackend = $injector.get('$httpBackend');\n //this.$q = $injector.get('$q');\n //this.$rootScope = $injector.get('$rootScope');\n //this.$window = $injector.get('$window');\n //this.$analytics = $injector.get('$analytics');\n //this.$timeout = $injector.get('$timeout');\n //this.$translate = $injector.get('$translate');\n //this.ngDialog = <any>$injector.get('ngDialog');\n this.areaBlades = new area_blades_1.AreaBlades(this);\n this.areaNotification = new area_notification_1.AreaNotification(this);\n }", "title": "" }, { "docid": "48b28717473b876f5f7f91334d52d4ab", "score": "0.6243072", "text": "_getPortal() {\n // Note that we can avoid this check by keeping the portal on the menu panel.\n // While it would be cleaner, we'd have to introduce another required method on\n // `MatMenuPanel`, making it harder to consume.\n if (!this._portal || this._portal.templateRef !== this.menu.templateRef) {\n this._portal = new _angular_cdk_portal__WEBPACK_IMPORTED_MODULE_7__[\"TemplatePortal\"](this.menu.templateRef, this._viewContainerRef);\n }\n return this._portal;\n }", "title": "" }, { "docid": "7c04e634280bc08601ff3892c7eb565e", "score": "0.6237577", "text": "function Portal(props) {\n var containerRef = props.containerRef,\n rest = _objectWithoutPropertiesLoose(props, [\"containerRef\"]);\n\n return containerRef ? /*#__PURE__*/React.createElement(ContainerPortal, _extends({\n containerRef: containerRef\n }, rest)) : /*#__PURE__*/React.createElement(DefaultPortal, rest);\n}", "title": "" }, { "docid": "11efdf12f6eef169d56834ac74258b35", "score": "0.60424656", "text": "portalMode() {\n if (this._isShutDown) return;\n this._addMode = PORTAL;\n this.setSelectedSimpleButton(5);\n }", "title": "" }, { "docid": "a89bd6c58c18bbe752f8cf0aa82c99df", "score": "0.5924208", "text": "function Portal(obj) {\n Entity.call(this);\n this.moveToMapPosRounded(obj.x, obj.y);\n this.dest = obj.properties.level;\n this.destpos = {x: obj.properties.x, y: obj.properties.y };\n}", "title": "" }, { "docid": "110a0b1d7595ba37579a892984334176", "score": "0.5907028", "text": "getPortalUrl (portalOptions = {}) {\n const portalHostname = portalOptions.portalHostname || this.get('session.portalHostname');\n let host;\n if (/^\\./.test(portalHostname)) {\n host = portalHostname;\n } else if (/^https?:\\/\\//.test(portalHostname)) {\n host = portalHostname;\n } else {\n host = `https://${portalHostname}`;\n }\n\n if (this.get('session.portal.isPortal')) {\n return this.fixUrl(host, this.get('session.portal'), location.protocol);\n } else {\n return host;\n }\n }", "title": "" }, { "docid": "5f194fd88eecb1e8a87ddfecbb027c73", "score": "0.58421916", "text": "function Portal({\n children,\n rendererId\n}) {\n const {\n 0: containerEl\n } = Object(external_react_[\"useState\"])(document.createElement('div'));\n Object(external_react_[\"useEffect\"])(() => {\n let portalRoot = document.getElementById(rendererId) || document.body;\n portalRoot.appendChild(containerEl);\n return () => portalRoot.removeChild(containerEl);\n });\n return /*#__PURE__*/external_react_dom_default.a.createPortal(children, containerEl);\n}", "title": "" }, { "docid": "3a40120767a58d01d27074acd222eb6a", "score": "0.5836823", "text": "addPortal(worldId, x1, y1, z1, x2, y2, z2, position, orientation, otherPortalId) {\n let world = this._worldModel.getWorld(worldId);\n let portals = this._portals;\n let worldToChunksToPortals = this._worldToChunksToPortals;\n\n // Check parameters.\n // Orientation should be correct.\n if (orientation !== '+' && orientation !== '-' && orientation !== 'both') return;\n // Portal must be orthogonal an axis: exactly one block coordinate in common.\n let bx = x1 === x2, by = y1 === y2, bz = z1 === z2;\n let sum = bx + by + bz;\n if (sum !== 1 && sum !== 2) {\n console.log('Portal not axis-aligned: ' + sum);\n return;\n }\n // Portal minimal size.\n\n // Check chunks.\n let coords1 = world.getChunkCoordinates(x1, y1, z1);\n let coords2 = world.getChunkCoordinates(x2, y2, z2);\n // Must be on one same chunk. TODO [LONG-TERM] spawn them across chunks.\n let chunk1 = world.getChunk(...coords1);\n let chunk2 = world.getChunk(...coords2);\n if (chunk1 && chunk1 !== chunk2) return;\n\n let portalId = CollectionUtils.generateId(portals);\n var portal = new Portal(worldId, portalId, [x1, y1, z1], [x2, y2, z2], position, orientation, chunk1);\n\n let chunkId = chunk1.chunkId;\n portals.set(portalId, portal);\n let wtpc = worldToChunksToPortals.get(worldId), ctpc;\n if (wtpc) {\n ctpc = wtpc.get(chunkId);\n if (ctpc) {\n ctpc.add(portalId);\n }\n else {\n ctpc = new Set();\n ctpc.add(portalId);\n wtpc.set(chunkId, ctpc);\n }\n } else {\n wtpc = new Map();\n ctpc = new Set();\n ctpc.add(portalId);\n wtpc.set(chunkId, ctpc);\n worldToChunksToPortals.set(worldId, wtpc);\n }\n\n if (otherPortalId) {\n this.addKnot(portalId, otherPortalId);\n } else {\n let newWorld = this._worldModel.addWorld();\n if (!newWorld) {\n console.log('Failed to create a new world.');\n return;\n }\n\n // Force generation (1 chunk) and add portal.\n let xS = newWorld.xSize, yS = newWorld.ySize, zS = newWorld.zSize;\n // TODO [HIGH] Maybe it's not right to generate chunks here.\n let ijk = chunkId.split(',');\n let newChunk = WorldGenerator.generateFlatChunk(xS, yS, zS, ...ijk, newWorld);\n newWorld.addChunk(newChunk.chunkId, newChunk);\n this.addPortal(newWorld.worldId, x1, y1, z1, x2, y2, z2, position, orientation, portalId);\n }\n\n this._cachedConnectivity = [new Map(), new Map()];\n }", "title": "" }, { "docid": "8362b36398cce61c6e5bcacf8f608d29", "score": "0.58246386", "text": "attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n }", "title": "" }, { "docid": "3966b7c1d45c598b986c4baf13903810", "score": "0.57935536", "text": "function Portal({\n children,\n rendererId\n}) {\n const {\n 0: containerEl\n } = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useState\"])(document.createElement('div'));\n Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(() => {\n let portalRoot = document.getElementById(rendererId) || document.body;\n portalRoot.appendChild(containerEl);\n return () => portalRoot.removeChild(containerEl);\n });\n return /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.createPortal(children, containerEl);\n}", "title": "" }, { "docid": "1e7934a14da1ced43c92ede7ff97d658", "score": "0.5786576", "text": "attachTemplatePortal(portal) {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n this.setDisposeFn((() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }", "title": "" }, { "docid": "1e7934a14da1ced43c92ede7ff97d658", "score": "0.5786576", "text": "attachTemplatePortal(portal) {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n this.setDisposeFn((() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }", "title": "" }, { "docid": "1e7934a14da1ced43c92ede7ff97d658", "score": "0.5786576", "text": "attachTemplatePortal(portal) {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n this.setDisposeFn((() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }", "title": "" }, { "docid": "1e7934a14da1ced43c92ede7ff97d658", "score": "0.5786576", "text": "attachTemplatePortal(portal) {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n this.setDisposeFn((() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }", "title": "" }, { "docid": "6e964b4ea59cd435264cac00b48436aa", "score": "0.57861865", "text": "attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n }", "title": "" }, { "docid": "6e964b4ea59cd435264cac00b48436aa", "score": "0.57861865", "text": "attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n }", "title": "" }, { "docid": "6e964b4ea59cd435264cac00b48436aa", "score": "0.57861865", "text": "attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n }", "title": "" }, { "docid": "6e964b4ea59cd435264cac00b48436aa", "score": "0.57861865", "text": "attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n }", "title": "" }, { "docid": "6e964b4ea59cd435264cac00b48436aa", "score": "0.57861865", "text": "attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n }", "title": "" }, { "docid": "6e964b4ea59cd435264cac00b48436aa", "score": "0.57861865", "text": "attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n }", "title": "" }, { "docid": "6e964b4ea59cd435264cac00b48436aa", "score": "0.57861865", "text": "attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalOutlet.\n const viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector);\n // If we're using a view container that's different from the injected one (e.g. when the portal\n // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered\n // inside of the alternate view container.\n if (viewContainerRef !== this._viewContainerRef) {\n this._getRootNode().appendChild(ref.hostView.rootNodes[0]);\n }\n super.setDisposeFn(() => ref.destroy());\n this._attachedPortal = portal;\n this._attachedRef = ref;\n this.attached.emit(ref);\n return ref;\n }", "title": "" }, { "docid": "703b35a3f0f3643db66497a262f6b3e8", "score": "0.57671356", "text": "attachTemplatePortal(portal) {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n this.setDisposeFn((() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n this._attachedPortal = portal;\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }", "title": "" }, { "docid": "703b35a3f0f3643db66497a262f6b3e8", "score": "0.57671356", "text": "attachTemplatePortal(portal) {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n this.setDisposeFn((() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n this._attachedPortal = portal;\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }", "title": "" }, { "docid": "703b35a3f0f3643db66497a262f6b3e8", "score": "0.57671356", "text": "attachTemplatePortal(portal) {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n // Note that we want to detect changes after the nodes have been moved so that\n // any directives inside the portal that are looking at the DOM inside a lifecycle\n // hook won't be invoked too early.\n viewRef.detectChanges();\n this.setDisposeFn((() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n this._attachedPortal = portal;\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }", "title": "" }, { "docid": "ebbb2714252e5afef0dda05203a8a8fc", "score": "0.57420063", "text": "function WebAdminBodyPortal ({\n children\n}) {\n return ReactDOM.createPortal(children, getWebAdminDocumentBody())\n}", "title": "" }, { "docid": "e191cacc2e20601dd35840707eb3aa95", "score": "0.5705282", "text": "attachComponentPortal(portal) {\n this._validatePortalAttached();\n this._setPanelClass();\n this._savePreviouslyFocusedElement();\n return this._portalOutlet.attachComponentPortal(portal);\n }", "title": "" }, { "docid": "a7f7914266cfe6f4e8735ca1a67d7ed4", "score": "0.5691628", "text": "attachComponentPortal(portal) {\n this._validatePortalAttached();\n this._setPanelClass();\n this._savePreviouslyFocusedElement();\n return this._portalOutlet.attachComponentPortal(portal);\n }", "title": "" }, { "docid": "1cbf6e6aa3accc6b457b851eb7d4c7da", "score": "0.5691404", "text": "attachComponentPortal(portal) {\n this._assertNotAttached();\n this._applySnackBarClasses();\n return this._portalOutlet.attachComponentPortal(portal);\n }", "title": "" }, { "docid": "1cbf6e6aa3accc6b457b851eb7d4c7da", "score": "0.5691404", "text": "attachComponentPortal(portal) {\n this._assertNotAttached();\n this._applySnackBarClasses();\n return this._portalOutlet.attachComponentPortal(portal);\n }", "title": "" }, { "docid": "143a9261565cca0665a42ff8972b35ed", "score": "0.5678778", "text": "attachTemplatePortal(portal) {\n let viewContainer = portal.viewContainerRef;\n let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n viewRef.detectChanges();\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalOutlet the view can be added everywhere in the DOM\n // (e.g Overlay Container) To move the view to the specified host element. We just\n // re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));\n this.setDisposeFn((() => {\n let index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }", "title": "" }, { "docid": "0d03c94008211bc121b45b8edaaebf47", "score": "0.5675036", "text": "attachTemplatePortal(portal) {\n this._validatePortalAttached();\n this._setPanelClass();\n this._savePreviouslyFocusedElement();\n return this._portalOutlet.attachTemplatePortal(portal);\n }", "title": "" }, { "docid": "d0b067faaf216c28063ae27dd3d939a1", "score": "0.567481", "text": "attachTemplatePortal(portal) {\n this._assertNotAttached();\n this._applySnackBarClasses();\n const viewRef = this._portalOutlet.attachTemplatePortal(portal);\n this._applyLabelClass();\n return viewRef;\n }", "title": "" }, { "docid": "a138c7fc9a4cc604c74b898bf41b9fb5", "score": "0.5662717", "text": "attachTemplatePortal(portal) {\n this._assertNotAttached();\n this._applySnackBarClasses();\n return this._portalOutlet.attachTemplatePortal(portal);\n }", "title": "" }, { "docid": "a138c7fc9a4cc604c74b898bf41b9fb5", "score": "0.5662717", "text": "attachTemplatePortal(portal) {\n this._assertNotAttached();\n this._applySnackBarClasses();\n return this._portalOutlet.attachTemplatePortal(portal);\n }", "title": "" }, { "docid": "44132d348af07fd0119dd51dce8d8391", "score": "0.56512034", "text": "attachTemplatePortal(portal) {\n this._validatePortalAttached();\n this._setPanelClass();\n this._savePreviouslyFocusedElement();\n return this._portalOutlet.attachTemplatePortal(portal);\n }", "title": "" }, { "docid": "ec7bfe1258afe11f09d2938b6e0cbe97", "score": "0.5576483", "text": "portals(x1,y1,x2,y2){\r\n this.set(x1,y1,T.PortalA(this.portalID, x2,y2));\r\n return this.set(x2,y2,T.PortalB(this.portalID++,x1,y1));\r\n\r\n }", "title": "" }, { "docid": "9d204492b1af69bbada96af5741ab32b", "score": "0.5550962", "text": "getPortalRestUrl (portalOptions = {}) {\n const baseUrl = this.getPortalUrl(portalOptions);\n return `${baseUrl}/sharing/rest`;\n }", "title": "" }, { "docid": "0583ac4de82e909eec1bb30ecc2706a0", "score": "0.5536313", "text": "injectFakePortal() {\n if (!Onboarding.isConfluxPortalInstalled()) {\n window.conflux = { enalbe: this.startOnboarding }\n }\n }", "title": "" }, { "docid": "c8f70990d87617a02fb0f7938f5856db", "score": "0.544201", "text": "function throwNullPortalOutletError() {\n throw Error('Attempting to attach a portal to a null PortalOutlet');\n }", "title": "" }, { "docid": "c531cf222150ad9139e8d272a1de26a7", "score": "0.54219925", "text": "function createPortal$1(children,containerInfo,// TODO: figure out the API for cross-renderer implementation.\nimplementation){var key=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return{// This tag allow us to uniquely identify this as a React Portal\n$$typeof:REACT_PORTAL_TYPE,key:key==null?null:''+key,children:children,containerInfo:containerInfo,implementation:implementation};}// TODO: this is special because it gets imported during build.", "title": "" }, { "docid": "c531cf222150ad9139e8d272a1de26a7", "score": "0.54219925", "text": "function createPortal$1(children,containerInfo,// TODO: figure out the API for cross-renderer implementation.\nimplementation){var key=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;return{// This tag allow us to uniquely identify this as a React Portal\n$$typeof:REACT_PORTAL_TYPE,key:key==null?null:''+key,children:children,containerInfo:containerInfo,implementation:implementation};}// TODO: this is special because it gets imported during build.", "title": "" }, { "docid": "79aa1bdadd2b9bd6facdca9163ce6564", "score": "0.54044926", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' + 'a ComponentPortal or a TemplatePortal.');\n }", "title": "" }, { "docid": "a28d2794354ae61fb05ef9c62ad19280", "score": "0.53912085", "text": "attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n }", "title": "" }, { "docid": "44c93a75e5d293049c14454bf80c25c0", "score": "0.5358566", "text": "attachComponentPortal(portal) {\n this._assertNotAttached();\n this._applySnackBarClasses();\n const componentRef = this._portalOutlet.attachComponentPortal(portal);\n this._applyLabelClass();\n return componentRef;\n }", "title": "" }, { "docid": "4d42f720d3ac047c5e5fddb8baf8665a", "score": "0.53570545", "text": "click(e) {\n let target = e.target;\n var eventPath = this.normalizeEventPath(e);\n // support walking the path in order to find the link clicked\n if (target.tagName !== \"A\") {\n eventPath.forEach((item) => {\n if (item.tagName === \"A\") {\n target = item;\n }\n });\n }\n\n if (target && target.getAttribute(\"href\") != null) {\n // progressive enhancement, if this class exists, can the link click\n if (\"HTMLPortalElement\" in window) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n // Adding some styles with transitions\n const style = document.createElement(\"style\");\n const initialScale = 0.2;\n style.innerHTML = `\n portal {\n position:fixed;\n width: 100%;\n height: 100%;\n opacity: 0;\n box-shadow: 0 0 20px 10px #999;\n transform: scale(${initialScale});\n bottom: calc(20px + 50% * ${initialScale} - 50%);\n right: calc(20px + 50% * ${initialScale} - 50%);\n z-index: 10000;\n }\n .portal-transition {\n transition:\n transform 0.4s,\n bottom 0.7s,\n left 0.7s,\n opacity 1.0s;\n }\n @media (prefers-reduced-motion: reduce) {\n .portal-transition {\n transition: all 0.001s;\n }\n }\n .portal-reveal {\n transform: scale(1.0);\n bottom: 0px;\n left: 0px;\n }\n .fade-in {\n opacity: 1.0;\n }\n `;\n const portal = document.createElement(\"portal\");\n // Let's navigate into the WICG Portals spec page\n portal.src = target.getAttribute(\"href\");\n // Add a class that defines the transition. Consider using\n // `prefers-reduced-motion` media query to control the animation.\n // https://developers.google.com/web/updates/2019/03/prefers-reduced-motion\n portal.classList.add(\"portal-transition\");\n portal.addEventListener(\"transitionend\", (evt) => {\n if (evt.propertyName == \"bottom\") {\n // Activate the portal once the transition has completed\n portal.activate();\n }\n });\n document.body.appendChild(style, portal);\n // Waiting for the page to load.\n // using setTimeout is a suboptimal way and it's best to fade-in\n // when receiving a load complete message from the portal via postMessage\n setTimeout((_) => portal.classList.add(\"fade-in\"), 250);\n setTimeout((_) => portal.classList.add(\"portal-reveal\"), 500);\n }\n }\n }", "title": "" }, { "docid": "04ec3dd2bb630ff2d42e7daa7507798e", "score": "0.5342649", "text": "function ModalPortal(props) {\n var children = props.children;\n var elementRef = React.useRef(null);\n if (_canUseDom.default && !elementRef.current) {\n var element = document.createElement('div');\n if (element && document.body) {\n document.body.appendChild(element);\n elementRef.current = element;\n }\n }\n React.useEffect(() => {\n if (_canUseDom.default) {\n return () => {\n if (document.body && elementRef.current) {\n document.body.removeChild(elementRef.current);\n elementRef.current = null;\n }\n };\n }\n }, []);\n return elementRef.current && _canUseDom.default ? /*#__PURE__*/_reactDom.default.createPortal(children, elementRef.current) : null;\n}", "title": "" }, { "docid": "bd45074c126f8e19a396773fa53dfbec", "score": "0.53409964", "text": "attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n }", "title": "" }, { "docid": "bd45074c126f8e19a396773fa53dfbec", "score": "0.53409964", "text": "attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n }", "title": "" }, { "docid": "bd45074c126f8e19a396773fa53dfbec", "score": "0.53409964", "text": "attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n }", "title": "" }, { "docid": "bd45074c126f8e19a396773fa53dfbec", "score": "0.53409964", "text": "attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n }", "title": "" }, { "docid": "bd45074c126f8e19a396773fa53dfbec", "score": "0.53409964", "text": "attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n }", "title": "" }, { "docid": "bd45074c126f8e19a396773fa53dfbec", "score": "0.53409964", "text": "attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n }", "title": "" }, { "docid": "bd45074c126f8e19a396773fa53dfbec", "score": "0.53409964", "text": "attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._attachedPortal = portal;\n this._attachedRef = viewRef;\n this.attached.emit(viewRef);\n return viewRef;\n }", "title": "" }, { "docid": "9520b0de20956710338580bfd22ab8fc", "score": "0.533336", "text": "attachComponentPortal(portal) {\n if (this.portalOutlet.hasAttached()) {\n throwPopoverContentAlreadyAttachedError(this.options.name);\n }\n this.beforeAttachPortal();\n return this.portalOutlet.attachComponentPortal(portal);\n }", "title": "" }, { "docid": "aaa05d47d480b5a4ebea8a7ba5489b7a", "score": "0.53146005", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' + 'a ComponentPortal or a TemplatePortal.');\n }", "title": "" }, { "docid": "f9a9ac6df08461eb63d2a1c778637901", "score": "0.5308492", "text": "renderPortal() {\n console.log(\n ' ------------------------------ renderPortal ------------------------------ '\n );\n console.log(MarekedWordReact);\n console.log(MarekedWordReact.blotName);\n console.log(MarekedWordReact.refs);\n console.log(this.id);\n console.log(MarekedWordReact.refs[this.id]);\n\n return createPortal(\n <MarekedWordReactComponent\n type={MarekedWordReact.blotName}\n ref={MarekedWordReact.refs[this.id]}\n id={this.id}\n data={this.data}\n />,\n this.domNode\n );\n }", "title": "" }, { "docid": "4fc7a6c93d3a81bc5e719509445a8930", "score": "0.5278945", "text": "function throwNullPortalOutletError() {\n throw Error('Attempting to attach a portal to a null PortalOutlet');\n }", "title": "" }, { "docid": "89327fed6417576806093a1c2704c53c", "score": "0.52571094", "text": "function defaultPortalUrl() {\n return exports.defaultSkynetPortalUrl;\n}", "title": "" }, { "docid": "5999463e1109142b10ab7888e27703bf", "score": "0.52241015", "text": "function setPortalAttribute(element) {\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\n}", "title": "" }, { "docid": "ccb1b4cf42a59442d7cc882fbdc8ebf8", "score": "0.5215032", "text": "function setPortalAttribute(element) {\r\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\r\n}", "title": "" }, { "docid": "ccb1b4cf42a59442d7cc882fbdc8ebf8", "score": "0.5215032", "text": "function setPortalAttribute(element) {\r\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\r\n}", "title": "" }, { "docid": "ccb1b4cf42a59442d7cc882fbdc8ebf8", "score": "0.5215032", "text": "function setPortalAttribute(element) {\r\n element.setAttribute(DATA_PORTAL_ATTRIBUTE, 'true');\r\n}", "title": "" }, { "docid": "6b5f3e4efe66c3327ccce84af5076f25", "score": "0.5190039", "text": "function ModalPortal(props) {\n var children = props.children;\n var elementRef = (0, _react.useRef)(null);\n\n if (_ExecutionEnvironment.canUseDOM && !elementRef.current) {\n var element = document.createElement('div');\n\n if (element && document.body) {\n document.body.appendChild(element);\n elementRef.current = element;\n }\n }\n\n (0, _react.useEffect)(function () {\n if (_ExecutionEnvironment.canUseDOM) {\n return function () {\n if (document.body && elementRef.current) {\n document.body.removeChild(elementRef.current);\n elementRef.current = null;\n }\n };\n }\n }, []);\n return elementRef.current && _ExecutionEnvironment.canUseDOM ? /*#__PURE__*/_reactDom.default.createPortal(children, elementRef.current) : null;\n}", "title": "" }, { "docid": "dc5faec475c9b933e394aac7b2c60ba8", "score": "0.5189962", "text": "attachComponentPortal(portal) {\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n let componentRef;\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector);\n this.setDisposeFn(() => componentRef.destroy());\n }\n else {\n componentRef = componentFactory.create(portal.injector || this._defaultInjector);\n this._appRef.attachView(componentRef.hostView);\n this.setDisposeFn(() => {\n this._appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this.outletElement.appendChild(this._getComponentRootNode(componentRef));\n return componentRef;\n }", "title": "" }, { "docid": "dc5faec475c9b933e394aac7b2c60ba8", "score": "0.5189962", "text": "attachComponentPortal(portal) {\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n let componentRef;\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector);\n this.setDisposeFn(() => componentRef.destroy());\n }\n else {\n componentRef = componentFactory.create(portal.injector || this._defaultInjector);\n this._appRef.attachView(componentRef.hostView);\n this.setDisposeFn(() => {\n this._appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this.outletElement.appendChild(this._getComponentRootNode(componentRef));\n return componentRef;\n }", "title": "" }, { "docid": "dc5faec475c9b933e394aac7b2c60ba8", "score": "0.5189962", "text": "attachComponentPortal(portal) {\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n let componentRef;\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector);\n this.setDisposeFn(() => componentRef.destroy());\n }\n else {\n componentRef = componentFactory.create(portal.injector || this._defaultInjector);\n this._appRef.attachView(componentRef.hostView);\n this.setDisposeFn(() => {\n this._appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this.outletElement.appendChild(this._getComponentRootNode(componentRef));\n return componentRef;\n }", "title": "" }, { "docid": "dc5faec475c9b933e394aac7b2c60ba8", "score": "0.5189962", "text": "attachComponentPortal(portal) {\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n let componentRef;\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector);\n this.setDisposeFn(() => componentRef.destroy());\n }\n else {\n componentRef = componentFactory.create(portal.injector || this._defaultInjector);\n this._appRef.attachView(componentRef.hostView);\n this.setDisposeFn(() => {\n this._appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this.outletElement.appendChild(this._getComponentRootNode(componentRef));\n return componentRef;\n }", "title": "" }, { "docid": "dc5faec475c9b933e394aac7b2c60ba8", "score": "0.5189962", "text": "attachComponentPortal(portal) {\n const resolver = portal.componentFactoryResolver || this._componentFactoryResolver;\n const componentFactory = resolver.resolveComponentFactory(portal.component);\n let componentRef;\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector);\n this.setDisposeFn(() => componentRef.destroy());\n }\n else {\n componentRef = componentFactory.create(portal.injector || this._defaultInjector);\n this._appRef.attachView(componentRef.hostView);\n this.setDisposeFn(() => {\n this._appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this.outletElement.appendChild(this._getComponentRootNode(componentRef));\n return componentRef;\n }", "title": "" }, { "docid": "943905a6e87a0732d7e4e9d50c2644bd", "score": "0.5180242", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}", "title": "" }, { "docid": "943905a6e87a0732d7e4e9d50c2644bd", "score": "0.5180242", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}", "title": "" }, { "docid": "943905a6e87a0732d7e4e9d50c2644bd", "score": "0.5180242", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}", "title": "" }, { "docid": "943905a6e87a0732d7e4e9d50c2644bd", "score": "0.5180242", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}", "title": "" }, { "docid": "943905a6e87a0732d7e4e9d50c2644bd", "score": "0.5180242", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}", "title": "" }, { "docid": "943905a6e87a0732d7e4e9d50c2644bd", "score": "0.5180242", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}", "title": "" }, { "docid": "943905a6e87a0732d7e4e9d50c2644bd", "score": "0.5180242", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}", "title": "" }, { "docid": "943905a6e87a0732d7e4e9d50c2644bd", "score": "0.5180242", "text": "function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}", "title": "" } ]
f3ce262892501121d2dd9a7dcf15570d
fallback to ajax if older browser
[ { "docid": "456e0c229d84a0835ba4746131e99300", "score": "0.0", "text": "function makeAjaxRequest(_ref) {\n var url = _ref.url,\n method = _ref.method,\n body = _ref.body,\n headers = _ref.headers,\n isForm = _ref.isForm;\n return new Promise(function (resolve, reject) {\n var params = {\n url: url,\n method: method,\n data: body,\n success: resolve,\n error: reject\n };\n\n if (isForm) {\n params.contentType = false; // tell jQuery not to process the data\n\n params.processData = false; // tell jQuery not to set contentType\n } else {\n params.headers = headers;\n }\n\n $.ajax(params);\n });\n }", "title": "" } ]
[ { "docid": "bce398cd236d2baa9dfdd80b078202eb", "score": "0.7540237", "text": "function browserSupportsAjax()\n {\n if (typeof XMLHttpRequest == \"undefined\" && typeof ActiveXObject == \"undefined\" && window.createRequest == \"undefined\")\n {\n return false;\n }\n return true\n }", "title": "" }, { "docid": "e963ba50c3d76d732a2c3c52c09fe107", "score": "0.66238934", "text": "function setup_ajax(){\n\n\ttry{\n\t\n\t\txmlHttp=new XMLHttpRequest();\n\t\t\n\t}catch (e){ // Internet Explorer \n\n\t\ttry{\n\t \t \t\n\t\t\txmlHttp=new ActiveXObject(\"Msxml2.XMLHTTP\");\n \n\t\t\t}catch (e){ \n\t\t\t\n\t\ttry{ \n\t\t\t\t\t\n\t\t\txmlHttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t\t\n\t \t}catch (e){\n\t\t\t\t\n\t\t\talert(AJAX_FAIL);\n\t\t\treturn false;\n\t\t} \n\t } \n\t}\n}", "title": "" }, { "docid": "b089e4531b9e1e75680e767c3bd33ab6", "score": "0.6615341", "text": "function check_ajax_version(){\n\tvar version = false;\n\tvar ie_versions = [\"MSXML2.XMLHTTP.6.0\", \"MSXML2.XMLHTTP.3.0\", \"Microsoft.XMLHTTP\"];\n\tfor(var i = 0; i < ie_versions.length; i++)\n\t{\n\t\ttry\n\t\t{\n\t\t\tversion = new ActiveXObject(ie_versions[i]);\n\t\t\tbreak;\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t}\n\tif(version == false)\n\t{\n\t\tversion = new XMLHttpRequest();\n\t}\n\telse\n\t{\n\t\tversion = version;\n\t}\n \treturn version;\n}", "title": "" }, { "docid": "c8bf615ebe7b1ce9d1226093d79adf38", "score": "0.6449491", "text": "function check_is_ajax($script) {\n $isAjax = isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND\n strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest';\n if(!$isAjax) {\n trigger_error('Access denied - not an AJAX request...' . ' (' . $script . ')', E_USER_ERROR);\n }\n}", "title": "" }, { "docid": "babc6a73dcc4505babe852d60178be16", "score": "0.6409007", "text": "sendAjaxQuiet(request) {\n return this.sendAjax(request, true);\n }", "title": "" }, { "docid": "e5654a3251fd0683715ba3f895af7a47", "score": "0.63660264", "text": "function ajaxRequest() {\n var activexmodes = [\"Msxml2.XMLHTTP\", \"Microsoft.XMLHTTP\"] //activeX versions to check for in IE\n if (window.ActiveXObject) { //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)\n \tfor (var i = 0; i < activexmodes.length; i++) {\n \t\ttry {\n \t\t\treturn new ActiveXObject(activexmodes[i])\n \t\t} catch (e) {\n //suppress error\n }\n }\n } else if (window.XMLHttpRequest) // if Mozilla, Safari etc\n return new XMLHttpRequest()\n else\n \treturn false\n }", "title": "" }, { "docid": "baff350fa73d1ea7b5a2d15fd03ba181", "score": "0.6294531", "text": "function AjaxCall () {}", "title": "" }, { "docid": "93d3c4286d74795526a23ec08d9c366e", "score": "0.62858266", "text": "function getXmlHttpRequestObject() {\n if (window.XMLHttpRequest) {\n return new XMLHttpRequest();\n } else if (window.ActiveXObject) {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n } else {\n alert(\n \"Your Browser does not support AJAX!\\nIt's about time to upgrade don't you think?\"\n );\n }\n \n if (!Modernizr.promises) {\n alert(\n \"Your Browser does not support modern versions of JavaScript!\\nIt's about time to upgrade don't you think?\"\n );\n }\n }", "title": "" }, { "docid": "301ded189df321728bfedc7a903ad42c", "score": "0.628229", "text": "function ajaxRequest()\n{\n\tvar activexmodes=[\"Msxml2.XMLHTTP\", \"Microsoft.XMLHTTP\"] //activeX versions to check for in IE\n\tif (window.ActiveXObject) //Test for support for ActiveXObject in IE first (as XMLHttpRequest in IE7 is broken)\n\t{ \n\t\tfor (var i=0; i<activexmodes.length; i++)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn new ActiveXObject(activexmodes[i])\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t\t//suppress error\n\t\t\t}\n\t\t}\n\t}\n\telse if (window.XMLHttpRequest) // if Mozilla, Safari etc\n\t{\n\t\treturn new XMLHttpRequest()\n\t}\n\telse\n\t{\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "9fccf020014ad18fabfc2da36835dd1b", "score": "0.625713", "text": "function getAjax(){\r\n\tvar ajaxRequest; // The variable that makes Ajax possible!\t\r\n\ttry\r\n\t\t{\r\n\t\t// Opera 8.0+, Firefox, Safari\r\n\t\tajaxRequest = new XMLHttpRequest();\r\n\t\t} \r\n\tcatch (e)\r\n\t\t{\r\n\t\t// Internet Explorer Browsers\r\n\t\ttry\r\n\t\t\t{\r\n\t\t\tajaxRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n\t\t\t} \r\n\t\tcatch (e) \r\n\t\t\t{\r\n\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\tajaxRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t\t\t} \r\n\t\t\tcatch (e)\r\n\t\t\t\t{\r\n\t\t\t\t// Something went wrong\r\n\t\t\t\tshowError(\"Your browser broke!\");\r\n\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\treturn ajaxRequest;\r\n}", "title": "" }, { "docid": "84a61e7cbb46a2a74b4bd96c0ceb205f", "score": "0.6228828", "text": "function getAjax() {\r\n var XmlHttp;\r\n\r\n //Creating object of XMLHTTP in IE\r\n try {\r\n XmlHttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n }\r\n catch (e) {\r\n try {\r\n XmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n catch (oc) {\r\n XmlHttp = null;\r\n }\r\n }\r\n //Creating object of XMLHTTP in Mozilla and Safari \r\n if (!XmlHttp && typeof XMLHttpRequest != \"undefined\") {\r\n XmlHttp = new XMLHttpRequest();\r\n }\r\n return XmlHttp;\r\n}", "title": "" }, { "docid": "3d52c7a2dd89cec5f5381dd9c57fc5c0", "score": "0.6221696", "text": "function GetXmlHttpObject()\n{\nif(window.XMLHttpRequest)\n{\nreturn new XMLHttpRequest();\n}\nif(window.ActiveXObject)\n{\nreturn new ActiveXObject(\"Microsoft.XMLHTTP\");\n}\nelse\n{alert(\"Maaf browser anda tidak mendukung ajax.\");}\nreturn false;\n}", "title": "" }, { "docid": "676dbc24bbc2b64a04fa4674a29895ed", "score": "0.6208659", "text": "function nuevoAjax() { \n var xmlhttp=false; \n try { \n xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\"); \n } \n catch (e) { \n try { \n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\"); \n } \n catch (e) { \n xmlhttp = false; \n } \n } \n if (!xmlhttp && typeof XMLHttpRequest!='undefined') { \n xmlhttp = new XMLHttpRequest(); \n } \n return xmlhttp; \n}", "title": "" }, { "docid": "676dbc24bbc2b64a04fa4674a29895ed", "score": "0.6208659", "text": "function nuevoAjax() { \n var xmlhttp=false; \n try { \n xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\"); \n } \n catch (e) { \n try { \n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\"); \n } \n catch (e) { \n xmlhttp = false; \n } \n } \n if (!xmlhttp && typeof XMLHttpRequest!='undefined') { \n xmlhttp = new XMLHttpRequest(); \n } \n return xmlhttp; \n}", "title": "" }, { "docid": "8d8e4db344a79314185ba9a3a2683f33", "score": "0.61431414", "text": "function getXmlHttpRequestObject() { //Gets the browser specific XmlHttpRequest Object\n if (window.XMLHttpRequest) {\n return new XMLHttpRequest(); \t//Not IE\n } else if (window.ActiveXObject) {\n return new ActiveXObject(\"Microsoft.XMLHTTP\"); //IE\n } else {\n alert(\"Your browser doesn't want to use AJAX\"); //Displays error message\n }\n}", "title": "" }, { "docid": "895a8c77b1811b82711f1589095c2a90", "score": "0.61416703", "text": "function canUseAjax(){\n\tif(createXHR()){ //javascript actif\n\t\treturn true;\n\t}\n\telse {\n\t\t//alert(\"Vous devez activer javascript pour utiliser la shoutbox !\");\n\t\tdocument.getElementById(\"shoutbox\").style.display = 'none';\n\t\t//document.getElementById(\"shoutbox\").style.visibility = 'hidden';\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "96941596341889319d7738cb111e13e6", "score": "0.612585", "text": "function xhr_func() {\n if (_xhr_func)\n return _xhr_func;\n _xhr_func = function(a,b,c,fn){console.log('No XHR');fn('No XHR Support');}\n if (false) ;\n /* jquery ajax */\n else if (window.XDomainRequest)\n _xhr_func = _ms_XDomainRequest_no_cookies;\n else if (window.XMLHttpRequest)\n _xhr_func = _xhr;\n return _xhr_func;\n }", "title": "" }, { "docid": "608126f19c575ec8b7b0bb92f108d3ac", "score": "0.6124003", "text": "function createAjax() {\n // The variable that makes Ajax possible!\n var ajaxRequest; \n try {\n // Opera 8.0+, Firefox, Safari\n ajaxRequest = new XMLHttpRequest();\n } catch (e) {\n \n // Internet Explorer Browsers\n try {\n ajaxRequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n \n try {\n ajaxRequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {\n \n // Something went wrong\n alert(\"Your browser broke!\");\n return false;\n }\n }\n }\n// If everything is allright, return ajaxRequest\nreturn ajaxRequest;\n}", "title": "" }, { "docid": "eebe7ab006cad7985d8007a1e888a3b7", "score": "0.61197424", "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": "265d2bfa451dd78676f0d8491301f6e0", "score": "0.61152935", "text": "function nuevoAjax() {\n var xmlhttp = false;\n try {\n // Creacion del objeto AJAX para navegadores no IE Ejemplo:Mozilla, Safari \n xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n // Creacion del objet AJAX para IE\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (E) {\n if (!xmlhttp && typeof XMLHttpRequest != 'undefined')\n xmlhttp = new XMLHttpRequest();\n }\n }\n return xmlhttp;\n}", "title": "" }, { "docid": "c84899c330e07c1aebdf2df1ac051edb", "score": "0.6106928", "text": "function nuevoAjax()\n{\n var xmlhttp = false;\n try {\n // Creacion del objeto AJAX para navegadores no IE Ejemplo:Mozilla, Safari \n xmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n // Creacion del objet AJAX para IE\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (E) {\n if (!xmlhttp && typeof XMLHttpRequest != 'undefined')\n xmlhttp = new XMLHttpRequest();\n }\n }\n return xmlhttp;\n}", "title": "" }, { "docid": "1e091f392a68b0008754c69a1fe6d9b9", "score": "0.6073096", "text": "function getRequest() {\r\n\tif(window.XMLHttpRequest) {\r\n\t\treturn new XMLHttpRequest();\r\n\t} else if(window.ActiveXObject) {\r\n\t\treturn new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t} else {\r\n\t\talert(\"Tu navegador no soporta AJAX\"); \r\n\t}\r\n}//getRequest", "title": "" }, { "docid": "6526b466789bcda5fadee758f42e87df", "score": "0.60703444", "text": "function getXMLHTTPRequest() {\r\n if (window.XMLHttpRequest) {\r\n //code for odern browsers\r\n return new XMLHttpRequest();\r\n } else {\r\n //code for IE browser\r\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n}", "title": "" }, { "docid": "05f02c805d670595fd9f7f8bef9cbeac", "score": "0.60558", "text": "function objetoAjax(){ \r\n\tvar xmlhttp=false;\r\n\ttry {\r\n\t\txmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n\t} catch (e) {\r\n\t\ttry {\r\n\t\t xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t\t} catch (E) {\r\n\t\t\txmlhttp = false;\r\n \t\t}\r\n\t}\r\n\r\n\tif (!xmlhttp && typeof XMLHttpRequest!='undefined') {\r\n\t\txmlhttp = new XMLHttpRequest();\r\n\t}\r\n\treturn xmlhttp;\r\n}", "title": "" }, { "docid": "2e8eaf04a230d868e074c3100af549b3", "score": "0.60472685", "text": "function AjaxError() {\n }", "title": "" }, { "docid": "fb7a6daa772315503495460bcfe0a728", "score": "0.6029758", "text": "function ajaxInit()\n{\n /* ajax on <a href=\"#\"></a> */\n $('a.ajax').unbind('click').click(function(event) {\n event.preventDefault();\n ajaxOnAnchor(this);\n });\n\n /* ajax on <form action=\"\"></form> */\n $('form.ajax').submit(function(event) {\n event.preventDefault();\n ajaxOnForm(this);\n });\n\n /* ajax on <button type=\"\"></form> */\n $('button.ajax').unbind('click').click(function(event) {\n event.preventDefault();\n ajaxOnButton(this);\n });\n} // ajaxInit()", "title": "" }, { "docid": "b96aec1852804cc18367e4a2d9fab6c5", "score": "0.60261285", "text": "function ajaxRequest() {\n\tvar request\n\t\n\ttry {\n\t\trequest = new XMLHttpRequest();\t\n\t}\n\tcatch(e1) {\n\t\ttry {\n\t\t\trequest = new ActiveXObject(\"Msxml2.XMLHTTP\");\t\n\t\t}\n\t\tcatch(e2) {\n\t\t\ttry {\n\t\t\t\trequest = new ActiveXObject(\"Microsoft.XMLHTTP\");\t\n\t\t\t}\n\t\t\tcatch(e3) {\n\t\t\t\trequest = false;\t\n\t\t\t}\n\t\t}\n\t\t\t\n\t}\n\treturn request;\n}", "title": "" }, { "docid": "e11a77cea72547f524ca4c8e1d5638d8", "score": "0.60160816", "text": "function createStandardXHR(){try{return new window.XMLHttpRequest();}catch(e){}}", "title": "" }, { "docid": "e11a77cea72547f524ca4c8e1d5638d8", "score": "0.60160816", "text": "function createStandardXHR(){try{return new window.XMLHttpRequest();}catch(e){}}", "title": "" }, { "docid": "64f856b486b228d1f7baa2eb1da362de", "score": "0.60025716", "text": "function listenAjaxLoad()\n{\n $('.loadajax').unbind('click');\n $('.loadajax').click(function () {\n var config = reactivateJsFunctionsFromJSONconversion($.parseJSON($(this).attr('data')));\n var url = $(this).attr('href');\n if(config.applyto == false) {\n $.get(url, function(data) {\n $.pushMessage('<span style=\"font-weight:normal;\">' + data.responce + '</span>', {\n header: data.heading,\n life: 5000\n //sticky: true\n });\n updateAllApplicableElements('table');\n updateAllApplicableElements('div');\n }, 'json');\n } else {\n\n }\n return false;\n });\n}", "title": "" }, { "docid": "e50318eb1d359acb07241cb99b032306", "score": "0.5998283", "text": "function nuevoAjax()\n{ \n\tvar xmlhttp=false;\n\ttry\t{\n\t\t// Creacion del objeto AJAX para navegadores no IE Ejemplo:Mozilla, Safari \n\t\txmlhttp=new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t}catch(e){\n\t\ttry\t{\n\t\t\t// Creacion del objet AJAX para IE\n\t\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}catch(E){\n\t\t\tif (!xmlhttp && typeof XMLHttpRequest!='undefined') xmlhttp=new XMLHttpRequest();\n\t\t}\n\t}\n\treturn xmlhttp; \n}", "title": "" }, { "docid": "41dc79313ac6be31d98b5c657cf4b676", "score": "0.5993595", "text": "function defaultAJAXresultcheck(param) { //Default, normal responses to AJAX results\n\tif (param.result==\"dbfailure\") { //Server/PHP error\n\t\tnotify(\"Sorry, there was a database error - Please try again at a later time.\", \"error\");\n\t\treturn true;\n\t}\n\telse if (param.result==\"invalidinput\") {\n\t\tnotify(\"Invalid input!\",\"error\");\n\t\treturn true;\n\t}\n\telse if (param.result==\"redirect\") { //Server/PHP error\n\t\twindow.location.replace(param.redirect);\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "4b1a3e67f126d8542050773a582c3b3f", "score": "0.5993567", "text": "function objetoAjax(){\n\tvar xmlhttp=false;\n\ttry {\n\t\txmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t} catch (e) {\n\t\ttry {\n\t\t xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t} catch (E) {\n\t\t\txmlhttp = false;\n \t\t}\n\t}\n\n\tif (!xmlhttp && typeof XMLHttpRequest!='undefined') {\n\t\txmlhttp = new XMLHttpRequest();\n\t}\n\treturn xmlhttp;\n}", "title": "" }, { "docid": "4b1a3e67f126d8542050773a582c3b3f", "score": "0.5993567", "text": "function objetoAjax(){\n\tvar xmlhttp=false;\n\ttry {\n\t\txmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n\t} catch (e) {\n\t\ttry {\n\t\t xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t} catch (E) {\n\t\t\txmlhttp = false;\n \t\t}\n\t}\n\n\tif (!xmlhttp && typeof XMLHttpRequest!='undefined') {\n\t\txmlhttp = new XMLHttpRequest();\n\t}\n\treturn xmlhttp;\n}", "title": "" }, { "docid": "4c5c45c3d05df2508dff017d8c33fcb7", "score": "0.5988886", "text": "function ajaxorformload(ev) {\n var ajax_load = $(\".ajax_loading\").val();\n if (ajax_load == 'True') {\n ajaxform(ev);\n } else {\n $(\"form.js_attributes input,form.js_attributes select\").closest(\"form\").submit();\n }\n }", "title": "" }, { "docid": "31f63dd26a22e023aa4cc3ed23390f8d", "score": "0.59635115", "text": "function getXmlHttpRequest() {\n try { return new XMLHttpRequest(); }\n catch (ex) { try { return new ActiveXObject('Msxml2.XMLHTTP'); }\n catch (ex1) { try { return new ActiveXObject('Microsoft.XMLHTTP'); }\n catch(ex1) { return new ActiveXObject('Msxml2.XMLHTTP.4.0'); }\n }\n }\n}", "title": "" }, { "docid": "e824570644620789207bfd8dd6ec1ac7", "score": "0.5951291", "text": "function oldIE() {\n onSuccess(JSON.parse(req.responseText));\n }", "title": "" }, { "docid": "daebf7bee8cba5139ee00665df8a4538", "score": "0.59482926", "text": "function rm_send_dummy_ajax_request(url){\r\n var data = {'action' : 'rm_dummy_refresh'};\r\n jQuery.post (rm_ajax_url, data, function(){\r\n if(url)\r\n window.location=url;\r\n else{\r\n //jQuery(\"#rm_ajax_login\").hide();\r\n //jQuery(\"#rm_ajax_after_login\").show();\r\n }\r\n }); \r\n}", "title": "" }, { "docid": "c5b2c5ba354f736825d0980704a7232f", "score": "0.59464693", "text": "function IAjaxCarrier() {}", "title": "" }, { "docid": "01727c7fca41b9586b64465277f30a6b", "score": "0.59423625", "text": "function createStandardXHR() { // 9741\n\ttry { // 9742\n\t\treturn new window.XMLHttpRequest(); // 9743\n\t} catch( e ) {} // 9744\n} // 9745", "title": "" }, { "docid": "7015c6a863668369c4eaa4b9ae95285b", "score": "0.5919253", "text": "function isCrossOriginAjaxSupported() {\n if (isCrossOriginXhrSupported()) {\n return true;\n }\n\n return isXdrSupported();\n }", "title": "" }, { "docid": "5be87060db4cda4e322d7182cd992066", "score": "0.5918234", "text": "function fallbackPjax(options) {\n var url = $.isFunction(options.url) ? options.url() : options.url,\n method = options.type ? options.type.toUpperCase() : 'GET';\n var form = $('<form>', {\n method: method === 'GET' ? 'GET' : 'POST',\n action: url,\n style: 'display:none'\n });\n\n if (method !== 'GET' && method !== 'POST') {\n form.append($('<input>', {\n type: 'hidden',\n name: '_method',\n value: method.toLowerCase()\n }));\n }\n\n var data = options.data;\n\n if (typeof data === 'string') {\n $.each(data.split('&'), function (index, value) {\n var pair = value.split('=');\n form.append($('<input>', {\n type: 'hidden',\n name: pair[0],\n value: pair[1]\n }));\n });\n } else if (Array.isArray(data)) {\n $.each(data, function (index, value) {\n form.append($('<input>', {\n type: 'hidden',\n name: value.name,\n value: value.value\n }));\n });\n } else if (_typeof(data) === 'object') {\n var key;\n\n for (key in data) {\n form.append($('<input>', {\n type: 'hidden',\n name: key,\n value: data[key]\n }));\n }\n }\n\n $(document.body).append(form);\n form.submit();\n } // Internal: Abort an XmlHttpRequest if it hasn't been completed,", "title": "" }, { "docid": "5c324b393d88a9ea114e887d74ab359f", "score": "0.5917466", "text": "function getXmlHttpRequestObject() {\r\n\tif (window.XMLHttpRequest) {\r\n\t\treturn new XMLHttpRequest();\r\n\t} else if(window.ActiveXObject) {\r\n\t\treturn new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t} else {\r\n\t\talert(\"Your Browser Sucks!\\nIt's about time to upgrade don't you think?\");\r\n\t}\r\n}", "title": "" }, { "docid": "ec0f1dbc0e59af623309b8e38e8ed04b", "score": "0.5914869", "text": "function promisedAjax(method,url,data,options){\n var p = new promise(), e, ct;\n\n options = options ? options : {};\n\n // set content-type based on extension\n // ajax defaults to 'application/javascript'\n if(!options[\"content-type\"]){\n if((e = url.match(/(\\.\\w+)$/))){\n e = e[0].toLowerCase();\n switch(e){\n case \".html\":\n case \".htm\":\n ct = \"text/html\";\n break;\n }\n\n if(ct) options[\"content-type\"] = ct;\n }\n }\n // Resolved value/error is xhr response\n return ajax[method](url,options,data,p);\n}", "title": "" }, { "docid": "b790ed640992cc9e6d82d57a065d3f48", "score": "0.5910518", "text": "function initAjax()\r\n{\r\n\tif (window.XMLHttpRequest) {\r\n\t\treqmfc = new XMLHttpRequest(); \r\n\t} else if (window.ActiveXObject) {\r\n\t\treqmfc = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t}\r\n}", "title": "" }, { "docid": "2daf2f3c166a67619f494e541ed68f5f", "score": "0.59040767", "text": "function makeAjaxRequest(url, method) {\n if(!method) {\n method = 'GET';\n }\n // and some code to make a request\n}", "title": "" }, { "docid": "23038ca0433bb4639171e9df08e3002c", "score": "0.5903036", "text": "function fs_xhr() {\n var ajaxRequest; try {\n ajaxRequest = new XMLHttpRequest;\n } catch (exception) {\n var indeces = ['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0',\n 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP',\n 'MICROSOFT.XMLHTTP.1.0',\n 'MICROSOFT.XMLHTTP.1', 'MICROSOFT.XMLHTTP'];\n for (var i = 0, len = indeces.length; i < len; i++) {\n try {\n ajaxRequest = new ActiveXObject(indeces[i]);\n break;\n } catch (exception) {\n\n }\n }\n }\n return ajaxRequest;\n}", "title": "" }, { "docid": "89fa6b42473b6576293dc83af0937dbe", "score": "0.58945817", "text": "function createXHR() {\r\n try { return new XMLHttpRequest(); } catch (e) {}\r\n try { return new window.ActiveXObject(\"Msxml2.XMLHTTP.6.0\"); } catch (e1) {}\r\n try { return new window.ActiveXObject(\"Msxml2.XMLHTTP.3.0\"); } catch (e2) {}\r\n try { return new window.ActiveXObject(\"Msxml2.XMLHTTP\"); } catch (e3) {}\r\n try { return new window.ActiveXObject(\"Microsoft.XMLHTTP\"); } catch (e4) {}\r\n\r\n alert(\"XMLHttpRequest not supported\");\r\n return null;\r\n}", "title": "" }, { "docid": "95984c572243b3587a609a333e2f70c0", "score": "0.58939964", "text": "function XHR() {\n var xhr = false;\n xhr = window.ActiveXObject\n ? new ActiveXObject(\"Microsoft.XMLHTTP\")\n : new XMLHttpRequest();\n return xhr;\n}", "title": "" }, { "docid": "e0d04183070f24954a8c02c7c38bba39", "score": "0.5892667", "text": "function makeAjaxRequestWithDefault(url, method = 'GET') {\n\treturn method;\n}", "title": "" }, { "docid": "9905e5d17296db9b13ea22cf39099758", "score": "0.58842045", "text": "function handleDefaultUpdate() {\n if (request.readyState == 4) {\n\tif (request.status == 200) {\n\t //var response = request.responseText;\n\t}\n\telse if (request.status == 404) {\n\t alert(\"handleDefaultUpdate: Request URL does not exist\");\n\t}\n\telse {\n\t alert(\"handleDefaultUpdate: Error - status code is \" + request.status);\n\t}\n }\n}", "title": "" }, { "docid": "df3099df1197ab17a7b5ac8c03ed5932", "score": "0.58689755", "text": "function create_request() {\r\n try {\r\n XMLHttp = new XMLHttpRequest();\r\n } catch (trymicrosoft) {\r\n try {\r\n XMLHttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n } catch (othermicrosoft) {\r\n try {\r\n XMLHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } catch (failed) {\r\n XMLHttp = null;\r\n }\r\n }\r\n }\r\n if (XMLHttp == null) {\r\n alert(\"Ajax nicht unterst�tzt\");\r\n }\r\n return XMLHttp;\r\n}", "title": "" }, { "docid": "e26286d2976087997688e2254d20de0d", "score": "0.5861288", "text": "function LancerAjax(fichier)\n{\n if(window.XMLHttpRequest) // FIREFOX\n xhr_object = new XMLHttpRequest();\n else if(window.ActiveXObject) // IE\n xhr_object = new ActiveXObject(\"Microsoft.XMLHTTP\");\n else\n return(false);\n xhr_object.open(\"GET\", fichier, false);\n xhr_object.send(null);\n if(xhr_object.readyState == 4) return(xhr_object.responseText);\n else return(false);\n}", "title": "" }, { "docid": "fdcabe4541dfe651e6efdf3cc156376e", "score": "0.58249897", "text": "function ajax(url, success, error = false) {\n var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');\n xhr.open('GET', url);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n success(xhr.responseText);\n } else {\n if (error) error('Error: ' + xhr.statusText)\n }\n }\n };\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n xhr.send();\n return xhr;\n}", "title": "" }, { "docid": "86735db8b12012a71ff4cf4d349ddcfc", "score": "0.582323", "text": "function requestPage(url, text) {\n // HOCINE: THE CONDITION OF THIS IF WAS \"history.pushState\"\n if (false) {\n getPage(url, text); // HOCINE: THE PROBLEM IS HERE. USING WEB CACHING NOT WORKING\n } else {\n /* Ajax navigation is not supported */\n location.assign(url);\n }\n }", "title": "" }, { "docid": "e67b6831e66de4ef65c480f7950be0f1", "score": "0.5815324", "text": "function createStandardXHR(){try{return new window.XMLHttpRequest}catch(e){}}", "title": "" }, { "docid": "3161f3b35df2bd8a5a57ed205184d6ee", "score": "0.5794684", "text": "function getXmlHttpRequestObject() {\nif (window.XMLHttpRequest) {\nreturn new XMLHttpRequest(); //Not Internet Explorer\n} else if(window.ActiveXObject) {\nreturn new ActiveXObject(\"Microsoft.XMLHTTP\"); //Internet Explorer\n} else {\n//fail silently\n}\n}", "title": "" }, { "docid": "0572d500285b2536e1ae524032c4a155", "score": "0.5791983", "text": "function polling(opts){var xhr;var xd=false;var xs=false;var jsonp=false!==opts.jsonp;if(typeof location!=='undefined'){var isSSL='https:'===location.protocol;var port=location.port;// some user agents have empty `location.port`\nif(!port){port=isSSL?443:80;}xd=opts.hostname!==location.hostname||port!==opts.port;xs=opts.secure!==isSSL;}opts.xdomain=xd;opts.xscheme=xs;xhr=new XMLHttpRequest(opts);if('open'in xhr&&!opts.forceJSONP){return new XHR(opts);}else{if(!jsonp)throw new Error('JSONP disabled');return new JSONP(opts);}}", "title": "" }, { "docid": "0572d500285b2536e1ae524032c4a155", "score": "0.5791983", "text": "function polling(opts){var xhr;var xd=false;var xs=false;var jsonp=false!==opts.jsonp;if(typeof location!=='undefined'){var isSSL='https:'===location.protocol;var port=location.port;// some user agents have empty `location.port`\nif(!port){port=isSSL?443:80;}xd=opts.hostname!==location.hostname||port!==opts.port;xs=opts.secure!==isSSL;}opts.xdomain=xd;opts.xscheme=xs;xhr=new XMLHttpRequest(opts);if('open'in xhr&&!opts.forceJSONP){return new XHR(opts);}else{if(!jsonp)throw new Error('JSONP disabled');return new JSONP(opts);}}", "title": "" }, { "docid": "a1b78d38d93dc1bf09a39089c30e986c", "score": "0.578713", "text": "function nuevoAjax(){\n\t\n\t\tvar xmlhttp = false;\n\t\ttry{\n\t\t\t//Creacion del objeto AJAX para navegadores no IE\n\t\t\txmlhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\t\n\t\t}catch(e){\n\t\t\n\t\t\t\ttry{\n\t\t\t\t\t//Creacion del objeto AJAX para IE\n\t\t\t\t\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t\t\t}catch(E){\n\t\t\t\t\tif(!xmlhttp && typeof XMLHttpRequest != 'undefined')\n\t\t\t\t\t\txmlhttp = new XMLHttpRequest();\n\t\t\t\t\n\t\t\t\t}\n\t\t}\n\t\t\n\t\treturn xmlhttp;\n\t}", "title": "" }, { "docid": "2ff4511131258f00fee2224f6527f47d", "score": "0.57796246", "text": "function createXHR(){\r\n if (window.ActiveXObject){\r\n try{\r\n return new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n } catch (e){\r\n try{\r\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } catch (e2){\r\n return null;//lol\r\n }\r\n }\r\n } else if (window.XMLHttpRequest){\r\n return new XMLHttpRequest();\r\n } else{\r\n return null;\r\n }\r\n}", "title": "" }, { "docid": "2cdcc8020250b74b018baa544711c8f4", "score": "0.57620436", "text": "function CreateXMLHttpRequest()\n{\ntry { return new XMLHttpRequest(); } catch(e) {}\ntry { return new ActiveXObject(\"Msxml2.XMLHTTP.6.0\"); } catch (e) {}\ntry { return new ActiveXObject(\"Msxml2.XMLHTTP.3.0\"); } catch (e) {}\ntry { return new ActiveXObject(\"Msxml2.XMLHTTP\"); } catch (e) {}\ntry { return new ActiveXObject(\"Microsoft.XMLHTTP\"); } catch (e) {}\nreturn null;\n}", "title": "" }, { "docid": "28568eae39229a71a9e82d0a147f4ca9", "score": "0.5752666", "text": "function AjaxRequest (url, opts){\r\n\tvar headers = {\r\n\t\t'X-Requested-With': 'XMLHttpRequest',\r\n\t\t'X-Prototype-Version': '1.6.1',\r\n\t\t'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'\r\n\t};\r\n\tvar ajax = null;\r\n\r\n\tif (DEBUG_TRACE_AJAX)\r\n\t\tlogit (\"AJAX: \"+ url +\"\\n\" + inspect (opts, 3, 1));\r\n\r\n\tif (window.XMLHttpRequest)\r\n\t\tajax=new XMLHttpRequest();\r\n\telse\r\n\t\tajax=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\r\n\tif (opts.method==null || opts.method=='')\r\n\t\tmethod = 'GET';\r\n\telse\r\n\t\tmethod = opts.method.toUpperCase();\r\n\r\n\tif (method == 'POST'){\r\n\t\theaders['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\r\n\t} else if (method == 'GET'){\r\n\t\taddUrlArgs (url, opts.parameters);\r\n\t}\r\n\r\n\tajax.onreadystatechange = function(){\r\n// ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; states 0-4\r\n\t\tif (ajax.readyState==4) {\r\n\t\t\tif (ajax.status >= 200 && ajax.status < 305)\r\n\t\t\t\tif (opts.onSuccess) opts.onSuccess(ajax);\r\n\t\t\telse\r\n\t\t\t\tif (opts.onFailure) opts.onFailure(ajax);\r\n\t\t} else {\r\n\t\t\tif (opts.onChange) opts.onChange (ajax);\r\n\t\t}\r\n\t}\r\n\r\n\tajax.open(method, url, true); // always async!\r\n\r\n\tfor (var k in headers)\r\n\t\tajax.setRequestHeader (k, headers[k]);\r\n\tif (matTypeof(opts.requestHeaders)=='object')\r\n\t\tfor (var k in opts.requestHeaders)\r\n\t\t\tajax.setRequestHeader (k, opts.requestHeaders[k]);\r\n\r\n\tif (method == 'POST'){\r\n\t\tvar a = [];\r\n\t\tfor (k in opts.parameters)\r\n\t\t\ta.push (k +'='+ opts.parameters[k] );\r\n\t\tajax.send (a.join ('&'));\r\n\t} else {\r\n\t\tajax.send();\r\n\t}\r\n}", "title": "" }, { "docid": "330838b81f2cdc2c794a95c556a01992", "score": "0.57494193", "text": "function createAjaxRequest(){\n\tif (typeof XMLHttpRequest != \"undefined\")\n\t{\n\t\treturn new XMLHttpRequest();\n\t}else if (window.ActiveXObject)\n\t{\n\t\tvar activeXVersions = [\"Microsoft.XMLHTTP\", \"MSXML2.XMLHTTP.2.0\", \"MSXML2.XMLHTTP.3.0\", \"MSXML2.XMLHTTP.4.0\", \"MSXML2.XMLHTTP.5.0\"];\n\t\tfor (var idx=0; idx<activeXVersions ; idx++)\n\t\t{\n\t\t\ttry{\n\t\t\t\treturn new window.ActiveXObject(activeXVersion[idx]);\n\t\t\t}catch (e){\n\t\t\t\t//Do nothing;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "71b1606c0feba7f8f3929a5b1df848c2", "score": "0.5748035", "text": "function AjaxRequest (url, opts){\r\n var headers = {\r\n 'X-Requested-With': 'XMLHttpRequest',\r\n 'X-Prototype-Version': '1.6.1',\r\n 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'\r\n };\r\n var ajax = null;\r\n \r\n if (window.XMLHttpRequest)\r\n ajax=new XMLHttpRequest();\r\n else\r\n ajax=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n \r\n if (opts.method==null || opts.method=='')\r\n method = 'GET';\r\n else\r\n method = opts.method.toUpperCase(); \r\n \r\n if (method == 'POST'){\r\n headers['Content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\r\n } else if (method == 'GET'){\r\n addUrlArgs (url, opts.parameters);\r\n }\r\n\r\n ajax.onreadystatechange = function(){\r\n// ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; states 0-4\r\n if (ajax.readyState==4) {\r\n if (ajax.status >= 200 && ajax.status < 305)\r\n if (opts.onSuccess) opts.onSuccess(ajax);\r\n else\r\n if (opts.onFailure) opts.onFailure(ajax);\r\n } else {\r\n if (opts.onChange) opts.onChange (ajax);\r\n }\r\n } \r\n \r\n ajax.open(method, url, true); // always async!\r\n\r\n for (var k in headers)\r\n ajax.setRequestHeader (k, headers[k]);\r\n if (matTypeof(opts.requestHeaders)=='object')\r\n for (var k in opts.requestHeaders)\r\n ajax.setRequestHeader (k, opts.requestHeaders[k]);\r\n \r\n if (method == 'POST'){\r\n var a = [];\r\n for (k in opts.parameters){\r\n\t if(matTypeof(opts.parameters[k]) == 'object')\r\n\t\tfor(var h in opts.parameters[k])\r\n\t\t\ta.push (k+'['+h+'] ='+ opts.parameters[k][h] );\r\n\t else\r\n a.push (k +'='+ opts.parameters[k] );\r\n\t}\r\n ajax.send (a.join ('&'));\r\n } else {\r\n ajax.send();\r\n }\r\n}", "title": "" }, { "docid": "ebc1e00111f38f9d40aba888507309ff", "score": "0.5736908", "text": "function ajax (method, action, data, onsuccess, onerror) {\n var xmlHttp = null;\n onsuccess = onsuccess || function () {};\n onerror = onerror || function () {};\n try {\n // Mozilla, Opera, Safari sowie Internet Explorer (ab v7)\n xmlHttp = new XMLHttpRequest();\n } catch (e1) {\n try {\n // MS Internet Explorer (ab v6)\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e2) {\n try {\n // MS Internet Explorer (ab v5)\n xmlHttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e3) {\n xmlHttp = null;\n }\n }\n }\n if (xmlHttp) {\n xmlHttp.open(method, action, true);\n xmlHttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState === 4) {\n if (xmlHttp.status === 204 || xmlHttp.status === 200) {\n onsuccess(xmlHttp.responseText);\n } else {\n onerror(xmlHttp.responseText);\n }\n } else {\n onerror(xmlHttp.responseText);\n }\n };\n xmlHttp.send(data);\n }\n }", "title": "" }, { "docid": "bd96536d7ca86fc49740a60b815c906d", "score": "0.57351285", "text": "function isXmlhttpRequestSupported() {\n var xhr = null;\n try{ xhr = (hasDojo) ? dojo._xhrObj() : getXMLHttpRequest(); }catch(e){} \n\treturn (!xhr) ? false : true; \n}", "title": "" }, { "docid": "5a24a4bdd21365277a7368c2600cde13", "score": "0.57207596", "text": "function ajax(url, type, data={}, success=r=>console.log(r), dataType='html'){\n 'use strict';\n $.ajax({url:url, type:type, dataType:dataType, data:data, success:success});\n}", "title": "" }, { "docid": "1d9516dff5b84351951b15cc4564cd8e", "score": "0.57159746", "text": "function Ajax()\n{\n}", "title": "" }, { "docid": "243b244db0588cb8cbec296a2d650222", "score": "0.5709141", "text": "function create_XMLHttpRequest()\n{\nif (window.XMLHttpRequest)\n return new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari\nelse\n return new ActiveXObject(\"Microsoft.XMLHTTP\"); // IE6, IE5\n}", "title": "" }, { "docid": "bdf0f5c32f3025fbececf2578546a87e", "score": "0.57057756", "text": "function interceptAjax(){\n $.ajax = function(ajax){\n return function(obj){\n handleIntercepts(obj);\n ajax.apply(this, arguments);\n };\n }($.ajax);\n }", "title": "" }, { "docid": "5f91daea214ef08ad5d2d08d79cedb1c", "score": "0.57047856", "text": "function ajaxPost(url, data, successCallback, errorCallback) {\n if (oldIE()) {\n ieAjaxPost(url, data, successCallback, errorCallback);\n\n } else {\n jQuery.post(url, data, function (data) {\n successCallback(data);\n }).fail(function (data) {\n errorCallback(data);\n });\n }\n }", "title": "" }, { "docid": "21234daa674210d128410e20be9ac9b8", "score": "0.5693127", "text": "static ajax(options) {\n return new Promise(function(resolve, reject) {\n $.ajax(options).done(resolve).fail(reject);\n });\n }", "title": "" }, { "docid": "f7a9f4dcc0205a49e60515a9c5fca7d6", "score": "0.569013", "text": "function _commonAjaxFunction(passedUrl) {\n\tvar MAXIMUM_WAITING_TIME = 3 * 60 * 1000;\n\tvar xhReq = new createXMLHttpRequest();\n\t\t\t\tvar _c=\"?\";\n\t\t\t\tif(passedUrl.indexOf(\"?\")!=-1){_c=\"&\";}\n\t\t\t\tpassedUrl=passedUrl+_c+new Date().getTime()+parent.frames[0].sesId+Math.random()*1000000;\n\t\n\txhReq.open(\"GET\", passedUrl, false);\n\tvar requestTimer = setTimeout(function () {\n\t\t\txhReq.abort();\n\t\t\t_commonAjaxFunction(passedUrl);\n\t\t}, MAXIMUM_WAITING_TIME);\n\t\t\n\tvar serverResponse;\n\txhReq.onreadystatechange = function () {\n\t\t\tif (xhReq.readyState != 4 || xhReq.status != 200) { return;\t}\n\t\t\tclearTimeout(requestTimer);\t\t\t\n\t\t\tserverResponse = xhReq.responseText;\n\t\t\treturn;\n\t};\n\t\n\txhReq.setRequestHeader(\"If-Modified-Since\", new Date().getTime());\n\txhReq.send(null);\n\tif (xhReq.readyState != 4 || xhReq.status != 200) {\n\t\treturn;\n\t}\n\tclearTimeout(requestTimer);\t\t\t\n\tserverResponse = xhReq.responseText;\n\t // alert(serverResponse);\n\treturn serverResponse;\n}", "title": "" }, { "docid": "f3c06d00e5c2370e0ac47cd6f954ffa6", "score": "0.56875044", "text": "function sendAjaxRating(data){\n // send ajax\n var hasError = false;\n $.ajax({\n type: 'POST',\n async: false,\n contentType: 'application/json',\n url: '/api/svc/rating/insert', // apache redirects (WARNING: remove sb=acme in other stores!!!)\n data: JSON.stringify(data),\n cache: true,\n success: function(msg) {\n if (msg == null || msg == \"\") {\n hasError = true; // works only with async=false\n } else {\n var response = JSON.parse(msg);\n if (response.status != \"OK\") {\n hasError = true; // works only with async=false\n }\n }\n },\n error: function() {\n hasError = true; // works only with async=false\n } \n }); \n return hasError; \n}", "title": "" }, { "docid": "066cac139b3cb55b5e97bb41b37f748b", "score": "0.5685998", "text": "function ajax_issue_test(url, data, rawtx) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {\n alert(xhr.responseText);\n \n xhr.close;\n }\n }\n xhr.open(data ? \"POST\" : \"GET\", url, true);\n if (data) xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n xhr.send(data);\n}", "title": "" }, { "docid": "3f8cfe01aa17403f5458e0012c04478c", "score": "0.5685954", "text": "function initiateRequest() {\r\n if (window.XMLHttpRequest) {\r\n return new XMLHttpRequest();\r\n } else if (window.ActiveXObject) {\r\n isIE = true;\r\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n }", "title": "" }, { "docid": "5a74cd70ae7703cc7914ca0aac959bca", "score": "0.5682765", "text": "function ajaxError(req, callback) {\n if (req.readyState === 4 && req.status !== 200) {\n callback(req);\n }\n }", "title": "" }, { "docid": "420f00cd4ac9ac6badb5ea32d329a649", "score": "0.56817615", "text": "function ajaxSetup() {\n $.ajaxSetup({\n beforeSend: function(xhr) {\n xhr.setRequestHeader(\"X-ControlView\", \"false\");\n }\n });\n }", "title": "" }, { "docid": "7c34dc0dfbc1a90fd090117a067df654", "score": "0.5671836", "text": "function createStandardXHR(){\n try{\n return new window.XMLHttpRequest();\n }catch(e){\n }\n }", "title": "" }, { "docid": "7e109307783c7fe3e1d0dd382440d759", "score": "0.5667925", "text": "function createAjaxObject(){ ao=null;\r\n try{\r\n\t ao = new XMLHttpRequest(); //for modern browsers \r\n }\r\n catch(e) {\r\n\t try {\r\n\t\t //for new IE \r\n\t\t ao = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n\t }\r\n\t catch(e){\r\n\t\t try { //for old browsers \r\n\t\t\t ao = new ActiveXObject(\"Microsoft.XMLHTTP\"); \r\n\t\t }\r\n\t\t catch(e) {\r\n\t\t\t alert(\"AJAX is not supported by your browser!\");\r\n\t\t\t return false; \r\n\t\t }\r\n\t }\r\n }\r\nreturn ao; \r\n}", "title": "" }, { "docid": "33688a4b1b6ed66c289094548af38f7b", "score": "0.5666495", "text": "function ajax (url, method, params, container_id, loading_text) {\n try { // For: chrome, firefox, safari, opera, yandex, ...\n \txhr = new XMLHttpRequest();\n } catch(e) {\n\t try{ // for: IE6+\n\t \txhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t } catch(e1) { // if not supported or disabled\n\t\t alert(\"Not supported!\");\n\t\t}\n\t}\n\txhr.onreadystatechange = function() {\n\t\t\t\t\t\t if(xhr.readyState == 4) { // when result is ready\n\t\t\t\t\t\t\t document.getElementById(container_id).innerHTML = xhr.responseText;\n\t\t\t\t\t\t\t } else { // waiting for result \n\t\t\t\t\t\t\t document.getElementById(container_id).innerHTML = loading_text;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t \t}\n\txhr.open(method, url, true);\n\txhr.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\n\txhr.send(params);\n}", "title": "" }, { "docid": "27c3667e23d3c03177df8a354688f721", "score": "0.5655301", "text": "function NonAsyncAjaxStart() {\n debugger;\n\tshowBusyModal();\n\tShowLoadingMessage();\n}", "title": "" }, { "docid": "44760719c8db2136800ef0d9cd87f362", "score": "0.56468284", "text": "function getXMLHttpRequest() {\r\n var xhr = null;\r\n\t\r\n if (window.XMLHttpRequest || window.ActiveXObject) {\r\n if (window.ActiveXObject) {\r\n try {\r\n xhr = new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n } catch(e) {\r\n xhr = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n } else {\r\n xhr = new XMLHttpRequest(); \r\n }\r\n }else {\r\n alert(\"Votre navigateur ne supporte pas l'objet XMLHTTPRequest...\");\r\n return null;\r\n }\r\n\t\r\n return xhr;\r\n}", "title": "" }, { "docid": "b4ea3bbdbc2b4c0c51912c477abb63eb", "score": "0.56466347", "text": "function getAjax(){\n\n\tvar obj;\n\n\tif(window.XMLHttpRequest){\n\t\tobj = new XMLHttpRequest();\n\t}\n\telse{\n\t\ttry{\n\t\t\tobj = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\t\tcatch (e){\n\t\t\talert(\"Este navegador no es compatible con AJAX\");\n\t\t}\n\t}\n\n\treturn obj;\n}", "title": "" }, { "docid": "1a9423013f49ff834f466d3571487564", "score": "0.5645355", "text": "function _ajax_request(url, data, callback, type, method,error) {\n if (jQuery.isFunction(data)) {\n callback = data;\n data = {};\n }\n return jQuery.ajax({\n type: method,\n url: url,\n data: data,\n success: callback,\n dataType: type,\n error:error\n });\n}", "title": "" }, { "docid": "039b92eb59e780a291178e56bd46437c", "score": "0.56428725", "text": "function is_xhr(){\nreturn async function is_xhr(ctx, next){\n\tctx.state.xhr = (ctx.request.get(\"X-Requested-With\") === \"XMLHttpRequest\")\n\tawait next()\t\n}\n}", "title": "" }, { "docid": "836035986feddf8916010a8043757a58", "score": "0.563995", "text": "originalGet(url,options) {\n return $.ajax({\n url : url,\n type : \"GET\"\n });\n }", "title": "" }, { "docid": "576a28c4964dc60fe97237d3b58fe22e", "score": "0.5633092", "text": "function exit() {\n var browser_name = getBrowserName();\n if (browser_name == \"Chrome\") {\n jQuery.ajax({\n type: \"POST\",\n url: strSecureRootPath + \"/myAjaxClass.aspx/obfuscateExitFunction\",\n contentType: 'application/json',\n dataType: \"json\",\n cache: false,\n data: \"{ 'someGuid': '\" + gvarsomeGuid + \"', \" +\n \"'ReadOnly': '\" + ReadOnly + \"'\" +\n \"}\"\n });\n }\n else {\n //Must use \"async: false\"\n jQuery.ajax({\n type: \"POST\",\n async: false,\n url: strSecureRootPath + \"/myAjaxClass.aspx/obfuscateExitFunction\",\n contentType: 'application/json',\n dataType: \"json\",\n cache: false,\n data: \"{ 'someGuid': '\" + gvarsomeGuid + \"', \" +\n \"'ReadOnly': '\" + ReadOnly + \"'\" +\n \"}\"\n });\n }\n\n parentWindowRefresh();\n}", "title": "" }, { "docid": "cd6900b9fbd0633230c9d450cac52dc9", "score": "0.5631498", "text": "get defaultAjaxConfig() {\n var xhrConfig = _helpers.extend({}, _activeConfig.withConfig);\n if ((_activeConfig.ajax == $.ajax) || (!angular && !$http)) {\n //jQuery/other land\n xhrConfig.type = xhrConfig.type || 'GET';\n xhrConfig.url = xhrConfig.url || '';\n xhrConfig.dataType = xhrConfig.dataType || 'json';\n\n } else if (angular || $http) {\n //angular land\n xhrConfig.method = xhrConfig.method || 'GET';\n xhrConfig.url = xhrConfig.url || '';\n\n }\n //common headers here\n return xhrConfig;\n }", "title": "" }, { "docid": "514dbfa06baf411a04cc19206f351b59", "score": "0.5630413", "text": "function supportAjaxUploadProgressEvents() {\n\t\t var xhr = new XMLHttpRequest();\n\t\t return !! (xhr && ('upload' in xhr) && ('onprogress' in xhr.upload));\n\t\t }", "title": "" }, { "docid": "630e5f197562e45dd100aff41478918e", "score": "0.56283593", "text": "function makeAjaxRequest (url, method = 'GET') {\n return method;\n}", "title": "" }, { "docid": "dcecb99d430323fda237f6c9eccb2e60", "score": "0.56236446", "text": "function reloadIfNeccessary() {\n if(document.hidden)\n return;\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", location.href, true);\n xhr.onload = function() {\n console.log(xhr.getAllResponseHeaders());\n var text = xhr.responseText;\n if (text == md) return;\n console.debug(\"Changes detected on \" + location.href);\n render(text);\n };\n xhr.send();\n }", "title": "" }, { "docid": "41613c8b5e1b979a569055d9124f1a12", "score": "0.5622032", "text": "function ajax() {\n const request = new XMLHttpRequest();\n request.open( resource.method, resource.method === 'GET' ? buildURL( resource.url, resource.params ) : resource.url, true );\n request.onreadystatechange = () => {\n if ( request.readyState === 4 && request.status === 200 )\n successData( self.helper.regex( 'json' ).test( request.responseText ) ? JSON.parse( request.responseText ) : request.responseText );\n };\n request.send( resource.method === 'POST' ? JSON.stringify( resource.params ) : undefined );\n }", "title": "" }, { "docid": "c120cd4da5979825e30bb95e299231d0", "score": "0.5621902", "text": "function _getXmlHttp()\n{\ntry { return new XMLHttpRequest();}\ncatch (e2) {return null; }\n}", "title": "" }, { "docid": "f532e7815646ea506d934c46514ec727", "score": "0.56115645", "text": "function createXHR() {\n if(XMLHttpRequest){\n return new XMLHttpRequest();\n }else{\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n}", "title": "" }, { "docid": "c83aaad0920a8e708659098c916a3c38", "score": "0.5608768", "text": "function ajaxGet(url, successCallback, errorCallback) {\n if (oldIE()) {\n ieAjaxGet(url, successCallback, errorCallback);\n\n } else {\n jQuery.getJSON(url, function (data) {\n successCallback(data);\n }).fail(function (data) {\n errorCallback(data);\n });\n }\n }", "title": "" }, { "docid": "a92eb5b247956754fe556720981bf990", "score": "0.5607381", "text": "function makeAjaxRequest(url, method) {\n if (!method) {\n method = 'GET';\n }\n // logic to make the request\n}", "title": "" }, { "docid": "3cd0d972ff9737c31e56e50f070d609b", "score": "0.56037295", "text": "function ajax(method, url, data, redirect) {\n var xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n xhr.send(data);\n xhr.onload = function (e) {\n if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304) {\n console.log(\"OK\");\n window.location = redirect;\n } else {\n console.log(\"What:\", e)\n }\n };\n xhr.onerror = function (e) {\n console.log(e);\n };\n}", "title": "" }, { "docid": "f417cdc7aa3d119292f5067d67213364", "score": "0.56037164", "text": "function createStandardXHR() {\r\n\ttry {\r\n\t\treturn new window.XMLHttpRequest();\r\n\t} catch( e ) {}\r\n}", "title": "" }, { "docid": "be5cf058d6e21c9d044963261ed54242", "score": "0.5601505", "text": "function CustomAjax({ type, baseUrl, ajaxCallback }) {\n const http = new XMLHttpRequest();\n const url = `${baseUrl}`;\n http.onreadystatechange = function() {\n if (http.Status === 400) {\n alert(http.responseText);\n }\n };\n http.open(type, url, true);\n http.send()\n http.onload = ajaxCallback;\n }", "title": "" } ]
0b86e0205784f41c7384cfb27c413b54
Return the document scroll value for all browsers
[ { "docid": "6792f06e132bea54665fa168ada0ce5c", "score": "0.66569024", "text": "function scrollDist() {\n var html = document.getElementsByTagName('html')[0];\n if (html.scrollTop && document.body.scrollTop) {\n return [html.scrollLeft, html.scrollTop];\n } else if (html.scrollTop || document.body.scrollTop)\n return [html.scrollLeft + document.body.scrollLeft, html.scrollTop + document.body.scrollTop];\n return [0, 0];\n}", "title": "" } ]
[ { "docid": "a4f2077f55823496719d16e870660f1b", "score": "0.8001054", "text": "function getScroll() {\n\tconst h = document.documentElement;\n\tconst b = document.body;\n\tconst st = 'scrollTop';\n\tconst sh = 'scrollHeight';\n\n\treturn (h[st] || b[st]) / ((h[sh] || b[sh]) - h.clientHeight);\n}", "title": "" }, { "docid": "18c81d3c9b55a7823c3ae9c7f6313515", "score": "0.78584474", "text": "function getPageScrollPosition() {\n\treturn Math.round(100 * (window.pageYOffset / (document.documentElement.offsetHeight - window.innerHeight)));\n}", "title": "" }, { "docid": "18c81d3c9b55a7823c3ae9c7f6313515", "score": "0.78584474", "text": "function getPageScrollPosition() {\n\treturn Math.round(100 * (window.pageYOffset / (document.documentElement.offsetHeight - window.innerHeight)));\n}", "title": "" }, { "docid": "2ca1df8268bc58e2fe0b4603220b8037", "score": "0.7764228", "text": "function getScrollValue(e) {\n if (e.deltaY) return e.deltaY;\n if (e.wheelDeltaY) return e.wheelDeltaY * -1;\n if (e.detail) return e.detail * 5; // normalize scroll value for firefox with multiplier\n}", "title": "" }, { "docid": "3dbcce97d56629b42ef3c0c2f00b033c", "score": "0.77453595", "text": "function getCurrentScroll() {\n return window.pageYOffset || document.documentElement.scrollTop;\n }", "title": "" }, { "docid": "1f0c2a2a5b0b238724fcb154f88acde4", "score": "0.77245796", "text": "function getCurrentScroll() {\n return window.pageYOffset || document.documentElement.scrollTop;\n }", "title": "" }, { "docid": "dbfc444bf12e11ba84494c4b127c487c", "score": "0.770653", "text": "function getScrollPos(){\n return window.scrollY;\n }", "title": "" }, { "docid": "e4728cc559e301276abfec821ae3169b", "score": "0.7659057", "text": "function getCurrentScroll() {\n return window.pageYOffset; }", "title": "" }, { "docid": "77067b3cb76af1de503857329304e912", "score": "0.7648588", "text": "function getScroll() {\n\t\treturn getScrollTop() - scrollTop\n\t}", "title": "" }, { "docid": "c70c95f433a575b1b1f21db1a825b6db", "score": "0.76145494", "text": "scrolledPos () {\n return window.pageYOffset || document.documentElement.scrollTop;\n }", "title": "" }, { "docid": "636893593199aa74372b4d3df5caea33", "score": "0.7590986", "text": "function getScrollY() { var scrOfX = 0, scrOfY = 0; if (typeof (window.pageYOffset) == 'number') { scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return scrOfY; }", "title": "" }, { "docid": "8980ca199b866ddff390ef7f35b71af9", "score": "0.7531576", "text": "function getPageScrollY() {\r\n\r\n if (IE4) return document.body.scrollTop;\r\n if (NS4 || NS6) return window.pageYOffset;\r\n return -1;\r\n}", "title": "" }, { "docid": "d35d9d20243fac8f722aac5235f03a25", "score": "0.7505336", "text": "function getScrollTop(){\n\t\treturn parseFloat(document.documentElement.scrollTop || document.body.scrollTop);\n\t}", "title": "" }, { "docid": "f5b13f119d4102ccdec8488d4b9dd652", "score": "0.748961", "text": "function getScrollPos()\r\n{\r\n var ScrollTop = document.body.scrollTop;\r\n if (ScrollTop == null || ScrollTop == 0)\r\n {\r\n if (window.pageYOffset)\r\n ScrollTop = window.pageYOffset;\r\n else\r\n ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;\r\n }\r\n // If we can't find the scroll position set it to 0 \r\n if (ScrollTop == null)\r\n {\r\n return 0;\r\n }\r\n return ScrollTop;\r\n}", "title": "" }, { "docid": "60fda2ead2862f6e9be5ebd4062aa8b7", "score": "0.7391999", "text": "function findScrollY()\n{\n\treturn window.scrollY || document.documentElement.scrollTop;\n}", "title": "" }, { "docid": "3c440df423a8b88550a0f5eb10741fe9", "score": "0.73355377", "text": "function getScrollTop(){\n\t\treturn parseInt(document.documentElement.scrollTop || document.body.scrollTop);\n\t}", "title": "" }, { "docid": "0414b7304959a2ba25ff60271b4012be", "score": "0.7293497", "text": "function getScrollTop() {\n var supportPageOffset = window.pageYOffset !== undefined;\n var isCSS1Compat = ((document.compatMode || \"\") === \"CSS1Compat\");\n var y = supportPageOffset ? window.pageYOffset : isCSS1Compat ? document.documentElement.scrollTop : docume\n return y;\n }", "title": "" }, { "docid": "031d804b95f6269fda112cc480dfa739", "score": "0.7289909", "text": "function contextly_get_page_scroll() {\r\n\tvar yScroll = 0;\r\n\tif (self.pageYOffset) {\r\n\t\tyScroll = self.pageYOffset;\r\n\t} else if (document.documentElement && document.documentElement.scrollTop) {\r\n\t\tyScroll = document.documentElement.scrollTop;\r\n\t} else if (document.body) {\r\n\t\tyScroll = document.body.scrollTop;\r\n\t}\r\n\treturn yScroll;\r\n}", "title": "" }, { "docid": "50ca43f82e7f85e6bbff9ea4e24fa9eb", "score": "0.72646666", "text": "function _get_scroll_percentage() {\r\n return (\r\n (_get_window_Yscroll() + _get_window_height()) / _get_doc_height()\r\n ) * 100;\r\n}", "title": "" }, { "docid": "94c44337ac3d6d96e24fad6be8bf03a6", "score": "0.72598976", "text": "function getPageScroll() {\r\n\r\n var xScroll, yScroll;\r\n\r\n if (self.pageYOffset) {\r\n yScroll = self.pageYOffset;\r\n xScroll = self.pageXOffset;\r\n } else if (document.documentElement && document.documentElement.scrollTop) {\t // Explorer 6 Strict\r\n yScroll = document.documentElement.scrollTop;\r\n xScroll = document.documentElement.scrollLeft;\r\n } else if (document.body) {// all other Explorers\r\n yScroll = document.body.scrollTop;\r\n xScroll = document.body.scrollLeft;\r\n }\r\n\r\n return [xScroll, yScroll];\r\n}", "title": "" }, { "docid": "5f769f74ee60a2827dc38ae13c77aa63", "score": "0.72515935", "text": "function getScroll(e) {\r\n recordEvent(\"scroll\", (window.pageXOffset - xOffset), (window.pageYOffset - yOffset), '');\r\n //update values of offsets\r\n xOffset = window.pageXOffset;\r\n yOffset = window.pageYOffset;\r\n}", "title": "" }, { "docid": "5ac2e03a0541c12be21742d3012aa122", "score": "0.72444826", "text": "function xScrollTop(e, bWin)\r\n{\r\n var offset=0;\r\n if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {\r\n var w = window;\r\n if (bWin && e) w = e;\r\n if(w.document.documentElement && w.document.documentElement.scrollTop) offset=w.document.documentElement.scrollTop;\r\n else if(w.document.body && xDef(w.document.body.scrollTop)) offset=w.document.body.scrollTop;\r\n }\r\n else {\r\n e = xGetElementById(e);\r\n if (e && xNum(e.scrollTop)) offset = e.scrollTop;\r\n }\r\n return offset;\r\n}", "title": "" }, { "docid": "38720a3527dc4e1c7267689de6b40dd6", "score": "0.720947", "text": "function desktopGetScrollPosition(){\n\t\treturn {\n\t\t\tx: this.bodyNode.scrollLeft,\n\t\t\ty: this.bodyNode.scrollTop\n\t\t};\n\t}", "title": "" }, { "docid": "09ca52ce5f45a17693bcf9c77b326f00", "score": "0.71847934", "text": "function xScrollTop(e, bWin)\n{\n var offset=0;\n if (!xDef(e) || bWin || e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {\n var w = window;\n if (bWin && e) w = e;\n if(w.document.documentElement && w.document.documentElement.scrollTop) offset=w.document.documentElement.scrollTop;\n else if(w.document.body && xDef(w.document.body.scrollTop)) offset=w.document.body.scrollTop;\n }\n else {\n e = xGetElementById(e);\n if (e && xNum(e.scrollTop)) offset = e.scrollTop;\n }\n return offset;\n}", "title": "" }, { "docid": "732072fa88c137f358f724d392277a27", "score": "0.71840924", "text": "function getPageScrollX() {\r\n\r\n if (IE4) return document.body.scrollLeft;\r\n if (NS4 || NS6) return window.pageXOffset;\r\n return -1;\r\n}", "title": "" }, { "docid": "f72bbf175ba9e08fae30dbd0ef5700d2", "score": "0.7175242", "text": "function getScrollY() {\n \treturn (window.pageYOffset != null) ? window.pageYOffset : (document.documentElement.scrollTop != null) ? document.documentElement.scrollTop : document.body.scrollTop;\n }", "title": "" }, { "docid": "7213954fd60abe5c1e0fb962eecfce3c", "score": "0.7169278", "text": "function getScrollY()\n{\n\tvar toReturn;\n\t// For most modern browsers\n\tif (window.scrollY)\n\t{\n\t\ttoReturn = window.scrollY;\n\t}\n\t// For Internet Explorer\n\telse if (document.documentElement.scrollTop)\n\t{\n\t\ttoReturn = document.documentElement.scrollTop;\n\t}\n\treturn toReturn;\n}", "title": "" }, { "docid": "fc57814756e9fe0feabfdb5798f538ca", "score": "0.71681476", "text": "function getScrollTop(){\n if(typeof pageYOffset!= 'undefined'){\n return pageYOffset;\n }\n else{\n var b = document.body; //IE 'quirks'\n var d = document.documentElement; //IE with doctype\n d = (d.clientHeight)? d : b;\n return d.scrollTop;\n }\n }", "title": "" }, { "docid": "92d752fe018e147b4686c6b80d516a79", "score": "0.7162405", "text": "function getYScroll() {\n var yScroll = 0;\n if (self.pageYOffset) {\n\t yScroll = self.pageYOffset;\n } else if (document.documentElement && document.documentElement.scrollTop) {\n\t yScroll = document.documentElement.scrollTop;\n } else if (document.body) {// all other Explorers\n\t yScroll = document.body.scrollTop;\n }\n return yScroll;\n}", "title": "" }, { "docid": "92d752fe018e147b4686c6b80d516a79", "score": "0.7162405", "text": "function getYScroll() {\n var yScroll = 0;\n if (self.pageYOffset) {\n\t yScroll = self.pageYOffset;\n } else if (document.documentElement && document.documentElement.scrollTop) {\n\t yScroll = document.documentElement.scrollTop;\n } else if (document.body) {// all other Explorers\n\t yScroll = document.body.scrollTop;\n }\n return yScroll;\n}", "title": "" }, { "docid": "ff0abd16e48d26fb70fe2be06d920fc3", "score": "0.7147281", "text": "function _trackScrollPos() {\n\t\tscrollY = window.scrollY || \n\t\t\t((window.pageYOffset || document.body.scrollTop) - \n\t\t\t(document.body.clientTop || 0));\n\t}", "title": "" }, { "docid": "c5fd2199693c385104eb7f1e26cfb286", "score": "0.7136925", "text": "function getScrollXY() {\r\n var scrOfY = 0;\r\n\r\n if (typeof (window.pageYOffset) == 'number') {\r\n //Netscape compliant\r\n scrOfY = window.pageYOffset;\r\n } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {\r\n //DOM compliant\r\n scrOfY = document.body.scrollTop;\r\n } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {\r\n //IE6 standards compliant mode\r\n scrOfY = document.documentElement.scrollTop;\r\n }\r\n\r\n return [scrOfY];\r\n }", "title": "" }, { "docid": "79766a9466632df822df15d2c0fd7fa4", "score": "0.7127446", "text": "function getScrollY() {\n return window.scrollY || window.pageYOffset || document.body.scrollTop;\n}", "title": "" }, { "docid": "93278c8e120dbc528aab8e0462b86a43", "score": "0.7104761", "text": "function _jsTree_getScrollPosition() {\n if (document.layers) {\n this.scrollX = frames[this.displayFrame].pageXOffset;\n this.scrollY = frames[this.displayFrame].pageYOffset;\n } else if (document.all) {\n this.scrollX = frames[this.displayFrame].document.body.scrollLeft;\n this.scrollY = frames[this.displayFrame].document.body.scrollTop;\n }\n}", "title": "" }, { "docid": "b45d3c77df511cc5a0f631dd39158c35", "score": "0.7097666", "text": "function getScrollXY() {\n var scrOfX = 0, scrOfY = 0;\n if( typeof( window.pageYOffset ) == 'number' ) {\n //Netscape compliant\n scrOfY = window.pageYOffset;\n scrOfX = window.pageXOffset;\n } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {\n //DOM compliant\n scrOfY = document.body.scrollTop;\n scrOfX = document.body.scrollLeft;\n } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {\n //IE6 standards compliant mode\n scrOfY = document.documentElement.scrollTop;\n scrOfX = document.documentElement.scrollLeft;\n }\n return scrOfY ;//return [ scrOfX, scrOfY ];\n}", "title": "" }, { "docid": "f837eed3b043e911ce5e74987b081ac3", "score": "0.70765907", "text": "function getScrollPosition() {\n var scrollPosition = $(window).scrollTop();\n return scrollPosition;\n}", "title": "" }, { "docid": "821b53b9e2c6f607906961a5781f94b2", "score": "0.70724714", "text": "static getScrollTop() {\n return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0\n }", "title": "" }, { "docid": "765c4325ae9b8d5b8c5f083d49ccbb24", "score": "0.7070865", "text": "function getScrollTop() {\n\t\treturn window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop;\n\t}", "title": "" }, { "docid": "92035fc5f0b2bf33feadc1e316908fb5", "score": "0.7066641", "text": "function getScrollTop() {\n\tif (typeof pageYOffset != 'undefined') {\n\t\t//most browsers except IE before #9\n\t\treturn pageYOffset;\n\t}\n\telse {\n\t\tvar B = document.body; //IE 'quirks'\n\t\tvar D = document.documentElement; //IE with doctype\n\t\tD = (D.clientHeight) ? D : B;\n\t\treturn D.scrollTop;\n\t}\n}", "title": "" }, { "docid": "87f7a7f52bc134723b35f1b32c2208e5", "score": "0.7059366", "text": "function getScrollTop() {\n\tif (self.pageYOffset) // all except Explorer\n\t{\n\t\treturn self.pageYOffset;\n\t}\n\telse if (document.documentElement && document.documentElement.scrollTop)\n\t\t// Explorer 6 Strict\n\t{\n\t\treturn document.documentElement.scrollTop;\n\t}\n\telse if (document.body) // all other Explorers\n\t{\n\t\treturn document.body.scrollTop;\n\t}\n}", "title": "" }, { "docid": "5ffb7251a68da19966be6334034895c5", "score": "0.70446444", "text": "function getDocumentScrollWidth() {\n return Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);\n}", "title": "" }, { "docid": "5ffb7251a68da19966be6334034895c5", "score": "0.70446444", "text": "function getDocumentScrollWidth() {\n return Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);\n}", "title": "" }, { "docid": "7b7dff4129255af5f8f6fdf3466402c2", "score": "0.7040039", "text": "function getScrollPosition() {\n\tscrOfX = 0;\n\tscrOfY = 0;\n\tif (typeof(window.pageYOffset) == 'number') {\n\t\t//Netscape compliant\n\t\tscrOfY = window.pageYOffset;\n\t\tscrOfX = window.pageXOffset;\n\t} else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {\n\t\t//DOM compliant\n\t\tscrOfY = document.body.scrollTop;\n\t\tscrOfX = document.body.scrollLeft;\n\t} else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {\n\t\t//IE6 standards compliant mode\n\t\tscrOfY = document.documentElement.scrollTop;\n\t\tscrOfX = document.documentElement.scrollLeft;\n\t}\n\treturn [scrOfX, scrOfY];\n}", "title": "" }, { "docid": "450242abd6da7eb8111286b0a4b61221", "score": "0.70291615", "text": "function getScroll(w, top) {\n var ret = w['page' + (top ? 'Y' : 'X') + 'Offset'];\n var method = 'scroll' + (top ? 'Top' : 'Left');\n if (typeof ret !== 'number') {\n var d = w.document;\n // ie6,7,8 standard mode\n ret = d.documentElement[method];\n if (typeof ret !== 'number') {\n // quirks mode\n ret = d.body[method];\n }\n }\n return ret;\n}", "title": "" }, { "docid": "0bc4dd2f320e1bc85e6a1996ed9a02c2", "score": "0.7009983", "text": "function findScrollX()\n{\n\treturn window.scrollX || document.documentElement.scrollLeft;\n}", "title": "" }, { "docid": "cf7480d2fbe43a83254e5a971d2ec244", "score": "0.70026916", "text": "_getViewportScrollPosition() {\n const cachedPosition = this._parentPositions.positions.get(this._document);\n return cachedPosition ? cachedPosition.scrollPosition :\n this._viewportRuler.getViewportScrollPosition();\n }", "title": "" }, { "docid": "cf7480d2fbe43a83254e5a971d2ec244", "score": "0.70026916", "text": "_getViewportScrollPosition() {\n const cachedPosition = this._parentPositions.positions.get(this._document);\n return cachedPosition ? cachedPosition.scrollPosition :\n this._viewportRuler.getViewportScrollPosition();\n }", "title": "" }, { "docid": "3263d8b9a24086a9f9a97414f58f4ecb", "score": "0.699189", "text": "function scrollTop() {\n var doc = document.documentElement, body = document.body;\n return (doc && doc.scrollTop || body && body.scrollTop || 0);\n}", "title": "" }, { "docid": "2a22a03152d12504aa0063b04d8c6edc", "score": "0.6982008", "text": "function getScrollTop() {\n if (window.self.pageYOffset) // all except Explorer\n {\n return window.self.pageYOffset;\n }\n else if (document.documentElement && document.documentElement.scrollTop)\n // Explorer 6 Strict\n {\n return document.documentElement.scrollTop;\n }\n else if (document.body) // all other Explorers\n {\n return document.body.scrollTop;\n }else{\n return null;\n }\n }", "title": "" }, { "docid": "b773ff7b2a5885cc87032a22ddcf2cf8", "score": "0.69787455", "text": "function getScrollTop() {\n\t\treturn $(window).scrollTop()\n\t}", "title": "" }, { "docid": "a7ec89d46bf5a244ba77c5aa1f929f92", "score": "0.6976871", "text": "function getScrollTop()\n{\n var scrollTop=0;\n if(document.documentElement&&document.documentElement.scrollTop)\n {\n scrollTop=document.documentElement.scrollTop;\n }\n else if(document.body)\n {\n scrollTop=document.body.scrollTop;\n }\n return scrollTop;\n}", "title": "" }, { "docid": "329e288c5326b8e2d99f3de81eb750a3", "score": "0.69449097", "text": "function getScrollPosition()\r\n{\r\n\treturn Array((document.documentElement && document.documentElement.scrollLeft) || window.pageXOffset || self.pageXOffset || document.body.scrollLeft,(document.documentElement && document.documentElement.scrollTop) || window.pageYOffset || self.pageYOffset || document.body.scrollTop);\r\n}", "title": "" }, { "docid": "b54fe6bb90e6844e76d20c6fc8fd6f4f", "score": "0.69209045", "text": "function ViewportScrollPosition() { }", "title": "" }, { "docid": "026e33357b0dec1f287f102147839f0b", "score": "0.6908654", "text": "function getScrollLeft(){\n\t\treturn parseFloat(document.documentElement.scrollLeft || document.body.scrollLeft)\n\t}", "title": "" }, { "docid": "6fce960e2a871a23582948c61133aab2", "score": "0.68705004", "text": "get scrolling() {\n\t\treturn this.nativeElement ? this.nativeElement.scrolling : undefined;\n\t}", "title": "" }, { "docid": "bc12eca4f26f18d70e375306303d10a5", "score": "0.6846232", "text": "function getScrollbarOffset() {\n try {\n if (window.innerWidth > document.documentElement.clientWidth) {\n return window.innerWidth - document.documentElement.clientWidth;\n }\n } catch (err) {}\n\n return 0;\n}", "title": "" }, { "docid": "d49b7682b063b68cc391d5c703ff5dcf", "score": "0.68433905", "text": "function getScrollOffset() {\n const offset = {};\n if (window.pageXOffset) {\n offset.x = window.pageXOffset;\n } else {\n offset.x = document.documentElement.scrollLeft;\n }\n if (window.pageYOffset) {\n offset.y = window.pageYOffset;\n } else {\n offset.y = document.documentElement.scrollTop;\n }\n return offset;\n}", "title": "" }, { "docid": "9495d6ebc91831cf54158236b9f52cf6", "score": "0.6837152", "text": "function GetScrollY() { return bind.GetScrollY(); }", "title": "" }, { "docid": "cad7166d1a528b73ac03d338270abff3", "score": "0.68352175", "text": "function getScrollPercent() {\n var h = document.documentElement, \n b = document.body,\n st = 'scrollTop',\n sh = 'scrollHeight';\n return (h[st]||b[st]) / ((h[sh]||b[sh]) - h.clientHeight) * 80;\n}", "title": "" }, { "docid": "c1d547178315ab5a0f5de5ee44ab6a20", "score": "0.68287015", "text": "function location() {\n\t return window.scrollY || window.pageYOffset;\n\t }", "title": "" }, { "docid": "da7328b8b6598432591bd1a7698cec4e", "score": "0.68286794", "text": "function getScrollOffset() {\n\tvar x = 0, y = 0;\n\tx = window.pageXOffset;\n\ty = window.pageYOffset;\n\n\tif( document.documentElement && navigator.appName == 'Microsoft Internet Explorer' ) {\n\t\tx = documentElement.scrollLeft;\n\t\ty = documentElement.scrollRight;\n\t}\n\treturn [x,y];\n}", "title": "" }, { "docid": "a73be45e8e80024e7eee9498efecb921", "score": "0.68272746", "text": "function _get_window_Yscroll() {\r\n return window.pageYOffset ||\r\n document.body.scrollTop ||\r\n document.documentElement.scrollTop || 0;\r\n}", "title": "" }, { "docid": "21328f966b581c22261cce178604627c", "score": "0.6812097", "text": "static get mouseScrollDelta() {}", "title": "" }, { "docid": "44db81ecd706c28a7f97c5d2d6e9954e", "score": "0.68120533", "text": "function getScrollTop() {\n var scrollTop = window.pageYOffset;\n\n if (typeof scrollTop === 'undefined') {\n scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n }\n\n if (isNaN(scrollTop) || typeof scrollTop === 'undefined') {\n throw new Error('Unable to retrieve scrollTop. :(');\n }\n\n return scrollTop;\n}", "title": "" }, { "docid": "a284a52113ae0bb41f3aaa07df7ad831", "score": "0.6796169", "text": "function findScroll()\n{\n\tvar x = 0;\n\tvar y = 0;\n\tif (self.pageYOffset)\n\t{\n\t\tx = self.pageXOffset;\n\t\ty = self.pageYOffset;\n\t}\n\telse if (document.documentElement && document.documentElement.scrollTop)\n\t{\n\t\tx = document.documentElement.scrollLeft;\n\t\ty = document.documentElement.scrollTop;\n\t}\n\telse if (document.body)\n\t{\n\t\tx = document.body.scrollLeft;\n\t\ty = document.body.scrollTop;\n\t}\n\t\n\treturn [x,y];\n}", "title": "" }, { "docid": "da6be553f48611ac8b3a94746019bca6", "score": "0.6786759", "text": "function getScrollX()\n{\n\tvar toReturn;\n\t// For most modern browsers\n\tif (window.scrollX)\n\t{\n\t\ttoReturn = window.scrollX;\n\t}\n\t// For Internet Explorer\n\telse if (document.documentElement.scrollLeft)\n\t{\n\t\ttoReturn = document.documentElement.scrollLeft;\n\t}\n\treturn toReturn;\n}", "title": "" }, { "docid": "28f3660ce1545b5a43e0815e182504fa", "score": "0.67626745", "text": "function scrollY() {\n return window.scrollY || $(window).scrollTop();\n }", "title": "" }, { "docid": "dc85da46969c6e71443093211da88435", "score": "0.6756306", "text": "function getScrollOffset(element){if(element===window){return{top:'scrollY'in window?window.scrollY:document.documentElement.scrollTop,left:'scrollX'in window?window.scrollX:document.documentElement.scrollLeft};}else{return{top:element.scrollTop,left:element.scrollLeft};}}", "title": "" }, { "docid": "c8f82bdcfdd02b962c68053d8471bb80", "score": "0.6737366", "text": "function getWindowScroll(){\n if ( scroll.blocked ) return\n\n var wScroll = _window.scrollTop()\n scroll.y = wScroll\n scroll.direction = wScroll > scroll.lastForScrollDir ? \"down\" : \"up\"\n\n scroll.lastForScrollDir = wScroll <= 0 ? 0 : wScroll;\n }", "title": "" }, { "docid": "e2b83ca6ad626b093898608362b53813", "score": "0.67241335", "text": "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n } else {\n return [0, 0];\n }\n }", "title": "" }, { "docid": "e2b83ca6ad626b093898608362b53813", "score": "0.67241335", "text": "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n } else {\n return [0, 0];\n }\n }", "title": "" }, { "docid": "f845b8dc495b3f0d547de739f0854ab7", "score": "0.67195374", "text": "getViewportScrollPosition() {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 };\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._getDocument();\n const window = this._getWindow();\n const documentElement = document.documentElement;\n const documentRect = documentElement.getBoundingClientRect();\n const top = -documentRect.top || document.body.scrollTop || window.scrollY ||\n documentElement.scrollTop || 0;\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX ||\n documentElement.scrollLeft || 0;\n return { top, left };\n }", "title": "" }, { "docid": "ae66ba06c5245ceffa2b201809663af7", "score": "0.669739", "text": "getViewportScrollPosition() {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 };\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._document;\n const window = this._getWindow();\n const documentElement = document.documentElement;\n const documentRect = documentElement.getBoundingClientRect();\n const top = -documentRect.top || document.body.scrollTop || window.scrollY ||\n documentElement.scrollTop || 0;\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX ||\n documentElement.scrollLeft || 0;\n return { top, left };\n }", "title": "" }, { "docid": "ae66ba06c5245ceffa2b201809663af7", "score": "0.669739", "text": "getViewportScrollPosition() {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return { top: 0, left: 0 };\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const document = this._document;\n const window = this._getWindow();\n const documentElement = document.documentElement;\n const documentRect = documentElement.getBoundingClientRect();\n const top = -documentRect.top || document.body.scrollTop || window.scrollY ||\n documentElement.scrollTop || 0;\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX ||\n documentElement.scrollLeft || 0;\n return { top, left };\n }", "title": "" }, { "docid": "2065ce7cac28f8037732d52419fa13b3", "score": "0.6662152", "text": "function getPageScroll(){\n\n\tvar yScroll;\n\n\tif (self.pageYOffset) {\n\t\tyScroll = self.pageYOffset;\n\t} else if (document.documentElement && document.documentElement.scrollTop){\t // Explorer 6 Strict\n\t\tyScroll = document.documentElement.scrollTop;\n\t} else if (document.body) {// all other Explorers\n\t\tyScroll = document.body.scrollTop;\n\t}\n\n\tarrayPageScroll = new Array('',yScroll) \n\treturn arrayPageScroll;\n}", "title": "" }, { "docid": "5984d7a450087e2382660dd5f77f6e72", "score": "0.6657095", "text": "function scrollY() {\n // A shortcut, in case we're using Internet Explorer 6 in Strict Mode\n var de = document.documentElement;\n // If the pageYOffset of the browser is available, use that\n return (\n self.pageYOffset ||\n // Otherwise, try to get the scroll top off of the root node\n (de && de.scrollTop) ||\n // Finally, try to get the scroll top off of the body element\n document.body.scrollTop\n );\n}", "title": "" }, { "docid": "bd3ebbd30730fa47f3e88d586bc6abff", "score": "0.66552436", "text": "function location() {\n return window.scrollY || window.pageYOffset;\n }", "title": "" }, { "docid": "bd3ebbd30730fa47f3e88d586bc6abff", "score": "0.66552436", "text": "function location() {\n return window.scrollY || window.pageYOffset;\n }", "title": "" }, { "docid": "bd3ebbd30730fa47f3e88d586bc6abff", "score": "0.66552436", "text": "function location() {\n return window.scrollY || window.pageYOffset;\n }", "title": "" }, { "docid": "bd3ebbd30730fa47f3e88d586bc6abff", "score": "0.66552436", "text": "function location() {\n return window.scrollY || window.pageYOffset;\n }", "title": "" }, { "docid": "a0111543cdc548fa281afbb3ffa386ba", "score": "0.66394126", "text": "function getScrollPosition(element) {\n if (!canUseDOM()) return {\n scrollX: 0,\n scrollY: 0\n };\n var win = element ? getOwnerWindow(element) : window;\n return {\n scrollX: win.scrollX,\n scrollY: win.scrollY\n };\n}", "title": "" }, { "docid": "9199c26b479eeaf5a29fccb59ae347b9", "score": "0.66374046", "text": "function location() {\n return window.scrollY || window.pageYOffset;\n } // element offset helper", "title": "" }, { "docid": "b8bb31aeab0da15cd6c13fe629c0e34f", "score": "0.6629856", "text": "function newscroll() {\n return (SCROLL_PROBABILITY[rund(81)]);\n}", "title": "" }, { "docid": "a6c79f97fc5f108fee962f5937447e39", "score": "0.6604794", "text": "function handleWindowScroll() {}", "title": "" }, { "docid": "25c3ae06f66239c85fdb5a445fadac20", "score": "0.6587517", "text": "function ___getPageScroll() {\n var xScroll, yScroll;\n if (self.pageYOffset) {\n yScroll = self.pageYOffset;\n xScroll = self.pageXOffset;\n } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict\n yScroll = document.documentElement.scrollTop;\n xScroll = document.documentElement.scrollLeft;\n } else if (document.body) {// all other Explorers\n yScroll = document.body.scrollTop;\n xScroll = document.body.scrollLeft; \n }\n arrayPageScroll = new Array(xScroll,yScroll);\n return arrayPageScroll;\n }", "title": "" }, { "docid": "1b8721be2f107709eeffada7e3d7783d", "score": "0.6585565", "text": "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "title": "" }, { "docid": "1b8721be2f107709eeffada7e3d7783d", "score": "0.6585565", "text": "getScrollPosition() {\n if (this.supportsScrolling()) {\n return [this.window.pageXOffset, this.window.pageYOffset];\n }\n else {\n return [0, 0];\n }\n }", "title": "" }, { "docid": "c7fb68d2d3dde2cc3287fdc4011a4908", "score": "0.6578695", "text": "_onScroll( e ) {\n this._lastScroll = window.scrollY;\n this._requestTick();\n }", "title": "" }, { "docid": "4bb8109d3471e4c75cf8724bf0528214", "score": "0.6550474", "text": "function handleScroll() {\n console.debug('test: ', window.scrollY);\n} // Typewriter Header", "title": "" }, { "docid": "3e5b4a30f15193e01536168e0322a064", "score": "0.65329915", "text": "get _maxScrollTop() {\n return this._estScrollHeight - this._viewportHeight + this._scrollerPaddingTop;\n }", "title": "" }, { "docid": "68e99d9ad819a2e8c2d5db3967919b38", "score": "0.65276664", "text": "function ___getPageScroll() {\r\n\t\t\tvar xScroll, yScroll;\r\n\t\t\tif (self.pageYOffset) {\r\n\t\t\t\tyScroll = self.pageYOffset;\r\n\t\t\t\txScroll = self.pageXOffset;\r\n\t\t\t} else if (document.documentElement && document.documentElement.scrollTop) {\t // Explorer 6 Strict\r\n\t\t\t\tyScroll = document.documentElement.scrollTop;\r\n\t\t\t\txScroll = document.documentElement.scrollLeft;\r\n\t\t\t} else if (document.body) {// all other Explorers\r\n\t\t\t\tyScroll = document.body.scrollTop;\r\n\t\t\t\txScroll = document.body.scrollLeft;\t\r\n\t\t\t}\r\n\t\t\tarrayPageScroll = new Array(xScroll,yScroll);\r\n\t\t\treturn arrayPageScroll;\r\n\t\t}", "title": "" }, { "docid": "d33f798134011a44f0fafa547dd72bd7", "score": "0.652669", "text": "function calculateScrollHeight() {\n const windowHeight = window.innerHeight; /* Get the height of the browser window */\n const scrollTop = window.pageYOffset; /* How much user scrolled page vertically */\n const docHeight = getDocumentHeight(); /* Document height */\n const heightDiff = docHeight - windowHeight;/* Difference between document height and browser height */\n const percentageScrolled = Math.floor(scrollTop/heightDiff * 100); /* Percentage of page scrolled by the user */\n return percentageScrolled;\n}", "title": "" }, { "docid": "0ff8eb7a254401a9622d132d179726e4", "score": "0.651039", "text": "function getMaxScroll() {\n\t\t\t\treturn maxScrollPosition;\n\t\t\t}", "title": "" }, { "docid": "2db456d370c8fdf36062af1dab18df60", "score": "0.6507129", "text": "get _maxScrollTop() {\n return this._estScrollHeight - this._viewportHeight + this._scrollOffset;\n }", "title": "" }, { "docid": "5a098907f0c29cbe969d4cf3d0c08f1e", "score": "0.64793515", "text": "function getScrolledPosition(element){\n var position;\n\n //is not the window element and is a slide?\n if(element.self != window && hasClass(element, SLIDES_WRAPPER)){\n position = element.scrollLeft;\n }\n else if(!options.autoScrolling || options.scrollBar){\n position = getScrollTop();\n }\n else{\n position = element.offsetTop;\n }\n\n //gets the top property of the wrapper\n return position;\n }", "title": "" }, { "docid": "49ff21ed4246149230f0ac79af2d36ed", "score": "0.6437817", "text": "function getScrollVelocityFactor() {\n if(isTouchDevice()) {\n return 20;\n } else {\n return 5;\n }\n}", "title": "" }, { "docid": "269f188a10c6237f662dc572fb67300c", "score": "0.6429954", "text": "get ScrollWheel() {}", "title": "" }, { "docid": "1400d0e624fbf29c2a98aba0e505852c", "score": "0.64295745", "text": "function ___getPageScroll() {\n\t\t\tvar xScroll, yScroll;\n\t\t\tif (self.pageYOffset) {\n\t\t\t\tyScroll = self.pageYOffset;\n\t\t\t\txScroll = self.pageXOffset;\n\t\t\t} else if (document.documentElement && document.documentElement.scrollTop) {\t // Explorer 6 Strict\n\t\t\t\tyScroll = document.documentElement.scrollTop;\n\t\t\t\txScroll = document.documentElement.scrollLeft;\n\t\t\t} else if (document.body) {// all other Explorers\n\t\t\t\tyScroll = document.body.scrollTop;\n\t\t\t\txScroll = document.body.scrollLeft;\t\n\t\t\t}\n\t\t\tarrayPageScroll = new Array(xScroll,yScroll);\n\t\t\treturn arrayPageScroll;\n\t\t}", "title": "" }, { "docid": "9a349017c7fc18bb3fcf371f344304f2", "score": "0.6425578", "text": "function getScrollOffsets () {\n let t;\n\n let xOffset = (typeof window.pageXOffset === 'undefined') ?\n (((t = document.documentElement) || (t = document.body.parentNode)) &&\n typeof t.ScrollLeft === 'number' ? t : document.body).ScrollLeft :\n window.pageXOffset;\n\n let yOffset = (typeof window.pageYOffset === 'undefined') ?\n (((t = document.documentElement) || (t = document.body.parentNode)) &&\n typeof t.ScrollTop === 'number' ? t : document.body).ScrollTop :\n window.pageYOffset;\n\n return { x: xOffset, y: yOffset };\n}", "title": "" }, { "docid": "35736d14237f2cd14cc0b27a7bce2410", "score": "0.6424677", "text": "function onScrollEventHandler(ev){\n\t\tws = win.scrollTop();\n\t}", "title": "" } ]
9d38aad9827df8929e3e4fc256a24ae1
grab the flags from the server
[ { "docid": "fe52fd35e0f16282eaa972b3e4a35bb0", "score": "0.55022794", "text": "async function loadFlags(name) {\n var flagsGrabbed;\n loadDoc(\"login/grabFlags.php?q=\"+user, function(data){\n flagsGrabbed = data;\n temp = JSON.parse(flagsGrabbed, function(key, value){\n\t\t\t\tif (isNaN(key)){\n\t\t\t\t\tassignFlagValue(key, parseInt(value))\n \tif (key == 'health'){\n \t setHealth(parseInt(value));\n \t}\n \tif (key == 'attack'){\n setAttack(parseInt(value));\n \t}\n\t\t\t\t}\n\t\t\t});\n loadMap('map1');\n });\n}", "title": "" } ]
[ { "docid": "229547075aff9adc2a94be70d23566ee", "score": "0.59870553", "text": "GetFlagsBuffer() {\n return this.m_flagsBuffer.data;\n }", "title": "" }, { "docid": "1d33118dac4af54bfc2ca69873134c14", "score": "0.58607817", "text": "function getflagaccion(){return flagactionglob;}", "title": "" }, { "docid": "0b5f2c5b7ff11a0ad3cabfababeb2062", "score": "0.583398", "text": "get Flags() { return this.native.Flags; }", "title": "" }, { "docid": "0b5f2c5b7ff11a0ad3cabfababeb2062", "score": "0.583398", "text": "get Flags() { return this.native.Flags; }", "title": "" }, { "docid": "0b5f2c5b7ff11a0ad3cabfababeb2062", "score": "0.583398", "text": "get Flags() { return this.native.Flags; }", "title": "" }, { "docid": "0b5f2c5b7ff11a0ad3cabfababeb2062", "score": "0.583398", "text": "get Flags() { return this.native.Flags; }", "title": "" }, { "docid": "d186d3e8d0ab65398ce495022d0b53cf", "score": "0.57634443", "text": "get flags() {\n const flags = this._raw_lView[FLAGS];\n return {\n __raw__flags__: flags,\n initPhaseState: flags & 3 /* InitPhaseStateMask */,\n creationMode: !!(flags & 4 /* CreationMode */),\n firstViewPass: !!(flags & 8 /* FirstLViewPass */),\n checkAlways: !!(flags & 16 /* CheckAlways */),\n dirty: !!(flags & 64 /* Dirty */),\n attached: !!(flags & 128 /* Attached */),\n destroyed: !!(flags & 256 /* Destroyed */),\n isRoot: !!(flags & 512 /* IsRoot */),\n indexWithinInitPhase: flags >> 11 /* IndexWithinInitPhaseShift */,\n };\n }", "title": "" }, { "docid": "d186d3e8d0ab65398ce495022d0b53cf", "score": "0.57634443", "text": "get flags() {\n const flags = this._raw_lView[FLAGS];\n return {\n __raw__flags__: flags,\n initPhaseState: flags & 3 /* InitPhaseStateMask */,\n creationMode: !!(flags & 4 /* CreationMode */),\n firstViewPass: !!(flags & 8 /* FirstLViewPass */),\n checkAlways: !!(flags & 16 /* CheckAlways */),\n dirty: !!(flags & 64 /* Dirty */),\n attached: !!(flags & 128 /* Attached */),\n destroyed: !!(flags & 256 /* Destroyed */),\n isRoot: !!(flags & 512 /* IsRoot */),\n indexWithinInitPhase: flags >> 11 /* IndexWithinInitPhaseShift */,\n };\n }", "title": "" }, { "docid": "d186d3e8d0ab65398ce495022d0b53cf", "score": "0.57634443", "text": "get flags() {\n const flags = this._raw_lView[FLAGS];\n return {\n __raw__flags__: flags,\n initPhaseState: flags & 3 /* InitPhaseStateMask */,\n creationMode: !!(flags & 4 /* CreationMode */),\n firstViewPass: !!(flags & 8 /* FirstLViewPass */),\n checkAlways: !!(flags & 16 /* CheckAlways */),\n dirty: !!(flags & 64 /* Dirty */),\n attached: !!(flags & 128 /* Attached */),\n destroyed: !!(flags & 256 /* Destroyed */),\n isRoot: !!(flags & 512 /* IsRoot */),\n indexWithinInitPhase: flags >> 11 /* IndexWithinInitPhaseShift */,\n };\n }", "title": "" }, { "docid": "d186d3e8d0ab65398ce495022d0b53cf", "score": "0.57634443", "text": "get flags() {\n const flags = this._raw_lView[FLAGS];\n return {\n __raw__flags__: flags,\n initPhaseState: flags & 3 /* InitPhaseStateMask */,\n creationMode: !!(flags & 4 /* CreationMode */),\n firstViewPass: !!(flags & 8 /* FirstLViewPass */),\n checkAlways: !!(flags & 16 /* CheckAlways */),\n dirty: !!(flags & 64 /* Dirty */),\n attached: !!(flags & 128 /* Attached */),\n destroyed: !!(flags & 256 /* Destroyed */),\n isRoot: !!(flags & 512 /* IsRoot */),\n indexWithinInitPhase: flags >> 11 /* IndexWithinInitPhaseShift */,\n };\n }", "title": "" }, { "docid": "3a7da1f7fd332b49f171374363ea1c6c", "score": "0.56857616", "text": "function GetServerData(arg, context) {\n var splitArgs = arg.split(\"|\");\n var actionFlag = splitArgs[0];\n\n if(splitArgs.length > 2) {\n alert(splitArgs[2]);\n return;\n }\n\n switch(actionFlag) {\n case \"update-at-bat\":\n console.log(\"UPDATED!\");\n break;\n default:\n console.log(\"Default!\");\n };\n}", "title": "" }, { "docid": "1e5242ed63c0afcfcf354a82e16bfc8a", "score": "0.56363744", "text": "function setFlags() {\n\t\t\t\t\tflagN = !!(P & 0x80);\n\t\t\t\t\tflagV = !!(P & 0x40);\n\t\t\t\t\tflagB = !!(P & 0x10);\n\t\t\t\t\tflagD = !!(P & 0x08);\n\t\t\t\t\tflagI = !!(P & 0x04);\n\t\t\t\t\tflagZ = !!(P & 0x02);\n\t\t\t\t\tflagC = !!(P & 0x01);\n\t\t\t\t}", "title": "" }, { "docid": "1bcb951f5daaa7632dbfe8f1163161d0", "score": "0.562743", "text": "parseFlagsHex(flags) {\n const flagsInt = parseInt(flags, 16)\n return Object.keys(FLAGS).reduce((o, key) => {\n o[key] = Boolean(flagsInt & FLAGS[key])\n return o\n }, {})\n }", "title": "" }, { "docid": "149ae305a6fa5a831f4c8bb2a6b0cc02", "score": "0.55657864", "text": "function sendFlags() {\n processForm(flags.q1_valid, flags.q2_valid, flags.q3_valid, flags.q4_valid, flags.q5_valid, flags.q6_valid);\n}", "title": "" }, { "docid": "b0cb01e985485ae1b379e748b4643c52", "score": "0.5500418", "text": "get ConfigFlags() { return this.native.ConfigFlags; }", "title": "" }, { "docid": "6e53c1c66d38518e9365a3197697e4df", "score": "0.54740024", "text": "static getServerInfos(request, reply) {\n reply({\n version: request.server.version,\n load: request.server.load,\n });\n }", "title": "" }, { "docid": "316a81bfd6ca7d7fbac8cebfdf148ac4", "score": "0.5379982", "text": "get protocolFlags() {\n \treturn this.URI_LOADABLE_BY_ANYONE;\n }", "title": "" }, { "docid": "e0c12abb9d79ba2d6b37d8ac7e94ebc2", "score": "0.53759974", "text": "server_features() {\n return this.request('server.features', []);\n }", "title": "" }, { "docid": "0e6781ab5b88f8aaa572b26d3cc1f9db", "score": "0.53667116", "text": "function processChannelModes(){\n\t\t\t\tvar usr = parseUser(bits[0]); //user that set the mode\n\t\t\t\tvar chan = bits[2]; //channel mode was set for\n\t\t\t\tvar channel = burd.getChannel(svr.id, bits[2], \"channel\");\n\t\t\t\tvar modeBits = data.substr(bits[0].length + bits[1].length + bits[2].length + 3).split(\" \");\n\t\t\t\tvar params = data.substr(bits[0].length + bits[1].length + bits[2].length + bits[3].length + 4).split(\" \");\n\t\t\t\tvar flags = modeBits[0].split(\"\");\n\t\t\t\tvar state = true;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\tif a flag is + then we set state to true, otherwise we set it to false. if state is true then we know\n\t\t\t\t\tto add the mode, otherwse we remove it.\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\tfor(var i in flags){\n\t\t\t\t\tswitch(flags[i]){\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"+\":\n\t\t\t\t\t\t\tstate = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"-\":\n\t\t\t\t\t\t\tstate = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase \"o\":\n\t\t\t\t\t\tcase \"v\":\n\t\t\t\t\t\t\tfor(var a in channel.users){\n\t\t\t\t\t\t\t\tif(channel.users[a][0].toLowerCase() == params[0].toLowerCase()){\n\t\t\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t\t\t\tflag [o|v] for param[0] which matches channel.users[a][1].\n\t\t\t\t\t\t\t\t\t\tso if state=true we add an op flag, otherwise we remove it.\n\t\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\t\tif(state == true){\n\t\t\t\t\t\t\t\t\t\tif(channel.users[a][1].indexOf(flagToSyn(flags[i]))==-1) channel.users[a][1] += flagToSyn(flags[i]);\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tif(channel.users[a][1].indexOf(flagToSyn(flags[i]))>-1) channel.users[a][1] = channel.users[a][1].replace(flagToSyn(flags[i]), \"\");\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\t/* we now need to remove the param */\n\t\t\t\t\t\t\tparams.splice(0, 1);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n \n function flagToSyn(flag){\n switch(flag){\n case \"o\":\n return \"@\";\n case \"v\":\n return \"+\";\n case \"q\":\n return \"~\";\n case \"a\":\n return \"&\";\n case \"h\":\n return \"%\";\n }\n }\n\t\t\t\tburd.sortUsers(channel, svr);\n $(\"div.server[sid='\" + svr.id + \"'] div.item-selected[channel='\" + formatAttr(channel.channel.toLowerCase()) + \"']\").click();\n\t\t\t}", "title": "" }, { "docid": "bd42e23ed414e2bd120bb09a3f86fe29", "score": "0.53534585", "text": "get BackendFlags() { return this.native.BackendFlags; }", "title": "" }, { "docid": "2ad69633b2e9480145f36aeb40804826", "score": "0.53195345", "text": "set_flag() {\n log(\"set_flag() (this.useFlags = %s; this.vpnStatus = %s; this.vpnName = %s; this.labelWhenVPNisOff = %s)\".format(this.useFlags, this.vpnStatus, this.vpnName, \"\"+this.labelWhenVPNisOff));\n if (this.useFlags === false) {\n this.hideLabel();\n return\n }\n\n let flagList = this.s.getValue(\"flagList\");\n this.showLabel();\n\n if (this.vpnStatus === \"off\") {\n switch(this.labelWhenVPNisOff) {\n case \"NoLabel\":\n this.hideLabel();\n return;\n case \"LabelWithoutFlag\": {\n this.set_applet_label(DEFAULT_APPLET_LABEL);\n return;\n }\n case \"LabelWithFlag\": {\n for (let fl of flagList) {\n if ((\"\"+fl.vpnName == _(\"(None)\")) && (fl.confirmed === true)) {\n this.set_applet_label(\"\"+fl.flag);\n return\n }\n }\n IpGateway.getCountryCodeInfo( (countryCode) => this.update_flag_info(countryCode));\n return;\n }\n }\n } else {\n if (this.vpnStatus === \"on\") {\n for (let fl of flagList) {\n if ((\"\"+fl.vpnName == \"\"+this.vpnName) && (fl.confirmed === true)) {\n this.set_applet_label(\"\"+fl.flag);\n return\n }\n }\n }\n }\n IpGateway.getCountryCodeInfo( (countryCode) => this.update_flag_info(countryCode));\n }", "title": "" }, { "docid": "1f997f2a9e98b04b3595c9693361a6d0", "score": "0.5317742", "text": "function kn_hacks(flags)\n{\n return kn_options(flags);\n}", "title": "" }, { "docid": "0b6dbc8966d5a0e4a2887bf15c5f3b4c", "score": "0.52813464", "text": "static get HasFlags() {\n return true;\n }", "title": "" }, { "docid": "bfc30c957a8155e9760bc1db6ced50bd", "score": "0.5221642", "text": "function FlagList() {\n const { socket } = useSocket();\n const { flags, setFlags, showFlags } = useFlags();\n\n socket.on('adminRoutine', (o) => {\n if (!localStorage.getItem('moving')) setFlags(o.flags);\n });\n\n return showFlags ? (\n flags.map((flag) => <FlagMarker key={flag.id} flag={flag} />)\n ) : (\n <></>\n );\n}", "title": "" }, { "docid": "dcff36e70eb26a6088a2450d0eae541a", "score": "0.5136483", "text": "getFlagsFen() {\n let flags = \"\";\n // Castling flags\n for (let c of [\"w\", \"b\"])\n flags += this.castleFlags[c].map(V.CoordToColumn).join(\"\");\n return flags;\n }", "title": "" }, { "docid": "a0555fc566f26f82fcf513ac22f7365c", "score": "0.5116599", "text": "function inspectServerBehavior(sbObj) {\r\n //the recordset command handles inspecting\r\n}", "title": "" }, { "docid": "ad2932b10e74da0bf77fbfce24d994f7", "score": "0.5104439", "text": "function intercept() {\n // Check if frida has located the JNI\n if (Java.available) {\n // Switch to the Java context\n Java.perform(function() {\n const myreceiver = Java.use('b3nac.injuredandroid.FlagFiveReceiver');\n //We need to overwrite $ instead of $new, since $new = allocate + init.\n myreceiver.onReceive.overload('android.content.Context', 'android.content.Intent').implementation = function (context, intent) {\n\t\tconsole.log('[+] received a broadcast');\n\t\tthis.onReceive( context, intent );\n // var flag = this.getData()\n\t\t// flag is a byte array, need to convert to String, don't you just love Java?\n\t\t//var result = \"\";\n\t\t//for(var i = 0; i < flag.length; ++i){\n \t\t// result += (String.fromCharCode(flag[i] & 0xff)); // here!!\n\t\t//}\n //console.log('[+] decoded data (flag) ' + result);\n\t\t//return flag;\n }\n console.log('[+] FlagFiveReceiver.onReceive hooked')\n\n }\n )}\n\n}", "title": "" }, { "docid": "345fa3619810479bb14285998e746eb7", "score": "0.5045298", "text": "get receiveBitCount() { return this.options.receiveBitCount }", "title": "" }, { "docid": "267d7d1e503dc6a80e0a459fa1bda451", "score": "0.501211", "text": "get globalIlluminationFlags() {}", "title": "" }, { "docid": "4df32e5cd6e2ac374e4d94888c2fea79", "score": "0.5010208", "text": "flagPost(req, res) {\n joi.validate(req.body, flagschema, (err, value) => {\n if (err) return res.send(err.details[0].message);\n const flg = {\n id: flags.length + 1,\n car_id: value.car_id,\n reason: value.reason,\n description: value.description,\n };\n flags.push(flg);\n return res.status(200).send(flg);\n });\n }", "title": "" }, { "docid": "f408c6c4da43e67df345b528e96a020b", "score": "0.49939314", "text": "async request_server_info() {\n const message = Message.create('SERVER-INFO-REQ', {});\n const reply = await this._connection.send_with_reply(message);\n return reply.content;\n }", "title": "" }, { "docid": "2ceba12e61f4f000cc7d4982dbb35f40", "score": "0.49875078", "text": "function getFlags(city) {\n //nameOfCityContainer.append(flag.City.city);\n cityId = city || \"\";\n if (cityId) {\n cityId = \"/?city_id=\" + cityId;\n }\n $.get(\"/api/flags\" + cityId, function(data) {\n console.log(\"Flags\", data);\n flags = data;\n if (!flags || !flags.length) {\n displayEmpty(city);\n }\n else {\n initializeRows();\n }\n });\n }", "title": "" }, { "docid": "195e38510554abc9d04b3b83472a1b36", "score": "0.49473265", "text": "initializeCommandServer() {\n this.app.all('/command', (req, res) => {\n res.setHeader('content-type', 'text/plain');\n let response = '';\n Object.keys(req.query).forEach((command) => {\n const value = decodeURIComponent(req.query[command]);\n if (command === 'execute') {\n this.execute(value).then((result) => { response = result; });\n } else if (command === 'mount') {\n this.setContent(value);\n } else {\n response = 'Unknown command';\n }\n });\n res.send(response);\n });\n }", "title": "" }, { "docid": "9dcb0435ebcf70dc4d3948e23c7e3377", "score": "0.4938602", "text": "requestSettings() {}", "title": "" }, { "docid": "87a87147486caa9ca6237a43e41988e8", "score": "0.49343538", "text": "async readP2WDB (flags) {\n try {\n // Centralized mode.\n if (flags.centralized) {\n const result = await axios.get(\n `${P2WDB_SERVER}/entry/hash/${flags.hash}`\n )\n console.log(`data: ${JSON.stringify(result.data, null, 2)}`)\n\n return\n }\n\n // Decentrlaized mode\n const result = await this.p2wdbService.getEntry(flags.hash)\n console.log('data: ', result)\n } catch (err) {\n console.error('Error in readP2WDB()')\n throw err\n }\n }", "title": "" }, { "docid": "83e9ca9a1d84e8b189084ea43f610de1", "score": "0.49235782", "text": "getInfo() {\n if (this.bufferedBytes < 2) {\n this.loop = false;\n return;\n }\n\n const buffer = this.consume(2);\n\n if ((buffer[0] & 0x30) !== 0x0) {\n error('RSV2 and RSV3 must be clear', 1002);\n }\n\n const compressed = (buffer[0] & 0x40) === 0x40;\n\n if (compressed) {\n // && !decompressionEnabled\n error('RSV1 must be clear', 1002);\n }\n\n this.fin = (buffer[0] & 0x80) === 0x80;\n this.opCode = buffer[0] & 0xf;\n this.payloadLength = buffer[1] & 0x7f;\n\n if (this.opCode === opCodes.CONTINUATION) {\n if (compressed) {\n error('RSV1 must be clear', 1002);\n }\n\n if (!this.fragmented) {\n error('Invalid opCode 0', 1002);\n }\n\n this.opCode = this.fragmented;\n } else if (this.opCode === opCodes.TEXT || this.opCode === opCodes.BINARY) {\n if (this.fragmented) {\n error(`Invalid opCode ${this.opCode}`, 1002);\n }\n\n this.compressed = compressed;\n } else if (isControlOpCode(this.opCode)) {\n if (!this.fin) {\n error('FIN must be set', 1002);\n }\n\n if (compressed) {\n error('RSV1 must be clear', 1002);\n }\n\n if (this.payloadLength > 0x7d) {\n error(`Invalid payload length ${this.payloadLength}`, 1002);\n }\n } else {\n error(`Invalid opCode ${this.opCode}`, 1002);\n }\n\n if (!this.fin && !this.fragmented) {\n this.fragmented = this.opCode;\n }\n\n this.masked = (buffer[1] & 0x80) === 0x80;\n const length = this.payloadLength;\n\n if (length === 126) {\n this.state = states.GET_PAYLOAD_LENGTH_16;\n } else if (length === 127) {\n this.state = states.GET_PAYLOAD_LENGTH_64;\n } else {\n return this.haveLength();\n }\n }", "title": "" }, { "docid": "d743077a1c0a600fdcf3abf12a7d0565", "score": "0.49033827", "text": "function _getBitFromFlags(gl, flags) {\n\t\tvar bit = /* None */0;\n\t\tif (flags.includes(\"COLOR_BUFFER\")) {\n\t\t\tvar match = bit;\n\t\t\tbit = match ? /* Some */[match[0] | gl.COLOR_BUFFER_BIT] : /* Some */[gl.COLOR_BUFFER_BIT];\n\t\t}\n\t\tif (flags.includes(\"DEPTH_BUFFER\")) {\n\t\t\tvar match$1 = bit;\n\t\t\tbit = match$1 ? /* Some */[match$1[0] | gl.DEPTH_BUFFER_BIT] : /* Some */[gl.DEPTH_BUFFER_BIT];\n\t\t}\n\t\tif (flags.includes(\"STENCIL_BUFFER\")) {\n\t\t\tvar match$2 = bit;\n\t\t\tbit = match$2 ? /* Some */[match$2[0] | gl.STENCIL_BUFFER_BIT] : /* Some */[gl.STENCIL_BUFFER_BIT];\n\t\t}\n\t\treturn getExn(bit);\n\t}", "title": "" }, { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.49031302", "text": "get hideFlags() {}", "title": "" }, { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.49031302", "text": "get hideFlags() {}", "title": "" }, { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.49031302", "text": "get hideFlags() {}", "title": "" }, { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.49031302", "text": "get hideFlags() {}", "title": "" }, { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.49031302", "text": "get hideFlags() {}", "title": "" }, { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.49031302", "text": "get hideFlags() {}", "title": "" }, { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.49031302", "text": "get hideFlags() {}", "title": "" }, { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.49031302", "text": "get hideFlags() {}", "title": "" }, { "docid": "2e48e38dbece8ff7321f1699209d9e4b", "score": "0.4902816", "text": "function lightMode(){\n var path = url + '/lights'\n httpDO(path, 'GET', checkLightMode )\n\n}", "title": "" }, { "docid": "0e6cc331352658e62b90e4c32457818a", "score": "0.48902524", "text": "function getWbStatusBool(req)\n {\n logDebug(\"getWbStatusBool: \", req) ;\n var sts = getWbStatus(req) ;\n if ( sts != null )\n {\n switch (sts[2])\n {\n case \"False\": sts[2] = 0 ; break ;\n case \"True\": sts[2] = 1 ; break ;\n default: return null ;\n }\n return sts ;\n }\n return null ;\n }", "title": "" }, { "docid": "e198073a650e66450158e13d76fcb5b9", "score": "0.48762304", "text": "function fillFlags()\n{\n\t//Clears out \"flags\" array\n\tflags=[];\n\t\n\t//Assigns flag object\n\tfor(var i = 1;i < 21; i++) //change for # final flags\n\t{\n\t\tflags.push(window[\"flag\" + i]); //window[] converts string to object\n\t}\n\n}//END fillFlags", "title": "" }, { "docid": "8eb0a4ad9019a7c35daa1dba302fa779", "score": "0.48740995", "text": "function setupFlags() {\n const flagsJSON = localStorage.getItem(StoreName.Flags);\n if (flagsJSON) PageData.Flags = JSON.parse(flagsJSON);\n\n const buttons = document.getElementsByClassName('flag-button');\n for (const button of buttons) {\n button.addEventListener('click', flagClick);\n\n const link = button.nextSibling;\n const filename = link.pathname.slice(1, -4);\n\n // TODO: Hover preview?\n // const preview = document.createElement('img');\n // preview.src = '/' + filename + '.svg';\n // preview.height = \"200\";\n // link.appendChild(preview);\n\n const flagged = (PageData.Flags.indexOf(filename) !== -1);\n updateFlag(button, flagged);\n }\n\n document.getElementById('clear-all')\n .addEventListener('click', clearFlagsClick);\n\n document.getElementById('flag-all')\n .addEventListener('click', flagAllClick);\n}", "title": "" }, { "docid": "083d5ec62e2abf158c170d531365cd81", "score": "0.484738", "text": "function kn_options(flags)\n{\n if ((flags == null) && (typeof(flags) == 'undefined'))\n kn._options = true;\n else\n kn._options = flags;\n}", "title": "" }, { "docid": "86523da41f086222eaef5b3c23eef18c", "score": "0.4845961", "text": "function getHttpVars(){\n\thttpVars = location.search.replace(\"?\", \"&\").split(\"&\");\n\tfor(var i = 0; i < httpVars.length; i++){\n\t\thttpVars[i] = httpVars[i].split(\"=\");\n\t\t\n\t\tif(httpVars[i][0] == \"user\"){\n\t\t\tuserName = httpVars[i][1];\n\t\t\trun();\n\t\t}\n\t\t\n\t\tif(httpVars[i][0] == \"size\"){\n\t\t\tsize = httpVars[i][1];\n\t\t}\n\t\t\n\t\tif(httpVars[i][0] == \"set\"){\n\t\t\tBset = httpVars[i][1];\n\t\t}\n\t\t\n\t\tif(httpVars[i][0] == \"skipGag\"){\n\t\t\tskipGag = true;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c06623affdacf07fee8ea77c469f83c1", "score": "0.48379132", "text": "function flagSet() {\n\t\t// long flag form?\n\t\tif (cursor < input.length-1 && input[cursor+1] == \"-\") {\n\t\t\treturn longFlag();\n\t\t}\n\n\t\t// if not, parse short flag form\n\t\tcursor++; // skip leading dash\n\t\twhile (cursor < input.length && !whitespace(input[cursor]))\n\t\t{\n\t\t\tvar flagName = input[cursor];\n\t\t\tif (typeof result[flagName] == 'undefined') {\n\t\t\t\tresult[flagName] = [];\n\t\t\t}\n\t\t\tcursor++; // skip the flag name\n\t\t\tif (boolFlag(flagName))\n\t\t\t\tresult[flagName] = true;\n\t\t\telse if (Array.isArray(result[flagName]))\n\t\t\t\tresult[flagName].push(nextString());\n\t\t}\n\t}", "title": "" }, { "docid": "575365b0f0db2c183635b15d56234f76", "score": "0.48220778", "text": "function Flags() {\n ;\n}", "title": "" }, { "docid": "2908cff914813a8efa05d5d5f15366b8", "score": "0.48110062", "text": "async features() {\n const res = await this.sendIgnoringError(\"FEAT\");\n const features = new Map();\n // Not supporting any special features will be reported with a single line.\n if (res.code < 400 && (0, parseControlResponse_1.isMultiline)(res.message)) {\n // The first and last line wrap the multiline response, ignore them.\n res.message.split(\"\\n\").slice(1, -1).forEach(line => {\n // A typical lines looks like: \" REST STREAM\" or \" MDTM\".\n // Servers might not use an indentation though.\n const entry = line.trim().split(\" \");\n features.set(entry[0], entry[1] || \"\");\n });\n }\n return features;\n }", "title": "" }, { "docid": "2bd70febba2d933134e2e8494c9c7e3e", "score": "0.47993046", "text": "function getZWDDetFromServer(request)\n{\n\tvar array = [];\n\n\t$.ajax({\n\t\ttype:'GET',\n\t\turl:g_urlGetAPStatus,\n\t\tdata:request,\n\t\tasync:false,\n\t\tsuccess:function(result) {\n\t\t\tif (isHTTPDWebserver == 1)\n\t\t\t\tarray = result;\n\t\t\telse\n\t\t\t\tarray = JSON.parse(result);\n\t\t\tparseZWDResponse(array);\n\t\t}\n\t});\n\tarray = [];\n}", "title": "" }, { "docid": "ba6d90921c385d579f620f07dc975c22", "score": "0.47916567", "text": "_setFlag(flag) {\n // tslint:disable-next-line\n this._status |= flag;\n }", "title": "" }, { "docid": "758870491d37b1e1a445a5e09d169dc0", "score": "0.47872356", "text": "function requestInfo() {\n chrome.send('requestInfo');\n }", "title": "" }, { "docid": "060c87f46e33d3ab20e8563527c64b7a", "score": "0.47815806", "text": "function getAIMprotocol(){\n var xHttp = new XMLHttpRequest();\n\n xHttp.onload = aimResponseHandler;\n xHttp.open(\"GET\", \"/patterns/auth-status\", true);\n xHttp.send();\n }", "title": "" }, { "docid": "4bdeff807c7cbb4ca7b62796cdc23ebb", "score": "0.47787565", "text": "getInfo () {\n if (!this.hasBufferedBytes(2)) return;\n\n const buf = this.readBuffer(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this.error(new Error('RSV2 and RSV3 must be clear'), 1002);\n return;\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this.extensions[PerMessageDeflate_1.extensionName]) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n this.fin = (buf[0] & 0x80) === 0x80;\n this.opcode = buf[0] & 0x0f;\n this.payloadLength = buf[1] & 0x7f;\n\n if (this.opcode === 0x00) {\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (!this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n } else {\n this.opcode = this.fragmented;\n }\n } else if (this.opcode === 0x01 || this.opcode === 0x02) {\n if (this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n this.compressed = compressed;\n } else if (this.opcode > 0x07 && this.opcode < 0x0b) {\n if (!this.fin) {\n this.error(new Error('FIN must be set'), 1002);\n return;\n }\n\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (this.payloadLength > 0x7d) {\n this.error(new Error('invalid payload length'), 1002);\n return;\n }\n } else {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n if (!this.fin && !this.fragmented) this.fragmented = this.opcode;\n\n this.masked = (buf[1] & 0x80) === 0x80;\n\n if (this.payloadLength === 126) this.state = GET_PAYLOAD_LENGTH_16;\n else if (this.payloadLength === 127) this.state = GET_PAYLOAD_LENGTH_64;\n else this.haveLength();\n }", "title": "" }, { "docid": "b6f2c339fbd28a5bbf492f137f933756", "score": "0.47679934", "text": "function readServerSettings() {\n if(global.localStorage.server !== undefined) {\n //User has explicitly set the PI server via settings so use this\n global.pimon_config.server = global.localStorage.server;\n }else {\n if(window.location.hostname !== \"localhost\") {\n global.pimon_config.server = window.location.protocol + \"//\" + window.location.hostname + \":\" + window.location.port;\n } else {\n //running from local host so default to the prototype system\n global.pimon_config.server = \"http://app1poy.inpex.com.au:58000\";\n }\n }\n global.pimon_config.server_client = global.localStorage.server_client || \"030\";\n global.pimon_config.erp_server = global.localStorage.erp_server || \"http://app-saperd.inpex.com.au:8002\";\n global.pimon_config.dev_user = global.localStorage.dev_user || \"\";\n global.pimon_config.dev_pass = global.localStorage.dev_pass || \"\";\n\n if (global.pimon_config.server === \"\") {\n $(\"#js-alert-connection\").show(500);\n }\n }", "title": "" }, { "docid": "86ca35825b9c419fc0b56bf6b8ca5a40", "score": "0.4764479", "text": "GetParticleFlags(index) {\n return this.m_flagsBuffer.data[index];\n }", "title": "" }, { "docid": "adacb697b0e3ae7a8f699e001f36c8e9", "score": "0.47623244", "text": "function countFlags(flags) {\n return Object.keys(flags).length;\n}", "title": "" }, { "docid": "6d94f0887bd270d54f2ca2e7f17d8312", "score": "0.4761849", "text": "function setServerInformation(req, res){\n data = {}\n data.url = 'Server Information'\n data.queryRequest = req.query\n return data\n}", "title": "" }, { "docid": "23cda5c878fc171a03665cd4382169a1", "score": "0.4761459", "text": "function grab(flag){ // this will take a greeting as a flag\n var index= process.argv.indexOf(flag); // here we are getting the index of the flag \n return (index === -1) ? null : process.argv[index+1]; // we are checking weather the index equalls to negative else we are returning the \n}", "title": "" }, { "docid": "af3b63fe2f583b5affcf37ced1dbbd32", "score": "0.47558448", "text": "function getFlag(name) {\n // flags from @KOP-XIAO: https://github.com/KOP-XIAO/QuantumultX/blob/master/Scripts/resource-parser.js\n const flags = {\n \"🇦🇨\": [\"AC\"],\n \"🇦🇹\": [\"奥地利\", \"维也纳\"],\n \"🇦🇺\": [\"AU\", \"Australia\", \"Sydney\", \"澳大利亚\", \"澳洲\", \"墨尔本\", \"悉尼\"],\n \"🇧🇪\": [\"BE\", \"比利时\"],\n \"🇧🇬\": [\"保加利亚\", \"Bulgaria\"],\n \"🇧🇷\": [\"BR\", \"Brazil\", \"巴西\", \"圣保罗\"],\n \"🇨🇦\": [\n \"CA\",\n \"Canada\",\n \"Waterloo\",\n \"加拿大\",\n \"蒙特利尔\",\n \"温哥华\",\n \"楓葉\",\n \"枫叶\",\n \"滑铁卢\",\n \"多伦多\",\n ],\n \"🇨🇭\": [\"瑞士\", \"苏黎世\", \"Switzerland\"],\n \"🇩🇪\": [\"DE\", \"German\", \"GERMAN\", \"德国\", \"德國\", \"法兰克福\"],\n \"🇩🇰\": [\"丹麦\"],\n \"🇪🇸\": [\"ES\", \"西班牙\", \"Spain\"],\n \"🇪🇺\": [\"EU\", \"欧盟\", \"欧罗巴\"],\n \"🇫🇮\": [\"Finland\", \"芬兰\", \"赫尔辛基\"],\n \"🇫🇷\": [\"FR\", \"France\", \"法国\", \"法國\", \"巴黎\"],\n \"🇬🇧\": [\"UK\", \"GB\", \"England\", \"United Kingdom\", \"英国\", \"伦敦\", \"英\"],\n \"🇲🇴\": [\"MO\", \"Macao\", \"澳门\", \"CTM\"],\n \"🇭🇺\": [\"匈牙利\", \"Hungary\"],\n \"🇭🇰\": [\n \"HK\",\n \"Hongkong\",\n \"Hong Kong\",\n \"香港\",\n \"深港\",\n \"沪港\",\n \"呼港\",\n \"HKT\",\n \"HKBN\",\n \"HGC\",\n \"WTT\",\n \"CMI\",\n \"穗港\",\n \"京港\",\n \"港\",\n ],\n \"🇮🇩\": [\"Indonesia\", \"印尼\", \"印度尼西亚\", \"雅加达\"],\n \"🇮🇪\": [\"Ireland\", \"爱尔兰\", \"都柏林\"],\n \"🇮🇳\": [\"India\", \"印度\", \"孟买\", \"Mumbai\"],\n \"🇰🇵\": [\"KP\", \"朝鲜\"],\n \"🇰🇷\": [\"KR\", \"Korea\", \"KOR\", \"韩国\", \"首尔\", \"韩\", \"韓\"],\n \"🇱🇻\": [\"Latvia\", \"Latvija\", \"拉脱维亚\"],\n \"🇲🇽️\": [\"MEX\", \"MX\", \"墨西哥\"],\n \"🇲🇾\": [\"MY\", \"Malaysia\", \"马来西亚\", \"吉隆坡\"],\n \"🇳🇱\": [\"NL\", \"Netherlands\", \"荷兰\", \"荷蘭\", \"尼德蘭\", \"阿姆斯特丹\"],\n \"🇵🇭\": [\"PH\", \"Philippines\", \"菲律宾\"],\n \"🇷🇴\": [\"RO\", \"罗马尼亚\"],\n \"🇷🇺\": [\n \"RU\",\n \"Russia\",\n \"俄罗斯\",\n \"俄羅斯\",\n \"伯力\",\n \"莫斯科\",\n \"圣彼得堡\",\n \"西伯利亚\",\n \"新西伯利亚\",\n \"京俄\",\n \"杭俄\",\n ],\n \"🇸🇦\": [\"沙特\", \"迪拜\"],\n \"🇸🇪\": [\"SE\", \"Sweden\"],\n \"🇸🇬\": [\n \"SG\",\n \"Singapore\",\n \"新加坡\",\n \"狮城\",\n \"沪新\",\n \"京新\",\n \"泉新\",\n \"穗新\",\n \"深新\",\n \"杭新\",\n \"广新\",\n ],\n \"🇹🇭\": [\"TH\", \"Thailand\", \"泰国\", \"泰國\", \"曼谷\"],\n \"🇹🇷\": [\"TR\", \"Turkey\", \"土耳其\", \"伊斯坦布尔\"],\n \"🇹🇼\": [\n \"TW\",\n \"Taiwan\",\n \"台湾\",\n \"台北\",\n \"台中\",\n \"新北\",\n \"彰化\",\n \"CHT\",\n \"台\",\n \"HINET\",\n ],\n \"🇺🇸\": [\n \"US\",\n \"USA\",\n \"America\",\n \"United States\",\n \"美国\",\n \"美\",\n \"京美\",\n \"波特兰\",\n \"达拉斯\",\n \"俄勒冈\",\n \"凤凰城\",\n \"费利蒙\",\n \"硅谷\",\n \"矽谷\",\n \"拉斯维加斯\",\n \"洛杉矶\",\n \"圣何塞\",\n \"圣克拉拉\",\n \"西雅图\",\n \"芝加哥\",\n \"沪美\",\n \"哥伦布\",\n \"纽约\",\n ],\n \"🇻🇳\": [\"VN\", \"越南\", \"胡志明市\"],\n \"🇮🇹\": [\"Italy\", \"IT\", \"Nachash\", \"意大利\", \"米兰\", \"義大利\"],\n \"🇿🇦\": [\"South Africa\", \"南非\"],\n \"🇦🇪\": [\"United Arab Emirates\", \"阿联酋\"],\n \"🇯🇵\": [\n \"JP\",\n \"Japan\",\n \"日\",\n \"日本\",\n \"东京\",\n \"大阪\",\n \"埼玉\",\n \"沪日\",\n \"穗日\",\n \"川日\",\n \"中日\",\n \"泉日\",\n \"杭日\",\n \"深日\",\n \"辽日\",\n \"广日\",\n ],\n \"🇦🇷\": [\"AR\", \"阿根廷\"],\n \"🇳🇴\": [\"Norway\", \"挪威\", \"NO\"],\n \"🇨🇳\": [\n \"CN\",\n \"China\",\n \"回国\",\n \"中国\",\n \"江苏\",\n \"北京\",\n \"上海\",\n \"广州\",\n \"深圳\",\n \"杭州\",\n \"徐州\",\n \"青岛\",\n \"宁波\",\n \"镇江\",\n \"back\",\n ],\n \"🏳️‍🌈\": [\"流量\", \"时间\", \"应急\", \"过期\", \"Bandwidth\", \"expire\"],\n };\n for (let k of Object.keys(flags)) {\n if (flags[k].some((item) => name.indexOf(item) !== -1)) {\n return k;\n }\n }\n // no flag found\n const oldFlag = (name.match(\n /[\\uD83C][\\uDDE6-\\uDDFF][\\uD83C][\\uDDE6-\\uDDFF]/\n ) || [])[0];\n return oldFlag || \"🏴‍☠️\";\n }", "title": "" }, { "docid": "30f50ba620d1b684e113c6af44eec47b", "score": "0.47535607", "text": "function getCommandLineParams(cmdString) {\n\t// Parse out from URL querystring parameters\n\t//\n\t//\n\t//setLayerVisible.length=0;\n\tvar cmdString2 = cmdString.toUpperCase();\n\tvar startpos = 0;\n\tvar endpos = 0;\n\tvar pos = cmdString2.indexOf(\"HOST=\");\n\tif (pos!=-1) {\n\t\tstartpos = pos + 5;\n\t\tendpos = cmdString.indexOf(\"&\",startpos);\n\t\tif (endpos==-1) endpos = cmdString.length;\n\t\thostName = cmdString.substring(startpos,endpos);\n\t\tserverURL = parent.MapFrame.JSPViewerController + \"?ServiceName=\";\n\t}\n\tpos = cmdString2.indexOf(\"SERVICE=\"); // formally was MAPSERVICE=\n\tif (pos!=-1) {\n\t\tstartpos = pos + 8;\n\t\tendpos = cmdString.indexOf(\"&\",startpos);\n\t\tif (endpos==-1) endpos = cmdString.length;\n\t\timsURL = serverURL + cmdString.substring(startpos,endpos);\n\t}\n\tpos = cmdString2.indexOf(\"OVMAP=\"); // formally was OVMAPSERVICE=\n\tif (pos!=-1) {\n\t\tstartpos = pos + 6;\n\t\tendpos = cmdString.indexOf(\"&\",startpos);\n\t\tif (endpos==-1) endpos = cmdString.length;\n\t\timsOVURL = serverURL + cmdString.substring(startpos,endpos);\n\t}\n\tpos = cmdString2.indexOf(\"BOX=\");\n\tif (pos!=-1) {\n\t\tstartpos = pos + 4;\n\t\tendpos = cmdString.indexOf(\"&\",startpos);\n\t\tif (endpos==-1) endpos = cmdString.length;\n\t\tvar boxString = cmdString.substring(startpos,endpos);\n\t\t//alert(boxString);\n\t\tvar xyBox = boxString.split(\":\");\n\t\tif (xyBox.length==4) {\n\t\t\tstartLeft = parseFloat(xyBox[0]);\n\t\t\tstartBottom = parseFloat(xyBox[1]);\n\t\t\tstartRight = parseFloat(xyBox[2]);\n\t\t\tstartTop = parseFloat(xyBox[3]);\n\t\t\teLeft=startLeft;\n\t\t\teBottom=startBottom;\n\t\t\teRight=startRight;\n\t\t\teTop = startTop;\n\t\t}\n\t\t//xyBox=null;\n\t}\n\tpos = cmdString2.indexOf(\"MAXRECT=\");\n\tif (pos!=-1) {\n\t\tstartpos = pos + 8;\n\t\tendpos = cmdString.indexOf(\"&\",startpos);\n\t\tif (endpos==-1) endpos = cmdString.length;\n\t\tvar boxString = cmdString.substring(startpos,endpos);\n\t\t//alert(boxString);\n\t\tvar xyBox = boxString.split(\":\");\n\t\tif (xyBox.length==4) {\n\t\t\tlimitLeft = xyBox[0];\n\t\t\tlimitBottom = xyBox[1];\n\t\t\tlimitRight = xyBox[2];\n\t\t\tlimitTop = xyBox[3];\n\t\t}\n\t\t//xyBox=null;\n\t}\n\n\tpos = cmdString2.indexOf(\"SERVICENAME=\");\n\tif (pos > -1) {\n\t\tstartpos = pos + 12;\n\t\tendpos = cmdString.indexOf(\"&\",startpos);\n\t\tif (endpos==-1) endpos = cmdString.length;\n\t\tvar serviceName = cmdString.substring(startpos, endpos);\n\n\t\t//alert(\"service name=\" + serviceName);\n\t\tif (serviceName != \"\") {\n\t\t\tparent.ToolFrame.document.location = parent.MapFrame.ContextPath + \"/toolbar.htm\";\n\t\t\tparent.MapFrame.ServiceName = serviceName;\n\t\t\tvar theForm = parent.TOCFrame.document.forms[0];\n\t\t\ttheForm.Width.value = getWinWidth();\n\t\t\ttheForm.Height.value = getWinHeight();\n\t\t\ttheForm.Cmd.value = \"InitMap\";\n\t\t\ttheForm.ServiceName.value = serviceName;\n\t\t\ttheForm.action = parent.MapFrame.MOJServerController;\n\t\t\ttheForm.submit();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "564e9a5bb50faecfb4ab99592cd09833", "score": "0.4733762", "text": "function _requestOptions(command) {\n var options = {};\n if(command.insecure) {\n options.strictSSL = false;\n }\n if(command.type) {\n options.dataType = command.type;\n }\n return options;\n}", "title": "" }, { "docid": "2d3b0d46f160e37b627f5b99e7f61552", "score": "0.47311765", "text": "get availableFlags() {\n return this.mines - this.usedFlag\n }", "title": "" }, { "docid": "2d374afe4aa5cdde5d6bacc1ae60c145", "score": "0.47289622", "text": "getInfo () {\n if (!this.hasBufferedBytes(2)) return;\n\n const buf = this.readBuffer(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this.error(new Error('RSV2 and RSV3 must be clear'), 1002);\n return;\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this.extensions[PerMessageDeflate.extensionName]) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n this.fin = (buf[0] & 0x80) === 0x80;\n this.opcode = buf[0] & 0x0f;\n this.payloadLength = buf[1] & 0x7f;\n\n if (this.opcode === 0x00) {\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (!this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n } else {\n this.opcode = this.fragmented;\n }\n } else if (this.opcode === 0x01 || this.opcode === 0x02) {\n if (this.fragmented) {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n this.compressed = compressed;\n } else if (this.opcode > 0x07 && this.opcode < 0x0b) {\n if (!this.fin) {\n this.error(new Error('FIN must be set'), 1002);\n return;\n }\n\n if (compressed) {\n this.error(new Error('RSV1 must be clear'), 1002);\n return;\n }\n\n if (this.payloadLength > 0x7d) {\n this.error(new Error('invalid payload length'), 1002);\n return;\n }\n } else {\n this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);\n return;\n }\n\n if (!this.fin && !this.fragmented) this.fragmented = this.opcode;\n\n this.masked = (buf[1] & 0x80) === 0x80;\n\n if (this.payloadLength === 126) this.state = GET_PAYLOAD_LENGTH_16;\n else if (this.payloadLength === 127) this.state = GET_PAYLOAD_LENGTH_64;\n else this.haveLength();\n }", "title": "" }, { "docid": "173b99876cb149d5b780f204148ca85c", "score": "0.4699645", "text": "function get_current_command() {\n if (shutdown == false)\n {\n JSONrequest('/getcurrentcommand','POST', writecurrentcommand); //Once data is received it is passed to the writecurrentcommand\n }\n}", "title": "" }, { "docid": "0ce7a848eade9208d0f43de3d19e1145", "score": "0.46920344", "text": "function get_status() {\n //TODO\n\n }", "title": "" }, { "docid": "613b11a7af7ac8b7234612eeb17ca0b5", "score": "0.46817866", "text": "specialFlags() { return 0 }", "title": "" }, { "docid": "c8fad0e7871f4ce6394b2329f7c62708", "score": "0.46755695", "text": "static get BUFF_STAT() { return \"BUFF_STAT\"; }", "title": "" }, { "docid": "614d33e4685950fbdc2701ea9a0e9b37", "score": "0.466805", "text": "GetInputStatus()\r\n{\r\n return this.GetOneByteDataByPosFromChaKey(GET_CHAKEY_INFO,2); \r\n}", "title": "" }, { "docid": "fb3e3464450cef2fa8b9525debec053d", "score": "0.46642768", "text": "function getInfo() {\n return Utils.OSExecute(\"apx-mdm state\");\n}", "title": "" }, { "docid": "9cd329a81af3b6cc1a1671e6ea5c90dd", "score": "0.46477333", "text": "function convertToBitFlags(flags) {\n if (typeof flags === 'undefined' || typeof flags === 'number') {\n return flags;\n }\n // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in\n // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from\n // `InjectOptions` to `InjectFlags`.\n return 0 /* InternalInjectFlags.Default */ | (\n // comment to force a line break in the formatter\n flags.optional && 8 /* InternalInjectFlags.Optional */) | (flags.host && 1 /* InternalInjectFlags.Host */) | (flags.self && 2 /* InternalInjectFlags.Self */) | (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */);\n}", "title": "" }, { "docid": "47a7187f4fa07fd0b5c650bee105163d", "score": "0.46473873", "text": "function _parseOptionFlags(flags) {\n let shortFlag;\n let longFlag;\n // Use original very loose parsing to maintain backwards compatibility for now,\n // which allowed for example unintended `-sw, --short-word` [sic].\n const flagParts = flags.split(/[ |,]+/);\n if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift();\n longFlag = flagParts.shift();\n // Add support for lone short flag without significantly changing parsing!\n if (!shortFlag && /^-[^-]$/.test(longFlag)) {\n shortFlag = longFlag;\n longFlag = undefined;\n }\n return { shortFlag, longFlag };\n}", "title": "" }, { "docid": "6999c99d25f46d1125d7300e83fc0a46", "score": "0.46443447", "text": "function getOpenFlags(mode){\r\n\t\r\n\tvar flags = {\r\n\t\t// Create:true => si no existeix, crear-lo\r\n\t\tcreate: false,\r\n\t\t// Exclusive:true => si create=true, donar error en cas que ja existeixi\r\n\t\texclusive: false\r\n\t};\r\n\t\r\n\tswitch(mode){\r\n\t\t//Read: Obrir directori existent\r\n\t\tcase 'r':\r\n\t\tbreak;\r\n\t\t//Write: Crear directori sempre i quan no existeixi ja\r\n\t\tcase 'w':\r\n\t\t\tflags.create = true;\r\n\t\t\tflags.exclusive = true;\r\n\t\tbreak;\r\n\t\t//Append: Obrir directori existent, i si no existeix, crear-lo\r\n\t\tcase 'a':\r\n\t\tdefault:\r\n\t\t\tflags.create = true;\r\n\t\tbreak;\r\n\t}\r\n\t\r\n\treturn flags;\r\n\t\r\n}", "title": "" }, { "docid": "91da6fc166ab0d9dc093d7f550233311", "score": "0.4642191", "text": "function retrieveRemoteDebug()\n{\n\tvar tmpcokie1, tmpcokie2;\n\ttmpcokie1 = unescape($.cookie('remoteenabledflag'));\n\ttmpcokie2 = unescape($.cookie('remotedconip'));\n\tif(tmpcokie1.length > 0){\n\t\tisRemoteEnabled = Number(tmpcokie1.split(','));\n\t} else {\n\t\tisRemoteEnabled = 0;\n\t}\n\tif(tmpcokie2.length > 0){\n\t\tremoteIPAddress = tmpcokie2.split(',');\n\t} else {\n\t\tremoteIPAddress = '';\n\t}\n\tif (isRemoteDebuggingEnabled()) { // If remote debugging enabled, show message\n\t\t$(\"#frequencybandselector\").hide();\n\t\tvar errorelem = '<div id=\"errormsgid\" class=\"errormsg\">Remote debugging is enabled. Please go to <b>\"'+remoteIPAddress+'\"</b>.</div>';\n\t\t$(\"#showerrmessage\").append(errorelem);\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "71269dc9d5eb59030d22734ae5cbde7d", "score": "0.46399602", "text": "function processCommand () {\n var command = process.argv.slice (2);\n command.forEach (function (arg) {\n if (arg[0] === \"-\") {\n var elements = arg.split (\"=\");\n var key = elements[0].toUpperCase ();\n if ((key === \"-I\") || (key === \"--INBOUND\")) {\n inboundPort = elements[1];\n } else if ((key === \"-I\") || (key === \"--OUTBOUND\")) {\n outboundPort = elements[1];\n }\n }\n });\n}", "title": "" }, { "docid": "e30c2fdf585f64c53598a502694f330e", "score": "0.46379203", "text": "function cmd(c)\n{\n $.get( \"http://192.168.1.102/?cmd=\"+c+\"&getdata=pos\", cb);\n //$.get( \"http://192.168.1.102?getdata=pos\", cb);\n}", "title": "" }, { "docid": "26ef5704965b607f6ab073103c33243f", "score": "0.46359774", "text": "flags(...flags) {\n this.assert('.flags()', '<string...>', arguments);\n flags.forEach(v => {\n const firstSpace = v.indexOf(' ');\n if (!~firstSpace)\n return this.flag(v);\n let key = this.utils.toFlag(v.slice(0, firstSpace).trim());\n let val = v.slice(firstSpace + 1);\n if (!~val.indexOf('<') && !~val.indexOf('['))\n val = `[${val}]`;\n return this.flag(`${key} ${val}`);\n });\n return this;\n }", "title": "" }, { "docid": "9d0f2a8238f3c92d79618a1f3bcb191b", "score": "0.46353123", "text": "function getRenderFlags(view) {\n return view[FLAGS] & 1 /* CreationMode */ ? 1 /* Create */ | 2 /* Update */ :\n 2 /* Update */;\n}", "title": "" }, { "docid": "9d0f2a8238f3c92d79618a1f3bcb191b", "score": "0.46353123", "text": "function getRenderFlags(view) {\n return view[FLAGS] & 1 /* CreationMode */ ? 1 /* Create */ | 2 /* Update */ :\n 2 /* Update */;\n}", "title": "" }, { "docid": "9d0f2a8238f3c92d79618a1f3bcb191b", "score": "0.46353123", "text": "function getRenderFlags(view) {\n return view[FLAGS] & 1 /* CreationMode */ ? 1 /* Create */ | 2 /* Update */ :\n 2 /* Update */;\n}", "title": "" }, { "docid": "9339d2afc99fb29fdb74e52508bd6db3", "score": "0.46173635", "text": "@api\n getOutputCommand() {\n let flags = [];\n const flagNames = this.template.querySelectorAll('.flag-key');\n const flagValues = this.template.querySelectorAll('.flag-value');\n const valid = reportFormValidity([...flagNames, ...flagValues]);\n // get flag input values\n if (flagNames.length) {\n flagNames.forEach(flagKey => {\n flagValues.forEach(flagValue => {\n if (flagKey.name === flagValue.name) {\n if (flagValue.value) {\n flags.push(`--${flagKey.value}=${flagValue.value}`);\n } else {\n flags.push(`--${flagKey.value}`);\n }\n\n }\n })\n });\n }\n\n return {\n valid: valid,\n command: this.command,\n flags: [...flags]\n }\n }", "title": "" }, { "docid": "9c2786182c749a3c99e097a19e4f9f22", "score": "0.46144006", "text": "function longFlag() {\n\t\tcursor += 2; // skip leading dashes\n\t\tvar flagName = nextString(\"=\");\n\t\tif (boolFlag(flagName))\n\t\t\tresult[flagName] = true;\n\t\telse {\n\t\t\tif (typeof result[flagName] == 'undefined') {\n\t\t\t\tresult[flagName] = [];\n\t\t\t}\n\t\t\tif (Array.isArray(result[flagName])) {\n\t\t\t\tresult[flagName].push(nextString());\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "56244b1f31e7458a02cb189035d634f2", "score": "0.4613155", "text": "function serverInfo() {\n console.info(\"\\n\");\n console.info(\"Web server is running.\");\n console.info(\"Connection options:\");\n console.info(\"localhost:\" + options_webserver.port );\n\n if ((typeof currentIPAddress !== \"undefined\") && (currentIPAddress !== noAddressMessage)) {\n \tconsole.info(currentIPAddress + \":\" + options_webserver.port );\n }\n console.info(\"\\n\");\n}", "title": "" }, { "docid": "fe5be76a2e7e9f5627d79b18d209c22f", "score": "0.46105266", "text": "function retrieveRemoteDebug()\n{\n\tvar tmpcokie1, tmpcokie2;\n\n\ttmpcokie1 = unescape($.cookie('remoteenabledflag'));\n\ttmpcokie2 = unescape($.cookie('remotedconip'));\n\tif (tmpcokie1.length > 0) {\n\t\tisRemoteEnabled = Number(tmpcokie1.split(','));\n\t} else {\n\t\tisRemoteEnabled = 0;\n\t}\n\tif (tmpcokie2.length > 0) {\n\t\tremoteIPAddress = tmpcokie2.split(',');\n\t} else {\n\t\tremoteIPAddress = '';\n\t}\n\tif (isRemoteDebuggingEnabled()) {\n\t\t$(\"#frequencybandselector\").hide();\n\t\t$(\".ampdutable\").hide();\n\t\t$(\"#countermatrics\").hide();\n\t\tvar errorelem = '<div id=\"errormsgid\" class=\"errormsg\">Remote debugging is enabled. Please go to <b>\"'+remoteIPAddress+'\"</b>.</div>';\n\t\t$(\"#showerrmessage\").append(errorelem);\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "title": "" }, { "docid": "84f367c8080439e6a817bb267dedee07", "score": "0.46004292", "text": "specialFlags() {\n return this.INH_CRY18;\n }", "title": "" }, { "docid": "b36085f28283bd31f7f50fdd9061f949", "score": "0.4597782", "text": "function getFlagsAvailable() {\n\tvar result = bombs;\n\n\tfor (var i = 0; i < rows; i++) {\n\t\tfor (var j = 0; j < columns; j++) {\n\t\t\tresult -= flags[i][j];\n\t\t}\n\t}\n\n\treturn result;\n}", "title": "" }, { "docid": "7688d73e6cb9279184e8bf98c09d823b", "score": "0.459746", "text": "function test_mode(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.valid = true;\r\n\tresult.flagname = [];\r\n\tresult.flags = [];\r\n\tresult.flagval = [];\r\n\tresult.flagmsg = [];\r\n\tif (!presence_check(input)){\r\n\t\terror = \"S2_1\";\r\n\t\tresult.flagname.push((flags)[error].name);\r\n\t\tresult.flags.push((flags)[error].flag);\r\n\t\tresult.flagval.push((flags)[error].value);\r\n\t\tresult.flagmsg.push((flags)[error].msg);\r\n\t\tresult.valid = false;\r\n\t} else if (!check_allowed_char(input, \"numeric\", \"conf1\")){\r\n\t\terror = \"S2_2\";\r\n\t\tresult.flagname.push((flags)[error].name);\r\n\t\tresult.flags.push((flags)[error].flag);\r\n\t\tresult.flagval.push((flags)[error].value);\r\n\t\tresult.flagmsg.push((flags)[error].msg);\r\n\t\tresult.valid = false;\r\n\t} else if (!field_length_check(input, \"mode\", \"conf1\")){\r\n\t\terror = \"S44_4\";\r\n\t\tresult.flagname.push((flags)[error].name);\r\n\t\tresult.flags.push((flags)[error].flag);\r\n\t\tresult.flagval.push((flags)[error].value);\r\n\t\tresult.flagmsg.push((flags)[error].msg);\r\n\t\tresult.valid = false;\r\n\t} else {\r\n\t\tif (!lkup_linear(\"lkup3\", input)){\r\n\t\t\terror = \"S2_3\";\r\n\t\t\tresult.flagname.push((flags)[error].name);\r\n\t\t\tresult.flags.push((flags)[error].flag);\r\n\t\t\tresult.flagval.push((flags)[error].value);\r\n\t\t\tresult.flagmsg.push((flags)[error].msg);\r\n\t\t}\t\t\t\t\r\n\t}\r\n\tif (result.flags.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\telse {\r\n\t\tresult.pass = true;\r\n\t}\r\n\treturn result;\r\n}", "title": "" }, { "docid": "f66598fa1795ab17c5a335109978c5a0", "score": "0.45901084", "text": "function downloadReq(mode) {\n\tif( mode === \"single\" ) { // single page\n\t\t// prepare download request\n\t\tvar req_type = \"download\";\n\t\tvar req_url = window.content.location.href;\n\t\tvar req_mode = \"single\";\n\n\t\tvar req = new String();\n\t\treq = req.concat(\n\t\t req_type, \"\\n\", \n\t\t req_mode, \"\\n\", \n\t\t req_url\n\t\t);\n\n\t\t// pull server address from preferences\n\t\tvar prefManager = Components.classes[\"@mozilla.org/preferences-service;1\"]\n\t\t\t.getService(Components.interfaces.nsIPrefBranch);\n\t\tvar serverAddr = prefManager.getCharPref(\"extensions.seniorcap.serverAddress\");\n\t\tif( serverAddr == \"\" ) {\n\t\t\talert(\"ERROR: No server address for connection specified!\");\n\t\t\treturn;\n\t\t}\n\n\t\t// send request to CGI script\n\t\tvar xmlhttp = new XMLHttpRequest();\n\t\txmlhttp.onreadystatechange=function() {\n\t\t\tif( xmlhttp.readyState==4 && xmlhttp.status==200 ) {\n\t\t\t\tif( !(xmlhttp.responseText == \"REQ_RECEIVED\\n\") ) {\n\t\t\t\t\talert(xmlhttp.responseText);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if( xmlhttp.readyState==4 && !xmlhttp.status ) {\n\t\t\t\talert(\"ERROR: Server cannot be reached\");\n\t\t\t}\n\t\t\telse if( xmlhttp.readyState==4 ) {\n\t\t\t\talert(\"UNKNOWN ERROR: \"\n\t\t\t\t\t+\" state:\"+xmlhttp.readyState\n\t\t\t\t\t+\" status:\"+xmlhttp.status\n\t\t\t\t\t+\" response:\"+xmlhttp.responseText\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\txmlhttp.open(\"POST\", \"http://\"+serverAddr+\"/cgi-bin/cap/clientreq.pl\", true);\n\t\txmlhttp.send(req);\n\t}\n}", "title": "" }, { "docid": "1552b112a36825be906844ec308f357b", "score": "0.45887342", "text": "getFeatures() {\n\t\tfetch(`https://maximum-arena-3000.codio-box.uk/api/features/${this.props.prop_ID}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tbody: null,\n\t\t\theaders: {\n\t\t\t\t\"Authorization\": \"Basic \" + btoa(this.context.user.username + \":\" + this.context.user.password)\n\t\t\t}\n\t\t})\n\t\t\t.then(status)\n\t\t\t.then(json)\n\t\t\t.then(dataFromServer => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tfeatures: dataFromServer,\n\t\t\t\t});\n\t\t\t\tconsole.log(dataFromServer, 'features here')\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.log(error)\n\t\t\t\tmessage.error('Could not get the features. Try Again!', 5);\n\t\t\t});\n\t}", "title": "" }, { "docid": "b883a121530720b1bb43c6aeae3325f6", "score": "0.45860827", "text": "function getServerInfo() {\n // Note that 'cross-domain' requests don't work without CORS\n // $ sudo apt-get install node.js node npm\n // $ npm install -g add-cors-to-couchdb\n // $ add-cors-to-couchdb\n\n // Found at\n // http://bradley-holt.com/2011/07/couchdb-jquery-plugin-reference/\n \n // Note that if the couchDB domain the HTTP domain differ, you have to enable CORS.\n // edit /etc/couchdb/default.ini\n // Set in the [httpd] section:\n // enable_cors = true\n // And set in the [cors] section:\n // origins = *\n // (or the domain you want to use; otherwise _ever domain_ can read/modify your couchdb).\n // \n // Eventually add the same items/sections to the local.ini file.\n // Restart the server. \n // Note: restarting only apache and/or couchDB somehow does not do the job.\n // Restart the whole system. (really?? dafuq?!)\n $.couch.info({\n\t// GET http://localhost:5984/\n\tsuccess: function(data) {\n window.alert( JSON.stringify(data) );\n\t}\n });\n}", "title": "" }, { "docid": "3edd9dc8599ae5cbf0c26f88d6a0f27c", "score": "0.4585426", "text": "startListening() {\n const http = require('http');\n const qs = require('querystring');\n selfReference = this;\n this.server = http.createServer((req, res) => {\n res.setHeader('Content-Type', 'text/plain');\n\n var params = null;\n if (req.method == 'POST') {\n var body = '';\n req.on('data', function(data) { body += data; });\n req.on('end', function() {\n params = qs.parse(body);\n\n\t\t\t\t\t// new (or updated) user in local network\n\t\t\t\t\t// =========================================================\n if (params && params.ipaddress && params.hostname) {\n selfReference.localNetworkPals[params.ipaddress] = params;\n\n var sendList = JSON.parse(JSON.stringify(selfReference.localNetworkPals));\n delete sendList[params.ipaddress];\n sendList[selfReference.hostname] = {};\n sendList[selfReference.hostname].hostname = atom.config.get('localnet-paste.networkDisplayName');\n sendList[selfReference.hostname].ipaddress = selfReference.hostname;\n sendList[selfReference.hostname].picture = selfReference.profilePicture;\n\n res.setHeader('Content-Type', 'application/json');\n res.statusCode = 200;\n res.end(JSON.stringify(sendList));\n\n\t\t\t\t\t// receive a user clipboard\n\t\t\t\t\t// =========================================================\n } else if (params && params.ipaddress && params.clipboard) {\n\t\t\t\t\t\t// get shared clipboard\n\t var netClipboard = params.clipboard;\n\t\t\t\t\t\tatom.notifications.addInfo(\n\t\t\t\t\t\t\t'<strong>'+selfReference.localNetworkPals[params.ipaddress].hostname+'</strong> pasted his clipboard to you',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdismissable: true,\n\t\t\t\t\t\t\t\tbuttons: [\n\t\t\t\t\t\t\t\t\t{ text: ' Copy', className: 'icon icon-clippy', onDidClick: function(){\n\t\t\t\t\t\t\t\t\t\tatom.clipboard.write(netClipboard);\n\t\t\t\t\t\t\t\t\t\tselfReference.dismissNotificationFromButton(this);\n\t\t\t\t\t\t\t\t\t} },\n\t\t\t\t\t\t\t\t\t{ text: ' Ignore', className: 'icon icon-trashcan', onDidClick: function(){ selfReference.dismissNotificationFromButton(this); } }\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\ticon: 'clippy',\n\t\t\t\t\t\t\t\tdetail: params.clipboard.length < 43 ? params.clipboard : params.clipboard.substring(0, 40) +'...'\n\t\t\t\t\t\t\t});\n\n res.statusCode = 200;\n res.end('');\n\n\t\t\t\t\t// positive response on ping (sender IP included)\n\t\t\t\t\t// =========================================================\n\t\t\t\t\t} else if (params && params.ipaddress) {\n\t\t res.statusCode = 200;\n\t\t res.end('');\n\n\t\t\t\t\t// negative response (unauthorized) to invalid requests\n\t\t\t\t\t// =========================================================\n\t\t\t\t\t} else {\n res.statusCode = 401;\n res.end('');\n }\n });\n } else {\n res.statusCode = 401;\n res.end('');\n }\n });\n this.server.listen(this.port, this.hostname, () => {\n console.log('Listening for other localNetwork devices');\n });\n }", "title": "" }, { "docid": "7e7374f3e5db5d95c28dce7708e09c89", "score": "0.45815474", "text": "function output_flags(f,fname) {\n\t\t\t\t\t//output flag variables\t\n\t\tfor (c in fname) {\n\t\t\tdt += '<div class=\"form_block\"><label>';\n\t\t\t\t\n dt+=\"<a href=\\\"#\\\" title=\\\"\" + fname[c] + \"\\\"onclick=\\\"togglez('\" + fname[c] +\"'); return false;\\\">\";\n\t\t\tdt += fname[c];\n\t\t\t\n dt+=\":</a>\";\n\t\t\t\n\t\t\tdt+=\"</label>\";\n\t\t\tdt+='<input type=\"text\" id=\"debug_'\n\t\t\tdt+=fname[c];\n\t\t\tdt+='\" name=\"';\n\t\t\tdt+=fname[c];\n\t\t\tdt+='\" value=\"';\n\t\t\tdt+=f[fname[c]];\n\t\t\tdt+='\" />'\n\t\t\tdt+=\"</div>\";\n\t\t}\n\t\n\t}", "title": "" }, { "docid": "bf18a18d0b83701b1d466226a5a3144f", "score": "0.45777702", "text": "function setflagaccion(flag){flagactionglob=flag;}", "title": "" }, { "docid": "5693d8fa7e6bd9e2825d9d977863d12b", "score": "0.45766437", "text": "status() {\n const that = this;\n const conn = new rcon({\n host: that.cfg.ip,\n port: that.cfg.port,\n password: that.cfg.pass\n })\n .on(\"error\", function(err) {\n console.error(err);\n })\n .exec(\"status\", function(res) {\n // Get current map\n let re = named(/map\\s+:\\s+(:<map>.*?)\\s/),\n match = re.exec(res.body);\n if (match !== null) {\n const map = match.capture(\"map\");\n\n if (that.state.maps.indexOf(map) >= 0) {\n that.state.map = map;\n } else {\n that.state.maps = [map];\n that.state.map = map;\n }\n\n that.stats(false); \n }\n\n // ???\n const regex = new RegExp('\"(:<user_name>.*?)\" (:<steam_id>STEAM_.*?) .*?' + that.cfg.adminip + \":\", \"\");\n re = named(regex);\n match = re.exec(res.body);\n if (match !== null) {\n for (const i in match.captures.steam_id) {\n if (\n match.captures.steam_id.hasOwnProperty(i) &&\n that.state.steamid.indexOf(Utils.id64(match.captures.steam_id[i])) === -1\n ) {\n that.state.steamid.push(Utils.id64(match.captures.steam_id[i]));\n that.state.admins.push(match.captures.user_name[i]);\n }\n }\n }\n conn.close();\n })\n .connect();\n }", "title": "" }, { "docid": "274f0e33735156e5d3b3800d2d4654e2", "score": "0.4562072", "text": "loadWfsCapabilities() {\n this.setError(false);\n this.wfsOnlyFolder.setChildren(null);\n\n if (this.getOriginalWfsUrl()) {\n log.info(OGCServer.LOGGER_, this.getLabel() + ' requesting WFS GetCapabilities');\n\n var uri = new Uri(this.getOriginalWfsUrl());\n var queryData = this.getWfsQueryData_();\n uri.setQueryData(queryData);\n\n var request = new Request(uri);\n request.setHeader('Accept', '*/*');\n request.listen(EventType.SUCCESS, this.handleWfsGetCapabilities, false, this);\n request.listen(EventType.ERROR, this.onOGCError, false, this);\n request.setValidator(getException);\n\n log.fine(OGCServer.LOGGER_, 'Loading WFS GetCapabilities from URL: ' + uri.toString());\n this.setLoading(true);\n request.load();\n } else {\n this.wfsDone_ = true;\n this.finish();\n }\n }", "title": "" } ]
097b5df850bee26e6f76effacb6c1ae3
access className property while respecting SVGAnimatedString
[ { "docid": "52465bcef6502134b529ffc26154bc0b", "score": "0.62064016", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" } ]
[ { "docid": "24cd92e88926f43aeb6130c84c7a1fe6", "score": "0.64946985", "text": "function svgClass(name) {\n\t\treturn svgStyles[name] || {};\n\t}", "title": "" }, { "docid": "7ebabac4059aa2832c2cce43e32ee0e6", "score": "0.6342586", "text": "function className(node, value){\n\t var klass = node.className || '',\n\t svg = klass && klass.baseVal !== undefined\n\n\t if (value === undefined) return svg ? klass.baseVal : klass\n\t svg ? (klass.baseVal = value) : (node.className = value)\n\t }", "title": "" }, { "docid": "45ce9e13ba86bfabe6070f1093136aa4", "score": "0.629753", "text": "function className(node, value) {\n\t var klass = node.className || '',\n\t svg = klass && klass.baseVal !== undefined;\n\n\t if (value === undefined) return svg ? klass.baseVal : klass;\n\t svg ? klass.baseVal = value : node.className = value;\n\t }", "title": "" }, { "docid": "6f2c95704d6b4bbdd34139ffde724981", "score": "0.62813956", "text": "function className(node, value){\r\n var klass = node.className || '',\r\n svg = klass && klass.baseVal !== undefined\r\n\r\n if (value === undefined) return svg ? klass.baseVal : klass\r\n svg ? (klass.baseVal = value) : (node.className = value)\r\n }", "title": "" }, { "docid": "52f4cc41fdaa71d0644f6ca079f24b46", "score": "0.62777656", "text": "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "52f4cc41fdaa71d0644f6ca079f24b46", "score": "0.62777656", "text": "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "52f4cc41fdaa71d0644f6ca079f24b46", "score": "0.62777656", "text": "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "52f4cc41fdaa71d0644f6ca079f24b46", "score": "0.62777656", "text": "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "52f4cc41fdaa71d0644f6ca079f24b46", "score": "0.62777656", "text": "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "52f4cc41fdaa71d0644f6ca079f24b46", "score": "0.62777656", "text": "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "c61b05ee4b60fa6ff11d6c2d29f60c56", "score": "0.62756413", "text": "function className(node, value) {\n var klass = node.className || '';\n var svg = klass && klass.baseVal !== undefined;\n\n if (value === undefined) return svg ? klass.baseVal : klass;\n svg ? klass.baseVal = value : node.className = value;\n }", "title": "" }, { "docid": "ee4d35011dd77c3808128c886b2407dd", "score": "0.62500775", "text": "function patchClass(el,value,isSVG){if(value==null){value=\"\";}if(isSVG){el.setAttribute(\"class\",value);}else{// 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.\nvar transitionClasses=el._vtc;if(transitionClasses){value=(value?[value].concat(_toConsumableArray(transitionClasses)):_toConsumableArray(transitionClasses)).join(\" \");}el.className=value;}}", "title": "" }, { "docid": "8320d735777ecb792bffe433a9defd8c", "score": "0.6193658", "text": "function className(node, value) {\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined;\n\n if (value === undefined) return svg ? klass.baseVal : klass;\n svg ? klass.baseVal = value : node.className = value;\n }", "title": "" }, { "docid": "fab5ec774654094d9efedf283be972e0", "score": "0.6178343", "text": "function className(node, value) {\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "281ea91edd6da20010a5276bc0457ea0", "score": "0.616736", "text": "function className(node, value) {\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "995c3dbac4d555b18cccff1c21301754", "score": "0.61455274", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "995c3dbac4d555b18cccff1c21301754", "score": "0.61455274", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "995c3dbac4d555b18cccff1c21301754", "score": "0.61455274", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "995c3dbac4d555b18cccff1c21301754", "score": "0.61455274", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "995c3dbac4d555b18cccff1c21301754", "score": "0.61455274", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "995c3dbac4d555b18cccff1c21301754", "score": "0.61455274", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "995c3dbac4d555b18cccff1c21301754", "score": "0.61455274", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "2e909c6d5054ceebebef3f1ba85ebd0f", "score": "0.6145178", "text": "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "title": "" }, { "docid": "08a3038e22db0a9101158ec29724de03", "score": "0.6103514", "text": "function className(node, value) {\n\t var klass = node.className,\n\t svg = klass && klass.baseVal !== undefined\n\n\t if (value === undefined) return svg ? klass.baseVal : klass\n\t svg ? (klass.baseVal = value) : (node.className = value)\n\t }", "title": "" }, { "docid": "a3cc49d67fcc0bf502e3372eac3e2a28", "score": "0.6080745", "text": "function animateEffect(imgEl, animateString){\n imgEl.className = animateString;\n}", "title": "" }, { "docid": "c180b51866432f7102992dbba4171ae7", "score": "0.6032661", "text": "function switchSVGAttrToReactProp(propName) {\n switch (propName) {\n case 'class':\n return 'className';\n default:\n return propName;\n }\n}", "title": "" }, { "docid": "c180b51866432f7102992dbba4171ae7", "score": "0.6032661", "text": "function switchSVGAttrToReactProp(propName) {\n switch (propName) {\n case 'class':\n return 'className';\n default:\n return propName;\n }\n}", "title": "" }, { "docid": "32fafc71f4732d665db172c1d95784de", "score": "0.5959302", "text": "function _getClassName(animation) {\n return '.velocity-' + animation.replace('.', '-');\n }", "title": "" }, { "docid": "32fafc71f4732d665db172c1d95784de", "score": "0.5959302", "text": "function _getClassName(animation) {\n return '.velocity-' + animation.replace('.', '-');\n }", "title": "" }, { "docid": "6801808dc11a411e39e2ae5ffabac07a", "score": "0.5955173", "text": "function switchSVGAttrToReactProp(propName) {\n\t switch (propName) {\n\t case 'class':\n\t return 'className';\n\t default:\n\t return propName;\n\t }\n\t}", "title": "" }, { "docid": "f519b8af1b1f52f0a2cb3ad08aec59eb", "score": "0.5925287", "text": "function elementClass(index, value) {\n if (value !== NO_CHANGE) {\n // TODO: This is a naive implementation which simply writes value to the `className`. In the\n // future\n // we will add logic here which would work with the animation code.\n var lElement = data[index];\n isProceduralRenderer(renderer) ? renderer.setProperty(lElement.native, 'className', value) :\n lElement.native['className'] = stringify$1(value);\n }\n}", "title": "" }, { "docid": "684684f63822fc1062d2e85133e4d4ba", "score": "0.58589345", "text": "getClassName(className, i){\n let liClassName = className + \"-\" + this.state.navState.styles[i];\n\n // if step ui based navigation is disabled, then dont highlight step\n if (!this.props.stepsNavigation)\n liClassName += \" no-hl\";\n\n return liClassName;\n }", "title": "" }, { "docid": "10e41c7c1d654ad4d6a3434407813cd2", "score": "0.5807755", "text": "moduleClass(className) {\n return this.style[`${className}`];\n }", "title": "" }, { "docid": "3a92feae45ca66d7dfbed05eff0fe8ee", "score": "0.57779264", "text": "setImageClass(x,y){\n let className = \"\";\n className += (x == 0) ? \"top\" : \"\";\n className += (x == 18) ? \"bot\" : \"\";\n className += (y == 0) ? \"left\" : \"\";\n className += (y == 18) ? \"right\" : \"\";\n className += (!className) ? \"point\" : \"\";\n return className;\n }", "title": "" }, { "docid": "9a065b1874d20b6e5eb68fc6cd7bf3b7", "score": "0.5764482", "text": "function getClassName(card){\n return card.html()\n}", "title": "" }, { "docid": "baa6dba45f9a3532b08b231d5c823e23", "score": "0.5737408", "text": "render() {\n this.node.className = this.getClassName()\n }", "title": "" }, { "docid": "169f7400610ac73ae6bf0924c2a26657", "score": "0.5721256", "text": "function getClassifier() {\n return d3.select(\"#classSelect\").property(\"value\");\n}", "title": "" }, { "docid": "ac7e859dd41d9beaec187da07325ae61", "score": "0.5708983", "text": "getClassName() {\n var className = this.props.className;\n\n if (this.getActiveState())\n className += ` ${ this.props.activeClassName }`;\n\n return className;\n }", "title": "" }, { "docid": "ba15cfaa2fd273c07b30f8df77b57811", "score": "0.5691792", "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\n ? [value, ...transitionClasses]\n : [...transitionClasses]).join(' ');\n }\n el.className = value;\n }\n}", "title": "" }, { "docid": "439d4a395e89418226d3ce5e7bb909d3", "score": "0.56840014", "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.56840014", "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": "051b44efad444930a9673ca45f4184bb", "score": "0.56557775", "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": "d164c248d46c6013f3f3d1514acc59dc", "score": "0.5641104", "text": "function keyframes(styles) {\n return (new KeyframePiece(styles)).className;\n}", "title": "" }, { "docid": "361a26967b15918730508cb47843a83b", "score": "0.5637513", "text": "_getAnimationText() {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }", "title": "" }, { "docid": "361a26967b15918730508cb47843a83b", "score": "0.5637513", "text": "_getAnimationText() {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }", "title": "" }, { "docid": "361a26967b15918730508cb47843a83b", "score": "0.5637513", "text": "_getAnimationText() {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }", "title": "" }, { "docid": "361a26967b15918730508cb47843a83b", "score": "0.5637513", "text": "_getAnimationText() {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }", "title": "" }, { "docid": "96db491750e5cb124e105371c3d317c5", "score": "0.56255674", "text": "function amt_js_get_animation( _idx ) {\n var name = \"\";\n switch(_idx) {\n case 7:\n name = \"amt-anim-slide-right-3\";\n break;\n case 8:\n name = \"amt-anim-slide-bottom-3\";\n break;\n case 9:\n name = \"amt-anim-whirl-3\";\n break;\n default:\n name = \"amt-anim-fade-in-3\";\n }\n return name;\n}", "title": "" }, { "docid": "0c42c6e5fcfba3c4b715a3914c79db3d", "score": "0.56243324", "text": "determineClassName(){\n\t\treturn `square ${this.props.model.getState()}`;\n\t}", "title": "" }, { "docid": "99a344974aa4c489f18628f1416150ee", "score": "0.56112653", "text": "function fillTextColor(classname, color) {\n\tvar textfield = document.querySelector('.svgClass').getSVGDocument().getElementsByClassName(classname);\n\n\ttextfield[0].style.fill = color;\n}", "title": "" }, { "docid": "b9e086d9e10014c60d8a0c86a09e54ed", "score": "0.5592095", "text": "function getClassFromIndex(index){\n\treturn \"m-\" + index;\n}", "title": "" }, { "docid": "9684d174e4845bb14da4fe4aabfbcef1", "score": "0.55893123", "text": "moduleClass(className) {\n return this.$style[`${className}`];\n }", "title": "" }, { "docid": "1f7fcad8fa433704455640636c62c159", "score": "0.55722356", "text": "function getClassName(props) {\n var orientation = props.orientation === 'vertical' ? 'rheostat-vertical' : 'rheostat-horizontal';\n\n return ['rheostat', orientation].concat(props.className.split(' ')).join(' ');\n}", "title": "" }, { "docid": "1f7fcad8fa433704455640636c62c159", "score": "0.55722356", "text": "function getClassName(props) {\n var orientation = props.orientation === 'vertical' ? 'rheostat-vertical' : 'rheostat-horizontal';\n\n return ['rheostat', orientation].concat(props.className.split(' ')).join(' ');\n}", "title": "" }, { "docid": "4d0c734fccc5bcdf1e0efde12f4f6f02", "score": "0.5527168", "text": "function getClassName() {\n className = $getClass.split(/\\s+/);\n\n if ($body.hasClass('archive')) {\n className = className[3].split('-');\n } else {\n className = className[2].split('-');\n }\n\n return className;\n }", "title": "" }, { "docid": "a10b399c926a023e24e2db9c88346caf", "score": "0.5523488", "text": "function getColorName(obj) {\n var classes = obj.attr(\"class\");\n if(classes){\n var start_index = classes.indexOf(\"color\")+5;\n var color_code = classes.substring(start_index, start_index+2);\n return color_code;\n }\n return null;\n}", "title": "" }, { "docid": "10a1a9d774f75b931d7964dc8b095fd4", "score": "0.5519235", "text": "function elementClassNamed(index, className, value) {\n if (value !== NO_CHANGE) {\n var lElement = data[index];\n if (value) {\n isProceduralRenderer(renderer) ? renderer.addClass(lElement.native, className) :\n lElement.native.classList.add(className);\n }\n else {\n isProceduralRenderer(renderer) ? renderer.removeClass(lElement.native, className) :\n lElement.native.classList.remove(className);\n }\n }\n}", "title": "" }, { "docid": "86307200e004cf90d05ca2339649e3bc", "score": "0.55107844", "text": "function setClass(elem, name) {\n if ((vp.utils.isSvgDocOrElement(elem)) && (elem.getAttribute)) {\n elem.setAttribute(\"class\", name);\n }\n else {\n elem.className = name;\n }\n }", "title": "" }, { "docid": "1c814151364193746cc40b2dcbb12bd6", "score": "0.5498083", "text": "function St(e,t,o){o.split(\" \").forEach(function(o){e.classList[t](o+\"-theme\")})}", "title": "" }, { "docid": "60eb208d6eb707736dd39a04ccd564b5", "score": "0.54972774", "text": "function getClassWith(string, className){\n\tvar classList = className.split(/\\s+/);\n\tfor (var i = 0; i < classList.length; i++) \n\t{\n\t\tif (classList[i].indexOf(string) !== -1)\n\t\t{\n\t\t\treturn classList[i];\n\t\t}\n\t}\n\n\treturn undefined;\n}", "title": "" }, { "docid": "4b41a357290a59dfc1f9d1293dea22cb", "score": "0.5493591", "text": "function classNames(){for(var e=\"\",t,n=0;n<arguments.length;n++){if(!(t=arguments[n]))continue;if(\"string\"==typeof t||\"number\"==typeof t)e+=\" \"+t;else if(\"[object Array]\"===Object.prototype.toString.call(t))e+=\" \"+classNames.apply(null,t);else if(\"object\"==typeof t)for(var r in t){if(!t.hasOwnProperty(r)||!t[r])continue;e+=\" \"+r}}return e.substr(1)}", "title": "" }, { "docid": "3d5118cb5e519d53d310c80a073c9e71", "score": "0.5490641", "text": "function getClass(string) {\n return document.getElementsByClassName(string);\n}", "title": "" }, { "docid": "c7ed1ee92d78f842950f35bacf5aa48b", "score": "0.54740006", "text": "svg() {\n return this._text;\n }", "title": "" }, { "docid": "539110813bffc8707ffacd969c7de6b3", "score": "0.5447148", "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": "539110813bffc8707ffacd969c7de6b3", "score": "0.5447148", "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": "539110813bffc8707ffacd969c7de6b3", "score": "0.5447148", "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": "f5e44e5c4d64c4ad9f7e0379293dad49", "score": "0.5416722", "text": "function getIconClassName(name) {\r\n var className = '';\r\n var icon = icons_1.getIcon(name);\r\n if (icon) {\r\n className = index_1.mergeStyles(icon.subset.className, defaultIconStyles, {\r\n selectors: {\r\n '::before': {\r\n content: \"\\\"\" + icon.code + \"\\\"\"\r\n }\r\n }\r\n });\r\n }\r\n return className;\r\n}", "title": "" }, { "docid": "f5e44e5c4d64c4ad9f7e0379293dad49", "score": "0.5416722", "text": "function getIconClassName(name) {\r\n var className = '';\r\n var icon = icons_1.getIcon(name);\r\n if (icon) {\r\n className = index_1.mergeStyles(icon.subset.className, defaultIconStyles, {\r\n selectors: {\r\n '::before': {\r\n content: \"\\\"\" + icon.code + \"\\\"\"\r\n }\r\n }\r\n });\r\n }\r\n return className;\r\n}", "title": "" }, { "docid": "f5e44e5c4d64c4ad9f7e0379293dad49", "score": "0.5416722", "text": "function getIconClassName(name) {\r\n var className = '';\r\n var icon = icons_1.getIcon(name);\r\n if (icon) {\r\n className = index_1.mergeStyles(icon.subset.className, defaultIconStyles, {\r\n selectors: {\r\n '::before': {\r\n content: \"\\\"\" + icon.code + \"\\\"\"\r\n }\r\n }\r\n });\r\n }\r\n return className;\r\n}", "title": "" }, { "docid": "f5e44e5c4d64c4ad9f7e0379293dad49", "score": "0.5416722", "text": "function getIconClassName(name) {\r\n var className = '';\r\n var icon = icons_1.getIcon(name);\r\n if (icon) {\r\n className = index_1.mergeStyles(icon.subset.className, defaultIconStyles, {\r\n selectors: {\r\n '::before': {\r\n content: \"\\\"\" + icon.code + \"\\\"\"\r\n }\r\n }\r\n });\r\n }\r\n return className;\r\n}", "title": "" }, { "docid": "f5e44e5c4d64c4ad9f7e0379293dad49", "score": "0.5416722", "text": "function getIconClassName(name) {\r\n var className = '';\r\n var icon = icons_1.getIcon(name);\r\n if (icon) {\r\n className = index_1.mergeStyles(icon.subset.className, defaultIconStyles, {\r\n selectors: {\r\n '::before': {\r\n content: \"\\\"\" + icon.code + \"\\\"\"\r\n }\r\n }\r\n });\r\n }\r\n return className;\r\n}", "title": "" }, { "docid": "3bdd582b86c8d3a7dce18bed50f3bfce", "score": "0.5409569", "text": "function className(value) { return new HtmlAttr(\"className\", [], value); }", "title": "" }, { "docid": "f33211d0e245a161cfac41a3f0dfd1b1", "score": "0.5405339", "text": "classNameToColor(name, classes) {\n var index = -1;\n for (var i = 0; i < classes.length; i++) {\n if (classes[i] == name || (typeof(classes[i])!=\"String\" && classes[i].title == name)) {\n index = i;\n break;\n }\n }\n return index == -1 ? \"#777777\" : service.classIndexToColor(index);\n }", "title": "" }, { "docid": "b543dd0b30d44ed7e76aa4552207d8f0", "score": "0.5395232", "text": "function iconClass(iconName) {\r\n if (iconName == null) {\r\n return undefined;\r\n }\r\n return iconName.indexOf(NS + \"-icon-\") === 0 ? iconName : NS + \"-icon-\" + iconName;\r\n }", "title": "" }, { "docid": "665695a6a3edc223ec29b0e79990675e", "score": "0.5395066", "text": "function iconClass(iconName) {\n if (iconName == null) {\n return undefined;\n }\n return iconName.indexOf(NS + \"-icon-\") === 0 ? iconName : NS + \"-icon-\" + iconName;\n}", "title": "" }, { "docid": "f836741d6e077da96abe56bc7e4f96c1", "score": "0.539156", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\"; // includes all the classes that we pass to className\n classes += this.state.value === 0 ? \"warning\" : \"primary\"; // if(conditon) then append String a, else append String b\n return classes;\n }", "title": "" }, { "docid": "c0222d36b955c7a515bd9deb6a87d8d4", "score": "0.5390718", "text": "function _getClassName(el) {\n return typeof el.className.baseVal === \"undefined\" ? el.className : el.className.baseVal;\n }", "title": "" }, { "docid": "2079fb58f35bbb7e1d8808f98ca6eaba", "score": "0.53902256", "text": "function patchClass(el, value, isSVG) {\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 ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');\r\n }\r\n if (value == null) {\r\n el.removeAttribute('class');\r\n }\r\n else if (isSVG) {\r\n el.setAttribute('class', value);\r\n }\r\n else {\r\n el.className = value;\r\n }\r\n}", "title": "" }, { "docid": "fb0544177bc3b829943f8501cc169e10", "score": "0.5380313", "text": "setElementClass(element, classString) {\n let root = _style_util_js__WEBPACK_IMPORTED_MODULE_3__[\"wrap\"](element).getRootNode();\n let classes;\n if (classString) {\n let definitelyString = typeof classString === 'string' ? classString : String(classString);\n classes = definitelyString.split(/\\s/);\n } else {\n classes = [];\n }\n let scopeName = root.host && root.host.localName;\n // If no scope, try to discover scope name from existing class.\n // This can occur if, for example, a template stamped element that\n // has been scoped is manipulated when not in a root.\n if (!scopeName) {\n var classAttr = element.getAttribute('class');\n if (classAttr) {\n let k$ = classAttr.split(/\\s/);\n for (let i=0; i < k$.length; i++) {\n if (k$[i] === _style_transformer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SCOPE_NAME) {\n scopeName = k$[i+1];\n break;\n }\n }\n }\n }\n if (scopeName) {\n classes.push(_style_transformer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SCOPE_NAME, scopeName);\n }\n if (!_style_settings_js__WEBPACK_IMPORTED_MODULE_1__[\"nativeCssVariables\"]) {\n let styleInfo = _style_info_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].get(element);\n if (styleInfo && styleInfo.scopeSelector) {\n classes.push(_style_properties_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].XSCOPE_NAME, styleInfo.scopeSelector);\n }\n }\n _style_util_js__WEBPACK_IMPORTED_MODULE_3__[\"setElementClassRaw\"](element, classes.join(' '));\n }", "title": "" }, { "docid": "d2c887fc64c777436a9aad50d31ec544", "score": "0.53793174", "text": "_getSpinnerAnimationLabel() {\n // The string of a float point number will include a period ‘.’ character,\n // which is not valid for a CSS animation-name.\n return this.diameter.toString().replace('.', '_');\n }", "title": "" }, { "docid": "d2c887fc64c777436a9aad50d31ec544", "score": "0.53793174", "text": "_getSpinnerAnimationLabel() {\n // The string of a float point number will include a period ‘.’ character,\n // which is not valid for a CSS animation-name.\n return this.diameter.toString().replace('.', '_');\n }", "title": "" }, { "docid": "d2c887fc64c777436a9aad50d31ec544", "score": "0.53793174", "text": "_getSpinnerAnimationLabel() {\n // The string of a float point number will include a period ‘.’ character,\n // which is not valid for a CSS animation-name.\n return this.diameter.toString().replace('.', '_');\n }", "title": "" }, { "docid": "d2c887fc64c777436a9aad50d31ec544", "score": "0.53793174", "text": "_getSpinnerAnimationLabel() {\n // The string of a float point number will include a period ‘.’ character,\n // which is not valid for a CSS animation-name.\n return this.diameter.toString().replace('.', '_');\n }", "title": "" }, { "docid": "01a6f9e69c4d4c000ad3161f8e756b18", "score": "0.5379055", "text": "function getPolygonClassName(className){\n return className + \"-radar\";\n}", "title": "" }, { "docid": "f98774a1af202b2530fae4036bb4cd5b", "score": "0.53781223", "text": "function jqClass(className) {\n return \".\" + className.replace( /(:|\\.|\\[|\\]|,)/g, \"\\\\$1\" );\n }", "title": "" }, { "docid": "ef13e0259ed1e91d1a2e00c3c692efb8", "score": "0.537263", "text": "function get_effect_name( elm ) {\r\n\t\tvar name = '';\r\n\t\tfor ( var i=0; i < elm.classList.length; i++ ) {\r\n\t\t\tif ( elm.classList[i].indexOf(planeClassPrefix) === 0 ) {\r\n\t\t\t\tname = elm.classList[i].substring( planeClassPrefix.length );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn name;\r\n\t}", "title": "" }, { "docid": "2656bcba24d342b254e95572b8f2fa49", "score": "0.5352297", "text": "mainClasses() {\n return classNames(\n 'carbon-carousel',\n this.props.className\n );\n }", "title": "" }, { "docid": "2890c3f2dae798ceb2062fb60bc787ca", "score": "0.5333945", "text": "getCardIconName(card) {\n return card.firstElementChild.firstElementChild.classList[1];\n }", "title": "" }, { "docid": "4dc4a76cd2eb28c913b426feebe79821", "score": "0.5318536", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n\n // 3rd class is badge-something. Determine if it should be 'warning' or 'primary' and add it to string.\n classes += this.props.counter.value === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "title": "" }, { "docid": "50eb746644621ea7824c4cda8047ff3f", "score": "0.53104955", "text": "getClassName(props) {\n return props.className;\n }", "title": "" }, { "docid": "fa01a4e785bba18dd6437c3c48d112b3", "score": "0.53073573", "text": "function measureSvgText(svgNode, text, className) {\n var textElem = document.createElementNS('http://www.w3.org/2000/svg', \"text\");\n svgNode.append(textElem);\n vp.dom.setClass(textElem, className);\n var xx = vp.dom.getBounds(textElem);\n var rect = textElem.getBoundingClientRect();\n svgNode.remove(textElem);\n var sz = { width: rect.width, height: rect.height };\n return sz;\n }", "title": "" }, { "docid": "c1b6704c7fbe1029018c694215ccc0eb", "score": "0.52937585", "text": "function getClassFromCard(card){\n return card[0].firstChild.className;\n}", "title": "" }, { "docid": "491c916c5044df1acc66dbde5808d81b", "score": "0.5281558", "text": "getClass() {\n const { isViewerApplyClass, isViewerClosed, isViewerApplyMaxClass, isViewerMaxed } = this.props;\n let cls = 'viewer';\n if ( isViewerApplyClass ) cls += ' scale0';\n if ( isViewerApplyMaxClass ) cls += ' maxClass';\n if ( isViewerClosed ) cls += ' closed';\n if ( isViewerMaxed ) cls += ' maxed';\n\n return cls;\n }", "title": "" }, { "docid": "d173c6fc3ba3cefd54d615da1068d1bc", "score": "0.5266624", "text": "function getStyleClass(c){\n\t\tif (c === \"Untyped\") {\n\t\t\treturn \"untyped\";\n\t\t}else if(c === \"Enhancement\") {\n\t\t\treturn \"enhancement\";\n\t\t}else if(c === \"Morale\") {\n\t\t\treturn \"morale\";\n\t\t}else if(c === \"Deflection\") {\n\t\t\treturn \"deflection\";\n\t\t}else{\n\t\t\treturn \"buffer\";\n\t\t};\n\t}", "title": "" }, { "docid": "0c651093b87bb63f9da26eac90de5572", "score": "0.526327", "text": "elementClass (processing) {\n let className = 'async__element';\n if (processing) className += ' async__element--loading';\n if (this.props.disabled) className += ' async__element--disabled';\n if (this.props.className) className += ' ' + this.props.className;\n return className;\n }", "title": "" }, { "docid": "1917ebcff41227604983dac4b83047c8", "score": "0.52448875", "text": "function getIconClassName(name) {\r\n var className = '';\r\n var icon = getIcon(name);\r\n if (icon) {\r\n className = Object(lib[\"f\" /* mergeStyles */])(icon.subset.className, defaultIconStyles, {\r\n selectors: {\r\n '::before': {\r\n content: \"\\\"\" + icon.code + \"\\\"\"\r\n }\r\n }\r\n });\r\n }\r\n return className;\r\n}", "title": "" }, { "docid": "74987b7095b341221512ce5fdecc75f3", "score": "0.524472", "text": "getClassName() {\n switch (this.titleStyle) {\n case 'dxp-title-xl': {\n return 'dxp-title-1';\n }\n case 'dxp-title-lg': {\n return 'dxp-title-2';\n }\n case 'dxp-title-md': {\n return 'dxp-title-3';\n }\n case 'dxp-title-sm': {\n return 'dxp-title-4';\n }\n default: {\n return 'dxp-title-1';\n }\n }\n }", "title": "" }, { "docid": "20c5f43b17f1ded296e8d87ab6d3513f", "score": "0.5227607", "text": "function changeClass(string){\n\tavenger.class = string; \n\tconsole.log(avenger.class);\n\tconsole.log(avenger);\n}", "title": "" }, { "docid": "2812f56da075d6b114fca0d820b447dc", "score": "0.51990265", "text": "function setClassName() {\n if(errorState.msg) {\n return \"danger\"\n }else if(authState.message) {\n return \"success\"\n }\n }", "title": "" }, { "docid": "7bfec13b23bb53b087510a921fb071fd", "score": "0.5192826", "text": "animate() {\n this.image.classes.push(c.ANIMATION_CSS_CLASS_APPEND);\n }", "title": "" } ]
be8551a7c53f903617e8a7c8badb2276
If the tabs only provide the label string, map them into objects with an id for consistency across the rest of the component. The option to supply an id with a tab supports the use case where a consumer wants a shorter id for the tabs than the label (e.g. for binding to query params)
[ { "docid": "f5699c835a6b6009c2c7ea1a21055036", "score": "0.63276553", "text": "@readOnly\n @computed('tabs.[]')\n _tabs (tabs) {\n // Let PropTypes handle checking the format of objects passed in as tabs,\n // just assume they're in the right format here\n if (isEmpty(tabs) || typeOf(tabs[0]) === 'object' || typeOf(tabs[0]) === 'instance') {\n return tabs\n }\n\n // Map tab strings to an {id, label} hash\n return tabs.map(label => {\n return {\n id: label,\n label\n }\n })\n }", "title": "" } ]
[ { "docid": "804e7c16a5ec14ca0afa5c2c067300e7", "score": "0.62829155", "text": "_getTabLabelId(i) {\n return `mat-tab-label-${this._groupId}-${i}`;\n }", "title": "" }, { "docid": "804e7c16a5ec14ca0afa5c2c067300e7", "score": "0.62829155", "text": "_getTabLabelId(i) {\n return `mat-tab-label-${this._groupId}-${i}`;\n }", "title": "" }, { "docid": "804e7c16a5ec14ca0afa5c2c067300e7", "score": "0.62829155", "text": "_getTabLabelId(i) {\n return `mat-tab-label-${this._groupId}-${i}`;\n }", "title": "" }, { "docid": "804e7c16a5ec14ca0afa5c2c067300e7", "score": "0.62829155", "text": "_getTabLabelId(i) {\n return `mat-tab-label-${this._groupId}-${i}`;\n }", "title": "" }, { "docid": "48f19d378c5be297b535328e132268be", "score": "0.6257956", "text": "function Tab(label) {\n this.label = label;\n}", "title": "" }, { "docid": "cb823d412f47f208354bd092fe7bef6c", "score": "0.594454", "text": "function setupTabClick () {\n $('.js-label-tab').on('click', e => {\n const type = $(e.currentTarget).data('type')\n const labels = db.getLabelList()[type].labels\n\n // currentTab = type\n core.setCurrentTab(type)\n\n let $ul = $(`<ul class=\"tab-pane active label-list\" data-type=\"${type}\"/>`)\n labels.forEach((label, index) => {\n\n let text, aColor\n if (typeof label === 'string') { // old style.\n text = label\n aColor = color.colors[0]\n } else {\n text = label[0]\n aColor = label[1]\n }\n\n $ul.append(`\n <li class=\"label-list__item\">\n <div class=\"label-list__btn js-label-edit\" data-index=\"${index}\">\n <i class=\"fa fa-edit fa-2x\"></i>\n </div>\n <div class=\"label-list__btn js-label-trash\" data-index=\"${index}\">\n <i class=\"fa fa-trash-o fa-2x\"></i>\n </div>\n <input type=\"text\" name=\"color\" class=\"js-label-palette\" autocomplete=\"off\" data-color=\"${aColor}\" data-index=\"${index}\">\n <div class=\"label-list__text js-label\">\n ${text}\n </div>\n </li>\n `)\n })\n $ul.append(`\n <li class=\"label-list__item\">\n <div class=\"label-list__btn js-add-label-button\">\n <i class=\"fa fa-plus fa-2x\"></i>\n </div>\n <input type=\"text\" class=\"label-list__input\">\n </li>\n `)\n $('.js-label-tab-content').html($ul)\n\n // Setup color pickers.\n setupColorPicker()\n\n })\n\n // Setup the initial tab content.\n initializeLabelDb()\n $('.js-label-tab[data-type=\"span\"]').click()\n}", "title": "" }, { "docid": "30e9f67dec7f5b5afcb5ddba42b33c1b", "score": "0.58264434", "text": "tabLabel() {}", "title": "" }, { "docid": "6e253a6a2a5759f3e1988333a97fc9af", "score": "0.58151305", "text": "constructor(name, id, label) {\n this.name = name;\n this.id = id;\n this.label = label;\n }", "title": "" }, { "docid": "c871970ca9fe7d3ede3a3e6820d6737a", "score": "0.5647734", "text": "id(props, ...args) {\n let error = null;\n\n if (!props.generateChildId) {\n error = idPropType(props, ...args);\n\n if (!error && !props.id) {\n error = new Error('In order to properly initialize Tabs in a way that is accessible ' + 'to assistive technologies (such as screen readers) an `id` or a ' + '`generateChildId` prop to TabContainer is required');\n }\n }\n\n return error;\n }", "title": "" }, { "docid": "c2aef3c5ecfb3598395181d898c307cd", "score": "0.5535761", "text": "function TabBar_TabBar({\n currentTab,\n disabled = false,\n id: groupName,\n selectTab,\n tabs,\n type\n}) {\n if (!tabs.some(tab => tab.id === currentTab)) {\n selectTab(tabs[0].id);\n }\n\n const onChange = Object(react[\"useCallback\"])(({\n currentTarget\n }) => selectTab(currentTarget.value), [selectTab]);\n const handleKeyDown = Object(react[\"useCallback\"])(event => {\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowLeft':\n case 'ArrowRight':\n case 'ArrowUp':\n event.stopPropagation();\n break;\n\n default:\n break;\n }\n }, []);\n let iconSizeClassName;\n let tabLabelClassName;\n let tabSizeClassName;\n\n switch (type) {\n case 'navigation':\n iconSizeClassName = TabBar_default.a.IconSizeNavigation;\n tabLabelClassName = TabBar_default.a.TabLabelNavigation;\n tabSizeClassName = TabBar_default.a.TabSizeNavigation;\n break;\n\n case 'profiler':\n iconSizeClassName = TabBar_default.a.IconSizeProfiler;\n tabLabelClassName = TabBar_default.a.TabLabelProfiler;\n tabSizeClassName = TabBar_default.a.TabSizeProfiler;\n break;\n\n case 'settings':\n iconSizeClassName = TabBar_default.a.IconSizeSettings;\n tabLabelClassName = TabBar_default.a.TabLabelSettings;\n tabSizeClassName = TabBar_default.a.TabSizeSettings;\n break;\n\n default:\n throw Error(`Unsupported type \"${type}\"`);\n }\n\n return /*#__PURE__*/react[\"createElement\"](react[\"Fragment\"], null, tabs.map(({\n icon,\n id,\n label,\n title\n }) => {\n let button = /*#__PURE__*/react[\"createElement\"](\"label\", {\n className: [tabSizeClassName, disabled ? TabBar_default.a.TabDisabled : TabBar_default.a.Tab, !disabled && currentTab === id ? TabBar_default.a.TabCurrent : ''].join(' '),\n key: id,\n onKeyDown: handleKeyDown,\n onMouseDown: () => selectTab(id)\n }, /*#__PURE__*/react[\"createElement\"](\"input\", {\n type: \"radio\",\n className: TabBar_default.a.Input,\n checked: currentTab === id,\n disabled: disabled,\n name: groupName,\n value: id,\n onChange: onChange\n }), /*#__PURE__*/react[\"createElement\"](Icon_Icon, {\n className: `${disabled ? TabBar_default.a.IconDisabled : ''} ${iconSizeClassName}`,\n type: icon\n }), /*#__PURE__*/react[\"createElement\"](\"span\", {\n className: tabLabelClassName\n }, label));\n\n if (title) {\n button = /*#__PURE__*/react[\"createElement\"](Tooltip, {\n key: id,\n className: Tooltip_default.a.Tooltip,\n label: title\n }, button);\n }\n\n return button;\n }));\n}", "title": "" }, { "docid": "866ca7e853bb7c75da760e1e9a0099d8", "score": "0.54845977", "text": "function addTab(id, name, url) {\n var existing = _.find(this.items, function(tab) { return tab.id === id; });\n if (existing === undefined || existing === null) {\n var tab = new MerchelloTab();\n tab.id = id;\n tab.name = name;\n tab.url = url;\n this.items.push(tab);\n }\n }", "title": "" }, { "docid": "95a0095f0bd8d3770d8256d85630d02b", "score": "0.5420669", "text": "renderTabs() {\n const tabs = [\n { id: 'general', label: 'General' },\n { id: 'skills', label: 'Skills' },\n { id: 'social', label: 'Social Profiles' },\n ]\n return tabs.map(tab => (\n <button\n className={this.state.activeTab === tab.id ? 'tabSelected' : 'tabUnselected'}\n onClick={() => this.setState({ activeTab: tab.id })}\n key={tab.id}\n >\n {tab.label}\n </button>\n ))\n }", "title": "" }, { "docid": "3e416b3f58eca30276bc323766754d1b", "score": "0.5382162", "text": "function buildActionLinkForTab(label, actionMap, $actionMenu, $midmenuItem1, $thisTab) { \n var apiInfo = actionMap[label];\n var $listItem = $(\"#action_list_item\").clone();\n $actionMenu.find(\"#action_list\").append($listItem.show());\n \n var label2;\n if(label in dictionary)\n label2 = dictionary[label];\n else\n label2 = label; \n $listItem.find(\"#link\").text(label2); \n \n $listItem.data(\"label\", label);\t \n $listItem.data(\"apiInfo\", apiInfo);\t \n \n var id = $midmenuItem1.data(\"jsonObj\").id;\n \n $listItem.bind(\"click\", function(event) { \n $actionMenu.hide(); \t \n var $actionLink = $(this); \n \n var dialogBeforeActionFn = apiInfo.dialogBeforeActionFn; \n if(dialogBeforeActionFn == null) {\t \n var apiCommand = \"command=\"+apiInfo.api+\"&id=\"+id; \n doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $thisTab); \n }\n else {\n dialogBeforeActionFn($actionLink, $thisTab, $midmenuItem1);\t\n } \n return false;\n }); \n}", "title": "" }, { "docid": "3734680f1818e572139a8c917a66a737", "score": "0.53767264", "text": "function Tabs(id){\r\n\tthis.id = id;\r\n\tthis.selector = \"#\"+id;\r\n\tthis.tabsDiv = $(this.selector); \r\n\r\n\tthis.headerID = id + \"-h\";\r\n\tthis.headerSelector = \"#\"+this.headerID;\r\n\r\n\tthis.bodyID = id + \"-b\";\r\n\tthis.bodySelector = \"#\"+this.bodyID;\r\n\tthis.init();\r\n}", "title": "" }, { "docid": "ef52f7835f82a8b9d83b8fc366239f63", "score": "0.5331003", "text": "function addTab( id = ++tabCounter, name = 'New Tab' )\n{\n\n // Prepare tab HTML\n let tabHTML = tabHTMLTemplate.replace( /\\!/g, id ).replace( /\\@/g, name );\n\n // Add the tab to the page\n $( '#new-tab-button' ).before( tabHTML );\n\n // Add our handler function selecting the new tab\n $( '#' + id + '-tab' ).click( selectTab );\n\n // Save the session\n saveSession();\n\n}", "title": "" }, { "docid": "c39f203047d0c34b364d0ef3c4cbe5d4", "score": "0.52993006", "text": "function TabButton(props) {\n const { id, text, active } = props\n return (\n <li\n id={id}\n className={`tabPanel-tab${active ? ' is-active' : ''}`}\n onClick={props.onClick}\n >\n <a data-testid=\"tab\">{text}</a>\n </li>\n )\n}", "title": "" }, { "docid": "7d8545e873538099db0360b419677154", "score": "0.521768", "text": "setUpLabels() {\n const id = this.id;\n if (id === undefined || id === '') {\n return;\n }\n\n const rootNode = 'getRootNode' in this ? this.getRootNode() : document;\n const labels = rootNode.querySelectorAll(`label[for=\"${id}\"]`);\n\n if (labels && labels.length > 0) {\n let labelledBy = [];\n for (let i = 0; i < labels.length; i++) {\n let label = labels[i];\n if (label.id === '') {\n label.id = this._generateGuid();\n }\n labelledBy.push(label.id);\n\n if (this.getAttribute('role') !== 'button') {\n // Remove the event listener if it is already set the add it.\n label.removeEventListener('click', this._onLabelClick.bind(this));\n label.addEventListener('click', this._onLabelClick.bind(this));\n }\n }\n this.setAttribute('aria-labelledby', labelledBy.join(' '));\n }\n }", "title": "" }, { "docid": "fb90b8f8361121f0fece372547bb4499", "score": "0.5204498", "text": "renderTabs() {\n\t\treturn [\n\t\t\t{\n\t\t\t\tcontent: <Map key=\"map\" data={this.state.records} navigator={this.props.navigator} />,\n\t\t\t\ttab: <Tab key=\"map\" label=\"Map\" icon=\"ion-ios-home-outline\" />\n\t\t\t},\n\t\t\t{\n\t\t\t\tcontent: <Table key=\"table\" navigator={this.props.navigator} />,\n\t\t\t\ttab: <Tab key=\"table\" label=\"Table\" icon=\"ion-ios-albums-outline\" />\n\t\t\t}\n\t\t\t\n\t\t];\n\t}", "title": "" }, { "docid": "fd48d2b2af98472570be51de6483bb4d", "score": "0.51976764", "text": "function Pg1(theTabLabel) {\n this.tabLabel = theTabLabel;\n}", "title": "" }, { "docid": "d4e0d3f5404a7bfb5e009eae19441279", "score": "0.5169026", "text": "function tabName($tab) {\n if ($tab.hasClass('tab')) {\n return '#'+$tab.attr('id').substring(opts.idPrefix.length+1);\n }\n else {\n return $tab.find('a').attr('href');\n }\n \n }", "title": "" }, { "docid": "734c38f82a8ad709f6b056f943fbf4cf", "score": "0.5164197", "text": "createTab(tab, key) {\n if(tab.type == null) {\n return null;\n }\n else if(tab.type == 'varnish') {\n return new VarnishLogsTabComponent(key);\n }\n else if(tab.type == 'rss') {\n let feeds = tab.feeds;\n return new RssFeedTabComponent(feeds, key);\n }\n else if(tab.type == 'flickr') {\n return new FlickrGalleryTabComponent(tab.keyword, tab.api_key, tab.photos_per_page, key);\n }\n }", "title": "" }, { "docid": "7fad57456adbce14618ba21d9e080c23", "score": "0.51600134", "text": "static getLabelByID(labelID) {\n let labelInfo = null;\n let tryLabel;\n yarp.labels.forEach((label) => {\n tryLabel = label.id.split(\" \");\n if(tryLabel[0]==labelID){\n labelInfo = label;\n } \n })\n return labelInfo;\n }", "title": "" }, { "docid": "2949f832fe19e0d8a210da35acb9339a", "score": "0.5142409", "text": "function mapOptions(opts) {\n\treturn Object.keys(opts).map( function(key) {\n\t\topts[key].id = key //so we know the key when we just have the value\n\t\treturn { value: key, label: opts[key].label }\n\t})\n}", "title": "" }, { "docid": "7d0a119de5c90f132424a1995295418b", "score": "0.5139349", "text": "switchTab() {\n let { selectedTab, tabsArray } = this.state\n if(tabsArray.length <= 1) return\n let currentIndex = tabsArray.findIndex(el => el.props.value == selectedTab.value)\n currentIndex = currentIndex == tabsArray.length-1 ? -1 : currentIndex\n let { value, label } = tabsArray[currentIndex+1].props\n let newSelectedTab = { value, label }\n this.handleTabChange(newSelectedTab)\n }", "title": "" }, { "docid": "c5fc2a8b4f9d7cf333f6e0473831d7b4", "score": "0.51292425", "text": "function changeTab(e) {\n // Add/remove active class from labels\n tabs.forEach((tab) => {\n if(tab.dataset.tabId === e.target.dataset.tabId) {\n tab.classList.add('active');\n } else {\n tab.classList.remove('active');\n }\n });\n\n // Add/remove active class from content\n tabContents.forEach((content) => {\n if(content.dataset.tabId === e.target.dataset.tabId) {\n content.classList.add('active');\n } else {\n content.classList.remove('active');\n }\n });\n}", "title": "" }, { "docid": "00b224af9cc9123f08716ff96a415119", "score": "0.511562", "text": "setActiveTab(id) {\n for (let tab of this.tabs) {\n if (tab.getAttribute(\"aria-controls\") == id) {\n tab.setAttribute(\"aria-selected\", \"true\");\n tab.focus();\n this.activeTab = tab;\n } else {\n tab.setAttribute(\"aria-selected\", \"false\");\n }\n }\n\n for (let tabpanel of this.tabpanels) {\n if (tabpanel.getAttribute(\"data-id\") == id) {\n tabpanel.setAttribute(\"aria-expanded\", \"true\");\n } else {\n tabpanel.setAttribute(\"aria-expanded\", \"false\");\n }\n }\n }", "title": "" }, { "docid": "7eac53239bf0c96a8dd42a3a20d15c2c", "score": "0.5112577", "text": "function addTab(assetId, assetName, optionsList) {\n var label = assetName,\n //id = \"tabs-\" + assetId,\n id = getTabId(assetId);\n li = $(tabTemplate.replace(/#\\{href\\}/g, \"#\" + id).replace(/#\\{label\\}/g, label));\n\n tabs.find(\".ui-tabs-nav\").append(li);\n var tabPanelContentHtml = constructTabPanelTable(assetId, optionsList);\n tabs.append(\"<div id='\" + id + \"'>\" + tabPanelContentHtml + \"</div>\");\n tabs.tabs(\"refresh\");\n}", "title": "" }, { "docid": "2f5803c3703c5ad1868d0205f38228fa", "score": "0.50963515", "text": "function useLabels(props, defaultLabel) {\n let {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy\n } = props; // If there is both an aria-label and aria-labelledby,\n // combine them by pointing to the element itself.\n\n id = useId(id);\n\n if (labelledBy && label) {\n let ids = new Set([...labelledBy.trim().split(/\\s+/), id]);\n labelledBy = [...ids].join(' ');\n } else if (labelledBy) {\n labelledBy = labelledBy.trim().split(/\\s+/).join(' ');\n } // If no labels are provided, use the default\n\n\n if (!label && !labelledBy && defaultLabel) {\n label = defaultLabel;\n }\n\n return {\n id,\n 'aria-label': label,\n 'aria-labelledby': labelledBy\n };\n}", "title": "" }, { "docid": "255d724c108dfebc7eea9c8e50c3ac77", "score": "0.50772524", "text": "handleTabClick(event) {\n // hide all tab panels\n this.tabPanels.forEach((panel) => {\n panel.hidden = true;\n });\n // mark all tabs as unselected\n this.tabButtons.forEach((tab) => {\n // tab.ariaSelected = false;\n tab.setAttribute(\"aria-selected\", false);\n });\n // mark the clicked tab as selected\n event.currentTarget.setAttribute(\"aria-selected\", true);\n // find the associated tabPanel and show it!\n const { id } = event.currentTarget;\n\n // METHOD 2 - find in the array of tabPanels\n // console.log(this.tabPanels);\n const tabPanel = this.tabPanels.find(\n (panel) => panel.getAttribute(\"aria-labelledby\") === id\n );\n tabPanel.hidden = false;\n }", "title": "" }, { "docid": "3559973b503658d359104a6b3cb7d6cb", "score": "0.5036489", "text": "connectLabels() {\n // No id implies no labels.\n if (this.id == null || this.id === '') {\n return;\n }\n\n const rootNode = this.getRootNode();\n const labels = rootNode.querySelectorAll(`label[for=\"${this.id}\"]`);\n\n if (labels && labels.length > 0) {\n const labelledBy = [];\n for (const label of labels) {\n // Labels must have an id for `aria-labelledby`.\n if (label.id == null || label.id === '') {\n label.id = this.generateNewLabelId();\n }\n labelledBy.push(label.id);\n\n label.addEventListener('click', this[labelClickEventListener]);\n }\n this.setAttribute('aria-labelledby', labelledBy.join(' '));\n }\n }", "title": "" }, { "docid": "69e52ee674548b408275cfed5eca2c60", "score": "0.503495", "text": "_getStepLabelId(i) {\n return `cdk-step-label-${this._groupId}-${i}`;\n }", "title": "" }, { "docid": "2b7233a3b74a8a2070aa109f44e57654", "score": "0.5010605", "text": "function handleTab(id, bid) {\n // tab switch\n $('.pages').hide(0)\n $(id).fadeIn(300)\n $('#tab_title').html(id.replace(\"#\",\"\"))\n\n // button color\n // reset button color and font color\n $('.navbutton').removeClass('btn_selected')\n //change selected button color and font color\n $(bid).addClass('btn_selected')\n}", "title": "" }, { "docid": "eb35e6fae3cccabb6bd96673ed54efdd", "score": "0.5005626", "text": "function handleTabs(selectedTab) {\n\n //console.log(selectedTab.target.id);\n\n\n var elementId = selectedTab.srcElement.id;\n var tabCore = elementId.replace(preListVal, \"\");\n var compId = document.getElementById(elementId).parentNode.id\n compId = compId.replace(\"f_\", \"\");\n hideTabContent(compId);\n makeTabVisable(tabCore,compId);\n}", "title": "" }, { "docid": "0f999bc5c6d138a2973cc84f2d5b6579", "score": "0.4980196", "text": "function Pg2(theTabLabel) {\n this.tabLabel = theTabLabel;\n}", "title": "" }, { "docid": "51cb147468a831b17460d5d0fc17a902", "score": "0.4966616", "text": "hideTab(id) {\n const tab = this.tabs[id];\n tab.hide();\n this.redraw();\n }", "title": "" }, { "docid": "fbc06e68e1f3fc3376c26c21804ea5e5", "score": "0.49456444", "text": "function updateTabId(guid, newTabId) {\n\t\tregistry.current[guid].tabId = newTabId;\n\t\twrite();\n\t}", "title": "" }, { "docid": "26410bae521bb27099ef4d68b46a5b19", "score": "0.49451843", "text": "function GetTab (props)\n{\n switch(parseInt(props.tab))\n {\n case 0:\n return <RegisterForm/>\n case 1:\n return <Get/>\n case 2:\n return <Update/>\n case 3:\n return <Delete/>\n case 4:\n return <PhotoshopPost/>\n case 5:\n return <PhotoshopUpdate/>\n case 6:\n return <PhotoshopDelete/>\n case 7:\n return <ModelPost/>\n case 8:\n return <ModelUpdate/>\n case 9:\n return <ModelDelete/>\n case 10:\n return <GamedevPost/>\n case 11:\n return <GamedevUpdate/>\n case 12:\n return <GamedevDelete/>\n default:\n return null;\n }\n}", "title": "" }, { "docid": "0b3a21dfc6d73f81b3fb1e52c6426aca", "score": "0.49313247", "text": "function historyReplaceID(id=null){\n\t\tvar state_var = {};\n\t\tstate_var['tab'] = 'department';\n\n\t\tif (id != null)\n\t\t\tstate_var['id'] = id;\n\t\telse if (history.state.id != undefined)\n\t\t\tstate_var['id'] = history.state.id;\n\n\t\tif (history.state.page != undefined)\n\t\t\tstate_var['page'] = history.state.page;\n\n\t\thistory.replaceState(state_var, 'department', '');\n\t}", "title": "" }, { "docid": "ee132fb55bb0547b8e618424e963e47e", "score": "0.4929527", "text": "set(id) {\n this.currentTab = id;\n this.close();\n if (this.tabs[id]) {\n this.tabs[id].set(true);\n }\n }", "title": "" }, { "docid": "9aab314bf665b5e674e5c44d05e4b474", "score": "0.49291593", "text": "function getTabId(options) {\n var _options$panels, _tabsWithoutPanel$pan;\n\n var panel = (_options$panels = options.panels) === null || _options$panels === void 0 ? void 0 : _options$panels.find(function (p) {\n return p.id === options.id;\n });\n var tabId = options.tabId || (panel === null || panel === void 0 ? void 0 : panel.groupId);\n\n if (tabId || !panel || !options.panels || !options.items) {\n return tabId;\n }\n\n var panelIndex = getPanelIndex(options.panels, panel);\n var tabsWithoutPanel = getTabsWithoutPanel(options.items, options.panels);\n return ((_tabsWithoutPanel$pan = tabsWithoutPanel[panelIndex]) === null || _tabsWithoutPanel$pan === void 0 ? void 0 : _tabsWithoutPanel$pan.id) || undefined;\n}", "title": "" }, { "docid": "6956d78e32664db6a0a1a47a3d6b528e", "score": "0.49253908", "text": "function handleTabClick(event){\n // console.log('You clicked a tab');\n // console.log(event);\n // console.log(event.currentTarget);\n\n // hide all the tab panels\n tabPanels.forEach( function(panel){\n // console.log(panel);\n panel.hidden = true;\n });\n // mark all the tabs unselected\n tabButtons.forEach( function(tab){\n // this method doesn't work\n // tab.ariaSelected = false;\n tab.setAttribute('aria-selected', false);\n });\n // mark the clicked tab as selected\n event.currentTarget.setAttribute('aria-selected', true);\n // find the associated tabPanel and show it\n const { id }= event.currentTarget;\n\n /*\n // METHOD 1\n // const tabPanel = tabs.querySelector(`[aria-labelledby=\"${id}\"]`);\n // console.log(tabPanel);\n // tabPanel.hidden = false;\n */\n\n // METHOD 2 - find in the array of tabPanels\n // console.log(tabPanels);\n const tabPanel = tabPanels.find(\n // using an if statement here\n // if(panel.getAttribute('aria-labelledby') === id){\n // return true;\n // }\n\n // improved/shortened syntax here\n panel => panel.getAttribute('aria-labelledby') === id\n\n // Just tinkering here\n // const results = panel.getAttribute('aria-labelledby') === id;\n // console.log(results);\n // return results;\n );\n // console.log(tabPanel);\n tabPanel.hidden = false;\n}", "title": "" }, { "docid": "b0965339a4513e426ef032bcc31eccc5", "score": "0.492261", "text": "function createLabelsElements(labels, isTicketLabel, ticketId) {\n if (!labels) {\n return \"\";\n }\n let chosenExist;\n if (chosenLabels[0]) {\n chosenExist = true\n }\n return labels.map((label, index) => {\n const isChosen = chosenLabels.includes(label);\n const labelBackgroundColor = chosenExist ? (isChosen ? getLabelBackroundColor(label) : 'lightgray') : getLabelBackroundColor(label);\n return (\n <Label key={index} toggleLabelChoose={toggleLabelChoose} label={label} labels={labels} ticketId={ticketId} isTicketLabel={isTicketLabel} labelBackgroundColor={labelBackgroundColor} getLabelBackroundColor={getLabelBackroundColor} updateTicketLabels={updateTicketLabels} removeLabelFromAll={removeLabelFromAll} />\n );\n });\n }", "title": "" }, { "docid": "c799f17655101ce14c62f04cd8e21bc9", "score": "0.49106365", "text": "function ShowTab(tab, tab_label) {\n if (!IsAnElement(tab)) throw \"ShowTab: tab isn't a DOM element.\";\n if (!IsAnElement(tab_label)) throw \"ShowTab: tab_label isn't a DOM element.\";\n\n tab.style.left = 0;\n tab.style.display = \"inline-block\";\n tab_label.classList.add(\"selected_tab\");\n}", "title": "" }, { "docid": "7eea415549f27dabb61d19254aff295f", "score": "0.49076846", "text": "parseLabelIdentifier() {\n const node = this.parseIdentifierReference();\n node.type = 'LabelIdentifier';\n return node;\n }", "title": "" }, { "docid": "ecb5e4cd9842df5d7712ee5d1c05dedc", "score": "0.48906252", "text": "static async labelToWord(label, idToWordMap) {\n const elements = await label.data();\n const id = elements.indexOf(Math.max.apply(Math, elements));\n const word = idToWordMap[id];\n return word;\n }", "title": "" }, { "docid": "c989c2d02a5d5900e5df8da99468229b", "score": "0.48827925", "text": "function addTab() {\n var label = tabTitle.val() || \"Product \" + tabCounter,\n id = myid+\"-\" + tabCounter,\n li = $( tabTemplate.replace( /#\\{href\\}/g, \"#\" + id ).replace( /#\\{label\\}/g, label ) ),\n tabContentHtml = tabContent.val() || \"<div class=\\\"form-group\\\"><label for=\\\"product_link\\\">Product Link<code></code></label><input type=\\\"text\\\" class=\\\"form-control\\\" id=\\\"productLink\\\" name=\\\"productLink\\\" placeholder=\\\"Enter Link\\\" value=\\\"\\\"></div><div class=\\\"form-group\\\"><label for=\\\"product_description\\\">Product Description<code></code></label><input type=\\\"text\\\" class=\\\"form-control\\\" id=\\\"productDesscription\\\" name=\\\"productDesscription\\\" placeholder=\\\"Enter Description\\\" value=\\\"\\\"><label for=\\\"Picture\\\">Picture<code></code></label></div>\";\n tabs.find( \".ui-tabs-nav\" ).append( li );\n tabs.append( \"<div id='\" + id + \"'><p>\" + tabContentHtml + \"</p></div>\" );\n tabs.tabs( \"refresh\" );\n tabCounter++;\n }", "title": "" }, { "docid": "b56cc9fd19eaaaee351f43f0ddc112b9", "score": "0.4874835", "text": "function setupAddButton () {\n $('.js-label-tab-content').on('click', '.js-add-label-button', e => {\n let $this = $(e.currentTarget)\n\n let text = $this.parent().find('input').val()\n let type = $this.parents('[data-type]').data('type')\n\n // Check the text valid.\n if (!core.isValidInput(text)) {\n alertDialog.show({ message : 'Nor white space, tab, or line break are not permitted.' })\n return\n }\n\n // Chose one at random.\n let aColor = color.choice()\n\n let d = db.getLabelList()\n let labelObject = d[type] || { labels : [] }\n labelObject.labels.push([ text, aColor ])\n d[type] = labelObject\n db.saveLabelList(d)\n\n // Re-render.\n $(`.js-label-tab[data-type=\"${core.getCurrentTab()}\"]`).click()\n\n // Notify color changed.\n color.notifyColorChanged({\n text,\n color : aColor,\n annoType : core.getCurrentTab()\n })\n })\n}", "title": "" }, { "docid": "ba2cbb2a06a467e7286cbecce5544410", "score": "0.48746532", "text": "function objectSplitLbl(lblstr)\r\n{\r\n\tvar lbl_parts = lblstr.split(\":\");\r\n\treturn {typeTitle:lbl_parts[0], objTitle:lbl_parts[1]};\r\n}", "title": "" }, { "docid": "77d0e5bc3b36590c260e2f611601d8c6", "score": "0.48720962", "text": "function createSpecificChartLink(id, link, labelFormat) {\n if (id == 0) {\n chartLabels = [];\n chartDataTemp = [];\n chartDataPressure = [];\n chartDataO3 = [];\n chartDataPM1 = []\n }\n if (id != 0) {\n getDataLink(id, link, labelFormat);\n }\n setTimeout(createChart, 100, chartLabels, chartDataTemp, tempChart, 'SO2', 'rgba(255, 255, 0, 0.58)', true, '#989800');\n setTimeout(createChart, 100, chartLabels, chartDataPressure, pressureChart, 'NO2', 'rgba(255, 0, 0, 0.58)', true, '#980000');\n setTimeout(createChart, 100, chartLabels, chartDataO3, O3Chart, 'O3', 'rgba(0, 255, 10, 0.58)', true, '#009806');\n setTimeout(createChart, 100, chartLabels, chartDataPM1, PM1Chart, 'PM1', 'rgba(0, 245, 255, 0.58)', true, '#009298');\n}", "title": "" }, { "docid": "6ef79f3b7b4a26881779908aaea7e66f", "score": "0.48709562", "text": "function deleteTab(id) {\n // Remove the tab\n var index = w2ui[\"editortabs\"].get(id, true);\n w2ui[\"editortabs\"].remove(id);\n // Select a new tab\n var editors = getEditors();\n var cnt = editors.length;\n if (cnt > 0) {\n var newindex = (index < cnt) ? index : cnt - 1;\n var newid = editors[newindex].ceylonId;\n selectTab(newid);\n } else {\n updateMenuState();\n }\n updateAdvancedState();\n}", "title": "" }, { "docid": "337645f08691836be0b46bdb52a19e57", "score": "0.4864796", "text": "function mapTabsWithMaps() {\n\n}", "title": "" }, { "docid": "5ef7b82c4fe76d5644817f5490860fcd", "score": "0.48617336", "text": "function setupTabRedirection(id) {\n\t// Javascript to enable link to tab\n\tvar url = document.location.toString();\n\tif (url.match('#')) {\n\t\tvar hash = url.split('#')[1];\n\t $('#' + id + 'Tabs a[href=\"#' + hash + '\"]').tab('show');\n\t} //add a suffix\n\n\t// Change hash for page-reload\n\t$('.nav-tabs a').on('shown.bs.tab', function (e) {\n\t window.location.hash = e.target.hash;\n\t});\n}", "title": "" }, { "docid": "4a84a676f3f614e91249f519af63a6fe", "score": "0.48573965", "text": "function addToTabLookup(selector) {\n\tvar $tmp = $(selector).find(\".chat_container\");\n\tvar tab_id = \"#\"+$tmp.parent().attr(\"id\");\n\ttab_lookup[tab_id] = {\n\t\t$tab_href:\t\t\t$(\"a[href='\"+tab_id+\"']\"),\n\t\t$chat_container: \t$tmp,\n\t\t$chat_cont_left:\t$tmp.find(\".chat_container_left\"),\n\t\t$chat_left:\t\t\t$tmp.find(\".chat_left\"),\n\t\t$chat_bottom_left:\t$tmp.find(\".chat_bottom_left\"),\n\t\t$chat_bottom_right:\t$tmp.find(\".chat_bottom_right\"),\n\t\t$chat_right:\t\t$tmp.find(\".chat_right\"),\n\t\t$message_input:\t\t$tmp.find(\".message_input\"),\n\t\tchat_history:\t\t0\n\t};\n}", "title": "" }, { "docid": "3d58f87bbadce4269a7a5f91cea3161b", "score": "0.48563233", "text": "function tabs (state = initialTabs, action) {\n switch (action.type) {\n case actions.RECV_DATA:\n case actions.RECV_ERROR:\n case actions.REQ_DATA:\n return state.map((tab) => {\n if (tab.guid === action.object.tab) {\n // if RECV_ERROR then do stuff\n return {\n ...tab,\n response: {\n url: action.object.url,\n response: action.object.json || false\n }\n };\n }\n return tab;\n });\n case actions.ADD_TAB:\n const guid = UUID.v4();\n return state.concat({\n guid: guid,\n label: 'New Tab',\n url: ''\n });\n case actions.UPDATE_TAB:\n return state.map((tab) => {\n if (tab.guid === action.object.tab) {\n return { ...tab, ...action.object.updates };\n }\n return tab;\n });\n case actions.DELETE_TAB:\n return state.filter((tab) => tab.guid !== action.object);\n case actions.SWITCH_TAB:\n return state.map((tab) => {\n if (tab.guid === action.object) {\n return { ...tab, selected: true };\n }\n if (tab.selected === true) {\n return { ...tab, selected: false };\n }\n return tab;\n });\n case actions.SWITCH_TAB_LOGIN:\n return state.map((tab) => {\n if (tab.guid === action.object.tab) {\n return { ...tab, login: action.object.login };\n }\n return tab;\n });\n default:\n return state;\n }\n /*\n require('node-uuid').v4()\n */\n}", "title": "" }, { "docid": "351b8157e8b2bb0a4810978a7fb0cdf9", "score": "0.48426452", "text": "loadLegacyTabs(values) {\n let tabs = [new Tab('Welcome', TAB_TYPES.WELCOME)]\n tabs = tabs.concat(\n values.map((x, index) => {\n const tab = new QueryTab(this.meta, `Query-${index + 1}`, TAB_TYPES.SQL_QUERY)\n tab.id = x.key\n tab.query = x.query\n return tab\n })\n )\n this.tabs = tabs\n this.selectedTabId = this.tabs.length ? this.tabs[0].id : undefined\n }", "title": "" }, { "docid": "741f426c5c3d3e571b41c166d0d32043", "score": "0.48357436", "text": "setupSettingLabels() {\n const labels = document.getElementsByTagName('LABEL');\n for (let i = 0; i < labels.length; i++) {\n const htmlFor = labels[i].htmlFor;\n if (htmlFor != '') {\n const elem = document.getElementById(htmlFor);\n if (elem) elem.label = labels[i];\n } else {\n // If 'for' isn't set, use the first input element child\n const children = labels[i].children;\n for (let j = 0; j < children.length; j++) {\n if (children[j].form !== undefined) {\n children[j].label = labels[i];\n break;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "82ff0437daafe4b603849d0a57152bf5", "score": "0.48285496", "text": "function setActiveTab(pageId) {\n let pages = document.querySelectorAll(\".tabbar a\");\n for (let page of pages) {\n if (`#${pageId}` === page.getAttribute(\"href\")) {\n page.classList.add(\"active\");\n } else {\n page.classList.remove(\"active\");\n }\n\n }\n}", "title": "" }, { "docid": "d7d2898a7cb19a36c7b0a77259c3a0c5", "score": "0.48267126", "text": "function ChangeActiveTab(id) {\n $(\".list-group-item\").eq(id).tab(\"show\")\n }", "title": "" }, { "docid": "d972a48f38a273ce786b4549b3234f95", "score": "0.48171064", "text": "function App() {\n const [tabs, setTabs] = useState([\n {\n index: 0,\n text: \"Info in tab 1\",\n selected: true,\n }, {\n index: 1,\n text: \"Info in tab 2\",\n selected: false,\n },\n {\n index: 2,\n text: \"Info in tab 3\",\n selected: false,\n },\n ])\n\n const clickHandler = (clickedIndex) => {\n console.log(\"You clicked tab index ${clickedIndex}.\");\n tabs.map((tab, i) => {\n let t = tab;\n if (clickedIndex === i) {\n t.selected = true;\n setTabs([...tabs.slice(0, i), t].concat(tabs.slice(i + 1)));\n } else {\n t.selected = false;\n setTabs([...tabs.slice(0, i), t].concat(tabs.slice(i + 1)));\n }\n });\n };\n\n\n return (\n <div className=\"App\" >\n {\n tabs.map((tab, i) => {\n return <TabHeader index={i} key={i} selected={tab.selected} clickHandler={clickHandler} />\n })\n }\n {\n tabs.map((tab, i) => {\n return tab.selected ? <h2 key={i}> {tab.text}</h2> : \"\";\n })\n }\n </div>\n );\n}", "title": "" }, { "docid": "847dad6c82e67314f09838572252b019", "score": "0.48073465", "text": "function getTabById(tabId) {\n\treturn getAllTabs()[tabId]\n}", "title": "" }, { "docid": "e3e3f49d121ff1b91cd6f1e8898c5163", "score": "0.4807238", "text": "render() {\n const { data } = this.props\n return (\n <Tabs>\n <TabList>\n {data.map(tab =>\n <Tab>\n {tab.label}\n </Tab>\n )}\n </TabList>\n <TabPanels>\n {data.map(tab =>\n <TabPanel>\n {tab.content}\n </TabPanel>\n )}\n </TabPanels>\n </Tabs>\n )\n }", "title": "" }, { "docid": "e7b6c2062296fe3ecfd07d1845731eef", "score": "0.47998142", "text": "function updateTab(tabId,title, url) {\r\n \tvar tab = tabPanel.getItem(tabId);\r\n \tif(tab){\r\n \t\t//tab.getUpdater().update(url);\r\n \t\ttab.setTitle(title);\r\n \t}else{\r\n \t\ttab = addTab(title,url);\r\n \t}\r\n \ttabPanel.setActiveTab(tab);\r\n }", "title": "" }, { "docid": "3e894d096b32bfd6a56c27001a459eab", "score": "0.47998065", "text": "function objectSetNameLabel(obj_type, id, con)\r\n{\r\n\tif (obj_type && id)\r\n\t{\r\n ajax = new CAjax('json');\r\n ajax.cbData.con = con;\r\n ajax.onload = function(ret)\r\n {\r\n if (!ret['error'])\r\n this.cbData.con.innerHTML = unescape(ret);\r\n };\r\n var args = [[\"obj_type\", obj_type], [\"id\", id]];\r\n ajax.exec(\"/controller/Object/getObjName\", args);\r\n\t}\r\n}", "title": "" }, { "docid": "7d5b8360a9ddf760cbc77df2950820f7", "score": "0.47973397", "text": "function ChangeTab(objid, lang, index, snippetCount)\r\n{\r\n setCurrentLang(objid, lang, index, snippetCount, true);\r\n SetCodeSnippetContainerLangCookie(lang);\r\n\r\n // switch tab for all of other code snippets\r\n i = 0;\r\n while (i < snippetIdSets.length)\r\n {\r\n // we just care about other snippets\r\n if (snippetIdSets[i] != objid)\r\n {\r\n\r\n var _tempSnippetCount = 5;\r\n if (document.getElementById(snippetIdSets[i] + \"_tab4\") == null)\r\n _tempSnippetCount = 1;\r\n if (_tempSnippetCount < 2)\r\n { // Tabs are not grouped - skip\r\n i++;\r\n continue;\r\n }\r\n\r\n\r\n var index = 1, j = 1;\r\n while (j < 6)\r\n {\r\n var tabTemp = document.getElementById(snippetIdSets[i] + \"_tab\" + j);\r\n if (tabTemp == null) { j++; continue; }\r\n if (tabTemp.innerHTML.indexOf(lang) != -1)\r\n {\r\n index = j;\r\n }\r\n j++;\r\n }\r\n\r\n if (index > 5) index = 1;\r\n setCurrentLang(snippetIdSets[i], lang, index, _tempSnippetCount, false);\r\n }\r\n i++;\r\n }\r\n}", "title": "" }, { "docid": "1e689bcedf42c0d63edb59428bdde256", "score": "0.47963995", "text": "changeTab(tab) {\n this.setState({ currentTab: tab.id });\n }", "title": "" }, { "docid": "9a022d6f65482c03c3692e70f4eca220", "score": "0.47927722", "text": "selectTab(id) {\n if (this.selectedTab !== null && this.selectedTab.getDataSet().tabId === id) {\n return;\n }\n\n for (const tabId in this.tabs) {\n if (this.tabs.hasOwnProperty(tabId)) {\n this.tabs[tabId].removeClass('selected');\n }\n }\n\n this.tabs[id].addClass('selected');\n this.selectedTab = this.tabs[id];\n for (const tabId in this.tabContents) {\n if (this.tabContents.hasOwnProperty(tabId) && tabId === id) {\n this.tabContents[tabId].show('block');\n if (this.options.selectCallback) {\n this.options.selectCallback(this.tabs[tabId], this.tabContents[tabId]);\n }\n } else {\n this.tabContents[tabId].hide();\n }\n }\n\n // Save current selected tab state in local storage. The JSON object isn't necessary at the moment,\n // but we can tack on other properties as needed for additional state in the future.\n if (PrimeStorage.supported && this.options.localStorageKey !== null) {\n const data = {\n tabId: id\n };\n PrimeStorage.setSessionObject(this.options.localStorageKey, data);\n }\n\n const ajaxURL = this.selectedTab.getDataSet().tabUrl;\n if (ajaxURL !== '') {\n this.selectedTab.addClass('loading');\n this.tabContents[id].setHTML('');\n this.tabContents[id].addClass('loading');\n new PrimeRequest(ajaxURL, 'GET')\n .withSuccessHandler(this._handleAJAXResponse)\n .withErrorHandler(this._handleAJAXResponse)\n .go();\n }\n }", "title": "" }, { "docid": "6e4b627458125d785c0dc1b486d5757f", "score": "0.47916466", "text": "function addTab(tab_group_id,tab_id,tab_name) {\n\tvar tab_group = document.getElementById(tab_group_id);\n\tvar tab_node = document.getElementById(tab_id);\n\tif(!tab_node) {\n\t\ttab_node = document.createElement(\"button\");\n\t\ttab_node.setAttribute('type','button');\n\t\ttab_node.className = TAB_CLASS_UNSELECTED;\n\t\ttab_node.id = tab_id;\n\t\ttab_node.addEventListener('click',function() {\n\t\t\tonClickTab(tab_id);\n\t\t});\n\t\ttab_group.appendChild(tab_node);\n\t}\n\ttab_node.innerText = tab_name;\n}", "title": "" }, { "docid": "b9cef4526e64fb364031cf9037f55356", "score": "0.47881448", "text": "function getPseudoId(tabId, url){\r\n //also set tab_arr here!!!\r\n //We have to check for this because the webrequest listener fires before the tabs listener and thus this will be undefined for the first webrequest from a given tab.\r\n var pId;\r\n if(tab_arr[tabId] == undefined){\r\n if(DEBUG) {\r\n //console.log(tab_arr[tabId]);\r\n //console.log(url);\r\n }\r\n pId = getDomain(url);\r\n pId = 'Tab' + tabId;\r\n tab_arr[tabId]=pId; \r\n }\r\n if(tab_arr[tabId] == \"newtab\")\r\n {\r\n pId = 'NewTab'\r\n tab_arr[tabId] = tab_arr[tabId]; \r\n }\r\n else\r\n {\r\n pId = tab_arr[tabId];\r\n }\r\n //console.log(tab_arr[tabId]);\r\n return pId;\r\n}", "title": "" }, { "docid": "28c323ce4c34ac0e640de8d03d468fb3", "score": "0.47832903", "text": "function addLabel(label, id) {\n\t$(\"#\" + id).append(\"<h4 style='text-align:center'>\" + label + \"</h4>\")\n}", "title": "" }, { "docid": "2c58255000842c4fd8c13b4c98bf0410", "score": "0.47828084", "text": "function addTab() {\n var label = tabTitle.val() || \"Tab \" + tabCounter,\n id = \"tabs-\" + tabCounter,\n li = $( tabTemplate.replace( /#\\{href\\}/g, \"#\" + id ).replace( /#\\{label\\}/g, label ) ),\n tabContentHtml = tabContent.val() || \"Tab \" + tabCounter + \" content.\";\n\n tabs.find( \".ui-tabs-nav\" ).append( li );\n tabs.append( \"<div id='\" + id + \"'><p>\" + tabContentHtml + \"</p></div>\" );\n tabs.tabs( \"refresh\" );\n tabCounter++;\n }", "title": "" }, { "docid": "43f95d3718d07b99a4bb2b72451d3598", "score": "0.47764233", "text": "function setActiveTab(id) {\n hidePackageContent();\n $('.nav-tabs a[href=\"#' + id + '\"]').tab('show');\n $(\"main #packagesPageContent #packagesImageHeader img\").hide();\n $(\"#\" + id + \"Banner\" ).show();\n }", "title": "" }, { "docid": "b334af4181ff439a601006c6924800e5", "score": "0.4775888", "text": "function _reloaddimnsn4tabs(id) {\r\n\t_initDimnTempData();\r\n\t// clear the pane\r\n\t_redrawdimnsn4tabs();\r\n\tfor (var i = 0; i < reportGlobal.dimensionstemp[\"members\"].length; i++) {\r\n\t\tif (reportGlobal.dimensionstemp[\"members\"][i].memberId == id) {\r\n\t\t\t_loadSelectedOptions(reportGlobal.dimensionstemp[\"members\"][i]);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "cbb7281989e72fbc6c0bb4635caa3379", "score": "0.47649005", "text": "function updateTabInfo(tab) {\n const tabInfo = tabsInfoMap[tab.tabId] || Object.create(null);\n tabInfo.tabId = tab.tabId;\n tabInfo.title = tab.title;\n tabInfo.isExtensionTab = tab.url && tab.url.indexOf(adguard.app.getExtensionUrl()) === 0;\n tabsInfoMap[tab.tabId] = tabInfo;\n return tabInfo;\n }", "title": "" }, { "docid": "bb59995873d2f0e503b308bd489034cd", "score": "0.4764469", "text": "get name() { return tabComponent; }", "title": "" }, { "docid": "bb59995873d2f0e503b308bd489034cd", "score": "0.4764469", "text": "get name() { return tabComponent; }", "title": "" }, { "docid": "bb59995873d2f0e503b308bd489034cd", "score": "0.4764469", "text": "get name() { return tabComponent; }", "title": "" }, { "docid": "de4247d4f3707b6a1039fe42c9ad9917", "score": "0.47508925", "text": "getObjectTab( instance, obj_id ){\n const tabs = Object.keys( instance.ronin.tabs );\n for( let i=0 ; i<tabs.length ; ++i ){\n if( Template.projects_tree.fn.tree_hasId( instance.ronin.tabs[tabs[i]].$tree, obj_id )){\n return tabs[i];\n }\n }\n return null;\n }", "title": "" }, { "docid": "eeab87fd0220f32c8deee3fc9f582524", "score": "0.47507235", "text": "parseQueryObjs($ = this.$, l = this.l, id = this.id) {\n const mapTabToKey = {\n '#tabs-productofrecipe': 'recipes',\n '#tabs-recipematerial': 'used_in_recipe',\n '#tabs-mproductofrecipe': 'recipes',\n '#tabs-designmaterial': 'used_in_design',\n }\n const tabs = Object.keys(mapTabToKey)\n const Ctrl = new TabsController(id, l)\n return $('.nav.nav-tabs').find('a').toArray().map((node, i) => {\n const href = $(node).attr('href')\n if (!tabs.includes(href))\n return null\n return {\n uri: Ctrl.get(href),\n key: mapTabToKey[href]\n }\n }).filter(e => e)\n }", "title": "" }, { "docid": "1a49a66bc34d8b93de313906c5a233e0", "score": "0.4749054", "text": "function m_createLabel(forId) {\n var el = document.createElement(\"label\");\n el.htmlFor = forId;\n return el;\n}", "title": "" }, { "docid": "751c618b0d6b8e5216d283762980c630", "score": "0.4745425", "text": "function onClickTab(tab_id) {\n\tsetSelectedTab(tab_id);\n\tloadVideoSelection('videos',tab_id);\n\tloadFirstVideoFromSelection(tab_id);\n}", "title": "" }, { "docid": "16ee3a0085a62b39b0be11bbb1432601", "score": "0.47279105", "text": "function ControlledTabs() {\n const [key, setKey] = useState('main');\n \n return (\n <Tabs id=\"controlled-tab\" activeKey={key} onSelect={k => setKey(k)}>\n <Tab eventKey=\"main\" title=\"Main\">\n <MainTab />\n </Tab>\n <Tab eventKey=\"chart\" title=\"Chart\">\n <Charts />\n </Tab>\n <Tab eventKey=\"news\" title=\"News\">\n <News />\n </Tab>\n <Tab eventKey=\"favorites\" title=\"Favorites\">\n <Favorites />\n </Tab>\n {/* <Tab eventKey=\"notes\" title=\"Notes\">\n <Notes />\n </Tab> */}\n {/* <Tab eventKey=\"contact\" title=\"Contact\" disabled>\n <div>\n final div\n </div>\n </Tab> */}\n </Tabs>\n );\n }", "title": "" }, { "docid": "f7188e4774aa5e13bad1959822c83273", "score": "0.47266707", "text": "getTabNav() {\n const tabs = [\n { title: 'Updates', tab: 'reports' },\n { title: 'Game Log', tab: 'splits' },\n ];\n\n return tabs.map((tab) => {\n let classes = '';\n\n if (this.state.activeTab === tab.tab) {\n classes = 'active';\n }\n\n return (\n <li\n key={tab.tab}\n className={classes}\n onClick={this.handleTabClick.bind(this, tab.tab)}\n >\n <span className=\"tab-title\">\n {tab.title}\n </span>\n </li>\n );\n });\n }", "title": "" }, { "docid": "6d89e17178f5c4f2f8e339bfbae014a5", "score": "0.47227105", "text": "function create(label) {\n return { label: label };\n }", "title": "" }, { "docid": "6d89e17178f5c4f2f8e339bfbae014a5", "score": "0.47227105", "text": "function create(label) {\n return { label: label };\n }", "title": "" }, { "docid": "16ed6a518fec367af07925b855934170", "score": "0.47202203", "text": "function updateTabOrder() {\n var orderedTabs = [];\n $(\".tab\").each(function(i) {\n var id = $(this).attr('id').slice(4);\n toolbar.bar.tabs.forEach(function(tab) {\n if (id === tab.id.toString()) {\n orderedTabs.push(tab);\n }\n });\n });\n toolbar.bar.tabs = orderedTabs;\n}", "title": "" }, { "docid": "0c3b4be5aa31298c4ac71034fcc809ba", "score": "0.47148588", "text": "function create(label) {\r\n return { label: label };\r\n }", "title": "" }, { "docid": "a2756c43296ec38491c6ba6f5be6bea1", "score": "0.47088078", "text": "function create(label) {\n return { label: label };\n }", "title": "" }, { "docid": "054ba088dfb01d211ff949f0cb0d5213", "score": "0.47068578", "text": "getLabel(item, lmap) {\n let label = '';\n for (const labelkey in lmap) {\n if (lmap.hasOwnProperty(labelkey) && item === labelkey) {\n label = lmap[labelkey];\n }\n }\n return label;\n }", "title": "" }, { "docid": "4bc47e8ac08832e28da3aa2837b678a4", "score": "0.47039303", "text": "buildTab(tabdef, order, parent) {\n\n let parentname = 'root',\n next = order + 1,\n previous = order - 1;\n\n if (previous < 1) { previous = 0; }\n\n if ((!tabdef.label) && (!tabdef.icon)) {\n console.warn('TabBar: Element defined but has neither icon or text. Skipping');\n return null;\n }\n\n let li = document.createElement('li');\n li.setAttribute('role', 'none');\n li.setAttribute('id', `parent-${tabdef.id}`);\n li.setAttribute('data-tabno', `${order}`);\n if (tabdef.classes) {\n for (let c of tabdef.classes) {\n li.classList.add(c);\n }\n }\n if (tabdef.tooltip) {\n new ToolTip({\n text: tabdef.tooltip,\n gravity: (tabdef.tooltipgravity ? tabdef.tooltipgravity : 's')\n }).attach(li);\n }\n\n let link = document.createElement('a');\n link.setAttribute('data-tabtext', tabdef.label);\n link.setAttribute('data-tabno', order);\n link.setAttribute('id', tabdef.id);\n link.setAttribute('data-tabid', tabdef.id);\n link.setAttribute('tabindex', '-1'); // always set this here\n\n if (tabdef.dataattributes) {\n CFBUtils.applyDataAttributes(tabdef.dataattributes, link);\n }\n\n if (!this.navigation) {\n link.setAttribute('role', 'menuitem');\n }\n if (tabdef.icon) {\n link.appendChild(IconFactory.icon(tabdef.icon));\n }\n if (tabdef.label) {\n let linktext = document.createElement('span');\n linktext.classList.add('t');\n linktext.innerHTML = tabdef.label;\n link.appendChild(linktext);\n }\n\n li.appendChild(link);\n\n if (parent) {\n parentname = parent.getAttribute('data-tabid');\n let plist = parent.querySelector('ul');\n if (!plist) {\n plist = document.createElement('ul');\n plist.setAttribute('role', 'menu');\n plist.classList.add('submenu');\n parent.appendChild(plist);\n }\n plist.appendChild(li); // attach to child list\n } else {\n if (this.animation) {\n li.style.setProperty('--anim-order', order); // used in animations\n li.classList.add(this.animation);\n }\n this.list.appendChild(li); // attach to root list\n }\n link.setAttribute('data-parent', parentname);\n li.setAttribute('data-parent', parentname);\n order++;\n\n // Is this a master menu item?\n if ((tabdef.subtabs) && (tabdef.subtabs.length > 0)) {\n link.classList.add('mastertab');\n link.setAttribute('aria-haspopup', true);\n link.setAttribute('aria-expanded', false);\n if (this.submenuicon) {\n let sicon = IconFactory.icon(this.submenuicon);\n sicon.classList.add('secondicon');\n link.appendChild(sicon);\n }\n // Add the subtabs ins\n let localorder = 1;\n for (let subdef of tabdef.subtabs) {\n localorder = this.buildTab(subdef, localorder, li);\n }\n\n link.addEventListener('keydown', (e) => {\n let setname = li.getAttribute('data-parent');\n let prevtab = li.parentNode.querySelector(`li[data-parent='${setname}'][data-tabno='${previous}'] a[data-tabno='${previous}']`);\n let nexttab = li.parentNode.querySelector(`li[data-parent='${setname}'][data-tabno='${next}'] a[data-tabno='${next}']`);\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n if (prevtab) {\n prevtab.focus();\n }\n break;\n case 'ArrowRight':\n e.preventDefault();\n e.stopPropagation();\n if (nexttab) {\n nexttab.focus();\n }\n break;\n case 'ArrowDown':\n case 'Enter':\n case 'Space':\n e.preventDefault();\n e.stopPropagation();\n let ul = li.querySelector('ul');\n if (ul) {\n let children = ul.querySelectorAll('li a');\n children[0].focus();\n }\n break;\n default:\n break;\n }\n });\n } else if (tabdef.url) {\n link.setAttribute('href', tabdef.url);\n } else { // Non-Master Tabs\n link.addEventListener('keydown', (e) => {\n\n let setname = li.getAttribute('data-parent');\n let prevtab = li.parentNode.querySelector(`li[data-parent='${setname}'][data-tabno='${previous}'] a[data-tabno='${previous}']`);\n let nexttab = li.parentNode.querySelector(`li[data-parent='${setname}'][data-tabno='${next}'] a[data-tabno='${next}']`);\n let parenttab;\n if (parent) {\n parenttab = parent.querySelector('a');\n }\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n if ((previous === 0) && (parenttab)) {\n parenttab.focus();\n } else if (prevtab) {\n prevtab.focus();\n }\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n e.preventDefault();\n e.stopPropagation();\n if (nexttab) {\n nexttab.focus();\n }\n break;\n case 'Escape':\n e.preventDefault();\n e.stopPropagation();\n if (parenttab) {\n parenttab.focus();\n }\n break;\n case 'Enter':\n case 'Space':\n e.preventDefault();\n e.stopPropagation();\n link.click();\n break;\n default:\n break;\n }\n });\n link.addEventListener('click', (e) => {\n e.preventDefault();\n this.select(tabdef.id);\n if ((tabdef.action) && (typeof tabdef.action === 'function')) {\n tabdef.action(tabdef.id, this);\n } else if (this.action) {\n this.action(tabdef.id, this);\n }\n link.blur();\n });\n }\n\n if (tabdef.selected) {\n window.setTimeout(() => { // Have to wait until we're sure we're in the DOM\n this.select(tabdef.id);\n }, 100);\n }\n\n return order; // send this back.\n }", "title": "" }, { "docid": "4bc47e8ac08832e28da3aa2837b678a4", "score": "0.47039303", "text": "buildTab(tabdef, order, parent) {\n\n let parentname = 'root',\n next = order + 1,\n previous = order - 1;\n\n if (previous < 1) { previous = 0; }\n\n if ((!tabdef.label) && (!tabdef.icon)) {\n console.warn('TabBar: Element defined but has neither icon or text. Skipping');\n return null;\n }\n\n let li = document.createElement('li');\n li.setAttribute('role', 'none');\n li.setAttribute('id', `parent-${tabdef.id}`);\n li.setAttribute('data-tabno', `${order}`);\n if (tabdef.classes) {\n for (let c of tabdef.classes) {\n li.classList.add(c);\n }\n }\n if (tabdef.tooltip) {\n new ToolTip({\n text: tabdef.tooltip,\n gravity: (tabdef.tooltipgravity ? tabdef.tooltipgravity : 's')\n }).attach(li);\n }\n\n let link = document.createElement('a');\n link.setAttribute('data-tabtext', tabdef.label);\n link.setAttribute('data-tabno', order);\n link.setAttribute('id', tabdef.id);\n link.setAttribute('data-tabid', tabdef.id);\n link.setAttribute('tabindex', '-1'); // always set this here\n\n if (tabdef.dataattributes) {\n CFBUtils.applyDataAttributes(tabdef.dataattributes, link);\n }\n\n if (!this.navigation) {\n link.setAttribute('role', 'menuitem');\n }\n if (tabdef.icon) {\n link.appendChild(IconFactory.icon(tabdef.icon));\n }\n if (tabdef.label) {\n let linktext = document.createElement('span');\n linktext.classList.add('t');\n linktext.innerHTML = tabdef.label;\n link.appendChild(linktext);\n }\n\n li.appendChild(link);\n\n if (parent) {\n parentname = parent.getAttribute('data-tabid');\n let plist = parent.querySelector('ul');\n if (!plist) {\n plist = document.createElement('ul');\n plist.setAttribute('role', 'menu');\n plist.classList.add('submenu');\n parent.appendChild(plist);\n }\n plist.appendChild(li); // attach to child list\n } else {\n if (this.animation) {\n li.style.setProperty('--anim-order', order); // used in animations\n li.classList.add(this.animation);\n }\n this.list.appendChild(li); // attach to root list\n }\n link.setAttribute('data-parent', parentname);\n li.setAttribute('data-parent', parentname);\n order++;\n\n // Is this a master menu item?\n if ((tabdef.subtabs) && (tabdef.subtabs.length > 0)) {\n link.classList.add('mastertab');\n link.setAttribute('aria-haspopup', true);\n link.setAttribute('aria-expanded', false);\n if (this.submenuicon) {\n let sicon = IconFactory.icon(this.submenuicon);\n sicon.classList.add('secondicon');\n link.appendChild(sicon);\n }\n // Add the subtabs ins\n let localorder = 1;\n for (let subdef of tabdef.subtabs) {\n localorder = this.buildTab(subdef, localorder, li);\n }\n\n link.addEventListener('keydown', (e) => {\n let setname = li.getAttribute('data-parent');\n let prevtab = li.parentNode.querySelector(`li[data-parent='${setname}'][data-tabno='${previous}'] a[data-tabno='${previous}']`);\n let nexttab = li.parentNode.querySelector(`li[data-parent='${setname}'][data-tabno='${next}'] a[data-tabno='${next}']`);\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n if (prevtab) {\n prevtab.focus();\n }\n break;\n case 'ArrowRight':\n e.preventDefault();\n e.stopPropagation();\n if (nexttab) {\n nexttab.focus();\n }\n break;\n case 'ArrowDown':\n case 'Enter':\n case 'Space':\n e.preventDefault();\n e.stopPropagation();\n let ul = li.querySelector('ul');\n if (ul) {\n let children = ul.querySelectorAll('li a');\n children[0].focus();\n }\n break;\n default:\n break;\n }\n });\n } else if (tabdef.url) {\n link.setAttribute('href', tabdef.url);\n } else { // Non-Master Tabs\n link.addEventListener('keydown', (e) => {\n\n let setname = li.getAttribute('data-parent');\n let prevtab = li.parentNode.querySelector(`li[data-parent='${setname}'][data-tabno='${previous}'] a[data-tabno='${previous}']`);\n let nexttab = li.parentNode.querySelector(`li[data-parent='${setname}'][data-tabno='${next}'] a[data-tabno='${next}']`);\n let parenttab;\n if (parent) {\n parenttab = parent.querySelector('a');\n }\n\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n if ((previous === 0) && (parenttab)) {\n parenttab.focus();\n } else if (prevtab) {\n prevtab.focus();\n }\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n e.preventDefault();\n e.stopPropagation();\n if (nexttab) {\n nexttab.focus();\n }\n break;\n case 'Escape':\n e.preventDefault();\n e.stopPropagation();\n if (parenttab) {\n parenttab.focus();\n }\n break;\n case 'Enter':\n case 'Space':\n e.preventDefault();\n e.stopPropagation();\n link.click();\n break;\n default:\n break;\n }\n });\n link.addEventListener('click', (e) => {\n e.preventDefault();\n this.select(tabdef.id);\n if ((tabdef.action) && (typeof tabdef.action === 'function')) {\n tabdef.action(tabdef.id, this);\n } else if (this.action) {\n this.action(tabdef.id, this);\n }\n link.blur();\n });\n }\n\n if (tabdef.selected) {\n window.setTimeout(() => { // Have to wait until we're sure we're in the DOM\n this.select(tabdef.id);\n }, 100);\n }\n\n return order; // send this back.\n }", "title": "" }, { "docid": "86e2811c85c374de589655bdc6106966", "score": "0.4703614", "text": "function makeTabGroup(tabsArr) {\n return {\n date: Date.now(),\n id: Date.now(), // clever way to quickly get a unique ID\n title: '',\n tabs: tabsArr.map(tab => ({url: tab.url, title: tab.title, pinned: tab.pinned}))\n };\n }", "title": "" }, { "docid": "8c0e9ccb0b921637d38343b09f2477a4", "score": "0.47006652", "text": "getArticleLinkId() {\n if (this.tabId == null)\n return \"\";\n else\n return 'tabid-' + this.tabId;\n }", "title": "" }, { "docid": "5d2355c9a3ab8669ef308c003dc58440", "score": "0.46875465", "text": "function bctActiveMetadataTab(tabId){\n // var tabId = tabId;\n $('body').attr('data-open-metadata-tab', tabId);\n}", "title": "" }, { "docid": "9870a0674d2ed6505944db352347b2e3", "score": "0.46836764", "text": "function makeTabGroup(tabsArr) {\n var date;\n date = dateFormat(\"YYYY-mm-dd HH:MM:SS\", new Date());\n var tabGroup = {\n date: date,\n id: genObjectId() // clever way to quickly get a unique ID\n };\n let res = tabsArr.map(({ title, url }) => ({ title, url }));\n tabGroup.tabs = res;\n tabGroup.isLock = false;\n tabGroup.groupTitle = '';\n return tabGroup;\n }", "title": "" }, { "docid": "50ddab991417605f9db271e94617fe61", "score": "0.46834874", "text": "function historyReplaceID(id=null){\n\t\tvar state_var = {};\n\t\tstate_var['tab'] = 'student';\n\n\t\tif (id != null)\n\t\t\tstate_var['id'] = id;\n\t\telse if (history.state.id != undefined)\n\t\t\tstate_var['id'] = history.state.id;\n\n\t\tif (history.state.page != undefined)\n\t\t\tstate_var['page'] = history.state.page;\n\n\t\thistory.replaceState(state_var, 'student', '');\n\t}", "title": "" }, { "docid": "46b8405d7519f8271d89200faf3daf7e", "score": "0.4680875", "text": "function id2Index(tabsId, srcId)\n{\n\tvar index=-1;\n\tvar i = 0, tbH = $(tabsId).find(\"li a\");\n\tvar lntb=tbH.length;\n\tif(lntb>0){\n\t\tfor(i=0;i<lntb;i++){\n\t\t\to=tbH[i];\n\t\t\tif(o.href.search(srcId)>0){\n\t\t\t\tindex=i;\n\t\t\t}\n\t\t}\n\t}\n\treturn index;\n}", "title": "" }, { "docid": "2f7a0ca4b97a85b76dc0ed187edc6717", "score": "0.46804583", "text": "function handleChange(e) {\n setTabPosition(e.target.id);\n }", "title": "" }, { "docid": "aaf9c26c8edd4eaf19adda0bfebede9e", "score": "0.46760967", "text": "updateTabState(gString, stringNum, e){\n e.preventDefault();\n console.log('UPDATING TAB!', e.target);\n console.log('gString', gString);\n console.log('stringNum', stringNum);\n\n let tab = this.state.tab;\n\n tab[stringNum] = gString;\n\n this.setState({\n tab: tab\n })\n }", "title": "" }, { "docid": "bfa4fbb4ec4fc1a7437f61e5d21e40d4", "score": "0.46752137", "text": "createLabels(trelloLabels, board) {\n trelloLabels.forEach(label => {\n const color = label.color;\n const name = label.name;\n const existingLabel = board.getLabel(name, color);\n if (existingLabel) {\n this.labels[label.id] = existingLabel._id;\n } else {\n const idLabelCreated = board.pushLabel(name, color);\n this.labels[label.id] = idLabelCreated;\n }\n });\n }", "title": "" }, { "docid": "267bf2a21480f6ad2c648e268cb00711", "score": "0.46745947", "text": "tabTap(e) {\n\n var name = e.currentTarget.getAttribute('name');\n //this.selectedTabName = name;\n this.selectTab(name);\n }", "title": "" } ]
01279f68058862d24facbd7571c9c4f4
Enables the use of $joi validator
[ { "docid": "6d9bfe943d511548b78d748a3fb9dec0", "score": "0.69904387", "text": "static useJoi(joi) {\n if (!joi) {\n try {\n joi = require(\"joi\");\n }\n catch (e) {\n throw new Error(`Joi not found! Install Joi`);\n }\n }\n /**\n * Add Validator Joi\n */\n return this.addGlobalValidator({\n name: \"$joi\",\n validator(value, joiSchema, { error, modifier }) {\n /**\n * Check if schema is Joi Schema\n */\n if (!joi.isSchema(joiSchema)) {\n return error(`Invalid JOI schema provided for :param`);\n }\n /**\n * Validate value against joiSchema Passed\n */\n let validated;\n try {\n validated = joi.attempt(value, joiSchema);\n }\n catch (e) {\n return error(e.message);\n }\n /**\n * abolish_Set Value for abolish\n */\n modifier.setThis(validated);\n return true;\n }\n });\n }", "title": "" } ]
[ { "docid": "f737ba9a39cf92e7f68a63c03cad3ff1", "score": "0.61756456", "text": "function Validator () {}", "title": "" }, { "docid": "b29a3f21f8d9b4ec69caf6f878aeea94", "score": "0.61708564", "text": "function Validator() {}", "title": "" }, { "docid": "8a693a53a4c62ef0fb00e05f6791df66", "score": "0.6003499", "text": "function Validator() {\n}", "title": "" }, { "docid": "fbb3d8ef2d658c20cf10a32692d7e040", "score": "0.58921176", "text": "function true_validator() { return true; }", "title": "" }, { "docid": "dff3072608f5ee5eb819c98f2d5c97da", "score": "0.57454467", "text": "initValidator() {\n this.validatorInstance = new WeValidator({\n // the set of the rules applied to the form\n rules: {\n realname: {\n required: true\n },\n idnum: {\n required: true,\n idcard: true\n },\n telnum: {\n required: true,\n mobile: true\n },\n },\n // the message if the rules are violated\n messages: {\n realname: {\n required: '请输入真实姓名'\n },\n idnum: {\n required: '请输入身份证号',\n idcard: '请输入正确的身份证号'\n },\n telnum: {\n required: '请输入手机号',\n mobile: '手机号格式不正确'\n },\n },\n })\n }", "title": "" }, { "docid": "4f9c7c375caaf06341cc4fa0de674276", "score": "0.5735664", "text": "get _validator(){return IronValidatableBehaviorMeta&&IronValidatableBehaviorMeta.byKey(this.validator);}", "title": "" }, { "docid": "e6d8851c95eae6b22aeaeb4c3f95aea4", "score": "0.5727076", "text": "function customValidation(input) {}", "title": "" }, { "docid": "8f17bd77c971e305db812226ddedfc4f", "score": "0.5697528", "text": "get _validator(){return IronValidatableBehaviorMeta&&IronValidatableBehaviorMeta.byKey(this.validator)}", "title": "" }, { "docid": "9b330bba6ece1856ce1219f49eaf0aa9", "score": "0.5659839", "text": "validateRequired() {\r\n let $this = this;\r\n let inputs = this.inputs.required = this.formHandler.findByAttr('required');\r\n\r\n inputs.on(this.options.events, function (e) {\r\n let input = $(this);\r\n $this.required(input);\r\n });\r\n }", "title": "" }, { "docid": "351bb94225ed66b48fa1079db083ffd8", "score": "0.5651557", "text": "getJoi() {\n const newJoi = Joi.extend((joi) => ({\n base: joi.string(),\n name: 'cloakAddress',\n language: {\n validCloak: this.t(`is not a valid Cloak address`),\n validStealth: this.t(`is not a valid Stealth address`),\n validAll: this.t(`is not a valid Cloak or stealth address`)\n },\n /* eslint-disable-next-line no-unused-vars */\n pre: (value, state, options) => value.trim(), // pre: (value, state, options) => value.replace(/\\s+/g, ''),\n rules: [\n {\n name: 'validCloak',\n validate: (params, value, state, options) => {\n if (!this.validate(value, true, false)) {\n const err = joi.createError('cloakAddress.validCloak', {}, state, options)\n err.context.label = ellipsisString(value, 16, 'middle')\n return err\n }\n return value\n }\n },\n {\n name: 'validStealth',\n validate: (params, value, state, options) => {\n if (!this.validate(value, false, true)) {\n const err = joi.createError('cloakAddress.validStealth', {}, state, options)\n err.context.label = ellipsisString(value, 16, 'middle')\n return err\n }\n return value\n }\n },\n {\n name: 'validAll',\n validate: (params, value, state, options) => {\n if (!this.validate(value, true, true)) {\n const err = joi.createError('cloakAddress.validAll', {}, state, options)\n err.context.label = ellipsisString(value, 16, 'middle')\n return err\n }\n return value\n }\n }\n ]\n }))\n\n return newJoi\n }", "title": "" }, { "docid": "83638da027ae8fb9298e09a72fa3279e", "score": "0.5610167", "text": "get _validator() {\n return Polymer.IronValidatableBehaviorMeta &&\n Polymer.IronValidatableBehaviorMeta.byKey(this.validator);\n }", "title": "" }, { "docid": "0dec6221dc415db94ddaf552f75f8712", "score": "0.5606636", "text": "function customValidation(input){\n}", "title": "" }, { "docid": "d9610bbb89a133a73ddc63a56f5623c8", "score": "0.55872554", "text": "function handleValidation() {\n validationEnabled = !validationEnabled;\n }", "title": "" }, { "docid": "2921e99284dd9d42942395c5fef181f0", "score": "0.5570987", "text": "function autoValid(input){\n return true; // default validation only\n}", "title": "" }, { "docid": "2921e99284dd9d42942395c5fef181f0", "score": "0.5570987", "text": "function autoValid(input){\n return true; // default validation only\n}", "title": "" }, { "docid": "2921e99284dd9d42942395c5fef181f0", "score": "0.5570987", "text": "function autoValid(input){\n return true; // default validation only\n}", "title": "" }, { "docid": "e6197b0e78790104eb67dce815a11db7", "score": "0.5563362", "text": "function setupValidator(form) {\r\n jQuery(form).validate();\r\n}", "title": "" }, { "docid": "be7889662016e22c3ee223a31cd27912", "score": "0.5559525", "text": "function customValidation(input){\n \n}", "title": "" }, { "docid": "4359806aa8b48d5b2a04662da10b3d69", "score": "0.5490006", "text": "function initValidator() {\n const dictionary = {\n en: {\n messages: {\n required(fieldName) {\n return \"Field is required\";\n },\n email() {\n return \"Invalid email\";\n },\n is_not() {\n return \"Field is required\";\n },\n confirmed: function() {\n return \"Confirmed password does not match\";\n }\n }\n }\n };\n\n VeeValidate.Validator.localize(dictionary);\n Vue.use(VeeValidate);\n}", "title": "" }, { "docid": "486ffb82e833c235e9a64292a13d5321", "score": "0.54885364", "text": "validate() {\n if (!this.get('ignoreErrs')) {\n if (this._getProperty('required') && this.isBlank()) {\n this.setErr('required');\n } else if (\n !this.isBlank() &&\n this._getProperty('validators') &&\n this._getProperty('validators').length > 0\n ) {\n const validator = new Validator(this._toValidatorProps());\n const errors = validator.validate(this._getProperty('validators'));\n if (errors.length !== 0) {\n this.setErr(errors[0]);\n }\n }\n }\n }", "title": "" }, { "docid": "5f42c1bf3287edac18965421bc9a38b9", "score": "0.54824567", "text": "validate(obj) {\n return false;\n }", "title": "" }, { "docid": "1117cc36b0c16775bbcb1f1a5540fb65", "score": "0.548113", "text": "function autoValid(input) {\n return true; // default validation only\n}", "title": "" }, { "docid": "1117cc36b0c16775bbcb1f1a5540fb65", "score": "0.548113", "text": "function autoValid(input) {\n return true; // default validation only\n}", "title": "" }, { "docid": "75d7cc6cf1b0be332170f125178f196e", "score": "0.54544544", "text": "get _validator() {\n return IronValidatableBehaviorMeta &&\n IronValidatableBehaviorMeta.byKey(this.validator);\n }", "title": "" }, { "docid": "75d7cc6cf1b0be332170f125178f196e", "score": "0.54544544", "text": "get _validator() {\n return IronValidatableBehaviorMeta &&\n IronValidatableBehaviorMeta.byKey(this.validator);\n }", "title": "" }, { "docid": "c3e3c312e229bfbe97613db1e032eca0", "score": "0.5402768", "text": "validate() {}", "title": "" }, { "docid": "c3e3c312e229bfbe97613db1e032eca0", "score": "0.5402768", "text": "validate() {}", "title": "" }, { "docid": "86147d351e11c8420907b4904f6f7b1c", "score": "0.53705484", "text": "checkForValidations() {\n\n }", "title": "" }, { "docid": "66bfe91e3727c35f4224cdee0f750cf0", "score": "0.53677815", "text": "function updateValidator(){\n\t\n}", "title": "" }, { "docid": "12408ae2b2c083f8b7ae8d4c27266756", "score": "0.53657424", "text": "function guarEmpRequiredOn() {\n\tguarEmpJobTitle.required = true\n\tguarEmpCompanyName.required = true\n\tguarEmpLandlineNumber.required = true\n\tguarEmpRefFName.required = true\n\tguarEmpRefLName.required = true\n\tguarEmpRefMob.required = true\n\tguarEmpRefLandline.required = true\n\tguarEmpRefEmail.required = true\n}", "title": "" }, { "docid": "8e27293bf4a74aeb24c79f7a64f17bf8", "score": "0.5348617", "text": "validateIs() {\r\n let $this = this;\r\n let inputs = this.inputs.is = this.formHandler.findByAttr(Validator.VALIDATE_BY_IS);\r\n\r\n inputs.on(this.options.events, function () {\r\n let input = $(this);\r\n\r\n $this.is(input);\r\n });\r\n }", "title": "" }, { "docid": "b64e59a6aa40aef31c1c65275350d6ff", "score": "0.53484744", "text": "constructor() {\n this._composer = new ajv_1.default({ useDefaults: true });\n this._validator = new ajv_1.default();\n this._composer.addSchema(plugin_schema_json_1.default, 'jupyterlab-plugin-schema');\n this._validator.addSchema(plugin_schema_json_1.default, 'jupyterlab-plugin-schema');\n }", "title": "" }, { "docid": "3dd0f8cc58814111972712a562837524", "score": "0.53457606", "text": "function validate(){return true;}", "title": "" }, { "docid": "bbe666c5dbf66f2d66524713e23bb49b", "score": "0.53152037", "text": "function OnValidate () {}", "title": "" }, { "docid": "1711a400bcdba70f1701af7a544f3a75", "score": "0.5310926", "text": "function validate() {}", "title": "" }, { "docid": "877d9b20361f492e76e80bf756f19f17", "score": "0.53026295", "text": "function validate(oInvoice) {\n return true;\n}", "title": "" }, { "docid": "2d31b49822a89ec4d5e6f0e757a01ff5", "score": "0.5285518", "text": "function addValidarFormularioItxDropPoint(){\n settings =$(\"#frmOrderShipping\").validate().settings;\n $.extend(settings, {\n rules: {\n itxNameDP: {required: true},\n itxLastNameDP: {required: true},\n itxPrefijoDP :{\n validPrefix : true,\n required : true\n },\n itxTelefonoDP : {\n required : true,\n validatePhone : true\n }\n },\n messages : {\n itxNameDP : Messages.required,\n itxLastNameDP : Messages.required,\n itxTelefonoDP : {\n required: Messages.required,\n validatePhone : eval('Messages.phone_' + iCountry)\n }\n }\n });\n settings = $(\"#frmOrderShipping\").validate().settings;\n}", "title": "" }, { "docid": "a738e93b08b3b5316c2e00c15d796452", "score": "0.52798086", "text": "function JSONDValidator() {\n\tthis.schemas = {};\n\tthis.compiled = {};\n}", "title": "" }, { "docid": "3d1ebff617380ffd5654f3c9066744a6", "score": "0.527114", "text": "constructor(options = {}) {\n const defaults = {\n // This is your plugin's options. It will be accessible with this.options\n accessorName: '$yupFormValidation'\n };\n this.options = { ...defaults, ...options };\n }", "title": "" }, { "docid": "fb52c86a4e974fc16b821da24a8bfadb", "score": "0.52489996", "text": "function arg_is_responsable_inscripto(){\n $(\".ri\").show();\n $(\".ri>input\").prop(\"required\", true);\n set_optionals();\n}", "title": "" }, { "docid": "17a8ef36e287f29fa0d53884f0adcf9c", "score": "0.5227278", "text": "function initValidations() {\n // GENERIC FUNCTIONS\n var validateErrorPlacement = function(error, element) {\n error.addClass(\"ui-input__validation\");\n error.appendTo(element.parent(\"div\"));\n };\n var validateHighlight = function(element) {\n $(element)\n .parent(\"div\")\n .addClass(\"has-error\");\n };\n var validateUnhighlight = function(element) {\n $(element)\n .parent(\"div\")\n .removeClass(\"has-error\");\n };\n var validateSubmitHandler = function(form) {\n $(form).addClass(\"loading\");\n $.ajax({\n type: \"POST\",\n url: $(form).attr(\"action\"),\n data: $(form).serialize(),\n success: function(response) {\n $(form).removeClass(\"loading\");\n var data = $.parseJSON(response);\n if (data.status == \"success\") {\n $(\"[js-open-thank]\").click();\n } else {\n $(form)\n .find(\"[data-error]\")\n .html(data.message)\n .show();\n }\n }\n });\n };\n\n var validatePhone = {\n required: true,\n normalizer: function(value) {\n var PHONE_MASK = \"(XXX) XXX-XXXX\";\n if (!value || value === PHONE_MASK) {\n return value;\n } else {\n return value.replace(/[^\\d]/g, \"\");\n }\n },\n minlength: 11,\n digits: true\n };\n\n ////////\n // FORMS\n\n /////////////////////\n // REGISTRATION FORM\n ////////////////////\n\n $(\".js-validation\").validate({\n errorPlacement: validateErrorPlacement,\n highlight: validateHighlight,\n unhighlight: validateUnhighlight,\n submitHandler: validateSubmitHandler,\n rules: {\n name: \"required\",\n phone: \"required\",\n mail: \"required\",\n mess: \"required\"\n },\n messages: {\n name: \"Ошибка при заполнении\",\n phone: \"Ошибка при заполнении\",\n mail: \"Некорректный формат почты\",\n mess: \"Ошибка при заполнении\"\n }\n });\n }", "title": "" }, { "docid": "7ac8aad6135995335f0610e8fec663c9", "score": "0.52073866", "text": "function car_manufactuers_validation(manufactuer)\n{\n const joi_manufactuers_Schema = Joi.object\n ({\n name: Joi.string().min(2).required(),\n logo:Joi.string().required(),\n thumnail:Joi.string().required(),\n })\n return result = joi_manufactuers_Schema.validate(manufactuer); \n\n}", "title": "" }, { "docid": "14221cc8dbf158eb2eb8e6f7d831a4c5", "score": "0.5197314", "text": "function update_manufactuers_validation(manufactuer)\n{\n const joi_manufactuers_Schema = Joi.object\n ({\n name: Joi.string().min(2).required(),\n logo:Joi.string().required(),\n thumnail:Joi.string().required(),\n })\n return result = joi_manufactuers_Schema.validate(manufactuer); \n\n}", "title": "" }, { "docid": "c9d32c6b42149f82f61d3f7a4e0fe5d4", "score": "0.51832217", "text": "function setValidator(validator) {\n\t _validatorFunction = validator;\n }", "title": "" }, { "docid": "48cb6a3b21b28cf59ac826615a634c73", "score": "0.5181513", "text": "function validiraj ()\n\t{\n\t\tvar $priceField = $('#priceSearch');\n\t\t$priceField.css({\"background-color\": \"#ff9db3\"});\n\n\t\t$priceField.attr(\"placeholder\", \"A number must be entered!\");\n\t\t$('#priceSearch').val(\"\");\n\n\t}", "title": "" }, { "docid": "1b69a196b331f9806fd3bc9a1e5a9c6a", "score": "0.5164892", "text": "function validateSelectOne(thisObj) {\n let attr = thisObj.attr('required');\n if (typeof attr !== typeof undefined && attr !== false) {\n let fieldValue = thisObj.val();\n\n if (fieldValue != null) {\n $(thisObj).addClass('is-valid');\n } else {\n $(thisObj).addClass('is-invalid');\n }\n }\n }", "title": "" }, { "docid": "06a8bde20801552f101af98976b47a24", "score": "0.5162159", "text": "function guarSelfEmpRequiredOn() {\n\tguarSelfEmpLength.required = true\n\tguarSelfEmpProfession.required = true\n\tguarSelfEmpSalary.required = true\n\tguarSelfEmpRefFullName.required = true\n\tguarSelfEmpRefMobNum.required = true\n\tguarSelfEmpRefLandlineNum.required = true\n\tguarSelfEmpRefEmail.required = true\n}", "title": "" }, { "docid": "80c2a6930f5f7f570fdc4d52ecca3a37", "score": "0.515397", "text": "validate(_value, _utils) {\n return false;\n }", "title": "" }, { "docid": "0951f1609d847d6b47d144a8c94de9df", "score": "0.51401633", "text": "function AriaValidate(element, userSettings) {\n var self = this;\n\n self.element = $(element);\n\n //DEFAULT SETTINGS\n self.userSettings = userSettings; //the unchanged settings object passed from user\n self.behaviour = self.userSettings.behaviour;\n\n //CLASSES\n self.classes = makeSettings($.fn[pluginName].defaultClasses, self.userSettings.classes); //computed html classes used to retrive elements\n\n //REGION SETTINGS\n self.regionSettings = makeSettings($.fn[pluginName].defaultRegionSettings, self.userSettings.regionSettings);\n\n //VALIDATION\n self.fieldStatus = undefined; //Describes the staus of the field: undefined -> field was never focussed and validated, true -> correct input , 'errorCode' -> incorrect input\n self.isDirty = false; // a field is considered dirty after first interaction, this means on blur or on change for some other fields\n self.fieldValue = undefined; //The value of the field\n\n //MESSAGES\n self.errorMsgs = makeSettings($.fn[pluginName].defaultErrorMsgs, self.userSettings.errorMsgs); //computed error messages settings for this field;\n self.successMsg = self.userSettings.successMsg\n ? self.userSettings.successMsg\n : $.fn[pluginName].defaultSuccessMsg; //Success message for this field\n\n //REGISTERED EVENTS\n //keep track of event listeners added to field\n self.eventListeners = [];\n\n // -----------------------------------\n //Initialise field\n self.selectElements(); //get all the needed elements to interact with from dom\n self.initMarkup(); //add needed attributes and check markup\n self.manageDirty(); //check for first interaction with field and mark as dirty after\n self.addBehaviour(); //bind validation functions to the event listeners\n self.updateFieldValue(); // get the current field value\n self.initHooks(); // init the hooks\n }", "title": "" }, { "docid": "ba96a5e6c94477ec3c0253fb826ea6f4", "score": "0.5120906", "text": "function validate() {\n\n}", "title": "" }, { "docid": "5efc5f7ab130e2549df2f66203449dee", "score": "0.51202214", "text": "_requiredObserver(newVal) {\n if (newVal === false) {\n this.invalid = newVal;\n this.validate();\n }\n }", "title": "" }, { "docid": "5a2d25a759672569b72314e987fc6338", "score": "0.51178813", "text": "get validateAll() {\n return true\n }", "title": "" }, { "docid": "3a2615b05227da9c99d3069ad2507019", "score": "0.5108487", "text": "function validate(jqField,jcrKey){\n if (( ($('#historicalChartApiUrl').val() != \"\") &&\n ($('#historicalChartApiKey').val() != \"\"))\n )\n {\n $('#saveHistoricalChartSettings').removeAttr(\"disabled\");\n $('#cancelChangeHistoricalChartSettings').removeAttr(\"disabled\");\n } else {\n $('#saveHistoricalChartSettings').attr(\"disabled\", \"disabled\");\n $('#cancelChangeHistoricalChartSettings').attr(\"disabled\", \"disabled\");\n }\n}", "title": "" }, { "docid": "a757c96bdccfc3e7616ffc681d4feec8", "score": "0.5105184", "text": "function odu100OmcConfigurationValidation() {\n $(\"#odu100_omc_config_form\").validate({\n rules: {\n 'ru.omcConfTable.omcIpAddress': {\n required: true,\n ipv4Address: true\n },\n 'ru.omcConfTable.periodicStatsTimer': {\n required: true,\n number: true,\n positiveNumber: true,\n min: 5,\n max: 1440\n }\n },\n\n messages: {\n 'ru.omcConfTable.omcIpAddress': {\n required: \"*\",\n ipv4Address: \"Invalid IP Address\"\n },\n 'ru.omcConfTable.periodicStatsTimer': {\n required: \"*\",\n number: \" It must be a number\",\n positiveNumber: \"It must be greater then zero\",\n min: \" It must be >= 5 and <= 1440\",\n max: \" It must be >= 5 and <= 1440\"\n }\n }\n });\n}", "title": "" }, { "docid": "8b91e5be474d94912e32d03d6285fe74", "score": "0.50993645", "text": "function NumberValidation() {}", "title": "" }, { "docid": "1d7ae8d9e6ce305d9c0594f151678829", "score": "0.5095019", "text": "@api handleValidation(validFlag,classname){\n console.log('searchAddtionalComparent' );\n var searchBusinessName = this.template.querySelector(\".\"+classname);\n console.log('searchBusinessName111'+searchBusinessName);\n if(searchBusinessName!=null){\n if(validFlag){\n console.log('displayvalideflag'+validFlag );\n \n searchBusinessName.setCustomValidity(\"Error: check for special characters in field. Only Alpha numeric, space, full stops and commas are accepted in this fields\");\n \n }\n else{\n console.log('validFlag'+validFlag);\n searchBusinessName.setCustomValidity(\"\");\n }\n searchBusinessName.reportValidity(); \n }\n }", "title": "" }, { "docid": "1e0ff442cffdd89ec1df7d0271a34844", "score": "0.5071557", "text": "function addValidationEngineToForm(formID){\n\t$(formID).validationEngine();\n\n}", "title": "" }, { "docid": "60019c763d6cba5367e5ff8bd503987c", "score": "0.5063603", "text": "function Io(){return jn.allowannotations===!1&&w(\"InitError\",'The \"allowannotations\" property in the WebDocumentViewer config is set to false.'),jn.allowannotations}", "title": "" }, { "docid": "a913b6f285fd3c81342f756abefaa62d", "score": "0.506303", "text": "function setValidatorMessages() {\n jQuery.extend(jQuery.validator.messages, {\n required: \"Zorunlu alan\",\n remote: \"Please fix this field.\",\n email: \"Hatalı e-posta adresi\",\n url: \"Please enter a valid URL.\",\n date: \"Please enter a valid date.\",\n dateISO: \"Please enter a valid date (ISO).\",\n number: \"Please enter a valid number.\",\n digits: \"Please enter only digits.\",\n creditcard: \"Please enter a valid credit card number.\",\n equalTo: \"Please enter the same value again.\",\n accept: \"Please enter a value with a valid extension.\",\n maxlength: jQuery.validator.format(\"Please enter no more than {0} characters.\"),\n minlength: jQuery.validator.format(\"Eksik bilgi\"),\n rangelength: jQuery.validator.format(\"Please enter a value between {0} and {1} characters long.\"),\n range: jQuery.validator.format(\"Please enter a value between {0} and {1}.\"),\n max: jQuery.validator.format(\"Please enter a value less than or equal to {0}.\"),\n min: jQuery.validator.format(\"Please enter a value greater than or equal to {0}.\"),\n turkishDate: \"Geçerli bir tarih giriniz: gg.aa.yyyy\"\n });\n}", "title": "" }, { "docid": "67eb4d59b1d6d882e4b82d5653c41f3c", "score": "0.50605965", "text": "function bindJSONDataToValidationTextBox(uLabel, uInputWidget, JSONData, widgetSettings)\r\n{\r\n\tif (isDijit(uInputWidget) && JSONData && JSONData.value)\r\n\t{\r\n\t\tvar elemValue = JSONData.value; \r\n\t\tif (elemValue.caption){\r\n\t\t\tuLabel.innerHTML = elemValue.caption;\r\n\t\t}\r\n\t\t\r\n\t\tvar uInput = uInputWidget.domNode;\r\n\t\t//bind JSON data to the Widget DOM node so the data can be accessed through the Widget DOM node\r\n\t\tuInput.JSONData = JSONData; \r\n\t\tuInput.hatsDojoConnections = [];\r\n\t\tvar hc = uInput.hatsDojoConnections;\r\n\r\n\t\tvar eValue_text = rightTrimFromString(elemValue.text);\r\n\t\tif(uInputWidget.isVisualMode && uInputWidget.dir == 'rtl')\r\n\t\t\teValue_text = uInputWidget.reverseRtlText(eValue_text);\r\n\t\t\t\t\r\n\t\tsetDijitAttribute(uInputWidget, \"value\", rightTrimFromString(elemValue.text));\r\n\t\t\r\n\t\t\r\n\t\tif(trimSpacesFromValue(widgetSettings.value.regExp).length > 0){\r\n\t\t setDijitAttribute(uInputWidget, \"regExp\", widgetSettings.value.regExp);\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(widgetSettings.value.validateOnSubmit==\"true\"){\r\n\t\t setDijitAttribute(uInputWidget, \"validateOnSubmit\", widgetSettings.value.validateOnSubmit);\r\n\t\t}\t\t\r\n\t\t\r\n\t\t\r\n\t\tsetDijitAttribute(uInputWidget, \"promptMessage\", widgetSettings.value.promptMessage);\t\t\t\r\n\t\t\r\n\t\t\r\n\t\tvar useDefaultInvalidMessage = (widgetSettings.value.useDefaultInvalidMessage==\"true\");\t\t\r\n\t\tif(!useDefaultInvalidMessage){\r\n\t\t setDijitAttribute(uInputWidget, \"invalidMessage\", widgetSettings.value.invalidMessage);\r\n\t\t}\r\n\t\t\t\t\r\n\t\tsetDojoAttr(uInputWidget.textbox,\"name\",getPosLengthString(uInputWidget));\r\n\t\t\r\n\t\tsetDojoStyle(uInput,\"width\",elemValue.length+\"em\");\r\n\r\n\t\thc.push(dojoConnect(uInputWidget, \"onfocus\", function(evt) {\r\n\t\t\tif (uInputWidget.isVisualMode)\r\n\t\t\t setFocus(this.focusNode, formID);\r\n\t\t\telse\r\n\t\t\t setFocusFieldIntoGlobal(this, formID);\r\n\t\t}));\r\n\t\t\r\n\t\thc.push(dojoConnect(uInputWidget, \"onChange\", function(evt) {\r\n\t\t checkInput(this);}));\r\n\t\thc.push(dojoConnect(uInputWidget, \"onClick\", function(evt) {\r\n\t\t setCursorPosition(elemValue.startPos, formID);}));\t\t\r\n\t\t\r\n\t\tif (!showUnProtectedSosiAsSpace){\r\n\t\t\tif (uInputWidget.value && uInputWidget.value.length > 0){\r\n\t\t\t\tsetDijitAttribute(uInputWidget, \"value\", removeSpaceAsSOSI(uInputWidget.value));\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t\r\n\t\t\r\n\t\tvar isDBCSSession = isDBCSCodePage(CodePage);\r\n\t\tif (conntype == 5250 || conntype == 3270){ \r\n\t\t\tif (!elemValue.isProtected && elemValue.hsrAttributes){\t\r\n\t\t\t\tvar imeModeVar = \"inactive\";\r\n\t\t\t\tif (conntype == 5250){ \r\n\t\t\t\t\tif (elemValue.hsrAttributes.keyboardInhibited){\r\n\t\t\t\t\t\timeModeVar = \"disabled\";\r\n\t\t\t\t\t} else if (isDBCSSession && (elemValue.hsrAttributes.dbcsOnly || elemValue.hsrAttributes.dbcsPure)){\r\n\t\t\t\t\t\timeModeVar = \"active\";\r\n\t\t\t\t\t} else if (isDBCSSession && elemValue.hsrAttributes.dbcsOpen){\r\n\t\t\t\t\t\timeModeVar = null;\r\n\t\t\t\t\t} else if (isDBCSSession && elemValue.hsrAttributes.dbcsEither){\r\n\t\t\t\t\t\timeModeVar = \"active\";\r\n\t\t\t\t\t\tisSBCSOnly = false;\r\n\t\t\t\t\t\tvar isJFieldMode = false;\r\n\t\t\t\t\t\tif (uInputWidget.value && uInputWidget.value.length > 0){\r\n\t\t\t\t\t\t\tvar tmpValue = removeSpaceAsSOSI(uInputWidget.value);\r\n\t\t\t\t\t\t\tif (tmpValue.length>0){\r\n\t\t\t\t\t\t\t\tisJFieldMode = isDBCSChar(tmpValue.charAt(0), enableDBCSSession, enableDBCSEuro, CodePage);\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 (!isJFieldMode){\r\n\t\t\t\t\t\t\timeModeVar = \"inactive\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (isDBCSSession && elemValue.hsrAttributes.katakanaShift){\r\n\t\t\t\t\t\timeModeVar = \"active\";\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (isDBCSSession && elemValue.hsrAttributes.dbcsOnly) {\r\n\t\t\t\t\t\timeModeVar = \"active\";\r\n\t\t\t\t\t} else if(isDBCSSession && elemValue.hsrAttributes.dbcsOpen) {\r\n\t\t\t\t\t\timeModeVar = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (imeModeVar) {\r\n\t\t\t\t\tsetDojoStyle(uInputWidget.textbox,\"imeMode\",imeModeVar);\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "72a1e66fc709478a4162c690febcde48", "score": "0.5060134", "text": "beforeValidate(model) { //eslint-disable-line\n return new P.resolve(true);\n }", "title": "" }, { "docid": "14ed11eba9f223c6f102844a67229959", "score": "0.5053061", "text": "onkeyup(element) {\n $(element).valid();\n }", "title": "" }, { "docid": "b1208d2b639532cb94fdb76215e83e8d", "score": "0.5051029", "text": "function isNilaiFormValid(){\n return(MatkulField.isValid() && StatusField.isValid() && NilaiField.isValid());\n }", "title": "" }, { "docid": "2cbf66a9c39e554e91340bee7e1cede6", "score": "0.5049819", "text": "function customValid(){\n return {\n require: 'ngModel',\n link: function(scope, ele, attrs, c) {\n scope.$watch(attrs.ngModel, function() {\n\n // You can call a $http method here\n // Or create custom validation\n\n var validText = \"Inspinia\";\n\n if(scope.extras == validText) {\n c.$setValidity('cvalid', true);\n } else {\n c.$setValidity('cvalid', false);\n }\n\n });\n }\n }\n}", "title": "" }, { "docid": "2cbf66a9c39e554e91340bee7e1cede6", "score": "0.5049819", "text": "function customValid(){\n return {\n require: 'ngModel',\n link: function(scope, ele, attrs, c) {\n scope.$watch(attrs.ngModel, function() {\n\n // You can call a $http method here\n // Or create custom validation\n\n var validText = \"Inspinia\";\n\n if(scope.extras == validText) {\n c.$setValidity('cvalid', true);\n } else {\n c.$setValidity('cvalid', false);\n }\n\n });\n }\n }\n}", "title": "" }, { "docid": "cacf48b996074f21f11a101d4c039428", "score": "0.50468653", "text": "function makeThemRequiredInput(bandera){\n const rbs = document.querySelectorAll('.ChangeRequired');\n for (const rb of rbs) {\n if (bandera) {\n rb.required=true;\n }else{\n rb.required=false;\n }\n }\n}", "title": "" }, { "docid": "7dee59ef161f39f5c98ab6d17dce113b", "score": "0.50398254", "text": "function validate(inst, validation)\n{\n \n}", "title": "" }, { "docid": "6180dbf9f23a7a2104a346df22cad73c", "score": "0.5030206", "text": "function AspnetRequiredCheckBoxValidation() {\n defaultRangeValidator = $.validator.methods.range;\n $.validator.methods.range = function (value, element, param) {\n if (element.type === 'checkbox') {\n return element.checked;\n }\n\n return defaultRangeValidator.call(this, value, element, param);\n };\n}", "title": "" }, { "docid": "92938d3e7a9bdb7ca933f73346e32f00", "score": "0.50292796", "text": "function FormValidator() {\n this.validators = {};\n this.fields = {};\n}", "title": "" }, { "docid": "dd9480297c45c3ba80fb1e71a5549e14", "score": "0.5028257", "text": "function ShirtCustionFormValidation() {\n\n}", "title": "" }, { "docid": "5322a3109f2f541cf6cec00afe53035d", "score": "0.50112176", "text": "function validateCustomizedValidator(doc, schema, prefix) {\n if (typeof schema.validator === 'function') {\n if (schema.validator(doc) === false) {\n throw new Errors.ValidationErrors.ValidationError(\"Validator for the field \"+prefix+\" returned `false`.\");\n }\n }\n}", "title": "" }, { "docid": "d89c2858f858b0e0f10ef5460abec45a", "score": "0.5004259", "text": "function requiredTrueValidator(control) {\n return control.value === true ? null : { 'required': true };\n}", "title": "" }, { "docid": "dde800c1738991f469aba8041ecefdb2", "score": "0.4990708", "text": "function registerIntegerValidation(viewModel, propertyName, allowNull, minimumValue, maximumValue) {\n\n // the numeric string validation\n var validationFunction = function () {\n\n // get the property value\n var value = viewModel[propertyName]();\n\n // validate the property value\n return validateInteger(value, allowNull, minimumValue, maximumValue);\n\n };\n\n // register the validation\n registerValidation(viewModel, propertyName, validationFunction);\n\n}", "title": "" }, { "docid": "bf3465e7f94c4d0e18f9b1af507a2052", "score": "0.49906835", "text": "function customValid()\n{\n return {\n require: 'ngModel',\n link: function (scope, ele, attrs, c) {\n scope.$watch(attrs.ngModel, function () {\n\n // You can call a $http method here\n // Or create custom validation\n\n var validText = \"Inspinia\";\n\n if (scope.extras == validText) {\n c.$setValidity('cvalid', true);\n } else {\n c.$setValidity('cvalid', false);\n }\n\n });\n }\n };\n}", "title": "" }, { "docid": "5f94410f40306dacc5d8d293595fb2bd", "score": "0.4989645", "text": "function setValidatorDefaultSettings() {\n jQuery.validator.setDefaults({\n highlight: function (element, errorClass, validClass) {\n $(element).addClass(errorClass).removeClass(validClass)\n .parent().addClass(\"parent\" + errorClass).removeClass(\"parent\" + validClass);\n },\n unhighlight: function (element, errorClass, validClass) {\n $(element).removeClass(errorClass).addClass(validClass)\n .parent().removeClass(\"parent\" + errorClass).addClass(\"parent\" + validClass);\n },\n focusInvalid: false,\n invalidHandler: function (form, validator) {\n // Scroll to first invalid element if any exists.\n if (!validator.numberOfInvalids())\n return;\n\n // if form is in modal then return\n var isModal = $(validator.currentForm).parents('.modal').length === 1;\n\n if (!isModal) {\n var timerVal = 500;\n\n $('html, body').animate({\n scrollTop: parseInt($(validator.errorList[0].element).offset().top - 200)\n }, timerVal);\n\n setTimeout(function () {\n $(validator.errorList[0].element).focus();\n }, timerVal);\n }\n else {\n $(validator.errorList[0].element).focus();\n }\n }\n });\n\n $.validator.addMethod(\n 'depends',\n function (val, elem) {\n var ret = true;\n var senderElemProps = elementInfo($(elem).attr(\"id\"));\n\n //-> Check if 'depends' is based on a container specific validation control.\n //-> If container exists, then validate elements included in it.\n var dependentContainerId = $(elem).attr(\"data-dependent-container\");\n var dependentIsMultiple = $(elem).attr(\"multiple\");\n\n if (dependentContainerId) {\n var isValidating = $('#' + dependentContainerId).attr('data-validating');\n if (String(isValidating) == \"true\") {\n if (senderElemProps.info == \"checkbox\" || senderElemProps.info == \"radio\") {\n ret = $(\"[name=\" + senderElemProps.name + \"]\").is(\":checked\");\n }\n else {\n ret = ($(elem).val().length == 0 ? false : true);\n }\n }\n }\n else if (dependentIsMultiple) {\n ret = elem.options.length > 0 ? true : false;\n }\n else {\n var dependentElementInfoArr = $(elem).attr(\"data-dependent-src\").split('#');\n var dependentElementId = dependentElementInfoArr[0];\n var dependentElementVal = dependentElementInfoArr[1];\n var dependentElemProps = elementInfo(dependentElementId);\n\n if (dependentElemProps.info == \"checkbox\" || dependentElemProps.info == \"radio\") {\n if (String(dependentElemProps.isChecked) == dependentElementVal) {\n if (senderElemProps.info == \"checkbox\" || senderElemProps.info == \"radio\") {\n ret = $(\"[name=\" + senderElemProps.name + \"]\").is(\":checked\");\n }\n else {\n ret = ($(elem).val().length == 0 ? false : true);\n }\n }\n }\n else {\n if (dependentElemProps.val == dependentElementVal) {\n if (senderElemProps.info == \"checkbox\" || senderElemProps.info == \"radio\") {\n ret = $(\"[name=\" + senderElemProps.name + \"]\").is(\":checked\");\n }\n else {\n ret = ($(elem).val().length == 0 ? false : true);\n }\n }\n }\n }\n\n return ret;\n }, \"Zorunlu alan\");\n\n $.validator.addMethod(\n \"time24\",\n function (value, element) {\n if (value != '') {\n if (!/^\\d{2}:\\d{2}$/.test(value)) return false;\n var parts = value.split(':');\n if (parts[0] > 23 || parts[1] > 59) return false;\n }\n return true;\n }, \"Hatalı çalışma saati\");\n\n $.validator.addMethod(\n 'turkishDate',\n function (currVal, element) {\n if (currVal == '')\n return false;\n\n //Declare Regex \n var rxDatePattern = /^(\\d{1,2})(\\/|-|.)(\\d{1,2})(\\/|-|.)(\\d{4})$/;\n var dtArray = currVal.match(rxDatePattern); // is format OK?\n\n if (dtArray == null)\n return false;\n\n //Checks for dd/mm/yyyy format.\n var dtDay = dtArray[1];\n var dtMonth = dtArray[3];\n var dtYear = dtArray[5];\n var dateRange = $(element).attr('data-year-range').split(':');\n\n if (parseInt(dtYear) > parseInt(dateRange[1]) || parseInt(dtYear) < parseInt(dateRange[0])) {\n return false;\n }\n\n if (dtMonth < 1 || dtMonth > 12)\n return false;\n else if (dtDay < 1 || dtDay > 31)\n return false;\n else if ((dtMonth == 4 || dtMonth == 6 || dtMonth == 9 || dtMonth == 11) && dtDay == 31)\n return false;\n else if (dtMonth == 2) {\n var isleap = (dtYear % 4 == 0 && (dtYear % 100 != 0 || dtYear % 400 == 0));\n if (dtDay > 29 || (dtDay == 29 && !isleap))\n return false;\n }\n\n return true;\n }\n );\n}", "title": "" }, { "docid": "24f48ba64c33b5e1a8ec22ccefd51e69", "score": "0.49896094", "text": "hasValidationErrors() {\n return true;\n }", "title": "" }, { "docid": "771e8844c6a138dd93c65a58539039ed", "score": "0.49860004", "text": "function activateValidator() {\n // name validation\n var nameregex = /^[a-zA-Z \\-]+$/;\n var moment = require(\"electron\").remote.require(\"moment\");\n $.validator.addMethod(\"validName\", function(value, element) {\n return this.optional(element) || nameregex.test(value);\n });\n\n // valid email pattern\n var eregex = /^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\n $.validator.addMethod(\"validEmail\", function(value, element) {\n return this.optional(element) || eregex.test(value);\n });\n\n $.validator.addMethod(\"validDate\", function(value, element) {\n return this.optional(element) || moment(value, \"DD-MM-YYYY\", true).isValid();\n });\n $.validator.addMethod(\"validDateTime\", function(value, element) {\n return this.optional(element) || moment(value, \"DD-MM-YYYY H:mm\", true).isValid();\n });\n\n $.validator.addMethod(\"validTime\", function(value, element) {\n return this.optional(element) || moment(value, \"HH:MM\").isValid();\n });\n var classregex = /^[a-zA-Z1-9 \\-]+$/;\n $.validator.addMethod(\"validClass\", function(value, element) {\n return this.optional(element) || classregex.test(value);\n });\n var usernameregex = /^[a-zA-Z1-9\\-\\.\\_]+$/;\n $.validator.addMethod(\"validUsername\", function(value, element) {\n return this.optional(element) || usernameregex.test(value);\n });\n if (require('electron').remote.getGlobal('currentPage') == window.PAGES.PROFS) {\n validateCreateStd();\n validateEditStd();\n } else if (require('electron').remote.getGlobal('currentPage') == window.PAGES.ADMIN) {\n validateCreateProf();\n validateEditProf();\n } else if (require('electron').remote.getGlobal('currentPage') == window.PAGES.LEAVEREQ_STUDENT) {\n validateStudentCreateLeaveRequest();\n } else if (require('electron').remote.getGlobal('currentPage') == window.PAGES.LEAVEREQ_PROF) {\n validateProfCreateLeaveRequest();\n }\n}", "title": "" }, { "docid": "218255da41857b0efd5d76f3b4fa3d21", "score": "0.49854606", "text": "validate(control) {\n return this.required ? Validators.requiredTrue(control) : null;\n }", "title": "" }, { "docid": "218255da41857b0efd5d76f3b4fa3d21", "score": "0.49854606", "text": "validate(control) {\n return this.required ? Validators.requiredTrue(control) : null;\n }", "title": "" }, { "docid": "4c7fecba0507661baadc18251d47c510", "score": "0.4976451", "text": "function validate(inst, validation)\r\n{\r\n}", "title": "" }, { "docid": "4c230f09f6dddb291444fa0f366690b0", "score": "0.497545", "text": "createValidator() {\n throw new errors_1.SdkError('Not supported');\n }", "title": "" }, { "docid": "674c32ddc2a6175d8ac3ad68507ae34b", "score": "0.49711895", "text": "makeFieldsRequired(required=true) {\n this.$customerName.required = required;\n this.$customerAddress.required = required;\n this.$customerCity.required = required;\n //this.$customerState.required = required;\n this.$customerZipcode.required = required;\n }", "title": "" }, { "docid": "a96dadb42f2da88c18d95f1c0d47e5cd", "score": "0.49639282", "text": "function Validator (opts) {\n if (!(this instanceof Validator)) return new Validator(opts);\n opts = opts || {};\n this.trace = tracer(opts.trace || function(){});\n this.rules = [];\n this._optional = false;\n}", "title": "" }, { "docid": "2fc5cfc0b787ed2b69c1ff9c08d7cd2b", "score": "0.49558103", "text": "validate(formFieldObj) {\n const {element, errorElement} = formFieldObj;\n const value = element.value.trim();\n resetValidity(element, errorElement);\n\n formFieldObj.validatorNames.forEach((name) => {\n const isValid = validators[name][0](value);\n if (!isValid) {\n this.valid = false;\n setInvalid(formFieldObj, validators[name][1]);\n }\n })\n }", "title": "" }, { "docid": "1ae942c96dcc826039d310c9b08983b8", "score": "0.49554604", "text": "function requiredTrueValidator(control) {\n return control.value === true ? null : {\n 'required': true\n };\n}", "title": "" }, { "docid": "b55c10a903b5a7d80385427d430c3c45", "score": "0.49345818", "text": "function setInputRule($input){\n if($input.attr(\"type\") == \"submit\") return;\n //validation rulesc\n var rules = {required : $input.hasClass(\"required\")};\n if($input.hasClass(\"is_email\")){rules.email = true;}\n if($input.attr(\"type\") == \"password\"){rules.password = true;}\n Contabilidad.Validate.setRules($input, rules);\n}", "title": "" }, { "docid": "611170d17be39cf24067dd27673dbea1", "score": "0.4930591", "text": "validateMin() {\r\n let $this = this;\r\n let inputs = this.inputs.min = this.formHandler.findByAttr('min');\r\n\r\n inputs.on(this.options.events, function () {\r\n let input = $(this);\r\n\r\n $this.min(input);\r\n });\r\n }", "title": "" }, { "docid": "21daf0b2e1338728241f7bd2d19fbfcb", "score": "0.49213618", "text": "registerRequired(varName) {\n return this._register(varName, () => Validator.stringRequired(this.obj[varName]).result)\n }", "title": "" }, { "docid": "d03f5d05d425edabe29626b5de2f7938", "score": "0.49196765", "text": "_registerExtensions() {\r\n for (let extension of utils.entries(this.extensions)) {\r\n this.validator.extend(extension.key, extension.value);\r\n }\r\n }", "title": "" }, { "docid": "f002c181ab68f9a9e525a4f5da324cff", "score": "0.49164307", "text": "function testObjectValidation() {\n\n\t\t\t\t\t// We have a fixture for this...\n\t\t\t\t\tlet testInstance = Core.inst( \"Test.fixture.type.mixin.validating.TestClassOne\" );\n\n\t\t\t\t\t// Execute the test method\n\t\t\t\t\treturn testInstance.objDynamicTest( testObject,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta: {\n\t\t\t\t\t\t\t\tisNumber : true,\n\t\t\t\t\t\t\t\tdefaultValue : \"defaulted\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}", "title": "" }, { "docid": "e9b4146cebf8d9ff46ffa6ce2bd9dd5a", "score": "0.49152836", "text": "getValidator() {\n return new htmlvalidate_1.default(this.config);\n }", "title": "" }, { "docid": "78270926f7399937d5cc0e3f98a5df05", "score": "0.4905002", "text": "get validateAll () {\n\t\treturn true;\n\t}", "title": "" }, { "docid": "380a491c3acba2755b556a8335afe0ac", "score": "0.48935965", "text": "function validarEditUser(){\n $(\"div#basicmodal form#usuario_edit\").validate({\n rules:{\n 'usuario[nombre]': {required:true},\n 'usuario[apellido]': {required:true},\n 'usuario[usuario]': {required:true},\n 'usuario[correo]': {required:true, email:true},\n 'usuario[idrol][]': {required:true},\n 'usuario[password][second]': {\n equalTo: \"#usuario_password_first\"\n }\n },\n highlight: function (element) {\n $(element).parent().parent().addClass('has-danger');\n },\n unhighlight: function (element) {\n $(element).parent().parent().removeClass('has-danger');\n $(element).parent().parent().addClass('has-success');\n }\n });\n}", "title": "" }, { "docid": "ab79c4928fd3ac706ef9dde4cef0a003", "score": "0.4893334", "text": "function _setup() {\n parsley_form = $form.parsley(config.parsleyOptions);\n }", "title": "" }, { "docid": "f5abcea23d18c2176648682184111170", "score": "0.48898154", "text": "function validateUserParams(userObj)\n{ \n const userJSchema = \n {\n firstName: Joi.string().required(),\n lastName: Joi.string().required(),\n gender: Joi.string().required(),\n dob: Joi.date().required(),\n email: Joi.string().email(),\n mobileNo: Joi.string().regex(/[0-9]{10}/),\n baseChurch: Joi.string().required(),\n smartPhoneUser: Joi.boolean().required(),\n maritalStatus: Joi.any(),\n headOfFamily: Joi.any(),\n noOfDependents: Joi.any(),\n mobileUser: Joi.any(),\n mobileNo: Joi.any(),\n country: Joi.any(),\n state: Joi.any(),\n district: Joi.any(),\n churchSubsId: Joi.any(),\n headSubsId: Joi.any(),\n additionalChurch: Joi.any(),\n diocese: Joi.any(),\n indClassification: Joi.any(),\n phoneOS: Joi.any(), \n userRole: Joi.any(),\n designation: Joi.any()\n };\n return Joi.validate(userObj, userJSchema);\n}", "title": "" }, { "docid": "4758db9f99925400acb25d37c56f2cf2", "score": "0.48868242", "text": "ngOnInit() {\n this.form = this.fb.group({\n employeeId: [\n null,\n _angular_forms__WEBPACK_IMPORTED_MODULE_3__[\"Validators\"].compose([\n _angular_forms__WEBPACK_IMPORTED_MODULE_3__[\"Validators\"].required,\n _angular_forms__WEBPACK_IMPORTED_MODULE_3__[\"Validators\"].pattern(\"^[0-9]*$\")\n ])\n ]\n });\n }", "title": "" }, { "docid": "9d2bd20878f05efbb2abffb93584798f", "score": "0.48801026", "text": "function testObjectValidation() {\n\n\t\t\t\t\t// We have a fixture for this...\n\t\t\t\t\tlet testInstance = Core.inst( \"Test.fixture.type.mixin.validating.TestClassOne\" );\n\n\t\t\t\t\t// Execute the test method\n\t\t\t\t\treturn testInstance.objDynamicTest( testObject,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ta: {\n\t\t\t\t\t\t\t\tdefaultValue: \"defaulted\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\tisNumber: true\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\n\t\t\t\t}", "title": "" }, { "docid": "994725924fc8a7a05d639053824b3f54", "score": "0.4877208", "text": "getJoiWithAddressBook() {\n const newJoi = Joi.extend((joi) => ({\n base: joi.string(),\n name: 'addressBook',\n language: {\n valid: this.t(`is predefined address name, please type another one`)\n },\n /* eslint-disable-next-line no-unused-vars */\n pre: (value, state, options) => value.trim(),\n rules: [\n {\n name: 'valid',\n validate: (params, value, state, options) => {\n if (!AddressBookService.isValidName(value)) {\n const err = joi.createError('addressBook.valid', {}, state, options)\n err.context.label = ellipsisString(value, 16, 'middle')\n return err\n }\n return value\n }\n }\n ]\n }))\n\n return newJoi\n }", "title": "" }, { "docid": "db7b9426b52d3f559a3621342a7b45c4", "score": "0.4872067", "text": "function validatePatientInsuranceInfo() {\r\n $(\"#PatientInsuranceSetupForm\").alslValidate({\r\n ignore: \":hidden\",\r\n onfocusout: false,\r\n onclick: false,\r\n rules: {\r\n carriers: { selectBox: true },\r\n plans: { selectBox: true },\r\n insuredId: { maxlength: 50, required: true },\r\n policyGroup: { maxlength: 150 },\r\n relationship: { selectBox: true },\r\n subscriberFirstName: { required: true, Regex: regex.NAME, maxlength: 15 },\r\n subscriberLastName: { required: true, Regex: regex.NAME, maxlength: 25 },\r\n subscriberAddress1: { required: true, maxlength: 35 },\r\n subscriberAddress2: { maxlength: 35 },\r\n subscriberZipCode: { required: true, maxlength: 10, Regex: regex.ZIP },\r\n subscriberCity: { required: true, maxlength: 30, Regex: regex.ALPHADOT },\r\n subscriberState: { required: true, maxlength: 2, Regex: regex.STATE },\r\n subscriberPhone: { required: true, Regex: regex.PHONE },\r\n gender: { required: true },\r\n subscriberDob: { required: true, commonDate: true, notFutureDate: true },\r\n subscriberEmployer: { maxlength: 100 },\r\n unknownAddress1: { required: true, maxlength: 35 },\r\n unknownAddress2: { maxlength: 35 },\r\n unknownZipCode: { required: true, maxlength: 10, Regex: regex.ZIP },\r\n unknownCity: { required: true, maxlength: 30, Regex: regex.ALPHADOT },\r\n unknownState: { required: true, maxlength: 2, Regex: regex.STATE },\r\n unknownPhone: { required: true, Regex: regex.PHONE },\r\n unknownFax: { Regex: regex.PHONE }\r\n },\r\n messages: {\r\n carriers: { selectBox: \"Select a Carrier Name.\" },\r\n plans: { selectBox: \"Select a Plan Name.\" },\r\n insuredId: { maxlength: \"Insured ID cannot be more than 50 characters.\", required: \"Enter the Insured ID\" },\r\n policyGroup: { maxlength: \"Policy Group # cannot be more than 150 characters.\" },\r\n relationship: { selectBox: \"Select a Relationship to Subscriber.\" },\r\n subscriberFirstName: {\r\n required: \"Enter the First Name.\",\r\n Regex: \"Numbers and/or the special characters you entered are not allowed. Enter a valid First Name.\",\r\n maxlength: \"First Name cannot be more than 15 characters.\"\r\n },\r\n subscriberLastName: {\r\n required: \"Enter the Last Name.\",\r\n Regex: \"Numbers and/or the special characters you entered are not allowed. Enter a valid Last Name.\",\r\n maxlength: \"Last Name cannot be more than 25 characters.\"\r\n },\r\n subscriberAddress1: { required: \"Enter the Address.\", maxlength: \"Address 1 cannot be more than 35 characters.\" },\r\n subscriberAddress2: { maxlength: \"Address 2 cannot be more than 35 characters.\" },\r\n subscriberZipCode: { required: \"Enter the ZIP code.\", maxlength: \"Enter a valid ZIP code.\", Regex: \"Enter a valid ZIP code.\" },\r\n subscriberCity: { required: \"Enter the City.\", maxlength: \"City cannot be more than 30 characters.\", Regex: \"City can only contain alpha characters. Enter a valid City.\" },\r\n subscriberState: { required: \"Enter the State.\", maxlength: \"State cannot be more than 2 characters.\", Regex: \"Enter a valid 2 character State.\" },\r\n subscriberPhone: { required: \"Enter a Phone Number.\", Regex: \"Enter a valid Phone number.\" },\r\n gender: { required: \"Select a Sex.\" },\r\n subscriberDob: { required: \"Enter the Date Of Birth.\", commonDate: \"Enter a valid Date Of Birth.\", notFutureDate: \"Birthdays can't be in the future. Enter a valid Date Of Birth.\" },\r\n subscriberEmployer: { maxlength: \"Employer cannot be more than 100 characters.\" },\r\n unknownAddress1: { required: \"Enter the Address.\", maxlength: \"Address 1 cannot be more than 35 characters.\" },\r\n unknownAddress2: { maxlength: \"Address 2 cannot be more than 35 characters.\" },\r\n unknownZipCode: { required: \"Enter the ZIP code.\", maxlength: \"Enter a valid ZIP code.\", Regex: \"Enter a valid ZIP code.\" },\r\n unknownCity: { required: \"Enter the City.\", maxlength: \"City cannot be more than 30 characters.\", Regex: \"City can only contain alpha characters. Enter a valid City.\" },\r\n unknownState: { required: \"Enter the State.\", maxlength: \"State cannot be more than 2 characters.\", Regex: \"Enter a valid 2 character State.\" },\r\n unknownPhone: { required: \"Enter a Phone Number.\", Regex: \"Enter a valid Phone number.\" },\r\n unknownFax: { Regex: \"Enter a valid Fax number.\" }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "6fde6f54aa2b002cc58dda73cd82363a", "score": "0.48683298", "text": "function validateLatitude(){\n\n $.validator.addMethod(\"check_lat\", function(value, element) {\n if (value <= 90 && value >= -90) {\n return true;\n }\n return false;\n }, 'Invalid latitude.');\n \n}", "title": "" } ]
926ceecef86a4952683bc20f1b717aff
Determines if it should show points/sec
[ { "docid": "956e024f7dc688c5bebca559e0455c68", "score": "0.0", "text": "function canGenPoints(){\n\treturn true\n}", "title": "" } ]
[ { "docid": "5b851c3095f2466a5d4ae0ae2edaf5b1", "score": "0.64282763", "text": "function pts() {\n if (points === 1) {\n document.getElementById('pointsDisplay').innerHTML = \"You Have: \" + points + \" point!\";\n } else {\n document.getElementById('pointsDisplay').innerHTML = \"You Have: \" + points + \" points!\";\n }\n}", "title": "" }, { "docid": "f49b828be426e125f36e5359f37aff65", "score": "0.6370226", "text": "function isSignificantPassed(){\n\t\t\n\t\tif(g_temp.numPanes == 1)\n\t\t\treturn(false);\n\t\t\n\t\tvar objData = g_functions.getStoredEventData(g_temp.storedEventID);\n\t\t\n\t\tvar passedTime = objData.diffTime;\n\t\t\n\t\tvar currentInnerPos = getInnerPos();\n\t\tvar passedDistanceAbs = Math.abs(currentInnerPos - objData.startInnerPos);\n\t\t\n\t\tif(passedDistanceAbs > 30)\n\t\t\treturn(true);\n\t\t\n\t\tif(passedDistanceAbs > 5 && passedTime > 300)\n\t\t\treturn(true);\n\t\t\t\t\n\t\treturn(false);\n\t}", "title": "" }, { "docid": "5d9d132237527a3cd07ea99986fe4279", "score": "0.60597885", "text": "get isPoint() {\n return this.isLine && this.min === this.max;\n }", "title": "" }, { "docid": "f2f8db7899bd9caefb2f0fcc361165de", "score": "0.5918695", "text": "function atDotted() {\n\t\t\treturn yPos >= 100;\n\t\t}", "title": "" }, { "docid": "6d643df11fd6e810078a4a7a72b8459e", "score": "0.5878886", "text": "function showScore(points) {\n addNewLine();\n console.log(pokeYellowAndBlue(\"Score ==> \" + points));\n // Everytime player's score is to be displayed, we check if he has made a record score.\n checkHighScore(points);\n addNewLine();\n}", "title": "" }, { "docid": "4709266bb5a440b70c209ea9390c9aa5", "score": "0.58606374", "text": "checkVisible() {\n this.visible = false;\n /* number of hours above altitude at observatory */\n let h = obs.position.riseTime(this.coord, filter.altLimit);\n /* not visible if never above altitude limit or too faint */\n if ((!(h>0)) || this.v>filter.magLimit) return;\n /* not visible if score/uncertainty too low */\n if (this.type !== \"neocp\" && this.score < filter.uncLimit) return;\n /* visible if HA from midnight meridian is less than time above horizon.*/\n let diff = abs(this.coord.x - sun.raMidnight)/(toRadians * 15);\n if ( diff< h) {this.visible = true;}\n }", "title": "" }, { "docid": "0cf3bb40c55b00c3d89f7fcb2fa0f9bd", "score": "0.5824578", "text": "function enoughPoints() {\n\treturn points.length > 1;\n}", "title": "" }, { "docid": "d8bf80751add1c9b74f31a895c99cca7", "score": "0.579115", "text": "function displayAxis(p1, p2) {\r\n var prec = Math.pow(0.1, _precision);\r\n\r\n if ((Math.abs(p1.x - p2.x) >= prec && Math.abs(p1.y - p2.y) < prec && Math.abs(p1.z - p2.z) < prec)\r\n || (Math.abs(p1.y - p2.y) >= prec && Math.abs(p1.x - p2.x) < prec && Math.abs(p1.z - p2.z) < prec)\r\n || (Math.abs(p1.z - p2.z) >= prec && Math.abs(p1.x - p2.x) < prec && Math.abs(p1.y - p2.y) < prec)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "2611370256f4f0342098007ed5a47302", "score": "0.5770812", "text": "function showPoints(board) {\n\tfor (var i=board.ttoInitLength; i<board.objectsList.length; i++) {\n\t\tif (board.objectsList[i].dump) {\n\t\t\tif (board.objectsList[i].getType() == 'point') {\n\t\t\t\tboard.objectsList[i].setAttribute({visible : true});\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a8de29cfd3ef1077d4e6083b96218ce5", "score": "0.5755065", "text": "function showTime() {\r\n\r\n document.getElementById(\"time\").innerHTML = data.time === 0 ? data.time : data.time.toFixed(2);\r\n\r\n}", "title": "" }, { "docid": "0751af8c6d6c831932f3446476adb3dd", "score": "0.57476926", "text": "function showScore()\n\t{\n\t\tconsole.log('showScore mode', curMode);\n\t\tif (curMode === 'drill')\n\t\t\tshowScoreDrill()\n\t\telse\n\t\t\tshowScoreNormal();\n\t}", "title": "" }, { "docid": "898a2b350996e30c40675bd93db89349", "score": "0.57413065", "text": "function myPtsFormatter(val) {\n\t\tif(val <= 0) return \"\";\n\t\treturn numberWithCommas(val) + ' pts';\n\t}", "title": "" }, { "docid": "a21a44b2dba0eec9bf3dfd53a82e47d3", "score": "0.5714147", "text": "function checkSpeed(speed) {\n const speedLimit = 70;\n const kmPerPoint = 5;\n\n if (speed < speedLimit) {\n console.log('Ok');\n }\n else {\n let points = Math.floor((speed - speedLimit) / kmPerPoint);\n //Math.floor () function converts floating number to absolute number.\n if (points >= 12) {\n console.log('Licence suspended');\n }\n else {\n console.log('Points', points); // Here, Points: is for displaying Points word and points is a variable.\n }\n }\n}", "title": "" }, { "docid": "3f1230aabe1f1b9788bb03304179eb0b", "score": "0.5705099", "text": "score() {\n let player1Points = this.playerOne.pointsWon;\n let player2Points = this.playerTwo.pointsWon;\n let player1Games = this.playerOne.gamesWon;\n let player2Games = this.playerTwo.gamesWon;\n\n let showPlayerPoints = !((player1Points === 0) && (player2Points === 0));\n\n let output = `${player1Games}-${player2Games}`;\n if (showPlayerPoints) {\n output += this.getTennisPoint(this.player);\n }\n return output;\n }", "title": "" }, { "docid": "c478fe5b3901235e72e5425a381a5cb8", "score": "0.57039076", "text": "showStats() {\n return this.log(`X: ${this.x}, Y:${this.y}, HP: ${this.HP}, SCORE: ${this.score}`);\n }", "title": "" }, { "docid": "cd13fe9e53a8e83a278d8f1b53f8e8b8", "score": "0.5656451", "text": "function whatDivision(division, pointsHold, pointsPromotion,pointsTitle, maxPoints)\r\n{\r\n var maxWidth = 400;\r\n\r\n var pxOnePoint = maxWidth / maxPoints;\r\n var widthPointsNow = pointsNow * pxOnePoint;\r\n\r\n if (division >= 1 && division <= 10) {\r\n \r\n if (division == 1) {\r\n if (divisionNow == division) {\r\n if (pointsNow < pointsHold) {\r\n setPointColor('#F7464A', '#FF5A5E', widthPointsNow);\r\n }\r\n else if (pointsNow >= pointsHold && pointsNow < pointsTitle) {\r\n setPointColor('#4E4E4E', '#707070', widthPointsNow);\r\n }\r\n else if (pointsNow >= pointsTitle && pointsNow <= maxPoints) {\r\n setPointColor('#FDB45C', '#FFC870', widthPointsNow);\r\n }\r\n else if (pointsNow > maxPoints) {\r\n pointsNow = maxPoints;\r\n\r\n widthPointsNow = pointsNow * pxOnePoint;\r\n\r\n setPointColor('#FDB45C', '#FFC870', widthPointsNow);\r\n }\r\n else {\r\n console.log('de waarde klopt niet');\r\n }\r\n }\r\n }\r\n else if (division == 10) {\r\n if (pointsNow >= pointsHold && pointsNow < pointsPromotion) {\r\n setPointColor('#4E4E4E', '#707070', widthPointsNow);\r\n }\r\n else if (pointsNow >= pointsPromotion && pointsNow < pointsTitle) {\r\n setPointColor('#46BFBD', '#5AD3D1', widthPointsNow);\r\n }\r\n else if (pointsNow >= pointsTitle && pointsNow <= maxPoints) {\r\n setPointColor('#FDB45C', '#FFC870', widthPointsNow);\r\n }\r\n else if (pointsNow > maxPoints) {\r\n pointsNow = maxPoints;\r\n\r\n widthPointsNow = pointsNow * pxOnePoint;\r\n\r\n setPointColor('#FDB45C', '#FFC870', widthPointsNow);\r\n }\r\n else {\r\n console.log('de waarde klopt niet');\r\n }\r\n }\r\n else {\r\n\r\n if (divisionNow == division) {\r\n \r\n console.log('hij zit hier + '+pointsNow);\r\n if (pointsNow < pointsHold) {\r\n setPointColor('#F7464A', '#FF5A5E', widthPointsNow);\r\n }\r\n else if (pointsNow >= pointsHold && pointsNow < pointsPromotion) {\r\n setPointColor('#4E4E4E', '#707070', widthPointsNow);\r\n }\r\n else if (pointsNow >= pointsPromotion && pointsNow < pointsTitle) {\r\n setPointColor('#46BFBD', '#5AD3D1', widthPointsNow);\r\n }\r\n else if (pointsNow >= pointsTitle && pointsNow <= maxPoints) {\r\n setPointColor('#FDB45C', '#FFC870', widthPointsNow);\r\n }\r\n else if (pointsNow > maxPoints) {\r\n pointsNow = maxPoints;\r\n\r\n widthPointsNow = pointsNow * pxOnePoint;\r\n\r\n setPointColor('#FDB45C', '#FFC870', widthPointsNow);\r\n }\r\n else {\r\n console.log('de waarde klopt niet');\r\n }\r\n }\r\n }\r\n }\r\n $('.point-progress').width(widthPointsNow);\r\n}", "title": "" }, { "docid": "b5b55fb84ed103b49e136efa387192d9", "score": "0.56563866", "text": "function calcPoints() {\n\t\n\tvar defaultExtra = 1000 * foundWords.length+1;\n\t\n\tvar dateDif = Math.round(Math.abs((startTime.getTime() - time.getTime())/1000));\n\tdefaultExtra -= dateDif;\n\t\n\tif (defaultExtra > 0)\n\t{\n\t\tpoints += defaultExtra;\n\t}\n\t\n\tif (points > 99999999)\n\t\tpoints = 99999999;\n\t\t\n\tprintPoints();\n}", "title": "" }, { "docid": "d757a915a2af44721b13001e10296285", "score": "0.5647805", "text": "layerShown() {return hasUpgrade(\"e\", 22) || player[this.layer].points.gte(1)}", "title": "" }, { "docid": "f9b239c018686b0108328e80a81052f5", "score": "0.56449634", "text": "function calculate_points(points){\n\tif (mypoints >= points){\n\t\talert(\"Success you have\" + String(mypoints - points) + \" left!\");\n\t} else {\n\t\talert(\"not enough points! you need \" + String(points - mypoints));\n\t}\n}", "title": "" }, { "docid": "daf684074ce949d328b6fb6eda72a084", "score": "0.56063247", "text": "function hideShowPoints(d) {\n\t var p = projection.rotate(),\n\t angle = d3.geo.distance([d.lon, d.lat], [-p[0], -p[1]]),\n\t maxAngle = clipAngle * Math.PI / 180;\n\t return (angle > maxAngle) ? '0' : '1.0';\n\t }", "title": "" }, { "docid": "99d8db7d1b7457761406154c7fdc57f4", "score": "0.5574882", "text": "function detailup()\n {\n if (threshold > 0.6)\n {\n threshold = threshold / 2.0;\n }\n draw2();\n }", "title": "" }, { "docid": "96852fa53ac80b117cd3ea89f6acd188", "score": "0.5557827", "text": "function displayPoints() {\n var dealerPoints = calculatesPoints(dealerHand);\n var playerPoints = calculatesPoints(playerHand);\n\n $('#dealer-points').text(dealerPoints);\n $('#player-points').text(playerPoints);\n}", "title": "" }, { "docid": "155bbc379a7e4c5ecc221d2ade00c62b", "score": "0.55387133", "text": "function isWorthDisplayingShout(shoutData) {\n if ((!shoutData['duration'] || !shoutData['date'])) return 0; //if is no data\n if (!shoutData['playerState']) return 1; // if is paused\n\n //if is playing and remaning time comparing dates\n let remaining = (shoutData['duration'] || 0) - (shoutData['playerPosition'] || 0);\n let secondsElapsed = calculateSecondsElapsed(shoutData['date']);\n let isWorth = (remaining - secondsElapsed) > 0;\n return isWorth;\n}", "title": "" }, { "docid": "5ef0ef8f8878ac01ad19b5128e377d7e", "score": "0.553171", "text": "function getPts() {\n var dataPts = Number(data[0].pts);\n \n \n if(markerFound === true && introVisible === false){\n console.log(markerFound);\n console.log(\"dataPts: \" + dataPts);\n if (dataPts != 0) {\n data[0].pts = \"0\";\n pts++;\n console.log(\"pts++\");\n }\n distToGoal = getDistance(lat1, lon1, goalData[0].lat, goalData[0].lon);\n console.log(\"Distance To Goal\"+ distToGoal);\n if ( distToGoal < maxDistStart)\n {\n console.log(\"Am Ziel angekommen!\")\n pts++;\n }\n }\n}", "title": "" }, { "docid": "547470797e78d83b2eab4d9142e6aff8", "score": "0.5520252", "text": "function showStats() {\n var totalE = kineticE + potentialE + gravitationalE;\n energyReadout.innerHTML = \"KE = \" + kineticE.toFixed(2) +\n \", PE = \" + potentialE.toFixed(2) + \", GE = \" + gravitationalE.toFixed(2);\n var elapsedTime = ((new Date()).getTime() - startTime) / 1000;\t// time in seconds\n energyReadout.innerHTML += \", Steps/s = \" + Number(stepCount / elapsedTime).toFixed(0);\n dataReadout.innerHTML = \"t = \" + time.toFixed(3) + \", E = \" + totalE.toFixed(2) +\n \", T = \" + averageT.toFixed(4) + \", P = \" + averageP.toFixed(4);\n}", "title": "" }, { "docid": "b8c707324e1d0fde4418e5378bbc83b0", "score": "0.5505592", "text": "isTired() {\n return ((this.stamina / this.phenotype.maxStamina * 100) < 10 ? true : false)\n }", "title": "" }, { "docid": "9ec94940d82ae06c24d821f0b58f2242", "score": "0.54835397", "text": "function isPlotReady() {\n\tif (playerOrTeam === 'teams' && statsSelected.indexOf(\"SPD\") !== -1) {\n\t\talert(\"Sorry! There are no speed statistics kept on teams\");\n\t\treturn false;\n\t}\n\tif (ptID === undefined) {\n\t\talert(\"You need to select a team/player\");\n\t\treturn false;\n\t}\n\tif (statsSelected.length === 0) {\n\t\talert(\"You need to select stats to plot\");\n\t\treturn false\n\t}\n\treturn true\n}", "title": "" }, { "docid": "2c7d12f78e653d997c34e9dcc25db739", "score": "0.5473452", "text": "function updatePoints() {\n if (gamePointsInfo.correctClicks != 0) {\n if (gamePointsInfo.correctClicks % inGameDifficulty.bonusClickQty == 0) {\n gamePointsInfo.bonus++\n }\n }\n\n let plusThese = (gamePointsInfo.completeMatch * inGameDifficulty.posPoints) + (gamePointsInfo.bonus * inGameDifficulty.bonusPoints)\n let minusThese = (gamePointsInfo.nonMatch * inGameDifficulty.negPoints) + (gamePointsInfo.help * inGameDifficulty.helpPoints)\n let totalToBe = plusThese - minusThese\n gamePointsInfo.totalPoints = totalToBe\n\n thePoints.text(totalToBe)\n }", "title": "" }, { "docid": "72a2a02694b2e19904277777c45fdc2a", "score": "0.5471254", "text": "function updatePreviewTime() {\n if (gamePointsInfo.correctClicks !== 0) {\n if (gamePointsInfo.correctClicks % inGameDifficulty.toNextLevel == 0) {\n gameTimeInfo.previewTime -= (gameTimeInfo.previewTime * inGameDifficulty.challengeSpeed)\n }\n }\n\n return gameTimeInfo.previewTime * 1000\n }", "title": "" }, { "docid": "611b4e6872b80ce5470714c76157fbce", "score": "0.5460499", "text": "function testDurations() {\n \n var a = tlC.impact.duration().toFixed(2);\n var b = tlN.jabbing.duration().toFixed(2);\n var c = tlC.stepPush.duration().toFixed(2);\n var d = tlN.backing.duration().toFixed(2);\n var e = tlC.strike.duration().toFixed(2);\n var f = tlN.getHit.duration().toFixed(2);\n\n // impact vs jabbing\n if (a === b) {\n console.log(\"Exactly the same\");\n } else {\n if ( a < b ) {\n console.log(\" IMPACT is smaller than JABBING : \" + ( a - b ));\n } else if ( a > b ) {\n console.log(\" IMPACT is bigger than JABBING : \" + ( a - b ));\n }\n }\n\n // StepPush vs Backing\n if (c === d) {\n console.log(\"Exactly the same\");\n } else {\n if ( c < d ) {\n console.log(\"STEPPUSH is smaller than BACKING : \" + ( c - d )); \n } else if ( c > d ) {\n console.log(\"STEPPUSH is bigger than BACKING : \" + ( c - d ));\n }\n }\n\n // Strike vs getHit\n if (e === f) {\n console.log(\"Exactly the same\");\n } else {\n if ( e < f ) {\n console.log(\"Strike is smaller than getHit : \" + ( e - f )); \n } else if ( e > f ) {\n console.log(\"Strike is bigger than getHit : \" + ( e - f ));\n }\n }\n\n}", "title": "" }, { "docid": "7a33a27ac5dae904b9c873cce7b27d08", "score": "0.5452187", "text": "function checker() {\n if (points === random) {\n wins++;\n $(\"#wins\").html(wins);\n reset();\n } else {\n console.log(points, random);\n if (points > random) {\n losses++;\n $(\"#losses\").html(losses);\n reset();\n }\n }\n }", "title": "" }, { "docid": "fe82f88fa3352810ec87fd97a7e6b056", "score": "0.54440904", "text": "function earnPoints(){\n points = points + 10;\n showPoints.innerText = 'Points: ' + points;\n\n // Check if the player has enough points to win\n if(points >= pointsToWin ) {\n win();\n }\n}", "title": "" }, { "docid": "0fdba00cc7665b079efc647fb048da0a", "score": "0.542758", "text": "calculatePoints() {}", "title": "" }, { "docid": "5be687d0cf6102918f048a5c124d9a12", "score": "0.5424179", "text": "function testDurations() {\n\n var a = tlC.impact.duration().toFixed(2);\n var b = tlN.jabbing.duration().toFixed(2);\n var c = tlC.stepPush.duration().toFixed(2);\n var d = tlN.backing.duration().toFixed(2);\n var e = tlC.strike.duration().toFixed(2);\n var f = tlN.getHit.duration().toFixed(2);\n\n // impact vs jabbing\n if (a === b) {\n console.log(\"Exactly the same\");\n } else {\n if (a < b) {\n console.log(\" IMPACT is smaller than JABBING : \" + (a - b));\n } else if (a > b) {\n console.log(\" IMPACT is bigger than JABBING : \" + (a - b));\n }\n }\n\n // StepPush vs Backing\n if (c === d) {\n console.log(\"Exactly the same\");\n } else {\n if (c < d) {\n console.log(\"STEPPUSH is smaller than BACKING : \" + (c - d));\n } else if (c > d) {\n console.log(\"STEPPUSH is bigger than BACKING : \" + (c - d));\n }\n }\n\n // Strike vs getHit\n if (e === f) {\n console.log(\"Exactly the same\");\n } else {\n if (e < f) {\n console.log(\"Strike is smaller than getHit : \" + (e - f));\n } else if (e > f) {\n console.log(\"Strike is bigger than getHit : \" + (e - f));\n }\n }\n}", "title": "" }, { "docid": "41583097a36cbc86e7afead5a1856d95", "score": "0.5392543", "text": "bonusPoints(){\r\n //setting the display to none\r\n this.ufoBonus.style.display='none';\r\n \r\n //if else to determine if undefined/ no score yet set(snippet from increment score function/ simply changed value)\r\n if(this.scoreTotal===undefined){\r\n this.scoreTotal=500;\r\n this.scoreCounter.innerHTML=this.scoreTotal;\r\n } else {\r\n this.scoreTotal += 500;\r\n this.scoreCounter.innerHTML = this.scoreTotal ;\r\n\r\n }\r\n\r\n\r\n\r\n }", "title": "" }, { "docid": "a6d967e62bae2bea03afdf0840132359", "score": "0.5387919", "text": "function pointsDisplay(a) {\n\n points += Number(a);\n $('.scorecontainer').html(\"Score : \" + points);\n if(highscore !== null) {\n if (points > highscore) {\n localStorage.setItem(\"highscore\", points); \n highscore = points;\n $('.hscorecontainer').html(\"Best : \" + highscore); \n }\n } else {\n localStorage.setItem(\"highscore\", points);\n }\n }", "title": "" }, { "docid": "ed156808429e23fa6a187c5e5187eea8", "score": "0.5379406", "text": "function points(gain){\n if (gain){\n correct.play();\n game.points+=10;\n pointsDisplay.classList = (\"correct\");\n if (game.highScore<game.points){\n game.highScore = game.points;\n highScoreDisplay.innerHTML = game.highScore;\n myStorage.setItem('ranchHighScore', game.highScore);\n }\n } else {\n incorrect.play();\n game.points-=5;\n pointsDisplay.classList = (\"incorrect\");\n }\n pointsDisplay.innerHTML = game.points;\n}", "title": "" }, { "docid": "b24ea4cd618f09aecdf26d866e4f75c9", "score": "0.5374041", "text": "function checkSpeed(speed) {\r\n const speedLimit = 70;\r\n const kmPerPoint = 5;\r\n\r\n if (speed < speedLimit + kmPerPoint) console.log(\"Ok\");\r\n else {\r\n // let points = (speed - speedLimit) / kmPerPoint\r\n const points = Math.floor((speed - speedLimit) / kmPerPoint);\r\n\r\n if (points >= 12) console.log(\"License suspended\");\r\n else console.log(\"Ponits\", points);\r\n }\r\n}", "title": "" }, { "docid": "147c9cff434ddb7767140ec7eb080d0a", "score": "0.5366248", "text": "onLine(p1, p2) {\n return this.distToLine(p1, p2) < config.precision_point_on_line;\n }", "title": "" }, { "docid": "f3b21877d0530a22be87d802e773fe6f", "score": "0.53625894", "text": "function checkSpeed(speed) {\r\n const speedLimit = 70;\r\n const kmPerPoint = 5;\r\n\r\n if (speed < speedLimit + kmPerPoint) {\r\n console.log(\"Ok\");\r\n return;\r\n }\r\n\r\n // let points = (speed - speedLimit) / kmPerPoint\r\n const points = Math.floor((speed - speedLimit) / kmPerPoint);\r\n\r\n if (points >= 12) console.log(\"License suspended\");\r\n else console.log(\"Ponits\", points);\r\n}", "title": "" }, { "docid": "50011ae7c7c2184467cee974dd3364c1", "score": "0.5353816", "text": "checkForDraw() {\n //Get the score of both teams\n let xScore = this.players[0].getScore();\n let circleScore = this.players[1].getScore();\n //console.log(\"xScore: \" + xScore);\n //console.log(\"circleScore: \" + circleScore);\n //console.log(\"draw: \" + !(xScore > circleScore || xScore < circleScore));\n\n //If one of the teams has a higher score return false, else return true\n return !(xScore > circleScore || xScore < circleScore);\n }", "title": "" }, { "docid": "a1ffdb677cfe1a79223bd316ef26df58", "score": "0.53524625", "text": "function display() {\r\n ggPtsDoc.innerHTML = `HP: ${ggPoints}`;\r\n bgPtsDoc.innerHTML = `HP: ${bgPoints}`;\r\n music.volume=1;\r\n animate();\r\n}", "title": "" }, { "docid": "50c4223b167ce9bcbcf6961bf977f7b7", "score": "0.53436947", "text": "function calculatePoints() {\n\t\tif (playerPoints == 10) {\n\t\t\talert(\"Congratulations you won the game!\");\n\t\t\tresetGame();\n\t\t} else if (computerPoints == 10) {\n\t\t\talert(\"you have been defeated by computer :(\");\n\t\t\tresetGame();\n\t\t}\n\t}", "title": "" }, { "docid": "228fa63fefc4a30167ad11d8a20dae42", "score": "0.5340762", "text": "function checkEmissionRate() {\n // Reduces emission rate for slow devices\n var currentTime = new Date();\n var fps = Math.floor(1000 / (currentTime - now));\n if(fps < 30 && emissionRate > 1) {\n --emissionRate;\n } else if(fps < 25) {\n emissionRate = 1;\n } else if(emissionRate < maxEmissionRate) {\n ++emissionRate;\n }\n if(isDebugMode) {\n debugElement.setContent(fps + ' - ' + particleList.length);\n }\n now = currentTime;\n }", "title": "" }, { "docid": "67bf6fb3d611d0e52d1938b4db436440", "score": "0.5340129", "text": "function displayStats() {\n\tvar stats = \"\";\n\n\tvar pov = panorama.getPOV();\n\tvar displayBearing = parseInt(pov.yaw);\n\tif (displayBearing >= 360) {\n\t\tdisplayBearing -= 360;\n\t}\n\tif (displayBearing < 0) {\n\t\tdisplayBearing += 360;\n\t}\n\n\tif (displayBearing > 0) {\n\t} else {\n\t\tdisplayBearing = 0;\n\t}\n\n\tvar displaySpeed = vehicleSpeed * 10;\n\tif (displaySpeed < 0) {\n\t\tdisplaySpeed = 0;\n\t}\n\n\tstats = \"<span style='color:\" + (vehicleSpeed >= 6 ? \"red'\" : \"green\")\n\t\t\t+ \"'>\" + \"Speed: <b>\" + displaySpeed + \"</b></span>\" + \"<br/>\"\n\t\t\t+ \"Direction: <b>\" + displayBearing + \"&deg;</b>\";\n\n\tdocument.getElementById(\"statDiv\").innerHTML = stats;\n\n\tsetTimeout(\"displayStats()\", 500);\n}", "title": "" }, { "docid": "f8f46302a96df7415891d5dbdd2ab77a", "score": "0.532766", "text": "function isSetOver()\n\t{\n\t\tvar games1=point.gamesP1;\n\t\tvar games2=point.gamesP2;\n\t\tif(games1<6&&games2<6) return false;\n\t\tif(games1===6&&games2===6) // tiebreak\n\t\t{\n\t\t\tpoint.pointType='tieBreak';\n\t\t\ttieBreakPoint=1;\n\t\t\toldServer=0;\n\t\t\tupdPoints();\n\t\t\treturn false;\n\t\t}\n\t\tvar dif=Math.abs(games1-games2);\n\t\tif(dif<2) return false;\n\t\tif(games1>5||games2>5){\n\t\t\t setOver();\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "ea1fd51fca4da67441866825dbe3d2ca", "score": "0.53200704", "text": "function checkSpeed(speed) {\n const speedLimit = 70;\n const kmPerPoint = 5;\n\n if (speed < speedLimit + kmPerPoint) {\n console.log('Ok');\n return;\n }\n \n const points = Math.floor((speed - speedLimit) / kmPerPoint);\n if (points >= 12)\n console.log('License suspended');\n else \n console.log('Points: ', points);\n}", "title": "" }, { "docid": "84f7f320a2a306838166b5bcb70f69cc", "score": "0.5301702", "text": "function pointPosition (myScore, VeScore, socScore) { \n \n // if for social score conservative \n if(socScore <= 6.6){\n consPoint.style.cssText = `background-color: white;border-radius: 10px;`\n cons.style.cssText = `margin-left:${myScore}em; padding-top: ${VeScore}em; ` ; \n }\n\n // if for social score middle, not progresist and not conservative \n else if(socScore > 6.6 && socScore < 13){\n midPoint.style.cssText = `background-color: white;border-radius: 10px;`\n mid.style.cssText = `margin-left:${myScore}em; padding-top: ${VeScore}em; ` ; \n }\n\n // if for social score progresist \n else if(socScore > 13){\n progPoint.style.cssText = `background-color: white;border-radius: 10px;`\n prog.style.cssText = `margin-left:${myScore}em; padding-top: ${VeScore}em; ` ;\n }\n\n}", "title": "" }, { "docid": "fcc2018e59e9c4a9c6f7f52b13d9ca64", "score": "0.53011763", "text": "function progressedPlaces(){\n if ( fuzzyEqual( allHandsFour[0].lady1.pos, allHandsFour[0].POS_1 ) &&\n fuzzyEqual( allHandsFour[0].lady2.pos, allHandsFour[0].POS_3 ) &&\n fuzzyEqual( allHandsFour[0].gent1.pos, allHandsFour[0].POS_2 ) &&\n fuzzyEqual( allHandsFour[0].gent2.pos, allHandsFour[0].POS_0 ) ){\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "cbffc38be0a42f53e930f94cf842b408", "score": "0.5300713", "text": "function printStatus(x) {\n //print distance to console\n console.log('Object at ' + x.value*1.8/.0064 +'inches');\n}", "title": "" }, { "docid": "d16cb0a26217561b7014cfd3b77dfcfc", "score": "0.5295694", "text": "function shouldShowSittable() {\n var seatPosition = that.chairProperties.position;\n var distanceFromSeat = Vec3.distance(MyAvatar.position, seatPosition);\n\n return (distanceFromSeat < SITTABLE_DISTANCE_SHOW_M && !isAvatarSittingInSeat() && !that.overlayPreSit);\n }", "title": "" }, { "docid": "2a2edefe2bdfc422761d1ab1ba31fff5", "score": "0.52946573", "text": "_switchToDuration() { this._showFps = false; }", "title": "" }, { "docid": "4e034aca7a4629f300eeb909ea92c005", "score": "0.5294236", "text": "function point1 () {\n if ((((margintop >= (pt1height*5)) && (margintop <= (pt1height*8))) && ((marginleft >= (pt1width*5)) && (marginleft <= (pt1width*8)))) && (counter ===0)) {\n $('.mission p').text('Pick Up Newspaper');\n $('#pt1').fadeOut();\n counter++;\n }\n\n//makes a range in which if the player goes into it, registers in counter and allows you to move on to next point\n }", "title": "" }, { "docid": "6dda8e4dc1bd6f4af21340e560d77bb4", "score": "0.52933353", "text": "function beat() {\n // If my mouse and my partner's mouse are touching\n if (touching(myData, partnerMousePosition)) {\n // If my lerp amount is above or below the threshold, change direction\n if (amount > 1 || amount < 0) {\n step *= -1;\n }\n\n // Change the lerp amount by the step amount\n amount += step;\n\n // Lerp the size by the lerp amount\n size = lerp(origSize * 3, origSize * 4, amount);\n\n isTouching = true;\n\n // If they are not touching\n } else {\n // Draw them at their original size\n size = origSize;\n isTouching = false;\n }\n}", "title": "" }, { "docid": "7cbef273d9054dca6f5cfc9b09316248", "score": "0.52859944", "text": "function point_contains(player) {\n const point = player.getGlobalPosition();\n const pad = pads.children.find(child => child.containsPoint(point));\n if(pad) {\n player.animation.speed = 0.60;\n pad.events.emit('trigger');\n return speed;\n }\n\n if(env.dev) {\n return speed;\n }\n return 5;\n}", "title": "" }, { "docid": "0ebba4bcbaba8d4fbd247553c4924067", "score": "0.52820677", "text": "function pointTallyForGhost() {\r\n\twrittenScore += 50000;\r\n\tif (multiplierCount > 0) {\r\n\t\twrittenScore += 1000 * (multiplierCount * 0.5);\r\n\t}\r\n\tepicScore.innerHTML = writtenScore;\r\n}", "title": "" }, { "docid": "300897d9053dba57dd1331080d2872b6", "score": "0.52782595", "text": "function betterThanAverage(classPoints, yourPoints) {\n\tlet sum = classPoints.reduce((previous, current) => (current += previous));\n\tlet avg = sum / classPoints.length;\n\tif (yourPoints > avg) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "8c1b7cc86814ecf9569211988ff41c7b", "score": "0.52734184", "text": "function drawStatistics(totalLines, linesPerSecond) {\n\t\t//draw a white square.\n\t\tcontext.fillStyle = \"#ffffff\";\n\t\tcontext.fillRect(20, 4, 250, 30);\n\t\t//draw the lps text.\n\t\tcontext.fillStyle = \"#000000\";\n\t\tcontext.fillText(nrFormat.format(linesPerSecond.toFixed(0)) + \" lines per second.\", 20, 20);\n\t\tcontext.fillText(nrFormat.format(totalLines) + \" lines drawn in total.\", 20, 30);\n\t\tcontext.stroke();\n\t\tlines = 0;\n\t\ttimeElapsed = 0;\n\t}", "title": "" }, { "docid": "6aa21e497a6e6b5795e470558babf813", "score": "0.52691853", "text": "function hisPoint(){\n point1 ++;\n $(\"#player1\").css(\"background-color\", \"rgba(0, 128, 0, 0.425)\")\n $(\"#player2\").css(\"background-color\", \"rgba(255, 0, 0, 0.438)\")\n choices1.textContent = computerChoice[random];\n choices2.textContent = choice;\n \n $('#score1').html('Son score : ' + point1);\n $('h2').html(\"Un point pour lui !\");\n }", "title": "" }, { "docid": "c9fb157d3dddaf22d7b153cb8c2cbb54", "score": "0.52672637", "text": "function displayPlayerPoints(arrayOfPlayerCards, whichPlayer) {\n var points = calculatePoints(arrayOfPlayerCards);\n\n if (points[2]) {\n // means the player has an Ace\n if (points[0] > points[1]) {\n var text = points[0] + \" or \" + points[1]\n\n if (whichPlayer === 2) {\n $('#player-points2').text(text);\n } else {\n $('#player-points').text(text);\n };\n } else {\n if (whichPlayer === 2) {\n $('#player-points2').text(points[0]);\n } else {\n $('#player-points').text(points[0]);\n };\n };\n } else {\n if (whichPlayer === 2) {\n $('#player-points2').text(points[0]);\n } else {\n $('#player-points').text(points[0]);\n };\n };\n}", "title": "" }, { "docid": "0b9a37de62273504eb4b8fa31ed7547b", "score": "0.5259811", "text": "function toggleTrace() {\n\tif (!traceMode && !running) {\n\t\tif (enoughPoints()) {\n\t\t\tsendPoints();\n\t\t\tsetTimeout(function() {\n\t\t\t\ttoggleStartStop();\n\t\t\t\trestOfToggleTrace();\n\t\t\t}, sendPointsWaitTime);\n\t\t} else {\n\t\t\talert(\"There are not enough points.\");\n\t\t}\n\t} else {\n\t\trestOfToggleTrace();\n\t}\n}", "title": "" }, { "docid": "3b61ea6fc40d2acc246215d7d4221437", "score": "0.5256154", "text": "function displayOverlayResults(isWinner){\n if(isWinner){\n // Overlay text = YOU WIN! THE CORRECT NUMBER WAS\n overlayEl.style.display = \"block\";\n }else { \n //YOU LOSE, THE CORRECT NUMBER WAS ! \n overlayEl.style.display = \"block\";\n }\n \n\n }", "title": "" }, { "docid": "76a6c1a82eaaba1ac1fa2218f748274c", "score": "0.5253232", "text": "function timeUp()\n{\n\t$start.show();\t\n\t$pause.hide();\t\n\t$continue.hide();\n\t\n\t\n\t// setTimeout(() => alert(\"fin\"), 1500/60);\t\n\t// var fin = $(\"\")\n\tif($(\".spanOne\").text() <= 0){\n\t\tconsole.log(\"entra\");\n\t\t$(\".no\").css(\"display\", \"block\");\n\t}\n\n\tif($(\".spanOne\").text() > 0){\n\t\tconsole.log(\"entra\");\n\t\t$(\".yes\").css(\"display\", \"block\");\n\t}\n \n}", "title": "" }, { "docid": "e24f4601d61710cf3e6b794b3af9ecdd", "score": "0.5249732", "text": "totalPoints() { \n if (this.hungerMeter <= 0 || this.happinessMeter <= 0 || this.lonlinessMeter <= 0){\n this.removeDiv()\n //stop timer n display an alert??\n clearInterval(this.timer)\n corgiAdapter.deleteCorgi(this.id)\n showDangerAlert(`${this.name} ran away ☹`)\n }\n}", "title": "" }, { "docid": "fc3a5445442dea02b857e5933a57587e", "score": "0.52467054", "text": "function isAnswerFast(){\n\tvar response = false;\n\t\n\tif(currentTimeBarFrame < 25){\n\t\tresponse = true;\n\t}\n\t\n\treturn response;\n}", "title": "" }, { "docid": "21218e7cee871fb3f4ceebce0eed7b4e", "score": "0.5243857", "text": "calculate_points_helper(pos){\r\n //2 points for the bottom one\r\n if(pos[0]>-7.5 && pos[0]<7.5 && pos[2]<=-14 && pos[2]>-18){\r\n return 1\r\n }\r\n //middle one\r\n if(pos[0]>-7.5 && pos[0]<7.5 && pos[2]<=-18 && pos[2]>-22){\r\n return 2\r\n }\r\n //last one\r\n if(pos[0]>-7.5 && pos[0]<7.5 && pos[2]<=-22 && pos[2]>-26){\r\n return 3\r\n }\r\n return 0\r\n }", "title": "" }, { "docid": "636e8d192f4e4fe3100c51f26b4c4960", "score": "0.5241838", "text": "function displayTime() {\n //Calculate the number of minutes and seconds based on the current time\n var min = Math.floor(currentTime / 60);\n var sec = Math.floor(currentTime % 60);\n \n //Add a 0 to the front of the second when appropriate\n if (sec < 10) {\n sec = \"0\" + sec;\n }\n \n $(\"#time-text\").text(min + \":\" + sec);\n }", "title": "" }, { "docid": "a5ab71c65b0319bd573e737d5c015f16", "score": "0.52417433", "text": "function showMissedParasites(){\n\tvar timeAnim = 500;\n\tpicture_objects.forEach(function(parasiteObj, index, tab){\n\n\t\tif(paraIndexValides.indexOf(index) == -1){\n\t\t\t\t\n\t\t\twindow.setTimeout(function()\n\t\t\t{\n\t\t\t\tcanvas_context.beginPath();\n\t\t\t\tcanvas_context.lineWidth=2/canvas_quotient;\n\t\t\t\tcanvas_context.strokeStyle=\"blue\";\n\t\t\t\tcanvas_context.setLineDash([3,2.5,3,2.5]);\n\t\t\t\tcanvas_context.rect((picture_objects[index].pos_x)/canvas_quotient, (picture_objects[index].pos_y+1)/canvas_quotient, (picture_objects[index].size_x)/canvas_quotient, (picture_objects[index].size_y+1)/canvas_quotient);\n\t\t\t\tcanvas_context.stroke();\n\n\t\t\t}, timeAnim);\n\n\t\t timeAnim +=1200/(picture_objects.length - paraIndexValides.length);\n\t\t}\n\t\t\n\t});\n}", "title": "" }, { "docid": "6642cc00897ef065db21fb0505278d87", "score": "0.52356285", "text": "function randomPoints(){\n\tdo{\n\t\trandomNumber = Math.floor(Math.random()*120);\n\t\tif(randomNumber >= 19){\n\t\t\tif(randomNumber <= 120){\n\t\t\t\t$(\"#random-number\").html(randomNumber);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}while(!randomPoints());\n}", "title": "" }, { "docid": "b951a8af1a07b2a3af007f32cbaebe63", "score": "0.5228096", "text": "function showStatues(){\n\tconsole.log(\"-----------------------------------\");\n\tconsole.log(\"Current time is \" + currentTime);\n\tconsole.log(\"Statues in every stop\");\n\tfor(var i=1;i<=15;i++){\n\t\tconsole.log(\"Stop \"+ i + \" has \"+ waitPerson[i] + \" person.\")\n\t}\n\tif(leaveTime[\"A\"].time == 0){\n\t\tcarPosition[\"A\"] = leaveTime[\"A\"].stopN;\n\t}else{\n\t\tcarPosition[\"A\"] = (currentTime - leaveTime[\"A\"].time)/300 + leaveTime[\"A\"].stopN;\n\t}\n\t\n\tif(leaveTime[\"B\"].time == 0){\n\t\tcarPosition[\"B\"] = leaveTime[\"B\"].stopN;\n\t}else{\n\t\tcarPosition[\"B\"] = (currentTime - leaveTime[\"B\"].time)/300 + leaveTime[\"B\"].stopN;\n\t}\n\t\n\tif(leaveTime[\"C\"].time == 0){\n\t\tcarPosition[\"C\"] = leaveTime[\"C\"].stopN;\n\t}else{\n\t\tcarPosition[\"C\"] = (currentTime - leaveTime[\"C\"].time)/300 + leaveTime[\"C\"].stopN;\n\t}\n\tif(leaveTime[\"D\"].time == 0){\n\t\tcarPosition[\"D\"] = leaveTime[\"D\"].stopN;\n\t}else{\n\t\tcarPosition[\"D\"] = (currentTime - leaveTime[\"D\"].time)/300 + leaveTime[\"D\"].stopN;\n\t}\n\tif(leaveTime[\"E\"].time == 0){\n\t\tcarPosition[\"E\"] = leaveTime[\"E\"].stopN;\n\t}else{\n\t\tcarPosition[\"E\"] = (currentTime - leaveTime[\"E\"].time)/300 + leaveTime[\"E\"].stopN;\n\t}\n\t\n\tconsole.log(\"Bus \" + \"A\" + \" positon is \" + carPosition[\"A\"].toFixed(2));\n\tconsole.log(\"Bus \" + \"B\" + \" positon is \" + carPosition[\"B\"].toFixed(2));\n\tconsole.log(\"Bus \" + \"C\" + \" positon is \" + carPosition[\"C\"].toFixed(2));\n\tconsole.log(\"Bus \" + \"D\" + \" positon is \" + carPosition[\"D\"].toFixed(2));\n\tconsole.log(\"Bus \" + \"E\" + \" positon is \" + carPosition[\"E\"].toFixed(2));\n\n\n}", "title": "" }, { "docid": "5b044aff1be0d15979666404b57f5f24", "score": "0.5223983", "text": "function update_display() {\n total_points += points_per_second;\n total_persents += prosent_persec;\n reload_notif += points_per_second;\n update_notif += points_per_second;\n //console.log(total_points+\"reload_notif\"+reload_notif+\"update_notif\"+update_notif);\n if (reload_notif >= reload_notiflim) {\n reload_notif = 0;\n afterAccept();\n //\tsetTimeout(function() {afterAccept();}, 10);\n }\n if (update_notif >= update_notiflim) {\n setTimeout(function () {\n updateNotif();\n }, 500);\n update_notif = 0;\n }\n if (total_points >= 600) {\n clearInterval(ticker);\n return ;\n }\n //return total_points;\n\n}", "title": "" }, { "docid": "a88fd178cee84e02cf28de9e2d7604df", "score": "0.52170175", "text": "function tester(){\n\t\tconsole.log(\"the Tween has reached this point\");\n\n\t}", "title": "" }, { "docid": "43edaae6a8f3f8400721e704a10f2a00", "score": "0.5216083", "text": "function checkDisplayTime(time) {\n const date = new Date(),\n day = +date.getDay(),\n hours = +date.getHours(),\n minutes = +date.getMinutes(),\n clock_with = time.clock.with.split(\":\"),\n clock_on = time.clock.on.split(\":\");\n\n if (time.day_week[day] === \"off\") {\n return true;\n } else {\n if (hours >= +clock_with[0] && hours <= +clock_on[0]) {\n if (hours == +clock_with[0]) {\n return minutes <= +clock_with[1];\n }\n if (hours == +clock_on[0]) {\n return minutes >= +clock_on[1];\n }\n }\n }\n }", "title": "" }, { "docid": "30d80f6a1441841a331198ae2763b9d3", "score": "0.5212117", "text": "function displaySetPointChange(event){\n var setPoint = parseFloat(event.value);\n if(setPoint != NaN){\n var deviceId = event.deviceId;\n updateDeviceStateValue(deviceId, \"setPoint\", setPoint);\n }\n}", "title": "" }, { "docid": "a7c2d6929a48c46cf2149b7b7ca4bdb3", "score": "0.52110255", "text": "calculate_points(){\r\n //iterate through all balls\r\n for(var i=0; i< this.numberOfBalls;i++){\r\n var currBall= this.ball_array[i]\r\n //if current ball exist on the surface\r\n if(currBall.existence){\r\n //if current ball is for P1\r\n if(currBall.player==1){\r\n this.p1Score+=this.calculate_points_helper(currBall.pos_vec)\r\n }\r\n else{\r\n this.p2Score+=this.calculate_points_helper(currBall.pos_vec)\r\n }\r\n }\r\n }\r\n //assign whoWon number to be used in displaying as well\r\n this.whoWon= this.p1Score> this.p2Score ? 1: this.p1Score<this.p2Score ? 2: 3;\r\n }", "title": "" }, { "docid": "d5943070e1652e7836a9b09261004b48", "score": "0.52025294", "text": "needsUpdate()\n\t{\n\t\treturn Math.abs(this.x - this.xSmooth) + Math.abs(this.y - this.ySmooth)\n\t\t\t+ Math.abs(this.zoom - this.zoomSmooth) > 0.01;\n\t}", "title": "" }, { "docid": "75d0b24243dd60a7be8c7a6d1a271dfe", "score": "0.5193724", "text": "function updateScore(points){\n\t\t\t//Update total score\n\t\t\tif (trial.show_total_points){\n\t\t\t\tscoreDiv = display_element.querySelector('#total-score-box')\n\t\t\t\t//scoreDiv.style.color = 'green'\n\t\t\t\tscoreDiv.style.fontSize = '30px'\n\t\t\t\tscoreDiv.innerHTML = 'Total points: ' + points\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a2abcdb9fb3cf50124465a965fe00e7d", "score": "0.5186126", "text": "function countPoints() {\n\tvar points = 0;\n\tpoints += wagon.health/2 * wagon.people.length;\n\tpoints += 50; // for bringing the wagon\n\tpoints += 4 * wagon.oxen;\n\tpoints += 2 * wagon.wheels;\n\tpoints += 2 * wagon.axles;\n\tpoints += 2 * wagon.tongues;\n\tpoints += 2 * wagon.clothing;\n\tpoints += 1 * wagon.bait;\n\tpoints += 0.04 * wagon.food;\n\tpoints += 0.2 * wagon.money;\n\tif (wagon.leaderType == 'carpenter') points *= 2;\n\telse if (wagon.leaderType == 'farmer') points *= 3;\n\telse {}\n\treturn Math.max(0, Math.round(points));\n}", "title": "" }, { "docid": "55b7d81c6baae0aad9363b2c3368b8c5", "score": "0.51749825", "text": "function update_Points() {\n\t\tvar txt_points = document.getElementById(\"txtPoints\");\n\t\tif (loc_visited[current_loc] === 0) {\n\t\t\tpoints += 5;\n\t\t\ttxt_points.value = points;\n\t\t}\n\t}", "title": "" }, { "docid": "ce96f2983e0bc1af12a14b4a2439e6b9", "score": "0.5168837", "text": "function snowflake_offscreen(particle) {\r\n return particle.y > HEIGHT + 5;\r\n}", "title": "" }, { "docid": "e42eb5283aa4a56ed97d49cad890dd85", "score": "0.51623636", "text": "show(){\r\n if(this.dot){\r\n if(!this.eaten){//draw dot if not eaten\r\n fill(255, 255, 0);\r\n noStroke();\r\n ellipse(this.pos.x, this.pos.y, 3, 3);\r\n }\r\n }else if(this.bigDot){\r\n if(!this.eaten){\r\n fill(255, 255, 0);\r\n noStroke();\r\n ellipse(this.pos.x, this.pos.y, 6, 6);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "5bf2c6ff1c12023fee28bf53ba4fd109", "score": "0.5158551", "text": "isInfectious() {\n return this.status == Point.INFECTIOUS1 || this.status == Point.INFECTIOUS2\n }", "title": "" }, { "docid": "a5190eea961830a1b655f48994e48e86", "score": "0.51559126", "text": "function tabulatePoints(){\n totalPoints = 0\n resourcePoints = 0\n resourcePoints = ((totalCrew * 2000) + (totalFuel * 1000));\n totalPoints += inGamePoints + resourcePoints;\n if(totalPoints < 0){\n totalPoints = 0;\n }\n document.getElementById(\"current-score-h5\").innerHTML = `Your current score is ${totalPoints}`;\n return totalPoints;\n}", "title": "" }, { "docid": "489f9e4e38e8a64bda19d3102e5d82fa", "score": "0.5155537", "text": "perdre(points=1)\n {\n let me=this;\n me.score-=points;\n if (me.score > 0)\n {\n me._scoreText.setText('Ossements: ' + me.score);\n }\n else if (me.score < 0)\n {\n me.score = 0;\n me._scoreText.setText('Ossements: ' + me.score);\n }\n else\n {\n me.score = 0;\n }\n }", "title": "" }, { "docid": "83e46f424269e5155fecabf076150ab2", "score": "0.5149105", "text": "function displayPace() {\n var paceDiv = document.getElementById(\"paceTB\");\n if (paceDiv.style.display === \"block\") {\n paceDiv.style.display = \"none\";\n } else {\n paceDiv.style.display = \"block\";\n }\n }", "title": "" }, { "docid": "946712ce0252ab9da82a9639152c711b", "score": "0.5146301", "text": "function display() {\n return totalTime.toFixed(3);\n}", "title": "" }, { "docid": "d42d755927e5f7bf968f4018e7f25a71", "score": "0.51393443", "text": "numbersToShowSinceLast(time) {\n\n // Start out showing one block per second\n if (this.numToShowPerSecond === undefined)\n this.numToShowPerSecond = 1;\n\n // lastTime will track the last time blocks were rendered to the screen.\n if (this.lastTime === undefined) {\n this.lastTime = time;\n return 0;\n }\n\n // Calculate how often (in milliseconds) to show blocks and use this to figure out how many\n // blocks should be rendered from the last time blocks were rendered. Could be none, could be a\n // lot.\n const howOften = 1000.0 / this.numToShowPerSecond;\n const result = Math.floor((time - this.lastTime) / howOften);\n\n // If we should render at least one block then update lastTime and change the number of blocks\n // to per second to increase the rate a bit. Keep increasing the rate each time for an\n // exponential effect.\n if (result > 0) {\n this.lastTime = time;\n\n if (this.numToShowPerSecond < 1e5)\n this.numToShowPerSecond = this.numToShowPerSecond / 0.92;\n }\n\n return result;\n }", "title": "" }, { "docid": "5d5aef21ed5c5348971dffb9813ceb97", "score": "0.51378", "text": "function checkspeed(speed)\r\n{\r\n const speedlimit=70;\r\n const kmperpoint=5;\r\n if (speed<speedlimit+kmperpoint)\r\n console.log('Ok')\r\n else{\r\n const points=Math.floor((speed-speedlimit)/kmperpoint);\r\n if(points>=12)\r\n console.log('suspended');\r\n else\r\n console.log(points);\r\n }\r\n /* let counter;\r\n let point=0;\r\n if (speed <=70)\r\n console.log('OK');\r\n else if (speed>=75)\r\n {counter=speed\r\n while(counter<=speed)\r\n {\r\n point+=1;\r\n counter+=5;\r\n } \r\n if (point<12)\r\n console.log(point) ;\r\n else\r\n console.log('Licesnce Suspemded');\r\n }*/\r\n\r\n}", "title": "" }, { "docid": "5e135b266007c36cf0c711446abf6e95", "score": "0.5132994", "text": "function points() {\n if (ball.isOffScreen() === 1) {\n // Ball goes off left of screen\n // Darken background towards night by increasing array index\n // Increase right paddle points\n activeColor ++;\n rightPaddle.points ++;\n }\n else if (ball.isOffScreen() === 2) {\n // Ball goes off right of screen\n // Lighten background towards day by decreasing array index\n // Increase left paddle points\n activeColor --;\n leftPaddle.points ++;\n }\n\n // Game over if either paddle gains maximum points\n // by moving through backgroundColor array (achieving day or night)\n if (activeColor === 0 || activeColor === backgroundColor.length - 1) {\n gameIsOver = true;\n }\n}", "title": "" }, { "docid": "986cae577a635da08d46e8096532dda0", "score": "0.51275903", "text": "onClick(evt, point) {\n // test if results.arr object is empty\n if (Object.keys(results.arr).length !== 0 && results.arr.constructor === Object) {\n const index = point[0]._index;\n const altitude = dataset2.data[index].y * 1000; // [m] it's monotonous unlike velocity array\n let time = everpolate.linear(altitude, results.arr.alt, results.arr.t)[0];\n time = Math.round(time * 100) / 100; // round to 2 decimal places\n G.setTime(time); // sets the time of the simulation\n }\n }", "title": "" }, { "docid": "2ba74809a8de6b791e7301851b8461ab", "score": "0.51263815", "text": "function showTime() {\n if (animInterval) return; // in animation - quit\n var d = new Date();\n var hours = d.getHours();\n if (is12Hour) hours = ((hours + 11) % 12) + 1;\n var t = (\" \"+hours).substr(-2)+\":\"+\n (\"0\"+d.getMinutes()).substr(-2);\n var l = lastTime;\n // same - don't animate\n if (t==l || l==\"-----\") {\n drawDigits(l,t,0);\n drawEverythingElse();\n lastTime = t;\n return;\n }\n var n = 0;\n animInterval = setInterval(function() {\n n += 1/10;\n if (n>=1) {\n n=1;\n clearInterval(animInterval);\n animInterval = undefined;\n }\n drawDigits(l,t,n);\n }, 20);\n lastTime = t;\n}", "title": "" }, { "docid": "e9ee69e95f3eb326f9413487a67caaec", "score": "0.51252645", "text": "checkPosition() {\n if(dist(this.xPos, this.yPos, this.startX, this.startY) > this.fireRadius || this.surviveTime == 0) {\n this.inDisplay = false;\n }\n }", "title": "" }, { "docid": "569728d46cf909e9f10cebcfd0c2ed24", "score": "0.51240337", "text": "function showWinner(winner) {\n\t\tif (winner == 'player') {\n\t\t\tplayerPoints++;\n\t\t\tgameResult.innerText = nameInput.value + \" + 1 point\";\n\t\t\tplayerPointsHeader.innerText = playerPoints;\n\t\t} else if (winner == 'computer') {\n\t\t\tcomputerPoints++;\n\t\t\tgameResult.innerText = \"computer + 1 point\";\n\t\t\tcomputerPointsHeader.innerText = computerPoints;\n\t\t} else if (winner == 'draw') {\n\t\t\tgameResult.innerText = 'Draw!';\n\t\t}\n\t\tcalculatePoints();\n\t}", "title": "" }, { "docid": "df765a7c98b4edba6ef8c0ec762cc3fc", "score": "0.5122881", "text": "function comparePoints(){\n let points = document.getElementsByClassName(\"hand-points\");\n\n let dpoint = points[0].innerText;\n let ppoint = points[1].innerText;\n\n if(ppoint > dpoint && ppoint <= 21 || dpoint > 21){\n //Just display the message.\n //Points already updated on checkDealerBusted function\n if(dpoint > 21){\n //Display message\n winMessage();\n \n //Display message and update points\n } else{\n //Display message\n winMessage();\n \n // Updating points\n let winContainer = document.getElementById('win');\n let score = parseInt(winContainer.innerText);\n score += 1;\n winContainer.innerText = score;\n } \n \n } else if(dpoint > ppoint && dpoint <= 21 || ppoint > 21){\n //Display message\n loseMessage();\n\n // Updating points\n let loseContainer = document.getElementById('lose');\n let score = parseInt(loseContainer.innerText);\n score += 1;\n loseContainer.innerText = score;\n\n } else{\n //Display message\n tieMessage();\n \n //Updating points\n let tieContainer = document.getElementById('tie');\n let score = parseInt(tieContainer.innerText);\n score += 1;\n tieContainer.innerText = score;\n }\n}", "title": "" }, { "docid": "f68a1edd242b1be26ccd1a2c30b3965b", "score": "0.5122677", "text": "function displaySeconds() {\n quizTimerP.innerHTML = elapsedSeconds;\n elapsedSeconds++;\n \n // if the time ends and the user hasn't answered, the next Quiz object is loaded, the score of that question is 0, counter starts over\n if (elapsedSeconds > 20) {\n getNextQuestion();\n score += 0;\n elapsedSeconds = 1;\n }\n}", "title": "" }, { "docid": "9e3269b276d5427229bb0c37effe7ae6", "score": "0.5117164", "text": "function showTime() {\n if (counter_timer < winner_time) {\n POINTS.innerHTML = '<h2 class=\"points\">Your score is ' + counter_timer + ' seconds!</h2>';\n counter_timer += 1;\n }\n else {\n POINTS.innerHTML = 'Reload page if you want play again. ;)';\n }\n}", "title": "" }, { "docid": "9b4827c270436c653c8bc42c63ce00ec", "score": "0.51065767", "text": "function betterThanAverage(classPoints, yourPoints) {\n let avg, sum = 0;\n for (let i = 0; i < classPoints.length; i++) {\n sum += classPoints[i];\n }\n avg = sum / classPoints.length;\n return (avg < yourPoints) ? true : false;\n}", "title": "" }, { "docid": "3108bdaa6643c6909a135ca9a1db19b7", "score": "0.50994134", "text": "function renderSummaryNumbers() {\n var totalPoints = sumPoints(jsonData[0].axes);\n $('#current-points').text(totalPoints);\n\n var p = totalPoints\n while (p >= 0) {\n if (pointsToLevels[p]) {\n $('#current-level').text(pointsToLevels[p]);\n break;\n }\n p--;\n }\n\n var actualPoints = Object.keys(pointsToLevels)\n var maxPoints = actualPoints[actualPoints.length - 1];\n var pointsNeeded;\n p = totalPoints + 1;\n while (p <= maxPoints) {\n if (pointsToLevels[p]) {\n pointsNeeded = p - totalPoints;\n break;\n }\n p++;\n }\n $('#points-to-next-level').text(pointsNeeded || 'n/a');\n}", "title": "" }, { "docid": "815aac8235d1f8a0cccf59fcc4094bde", "score": "0.50992197", "text": "function showTime() {\n\n 'use strict';\n // define my variables of time function \n var timing = document.getElementById('timing'),\n now = new Date(),\n hours = now.getHours(),\n minut = now.getMinutes(),\n secondes = now.getSeconds();\n\n if (hours < 10) { hours = \"0\" + hours; }\n if (minut < 10) { minut = \"0\" + minut; }\n if (secondes < 10) { secondes = \"0\" + secondes; }\n timing.textContent = hours + \":\" + minut + \":\" + secondes;\n}", "title": "" }, { "docid": "1d8fe179e823f8bbfca32c5324339a33", "score": "0.50981754", "text": "function render() {\n game.debug.text('Time Left: ' + timer.duration.toFixed(0)/1000, 50, 50);\n\t\tgame.debug.text('Points: '+points, 62, 62);\n game.debug.text('Use arrow keys to move the knife to each organ then to the operating table', 10, 10);\n game.debug.text('You get more points the faster you get each organ', 22, 22);\n game.debug.text('You lose points if you hit the sensitive black tissue', 35, 35)\n }", "title": "" }, { "docid": "bac2e9ccc9f6a12649d8b54bf5aa5520", "score": "0.50908935", "text": "showInterests() {\n return (this.format != 'a-z' && (this.includeInterests || (!this.filterable && this.format == 'picture')));\n }", "title": "" } ]
86e14d63446e8b58a861e6ca1fc2f952
Creates a testing connections options based on the configuration in the ormconfig.json and given options that can override some of its configuration for the testspecific use case.
[ { "docid": "c1cd101e450db4d11e5535d89b9c1a3c", "score": "0.8269541", "text": "function setupTestingConnections(options) {\n var ormConfigConnectionOptionsArray = getTypeOrmConfig();\n if (!ormConfigConnectionOptionsArray.length)\n throw new Error(\"No connections setup in ormconfig.json file. Please create configurations for each database type to run tests.\");\n return ormConfigConnectionOptionsArray\n .filter(function (connectionOptions) {\n if (connectionOptions.skip === true)\n return false;\n if (options && options.enabledDrivers && options.enabledDrivers.length)\n return options.enabledDrivers.indexOf(connectionOptions.type) !== -1; // ! is temporary\n if (connectionOptions.disabledIfNotEnabledImplicitly === true)\n return false;\n return true;\n })\n .map(function (connectionOptions) {\n var newOptions = Object.assign({}, connectionOptions, {\n name: options && options.name ? options.name : connectionOptions.name,\n entities: options && options.entities ? options.entities : [],\n migrations: options && options.migrations ? options.migrations : [],\n subscribers: options && options.subscribers ? options.subscribers : [],\n dropSchema: options && options.dropSchema !== undefined ? options.dropSchema : false,\n cache: options ? options.cache : undefined,\n });\n if (options && options.driverSpecific)\n newOptions = Object.assign({}, options.driverSpecific, newOptions);\n if (options && options.schemaCreate)\n newOptions.synchronize = options.schemaCreate;\n if (options && options.schema)\n newOptions.schema = options.schema;\n if (options && options.logging !== undefined)\n newOptions.logging = options.logging;\n if (options && options.__dirname)\n newOptions.entities = [options.__dirname + \"/entity/*{.js,.ts}\"];\n if (options && options.__dirname)\n newOptions.migrations = [options.__dirname + \"/migration/*{.js,.ts}\"];\n if (options && options.namingStrategy)\n newOptions.namingStrategy = options.namingStrategy;\n return newOptions;\n });\n}", "title": "" } ]
[ { "docid": "09ea70c90664052ca2ba6acceb6f03ec", "score": "0.65619266", "text": "function createTestingConnections(options) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var connections;\n var _this = this;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, index_1.createConnections(setupTestingConnections(options))];\n case 1:\n connections = _a.sent();\n return [4 /*yield*/, Promise.all(connections.map(function (connection) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\n var databases, queryRunner, schemaPaths_1, schema;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n databases = [];\n connection.entityMetadatas.forEach(function (metadata) {\n if (metadata.database && databases.indexOf(metadata.database) === -1)\n databases.push(metadata.database);\n });\n queryRunner = connection.createQueryRunner();\n return [4 /*yield*/, PromiseUtils_1.PromiseUtils.runInSequence(databases, function (database) { return queryRunner.createDatabase(database, true); })];\n case 1:\n _a.sent();\n if (!(connection.driver instanceof PostgresDriver_1.PostgresDriver || connection.driver instanceof SqlServerDriver_1.SqlServerDriver)) return [3 /*break*/, 3];\n schemaPaths_1 = [];\n connection.entityMetadatas\n .filter(function (entityMetadata) { return !!entityMetadata.schemaPath; })\n .forEach(function (entityMetadata) {\n var existSchemaPath = schemaPaths_1.find(function (path) { return path === entityMetadata.schemaPath; });\n if (!existSchemaPath)\n schemaPaths_1.push(entityMetadata.schemaPath);\n });\n schema = connection.driver.options.schema;\n if (schema && schemaPaths_1.indexOf(schema) === -1)\n schemaPaths_1.push(schema);\n return [4 /*yield*/, PromiseUtils_1.PromiseUtils.runInSequence(schemaPaths_1, function (schemaPath) { return queryRunner.createSchema(schemaPath, true); })];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3: return [4 /*yield*/, queryRunner.release()];\n case 4:\n _a.sent();\n return [2 /*return*/];\n }\n });\n }); }))];\n case 2:\n _a.sent();\n return [2 /*return*/, connections];\n }\n });\n });\n}", "title": "" }, { "docid": "318a2f4f2aade4d47a34d124f48085ce", "score": "0.5916008", "text": "createAndConnect(connectionOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n // if connection options are given, then create connection from them\n if (connectionOptions && connectionOptions instanceof Object) {\n return this.createAndConnectByConnectionOptions(connectionOptions);\n }\n // if connection name is specified then explicitly try to load connection options from it\n // if (typeof optionsOrConnectionNameFromConfig === \"string\")\n // return this.createFromConfigAndConnect(optionsOrConnectionNameFromConfig || \"default\", ormConfigPath);\n // if driver type is set in environment variables then try to create connection from env variables\n // if (this.hasDefaultConfigurationInEnvironmentVariables())\n // return this.createFromEnvAndConnect();\n throw new CannotDetermineConnectionOptionsError();\n });\n }", "title": "" }, { "docid": "a528653d66a95df1e1a94d19295082fa", "score": "0.58472794", "text": "create(options) {\n const logger = new Logger(options.logging || {});\n const driver = this.createDriver(options.driver, logger);\n const connection = this.createConnection(options.name || \"default\", driver, logger);\n // import entity schemas\n if (options.entitySchemas) {\n const [directories, classes] = this.splitStringsAndClasses(options.entitySchemas);\n connection\n .importEntitySchemas(classes);\n // .importEntitySchemaFromDirectories(directories);\n }\n // import entities\n if (options.entities) {\n const [directories, classes] = this.splitStringsAndClasses(options.entities);\n connection\n .importEntities(classes);\n // .importEntitiesFromDirectories(directories);\n }\n // import subscriber\n if (options.subscribers) {\n const [directories, classes] = this.splitStringsAndClasses(options.subscribers);\n connection\n .importSubscribers(classes);\n // .importSubscribersFromDirectories(directories);\n }\n // import naming strategies\n if (options.namingStrategies) {\n const [directories, classes] = this.splitStringsAndClasses(options.namingStrategies);\n connection\n .importNamingStrategies(classes);\n // .importNamingStrategiesFromDirectories(directories);\n }\n // set naming strategy to be used for this connection\n if (options.usedNamingStrategy)\n connection.useNamingStrategy(options.usedNamingStrategy);\n return connection;\n }", "title": "" }, { "docid": "a9302e4f432ff52168a59ee44e07a4b5", "score": "0.58334434", "text": "static _defineOptions({ connectionTimeout, operationTimeout, url, host, port, db, pass }) {\n const parsedOptions = {\n connectionTimeout, operationTimeout, url, host, port, db, pass\n };\n\n return merge({}, DEFAULT_OPTIONS, parsedOptions);\n }", "title": "" }, { "docid": "4d2b705186265e2c9222cb9e61505660", "score": "0.5770017", "text": "createAndConnectToAll(optionsOrOrmConfigFilePath) {\n return __awaiter(this, void 0, void 0, function* () {\n // if connection options are given, then create connection from them\n if (optionsOrOrmConfigFilePath && optionsOrOrmConfigFilePath instanceof Array)\n return Promise.all(optionsOrOrmConfigFilePath.map(options => {\n return this.createAndConnectByConnectionOptions(options);\n }));\n // if connection name is specified then explicitly try to load connection options from it\n // if (typeof optionsOrOrmConfigFilePath === \"string\")\n // return this.createFromConfigAndConnectToAll(optionsOrOrmConfigFilePath as string);\n // if driver type is set in environment variables then try to create connection from env variables\n // if (this.hasDefaultConfigurationInEnvironmentVariables())\n // return [await this.createFromEnvAndConnect()];\n throw new CannotDetermineConnectionOptionsError();\n });\n }", "title": "" }, { "docid": "95396cff2f2f81339308379d55ffb0fb", "score": "0.56642205", "text": "function setupSingleTestingConnection(driverType, options) {\n var testingConnections = setupTestingConnections({\n name: options.name ? options.name : undefined,\n entities: options.entities ? options.entities : [],\n subscribers: options.subscribers ? options.subscribers : [],\n dropSchema: options.dropSchema ? options.dropSchema : false,\n schemaCreate: options.schemaCreate ? options.schemaCreate : false,\n enabledDrivers: [driverType],\n cache: options.cache,\n schema: options.schema ? options.schema : undefined,\n namingStrategy: options.namingStrategy ? options.namingStrategy : undefined\n });\n if (!testingConnections.length)\n return undefined;\n return testingConnections[0];\n}", "title": "" }, { "docid": "cc0115c04ead70ca553736aeae4f8367", "score": "0.5594181", "text": "function initConnection(testMode) {\n pool = new Pool({\n user: 'root',\n host: 'localhost',\n database: global.testMode ? 'pwd_manager_test' : 'pwd_manager',\n password: 'password',\n port: 5432,\n });\n}", "title": "" }, { "docid": "6ba9c95b53e5c47bbc5a1c535b19e643", "score": "0.5538763", "text": "_addConfigOptions(options: Config, qb: QueryBuilder) {\n const { orderBy, descending, groupBy, limit, offset } = options;\n const exists = obj => typeof obj !== 'undefined' && obj !== null;\n\n // Add grouping\n if (exists(groupBy)) qb.group(groupBy);\n\n // Add sorting\n if (exists(orderBy)) qb.order(orderBy, !descending);\n\n // Add offset\n if (exists(offset)) qb.offset(offset);\n\n // Add limit\n if (exists(limit)) qb.limit(limit);\n }", "title": "" }, { "docid": "dcc35c7d21d2ba8a211466487d16ef1c", "score": "0.54432356", "text": "getConnectionOptions() {\n return this.options.authInfo.getConnectionOptions();\n }", "title": "" }, { "docid": "42d631cb7359dd88bd1ca6336041de83", "score": "0.54055035", "text": "function getOptions(grunt) {\n // node_modules/grunt-sequelize/tasks\n var dbPath = path.normalize(path.join(__dirname, '../../../db'));\n\n return _.defaults(grunt.config.get('sequelize.options'), {\n config: path.join(dbPath, 'config.json'),\n migrationsPath: path.join(dbPath, 'migrations')\n });\n}", "title": "" }, { "docid": "aeacc1aaab3bf6dfd2ff54d243be776a", "score": "0.5372024", "text": "setTestOptions (callback) {\n\t\tthis.teamOptions.creatorIndex = 1;\n\t\t/*\n\t\tthis.streamOptions.creatorIndex = 1;\n\t\tif (this.streamType === 'team stream') {\n\t\t\tObject.assign(this.streamOptions, {\n\t\t\t\ttype: 'channel',\n\t\t\t\tisTeamStream: true\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t\tthis.streamOptions.type = this.streamType || 'channel';\n\t\t}\n\t\t*/\n\t\tif (!this.goPostless) {\n\t\t\tObject.assign(this.postOptions, {\n\t\t\t\tcreatorIndex: 0,\n\t\t\t\twantCodemark: true,\n\t\t\t\tcodemarkType: this.codemarkType || 'comment'\n\t\t\t});\n\t\t}\n\t\tcallback();\n\t}", "title": "" }, { "docid": "44ff4141f845d506ca214c1fc1a4df14", "score": "0.537121", "text": "static async create(options) {\n const configAggregator = options.configAggregator || (await configAggregator_1.ConfigAggregator.create());\n const versionFromConfig = ts_types_1.asString(configAggregator.getInfo('apiVersion').value);\n const baseOptions = {\n // Set the API version obtained from the config aggregator.\n // Will use jsforce default if undefined.\n version: versionFromConfig,\n callOptions: {\n client: clientId,\n },\n };\n // Get connection options from auth info and create a new jsForce connection\n options.connectionOptions = Object.assign(baseOptions, options.authInfo.getConnectionOptions());\n const conn = new this(options);\n await conn.init();\n if (!versionFromConfig) {\n await conn.useLatestApiVersion();\n }\n return conn;\n }", "title": "" }, { "docid": "a382ac2c3fe071210ecb6c3453e59535", "score": "0.5343353", "text": "function constructorShouldSetOptions() {\n expect(new Ginseng({ url: \"/genmaicha\" }).options)\n .toEqual({\n url: {\n baseline: \"/genmaicha/baseline\",\n snapshot: \"/genmaicha/snapshot\"\n }\n })\n}", "title": "" }, { "docid": "625fe6614584cac17a8839766fccef05", "score": "0.5259834", "text": "constructor(options) {\n this.options = options;\n this.connection = mysql.createConnection({\n host: this.options.host,\n port: this.options.port,\n user: this.options.user,\n password: this.options.password,\n database: 'information_schema',\n });\n }", "title": "" }, { "docid": "95c9d4a6eedc7b277938f979e2c72cdd", "score": "0.5236724", "text": "function createConnections(options) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\n var connections;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!options) return [3 /*break*/, 2];\n return [4 /*yield*/, new _connection_ConnectionOptionsReader__WEBPACK_IMPORTED_MODULE_6__[\"ConnectionOptionsReader\"]().all()];\n case 1:\n options = _a.sent();\n _a.label = 2;\n case 2:\n connections = options.map(function (options) { return getConnectionManager().create(options); });\n return [2 /*return*/, Promise.all(connections.map(function (connection) { return connection.connect(); }))];\n }\n });\n });\n}", "title": "" }, { "docid": "33af2d24da37d367987532d7cb3b0af8", "score": "0.5163828", "text": "_addDefaultsToExecOpts(options) {\n options.connection = this;\n if (options.keepInStmtCache === undefined)\n options.keepInStmtCache = true;\n settings.addToOptions(options,\n \"autoCommit\",\n \"dbObjectAsPojo\",\n \"fetchArraySize\",\n \"fetchTypeHandler\",\n \"maxRows\",\n \"outFormat\",\n \"prefetchRows\");\n }", "title": "" }, { "docid": "a47dbfe519c9beb776b987108f7a9c8f", "score": "0.51433676", "text": "static get schemaOptions () {\n return {}\n }", "title": "" }, { "docid": "1da2189bc597713316ddd91af871d3ed", "score": "0.5141495", "text": "function constructorShouldUseDefaultOptions() {\n expect(new Ginseng().options)\n .toEqual({\n url: {\n baseline: \"/_ginseng/baseline\",\n snapshot: \"/_ginseng/snapshot\"\n }\n })\n}", "title": "" }, { "docid": "ac26653a8b31c0d9d1b08e77a87fbc21", "score": "0.5091559", "text": "setupCustomEntityClientConsts() {\n this.context.protractorTests = true;\n }", "title": "" }, { "docid": "d558b8a52d60ffe392f47da1b62ad098", "score": "0.50862104", "text": "mergeConnection(options, connection) {\n let mergedOptions = options.setDefaults(connection);\n return mergedOptions;\n }", "title": "" }, { "docid": "d7337b4dff8242b2ae93ef1cc70cfee9", "score": "0.5038091", "text": "function getOptions(spec) {\n const options = genBaseOptions()\n\n // set proxies\n if (spec.useProxy) {\n log.info(`Proxies list size: ${_.size(proxies)}`)\n if (_.isEmpty(proxies)) {\n log.error('spec.useProxy is true but no proxy is available, shutting down for safety')\n process.exit()\n }\n _.assign(options, { proxy: _.first(proxies) })\n }\n\n // fix phantomjs driver shim error\n if (spec.driver === 'phantomjs') {\n _.assign(options, { webSecurity: false })\n }\n\n rotateAssets()\n return options\n}", "title": "" }, { "docid": "eeef724d014e32b4cbff4dfcccbc2957", "score": "0.5026235", "text": "constructor(options = {}) {\n this.serverSettings =\n options.serverSettings || serverconnection_1.ServerConnection.makeSettings();\n }", "title": "" }, { "docid": "69b16f5b56d4725016a15f517f287e1a", "score": "0.4986847", "text": "function getConnectionOptions(connectionName) {\n if (connectionName === void 0) { connectionName = \"default\"; }\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n return [2 /*return*/, new _connection_ConnectionOptionsReader__WEBPACK_IMPORTED_MODULE_6__[\"ConnectionOptionsReader\"]().get(connectionName)];\n });\n });\n}", "title": "" }, { "docid": "33f428164069aa1616ab74535538f979", "score": "0.4984317", "text": "function createConfig(options) {\n const config = options;\n options.set = (newConfig) => {\n deepMerge_1.deepMerge(options, newConfig);\n };\n return config;\n}", "title": "" }, { "docid": "81a40181b6b8aca68e49132318c2668c", "score": "0.49750558", "text": "function withTestDatabase(tests) {\n const name = `ac_test__${Date.now()}_${Math.floor(Math.random() * 100)}`;\n\n beforeAll(() => {\n return db\n .raw('CREATE DATABASE ??', [name])\n .then(() => {\n let _config = _.cloneDeep(config);\n _config.database = name;\n stack.unshift(knex(_config));\n })\n .then(() => {\n return db.migrate.latest({ directory: dirs.migrations });\n })\n .then(() => {\n return db.seed.run({ directory: dirs.seeds });\n });\n });\n\n tests(name);\n\n afterAll(() => {\n return stack.shift().destroy().then(() => {\n return db.raw('DROP DATABASE ??', [name]);\n });\n });\n}", "title": "" }, { "docid": "b570e489e232232c5618d74331be6ad9", "score": "0.49670443", "text": "options (config = {}) {\n return session.options(PRODUCT, config)\n }", "title": "" }, { "docid": "494f96b7090b57b99c74ff078dfc9114", "score": "0.49553904", "text": "function initConfig(config) {\n if (!['postgresql', 'sqlite'].includes(config.db.provider)) {\n throw new Error('Invalid db configuration. Please specify db.provider as either \"sqlite\" or \"postgresql\"');\n }\n\n return _objectSpread(_objectSpread({}, config), {}, {\n lists: applyIdFieldDefaults(config)\n });\n}", "title": "" }, { "docid": "ebfc9a4d426f58d241df5effc5ed7e2a", "score": "0.49547237", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: true, t: testCssPrefix },\n\t\t\t'cssClasses': { r: true, t: testCssClasses }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tconnects: 'connects',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t}\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( !isSet(options[name]) && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, !isSet(options[name]) ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// All recent browsers accept unprefixed transform.\n\t\t// We need -ms- for IE9 and -webkit- for older Android;\n\t\t// Assume use of -webkit- if unprefixed and -ms- are not supported.\n\t\t// https://caniuse.com/#feat=transforms2d\n\t\tvar d = document.createElement(\"div\");\n\t\tvar msPrefix = d.style.msTransform !== undefined;\n\t\tvar noPrefix = d.style.transform !== undefined;\n\n\t\tparsed.transformRule = noPrefix ? 'transform' : (msPrefix ? 'msTransform' : 'webkitTransform');\n\n\t\t// Pips don't move, so we can place them using left/top.\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "ebfc9a4d426f58d241df5effc5ed7e2a", "score": "0.49547237", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: true, t: testCssPrefix },\n\t\t\t'cssClasses': { r: true, t: testCssClasses }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tconnects: 'connects',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t}\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( !isSet(options[name]) && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, !isSet(options[name]) ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// All recent browsers accept unprefixed transform.\n\t\t// We need -ms- for IE9 and -webkit- for older Android;\n\t\t// Assume use of -webkit- if unprefixed and -ms- are not supported.\n\t\t// https://caniuse.com/#feat=transforms2d\n\t\tvar d = document.createElement(\"div\");\n\t\tvar msPrefix = d.style.msTransform !== undefined;\n\t\tvar noPrefix = d.style.transform !== undefined;\n\n\t\tparsed.transformRule = noPrefix ? 'transform' : (msPrefix ? 'msTransform' : 'webkitTransform');\n\n\t\t// Pips don't move, so we can place them using left/top.\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "ebfc9a4d426f58d241df5effc5ed7e2a", "score": "0.49547237", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: true, t: testCssPrefix },\n\t\t\t'cssClasses': { r: true, t: testCssClasses }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tconnects: 'connects',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t}\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( !isSet(options[name]) && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, !isSet(options[name]) ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// All recent browsers accept unprefixed transform.\n\t\t// We need -ms- for IE9 and -webkit- for older Android;\n\t\t// Assume use of -webkit- if unprefixed and -ms- are not supported.\n\t\t// https://caniuse.com/#feat=transforms2d\n\t\tvar d = document.createElement(\"div\");\n\t\tvar msPrefix = d.style.msTransform !== undefined;\n\t\tvar noPrefix = d.style.transform !== undefined;\n\n\t\tparsed.transformRule = noPrefix ? 'transform' : (msPrefix ? 'msTransform' : 'webkitTransform');\n\n\t\t// Pips don't move, so we can place them using left/top.\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "ebfc9a4d426f58d241df5effc5ed7e2a", "score": "0.49547237", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: true, t: testCssPrefix },\n\t\t\t'cssClasses': { r: true, t: testCssClasses }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tconnects: 'connects',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t}\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( !isSet(options[name]) && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, !isSet(options[name]) ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// All recent browsers accept unprefixed transform.\n\t\t// We need -ms- for IE9 and -webkit- for older Android;\n\t\t// Assume use of -webkit- if unprefixed and -ms- are not supported.\n\t\t// https://caniuse.com/#feat=transforms2d\n\t\tvar d = document.createElement(\"div\");\n\t\tvar msPrefix = d.style.msTransform !== undefined;\n\t\tvar noPrefix = d.style.transform !== undefined;\n\n\t\tparsed.transformRule = noPrefix ? 'transform' : (msPrefix ? 'msTransform' : 'webkitTransform');\n\n\t\t// Pips don't move, so we can place them using left/top.\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "ebfc9a4d426f58d241df5effc5ed7e2a", "score": "0.49547237", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: true, t: testCssPrefix },\n\t\t\t'cssClasses': { r: true, t: testCssClasses }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tconnects: 'connects',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t}\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( !isSet(options[name]) && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, !isSet(options[name]) ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// All recent browsers accept unprefixed transform.\n\t\t// We need -ms- for IE9 and -webkit- for older Android;\n\t\t// Assume use of -webkit- if unprefixed and -ms- are not supported.\n\t\t// https://caniuse.com/#feat=transforms2d\n\t\tvar d = document.createElement(\"div\");\n\t\tvar msPrefix = d.style.msTransform !== undefined;\n\t\tvar noPrefix = d.style.transform !== undefined;\n\n\t\tparsed.transformRule = noPrefix ? 'transform' : (msPrefix ? 'msTransform' : 'webkitTransform');\n\n\t\t// Pips don't move, so we can place them using left/top.\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "43e245ea3ebaf1d5fcce39944954df31", "score": "0.49544805", "text": "config(options) {\n Config.set(options);\n }", "title": "" }, { "docid": "f2f6316f69c064236d40279af3ee62d0", "score": "0.49162084", "text": "_setAllSequelizeConnections() {\n this.databaseConfigurations.forEach((configuration) => {\n this.connections.push(instanceCreator.getInstance(configuration));\n });\n }", "title": "" }, { "docid": "70abce87740b94021415638d4351c760", "score": "0.49112606", "text": "setupConfig(options) {\n this.config = {\n append: {\n defaultValue: false,\n environmentVariable: \"JEST_HTML_REPORTER_APPEND\",\n configValue: options.append\n },\n boilerplate: {\n defaultValue: null,\n environmentVariable: \"JEST_HTML_REPORTER_BOILERPLATE\",\n configValue: options.boilerplate\n },\n customScriptPath: {\n defaultValue: null,\n environmentVariable: \"JEST_HTML_REPORTER_CUSTOM_SCRIPT_PATH\",\n configValue: options.customScriptPath\n },\n dateFormat: {\n defaultValue: \"yyyy-mm-dd HH:MM:ss\",\n environmentVariable: \"JEST_HTML_REPORTER_DATE_FORMAT\",\n configValue: options.dateFormat\n },\n executionTimeWarningThreshold: {\n defaultValue: 5,\n environmentVariable: \"JEST_HTML_REPORTER_EXECUTION_TIME_WARNING_THRESHOLD\",\n configValue: options.executionTimeWarningThreshold\n },\n logo: {\n defaultValue: null,\n environmentVariable: \"JEST_HTML_REPORTER_LOGO\",\n configValue: options.logo\n },\n includeFailureMsg: {\n defaultValue: false,\n environmentVariable: \"JEST_HTML_REPORTER_INCLUDE_FAILURE_MSG\",\n configValue: options.includeFailureMsg\n },\n includeConsoleLog: {\n defaultValue: false,\n environmentVariable: \"JEST_HTML_REPORTER_INCLUDE_CONSOLE_LOG\",\n configValue: options.includeConsoleLog\n },\n outputPath: {\n defaultValue: path.join(process.cwd(), \"test-report.html\"),\n environmentVariable: \"JEST_HTML_REPORTER_OUTPUT_PATH\",\n configValue: options.outputPath\n },\n pageTitle: {\n defaultValue: \"Test Report\",\n environmentVariable: \"JEST_HTML_REPORTER_PAGE_TITLE\",\n configValue: options.pageTitle\n },\n theme: {\n defaultValue: \"defaultTheme\",\n environmentVariable: \"JEST_HTML_REPORTER_THEME\",\n configValue: options.theme\n },\n sort: {\n defaultValue: null,\n environmentVariable: \"JEST_HTML_REPORTER_SORT\",\n configValue: options.sort\n },\n statusIgnoreFilter: {\n defaultValue: null,\n environmentVariable: \"JEST_HTML_REPORTER_STATUS_FILTER\",\n configValue: options.statusIgnoreFilter\n },\n styleOverridePath: {\n defaultValue: null,\n environmentVariable: \"JEST_HTML_REPORTER_STYLE_OVERRIDE_PATH\",\n configValue: options.styleOverridePath\n },\n useCssFile: {\n defaultValue: false,\n environmentVariable: \"JEST_HTML_REPORTER_USE_CSS_FILE\",\n configValue: options.useCssFile\n }\n }; // Attempt to collect and assign config settings from jesthtmlreporter.config.json\n\n try {\n const jesthtmlreporterconfig = fs.readFileSync(path.join(process.cwd(), \"jesthtmlreporter.config.json\"), \"utf8\");\n\n if (jesthtmlreporterconfig) {\n const parsedConfig = JSON.parse(jesthtmlreporterconfig);\n\n for (const key of Object.keys(parsedConfig)) {\n if (this.config[key]) {\n this.config[key].configValue = parsedConfig[key];\n }\n }\n\n return;\n }\n } catch (e) {}\n /** do nothing */\n // If above method did not work we attempt to check package.json\n\n\n try {\n const packageJson = fs.readFileSync(path.join(process.cwd(), \"package.json\"), \"utf8\");\n\n if (packageJson) {\n const parsedConfig = JSON.parse(packageJson)[\"jest-html-reporter\"];\n\n for (const key of Object.keys(parsedConfig)) {\n if (this.config[key]) {\n this.config[key].configValue = parsedConfig[key];\n }\n }\n }\n } catch (e) {\n /** do nothing */\n }\n }", "title": "" }, { "docid": "aab2af0b4e82278239005ac733242470", "score": "0.49076667", "text": "function testOptions(options) {\n // To prove a fix for #537, freeze options here.\n // If the object is modified, an error will be thrown.\n // Object.freeze(options);\n\n var parsed = {\n margin: 0,\n limit: 0,\n padding: 0,\n animate: true,\n animationDuration: 300,\n ariaFormat: defaultFormatter,\n format: defaultFormatter\n };\n\n // Tests are executed in the order they are presented here.\n var tests = {\n step: { r: false, t: testStep },\n start: { r: true, t: testStart },\n connect: { r: true, t: testConnect },\n direction: { r: true, t: testDirection },\n snap: { r: false, t: testSnap },\n animate: { r: false, t: testAnimate },\n animationDuration: { r: false, t: testAnimationDuration },\n range: { r: true, t: testRange },\n orientation: { r: false, t: testOrientation },\n margin: { r: false, t: testMargin },\n limit: { r: false, t: testLimit },\n padding: { r: false, t: testPadding },\n behaviour: { r: true, t: testBehaviour },\n ariaFormat: { r: false, t: testAriaFormat },\n format: { r: false, t: testFormat },\n tooltips: { r: false, t: testTooltips },\n keyboardSupport: { r: true, t: testKeyboardSupport },\n documentElement: { r: false, t: testDocumentElement },\n cssPrefix: { r: true, t: testCssPrefix },\n cssClasses: { r: true, t: testCssClasses }\n };\n\n var defaults = {\n connect: false,\n direction: \"ltr\",\n behaviour: \"tap\",\n orientation: \"horizontal\",\n keyboardSupport: true,\n cssPrefix: \"noUi-\",\n cssClasses: {\n target: \"target\",\n base: \"base\",\n origin: \"origin\",\n handle: \"handle\",\n handleLower: \"handle-lower\",\n handleUpper: \"handle-upper\",\n touchArea: \"touch-area\",\n horizontal: \"horizontal\",\n vertical: \"vertical\",\n background: \"background\",\n connect: \"connect\",\n connects: \"connects\",\n ltr: \"ltr\",\n rtl: \"rtl\",\n textDirectionLtr: \"txt-dir-ltr\",\n textDirectionRtl: \"txt-dir-rtl\",\n draggable: \"draggable\",\n drag: \"state-drag\",\n tap: \"state-tap\",\n active: \"active\",\n tooltip: \"tooltip\",\n pips: \"pips\",\n pipsHorizontal: \"pips-horizontal\",\n pipsVertical: \"pips-vertical\",\n marker: \"marker\",\n markerHorizontal: \"marker-horizontal\",\n markerVertical: \"marker-vertical\",\n markerNormal: \"marker-normal\",\n markerLarge: \"marker-large\",\n markerSub: \"marker-sub\",\n value: \"value\",\n valueHorizontal: \"value-horizontal\",\n valueVertical: \"value-vertical\",\n valueNormal: \"value-normal\",\n valueLarge: \"value-large\",\n valueSub: \"value-sub\"\n }\n };\n\n // AriaFormat defaults to regular format, if any.\n if (options.format && !options.ariaFormat) {\n options.ariaFormat = options.format;\n }\n\n // Run all options through a testing mechanism to ensure correct\n // input. It should be noted that options might get modified to\n // be handled properly. E.g. wrapping integers in arrays.\n Object.keys(tests).forEach(function(name) {\n // If the option isn't set, but it is required, throw an error.\n if (!isSet(options[name]) && defaults[name] === undefined) {\n if (tests[name].r) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n }\n\n return true;\n }\n\n tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]);\n });\n\n // Forward pips options\n parsed.pips = options.pips;\n\n // All recent browsers accept unprefixed transform.\n // We need -ms- for IE9 and -webkit- for older Android;\n // Assume use of -webkit- if unprefixed and -ms- are not supported.\n // https://caniuse.com/#feat=transforms2d\n var d = document.createElement(\"div\");\n var msPrefix = d.style.msTransform !== undefined;\n var noPrefix = d.style.transform !== undefined;\n\n parsed.transformRule = noPrefix ? \"transform\" : msPrefix ? \"msTransform\" : \"webkitTransform\";\n\n // Pips don't move, so we can place them using left/top.\n var styles = [[\"left\", \"top\"], [\"right\", \"bottom\"]];\n\n parsed.style = styles[parsed.dir][parsed.ort];\n\n return parsed;\n }", "title": "" }, { "docid": "e7d03e378a87c35b035155fce9d3182f", "score": "0.49076667", "text": "function testOptions(options) {\n // To prove a fix for #537, freeze options here.\n // If the object is modified, an error will be thrown.\n // Object.freeze(options);\n\n var parsed = {\n margin: 0,\n limit: 0,\n padding: 0,\n animate: true,\n animationDuration: 300,\n ariaFormat: defaultFormatter,\n format: defaultFormatter\n };\n\n // Tests are executed in the order they are presented here.\n var tests = {\n step: { r: false, t: testStep },\n start: { r: true, t: testStart },\n connect: { r: true, t: testConnect },\n direction: { r: true, t: testDirection },\n snap: { r: false, t: testSnap },\n animate: { r: false, t: testAnimate },\n animationDuration: { r: false, t: testAnimationDuration },\n range: { r: true, t: testRange },\n orientation: { r: false, t: testOrientation },\n margin: { r: false, t: testMargin },\n limit: { r: false, t: testLimit },\n padding: { r: false, t: testPadding },\n behaviour: { r: true, t: testBehaviour },\n ariaFormat: { r: false, t: testAriaFormat },\n format: { r: false, t: testFormat },\n tooltips: { r: false, t: testTooltips },\n keyboardSupport: { r: true, t: testKeyboardSupport },\n documentElement: { r: false, t: testDocumentElement },\n cssPrefix: { r: true, t: testCssPrefix },\n cssClasses: { r: true, t: testCssClasses }\n };\n\n var defaults = {\n connect: false,\n direction: \"ltr\",\n behaviour: \"tap\",\n orientation: \"horizontal\",\n keyboardSupport: true,\n cssPrefix: \"noUi-\",\n cssClasses: {\n target: \"target\",\n base: \"base\",\n origin: \"origin\",\n handle: \"handle\",\n handleLower: \"handle-lower\",\n handleUpper: \"handle-upper\",\n touchArea: \"touch-area\",\n horizontal: \"horizontal\",\n vertical: \"vertical\",\n background: \"background\",\n connect: \"connect\",\n connects: \"connects\",\n ltr: \"ltr\",\n rtl: \"rtl\",\n draggable: \"draggable\",\n drag: \"state-drag\",\n tap: \"state-tap\",\n active: \"active\",\n tooltip: \"tooltip\",\n pips: \"pips\",\n pipsHorizontal: \"pips-horizontal\",\n pipsVertical: \"pips-vertical\",\n marker: \"marker\",\n markerHorizontal: \"marker-horizontal\",\n markerVertical: \"marker-vertical\",\n markerNormal: \"marker-normal\",\n markerLarge: \"marker-large\",\n markerSub: \"marker-sub\",\n value: \"value\",\n valueHorizontal: \"value-horizontal\",\n valueVertical: \"value-vertical\",\n valueNormal: \"value-normal\",\n valueLarge: \"value-large\",\n valueSub: \"value-sub\"\n }\n };\n\n // AriaFormat defaults to regular format, if any.\n if (options.format && !options.ariaFormat) {\n options.ariaFormat = options.format;\n }\n\n // Run all options through a testing mechanism to ensure correct\n // input. It should be noted that options might get modified to\n // be handled properly. E.g. wrapping integers in arrays.\n Object.keys(tests).forEach(function(name) {\n // If the option isn't set, but it is required, throw an error.\n if (!isSet(options[name]) && defaults[name] === undefined) {\n if (tests[name].r) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n }\n\n return true;\n }\n\n tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]);\n });\n\n // Forward pips options\n parsed.pips = options.pips;\n\n // All recent browsers accept unprefixed transform.\n // We need -ms- for IE9 and -webkit- for older Android;\n // Assume use of -webkit- if unprefixed and -ms- are not supported.\n // https://caniuse.com/#feat=transforms2d\n var d = document.createElement(\"div\");\n var msPrefix = d.style.msTransform !== undefined;\n var noPrefix = d.style.transform !== undefined;\n\n parsed.transformRule = noPrefix ? \"transform\" : msPrefix ? \"msTransform\" : \"webkitTransform\";\n\n // Pips don't move, so we can place them using left/top.\n var styles = [[\"left\", \"top\"], [\"right\", \"bottom\"]];\n\n parsed.style = styles[parsed.dir][parsed.ort];\n\n return parsed;\n }", "title": "" }, { "docid": "e4be958756ce637be0e3b3917322a41d", "score": "0.48767763", "text": "function getSessionOptions() {\n return {\n host : databaseInfo.host,\n port : databaseInfo.port,\n user : databaseInfo.user,\n password : databaseInfo.password,\n database : 'studly_session'\n }\n}", "title": "" }, { "docid": "759224b40eb587e1c012988d00713160", "score": "0.48736995", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tformat: defaultFormatter\n\t\t}, tests;\n\n\t\t// Tests are executed in the order they are presented here.\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\tstacking: 'stacking',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t}\n\t\t};\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider: '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = parsed.ort ? 'top' : 'left';\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "d4315397c278e30a746583004f61a43a", "score": "0.48679426", "text": "getSequelizeConfig(hostAddress) {\n return {\n host: hostAddress,\n dialect: \"postgres\",\n operatorsAliases: false,\n pool: {\n max: 5,\n min: 0,\n acquire: 30000,\n idle: 10000\n }\n };\n }", "title": "" }, { "docid": "0746ec1b3f8d0c1df582c90e87023942", "score": "0.48677596", "text": "constructor(opts = {}) {\n this.mode = opts.mode || \"production\";\n this.db = opts.db;\n this.collection = opts.collection;\n this.categoryEdgeCollection = opts.categoryEdgeCollection;\n }", "title": "" }, { "docid": "7f867e666ed344536c23e957b8b8b988", "score": "0.48518667", "text": "function testOptions ( options ) {\r\n\r\n\t\t// To prove a fix for #537, freeze options here.\r\n\t\t// If the object is modified, an error will be thrown.\r\n\t\t// Object.freeze(options);\r\n\r\n\t\tvar parsed = {\r\n\t\t\tmargin: 0,\r\n\t\t\tlimit: 0,\r\n\t\t\tpadding: 0,\r\n\t\t\tanimate: true,\r\n\t\t\tanimationDuration: 300,\r\n\t\t\tariaFormat: defaultFormatter,\r\n\t\t\tformat: defaultFormatter\r\n\t\t};\r\n\r\n\t\t// Tests are executed in the order they are presented here.\r\n\t\tvar tests = {\r\n\t\t\t'step': { r: false, t: testStep },\r\n\t\t\t'start': { r: true, t: testStart },\r\n\t\t\t'connect': { r: true, t: testConnect },\r\n\t\t\t'direction': { r: true, t: testDirection },\r\n\t\t\t'snap': { r: false, t: testSnap },\r\n\t\t\t'animate': { r: false, t: testAnimate },\r\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\r\n\t\t\t'range': { r: true, t: testRange },\r\n\t\t\t'orientation': { r: false, t: testOrientation },\r\n\t\t\t'margin': { r: false, t: testMargin },\r\n\t\t\t'limit': { r: false, t: testLimit },\r\n\t\t\t'padding': { r: false, t: testPadding },\r\n\t\t\t'behaviour': { r: true, t: testBehaviour },\r\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\r\n\t\t\t'format': { r: false, t: testFormat },\r\n\t\t\t'tooltips': { r: false, t: testTooltips },\r\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\r\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\r\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\r\n\t\t};\r\n\r\n\t\tvar defaults = {\r\n\t\t\t'connect': false,\r\n\t\t\t'direction': 'ltr',\r\n\t\t\t'behaviour': 'tap',\r\n\t\t\t'orientation': 'horizontal',\r\n\t\t\t'cssPrefix' : 'noUi-',\r\n\t\t\t'cssClasses': {\r\n\t\t\t\ttarget: 'target',\r\n\t\t\t\tbase: 'base',\r\n\t\t\t\torigin: 'origin',\r\n\t\t\t\thandle: 'handle',\r\n\t\t\t\thandleLower: 'handle-lower',\r\n\t\t\t\thandleUpper: 'handle-upper',\r\n\t\t\t\thorizontal: 'horizontal',\r\n\t\t\t\tvertical: 'vertical',\r\n\t\t\t\tbackground: 'background',\r\n\t\t\t\tconnect: 'connect',\r\n\t\t\t\tltr: 'ltr',\r\n\t\t\t\trtl: 'rtl',\r\n\t\t\t\tdraggable: 'draggable',\r\n\t\t\t\tdrag: 'state-drag',\r\n\t\t\t\ttap: 'state-tap',\r\n\t\t\t\tactive: 'active',\r\n\t\t\t\ttooltip: 'tooltip',\r\n\t\t\t\tpips: 'pips',\r\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\r\n\t\t\t\tpipsVertical: 'pips-vertical',\r\n\t\t\t\tmarker: 'marker',\r\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\r\n\t\t\t\tmarkerVertical: 'marker-vertical',\r\n\t\t\t\tmarkerNormal: 'marker-normal',\r\n\t\t\t\tmarkerLarge: 'marker-large',\r\n\t\t\t\tmarkerSub: 'marker-sub',\r\n\t\t\t\tvalue: 'value',\r\n\t\t\t\tvalueHorizontal: 'value-horizontal',\r\n\t\t\t\tvalueVertical: 'value-vertical',\r\n\t\t\t\tvalueNormal: 'value-normal',\r\n\t\t\t\tvalueLarge: 'value-large',\r\n\t\t\t\tvalueSub: 'value-sub'\r\n\t\t\t},\r\n\t\t\t'useRequestAnimationFrame': true\r\n\t\t};\r\n\r\n\t\t// AriaFormat defaults to regular format, if any.\r\n\t\tif ( options.format && !options.ariaFormat ) {\r\n\t\t\toptions.ariaFormat = options.format;\r\n\t\t}\r\n\r\n\t\t// Run all options through a testing mechanism to ensure correct\r\n\t\t// input. It should be noted that options might get modified to\r\n\t\t// be handled properly. E.g. wrapping integers in arrays.\r\n\t\tObject.keys(tests).forEach(function( name ){\r\n\r\n\t\t\t// If the option isn't set, but it is required, throw an error.\r\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\r\n\r\n\t\t\t\tif ( tests[name].r ) {\r\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\r\n\t\t});\r\n\r\n\t\t// Forward pips options\r\n\t\tparsed.pips = options.pips;\r\n\r\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\r\n\r\n\t\t// Pre-define the styles.\r\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\r\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\r\n\r\n\t\treturn parsed;\r\n\t}", "title": "" }, { "docid": "39722a15d00d31baa7aa6e9040af6c43", "score": "0.48440772", "text": "function setupDB(options)\n {\n // While already setting up, wait 100ms and retry\n if (self.status === 'setting_up_db') return wait(setupDB, options);\n\n // If already setup, return\n if (self.status === 'ready') return Promise.resolve();\n\n self.status = 'setting_up_db';\n\n const bigquery = BigQuery(\n {\n projectId: options.dbId,\n credentials: JSON.parse(options.credentials)\n });\n\n return bigquery.getDatasets().then((results) =>\n {\n self.dataset = results[0].find((ds) => ds.id === options.dbName);\n if (self.dataset) return;\n\n return bigquery.createDataset(options.dbName).then((results) =>\n {\n self.dataset = results[0];\n });\n }).then(() =>\n {\n self.status = 'ready';\n }).catch((err) =>\n {\n console.error('ERROR:', err);\n self.status = 'error';\n });\n }", "title": "" }, { "docid": "760854552e2aacbbced9fa37e344660a", "score": "0.48405933", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "a2e954faf206c29db80097b93b472c18", "score": "0.4827253", "text": "function setupDatabases(callback) {\n context.directionsHelper = require('./directions-helper');\n context.directionsHelper.init(context, callback);\n\tcontext.locationDb = require('./location-database');\n\tcontext.locationDb.init(context, callback);\n context.userDb = require('./user-database');\n context.userDb.init(context, callback);\n}", "title": "" }, { "docid": "c5462aafc8e4948bc1c643af4b9e9831", "score": "0.4822385", "text": "function buildOptions (argv) {\n const optionsMask = 'name,migrationsDirectory,relativeTo,migrationsTable,host,port,db,user,username,password,authKey,driver,discovery,pool,cursor,servers,ssl,i,ignoreTimestamp,to,extension'\n const envVars = Mask(process.env, optionsMask)\n const file = Mask(readOptionsFile(argv), optionsMask)\n const args = Mask(argv, optionsMask)\n\n // normalize the -i / --ignore-timestamp option to result to ignoreTimestamp option\n // for arguments input schema validation\n if (args.hasOwnProperty('i')) {\n delete args.i\n args.ignoreTimestamp = true\n }\n\n return Object.assign({}, envVars, file, args)\n}", "title": "" }, { "docid": "cc4f5ef02bb10db853942f91591aedba", "score": "0.48205534", "text": "configure(config) {\n config = config.setDefaults(this._defaultConfig);\n this._connectionResolver.configure(config);\n let collection = config.getAsStringWithDefault('collection', this._collection);\n if (collection != this._collection && this._schema != null) {\n this._collection = collection;\n this._schema.set('collection', collection);\n this._model = this._model = this._connection.model(collection, this._schema);\n }\n this._options = this._options.override(config.getSection(\"options\"));\n }", "title": "" }, { "docid": "a2622186c6b9459888f874a170f60d7c", "score": "0.48186633", "text": "function withMockDatabase(tests) {\n let mocks = {\n _query: jest.fn(() => {\n return Promise.reject(new Error('Not implemented'));\n }),\n _stream: jest.fn(() => {\n return Promise.reject(new Error('Not implemented'));\n }),\n acquireConnection: jest.fn(() => Promise.resolve({})),\n releaseConnection: jest.fn(() => Promise.resolve()),\n };\n\n beforeAll(() => {\n stack.ensure();\n // Override prototype methods with instance properties.\n _.each(mocks, (val, key) => {\n db.client[key] = val;\n });\n });\n\n tests(mocks);\n\n afterAll(() => {\n // Remove instance properties to restore prototype versions.\n _.each(mocks, (val, key) => {\n delete db.client[key];\n });\n });\n}", "title": "" }, { "docid": "5eacf7de330c0cf65c47f5d4a3a40ef4", "score": "0.48168543", "text": "bootstrapTests() {\n global.app = require('./app');\n app.bot.jobs = {};\n app.raven = null;\n\n this.prepareConfig(false);\n app.config.environment = 'testing';\n app.config.database = {\n type: 'sqlite3',\n filename: ':memory:'\n };\n\n this.prepareDiscordie();\n\n return this.prepareDatabase();\n }", "title": "" }, { "docid": "726a070c6aab26d64c6b7099e129a5c1", "score": "0.48099497", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tariaFormat: defaultFormatter,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'multitouch': { r: true, t: testMultitouch },\n\t\t\t'ariaFormat': { r: false, t: testAriaFormat },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'multitouch': false,\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// AriaFormat defaults to regular format, if any.\n\t\tif ( options.format && !options.ariaFormat ) {\n\t\t\toptions.ariaFormat = options.format;\n\t\t}\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "1f39a921478a460748eb9111c55c0300", "score": "0.47994208", "text": "function testOptions ( options ) {\n\n\t\t// To prove a fix for #537, freeze options here.\n\t\t// If the object is modified, an error will be thrown.\n\t\t// Object.freeze(options);\n\n\t\tvar parsed = {\n\t\t\tmargin: 0,\n\t\t\tlimit: 0,\n\t\t\tpadding: 0,\n\t\t\tanimate: true,\n\t\t\tanimationDuration: 300,\n\t\t\tformat: defaultFormatter\n\t\t};\n\n\t\t// Tests are executed in the order they are presented here.\n\t\tvar tests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'animate': { r: false, t: testAnimate },\n\t\t\t'animationDuration': { r: false, t: testAnimationDuration },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'limit': { r: false, t: testLimit },\n\t\t\t'padding': { r: false, t: testPadding },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'format': { r: false, t: testFormat },\n\t\t\t'tooltips': { r: false, t: testTooltips },\n\t\t\t'cssPrefix': { r: false, t: testCssPrefix },\n\t\t\t'cssClasses': { r: false, t: testCssClasses },\n\t\t\t'useRequestAnimationFrame': { r: false, t: testUseRaf }\n\t\t};\n\n\t\tvar defaults = {\n\t\t\t'connect': false,\n\t\t\t'direction': 'ltr',\n\t\t\t'behaviour': 'tap',\n\t\t\t'orientation': 'horizontal',\n\t\t\t'cssPrefix' : 'noUi-',\n\t\t\t'cssClasses': {\n\t\t\t\ttarget: 'target',\n\t\t\t\tbase: 'base',\n\t\t\t\torigin: 'origin',\n\t\t\t\thandle: 'handle',\n\t\t\t\thandleLower: 'handle-lower',\n\t\t\t\thandleUpper: 'handle-upper',\n\t\t\t\thorizontal: 'horizontal',\n\t\t\t\tvertical: 'vertical',\n\t\t\t\tbackground: 'background',\n\t\t\t\tconnect: 'connect',\n\t\t\t\tltr: 'ltr',\n\t\t\t\trtl: 'rtl',\n\t\t\t\tdraggable: 'draggable',\n\t\t\t\tdrag: 'state-drag',\n\t\t\t\ttap: 'state-tap',\n\t\t\t\tactive: 'active',\n\t\t\t\ttooltip: 'tooltip',\n\t\t\t\tpips: 'pips',\n\t\t\t\tpipsHorizontal: 'pips-horizontal',\n\t\t\t\tpipsVertical: 'pips-vertical',\n\t\t\t\tmarker: 'marker',\n\t\t\t\tmarkerHorizontal: 'marker-horizontal',\n\t\t\t\tmarkerVertical: 'marker-vertical',\n\t\t\t\tmarkerNormal: 'marker-normal',\n\t\t\t\tmarkerLarge: 'marker-large',\n\t\t\t\tmarkerSub: 'marker-sub',\n\t\t\t\tvalue: 'value',\n\t\t\t\tvalueHorizontal: 'value-horizontal',\n\t\t\t\tvalueVertical: 'value-vertical',\n\t\t\t\tvalueNormal: 'value-normal',\n\t\t\t\tvalueLarge: 'value-large',\n\t\t\t\tvalueSub: 'value-sub'\n\t\t\t},\n\t\t\t'useRequestAnimationFrame': true\n\t\t};\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\tObject.keys(tests).forEach(function( name ){\n\n\t\t\t// If the option isn't set, but it is required, throw an error.\n\t\t\tif ( options[name] === undefined && defaults[name] === undefined ) {\n\n\t\t\t\tif ( tests[name].r ) {\n\t\t\t\t\tthrow new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n\t\t});\n\n\t\t// Forward pips options\n\t\tparsed.pips = options.pips;\n\n\t\tvar styles = [['left', 'top'], ['right', 'bottom']];\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = styles[parsed.dir][parsed.ort];\n\t\tparsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n\t\treturn parsed;\n\t}", "title": "" }, { "docid": "09213184413cbf73c47b6595536dc662", "score": "0.47970492", "text": "function testOptions(options) {\r\n // To prove a fix for #537, freeze options here.\r\n // If the object is modified, an error will be thrown.\r\n // Object.freeze(options);\r\n\r\n var parsed = {\r\n margin: 0,\r\n limit: 0,\r\n padding: 0,\r\n animate: true,\r\n animationDuration: 300,\r\n ariaFormat: defaultFormatter,\r\n format: defaultFormatter\r\n };\r\n\r\n // Tests are executed in the order they are presented here.\r\n var tests = {\r\n step: { r: false, t: testStep },\r\n start: { r: true, t: testStart },\r\n connect: { r: true, t: testConnect },\r\n direction: { r: true, t: testDirection },\r\n snap: { r: false, t: testSnap },\r\n animate: { r: false, t: testAnimate },\r\n animationDuration: { r: false, t: testAnimationDuration },\r\n range: { r: true, t: testRange },\r\n orientation: { r: false, t: testOrientation },\r\n margin: { r: false, t: testMargin },\r\n limit: { r: false, t: testLimit },\r\n padding: { r: false, t: testPadding },\r\n behaviour: { r: true, t: testBehaviour },\r\n ariaFormat: { r: false, t: testAriaFormat },\r\n format: { r: false, t: testFormat },\r\n tooltips: { r: false, t: testTooltips },\r\n keyboardSupport: { r: true, t: testKeyboardSupport },\r\n documentElement: { r: false, t: testDocumentElement },\r\n cssPrefix: { r: true, t: testCssPrefix },\r\n cssClasses: { r: true, t: testCssClasses }\r\n };\r\n\r\n var defaults = {\r\n connect: false,\r\n direction: \"ltr\",\r\n behaviour: \"tap\",\r\n orientation: \"horizontal\",\r\n keyboardSupport: true,\r\n cssPrefix: \"noUi-\",\r\n cssClasses: {\r\n target: \"target\",\r\n base: \"base\",\r\n origin: \"origin\",\r\n handle: \"handle\",\r\n handleLower: \"handle-lower\",\r\n handleUpper: \"handle-upper\",\r\n horizontal: \"horizontal\",\r\n vertical: \"vertical\",\r\n background: \"background\",\r\n connect: \"connect\",\r\n connects: \"connects\",\r\n ltr: \"ltr\",\r\n rtl: \"rtl\",\r\n draggable: \"draggable\",\r\n drag: \"state-drag\",\r\n tap: \"state-tap\",\r\n active: \"active\",\r\n tooltip: \"tooltip\",\r\n pips: \"pips\",\r\n pipsHorizontal: \"pips-horizontal\",\r\n pipsVertical: \"pips-vertical\",\r\n marker: \"marker\",\r\n markerHorizontal: \"marker-horizontal\",\r\n markerVertical: \"marker-vertical\",\r\n markerNormal: \"marker-normal\",\r\n markerLarge: \"marker-large\",\r\n markerSub: \"marker-sub\",\r\n value: \"value\",\r\n valueHorizontal: \"value-horizontal\",\r\n valueVertical: \"value-vertical\",\r\n valueNormal: \"value-normal\",\r\n valueLarge: \"value-large\",\r\n valueSub: \"value-sub\"\r\n }\r\n };\r\n\r\n // AriaFormat defaults to regular format, if any.\r\n if (options.format && !options.ariaFormat) {\r\n options.ariaFormat = options.format;\r\n }\r\n\r\n // Run all options through a testing mechanism to ensure correct\r\n // input. It should be noted that options might get modified to\r\n // be handled properly. E.g. wrapping integers in arrays.\r\n Object.keys(tests).forEach(function(name) {\r\n // If the option isn't set, but it is required, throw an error.\r\n if (!isSet(options[name]) && defaults[name] === undefined) {\r\n if (tests[name].r) {\r\n throw new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\r\n }\r\n\r\n return true;\r\n }\r\n\r\n tests[name].t(parsed, !isSet(options[name]) ? defaults[name] : options[name]);\r\n });\r\n\r\n // Forward pips options\r\n parsed.pips = options.pips;\r\n\r\n // All recent browsers accept unprefixed transform.\r\n // We need -ms- for IE9 and -webkit- for older Android;\r\n // Assume use of -webkit- if unprefixed and -ms- are not supported.\r\n // https://caniuse.com/#feat=transforms2d\r\n var d = document.createElement(\"div\");\r\n var msPrefix = d.style.msTransform !== undefined;\r\n var noPrefix = d.style.transform !== undefined;\r\n\r\n parsed.transformRule = noPrefix ? \"transform\" : msPrefix ? \"msTransform\" : \"webkitTransform\";\r\n\r\n // Pips don't move, so we can place them using left/top.\r\n var styles = [[\"left\", \"top\"], [\"right\", \"bottom\"]];\r\n\r\n parsed.style = styles[parsed.dir][parsed.ort];\r\n\r\n return parsed;\r\n }", "title": "" }, { "docid": "746d291e26d036463b03dfdb3f3d1540", "score": "0.47865373", "text": "function testOptions(options) {\n\n // To prove a fix for #537, freeze options here.\n // If the object is modified, an error will be thrown.\n // Object.freeze(options);\n\n var parsed = {\n margin: 0,\n limit: 0,\n padding: 0,\n animate: true,\n animationDuration: 300,\n ariaFormat: defaultFormatter,\n format: defaultFormatter\n };\n\n // Tests are executed in the order they are presented here.\n var tests = {\n 'step': {\n r: false,\n t: testStep\n },\n 'start': {\n r: true,\n t: testStart\n },\n 'connect': {\n r: true,\n t: testConnect\n },\n 'direction': {\n r: true,\n t: testDirection\n },\n 'snap': {\n r: false,\n t: testSnap\n },\n 'animate': {\n r: false,\n t: testAnimate\n },\n 'animationDuration': {\n r: false,\n t: testAnimationDuration\n },\n 'range': {\n r: true,\n t: testRange\n },\n 'orientation': {\n r: false,\n t: testOrientation\n },\n 'margin': {\n r: false,\n t: testMargin\n },\n 'limit': {\n r: false,\n t: testLimit\n },\n 'padding': {\n r: false,\n t: testPadding\n },\n 'behaviour': {\n r: true,\n t: testBehaviour\n },\n 'ariaFormat': {\n r: false,\n t: testAriaFormat\n },\n 'format': {\n r: false,\n t: testFormat\n },\n 'tooltips': {\n r: false,\n t: testTooltips\n },\n 'cssPrefix': {\n r: false,\n t: testCssPrefix\n },\n 'cssClasses': {\n r: false,\n t: testCssClasses\n },\n 'useRequestAnimationFrame': {\n r: false,\n t: testUseRaf\n }\n };\n\n var defaults = {\n 'connect': false,\n 'direction': 'ltr',\n 'behaviour': 'tap',\n 'orientation': 'horizontal',\n 'cssPrefix': 'noUi-',\n 'cssClasses': {\n target: 'target',\n base: 'base',\n origin: 'origin',\n handle: 'handle',\n handleLower: 'handle-lower',\n handleUpper: 'handle-upper',\n horizontal: 'horizontal',\n vertical: 'vertical',\n background: 'background',\n connect: 'connect',\n ltr: 'ltr',\n rtl: 'rtl',\n draggable: 'draggable',\n drag: 'state-drag',\n tap: 'state-tap',\n active: 'active',\n tooltip: 'tooltip',\n pips: 'pips',\n pipsHorizontal: 'pips-horizontal',\n pipsVertical: 'pips-vertical',\n marker: 'marker',\n markerHorizontal: 'marker-horizontal',\n markerVertical: 'marker-vertical',\n markerNormal: 'marker-normal',\n markerLarge: 'marker-large',\n markerSub: 'marker-sub',\n value: 'value',\n valueHorizontal: 'value-horizontal',\n valueVertical: 'value-vertical',\n valueNormal: 'value-normal',\n valueLarge: 'value-large',\n valueSub: 'value-sub'\n },\n 'useRequestAnimationFrame': true\n };\n\n // AriaFormat defaults to regular format, if any.\n if (options.format && !options.ariaFormat) {\n options.ariaFormat = options.format;\n }\n\n // Run all options through a testing mechanism to ensure correct\n // input. It should be noted that options might get modified to\n // be handled properly. E.g. wrapping integers in arrays.\n Object.keys(tests).forEach(function(name) {\n\n // If the option isn't set, but it is required, throw an error.\n if (options[name] === undefined && defaults[name] === undefined) {\n\n if (tests[name].r) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n }\n\n return true;\n }\n\n tests[name].t(parsed, options[name] === undefined ? defaults[name] : options[name]);\n });\n\n // Forward pips options\n parsed.pips = options.pips;\n\n var styles = [\n ['left', 'top'],\n ['right', 'bottom']\n ];\n\n // Pre-define the styles.\n parsed.style = styles[parsed.dir][parsed.ort];\n parsed.styleOposite = styles[parsed.dir ? 0 : 1][parsed.ort];\n\n return parsed;\n }", "title": "" }, { "docid": "8e6ffc4cac28d82e49d414fef4cd2a56", "score": "0.47637188", "text": "constructor(connOptions = {}) {\n this._pgp = pgp;\n this._db = pgp(connOptions); // database instance\n\n //this._dropAndCreateSql = this.sql('./db/drop_and_create.sql');\n //this.initializeDatabase();\n }", "title": "" }, { "docid": "d6a6fe198555f585a7d6cfeffc334b62", "score": "0.4742935", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n}", "title": "" }, { "docid": "d6a6fe198555f585a7d6cfeffc334b62", "score": "0.4742935", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n}", "title": "" }, { "docid": "dc6c799ab972ab58662b64cff43c0327", "score": "0.47415867", "text": "extend(config, { isDev, isClient }) { }", "title": "" }, { "docid": "9a117b5458ca4d49be509e02522c6892", "score": "0.47230208", "text": "function PostgresConnect(options) {\n var that = this;\n \n // Private fields\n that._options = options;\n\n // Private API\n var connectAndExecuteQuery = function(req, tenantCode, queryDetails, callback) {\n var tenantCode = tenantCode || req.tenantCode;\n if (!tenantCode) {\n callback('No Tenant Code found');\n }\n var tenantDatabaseName = cfg.postgresql.machine_name + '.' + tenantCode;\n var connected = function(err, client, done) {\n if (err) {\n that._options.logger.logRequest('warning', that._options.source, req, 'Error connecting to PG. ' + tenantDatabaseName + ' ' + err);\n return callback(err); // will call next in callback\n }\n client.query(queryDetails.sql, queryDetails.values, function (err, result) {\n done(); // hand connection back to pool\n callback(err, result);\n });\n };\n\n pg.connect({\n host: cfg.postgresql.host,\n port: cfg.postgresql.port,\n ssl: cfg.postgresql.ssl,\n database: tenantDatabaseName,\n user: cfg.postgresql.user,\n password: cfg.postgresql.password\n }, connected);\n };\n \n that.connectAndExecuteQuery = connectAndExecuteQuery;\n}", "title": "" }, { "docid": "4a3428e103d08278fce6a24e9b068e51", "score": "0.47183824", "text": "configure(config) {\n this._connectionResolver.configure(config);\n this._credentialResolver.configure(config);\n this._options = config.getSection(\"options\");\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "1e08b5da237191d520ae7b9fc64ff463", "score": "0.47073397", "text": "function configure(user_options) {\n options = inherit(options, user_options);\n }", "title": "" }, { "docid": "9c0fc75c5018352c7523b3f3e30f149d", "score": "0.47057867", "text": "static init() {\n const dsn = config.database;\n const options = config.databaseOption;\n\n mongoose.Promise = bluebird;\n mongoose.connect(dsn, options, (error) => {\n // handle the error case\n if (error) {\n console.info('Failed to connect to the Mongo');\n console.error(error);\n throw error;\n }\n else {\n console.info('Connected to mongo: ' + dsn);\n }\n });\n }", "title": "" }, { "docid": "40fe673e91c56d99c433a1d075a0633b", "score": "0.46923703", "text": "function testOptions ( options ) {\n\n // To prove a fix for #537, freeze options here.\n // If the object is modified, an error will be thrown.\n // Object.freeze(options);\n\n var parsed = {\n margin: 0,\n limit: 0,\n padding: 0,\n animate: true,\n animationDuration: 300,\n ariaFormat: defaultFormatter,\n format: defaultFormatter\n };\n\n // Tests are executed in the order they are presented here.\n var tests = {\n 'step': { r: false, t: testStep },\n 'start': { r: true, t: testStart },\n 'connect': { r: true, t: testConnect },\n 'direction': { r: true, t: testDirection },\n 'snap': { r: false, t: testSnap },\n 'animate': { r: false, t: testAnimate },\n 'animationDuration': { r: false, t: testAnimationDuration },\n 'range': { r: true, t: testRange },\n 'orientation': { r: false, t: testOrientation },\n 'margin': { r: false, t: testMargin },\n 'limit': { r: false, t: testLimit },\n 'padding': { r: false, t: testPadding },\n 'behaviour': { r: true, t: testBehaviour },\n 'ariaFormat': { r: false, t: testAriaFormat },\n 'format': { r: false, t: testFormat },\n 'tooltips': { r: false, t: testTooltips },\n 'cssPrefix': { r: false, t: testCssPrefix },\n 'cssClasses': { r: false, t: testCssClasses },\n 'useRequestAnimationFrame': { r: false, t: testUseRaf }\n };\n\n var defaults = {\n 'connect': false,\n 'direction': 'ltr',\n 'behaviour': 'tap',\n 'orientation': 'horizontal',\n 'cssPrefix' : 'noUi-',\n 'cssClasses': {\n target: 'target',\n base: 'base',\n origin: 'origin',\n handle: 'handle',\n handleLower: 'handle-lower',\n handleUpper: 'handle-upper',\n horizontal: 'horizontal',\n vertical: 'vertical',\n background: 'background',\n connect: 'connect',\n ltr: 'ltr',\n rtl: 'rtl',\n draggable: 'draggable',\n drag: 'state-drag',\n tap: 'state-tap',\n active: 'active',\n tooltip: 'tooltip',\n pips: 'pips',\n pipsHorizontal: 'pips-horizontal',\n pipsVertical: 'pips-vertical',\n marker: 'marker',\n markerHorizontal: 'marker-horizontal',\n markerVertical: 'marker-vertical',\n markerNormal: 'marker-normal',\n markerLarge: 'marker-large',\n markerSub: 'marker-sub',\n value: 'value',\n valueHorizontal: 'value-horizontal',\n valueVertical: 'value-vertical',\n valueNormal: 'value-normal',\n valueLarge: 'value-large',\n valueSub: 'value-sub'\n },\n 'useRequestAnimationFrame': true\n };\n\n // AriaFormat defaults to regular format, if any.\n if ( options.format && !options.ariaFormat ) {\n options.ariaFormat = options.format;\n }\n\n // Run all options through a testing mechanism to ensure correct\n // input. It should be noted that options might get modified to\n // be handled properly. E.g. wrapping integers in arrays.\n Object.keys(tests).forEach(function( name ){\n\n // If the option isn't set, but it is required, throw an error.\n if ( options[name] === undefined && defaults[name] === undefined ) {\n\n if ( tests[name].r ) {\n throw new Error(\"noUiSlider (\" + VERSION + \"): '\" + name + \"' is required.\");\n }\n\n return true;\n }\n\n tests[name].t( parsed, options[name] === undefined ? defaults[name] : options[name] );\n });\n\n // Forward pips options\n parsed.pips = options.pips;\n\n var styles = [['left', 'top'], ['right', 'bottom']];\n\n // Pre-define the styles.\n parsed.style = styles[parsed.dir][parsed.ort];\n parsed.styleOposite = styles[parsed.dir?0:1][parsed.ort];\n\n return parsed;\n }", "title": "" }, { "docid": "ee26b3130d9b163d3b06555713a3a1bd", "score": "0.46882793", "text": "function setUpMongooseConnection() {\n const connectionString = process.env.MONGODB_URI;\n if (!connectionString) {\n throw new Error('Connection string is not defined. ' +\n 'Set process.env.MONGODB_URI');\n }\n mongoose.connect(connectionString,\n {useNewUrlParser: true, useUnifiedTopology: true});\n mongoose.Promise = global.Promise;\n mongoose.connection.on('error',\n console.error.bind(console, 'MongoDB connection error:'));\n}", "title": "" }, { "docid": "95d4bd0486afdc07b231163c84c7546a", "score": "0.46719238", "text": "extend (config, { isDev, isClient }) {\n }", "title": "" }, { "docid": "95d4bd0486afdc07b231163c84c7546a", "score": "0.46719238", "text": "extend (config, { isDev, isClient }) {\n }", "title": "" }, { "docid": "e244d2cb710617089b6ab7f416ea3443", "score": "0.46627203", "text": "static getConnection(){\n return new Sequelize(ConnConfig.configBD.database, ConnConfig.configBD.user, ConnConfig.configBD.password, {\n host: ConnConfig.configBD.host,\n dialect: ConnConfig.configBD.dialect,\n port: ConnConfig.configBD.port,\n pool: {\n max: 5,\n min: 1,\n idle: 10000\n }\n });\n }", "title": "" } ]
8ab37fa1022a0313c002a369a29845cb
Retrieve an unsigned 16bit short from the DataView. The value is stored in big endian. Parsing utility functions
[ { "docid": "723a9da31b18cd12a59fdbd2c220d9b2", "score": "0.7367977", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n}", "title": "" } ]
[ { "docid": "f01bdbc6e72b8c0fea6fe0f4ce38dd4a", "score": "0.78198785", "text": "function getUShort(dataView,offset){return dataView.getUint16(offset,false);}", "title": "" }, { "docid": "03ddbc2ae3da96871a9abc7d4a6da651", "score": "0.7808773", "text": "function getShort(dataView, offset) {\n return dataView.getInt16(offset, false);\n}", "title": "" }, { "docid": "e06802a18d636600b54b354ba22fc47b", "score": "0.7313046", "text": "function ToUint16(v) { return v & 0xFFFF; }", "title": "" }, { "docid": "6a1b8b1b77377faa7131e33a6fdc9e34", "score": "0.7209528", "text": "readShort() {\n let res = this._buffer.readInt16LE(this._currentReadPosition);\n this._currentReadPosition += 2;\n return res;\n }", "title": "" }, { "docid": "464dd5961fffefacb9ea013cd26792f0", "score": "0.71069336", "text": "readUint16() {\n const value = this._data.getUint16(this.offset, this.littleEndian);\n\n this.offset += 2;\n return value;\n }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.6842381", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9aaba6d14080b94e214bf333da76a44f", "score": "0.67610663", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n}", "title": "" }, { "docid": "9aaba6d14080b94e214bf333da76a44f", "score": "0.67610663", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.67546785", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" }, { "docid": "bf82615e1771e256bf2064d35480b54d", "score": "0.6753666", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n}", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.6728866", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "b8f3ff45b984a2d3663ad00a54f9547a", "score": "0.6725242", "text": "shortValue() {\n\t\treturn (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n\t}", "title": "" }, { "docid": "51efd88b7596fa07579370a5faa1888f", "score": "0.6724876", "text": "function bnShortValue(){\nreturn this.t==0?this.s:this[0]<<16>>16;\n}", "title": "" }, { "docid": "5f79cf2ebca0160ef36df7dee17f7b30", "score": "0.67139375", "text": "function bnShortValue() {\r\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\r\n}", "title": "" }, { "docid": "0a701ea8b1328a6533fd52af5cb17aa5", "score": "0.67106104", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n }", "title": "" }, { "docid": "0a701ea8b1328a6533fd52af5cb17aa5", "score": "0.67106104", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n }", "title": "" }, { "docid": "be5d1ed71e51bb0e0aefac5ace9cf47c", "score": "0.67083913", "text": "function bnShortValue() { return (this.t == 0) ? this.s : (this[0] << 16) >> 16; }", "title": "" }, { "docid": "56835f8a1494d2cb3250da4921c3b4b4", "score": "0.66924065", "text": "function ToInt16(v) { return (v << 16) >> 16; }", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.6674396", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.6674396", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.6674396", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.6674396", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.6674396", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "26a52bff3b6ecd953ea6244d36e49c35", "score": "0.66574603", "text": "function bnShortValue()\n\t {\n\t return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n\t }", "title": "" }, { "docid": "d7ec762d181aaf37bb4b93df5b5344f2", "score": "0.6655464", "text": "function bnShortValue() {\n\t return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n\t}", "title": "" }, { "docid": "d7ec762d181aaf37bb4b93df5b5344f2", "score": "0.6655464", "text": "function bnShortValue() {\n\t return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n\t}", "title": "" }, { "docid": "165b6ab8967241d4cc81646c8a508591", "score": "0.66252524", "text": "function wgint16(val, endian, buffer, offset)\n\t{\n\t\tif (endian == 'big') {\n\t\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\t\tbuffer[offset+1] = val & 0x00ff;\n\t\t} else {\n\t\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\t\tbuffer[offset] = val & 0x00ff;\n\t\t}\n\t}", "title": "" }, { "docid": "c8f3bc08b0125524ffe747759e4fe420", "score": "0.66178274", "text": "function bnShortValue() {\r\n return this.t == 0 ? this.s : (this[0] << 16) >> 16\r\n }", "title": "" }, { "docid": "dd6f73d2cad91d5cf5b1d01df17fdfc9", "score": "0.6611547", "text": "readUInt16(){return this.__readInteger(2,!1)}", "title": "" }, { "docid": "830636b903eadcdf8757b762938ac6fa", "score": "0.6489503", "text": "function U2S16( value )\n{\n\treturn value << 16 >> 16;\n}", "title": "" }, { "docid": "69be7df8a30d654ee551fe2071477071", "score": "0.64092845", "text": "ToUInt16() {\n\n }", "title": "" }, { "docid": "1461941d99164eb6487d29dcad97e0a6", "score": "0.63885206", "text": "readInt16() {\n const value = this._data.getInt16(this.offset, this.littleEndian);\n\n this.offset += 2;\n return value;\n }", "title": "" }, { "docid": "93128e8b940a4c4a94170aaafb7c8283", "score": "0.63848644", "text": "function toUnsignedShort(V, extAttrs) {\n //Initialize x to ToNumber(V).\n var x = ECMAScript.ToNumber(V);\n /*\n If the conversion to an IDL value is being performed due to any of the following:\n V is being assigned to an attribute annotated with the [EnforceRange] extended attribute,\n V is being passed as an operation argument annotated with the [EnforceRange] extended attribute, or\n V is being used as the value of dictionary member annotated with the [EnforceRange] extended attribute,\n */\n if (extAttrs.search('EnforceRange') > -1) {\n //If x is NaN, +∞, or -∞, then throw a TypeError.\n if (isNaN(x) || x === +Infinity || x === -Infinity) {\n throw new TypeError();\n }\n //Set x to sign(x) * floor(abs(x)).\n x = ECMAScript.sign(x) * Math.floor(Math.abs(x));\n //If x < 0 or x > 216 - 1, then throw a TypeError.\n if (x < 0 || x > (Math.pow(2, 16) - 1)) {\n throw new TypeError();\n }\n //Return the IDL unsigned short value that represents the same numeric value as x.\n return x;\n }\n //Set x to ToUint16(x).\n x = ECMAScript.ToUint16(x);\n //Return the IDL unsigned short value that represents the same numeric value as x.\n return x;\n }", "title": "" }, { "docid": "8d7c3494d87eb22203cb84c015e27186", "score": "0.6300493", "text": "function s16(val) {\n return (val << 16) >> 16;\n}", "title": "" }, { "docid": "9147f2a08fbf3c0750917b2e0e05593b", "score": "0.624304", "text": "get uint16() {\n return this.integer.inRange(0, 65535);\n }", "title": "" }, { "docid": "c91dec2e916467844a36f96aa5574734", "score": "0.624043", "text": "writeUInt16(value){if(!this.__checkIntegerBounds(value,2,!1))throw new RangeError(`The value ${value} does not fit into an uint16.`);return this.__writeInteger(value,2),this}", "title": "" }, { "docid": "b2b20d028c51040f785031af7b07538b", "score": "0.6228881", "text": "nextUInt16LE() {\n let value = this.buffer.readUInt16LE(this.offset);\n this.offset += 2;\n return value;\n }", "title": "" }, { "docid": "38f7a661f108417c0abd87a7055b52fe", "score": "0.6205469", "text": "function ttSHORT(b, o) {\n var n = b[o] * 256 + b[o+1];\n\treturn n & 0x8000 ? (0xffff0000|n)>>0 : n;\n}", "title": "" }, { "docid": "8694e58f4e8cec53133f8b8da59fdc6a", "score": "0.61252195", "text": "function DecodeVarLenUint16(input) {\n if (input.ReadBits(1)) {\n var nbits = (input.ReadBits(4));\n if (nbits == 0) {\n return 1;\n } else {\n return (input.ReadBits(nbits)) + (1 << nbits);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "28df1095ec011ffcea5c5d377ae1cd15", "score": "0.6117098", "text": "writeInt16(value){if(!this.__checkIntegerBounds(value,2,!0))throw new RangeError(`The value ${value} does not fit into an int16.`);return this.__writeInteger(value,2),this}", "title": "" }, { "docid": "d6578ca9da542a421255c4804aa23725", "score": "0.6107017", "text": "writeUint16(value) {\n this.ensureAvailable(2);\n\n this._data.setUint16(this.offset, value, this.littleEndian);\n\n this.offset += 2;\n\n this._updateLastWrittenByte();\n\n return this;\n }", "title": "" }, { "docid": "62db82e5cd8562e4a906d67d30329594", "score": "0.6103182", "text": "assure16Bit_() {\n this.assureUncompressed_();\n if (this.bitDepth != \"16\") {\n this.toBitDepth(\"16\");\n }\n }", "title": "" }, { "docid": "a9263c1d9df487f13747fca8ff0a045c", "score": "0.6031778", "text": "function u16(a,o) {\n return i16(a,o);\n}", "title": "" }, { "docid": "e88697bbf169712bda50fb57df6762aa", "score": "0.6020408", "text": "function norm16(v) {\n v = parseInt(v, 16);\n return size == 2 ? v : // 16 bit\n size == 1 ? v << 4 : // 8 bit\n v >> (4 * (size - 2)); // 24 or 32 bit\n }", "title": "" }, { "docid": "81e46c20c68f4763eed10c7425aa386b", "score": "0.5970565", "text": "writeInt16(value) {\n this.ensureAvailable(2);\n\n this._data.setInt16(this.offset, value, this.littleEndian);\n\n this.offset += 2;\n\n this._updateLastWrittenByte();\n\n return this;\n }", "title": "" }, { "docid": "7c8cc5d8f282744087f6c8351bf92b9d", "score": "0.59548163", "text": "nextUInt16BE() {\n let value = this.buffer.readUInt16BE(this.offset);\n this.offset += 2;\n return value;\n }", "title": "" }, { "docid": "9c64a63e241690af51bff5a1852d3d51", "score": "0.5939035", "text": "function uint16(capacity) {\n return PackSparseDenseSet_PackSparseDenseSet.uint16(capacity);\n }", "title": "" }, { "docid": "c4ed88cb7d462c2212c228a7d5fcfc2a", "score": "0.5937612", "text": "readInt16(){return this.__readInteger(2,!0)}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.593262", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.593262", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.593262", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.593262", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" }, { "docid": "49c31a365d99576ee482cbb83e2b8e7c", "score": "0.593262", "text": "function wsint16(value, endian, buffer, offset)\n{\n\tvar val;\n\n\tif (value === undefined)\n\t\tthrow (new Error('missing value'));\n\n\tif (endian === undefined)\n\t\tthrow (new Error('missing endian'));\n\n\tif (buffer === undefined)\n\t\tthrow (new Error('missing buffer'));\n\n\tif (offset === undefined)\n\t\tthrow (new Error('missing offset'));\n\n\tif (offset + 1 >= buffer.length)\n\t\tthrow (new Error('Trying to read beyond buffer length'));\n\n\tval = prepsint(value, 0x7fff, -0x8000);\n\tif (val >= 0)\n\t\twgint16(val, endian, buffer, offset);\n\telse\n\t\twgint16(0xffff + val + 1, endian, buffer, offset);\n\n}", "title": "" } ]
d33d68b10a0e8d3e91fca665151f1752
a fitness function to solve for x where f(x) = 0
[ { "docid": "d91e6c15cf2c09b366265bf7520b34c8", "score": "0.665611", "text": "function getFitness(x) {\n // this can be any equation where x is unknown and y is zero\n const y = 2 * x - 10;\n\n if (y === 0) {\n return 10 ** 1000;\n }\n return 1 / Math.abs(y);\n}", "title": "" } ]
[ { "docid": "1f7fa54234ddc7f63b9b7a83ac42d561", "score": "0.6654211", "text": "calcFitness() {}", "title": "" }, { "docid": "64dc9493980c9d3ad9d4f2f97d394f17", "score": "0.63130915", "text": "getFitness() {\n let answer = this.calculateAnswer();\n\n if (answer > Number.MAX_SAFE_INTEGER || _.isUndefined(answer) || _.isNaN(answer) || _.isObject(answer)) {\n return 0; //lowest possible fitness score for divide by zero type answers\n }\n\n let normalisedAnswer = answer - this.equalsAmount;\n if (normalisedAnswer === 0) {\n return Number.MAX_SAFE_INTEGER; //perfect answer, max fitness\n } else {\n return 1 / math.abs(normalisedAnswer); //this results in a higher score the closer we get to zero\n }\n }", "title": "" }, { "docid": "6c72a532e0e6c32cc3f24c9fa3a9b423", "score": "0.6307353", "text": "evaluateFitness(){\n // calcuate the distance of bot from target.\n let distanceFromTarget = dist(this.target.x, this.target.y, this.pos.x, this.pos.y);\n\n // The farther the distance then lower the fitness need to be\n // hence mapping the distance (0 - 1000) to fitness score (100 - 0)\n // i.e. a bot with zero distance to target will get 100 as fitness score\n distanceFromTarget = map(distanceFromTarget, 0, 1000, 100, 0);\n\n // if the bot is evaluated to be having fitness 100 already \n // then then dont assigne this calculated fitness score\n if(this.fitness != 100)\n this.fitness = distanceFromTarget;\n }", "title": "" }, { "docid": "4671632402e0e7af1254f3da4a320ec1", "score": "0.62108654", "text": "calcFitness() {\n let f = 0;\n for (let i = 0; i < this.genome.length; i++) {\n if (this.genome[i] == target[i]) {\n f += 1;\n }\n }\n this.fitness = f / this.genome.length;\n }", "title": "" }, { "docid": "a8b8942e697349038a4db3ab4e25e7fd", "score": "0.6032603", "text": "calcFitness() {\n for(let i = 0; i < this.population.length; i++) {\n this.population[i].calcFitness(this.target);\n }\n }", "title": "" }, { "docid": "ac020cff744a2214233931a94ec02f4f", "score": "0.5901059", "text": "function fint(f,x0,x,a){\n if(a<0) return NaN;\n if(a==0) return f(x);\n if(a>0 && a<0.01) a=0.01;\n var g = function(u){\n var p = Math.exp(x-x/u);\n return Math.pow(p,a)*x/(u*u)*f(x-p);\n };\n return -1/gamma(a)*gauss(g,x/(x-Math.log(x-x0)),0,1);\n}", "title": "" }, { "docid": "3555ea9f1f427b86af6c1c0d2388dc44", "score": "0.5870882", "text": "function compare_with_best_fitness(x){\n var x_fitness = fitness(x);\n if (x_fitness < best_fitness){\n best_fitness = x_fitness;\n }\n}", "title": "" }, { "docid": "922453f44832aabe07256a45f1020e5e", "score": "0.5862384", "text": "function activationf(x) {\n return Math.max(0, x);\n}", "title": "" }, { "docid": "7587578f2db7c8cc58683789baf97a5b", "score": "0.58518296", "text": "function setFitnessFunction(fn) {\n fitnessFunction = fn;\n }", "title": "" }, { "docid": "359f5b77571a759015f004fecf3823ad", "score": "0.5834726", "text": "calcFitness() {\n for (let i = 0; i < this.population.length; i++) {\n this.population[i].calcFitness();\n }\n }", "title": "" }, { "docid": "60f8cad247c971394ce4243cb3702c68", "score": "0.5799513", "text": "fittest () {\n let fittestValue = this.tours[0].fitness(),\n fitValue = 0;\n this.bestTourIndex = 0;\n for (let i = 1; i < this.tours.length; i++) {\n fitValue = this.tours[i].fitness();\n if (fitValue > fittestValue) {\n fittestValue = fitValue; \n this.bestTourIndex = i;\n }\n }\n this.bestFitnessValue = fittestValue;\n }", "title": "" }, { "docid": "36b888d69c5a4c108c51044287b37a8c", "score": "0.5794095", "text": "weightPopulation() {\n let populationFitness = this.population.map(this.fitness.bind(this))\n let fs = populationFitness.map((x) => x === 0 ? 0.001 : x)\n\n let totalFitness = fs.reduce((a, b) => a + b)\n let weightedFitness = fs.map((f) => f / totalFitness)\n\n return weightedFitness\n }", "title": "" }, { "docid": "496656202a2deb9a828a80104dab1161", "score": "0.576368", "text": "calculateFitness() {\r\n\t\tthis._fitnessScore = ((this._energyStatus.water/MAX_WATER) * (this._energyStatus.food/MAX_FOOD)) + (this._lifeSpan/GENERATION_LIFETIME);\r\n\t}", "title": "" }, { "docid": "947e0ba4b5461b6d090d54e72293bd15", "score": "0.5714056", "text": "getFitness() {\n\t\tlet distance = dist( this.position.x, this.position.y, target.position.x, target.position.y );\n\t\tlet fitness = map( distance, 0, width, width, 0 );\n\n\t\tif (this.completed) {\n\t\t\t/**\n\t\t\t * If rocket finds the target, boost its fintess.\n\t\t\t */\n\t\t\tfitness *= 15;\n\t\t} \n\n\t\tif (this.crashed) {\n\t\t\t/**\n\t\t\t * If rocket crashed, reduce its fitness\n\t\t\t */\n\t\t\tif (this.crash_type == \"obstacle\") {\n\t\t\t\tfitness /= 15;\n\t\t\t} else if (this.crash_type == \"border\") {\n\t\t\t\tfitness /= 10;\n\t\t\t}\n\t\t}\n\n\t\treturn fitness;\n\t}", "title": "" }, { "docid": "153466e2abb80fbce2009a614b2e5383", "score": "0.5672163", "text": "calcFitness() {\n for (let i = 0; i < this.population.length; i++) {\n this.population[i].calcFitness(this.tours);\n }\n }", "title": "" }, { "docid": "14719e68c499f2fd131622a7a252e043", "score": "0.55994934", "text": "function fitness(chromosome) {\n\t\t// console.log(chromosome);\n\t\tlet index = 0;\n\t\tlet fitness = 0;\n\t\twhile(chromosome[index] != 7){\n\t\t\tif (routes[chromosome[index]][chromosome[index+1]] == 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tfitness = fitness + routes[chromosome[index]][chromosome[index+1]];\n\t\t\tindex++;\n\t\t}\n\t\treturn 1 / fitness;\n\t}", "title": "" }, { "docid": "377a7cef7fbd974d21e43a0eeddeb72b", "score": "0.55944943", "text": "static jacobi(f, x0, fx0 = f(x0), EPSILON = 1e-6) {\n const jacobi = Matrix.forWidthHeight(x0.length, fx0.length);\n for (let colIndex = 0; colIndex < x0.length; colIndex++) {\n x0[colIndex] += EPSILON;\n const fx = f(x0);\n for (let rowIndex = 0; rowIndex < fx0.length; rowIndex++) {\n const value = (fx[rowIndex] - fx0[rowIndex]) / EPSILON;\n jacobi.setEl(rowIndex, colIndex, value);\n }\n x0[colIndex] -= EPSILON;\n }\n return jacobi;\n }", "title": "" }, { "docid": "5754e05c5313e00349b5be88dd3841c4", "score": "0.5592339", "text": "CalculateFitness() {\n\n let hitRate = parseFloat(this.nShotsHit) / parseFloat(this.nShotsFired); //Percentage of shots that hit asteroids\n this.fFitness = (this.nScore + 1) * 10; //Min 10\n this.fFitness *= this.nLifeSpan;\n this.fFitness *= hitRate * hitRate; //Uses hitRate squared to force fitness's top priority to be aiming. \n //Final fitness is determined by score * time alive *(hitRate * hitRate)\n\n }", "title": "" }, { "docid": "3eccf04e5bcf5d538db0ba451ff1406d", "score": "0.5541863", "text": "get fitness() {\r\n\t\treturn this._fitnessScore;\r\n\t}", "title": "" }, { "docid": "b2c3231afd7d11be0df7a634b342ac6a", "score": "0.55322546", "text": "calcFitness(alvo) {\r\n let pontuacao = 0; //passa por todas posicoes do vetor gene. Se a letra é igual e esta na posicao certa ao da frase alvo, ganha um ponto.\r\n for (let i = 0; i < this.genes.length; i++) {\r\n if (this.genes[i] == alvo.charAt(i)) {\r\n pontuacao++;\r\n }\r\n }\r\n this.fitness = pontuacao / alvo.length; //o fitness é calculado com a quantidade de pontos obtidos dividido pelo tamanho da frase alvo\r\n this.fitness = pow(this.fitness,4); //o valor é elevado a quarta\r\n }", "title": "" }, { "docid": "81da86b3a1fcfc1075eee63f6d51854d", "score": "0.55137587", "text": "function calculateIdealFitness(){\n\t\tvar sumSq = new Object();\n\t\tsumSq.x = 0;\n\t\tsumSq.y = 0;\n\t\tsumSq.z = 0;\n\t\tvar k;\n\t\tk = 0;\n\t\tif(nAA.length>0) {\n\t\t\twhile (k<nAA.length && k<maxShift){\n\t\t\t\tif(nAA[k] !== undefined){\n\t\t\t\t\tsumSq.x = sumSq.x + nAA[k].x * nAA[k].x;\n\t\t\t\t}\n\t\t\t\tif(nAA[k] !== undefined){\n\t\t\t\t\tsumSq.y = sumSq.y + nAA[k].y * nAA[k].y;\n\t\t\t\t}\n\t\t\t\tif(nAA[k] !== undefined){\n\t\t\t\t\tsumSq.z = sumSq.z + nAA[k].z * nAA[k].z;\n\t\t\t\t}\n\t\t\t\tk++;\n\t\t\t}\n\t\t\tif(k>0){\n\t\t\t\tsumSq.x = sumSq.x / k;\n\t\t\t\tsumSq.y = sumSq.y / k;\n\t\t\t\tsumSq.z = sumSq.z / k;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tvar idealFitness = sumSq.x + sumSq.y + sumSq.z;\n\t\treturn idealFitness;\n\t}", "title": "" }, { "docid": "a9cd7eb570311dfb125918d92ced4ec8", "score": "0.55085945", "text": "function fmin(f, x0, parameters) {\n parameters = parameters || {};\n\n var maxIterations = parameters.maxIterations || x0.length * 200,\n nonZeroDelta = parameters.nonZeroDelta || 1.1,\n zeroDelta = parameters.zeroDelta || 0.001,\n minErrorDelta = parameters.minErrorDelta || 1e-6,\n rho = parameters.rho || 1,\n chi = parameters.chi || 2,\n psi = parameters.psi || -0.5,\n sigma = parameters.sigma || 0.5,\n callback = parameters.callback,\n temp;\n\n // initialize simplex.\n var N = x0.length,\n simplex = new Array(N + 1);\n simplex[0] = x0;\n simplex[0].fx = f(x0);\n for (var i = 0; i < N; ++i) {\n var point = x0.slice();\n point[i] = point[i] ? point[i] * nonZeroDelta : zeroDelta;\n simplex[i + 1] = point;\n simplex[i + 1].fx = f(point);\n }\n\n var sortOrder = function(a, b) {\n return a.fx - b.fx;\n };\n\n var centroid = x0.slice(),\n reflected = x0.slice(),\n contracted = x0.slice(),\n expanded = x0.slice();\n\n for (var iteration = 0; iteration < maxIterations; ++iteration) {\n simplex.sort(sortOrder);\n if (callback) {\n callback(simplex);\n }\n\n if (Math.abs(simplex[0].fx - simplex[N].fx) < minErrorDelta) {\n break;\n }\n\n // compute the centroid of all but the worst point in the simplex\n for (i = 0; i < N; ++i) {\n centroid[i] = 0;\n for (var j = 0; j < N; ++j) {\n centroid[i] += simplex[j][i];\n }\n centroid[i] /= N;\n }\n\n // reflect the worst point past the centroid and compute loss at reflected\n // point\n var worst = simplex[N];\n weightedSum(reflected, 1 + rho, centroid, -rho, worst);\n reflected.fx = f(reflected);\n\n // if the reflected point is the best seen, then possibly expand\n if (reflected.fx <= simplex[0].fx) {\n weightedSum(expanded, 1 + chi, centroid, -chi, worst);\n expanded.fx = f(expanded);\n if (expanded.fx < reflected.fx) {\n temp = simplex[N];\n simplex[N] = expanded;\n expanded = temp;\n } else {\n temp = simplex[N];\n simplex[N] = reflected;\n reflected = temp;\n }\n }\n\n // if the reflected point is worse than the second worst, we need to\n // contract\n else if (reflected.fx >= simplex[N - 1].fx) {\n var shouldReduce = false;\n\n if (reflected.fx <= worst.fx) {\n // do an inside contraction\n weightedSum(contracted, 1 + psi, centroid, -psi, worst);\n contracted.fx = f(contracted);\n if (contracted.fx < worst.fx) {\n temp = simplex[N];\n simplex[N] = contracted;\n contracted = temp;\n } else {\n shouldReduce = true;\n }\n } else {\n // do an outside contraction\n weightedSum(contracted, 1 - psi * rho, centroid, psi * rho, worst);\n contracted.fx = f(contracted);\n if (contracted.fx <= reflected.fx) {\n temp = simplex[N];\n simplex[N] = contracted;\n contracted = temp;\n } else {\n shouldReduce = true;\n }\n }\n\n if (shouldReduce) {\n // do reduction. doesn't actually happen that often\n for (i = 1; i < simplex.length; ++i) {\n weightedSum(simplex[i], 1 - sigma, simplex[0], sigma - 1, simplex[i]);\n simplex[i].fx = f(simplex[i]);\n }\n }\n } else {\n temp = simplex[N];\n simplex[N] = reflected;\n reflected = temp;\n }\n\n }\n\n simplex.sort(sortOrder);\n return {\n f: simplex[0].fx,\n solution: simplex[0]\n };\n }", "title": "" }, { "docid": "f8ccd28f3acc602e0cdd1e8959d6509d", "score": "0.54932964", "text": "function MaybeOptimizeOrDeoptimize(f) {\n let x = Math.random(); // --random-seed makes this deterministic\n\n if (x <= 0.33) {\n ;\n } else {\n if (x <= 0.66) {\n ;\n }\n }\n}", "title": "" }, { "docid": "2a5778cca30ccfc830a91409f8fbebd9", "score": "0.5492259", "text": "function solve(f, y, x) {\n var steps = 100, delta, f0, f1;\n x = x === undefined ? 0 : +x;\n y = +y;\n do {\n f0 = f(x);\n f1 = f(x + epsilon);\n if (f0 === f1) f1 = f0 + epsilon;\n x -= delta = -1 * epsilon * (f0 - y) / (f0 - f1);\n } while (steps-- > 0 && abs(delta) > epsilon);\n return steps < 0 ? NaN : x;\n }", "title": "" }, { "docid": "b0bfc584cb1d5e01c8698159f2b32c51", "score": "0.547483", "text": "function calcFitness() {\n let sum = 0;\n for (bird of savedBirds) {\n sum += bird.score;\n }\n for (bird of savedBirds) {\n bird.fitness = bird.score / sum;\n }\n}", "title": "" }, { "docid": "8028ba3a983a839b38910fad4fbb87f2", "score": "0.5472081", "text": "normalizeFitness() {\n let sum = 0;\n for (let mem of this.deadPop) {\n sum += mem.fitness;\n }\n for (let mem of this.deadPop) {\n mem.fitness = mem.fitness / sum;\n }\n\n }", "title": "" }, { "docid": "c184e204b0090c112762032f89a9cfb6", "score": "0.54167724", "text": "function f1(x) {\n var a, b, c, d, e, f, g;\n return x <= 0 ? 0 : f1(x-1);\n}", "title": "" }, { "docid": "016cd982bb2208759b9af4eb557a0bf5", "score": "0.5410145", "text": "getMaxFitness() {\n let record = 0;\n for (let i = 0; i < this.population.length; i++) {\n if (this.population[i].getFitness() > record) {\n record = this.population[i].getFitness();\n }\n }\n return record;\n }", "title": "" }, { "docid": "c62683f7ef3c5ce1dbe74f9a83258cb3", "score": "0.5403961", "text": "function f(x) {\n if (x > 0) {\n return m(x);\n } else {\n return n(x);\n }\n}", "title": "" }, { "docid": "93c88d5b95accbfd278b40d544e2b143", "score": "0.5401795", "text": "function f(angle) {\n var base = Vector.CreateAngular(angle);\n \n for(var i = 0; i < bounds.length; ++i) {\n if(base.cross(Vector.CreateAngular(bounds[i].a)) >= 0 \n && base.cross(Vector.CreateAngular(bounds[i].b)) <= 0) {\n return bounds[i].n;\n }\n }\n \n console.log(\"Unable to find an equilibrium for the given angle.\");\n return 999;\n }", "title": "" }, { "docid": "ac320ef1d18b179ed3ce8968dfec13bf", "score": "0.53852564", "text": "function ga(n, count) {\n\t\tlet population = initPopulation(n);\n\t\t// console.log(population, 'init');\n\t\tfor (var i = 0; i < count; i++) {\n\t\t\tlet populationTemp = [];\n\t\t\tfor (var k = 0; k < n; k++) {\n\t\t\t\tpopulationTemp.push(population[k]);\n\t\t\t}\n\t\t\tfor (var j = 0; j < 2; j++) {\n\t\t\t\tlet tmp = crossOver(roulette(population));\n\t\t\t\tfor (var k = 0; k < 2; k++) {\n\t\t\t\t\tpopulationTemp.push(tmp[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpopulation = maxFitness(n, populationTemp);\n\t\t\t// for (var k = 0; k < 4; k++) {\n\t\t\t// \tconsole.log(population[k], fitness(population[k]));\n\t\t\t// }\n\t\t}\n\t\treturn population;\n\t}", "title": "" }, { "docid": "8d976c8f7f02ab638e60b7a10e6e739f", "score": "0.537688", "text": "_optimalAnyWith(f) {\n return this.exists(this._world.selfManager.askAgent(f));\n }", "title": "" }, { "docid": "e0945f176b6f157b176fe0ff5ee02349", "score": "0.53672063", "text": "evaluatePopulation() {\n let totalFitness = 0\n this.pop.forEach(function(agent) {\n let f = fitness(agent.str)\n agent.fitness = f\n totalFitness += f\n })\n this.pop.forEach(function(agent) {\n agent.fitness /= totalFitness\n }) \n this.pop.sort(function(agent1, agent2) {\n return agent2.fitness - agent1.fitness\n })\n }", "title": "" }, { "docid": "0b10d706395c7a35e866d2da2e096edd", "score": "0.5350513", "text": "function calculate_fitnesses(population){\n fitnesses=[];\n for (let index = 0; index < population_size; index++) {\n fitnesses.push(fitness(population[index]));\n }\n return fitnesses;\n}", "title": "" }, { "docid": "d536f63a10c83989da5bfc767ee36ce3", "score": "0.53417856", "text": "function popularityVoteFactory(opt) {\n // all scored organisms should have this much added to their votes\n var shift = opt.minPopularity * opt.popularityFactor;\n// var newFitness = _.assign({},fitnessById)\n \n /*\n * the arguments will be injected by the caller\n * when the sim is run\n */\n return function(organism,index,coll) {\n// console.log('called popularity fitness model with: ')\n// console.log(arguments)\n \n var count = 0;\n //Ok...\n \n //if the fitness is 0 return minPopularity with prob pLive\n if(organism.fitness == 0 ) {\n if(Math.random() < opt.pLive) {\n// console.log(\"**** organism \" + organism.name + \" is gonna live!!!\")\n count = opt.minPopularity\n }\n } else {\n count = organism.fitness + shift\n }\n \n// console.log(\"{popularityFitness}\",\n// organism.name,\n// organism.fitness,\n// count)\n return count;\n }\n \n// _.each(newFitness,\n// function(v,k,coll){\n// if( v > 0 ) {\n// coll[k] = v + popularityShift\n// } else if( Math.random() < pLive ) {\n// coll[k] = minPopularity;\n// } \n// })\n// \n// return newFitness;\n }", "title": "" }, { "docid": "9fad8b046a107d88b7ed27ccdb23be11", "score": "0.53063965", "text": "function normalizeFitness() {\n var sum = 0;\n for (var i = 0; i < fitness.length; i++) {\n sum += fitness[i];\n }\n for (var i = 0; i < fitness.length; i++) {\n fitness[i] = fitness[i] / sum;;\n }\n}", "title": "" }, { "docid": "33c4b6ece1d276e0736abb7296db2881", "score": "0.53046304", "text": "function byoFactorial(f, x) {\n if (x === 0) return 1\n return x * f(x - 1)\n}", "title": "" }, { "docid": "08b49e8881a30454875d7ac2ccbdaa36", "score": "0.5283714", "text": "function getFitness(indv) \n{\n // let unique = indv.filter((item, i, ar) => ar.indexOf(item) === i);\n let err = indv.filter(element => element === false);\n\n for (let idx = 0; idx < data_class_requirement.length; idx++) \n {\n data_class_requirement[idx][\"pref\"] = data_preferensi_dosen[indv[idx]];\n }\n let dengan_ruang = setRuangan();\n let problem = dengan_ruang.filter(element => element[\"pref\"][\"room_shift\"] === undefined);\n \n return calculateErrorFitness([err,problem]);\n}", "title": "" }, { "docid": "655f6316c0941f6cf41812c7f7ea2fd1", "score": "0.5253812", "text": "getMaxFitness() {\n let top = 0;\n for (let mem of this.deadPop) {\n if (mem.fitness > top) {\n top = mem.fitness;\n }\n }\n return top;\n }", "title": "" }, { "docid": "7d180b1104a5adef1180822873798340", "score": "0.52460116", "text": "fit2(f, g, m, n) {\n let i = 0;\n let result = [];\n while(i != n) {\n const x = random(this.mindensity, this.maxdensity);\n const prob = f(x)/(m * g(x));\n const u = Math.random();\n if(prob > u ) {\n result.push(x);\n i += 1;\n }\n\n }\n\n return result\n }", "title": "" }, { "docid": "15a8cc4bea0d9294a314145095c2e373", "score": "0.52324235", "text": "getFittest()\n {\n let fittest = this.tours[0];\n\n // Loop through individuals to find fittest\n for (let i = 0; i < this.populationSize(); i++) {\n // console.log(this.getTour(i))\n if (fittest.getFitness() <= this.getTour(i).getFitness()) {\n fittest = this.getTour(i);\n }\n }\n return fittest;\n }", "title": "" }, { "docid": "1a10ff07601aadf7d9b60e460a43eb0e", "score": "0.5198051", "text": "function simulatedAnnealing()\n{\n if(TEMP > 1e-4) // check if js can read 1e-4 as a float\n {\n\n \n var phenotype = initPopulation(numOfMeetings);\n var score = testFitness(phenotype);\n\n var newPhenotype = mutationFunction(phenotype);\n var newScore = testFitness(newPhenotype);\n\n if (newScore < score)\n {\n phenotype = newPhenotype;\n bestPhenotype = newPhenotype;\n return 1; // Accept new solution, Note the graph needs to be changed to depict the new employee locatiosn \n }\n else if (newScore > score)\n {\n var prob = Math.exp((score-newScore)/TEMP);\n return prob; // Probability of changing to a different phenotype\n }\n TEMP*=COOLING_RATE;\n}\n\n}", "title": "" }, { "docid": "98969c0808a293b6c08b99e792ff65ee", "score": "0.5188978", "text": "setAllFitness() {\n for (let mem of this.deadPop) {\n mem.fitness = Math.pow(mem.score, 2);\n }\n }", "title": "" }, { "docid": "c97cc71dc2da4a6155ad56648a4d4cb9", "score": "0.5163586", "text": "function g(x){ f(x); }", "title": "" }, { "docid": "6b8b6f75a332f2b6817e6f3b3dd69284", "score": "0.5160146", "text": "function minimaxValue(state) { ... }", "title": "" }, { "docid": "a71e4aa7bbc593be5ecd2d7b10b82cc8", "score": "0.51552236", "text": "function pointFixe(x0)\n{\n let h = function(x)\n {\n return f(x) + x;\n }\n let x1 = x0;\n let x2 = h(x1);\n let count = 0;\n while(Math.abs(x2 - x1) > epsilon && count <= 150000)\n {\n count++;\n x1 = x2;\n x2 = h(x1);\n }\n if(count >= 150000 || x2 >= asymptLimit)\n {\n x2 = \"Error computation\";\n }\n return (x2 = isZero(x2)).toFixed(powTen);\n}", "title": "" }, { "docid": "876b270d2dbbb314e80b6df8a842cec2", "score": "0.5145234", "text": "computeFuncValue(x){\n return this.currentFunction.compute(x, [0, this.state.params.b]);\n }", "title": "" }, { "docid": "308498807b898989f6b8ed709d2a50f1", "score": "0.5144403", "text": "adjustFitness(adjustment){\n this.fitness += adjustment;\n if (this.fitness > 100){\n this.fitness = 100;\n }\n if (this.fitness < 0){\n this.fitness = 0;\n }\n }", "title": "" }, { "docid": "a9e302650dd182f7ecb19e031b278e85", "score": "0.5143858", "text": "calculateFitness(clusters) {\r\n // Calculate distance fitness\r\n let fitness = this.calculateDistanceFitness(clusters);\r\n // Calculate energy fitness\r\n return fitness;\r\n }", "title": "" }, { "docid": "d6c7d1edd6a331a3db02949393487eff", "score": "0.51382405", "text": "calcFitness()\n {\n this.AIs.forEach(ai => {\n ai.calcFitness();\n })\n }", "title": "" }, { "docid": "c7355e0496eea323cca4417e45f72c85", "score": "0.51302785", "text": "calculateFitness() {\r\n for (var i = 0; i< this.players.length; i++) {\r\n this.players[i].calculateFitness();\r\n }\r\n }", "title": "" }, { "docid": "c06ce43564b67781d755f7e46b595d46", "score": "0.5127232", "text": "calculateFitness(target) // calculate fitness, receives target value \n {\n let score = 0;\n for ( let i=0; i < this.genes.length; i++)\n {\n if(this.genes[i] == target.charAt(i))\n {\n score ++; // increase score if any character is matched\n } \n }\n this.fitness = score/target.length ; // to have percentage\n this.fitness = Math.pow(this.fitness,2);\n }", "title": "" }, { "docid": "db27ad83b38c2cafff972abbd2663ec5", "score": "0.51166844", "text": "function _default(array, f) {\n var n = array.length,\n v = (0, _d3Array.deviation)(array, f),\n q = (0, _quartiles.default)(array, f),\n h = (q[2] - q[0]) / 1.34;\n v = Math.min(v, h) || v || Math.abs(q[0]) || 1;\n return 1.06 * v * Math.pow(n, -0.2);\n}", "title": "" }, { "docid": "8fe690c71c0813918580c12cbc1012c1", "score": "0.5116637", "text": "activation(sum) {\n if (sum > 0) return 1;\n else return -1;\n }", "title": "" }, { "docid": "f81fbfe4507eb754a2386e0f21de9103", "score": "0.51034856", "text": "function normalizeFitness(birds) {\n for (let i = 0; i < birds.length; i++) {\n birds[i].score = pow(birds[i].score, 2);\n }\n\n let sum = 0;\n for (let i = 0; i < birds.length; i++) {\n sum += birds[i].score;\n }\n for (let i = 0; i < birds.length; i++) {\n birds[i].fitness = birds[i].score / sum;\n }\n}", "title": "" }, { "docid": "ecea849e9b587d7acbc52905ec0171b2", "score": "0.5093954", "text": "function e(){return e.zero()}", "title": "" }, { "docid": "d8d61805605aa19116975c8454ca16e9", "score": "0.50664335", "text": "function calculate_fitness(arr) {\n\tvar sum = 0;\n\tfor (var i = 1; i < arr.length; i++)\n\t\tsum =\n\t\t\tsum +\n\t\t\tgeolib.getDistance(\n\t\t\t\tCORDINATES[arr[i]],\n\t\t\t\tCORDINATES[arr[i - 1]],\n\t\t\t\t0.01,\n\t\t\t);\n\tsum =\n\t\tsum +\n\t\tgeolib.getDistance(\n\t\t\tCORDINATES[0],\n\t\t\tCORDINATES[arr[arr.length - 1]],\n\t\t\t0.01,\n\t\t);\n\treturn sum;\n}", "title": "" }, { "docid": "c76837a0ccb2aa11ff63dc7bb0867c38", "score": "0.5062837", "text": "function Gammacdf(x,a){\r\n\tvar GI;\r\n\tif (x<=0) {\r\n\t\tGI=0\r\n\t} else if (x<a+1) {\r\n\t\tGI=gser(x,a)\r\n\t} else {\r\n\t\tGI=gcf(x,a)\r\n\t}\r\n\treturn GI\r\n}", "title": "" }, { "docid": "ffba570749298df003e4f21df3063abc", "score": "0.50568235", "text": "function zero(func) { \n if (func === undefined) return 0\n else return func(0)\n}", "title": "" }, { "docid": "3c17b060d972e4eca8d4e143257a4f20", "score": "0.5051179", "text": "function f(x) {\n return 5*x*x;\n }", "title": "" }, { "docid": "27b0ce4c9023556d6a185051987962d4", "score": "0.5041407", "text": "function bfgFunc(x,a)\n{\n for (var i=0;i<a.length;i+=4) {\n if (x>=a[i] && x<=a[i+2]) {\n\t var y = (((x-a[i])/(a[i+2]-a[i])) * (a[i+3]-a[i+1])) + a[i+1];\n\t return y;\n\t}\n }\n return NaN;\n}", "title": "" }, { "docid": "efe7f2dda0b86aa8ea726f7cb1b20521", "score": "0.50393933", "text": "function g() {\n\treturn 0;\n }", "title": "" }, { "docid": "ff973a672ce052647607fff90bc52594", "score": "0.503747", "text": "findGX(func, lambda)\n {\n return function(x)\n {\n return lambda*func(x)+x;\n };\n }", "title": "" }, { "docid": "47aeb17916090ff3ba2de58326a007ed", "score": "0.5025228", "text": "function faculteit (x){\n var result =1; // anders dan in hoofd programma\n for(var j = 2; j <= x; j++){\n result*=j;\n }\n return result; // uitkomst van deze functie\n}", "title": "" }, { "docid": "fbd795bcd0501dade3963b480a448ba9", "score": "0.5020902", "text": "getFx() {\n const B2 = x => this.B * this.frequencyMod(x);\n const C2 = x => this.C + this.phaseMod(x); \n const fx = x => {\n const a = this.A;\n const b = B2(x);\n const c = C2(x);\n const d = this.D;\n const func = this.rootfx;\n return a * func(b * (x + c)) + d;\n //note the form: b * (x + c), instead of: b * x + c\n //normally c = (-phaseShift * b), but we're intentionally factoring out the b.\n //This is so we can wait until generating fx to combine b and c, so they can be\n //changed arbitrarily. so therefore it became bx + bc, which factors to: b(x + c).\n };\n return fx;\n }", "title": "" }, { "docid": "a310cb48fdf3e1c8a1e9c867212f366a", "score": "0.501315", "text": "acceptanceProbability (fitness_difference, temperature) {\n return Math.exp(fitness_difference / temperature);\n }", "title": "" }, { "docid": "413f7db94f9acf1d4bd6d758559ec1ef", "score": "0.50042176", "text": "function solve(f, y, x) {\n var steps = 100,\n delta,\n f0,\n f1;\n x = x === undefined ? 0 : +x;\n y = +y;\n\n do {\n f0 = f(x);\n f1 = f(x + _math.epsilon);\n if (f0 === f1) f1 = f0 + _math.epsilon;\n x -= delta = -1 * _math.epsilon * (f0 - y) / (f0 - f1);\n } while (steps-- > 0 && (0, _math.abs)(delta) > _math.epsilon);\n\n return steps < 0 ? NaN : x;\n} // Approximate Newton-Raphson in 2D", "title": "" }, { "docid": "8cfffecfcc2613d918e25fd6df1d5e5d", "score": "0.50010765", "text": "setFitnessCalc(callback) {\n this.fitnessCalculation = callback;\n }", "title": "" }, { "docid": "e05869b4257bde8e2b3e82cb38b256cb", "score": "0.49872157", "text": "averageFitness(strategy, map) {\n let totalScore = 0\n for (let i=0; i<this.numberOfSimulations; i++) {\n totalScore += this.testFitness(strategy, map)\n }\n return totalScore / this.numberOfSimulations\n }", "title": "" }, { "docid": "ca392d65a9fbcb5ec1ba54ec735b382e", "score": "0.49778435", "text": "getAverageFitness()\n {\n let total = 0;\n for (let i = 0; i < this.population.length; i++) {\n total += this.population[i].fitness;\n }\n return total / (this.population.length);\n }", "title": "" }, { "docid": "3c0c8f68ea026fc8cb2f990c9282c6e0", "score": "0.49716613", "text": "getFittest() {\n let fittest = this.tours[0];\n // Loop through individuals to find fittest\n for (let i = 1; i < this.size(); i++) {\n if (fittest.getFitness() <= this.getTour(i).getFitness()) {\n fittest = this.getTour(i);\n }\n }\n return fittest;\n }", "title": "" }, { "docid": "6c773ece746b3415891384145897ae1a", "score": "0.49638316", "text": "function genetic_TSP() {\n\tcreate_initial_population();\n\tlet iterations = 0;\n\tlet limit = N ** (5 / 2);\n\twhile (iterations < limit) {\n\t\tselect_best_genes();\n\t\tcrossover();\n\t\tif (iterations % 20 == 0) mutation();\n\t\titerations++;\n\t}\n\tselect_best_genes();\n\treturn [PARENTS[0], calculate_fitness(PARENTS[0])];\n}", "title": "" }, { "docid": "94e602518c1916c3f000a280d417b32d", "score": "0.49607775", "text": "function _gpfEmptyFunc () {}", "title": "" }, { "docid": "47a400290b3ae441074075db6dafbf47", "score": "0.49546483", "text": "getAverageFitness() {\n\n }", "title": "" }, { "docid": "b468ee75b1d5c9778b2c0561509f16e4", "score": "0.49508715", "text": "function findFitnessRating() {\n\tvar closenessModifier = 1;\n\tvar areaModifier = 1;\n\tvar areaFactor = 200;\n\n\tvar closeness = findClosenessRating();\n\tvar area = findAreaRating(areaFactor);\n\tvar total = (closeness * closenessModifier) + (area * areaModifier);\n\n\tconsole.log(\"closeness\", closeness, \"area\", area, \"total\", total);\n\n\treturn total;\n}", "title": "" }, { "docid": "771c515be4926415b0810af46768bcfb", "score": "0.4931086", "text": "partialDerevative(i, j, x0) {\n const f = this.coordinatesFunctions[i];\n const h = Math.pow(10, -5);\n const x0_ = [...x0];\n\n x0_[j] += h \n\n return (f(x0_) - f(x0)) / h;\n }", "title": "" }, { "docid": "977a344988176ffb2b198a4dd81159f0", "score": "0.49288273", "text": "function schwefel(x){ \n bound = 500 ;\n lower_bound = -bound;\n upper_bound = bound;\n d = x.length;\n total_sum = 0;\n total_prod = 1;\n for (let i = 0; i < d ; i++) {\n total_sum += x[i] * Math.sin( Math.sqrt( Math.abs( x[i] ) ) );\n }\n return -total_sum ;\n}", "title": "" }, { "docid": "1741f158010c0f3533db14f7616c8ac9", "score": "0.49253651", "text": "function g(f, x, name) {\n var v2 = f(x);\n for (var i = 0; i < 13000; i++) {\n f(i);\n }\n var v1 = f(x);\n assertEquals(v1, v2);\n}", "title": "" }, { "docid": "94bd2f46736b03dcfd9d1bf0b5dc3b17", "score": "0.49137384", "text": "function f(t,e){0}", "title": "" }, { "docid": "7e10af5c2de9164208c012440a9e0000", "score": "0.49101514", "text": "function high0(x){\n return function(y){\n return x+y;\n }\n}", "title": "" }, { "docid": "625fb7ad62d2d7d7f7c12b335cb2c45d", "score": "0.48916596", "text": "tournamentSelection () {\n let tourTournamentIndex = [],\n randomIndex;\n // Selecting some of the tours from population at random. \n // Storing the index. \n while (tourTournamentIndex.length < this.tournamentSize) {\n randomIndex = floor (random () * this.size);\n if (!tourTournamentIndex.includes(randomIndex))\n tourTournamentIndex.push(randomIndex);\n } // end of while loop. \n\n let fittestJourney = this.tours[tourTournamentIndex[0]],\n fittestValue = this.tours[tourTournamentIndex[0]].fitness(),\n fitValue = 0;\n for (let i = 0; i < tourTournamentIndex.length; i++) {\n fitValue = this.tours[tourTournamentIndex[i]].fitness();\n if (fitValue > fittestValue) {\n fittestValue = fitValue;\n fittestJourney = this.tours[tourTournamentIndex[i]];\n }\n }\n return fittestJourney;\n }", "title": "" }, { "docid": "f7230f72f85a9925c596001778ac6226", "score": "0.48899156", "text": "f(x)\n\t{\n\t\treturn this.m*x + this.b;\n\t}", "title": "" }, { "docid": "b8a41a95c7c973a986072fe050d7b443", "score": "0.488871", "text": "function setFitness(id,fitness) {\n currentGeneration[id-1][0] = fitness;\n}", "title": "" }, { "docid": "a26fc2566e15954da66a760022ef5db3", "score": "0.48873314", "text": "function f(x) {\r\n\t//return Math.pow(x,2);\r\n\treturn x*2;\r\n}", "title": "" }, { "docid": "2603d66b0f912d05ef071ea9f2872008", "score": "0.4883621", "text": "function realFunc(x) {\n return -0.8 * Math.pow(x, 3) - 0.2 * Math.pow(x, 2) + 0.9 * x + 0.5;\n}", "title": "" }, { "docid": "07c1ed577c2073c81615234990fa28f7", "score": "0.48757792", "text": "getAverageFitness() {\n let total = 0;\n for (let i = 0; i < this.population.length; i++) {\n total += this.population[i].fitness;\n }\n return total / (this.population.length);\n }", "title": "" }, { "docid": "acba53799f85d961d7eeb04d4aca2236", "score": "0.48665723", "text": "function _default(inputs, outputs, feeRate, options) {\n var sortedInputs = inputs.sort(sorts.score(feeRate));\n var algorithm = (0, _tryconfirmed[\"default\"])(utils.anyOf([(0, _bnb[\"default\"])(0.5), _accumulative[\"default\"]]), options);\n return algorithm(sortedInputs, outputs, feeRate, options);\n}", "title": "" }, { "docid": "1a117d47816b66ad17d1d97f40982ba6", "score": "0.48584962", "text": "function derivative(f) {\n return function(x) {\n (f(x + 0.00001) - f(x)) / 0.00001;\n };\n}", "title": "" }, { "docid": "570e3494831e150e8b40ec7137dee2df", "score": "0.4844411", "text": "function l(e){return f(e,!0)}", "title": "" }, { "docid": "19834aa61ae6807b6ecfbac27b747530", "score": "0.48438576", "text": "iszero(x) { return numval(x)==numzero(this.p); }", "title": "" }, { "docid": "4e9738ed20da26cbf2d9387f1a342892", "score": "0.48359576", "text": "score(inputs, output) {\n var d = Math.sqrt(\n Math.pow(0.5 - inputs[0], 2) + Math.pow(0.5 - inputs[1], 2)\n );\n d = Math.abs(d - output) + 0.1;\n return 1 / d;\n /*var a = this.trainingData[this.population[individual].iteration][0];\n var b = this.trainingData[this.population[individual].iteration][1];\n var score = Math.abs(a - b);\n var score = 100 * Math.abs(score - this.population[individual].outputs[0]);\n var score = 1 / (score + 0.1);\n return score;*/\n }", "title": "" }, { "docid": "4b248b91d7135dee5217c78616514aea", "score": "0.4804157", "text": "function _calculate_(x){\n return false;\n}", "title": "" }, { "docid": "67e8825dca7ff63644a84ec8bdd24b5a", "score": "0.4797965", "text": "function x(e) { return Math.min(Math.max(e, 0), 1) }", "title": "" }, { "docid": "6d9160c5ce3efba236d5681977f1aa37", "score": "0.47961697", "text": "function zero(func) {\n return func ? func(0) : 0; }", "title": "" }, { "docid": "44de5b107a1a839e0ce9a1a23273ad4c", "score": "0.47930536", "text": "function maxFitness(n, population) {\n\t\tlet arrFitness = population.sort(function(a, b) {\n\t\t\tif (fitness(a) > fitness(b)) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tif (fitness(a) < fitness(b)) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t});\n\t\treturn arrFitness.slice(0, n);\n\t}", "title": "" }, { "docid": "2c334211580f8c6042ce6df6176f0785", "score": "0.4789872", "text": "function methodNewton(x0)\n{\n let f2 = fDerivate(f, 0.01);\n let x1 = x0;\n let x2 = x1 - f(x1) / f2(x1);\n while(Math.abs(x2 - x1) > epsilon)\n {\n x1 = x2;\n x2 = x1 - f(x1) / f2(x1);\n }\n if(isNaN(x2))\n {\n x2 = \"Asymptote\";\n }\n return (x2 = isZero(x2)).toFixed(powTen);\n}", "title": "" }, { "docid": "9b88a20d3ce4f306e2b58b6b8fec672b", "score": "0.47694206", "text": "function fn_g(x) {\n if (x >= 6 / 29) {\n return x * x * x;\n } else {\n return (108 / 841) * (x - 4 / 29);\n }\n }", "title": "" }, { "docid": "8820fb1d538650e3ef2635517d38ab24", "score": "0.47635165", "text": "function f(){}", "title": "" }, { "docid": "8820fb1d538650e3ef2635517d38ab24", "score": "0.47635165", "text": "function f(){}", "title": "" }, { "docid": "8820fb1d538650e3ef2635517d38ab24", "score": "0.47635165", "text": "function f(){}", "title": "" } ]
c31fd9dcebe2f2b8cf63feab64dd7d18
47. Write a function called isPrime, which checks if a number is prime number.
[ { "docid": "562de7247e10c2129399ab3106e5b22c", "score": "0.78077006", "text": "function isPrime (n) {\n if(n > 0 && n % n === 0 && n / 1 === n) {\n return 'Is Prime number'\n } else {\n return 'Is not'\n }\n}", "title": "" } ]
[ { "docid": "010f7b5665a1a596dd16c1eef4567b2d", "score": "0.9021687", "text": "function isPrime() {}", "title": "" }, { "docid": "45136f1ad376bd14dc0812070a4fad05", "score": "0.88867354", "text": "function isPrime(num) {\n\n}", "title": "" }, { "docid": "a63f658278058ebee43c7d3de0949f95", "score": "0.87822366", "text": "function isPrime() {\n \n }", "title": "" }, { "docid": "77c8166c5dd34e7b751b3d3c3e83dbf7", "score": "0.8673108", "text": "function isPrime(n) {\n\n}", "title": "" }, { "docid": "ffd78789eb3c79ad889118bd303b78b9", "score": "0.8590445", "text": "function isPrime (value) {\n // Put your code here...\n}", "title": "" }, { "docid": "5853e08dfd6f2c7f114a901833e4af44", "score": "0.811608", "text": "function isPrime (n)\n\n// from http://stackoverflow.com/questions/11966520/how-to-find-prime-numbers\n//\n// Credit: David S\n// http://stackoverflow.com/users/414414/davids\n// \n\n{\n if (n < 2) return false;\n\n /**\n * An integer is prime if it is not divisible by any prime less than or equal to its square root\n **/\n\n var q = parseInt(Math.sqrt (n), 10);\n for (var i = 2; i <= q; i++)\n {\n if (n % i == 0)\n {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "fcb75821341a573dc964a04a5f2577ef", "score": "0.80607814", "text": "isPrime(num) {\r\n if (num <= 1)\r\n return false;\r\n for (var i = 2; i < num; i++) {\r\n if (num % i === 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "d56849cc394a3b4ecd11e62d51818a2d", "score": "0.804068", "text": "function isPrime_v1( number ) {\n_debug(\"test1\");\n if( number < 2 || number != Math.floor(number) ) {\n _debug(\"[ERROR] Unexpected input \" + number + \" at function isPrime\");\n return false;\n }\n\n for( var i=3; i <= Math.sqrt(number); i+=2 ) {\n if( number % i ==0 ) {\n _debug( number + \" divisible by \" + i );\n return false;\n }\n }\n\n _debug( \"* \" + number + \" is prime\" );\n return true;\n}", "title": "" }, { "docid": "523d13fbbffea822c85dcd5969739d3b", "score": "0.7933811", "text": "isPrime(num){\n if(num<0){return false}\n for(let i=2; i<num; i++){\n if(num % i === 0){return false}\n }\n return num !== 1;\n }", "title": "" }, { "docid": "f03e54f03c624193231eda2af36877ad", "score": "0.7879747", "text": "function isPrime(number){\n if(number < 2){\n return false;\n };\n for(var i = 2; i < number; i++){\n if(number % i === 0){\n return false;\n };\n }\n return true;\n}", "title": "" }, { "docid": "a43cd90451070e6b282084a86dd23302", "score": "0.7865601", "text": "function isPrime(number) {\r\n for (let factor = 2; factor < number; factor++)\r\n if (number % factor === 0) return false;\r\n return true\r\n}", "title": "" }, { "docid": "31f4ee8fa4fed73210b4d1b763593266", "score": "0.78654206", "text": "function isPrime(integer) {\n for (var x = 2; x < integer; x++) {\n if (integer % x === 0) {\n console.log(integer + \" is divisible by \" + x);\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "c4b586654b14a09806906ab57a202339", "score": "0.7821967", "text": "function isPrime(num) {\n for (var i = 2; i < num; i++) if (num % i == 0) return false;\n return num >= 2;\n}", "title": "" }, { "docid": "b7de5655c9c172aed4f06d4c57464097", "score": "0.7814451", "text": "function isPrime(number) {\r\n if (number >= 2) {\r\n let flag = 0;\r\n for (let index = 2; index <= number / 2; index++) {\r\n if (number % index == 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if (flag == 0)\r\n return true;\r\n else\r\n return false;\r\n }\r\n else\r\n return false;\r\n}", "title": "" }, { "docid": "63d086cdab2100453c6bc5fe7343a5a2", "score": "0.78110194", "text": "function isPrime(int){\nfor(var j = 2; j <= int/j; j++){\n if(int%j === 0){\n return false\n \n}\n }\n return true\n}", "title": "" }, { "docid": "87c7e75bd34ed40ad1b518b0cd7daf33", "score": "0.7809533", "text": "function primeNumber(number) {\n if (number % number === 0 && number % 1 === 0 && number % 2 !== 0 && number % 3 !== 0) {\n return \"True\";\n } else {\n return \"False\";\n }\n}", "title": "" }, { "docid": "6c05887b39cbbf2ecf6e7438bf524a2b", "score": "0.7795538", "text": "function isPrime(x){\n if(x==1){\n return false;\n }\n else if(x==2){\n return true;\n }\n else\n {\n for(i=2;i<x;i++){\n if(x%i==0){\n return false;\n }\n }\n \n return true;\n }\n\n}", "title": "" }, { "docid": "a4f8a18487328818eec8ffd3f248eaeb", "score": "0.7787974", "text": "function isPrime (number) {\n if (number === 2) {\n return true;\n } else if (number > 0) {\n for (let i = 2; i < number; i++) {\n if (number % i !== 0) {\n return true;\n } else if (number === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "a4f8a18487328818eec8ffd3f248eaeb", "score": "0.7787974", "text": "function isPrime (number) {\n if (number === 2) {\n return true;\n } else if (number > 0) {\n for (let i = 2; i < number; i++) {\n if (number % i !== 0) {\n return true;\n } else if (number === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "65820f3aa22ccd1a7aeed66538aba119", "score": "0.777203", "text": "function isPrime(number) {\n for(var a = 2; a < number ; a ++) {\n if(number % a === 0){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a15e190b9538323205802c3ba19ca316", "score": "0.77655584", "text": "function isPrime(n)\r\n{\r\n var flag=0;\r\n for(let i=2 ; i < n/2 ; i++) {\r\n if(n%i === 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if(flag == 0) {\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "b9be94e7ff1d1fba518b419c6f4ee868", "score": "0.7754913", "text": "function isPrime (number) {\n if(number === 1) {\n return false;\n }\n else if(number === 2) {\n return true;\n }else{\n for (var i = 2; i<number; i++) {\n if(number % i === 0)\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "1fde32af86e1d90434766d20c1327b49", "score": "0.7752254", "text": "function isPrime(n) {\n var divisor = 2;\n while (n > divisor) {\n if (n % divisor == 0) {\n return false;\n } else {\n divisor++;\n }\n }\n return true;\n}", "title": "" }, { "docid": "ef37785f3788ba6b879c71e61abd7393", "score": "0.7751836", "text": "function isPrime(num){\n for(var i=2; i < num; i++){\n \tif(num%i === 0){\n \t\treturn false;\n \t}\n }\n return true;\n}", "title": "" }, { "docid": "7199b80df5d3f2d38bcbf57557633c4a", "score": "0.7746392", "text": "function isPrime(number) {\n if (number < 2) return false;\n \n for (var i = 2; i < number; i++) {\n if (number % i === 0) return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "886ea2447165581b8d673cbb94148a8d", "score": "0.7745092", "text": "function isPrime(num){\n for(var i=2; i<num; i++){\n if(num % i == 0 || num <= 1){\n return false;\n } else{\n return true;\n }\n } \n }", "title": "" }, { "docid": "bd404292f856ef2a83d618aeda9fa690", "score": "0.7744281", "text": "function isPrime(n)\r\n{ \r\n//this function will check wether the number is prime or not \r\n if (n===1)\r\n {\r\n return false;\r\n }\r\n else if(n === 2)\r\n {\r\n return true;\r\n }else\r\n {\r\n for(var x = 2; x < n; x++)\r\n {\r\n if(n % x === 0)\r\n {\r\n return false;\r\n }\r\n }\r\n return true; \r\n }\r\n}", "title": "" }, { "docid": "11679be59e6fa6f3087580662a3d10db", "score": "0.7742416", "text": "function isPrime(x) {\n for (var i = 2; i <= x/2; i++) {\n if (x % i === 0) {\n return false\n }\n }\n return x > 1;\n}", "title": "" }, { "docid": "11679be59e6fa6f3087580662a3d10db", "score": "0.7742416", "text": "function isPrime(x) {\n for (var i = 2; i <= x/2; i++) {\n if (x % i === 0) {\n return false\n }\n }\n return x > 1;\n}", "title": "" }, { "docid": "1197412495d6b1cd6c8afd92637ff457", "score": "0.7738997", "text": "function is_prime(num) {\n if (num === 1) return true;\n if (num === 2) return true;\n for (var i = 2; i <= Math.floor(Math.sqrt(num)); i++) {\n if (num%i === 0) return false;\n }\n return true;\n}", "title": "" }, { "docid": "589ea13da7d2e0e80448fc4fb0fe896a", "score": "0.77354556", "text": "function isPrime(n)\r\n {\r\n var flag=0;\r\n for(let i=2 ; i < n/2 ; i++) {\r\n if(n%i === 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if(flag == 0) {\r\n return true;\r\n }\r\n }", "title": "" }, { "docid": "d8e709e31649857bc3a1472cdb82b011", "score": "0.773514", "text": "function isPrime(prime) {\n\tfor(i = 2; i <= (prime/2); i++) {\n\t\t\tif(prime%i == 0){\n\t\t\t\treturn false;\n\t\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "bb085275766be11a0c495af32cf70b68", "score": "0.77288544", "text": "function isPrime (num) {\n if (num === 2) {\n return true;\n } else if (num > 0) {\n for (let i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "c54e405b68b7cc5288009b09a96cab8d", "score": "0.77212274", "text": "function is_prime(number) {\n\tfor (var i = 2; i <= Math.sqrt(number); i++) {\n\t\tif (number % i === 0) {\n\t\t\treturn false;\n\t\t} \n\t}\n\treturn true;\n}", "title": "" }, { "docid": "fb6404bcae1360653e0e4f5894fcbb64", "score": "0.77211255", "text": "function isPrime (num) {\n if (num === 2) {\n return true;\n } else if (num > 1) {\n for (let i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "fb6404bcae1360653e0e4f5894fcbb64", "score": "0.77211255", "text": "function isPrime (num) {\n if (num === 2) {\n return true;\n } else if (num > 1) {\n for (let i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n }\n}", "title": "" }, { "docid": "5d85fae77a6e7fd1d6b4f5ad2cff7086", "score": "0.7718019", "text": "function isPrime(num) {\n for(var i = 2; i < num; i++)\n if(num % i === 0) return false;\n return num > 1;\n }", "title": "" }, { "docid": "5bf96b641069904bbcb63e0594325633", "score": "0.77172637", "text": "function isPrime(num) {\n if(num < 2) return false;\n for (var i = 2; i < num; i++) {\n if(num%i==0)\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "43d133ec184f586fdbb4593f24e978fa", "score": "0.77121335", "text": "function isPrime(n)\n{\n\n if (n===1)\n {\n return false;\n }\n else if(n === 2)\n {\n return true;\n }else\n {\n for(var x = 2; x < n; x++)\n {\n if(n % x === 0)\n {\n return false;\n }\n }\n return true; \n }\n}", "title": "" }, { "docid": "2d778eb175ad2f3a536d810585f79cc1", "score": "0.770556", "text": "function isPrime(num) {\n for (var ii = 2; ii < num; ii++) {\n if (num % ii === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "813654229725459eb5e4090864f2d533", "score": "0.77044", "text": "function isPrime(num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return false\n }\n }\n return num > 1;\n}", "title": "" }, { "docid": "43827d2b870f631cf52ba04e007d6a32", "score": "0.76992303", "text": "function isPrime(num) {\r\n if(num < 2) return false;\r\n for (var i = 2; i < num; i++){\r\n if (num%i == 0) return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "f825f1a53dcfec02fac73fd67426de64", "score": "0.7698338", "text": "function isPrime(num) {\n if(num < 2) return false;\n for (var i = 2; i < num; i++) {\n if(num%i==0)\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "c7c27c99b111ab79b59e386049d56234", "score": "0.7698328", "text": "function is_prime(number){\n \n if(number <= 1){\n return false\n }\n \n for(var i = 2; i < number; i++){\n if(number % i === 0){\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "ac91ce0fe1c960c6018aa9646d3b7bce", "score": "0.7694335", "text": "function isPrime(n) {\r\n var remi;\r\n var tru = 1; //\r\n for (i = n - 1; i > 1; i - 1) {\r\n remi = n%i;\r\n if (remi === 0) {\r\n tru = 0;\r\n }\r\n }\r\n if (n === 1) {\r\n tru = 0;\r\n }\r\n if (n === 2) {\r\n tru = 1;\r\n }\r\n if (tru === 1) {\r\n return true \r\n } else {\r\n return false \r\n }\r\n}", "title": "" }, { "docid": "5b5d7c172227a239f2e7456e0e309371", "score": "0.76921314", "text": "function isPrime(number) {\n if (number < 2) {\n return false; \n }\n \n for (let current = 2; current < number; current += 1) {\n if (number % current === 0) {\n return false; \n }\n }\n \n return true;\n}", "title": "" }, { "docid": "88dbb2b7d850784719eb041307431c87", "score": "0.7690928", "text": "function isPrime(n){\n\tif (!isPrime.cache){\n\t\tisPrime.cache = {};\n\t}\n\tif (typeof isPrime.cache[n] !== 'undefined')\n\t\treturn isPrime.cache[n];\n\n\tconsole.log('processing ', n);\n\tisPrime.cache[n] = true;\n\tfor(var index = 2, count = (n/2); index < count; index++){\n\t\tif (n % index === 0){\n\t\t\tisPrime.cache[n] = false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn isPrime.cache[n];\n}", "title": "" }, { "docid": "a40718dcc51598497eabbdf8c4f44870", "score": "0.7684783", "text": "function isPrime(int) {\n // see if argument is natural number,\n // create a loop and iterate up to the integer\n // see if the number is devisable by any numbers other than 1 & the int\n\n for (let i = 2; i < int; i++) {\n if (int % int[i]) return false;\n else return true;\n }\n}", "title": "" }, { "docid": "a8f36977a4875e7f8a581ce9abc734f4", "score": "0.76833194", "text": "function isPrime(x) {\n var counter = 0;\n for(var i=2; i<x; i++) {\n if(x%i===0) {\n counter++;\n }\n }\n if(counter>0) {\n return \"The number is not a prime.\"\n } else {\n return \"The number is a prime.\"\n }\n}", "title": "" }, { "docid": "64cdc0df944dbf50b01739a2994eba37", "score": "0.7670089", "text": "function isPrime(num) {\n num = num +4;\n}", "title": "" }, { "docid": "fbac592f5d358e72708b6a069b6d7031", "score": "0.7666927", "text": "function isPrime(n) {\n for(var i = 2; i < n; i++) {\n if(n % i == 0) {\n return false;\n }\n }\n return n > 1;\n}", "title": "" }, { "docid": "49318957001f1e9e2ccf433545731f98", "score": "0.7659166", "text": "function isPrime(num) {\n if (num == 2) {\n return true;\n } else if (num > 1) {\n for (let i = 2; i < num; i++){\n if (num % i !== 0) {\n return true;\n } else if (num === i * 1) {\n return false\n } else {\n return false\n }\n }\n }\n }", "title": "" }, { "docid": "056f1a7c59535c400eb14abfb087bd70", "score": "0.76539165", "text": "static isPrime(n) {\n for (var i = 2; i < n / 2; i++) {\n if (i % n == 0) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "3562cb43ecb398972758671aae2de8f1", "score": "0.7653206", "text": "function is_prime(num){\n var sqrt = Math.sqrt(num);\n for(var i = 2; i <= sqrt; i++){\n if(num % i == 0){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "097f3cd8e0813ae37b2ad6f067db828d", "score": "0.7652669", "text": "function isPrime(num) {\n if (num < 2) {\n return false;\n }\n\n for (var i = 2; i < num; i++) {\n if (num % i == 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "e09a1c60eba20358e6770494f5e7d40d", "score": "0.7651831", "text": "function isPrime(num) {\n\n for (let i = 2; i < num; i++) {\n if (num % i === 0) return false;\n }\n return true;\n}", "title": "" }, { "docid": "04681168de1b31a33cfc77e131ba9270", "score": "0.76497865", "text": "function isPrime(n){\n for(var i=2;i<=Math.floor(Math.sqrt(n));i++){\n if(n%i===0){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "826a422c342b8a2da7e6283f6b1ff0a6", "score": "0.76474786", "text": "function isPrime (num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) { return false }\n }\n return true\n}", "title": "" }, { "docid": "3dcb80699829c2c8cfb8fd6fcdcfe17e", "score": "0.76472384", "text": "function isPrime(num){\n\tfor (var i = 2; i < num; i++) {\n\t\tif (num % i == 0) {\n\t\t\treturn false;\n\t\t}\n\t};\n\treturn true;\t\n}", "title": "" }, { "docid": "92cd6a7e0d3100ce65dee6b0e39e8369", "score": "0.7640165", "text": "function isPrime(num) {\n if (num === 2) {\n return true;\n } else if (num > 1) {\n for (var i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "25b00f614efe9046059af3e6384c9e93", "score": "0.7640012", "text": "function isPrime(n)\n{\n if(n==2 || n==3)return true;\n else if(n%2===0 || n%3===0)return false;\n else{\n var i=5;\n while(i<=n/2)\n {\n if(n%i===0)\n {\n return false;\n }\n i++;\n }\n }\n return true;\n}", "title": "" }, { "docid": "87b5b891f1d22af9a8936749554d5170", "score": "0.76399034", "text": "function isPrime(n){\n // add whatever parameters you deem necessary - good luck!\n for(let i = 2; i < Math.sqrt(n); i++){\n if(n % i === 0) return false;\n }\n return true;\n}", "title": "" }, { "docid": "60dddd6196c3e93c65b430ddda2c4bc2", "score": "0.7632376", "text": "function isPrime(n) {\n if(n === 0)\n return false;\n else if(n === 2)\n return true;\n else \n for(var i = 2; i < n; i++)\n if(n % i === 0)\n return false;\n \n return true;\n}", "title": "" }, { "docid": "650614d205a7dc36fefce7df6d8fba6f", "score": "0.763093", "text": "function isPrime(a) {\n if (a === 1) {\n return false;\n } else if (a === 2) {\n return true;\n } else {\n for (var i = 2; i < a; i++) {\n\n if (a % i === 0) {\n return false;\n\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "5883d4850747c619a6fd2a44f519bbdb", "score": "0.76226103", "text": "function isPrime(n){\n if (n===1) {\n return false;\n }else if(n === 2){\n return true;\n }else{\n for(var x = 2; x < n; x++){\n if(n % x === 0){\n return false;\n }\n }\n return true; \n }\n }", "title": "" }, { "docid": "5a15ea184f2d082f4489359e72e77b4e", "score": "0.7617182", "text": "function isPrimeNumber(x) {\n // viết code ở đây.\n if (x < 2) return false\n else if (x == 2 || x == 3) return true\n else if (x > 3) {\n var checkbool1 = 1;\n loop1:\n for (index = 2; index < (x / 2); ++index) {\n\n if (x % index == 0) {\n\n checkbool1 = 0;\n break loop1;\n }\n\n }\n if (checkbool1 == 0) return false;\n else return true;\n\n\n\n }\n}", "title": "" }, { "docid": "7ef6f711598c999d767412b10278aecd", "score": "0.7617032", "text": "function isPrime(i){\n if(i<2) return false;\n else{\n for(var j = 2;j<=Math.sqrt(i);j++){\n if(i%j==0){\n return false;\n break;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "ee42b15d9c6c7039ce98690408c715fe", "score": "0.7598536", "text": "function isPrime(n)\n{\n for(let i=2; i<n;i++){\n if(n%i==0) \n {\n return 0;\n }\n }\n\n return 1;\n}", "title": "" }, { "docid": "218632749f35550857d5c9f27877c5ef", "score": "0.75970846", "text": "function isPrime(num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "218632749f35550857d5c9f27877c5ef", "score": "0.75970846", "text": "function isPrime(num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "9765eed1328ea3478bf6a82b9576de1c", "score": "0.7591901", "text": "function isPrime(num) {\n // Prime number starts with 2\n if (num < 2) return false;\n for (let i = 2; i < num; i++) {\n // Divide the number by the increment -- Check if remainder is 0 (Prime numbers have a remainder)\n if (num % i === 0) return false;\n }\n return true;\n}", "title": "" }, { "docid": "232dea6aff7266f46266465af41d7d1e", "score": "0.7591505", "text": "function isPrime(num){\n if (num < 2){\n return false;\n }\n for (var i = 2; i < num; i++){\n if (num % i === 0){ //divide by each i leading up to num to check for remainders (i.e, 'not a prime')\n return false;\n }\n }\n return true; //loop concludes and num is a prime number\n}", "title": "" }, { "docid": "e5c4f1c24038ad8ef2e263b66ffd9a24", "score": "0.75877047", "text": "function isPrimeNumber(n) {\n if (n === 1) {\n return false;\n } else if (n === 2) {\n return true;\n } else {\n for (var x = 2; x <= n / 2; x++) {\n if (n % x === 0) {\n return false;\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "629fb82c07e0c53c6b569432e1d5480a", "score": "0.7582067", "text": "function isPrimeNumber(number) {\n if (number <= 0) {\n return false;\n }\n for (var i = 0; i < number; i++){\n if (number % i === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "e4da6ba7ee87e8cf74daf8154f0a5daa", "score": "0.7572864", "text": "function isPrime(n){\n//check if n is a multiple of 2\n if (n%2 == 0) {\n return false;\n }\n //if not, then just check the odds\n for(var i=3;i*i<=n;i+=2) {\n if(n%i==0){\n return false;\n }\n }\n return true;\n\n}", "title": "" }, { "docid": "dae66a1b92af79b3f82067e3e4385f15", "score": "0.75709784", "text": "function isPrime(num) {\n for (var j = 2; j < num; j++) {\n //if num when divided by j divdes eveningly\n if (num % j === 0) {\n //return false because you've discover a number that is not prime\n return false;\n }\n }\n //else return true because it is prime\n return true;\n}", "title": "" }, { "docid": "baf3caafb9b7cb3d73219dac5b05751a", "score": "0.75702184", "text": "function isPrime(num) {\n for (let i = 2; num > i; i++) {\n if (num % i == 0) {\n return false\n }\n }\n return num > 1\n }", "title": "" }, { "docid": "d0653f3d8649f9e6cf64d33ed0ec972a", "score": "0.7569615", "text": "function isPrime(num) {\n if(num < 2) return false;\n for (let i = 2; i < num; i++) {\n if(num % i == 0)\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "c1f18cdff42e855a8612070b4740fe84", "score": "0.75630784", "text": "function isPrime(num) {\n if (num < 2) { return false; }\n\n for (var i = 2; i < num; i++) {\n if (num % i === 0) { return false; }\n }\n\n return true;\n}", "title": "" }, { "docid": "8a4b24bfd580e343a6efbc30d2183a6b", "score": "0.7560432", "text": "function isPrime(n){\n var multiplos=0;\n var flag=false;\n for (var i=1; i < n; i++){\n if (n/i% 1 == 0){\n multiplos++;\n }\n }\n return multiplos > 1 ? flag= false : flag= true;\n }", "title": "" }, { "docid": "616622b528ff75fac6e3c930941f9653", "score": "0.75603426", "text": "function isPrime(n) {\n\t for(var i = 2; i < n; i++) {\n\t if (n % i == 0)\n\t return false;\n\t }\n\t return true;\n\t}", "title": "" }, { "docid": "b581a37a0f697117a01553a790d17865", "score": "0.75578684", "text": "function isPrime(num){\n if(num < 2){\n return false;\n }\n\n let root = Math.ceil(Math.sqrt(num));\n\n for (let i = 2; i <= root; i++) {\n if(num % i == 0){\n return `${num} is not a prime number`;\n } \n }\n return `${num} is a prime number`;\n}", "title": "" }, { "docid": "92f877ade759018b572591cdebb7d830", "score": "0.7553075", "text": "function isPrime(num){\n\n\tif(num === 1){\n\t\treturn true;\n\t}\n\tfor(i=2; i<num; i++) {\n\t\tif(num%i===0){\n\t\t\treturn false;\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "8533aa9f4f5eeaf17ed6efc1511a5630", "score": "0.7547396", "text": "function checkPrime(number) {\n let i=2;\n while(i<number){\n\n if (number%i===0) \n return false; \n i++\n}\nreturn true;\n}", "title": "" }, { "docid": "f8fbaf0fc2fd2661cc89690c570c58eb", "score": "0.7537259", "text": "function isPrime(num) {\n for (var n = 2; n < num; n++) {\n if (num % n == 0) {\n return false // num is not prime\n }\n }\n return true;\n}", "title": "" }, { "docid": "58342ff11c66aeae4dcfc2373715f466", "score": "0.75365436", "text": "function isThisPrime(num) {\n for (var x = 2; x < num; x++) {\n if (num % x === 0) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "1882efcf505e1a3dc47d0da0da6ed78f", "score": "0.75345516", "text": "function isPrime(num) {\n if (num <= 1) return false\n for (let i = 2; i < num; i++) {\n if (num % i == 0) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "3bf8d0831e4aadc32924d03e896421e0", "score": "0.7533019", "text": "function isPrime(number) {\n\tif(number <= 2) {\n\t\treturn true\n\t}\n\tfor (var i = 2; i < number; i++) {\n\t\tif((number % i) === 0) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}", "title": "" }, { "docid": "9fd37cebaa4d75263c11ab54ea13d29f", "score": "0.75320333", "text": "function isPrime(n) {\n if(n === 2) return true;\n if(n % 2 === 0) return false;\n if(n === 1) return false;\n for (let i = 3; i < n/2; i += 2) {\n if(n % i === 0) return false;\n }\n return true;\n}", "title": "" }, { "docid": "39d1f3aa62f195c535f6fce6244c171d", "score": "0.75269777", "text": "function isPrime(number) {\n var result = true;\n\n if (number <= 1 || (number > 2 && number % 2 === 0)) {\n result = false;\n } else {\n var divisor = 3;\n while (divisor < number) {\n if (number % divisor === 0) {\n return false;\n }\n\n divisor += 2;\n }\n }\n\n return result; \n}", "title": "" }, { "docid": "8d2340c9af86a2096fa9a8f00cd9bdb2", "score": "0.75258785", "text": "function isPrime(n) {\r\n\r\n if (n < 2)\r\n return `${n} is not a prime`\r\n\r\n\r\n for (let i = 2; i < n; i++) {\r\n if (n % i === 0) {\r\n return `${n} is not a prime number`\r\n }\r\n }\r\n return `${n} is a prime number`\r\n}", "title": "" }, { "docid": "b5cc775152d510e5323e6e87fd86df96", "score": "0.75258726", "text": "function IsDivisible(n, prime) {\n return n % prime == 0;\n}", "title": "" }, { "docid": "63927b79ad13066014cb0d38e25dd0a4", "score": "0.7525445", "text": "function isPrime(a) {\n var j = true;\n for (var i = 2; i <= a; i++) {\n if ((a % i) === 0 && a !== i) {\n j = false;\n }\n }\n return j;\n}", "title": "" }, { "docid": "dbc5cd4d602148b508fad4fe9ce2ac03", "score": "0.7524539", "text": "function isPrime(n) {\n if (n < 2) { \n return false;\n } \n for (let i = 2; i < n; i++) {\n if (n % i === 0) {\n return false;\n }\n }\n return true\n}", "title": "" }, { "docid": "4d65cda5399f135ed7807aa4437aa2fb", "score": "0.75198793", "text": "function isPrime(x) {\n if (x !== 2 && x % 2 === 0) {\n return false;\n }\n for (var i = 2; i < Math.sqrt(x); i++) {\n if (x % i === 0) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "533299e92191e8cd2b2d8e508145d9a1", "score": "0.75185156", "text": "function checkPrime(number) {\n if (number <= 1) {\n return false;\n } else {\n for (i = 2; i < number; i++) {\n if (number % i == 0) {\n return false;\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "72c269f0b197bebc1d459589c6864e8f", "score": "0.7516342", "text": "function isPrime(num) {\n return findFactors(num).length === 2;\n}", "title": "" }, { "docid": "fb62a68ca7e1e800ff204ab42646b275", "score": "0.7513448", "text": "function isPrime(n) {\n for (let i = 2; i < n; ++i) {\n if (n % i === 0) return false\n }\n return true\n}", "title": "" }, { "docid": "45630295853efa3b174a7444f1c504ff", "score": "0.7507558", "text": "function isPrime(number){\n\tif(number <= 1){return false;}\n\tif(number == 2){return true;}\n\tif(!(number%2)){return false;}\n\tvar maxCheck = Math.floor(Math.sqrt(number));\n\tfor(var i = 3; i <= maxCheck; i+=2){\n\t\tif(!(number%i)){return false;}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "ab9cb91acf73a9e63bba5dc7471af190", "score": "0.7500464", "text": "function PrimeTime(num) { \n \n var sq = Math.round(Math.sqrt(num)),\n prime = false;\n \n for (var i=2; i<=sq; i++) {\n if (num % i == 0) {\n return false;\n }\n }\n \n return true;\n\n // code goes here \n return num; \n \n}", "title": "" } ]
61805e3a38f45636e0b6c409e3aad21f
Google script calls initMap
[ { "docid": "c1f38965cb5b2b253ee399f9d5bb4a16", "score": "0.78857666", "text": "function initMap() {\n getLocation();\n}", "title": "" } ]
[ { "docid": "3a1b02902f6691d8eb622c7902e97065", "score": "0.84712434", "text": "function initMap(){\t//Stops Google running too early\n\tgetLocation();\n\tconsole.log(\"Google Begins\");\n}", "title": "" }, { "docid": "a814617bf0d8b84e099da670745395bb", "score": "0.8053882", "text": "function initMap() {}", "title": "" }, { "docid": "a814617bf0d8b84e099da670745395bb", "score": "0.8053882", "text": "function initMap() {}", "title": "" }, { "docid": "02a00087d93139f6d8a97a099fbb5b63", "score": "0.79884", "text": "function initMap() {\n createMap();\n setupMapClickEvent();\n}", "title": "" }, { "docid": "c83a88ac75ddf892617cda453bbf990e", "score": "0.79317707", "text": "function init(){\n buildMap();\n}", "title": "" }, { "docid": "427283d232fd81c1c2d4ceb6cd3ed4b3", "score": "0.7911223", "text": "function initMap() {\r\n\r\n\r\n} // now it IS a function and it is in global", "title": "" }, { "docid": "dd84716202586d1c4bba39764d3d0e6c", "score": "0.78821146", "text": "function init() {\t\t\n\tmap = new google.maps.Map(document.getElementById(\"map_page\"), originalOptions);\n\tgetMyLocation();\n}", "title": "" }, { "docid": "30569e2bde1e75cca85eed021186b3fb", "score": "0.78807193", "text": "function initMap(){\n\n \t// Map variable intialization \n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 43.038799, lng: -76.124932},\n zoom: 16,\n });\n\n }", "title": "" }, { "docid": "2f12aa2c3e785043fa25871b1516cd66", "score": "0.78674495", "text": "function initMap() {\n var tag = document.createElement('script');\n tag.src = \"https://maps.googleapis.com/maps/api/js?key=\" + GOOGLE_MAP_KEY + \"&callback=createMap\";\n tag.defer = true;\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n}", "title": "" }, { "docid": "f6dcbffb796eaebbab2b5ac7948feb66", "score": "0.78615457", "text": "function initMap() {} // now it IS a function and it is in global", "title": "" }, { "docid": "e4c67a446b2c9c229bbe070d9624dfa2", "score": "0.7832495", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 3,\n center: center\n });\n \n get_pins();\n \n }", "title": "" }, { "docid": "824a9d644968b03aba68f108cc8f2d41", "score": "0.7785269", "text": "function mapCallback() {\n googleMap.init();\n}", "title": "" }, { "docid": "f4da6c083e922faf5c645175c6bc58ac", "score": "0.7773468", "text": "function initMap() {\n\n\t//McMaster university logitude and latitude\n\tconst mcmasterLocation = { lat: 43.26094539110192, lng: -79.91916639360102 };\n\t\n\t//Create teh map centered at mcmaster\n\tconst map = new google.maps.Map(document.getElementById(\"map\"), {\n\t\tzoom: 15,\n\t\tcenter: mcmasterLocation,\n\t});\n\n\t\n\tconst marker = new google.maps.Marker({\n\t\tposition: mcmasterLocation,\n\t\tmap: map\n\t})\n\t\n\t\n\tgoogleMap = map\n}", "title": "" }, { "docid": "8a243deb75f0c07f48c4e6dc2f3482d7", "score": "0.77703154", "text": "function initMap() {\n setMap(0, 0, 2);\n}", "title": "" }, { "docid": "52d42e51b1990d282beb957ac9a52a9e", "score": "0.773902", "text": "function initMap(){\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t \tcenter: {lat: 38.977032, lng: -1.855353},\n\t \tzoom: 5\n\t});\n\n\tinnerElements();\n\tauto_update();\n\tsetTimeout(hide_splash_screen, 1500);\n\tload_information();\n}", "title": "" }, { "docid": "5f3f879c10d59252ab9f5cef9b3c12f9", "score": "0.7732078", "text": "function init_map(){\r\n\t//Retrieves an associative array with the current form values\r\n\tvar settings = getFormValues(document.thisForm);\r\n\t\r\n //Options to initialize map\r\n \tvar options = getMapOptions(settings['location']);\r\n\r\n //Draw the map\r\n var map = new google.maps.Map(document.getElementById(\"map\"), options);\r\n\r\n\t//Visualizes data appropriate to settings from form\r\n\tvisualizeData(map, settings);\r\n}", "title": "" }, { "docid": "700735f90e6f2c2df08d1ed68422d518", "score": "0.7728278", "text": "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n var myLatlng = new google.maps.LatLng(myplaces[0].lat, myplaces[0].lng);\n map = new google.maps.Map(document.getElementById('map'), { \n center: myLatlng,\n zoom: 14\n }\n );\n // clear the markers bounds to empty\n bounds = new google.maps.LatLngBounds();\n\n activeInfoWindow = new google.maps.InfoWindow();\n Initialize();\n }", "title": "" }, { "docid": "a667fe5325a62f9cafaca4deb9b1b837", "score": "0.77263063", "text": "function initialize(){\n\t\tsetMap();\n\t}", "title": "" }, { "docid": "be809b210502bda3cb9ad882617ccc06", "score": "0.77125144", "text": "function initMap( go ) {\n\tgoogle.load( 'maps', '3', {\n\t\tother_params: 'sensor=false',\n\t\tcallback: function() {\n\t\t\tgm = google.maps;\n\t\t\tgme = gm.event;\n\t\t\tvar mt = google.maps.MapTypeId;\n\t\t\tmap = new gm.Map( $map[0], {\n\t\t\t\tmapTypeId: mt.ROADMAP\n\t\t\t});\n\t\t\tgo();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d337cf84e7ba19e2efdbc5965b8d32e5", "score": "0.7710723", "text": "initMap() {\n\t\t\tthis.googleMaps = new google.maps.Map(document.getElementById('map_realtime'), {\n\t\t\t\tzoom: 14,\n\t\t\t\tcenter: { lat: 51.917937, lng: 4.487838 } // Wijnhaven, Rotterdam.\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "d43f4c4839f93825671c252d7d8435ed", "score": "0.76998633", "text": "function initialize_map() {\n\tconsoLog(\"In initalize\");\n\tmapCanvas = document.getElementById('map_canvas');\n\tready();\n}", "title": "" }, { "docid": "41db5f96872c9c98fa9cfbf318bb32d1", "score": "0.76772493", "text": "function initMap() {\n\tmap = new google.maps.Map($(\"#map\")[0], {\n\t\tcenter: {lat: 24.8138, lng: 120.9675},\n\t\tzoom: 13\n\t});\n}", "title": "" }, { "docid": "415c6498c1a2454b1f804b3820976755", "score": "0.767644", "text": "function initMap() {\n\n\t// set options for map \n\tvar mapOptions = {\n\t\tcenter: {\n\t\t\tlat: 52.067514882683064, \n\t\t\tlng: -355.6761313835413\n\t\t},\n\t\tzoom: 13,\n\t\tclickableIcons: true,\n\t\tstyles: styledMapType \n\t};\n\n\t// Implementatie Google Maps API\n\tmyMap = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n\tfor(var i=0; i<fitnessCenters.length; i++){\n\t\taddFitnessCenter(fitnessCenters[i]);\n\t}\t\n}", "title": "" }, { "docid": "c25208770a58f9bfd2f74811a21e07f4", "score": "0.7673227", "text": "function initMap() {\n\tGMaps.visualRefresh = true;\n\t\n\tvar mapOptions = {\n\t\tcenter: new GMaps.LatLng(11.373552, -83.304128),\n\t\tzoom: 3,\n\t\tmapTypeId: GMaps.MapTypeId.SATELLITE,\n\t\tdisableDefaultUI: true,\n\t\tminZoom: 3,\n\t\tkeyboardShortcuts: false\n\t};\n\t\n\tvar mapElement = document.getElementById('mapa-mundi');\n\n\tmap = new GMaps.Map(mapElement,mapOptions);\n\n\tlastValidBound = map.getBounds();\n}", "title": "" }, { "docid": "e1f09d0afd57e374fe39a15427929339", "score": "0.7643417", "text": "function initMap() {\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: {lat: 24.8138, lng: 120.9675},\n\t\tzoom: 13\n\t});\n}", "title": "" }, { "docid": "c2fa67c851c26f41d72756d12bc988b4", "score": "0.7642192", "text": "function initMap() {\n // Instance the map\n div_map = document.getElementById(\"map\")\n map_data = new google.maps.Map(div_map, config_mapa);\n createMarker(_center, [\"Origin University\"],4)\n console.log(\"The map has been loaded.\")\n loadKmlLayer(kml_limitations, map_data);\n}", "title": "" }, { "docid": "65d1d48131034827697b68e10a5a4093", "score": "0.7630818", "text": "function soGoogleMapInitialize() {\r\n\tnew sowb.SiteOriginGoogleMap(jQuery).initMaps();\r\n}", "title": "" }, { "docid": "0599a1ebe209cebf3b84a64e88740f3f", "score": "0.7630193", "text": "function map_initilise(){\n var mapOptions = {\n center: { lat: 57.70000, lng: 11.9667},\n zoom: 4\n };\n map = new google.maps.Map(document.getElementById('map'),\n mapOptions);\n\n console.log('initilised map');\n}", "title": "" }, { "docid": "61cb7728c6acc6aa894899adb20d5676", "score": "0.76085466", "text": "function initMap(gameMap) {\n\n}", "title": "" }, { "docid": "1b9c8b18198077f29dda63df6725a38f", "score": "0.7592242", "text": "function initMap(){\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: {lat: 0, lng: 0},\r\n zoom: 17\r\n });\r\n}", "title": "" }, { "docid": "4485e1842f8f57222188c22f174a60dc", "score": "0.7587311", "text": "function map_init() {\n\n // Save and parse all map markers in an object. Also update mapInit variable\n // to let other functions know this is the first time we build the map.\n mapInit = true;\n jQuery('#map').removeClass('no-js');\n\n // Initial map load: build map\n var latlng = new google.maps.LatLng(55.596911,12.998478);\n var mapOptions = {\n zoom: 13,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n streetViewControl: false,\n scrollwheel: false\n }\n map = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n\n doRequest(requestUrl);\n\n mapInit = false;\n}", "title": "" }, { "docid": "f7c05931088a37f9e741c4f7b1555bbd", "score": "0.75861514", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 43.65, lng: -79.35},\n zoom: 8\n });\n}", "title": "" }, { "docid": "4473f010e9a0e0a7c31e0794f313fdda", "score": "0.75834054", "text": "function initialize(){ //the first function called once the html is loaded\r\n\tsetMap();\r\n}", "title": "" }, { "docid": "ee57f030f3ddb4dd57e926df0678a027", "score": "0.75652194", "text": "function initMap() {\r\n\t\"use strict\";\r\n\t\tmap = new google.maps.Map(document.getElementById(\"map\"), {\r\n\t\t\tcenter: {lat: 12.971599, lng: 77.594563},\r\n\t\t\tzoom: 12,\r\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\r\n\t\t\tmapTypeControl: false\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "c056bf1d9c5b839cac31a2d8f60dbe3e", "score": "0.75631225", "text": "function initMap() {\n\n // Create a map object and specify the DOM element for display.\n var map = new google.maps.Map(document.getElementById('gp-googlemaps'), {\n center: LatLng,\n scrollwheel: sw,\n zoom: zoom\n });\n\n // Create a marker and set its position.\n var marker = new google.maps.Marker({\n map: map,\n position: LatLng,\n });\n}", "title": "" }, { "docid": "004f73504e5c3b34be74cf4a57672bef", "score": "0.7554432", "text": "function initMap() {\n console.log(1)\n loadCars()\n\n //Init the map, centered at Melb CBD: -37.814, 144.96332\n map = new google.maps.Map(\n document.getElementById('map'),\n {\n zoom: 15,\n center: {lat: -37.814, lng: 144.96332},\n styles: JSON.parse(mapStyleString5)\n });\n initCarMarker(allCars)\n initUserMarker()\n}", "title": "" }, { "docid": "6a825c3c14b77c611b3a5a4ac4aec7ce", "score": "0.7538899", "text": "function initMap() {\n const startCoord = {\n lat: 51.507351,\n lng: -0.127758\n };\n map = new google.maps.Map(document.getElementById('map'), {\n center: startCoord,\n zoom: 13,\n });\n}", "title": "" }, { "docid": "dcdc9fc23a07f195336afc6228a06bd4", "score": "0.753613", "text": "function initMap() {\n\n //Create map with these values\n var mapOptions = {\n zoom: 12,\n center: Stations[\"sstat\"].position\n };\n map = new google.maps.Map(document.getElementById(\"map\"), mapOptions);\n\n //Now with the map created we can handle the next features\n placeMarkers();\n drawPolyLine();\n getLocation();\n}", "title": "" }, { "docid": "5f61a316a297c1ea612ea9b29f8196e2", "score": "0.75320387", "text": "function init(){\n if(!map){\n setMap(map_init_options);\n } \n initModel();\n initView();\n addControlPanel(); \n\n}", "title": "" }, { "docid": "c4f9951d0e562698cf4d20c6de729286", "score": "0.7529445", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: { lat: 44.8115263, lng: -93.3288194 },\n zoom: 15,\n });\n}", "title": "" }, { "docid": "2627ea1d4cc050bae5df6b7395c7ca25", "score": "0.7526225", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: new google.maps.LatLng(0, 0),\n zoom: 4,\n });\n}", "title": "" }, { "docid": "f0038d3973eacac556f9c6d5b67dff69", "score": "0.75236136", "text": "function initMap() {\r\n var map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 13,\r\n center: {lat: 48.8567, lng: 2.3508}\r\n });\r\n }", "title": "" }, { "docid": "0bd52e0b8ddca13edc90963c436ee5b7", "score": "0.75143105", "text": "function init()\n{\n\tmap = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n\tgetMyLocation();\n}", "title": "" }, { "docid": "964db9cabedaec7f442620819b4e1e42", "score": "0.75137997", "text": "function drawInitialMap() {\n locations = new google.maps.LatLng(47.6205099,-122.3514714);\n drawMap();\n }", "title": "" }, { "docid": "d605475ca6a2a6effef36c885edc286b", "score": "0.7511663", "text": "function mapInitialise() {\n // Initalise map at Bristol.\n city = new google.maps.LatLng(51.454513, -2.5879099999999653);\n map = new google.maps.Map(document.getElementById('map-canvas'), {\n center: city,\n zoom: 14,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_CENTER,\n style: google.maps.ZoomControlStyle.SMALL\n },\n streetViewControlOptions: {\n position: google.maps.ControlPosition.LEFT_BOTTOM\n },\n mapTypeControl: false,\n panControl: false\n });\n clearTimeout(self.mapRequestTimeout);\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\n // Calls location for Bristol as default.\n infowindow = new google.maps.InfoWindow({maxWidth: 300});\n // Set deafult search.\n getFoursquares('Bristol', '51.4', '-2.59', 'Bar');\n // Get UK locations.\n getGrouponLocations();\n }", "title": "" }, { "docid": "2d3079e30103a07168327f8765e41e68", "score": "0.7510842", "text": "function initMap(){\r\n\t\t\t\t//MAP\r\n\t\t\t\t var UBC = new google.maps.LatLng(dfltLat,dfltLng);\r\n\t\t\t\t var options = {\r\n\t\t\t\t zoom: 14,\r\n\t\t\t\t center: UBC,\r\n\t\t\t\t mapTypeId: google.maps.MapTypeId.ROADMAP\r\n\t\t\t\t };\r\n\t\t\t\t \r\n\t\t\t\t map = new google.maps.Map(mapCanvas, options);\r\n\t\t\t\t //GEOCODER\r\n\t\t\t\t geocoder = new google.maps.Geocoder();\r\n\t\t\t\t \r\n\t\t\t\t}", "title": "" }, { "docid": "12b2fac4ab66ab53b2f32fdd35f251d3", "score": "0.7509606", "text": "function initMap() { //This works without being called?\n map = new google.maps.Map(document.querySelector(\"#map\"), {\n center: {\n lat: 55.676098,\n lng: 12.568337\n },\n zoom: 14\n });\n infoWindow = new google.maps.InfoWindow({\n content: \"You are here\"\n });\n}", "title": "" }, { "docid": "f8463cb30ece8f605afd5c797a742eb2", "score": "0.7508306", "text": "function initMap() {\n //Latitude/longitude of map starting point\n const mapStart = {\n lat: 37.090240,\n lng: -95.712891\n };\n //Generate he map\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: mapStart,\n styles: mapStyles,\n });\n //Generate a starting marker\n marker = new google.maps.Marker({\n position: mapStart,\n map: map,\n icon: 'images/pin-test.png',\n });\n geocoder = new google.maps.Geocoder();\n}", "title": "" }, { "docid": "f1b2cf9417fb3c05a47272cc9bca49a7", "score": "0.7506149", "text": "function initMap() {\n map = new google.maps.Map(\n document.getElementById('map'), {\n center: new google.maps.LatLng(37.4419, -122.1419),\n zoom: 2,\n mapTypeId: 'roadmap'\n });\n}", "title": "" }, { "docid": "ccfe7092d227390c9638cc965cd94c4a", "score": "0.750318", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"),\n {\n center: defaultLocation,\n scrollwheel: false,\n zoom: 12\n });\n}", "title": "" }, { "docid": "eed9104d4736dcf062e0627fd3005150", "score": "0.74868315", "text": "function initMap() \n{\n\t// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\t// MAP POINTS\n\tmap = new google.maps.Map(document.getElementById('map'), {zoom: 14, \n\t\t\t mapTypeControl: true, \n\t\t\t mapTypeControlOptions: {\n\t\t\t style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,\n\t\t\t mapTypeIds: ['roadmap', 'terrain', 'satellite']\n\t\t\t }});\n\t// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\tgenWayPoints();\n}", "title": "" }, { "docid": "01bddb9829e4703833931d7203f1cbc4", "score": "0.74852324", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 39.0133, lng: -120.0508},\n zoom: selectZoom(wmap)\n });\n}", "title": "" }, { "docid": "873664bc72b04e0561211673cb6ef90f", "score": "0.74742365", "text": "function mapInit() {\n jQuery('#map').removeClass('no-js');\n\n // Set the initial latitude and longitude for the map. We'll look for the\n // data in the URL. If it's not present, we'll try to get the users real\n // location. And if that fail's we'll stick with Malmö, since it's awesome.\n var params = getUrlParams();\n if (params['lat'] && params['lon']) {\n searchLat = params['lat'];\n searchLon = params['lon'];\n } else if (google.loader.ClientLocation != null) {\n var searchLat = google.loader.ClientLocation.latitude;\n var searchLon = google.loader.ClientLocation.longitude;\n } else {\n var searchLat = 55.596911;\n var searchLon = 12.998478;\n }\n\n // Create the map.\n map = new google.maps.Map(document.getElementById('map-canvas'), {\n zoom: parseInt(params['zoom'] ? params['zoom'] : 13),\n maxZoom: 18,\n minZoom: 11,\n center: new google.maps.LatLng(searchLat, searchLon),\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n streetViewControl: false,\n scrollwheel: false,\n disableDefaultUI: true\n });\n\n // When the map has finished loading for the first time, we'll automatically\n // do the initial shit.\n google.maps.event.addListener(map, 'tilesloaded', function(event) {\n if (!initiated) {\n updateParams();\n doShit();\n initiated = true;\n }\n });\n\n google.maps.event.addListener(map, 'dragend', function(event) { updateParams(); });\n google.maps.event.addListener(map, 'zoom_changed', function(event) { updateParams(); setSlider(map.getZoom()) });\n\n // Create the geocoder object.\n geocoder = new google.maps.Geocoder();\n\n // Initialize form controls\n initForm();\n }", "title": "" }, { "docid": "ea792a83dc440e8f93ec52d3b3657c9d", "score": "0.74612945", "text": "function initMap() {\n //The api is loaded at this step\n //L'api est chargée à cette étape\n\n //add translations\n translate(['legendFormGazetteer','fieldLblGazetteer','searchGazetteer']);\n\n createMap();\n var gazetteer= createSearchEngine();\n territoriesViewer[currentTerritory].getMap().addControls([gazetteer]);\n gazetteer.activate();\n}", "title": "" }, { "docid": "c5cde9a5a83a106ade81d4ba789ab314", "score": "0.746099", "text": "function initMap() {\n // Setting the Google maps api with position\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -27.594517, lng: -48.535801},\n zoom: 13\n });\n\n // Setting the markers\n setMarkers(map);\n}", "title": "" }, { "docid": "992832b8e2b90a40f6574c7291c9ad1a", "score": "0.7436323", "text": "function init(){\n\tgoogle.maps.visualRefresh = true;\n\tvar styledMap = new google.maps.StyledMapType(styles, {name: \"Stylised Map\"});\t\n\tvar mapOptions = {\n\t\tcenter: London,\n\t\tzoom: 12,\n\t\tscaleControl: true,\n\t\tmapTypeControlOptions: {\n\t\t\tmapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style', google.maps.MapTypeId.HYBRID]\n\t\t},\n\t\tzoomControlOptions: {\n\t\tstyle: google.maps.ZoomControlStyle.LARGE\n\t\t}\n\t};\n\n\tmap = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\tmap.mapTypes.set('map_style', styledMap);\n\tmap.setMapTypeId('map_style');\n\n\tbumpData();\n\theatmap = new google.maps.visualization.HeatmapLayer({\n\t\tdata: bumpHeatData\n\t});\n\theatmap.setMap(map);\n\tstopData();\n\theatmap2 = new google.maps.visualization.HeatmapLayer({\n\t\tdata: stopHeatData\n\t});\n\t$('#map-canvas').css(\"height\", $(window).height());\n}", "title": "" }, { "docid": "64668170ee4e388991c4783cf56e979e", "score": "0.74334437", "text": "function init() {\n map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n getMyLocation();\n}", "title": "" }, { "docid": "50e81395e8e8c0a199969a30b49f2206", "score": "0.74250895", "text": "function initMap() {\n\tviewModel.map = new google.maps.Map(document.getElementById('map'), {\n\t\tzoom: 12,\n\t\t\t center: new google.maps.LatLng(43.50, -80.5167),\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t});\n\tbuildPage();\n}", "title": "" }, { "docid": "14a2fd6aa823eaa6dda1ef822d8b1f38", "score": "0.7424782", "text": "function initMap() {\n //McMaster university logitude and latitude\n\tconst mcmasterLocation = { lat: 43.26094539110192, lng: -79.91916639360102 };\n \n //Create the map centered at mcmaster\n GMap = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 15,\n center: mcmasterLocation,\n\t})\n\n\tsetTimeout(getMarkers, 2000);\n}", "title": "" }, { "docid": "19502dbbc5e9143db199fef4f88a0d19", "score": "0.7414465", "text": "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 14,\n center: testLatLong\n });\n} //-end of initMap-", "title": "" }, { "docid": "684f89992f9048f36dadc5268827149d", "score": "0.74142176", "text": "function initMap() {\n //Initialize map to arbitrary location.\n window.googleAPI = google;\n const myLatLng = new window.googleAPI.maps.LatLng(36.15911, -95.99374);\n //Home: 36.15911, -95.99374\n window.state.map = new window.googleAPI.maps.Map(getElementById('map'), {\n center: myLatLng,\n zoom: 18, \n mapTypeId: 'satellite'});\n window.state.map.setTilt(0);\n}", "title": "" }, { "docid": "45b779214cb0d6af312dc54f8a1c475d", "score": "0.7410802", "text": "renderMap() {\n loadMapAPI(\"https://maps.googleapis.com/maps/api/js?key=AIzaSyDs8apc-US8cnhHdTl8djgb6tPxXwfGjzg&callback=initMap\")\n window.initMap = this.initMap\n }", "title": "" }, { "docid": "8b1ed76bcca5b086ee9fa26fec5e5041", "score": "0.7408772", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 37.803674,\n lng: -122.329186\n },\n styles: [\n {\n featureType: 'water',\n stylers: [\n { color: '#80a0f0' }\n ]\n }\n ],\n zoom: 10\n });\n largeInfoWindow = new google.maps.InfoWindow();\n // Polyfill IE\n if (isIE()) {\n loadScript('script/polyfill/ie-promise.js', init);\n }\n else {\n init();\n }\n }", "title": "" }, { "docid": "595e032319101ff95ecc4e2bc42952ce", "score": "0.74080783", "text": "function initMap() {\r\n var pghCenter = {lat: 40.444473, lng: -79.945549};\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 12,\r\n center: pghCenter,\r\n });\r\n}", "title": "" }, { "docid": "f7e9654c113028cea0f909582d941ff8", "score": "0.74054915", "text": "function initMap() {\n\n var homeLatLng = { lat: 37.78, lng: -122.44};\n map = new google.maps.Map(document.getElementById('map'), {\n center: homeLatLng,\n zoom: 8\n }); // <== this is for the map itself\n} // <== end of initMap function", "title": "" }, { "docid": "46c42c6e2e2e5679aec16f662e2b9e78", "score": "0.74020606", "text": "function init()\n{\n map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n getMyLocation();\n}", "title": "" }, { "docid": "62b327815139dab6ca411aef278bc017", "score": "0.73968136", "text": "function initMap() {\n // TODO: use a constructor to create a new map JS object. You can use the coordinates\n map = new google.maps.Map(document.getElementById('map'), {\n center: { lat: 35.6586, lng: 139.7454 },\n zoom: 14\n });\n}", "title": "" }, { "docid": "868e61e46a7e717b5f019eac8624a3f6", "score": "0.7381772", "text": "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 48.856614, lng: 2.352222},\n zoom: 13,\n mapTypeControl: false\n });\n}", "title": "" }, { "docid": "e26ddd0d9ab7970cc8f51791676feb72", "score": "0.7377757", "text": "function initMap() {\n\n // the default location for the map\n var defaultLocation = {\n lat: 41.636258,\n lng: -87.596769\n };\n\n // setup Maps in UI\n map = new google.maps.Map(document.getElementById('gMapsDiv'), {\n center: defaultLocation,\n zoom: 15,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n\n // create a default marker and drop it in the center\n var defaultMarker = {\n map: map,\n animation: google.maps.Animation.DROP,\n position: defaultLocation\n }\n\n // Handle click event on the map created above\n map.addListener('click', function(event) {\n showREPDataOnClick(map, event);\n })\n\n // Create geolocation button \n addYourLocationButton(map, defaultMarker);\n\n // Initialize REP\n REP.Layer.Google.Initialize(map);\n\n }", "title": "" }, { "docid": "3d050b6ec08058267773e38c287c14f7", "score": "0.73751384", "text": "function initMap() {\n const center = { lat: 46.619261, lng: -33.134766 };\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 3,\n center: center,\n });\n}", "title": "" }, { "docid": "40ca660dd4c00baaf723ffb876933c1f", "score": "0.73669654", "text": "function initializeMap()\n{\n map = new google.maps.Map(document.getElementById('mapCanvas'), {\n zoom: 18,\n center: mapCenter,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n}", "title": "" }, { "docid": "305623fda6404bcf0e3f68004aeb260d", "score": "0.7364954", "text": "function initMap(){\n \tvar loc ={lat:-25.363, lng:131.044};\n \tmap =new google.maps.Map(document.getElementById(\"map\"),{\n \t\tcenter:loc,\n \t\tzoom:8,\n \t\tmapTypeId:'terrain'\n \t});\n \tvar script = document.createElement('script');\n \tscript.src=\"https://developers.google.com/maps/documentation/javascript/examples/json/earthquake_GeoJSONP.js\";\n\n \t//making pin on the google map \n var makers = new google.maps.Marker({\n \tposition:loc,\n \tmap:map\n });\n}", "title": "" }, { "docid": "3f6e39a7d070f6f830da20ae20a98a86", "score": "0.73633033", "text": "function initMap() {\r\n\r\n infoGlobalMapa.map = new google.maps.Map(document.getElementById('map'), {\r\n zoom: 15,\r\n center: {lat: 36.540, lng: -4.620}\r\n\r\n });\r\n compartirUbicacion();\r\n}", "title": "" }, { "docid": "580871764c0c633064f1a830c51a882c", "score": "0.7361715", "text": "function initMap() {\n\t\tvar uluru = {lat: -25.363, lng: 131.044};\n\t\tvar brisbane = {lat: -25.363, lng: 144.044 };\n\n\t\tvar map = new google.maps.Map(document.getElementById('map'), {\n\t\t\tzoom: 4,\n\t\t\tcenter: uluru\n\t\t});\n\t\tvar a = new google.maps.Marker({\n\t\t\tposition: uluru,\n\t\t\tmap: map\n\t\t});\n\n\t\tvar marker2 = new google.maps.Marker({\n\t\t\tposition: brisbane,\n\t\t\tmap: map\n\t\t});\n\n\t}", "title": "" }, { "docid": "ed886f4a4e6785d3c73d37d2585f1523", "score": "0.7360693", "text": "function init() {\n\t\tfindMaps();\n\t\tinitalizeMaps();\n\t}", "title": "" }, { "docid": "fff88c97052f4b349b9f911bb442a291", "score": "0.73530024", "text": "function initialiseGoogleMaps() {\n\t\t var myLatlng = new google.maps.LatLng(52.3,4.88);\n\t\t var mapOptions = {\n\t\t\tzoom: 4,\n\t\t\tcenter: myLatlng\n\t\t }\n\t\t map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\t\t}", "title": "" }, { "docid": "a5bd4ab423058b368847fcd90a5f196a", "score": "0.7350624", "text": "function initMap() {\n pos = new google.maps.LatLng(self.building.latitude,\n self.building.longitude);\n\n /**\n * Crea una marca inicial\n */\n mark(pos, map);\n\n /**\n * Invoca a la funcion que inicia un \n * accion al hacer click en el mapa\n */\n self.init = addListener();\n }", "title": "" }, { "docid": "735f7e74ae32b754ce507952d439ca65", "score": "0.73502827", "text": "function initMap() {\n var map = new google.maps.Map(document.getElementById('ReporterMap'), {\n zoom: 10,\n styles: styleArray,\n center: {lat: 55.59851, lng: 12.24141}\n });\n\n setMarkers(map);\n }", "title": "" }, { "docid": "3b9e148005dce8305faa7c0e5c258721", "score": "0.7347267", "text": "function mapInit() {\n let map = document.querySelector('.map');\n let coordinates = { lat: 51.49778, lng: 31.287695 };\n let myMap = new google.maps.Map(map, {\n zoom: 17,\n center: coordinates\n });\n }", "title": "" }, { "docid": "f0c8f251ee5014d0eb634e82b9080345", "score": "0.73469144", "text": "function initMap() {\n\tlet brooklynStart = {\n\t\tlat: 40.650002, lng: -73.949997\n\t}\n\t// Map options\n\tlet mapOptions = {\n\t\tcenter: brooklynStart,\n\t\tzoom: 13,\n\t\tmapTypeId: 'roadmap'\n\t}\n\t// New Map\n\tmap = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n\t// new googe maps autocomplete-enabled search bar\n\tlet input = document.getElementById('search-input');\n let searchBox = new google.maps.places.SearchBox(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}", "title": "" }, { "docid": "e446330f475554805db9e2b0fa02ecc8", "score": "0.73438096", "text": "function initMap() {\n\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 6,\n //center: uluru,\n center: posicionInicial,\n mapTypeControl: false,\n zoomControl: true,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_CENTER\n },\n scaleControl: true,\n streetViewControl: false\n });\n\n //cargarClinicas();\n //llamarClinicasRDF();\n llamarClinicasVirtuoso();\n}", "title": "" }, { "docid": "228eddc93fdb87ef8a8571c6a847f2aa", "score": "0.7342592", "text": "function initializeMap() {\n var googleMapOption = {\n zoom: 6.99,\n maxZoom:18,\n center: new google.maps.LatLng(32.3571742, 36.9767603),\n mapTypeId: google.maps.MapTypeId.TERRAIN,\n mapTypeControl: true,\n streetViewControl: false\n };\n\n $scope.gMap = new google.maps.Map(document.getElementById('googleMap'), googleMapOption);\n\n initMarkers($scope.userEncryptors, markersArray);//init markers on map\n setMapOnAll($scope.gMap, markersArray);\n clusterMarkers(markersArray);\n\n }", "title": "" }, { "docid": "81e1fc6c888ff4e173caa385f498e86b", "score": "0.7336235", "text": "function init() {\n\tinit_map();\n\tzoomMap = map.getZoom();\n\tdefineSaveForm();\n}", "title": "" }, { "docid": "a5bc51039e07d717fda529db70549282", "score": "0.7335107", "text": "function init_map() {\n var var_location = new google.maps.LatLng(55.518282, -4.379168);\n\n var var_mapoptions = {\n center: var_location,\n zoom: 14\n };\n\n var var_marker = new google.maps.Marker({\n position: var_location,\n map: var_map,\n title: \"Venice\"\n });\n\n var var_map = new google.maps.Map(document.getElementById(\"map-container\"),\n var_mapoptions);\n\n var_marker.setMap(var_map);\n\n }", "title": "" }, { "docid": "7643f829c7d3da277554da66debc237c", "score": "0.7333819", "text": "function initMap() {\n kartta = new google.maps.Map(document.getElementById('kartta'), {\n center: {lat: 61.4988, lng: 23.7612},\n zoom: 11,\n });\n}", "title": "" }, { "docid": "d80c014d8bfa15636526609a783e963d", "score": "0.73328996", "text": "function initMap() {\n\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: mapSettings.zoom,\n scrollwheel: false,\n scaleControl: false,\n draggable: false,\n center: mapSettings.centerCoord\n });\n\n var marker = new google.maps.Marker({\n position:mapSettings.marker.coord,\n map: map,\n title: mapSettings.marker.title,\n icon: mapSettings.marker.icon\n });\n}", "title": "" }, { "docid": "7b6bb7dcb108d0f1b3cbaf7e32c775e6", "score": "0.73302245", "text": "function mapInit(){\n\tvar center = new google.maps.LatLng(38.523390, -0.170110); // Villajoyosa, Alicante\n\tvar zoom = 19;\n\treturn {'center':center, 'zoom':zoom};\n}", "title": "" }, { "docid": "11379dde3eeca2cb3914a86bd7ec3a32", "score": "0.7329983", "text": "function initMap() {\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: new google.maps.LatLng(48.866667, 2.333333),\n \tzoom: 5\n });\n\n}", "title": "" }, { "docid": "23d845b9a18b6641efaeb28cb7cd386c", "score": "0.7326073", "text": "function initMap() {\n var mapDiv = document.getElementById('map'); \n var mapOptions = {\n \tcenter: new google.maps.LatLng (40.1747708, -101.0129668),\t\n\t zoom: 5,\n \tmapTypeId: google.maps.MapTypeId.ROADMAP\n };\n var map = new google.maps.Map(mapDiv, mapOptions);\n \n}", "title": "" }, { "docid": "33e165b0ecf1571561bad79362c21006", "score": "0.7323703", "text": "function initMap() {\n\tvar latlng = new google.maps.LatLng(CENTER_LAT, CENTER_LNG);\n\t\n\tvar mapOptions = {\n\t\tzoom : ZOOM,\n\t\tcenter : latlng,\n\t\tmapTypeId : google.maps.MapTypeId.ROADMAP\n\t};\n\t\n\tmap_canvas = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);\n\n\tgoogle.maps.event.trigger(map_canvas, 'resize');\n}", "title": "" }, { "docid": "e25764be54e58c2a7a8f452a868954f7", "score": "0.7320627", "text": "function initMap() {\n\tvar location = {lat: -36.903190, lng: 174.688691};\n\tvar map = new google.maps.Map(document.getElementById('map'), {\n\t zoom: 12,\n\t center: location\n\t});\n\n\tvar marker = new google.maps.Marker({\n\t position: location,\n\t map: map\n\t});\n}", "title": "" }, { "docid": "e2856385ac4f1ebec2d2d1517215ea0f", "score": "0.73117566", "text": "function initialize() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 0, lng: 0},\n zoom: 15\n });\n initCenterMapButton();\n getUserLocation();\n createAllMarker();\n}", "title": "" }, { "docid": "dedd68df7a530b566665151210bf7775", "score": "0.73051435", "text": "function initMap() {\n\t\n\tvar abz = new google.maps.LatLng(57.1497, -2.0943);\n\treturn new google.maps.Map(document.getElementById('map'), {\n\t\tzoom: 8,\n\t\tcenter: abz\n\t});\n}", "title": "" }, { "docid": "ab54d9217e434a1240ae4cbd52269410", "score": "0.72886515", "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": "ef25bb0a82595cf8d61742ed31df7513", "score": "0.7287035", "text": "function initGoogleMap()\n\t{\n\t\tvar myLatlng = new google.maps.LatLng(36.286728,-5.278741);\n \tvar mapOptions =\n \t{\n \t\tcenter: myLatlng,\n\t \tzoom: 17,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\t\tdraggable: true,\n\t\t\tscrollwheel: false,\n\t\t\tzoomControl: true,\n\t\t\tzoomControlOptions:\n\t\t\t{\n\t\t\t\tposition: google.maps.ControlPosition.RIGHT_CENTER\n\t\t\t},\n\t\t\tmapTypeControl: false,\n\t\t\tscaleControl: false,\n\t\t\tstreetViewControl: false,\n\t\t\trotateControl: false,\n\t\t\tfullscreenControl: true,\n\t\t\tstyles:\n\t\t\t[\n\n\t\t\t]\n \t}\n\n \t// Initialize a map with options\n \tmap = new google.maps.Map(document.getElementById('map'), mapOptions);\n\n\t\t// Re-center map after window resize\n\t\tgoogle.maps.event.addDomListener(window, 'resize', function()\n\t\t{\n\t\t\tsetTimeout(function()\n\t\t\t{\n\t\t\t\tgoogle.maps.event.trigger(map, \"resize\");\n\t\t\t\tmap.setCenter(myLatlng);\n\t\t\t}, 1400);\n\t\t});\n\t}", "title": "" }, { "docid": "e6c698180917b859bde61484a841ef28", "score": "0.7281442", "text": "function initMap() {\n\tmap = new google.maps.Map(document.getElementById(\"googleMap\"),{\n\t\t// initiate map centering at Chicago, show full US\n center: new google.maps.LatLng(41.850033, -87.6500523),\n\t\tzoom: 4\n\t});\n\tinfowindow = new google.maps.InfoWindow({\n\t\tcontent: ''\n\t});\n}", "title": "" }, { "docid": "c3c9103809e933a2aeba212c2829d8f8", "score": "0.7277432", "text": "function initGoogleMaps() {\n var script = document.createElement(\"script\");\n script.src =\"https://maps.googleapis.com/maps/api/js?key=AIzaSyD-s4VH03KBs4cmv7AE2U7rGuO7E6iV0Uk&callback=initMap\";\n document.body.appendChild(script);\n\n}", "title": "" }, { "docid": "8c288894f3aea7eb9b2abd00306773f7", "score": "0.72765154", "text": "function initMap() {\n\n\tvar mapCanvas = $('#google-map');\n\tvar canvasHeight = $('#google-map').height();\n\tvar canvasWidth = $('#google-map').width();\n\tmapOpts = {\n\t\tdisableDefaultUI: true,\n\t\tcenter: new google.maps.LatLng(38.5449274, -121.7500067),\n\t};\n\n\tif(canvasWidth > 960 && canvasHeight > 920) {\n\t\tmapOpts.zoom = 15;\n\t}else if(canvasHeight < 500){\n\t\tmapOpts.zoom = 13;\n\t}else {\n\t\tmapOpts.zoom = 14;\n\t}\n\n\tif (canvasWidth < 600 || canvasHeight < 700) {\n\t\tnoNav();\n\t\tnoYelpNav();\n\t}\n\n\tmap = new google.maps.Map(document.getElementById('google-map'), mapOpts);\n\n\tsetMyMarkers();\n}", "title": "" }, { "docid": "953a9b970452f325a6ec6a20ee26218c", "score": "0.7273419", "text": "function initMap () {\n\tvar myLatLng = {lat: 53.5, lng: -108.5};\n\n\t// Create a map object and specify the DOM element for display.\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: myLatLng,\n\t\tscrollwheel: false,\n\t\tzoom: 12\n\t});\n}", "title": "" }, { "docid": "19e2dc32f070c3b344fc1f9b7338e012", "score": "0.7272252", "text": "function initMap() {\n var latLong = {\n lat: 000,\n lng: 000\n };\n window.map = new google.maps.Map(\n document.getElementById('map'), {\n zoom: 15,\n center: latLong,\n mapTypeId: 'roadmap'\n });\n var marker = new google.maps.Marker({\n position: latLong,\n map: map,\n });\n\n truck('default', null, null, 1);\n}", "title": "" } ]
147707052e55652f516a52c4a7367868
Add active class to navlink based on url dynamically Active class can be hard coded directly in html file also as required
[ { "docid": "a3b2dab01c109d5a21609f6c45bbb156", "score": "0.7747189", "text": "function addActiveClass(element) {\n if (current === \"\") {\n //for root url\n if (element.attr('href').indexOf(\"index.html\") !== -1) {\n element.parents('.nav-item').last().addClass('active');\n if (element.parents('.sub-menu').length) {\n element.closest('.collapse').addClass('show');\n element.addClass('active');\n }\n }\n } else {\n //for other url\n if (element.attr('href').indexOf(current) !== -1) {\n element.parents('.nav-item').last().addClass('active');\n if (element.parents('.sub-menu').length) {\n element.closest('.collapse').addClass('show');\n element.addClass('active');\n }\n if (element.parents('.submenu-item').length) {\n element.addClass('active');\n }\n }\n }\n }", "title": "" } ]
[ { "docid": "9b7d1f98ee40a944ba6279e5abc81312", "score": "0.8224235", "text": "function dynamicActiveClass() {\n var pathNameOfCurrentPage = window.location.pathname;\n \n $('a[href=\"' + pathNameOfCurrentPage + '\"]').parent().addClass('active');\n \n }", "title": "" }, { "docid": "fa899d7cca525ea6ae89831a270d3905", "score": "0.80814356", "text": "function handleActiveClass() {\n var pgurl = window.location.href.substr(window.location.href.lastIndexOf(\"/\"));\n $(\"#nav\").find(\"a\").each(function(){\n if($(this).attr(\"href\") == pgurl || $(this).attr(\"href\") == '' )\n $(this).parent().addClass(\"active\");\n })\n }", "title": "" }, { "docid": "698c4e48341d11ae427c654160637e95", "score": "0.76968026", "text": "function activeNavPage(){\n $('.main-nav a').each(function () {\n var location = window.location.href;\n var link = this.href;\n var result = location.match(link);\n\n if(result != null) {\n $(this).parent('li').addClass('active');\n }\n });\n }", "title": "" }, { "docid": "e30f8bc9fe1aebd5168cde8d7a678e02", "score": "0.769293", "text": "_setActiveStateClasses() {\n // check if the link match the location\n const href = this.getAttribute(\"href\").split(/\\?|#/)[0]\n const regexpStr = href.replace(/\\//g, \"\\\\/\")\n if (document.location.pathname === href) {\n this.classList.remove(\"active-within\")\n this.classList.add(\"active\")\n } else if (\n href !== \"/\" &&\n document.location.pathname.match(new RegExp(regexpStr))\n ) {\n this.classList.remove(\"active\")\n this.classList.add(\"active-within\")\n } else {\n this.classList.remove(\"active\")\n this.classList.remove(\"active-within\")\n }\n }", "title": "" }, { "docid": "569c24f168c875f807667f8242c18c5b", "score": "0.76048446", "text": "function setNavigation() {\n \n let path = window.location.pathname;\n $('.nav a').each(function(link) {\n let href = $(this).attr('href');\n if(href === path) {\n $(this).addClass('activeNavLink')\n }\n });\n\n}", "title": "" }, { "docid": "75fb4dbefb642356ea256674ece125ed", "score": "0.7492452", "text": "function setActiveNav() {\n\t\t$(\"a[href*='\" + theLocation + \"']\").addClass('styleguide__navigation__item--active');\n\t}", "title": "" }, { "docid": "60c6577d0f2bbe49660552bf3dfa6dea", "score": "0.7490513", "text": "function initActiveNavLink(){\n\t// match first / and all non-slash chars after\n\tvar current_nav_link = $(location)[0].pathname.match(/\\/[^/]+|\\//)[0];\n\tvar current_nav_jquery_selector = \".navbar__entry a[href='\"\n\t\t+ current_nav_link\n\t\t+ \"']\"\n\t;\n\t$( current_nav_jquery_selector ).parent().addClass('active');\n\n}", "title": "" }, { "docid": "1923375cf7f7d839ef9a9c27869b9b53", "score": "0.74841774", "text": "function setActiveLink(fragment){\n var links = document.querySelectorAll(\"#NavArea a\"),\n i, pageName;\n\n for(i = 0; i < links.length; i++){\n pageName = links[i].getAttribute(\"href\").substr(1);\n if(pageName === fragment) {\n links[i].setAttribute(\"class\", \"active\");\n } else {\n links[i].removeAttribute(\"class\");\n }\n }\n }", "title": "" }, { "docid": "fdbf62e4c93aabeed67f00338a7b1562", "score": "0.748107", "text": "function updateHeaderActiveClass(){\n $('.header__menu li').each(function(i,val){\n if ( $(val).find('a').attr('href') == window.location.pathname.split('/').pop() ){\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "title": "" }, { "docid": "fdbf62e4c93aabeed67f00338a7b1562", "score": "0.748107", "text": "function updateHeaderActiveClass(){\n $('.header__menu li').each(function(i,val){\n if ( $(val).find('a').attr('href') == window.location.pathname.split('/').pop() ){\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "title": "" }, { "docid": "fdbf62e4c93aabeed67f00338a7b1562", "score": "0.748107", "text": "function updateHeaderActiveClass(){\n $('.header__menu li').each(function(i,val){\n if ( $(val).find('a').attr('href') == window.location.pathname.split('/').pop() ){\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "title": "" }, { "docid": "fdbf62e4c93aabeed67f00338a7b1562", "score": "0.748107", "text": "function updateHeaderActiveClass(){\n $('.header__menu li').each(function(i,val){\n if ( $(val).find('a').attr('href') == window.location.pathname.split('/').pop() ){\n $(val).addClass('is-active');\n } else {\n $(val).removeClass('is-active')\n }\n });\n }", "title": "" }, { "docid": "9e66ce074f72c535fdf76fbde654627c", "score": "0.737899", "text": "function addActiveLink() {\n\t\t\"use strict\";\n\t\t$('a[href=\"' + window.location.pathname + '\"]').\n\t\t\tparent().\n\t\t\taddClass('active');\n\t}", "title": "" }, { "docid": "6edf9534a81a4f7dccc5c0f71b6f81b7", "score": "0.73287624", "text": "function initNavbarMenuActive() {\n $(\".navigation-menu a\").each(function () {\n if (this.href == window.location.href) {\n $(this).parent().addClass(\"active\"); // add active to li of the current link\n $(this).parent().parent().parent().addClass(\"active\"); // add active class to an anchor\n $(this).parent().parent().parent().parent().parent().addClass(\"active\"); // add active class to an anchor\n }\n });\n }", "title": "" }, { "docid": "1632ae21dda554c3fe64b0f9eeccbfdf", "score": "0.7321655", "text": "function classNav() {\r\n\tvar vars = getUrlVars();\r\n\tvar classId = vars.classId;\r\n\t\r\n\tvar selector = '#class-id-' + classId;\r\n\t$(selector).addClass('active');\r\n\t$(selector).closest(\".xn-openable\").addClass('active');;\r\n}", "title": "" }, { "docid": "28e522f3c9ecefbd9d5985cf87c13d0a", "score": "0.7242544", "text": "function setActiveLink(fragmentId){\n var navbarDiv = document.getElementById('navbar'),\n links = navbarDiv.children,\n // links = document.querySelectorAll('#navbar a'),\n // links = document.querySelectorAll('#navbar a [href=#' + fragmentId+\"]\"),\n i, link, pageName;\n \n for(i = 0; i < links.length; i++){\n link = links[i];\n pageName = link.getAttribute('href').substr(1);\n if(pageName === fragmentId){\n link.setAttribute('class', 'active');\n } else {\n link.removeAttribute('class');\n }\n }\n}", "title": "" }, { "docid": "0e04225e7aa029587bf8feb1b4b9b5ad", "score": "0.71995974", "text": "function setActiveLink(fragmentId){\n var navbarDiv = document.getElementById(\"myTopnav\"),\n links = navbarDiv.children,\n i, link, pageName;\n for(i = 0; i < links.length; i++){\n link = links[i];\n pageName = link.getAttribute(\"href\").substr(1);\n if(pageName === fragmentId) {\n link.setAttribute(\"class\", \"active\");\n } else {\n link.removeAttribute(\"class\");\n }\n }\n }", "title": "" }, { "docid": "4f3683467b66ccadfda05e18500378dd", "score": "0.7197462", "text": "function changeActiveTab() {\n document.querySelectorAll('.nav-links li').forEach(li => {\n if(li.getAttribute(\"href\") === window.location.pathname) { li.classList.add(\"active\"); }\n else { li.classList.remove(\"active\"); }\n })\n }", "title": "" }, { "docid": "2cef68ce27a358dd609ae292f2b19fe1", "score": "0.7196142", "text": "function setNavActiveElt() {\n console.clear();\n jQuery('.subBrandNav li').removeClass('on');\n var url = window.location.pathname;\n if (url.substr(-1) == '/') url = url.slice(0, -1);\n var parts = url.split('/').slice(1);\n parts = parts.filter(function (item) { return item != \"\"; });\n var urlV2 = url.substr(0, url.lastIndexOf('/'));\n var urlV3 = '/' + [parts[0], parts[1]].join('/');\n if (parts[parts.length - 1] != 'index' && hasPart(parts[2])) {\n urlV3 = '/' + [parts[0], parts[1], parts[2]].join('/');\n }\n jQuery('nav.topnav menu li a[href*=\"/' + parts[0] + '\"]').parent().addClass(\"on\");\n var elt = (jQuery('.subBrandNav li a[href=\"' + url + '/index' + '\"]').length != 0 ?\n jQuery('.subBrandNav li a[href=\"' + url + '/index' + '\"]').first() :\n jQuery('.subBrandNav li a[href=\"' + url + '\"]').length != 0 ?\n jQuery('.subBrandNav li a[href=\"' + url + '\"]').first() :\n jQuery('.subBrandNav li a[href*=\"' + urlV2 + '\"]').length != 0 ?\n jQuery('.subBrandNav li a[href*=\"' + urlV2 + '\"]').first() :\n jQuery('.subBrandNav li a[href^=\"' + urlV3 + '\"]').length != 0 ?\n jQuery('.subBrandNav li a[href^=\"' + urlV3 + '\"]').first() :\n null);\n\n if (elt) elt.parent().addClass(\"on\");\n}", "title": "" }, { "docid": "697d33747712341680490ca2c6c89baa", "score": "0.7189393", "text": "function setActive() {\n var aObj = document.getElementById('header').getElementsByTagName('a');\n for(var i=0;i<aObj.length;i++) {\n if(document.location.href.indexOf(aObj[i].href)>=0) {\n aObj[i].className='active';\n }\n }\n}", "title": "" }, { "docid": "a963fca8d7359ae479f381a4cdd77cb7", "score": "0.7153625", "text": "setActiveTag(path)\n\t{\n\t\t/***/\n\t\t$(\".active\").removeClass(\"active\")\n\n\t\t$(\"a[nav-to]\").each((i,e)=>{\n\t\t\tif($(e).attr(\"nav-to\") === path)\n\t\t\t\t$(e).addClass(\"active\");\n\t\t});\n\t}", "title": "" }, { "docid": "fe74357fecee63984903a51110569417", "score": "0.71239996", "text": "function SetActiveMenu() {\n var path = window.location.pathname;\n path = path.replace(/\\/$/, \"\");\n path = decodeURIComponent(path);\n\n $(\".nav a\").each(function () {\n $(this).click(function () {\n if (this.href == window.location.href.replace(\"Admin\", \"\")) {\n // $(this).closest(\"li\").removeClass()(\"active\");\n $(this).closest(\"li\").addClass(\"active\");\n }\n });\n\n });\n\n}", "title": "" }, { "docid": "97fc6214cb43471df446688e3a34a211", "score": "0.7058781", "text": "function setActive() {\n const active = activeSection() // active element\n if (active != null){\n const prev = document.getElementsByClassName('your-active-class')[0];\n prev.classList.remove('your-active-class');\n active.classList.add('your-active-class');\n const links = document.getElementsByClassName('menu__link')\n links.forEach( link => {\n link.dataset.nav === active.id ? link.classList.add('active') : link.classList.remove('active')\n })\n } \n}", "title": "" }, { "docid": "6a49583a364ad8389e9dbf0c0d8f37b5", "score": "0.6989618", "text": "function onURLChange() {\n\n //var getURL = window.location.pathname.split(\"/\").pop();\n var getURL = window.location.pathname;\n var getURLsplit = getURL.split(\"/\"); // split into array\n var myPath = getURLsplit[2]; // get part of the array\n var currentURL = 'curr-nav-' + myPath;\n \n //Remove all classes by default\n $('.navbar').removeClass(function (index, css) {\n return (css.match(/(^|\\s)curr-nav\\S+/g) || []).join(' ');\n });\n $('.navbar').addClass(currentURL);\n \n }", "title": "" }, { "docid": "4752c2221b25d816d3d2ec0b9d23c023", "score": "0.69042313", "text": "function setActiveNavItem(link,pattern) {\n if ( link.attr(\"id\").length > 0 ) {\n if ( (link.attr(\"id\").match(pattern) != null) ) {\n active_class = link.attr(\"id\").match(pattern)[1]\n if ( $(\"body\").hasClass(active_class) ) {\n link.addClass('active')\n }\n }\n }\n}", "title": "" }, { "docid": "b091599651115065375355c0fc4e399c", "score": "0.69023293", "text": "function toggleActiveNav() {\n getAll('.navbar-item').forEach(function (el) {\n if (el.pathname) {\n if (window.location.pathname.split(\"/\")[1] == el.pathname.split(\"/\")[1]) {\n el.classList.toggle('is-active');\n }\n }\n });\n }", "title": "" }, { "docid": "bd19e8f1d4b092f3569af206bce77fa2", "score": "0.689662", "text": "function Highlight_page() { \r\n\tvar url = location.href.split(\"/\");\r\n\tvar navLinks = document.getElementsByTagName(\"nav\")[0].getElementsByTagName(\"a\");\r\n\tvar i = 0;\r\n\tvar currentPage = url[url.length - 1];\r\n\tfor(i; i < navLinks.length; i++){\r\n\t\tvar lb = navLinks[i].href.split(\"/\");\r\n\t\tif(lb[lb.length-1] == currentPage) {\r\n\t\t\tnavLinks[i].className = \"active\";\r\n\t\t}\r\n\t}\r\n }", "title": "" }, { "docid": "bd19e8f1d4b092f3569af206bce77fa2", "score": "0.689662", "text": "function Highlight_page() { \r\n\tvar url = location.href.split(\"/\");\r\n\tvar navLinks = document.getElementsByTagName(\"nav\")[0].getElementsByTagName(\"a\");\r\n\tvar i = 0;\r\n\tvar currentPage = url[url.length - 1];\r\n\tfor(i; i < navLinks.length; i++){\r\n\t\tvar lb = navLinks[i].href.split(\"/\");\r\n\t\tif(lb[lb.length-1] == currentPage) {\r\n\t\t\tnavLinks[i].className = \"active\";\r\n\t\t}\r\n\t}\r\n }", "title": "" }, { "docid": "1f0b047c70c4ee7610b7ed82b7880dc3", "score": "0.688706", "text": "account_navigation_list_active_class(link) {\n\n\t\tif( ToSeoUrl( Iron.Location.get().path ) == \"-\"+link){ // Do this because / in the location becaomes a -\n\t\t\treturn 'active';\n\t\t}\n\n\t}", "title": "" }, { "docid": "db1a8982d4921b6e6585f92cb43efa05", "score": "0.6858166", "text": "function markActiveMenuLink() {\n // Clear current active\n jQuery(\"#\" + kradVariables.NAVIGATION_ID + \" li.\" + kradVariables.ACTIVE_CLASS).removeClass(kradVariables.ACTIVE_CLASS);\n\n // Select active\n var pageId = getCurrentPageId();\n var liParents = jQuery(\"a[name='\" + pageId + \"']\").parents(\"li\");\n liParents.addClass(kradVariables.ACTIVE_CLASS);\n}", "title": "" }, { "docid": "ef7aa1078d544c5b592f6d1e70089de1", "score": "0.6853847", "text": "function setActiveLink(s) {\n Array.from(links).forEach((link) => {\n const newLink = link.getAttribute(\"href\").substring(1); //get the link href value without the #, and compare it with section id value.\n if (s.id === newLink) {\n link.classList.add(\"active-link\");\n } else {\n link.classList.remove(\"active-link\");\n }\n });\n}", "title": "" }, { "docid": "439dd8692f2cf7973ee87b52b0e91d91", "score": "0.6845864", "text": "function activeLnkMenu() {\n\tlet gP = function(find) {\n\t\treturn getPage().match(find);\n\t};\n\tlet act = function(find) {\n\t\tlet rep = find.replace(\"/\",\"\",gP(find));\n\t\tif (gP(find)) {\t\n\t\t\t$('.menuitem a').removeClass('activemenu');\n\t\t\t$('.menuitem a[href=\"'+rep+'\"]').addClass('activemenu');\n\t\t}\n\t};\n\tact('index.html');\n}", "title": "" }, { "docid": "486d91807213d9fd055bb5b6b7c0bca3", "score": "0.68443", "text": "function navHighlight(elem, home, active) {\r\n var url = location.href.split('/'),\r\n loc = url[url.length -1],\r\n link = document.querySelectorAll(elem);\r\n for (var i = 0; i < link.length; i++) {\r\n var path = link[i].href.split('/'),\r\n page = path[path.length -1];\r\n if (page == loc || page == home && loc == '') {\r\n link[i].parentNode.className += ' ' + active;\r\n document.body.className += ' ' + page.substr(0, page.lastIndexOf('.'));\r\n }\r\n }\r\n }", "title": "" }, { "docid": "202bc8bfa816930fa0feb2c001192984", "score": "0.68340003", "text": "function setActiveNav (name) {\n console.log('setActiveNav', name)\n $('.nav a').removeClass('active')\n $('.nav a[href=/' + name + ']').addClass('active')\n }", "title": "" }, { "docid": "9879175e49f4187b1aab692dae672d87", "score": "0.68303967", "text": "function selectedNavLink(page) {\n\n const navbar = document.querySelector('.navbar-nav');\n const memberLi = navbar.querySelector('.member');\n const boardLi = navbar.querySelector('.board');\n\n if (page === 'member') {\n memberLi.classList.add('active');\n boardLi.classList.remove('active');\n }\n if (page === 'board') {\n memberLi.classList.remove('active');\n boardLi.classList.add('active');\n }\n}", "title": "" }, { "docid": "480a563699769073c06d6359fc1bf9b5", "score": "0.68002635", "text": "function activeLinksControll(){\r\n $('.menu-list .nav-item').click(function(){\r\n // remove active class from any links\r\n $('.nav-item').removeClass('active')\r\n // add active class to a\r\n $(this).closet('.nav-item').addClass('active')\r\n });\r\n }", "title": "" }, { "docid": "26d8ee7491b2b8833797220ef37dbdf0", "score": "0.67986536", "text": "function setNavLinkActive(\n pageName\n ) {\n $('#navbar li').each(function(index) {\n $(this).removeClass('active');\n\n var dataLink = $(this).attr('data-link');\n if (dataLink == pageName) {\n $(this).addClass('active');\n }\n });\n }", "title": "" }, { "docid": "d9c48f7a7db1c7da48a28cd45805baac", "score": "0.6783851", "text": "function changeActiveNav(dataNav){\n let old_active_item = document.querySelector('.menu__link.active');\n if(old_active_item){\n old_active_item.classList.remove('active');\n }\n let allItems = document.querySelectorAll('.menu__link');\n for(let item of allItems){\n if(item.textContent === dataNav){\n item.classList.add('active');\n break;\n }\n }\n}", "title": "" }, { "docid": "08bd4f0cf8be327068e878e0d2d4e93a", "score": "0.67781717", "text": "function setActiveNavbar() {\n\n navbarSupportedContent = document.getElementById('navbarSupportedContent');\n allLink = navbarSupportedContent.getElementsByClassName('nav-link'); // tutti i figli \n\n for (Link of allLink) {\n\n if ( (window.location.href).search(Link.href) != -1 ) {\n Link.className = 'nav-link active';\n } else {\n Link.className = 'nav-link';\n }\n }\n\n if ( getActiveUser() ) {\n document.getElementById('LinkAccedi').href = \"#\";\n document.getElementById(\"Logout_Btn\").disabled = false;\n\n } else {\n document.getElementById('LinkAccedi').href = \"./signup.html\";\n document.getElementById(\"Logout_Btn\").disabled = true;\n\n }\n\n}", "title": "" }, { "docid": "d7b7e6826cbeae0f45c0008e7994c0af", "score": "0.67739534", "text": "function active_schedule()\n{\n let url = window.location.pathname.split('/');\n if(url[url.length-1] === \"schedule\")\n $(\"#schedule-link\").addClass(\"active\");\n}", "title": "" }, { "docid": "6a320f02382942a02745a57a64c4fe57", "score": "0.6761115", "text": "function setActive(page, nav) {\n const navChildren = nav.children;\n\n for (const child of navChildren) {\n child.className = \"\";\n if (child.href == page) {\n child.className = \"active\";\n }\n }\n}", "title": "" }, { "docid": "4a63960d6258f6b2999127191c06906f", "score": "0.67503566", "text": "function active(section){\n\n // select all links 'a'\n let links =document.querySelectorAll(\"a\");\n let dataId = section.getAttribute(\"data-nav\");\n\n//loop over links\n links.forEach(link=> {\n\n //remove the active link from the first section\n link.classList.remove(\"active-link\");\n if (link.textContent==dataId){\n\n //add active link to the active section\n link.classList.add(\"active-link\");\n\n\n }\n\n\n });\n\n}", "title": "" }, { "docid": "32849af8c54531b4d2b483c48f5ba2f8", "score": "0.67333406", "text": "function setActive() {\n for (let section of sections) {\n nonActiveLinks = [];\n if (isInView(section)) {\n //console.log(isInView(section));\n // set active section\n section.classList.add(\"your-active-class\");\n // set active link\n activeLi = document.querySelector(`[data-nav=${section.id}]`);\n activeLi.classList.add(\"selected__link\");\n } else {\n //console.log(isInView(section));\n // remove active class\n section.classList.remove(\"your-active-class\");\n //filter non Active Links\n nonactiveLi = document.querySelector(`[data-nav=${section.id}]`);\n nonActiveLinks.push(nonactiveLi);\n // remove selected_link class from Active Links\n nonActiveLinks.forEach(function (nonActiveLink) {\n nonActiveLink.classList.remove(\"selected__link\");\n });\n }\n }\n}", "title": "" }, { "docid": "c83a2c22725562a05a99c0cbcc2a733c", "score": "0.67309517", "text": "function activateNavbarButton() {\n // get the webpage filename\n var page = document.URL.split('/').pop().toLowerCase();\n var id;\n\n if (page == 'index.html') {\n id = '#home';\n } else if (page == 'two_stroke.html') {\n id = '#2-stroke';\n } else if (page == 'four_stroke.html') {\n id = '#4-stroke';\n } else if (page == 'gasoline.html') {\n id = '#gasoline';\n } else if (page == 'rating_info.html') {\n id = '#rating';\n } else if (page == 'order_info.html') {\n id = '#ordering';\n } else if (page == 'contact.html') {\n id = '#contact';\n }\n\n $(id).addClass('active');\n}", "title": "" }, { "docid": "ea6403c63d1edbafc2adf8a1d80975d1", "score": "0.67302996", "text": "function setActiveTab() {\n $('a.active').removeClass('active');\n $('a[href=\"' + location.pathname + '\"]').addClass('active');\n}", "title": "" }, { "docid": "4c5066c3b2c1aa9f4ed75816b7520ab4", "score": "0.66845804", "text": "function navigationUpdate() {\n $('header a, footer .nav-item, header .nav-item').removeClass('current-menu-item');\n // 2. go through all links and add current-menu-item class if href == current URL\n var path = window.location.href.split('/');\n // console.log(path);\n var parentPage = path[0] + '//' + path[2] + '/' + path[3] + '/' ;\n // console.log(parentPage);\n // console.log(path[3]);\n $('header a[href*=\"' + parentPage + '\"]').parent().addClass('current-menu-item');\n $('footer a[href*=\"' + parentPage + '\"]').parent().addClass('current-menu-item');\n\n $('header .dropdown-menu a[href*=\"' + path[3] + '\"]').addClass('current-menu-item');\n\n}", "title": "" }, { "docid": "6066a6cc28d4a588f5256bbd3b2ba02c", "score": "0.6672381", "text": "function updateActive(pageclass) {\n let pages = ['home', 'portfolio', 'aboutMe', 'contact'];\n\n for (let i= 0; i < pages.length; i++){\n let pg = document.getElementById(pages[i]);\n if ( pages[i] == pageclass) {\n pg.className = \"active\";\n } else {\n pg.className = \"\";\n }\n }\n}", "title": "" }, { "docid": "4666613a2060ed4e59a271ca86f5966f", "score": "0.6658731", "text": "function activeNav() {\n for (var i = 0; i < 5; i++) {\n if (currentIndex == i) {\n $(\"#page\" + (currentIndex + 1)).addClass(\"active orange\");\n };\n };\n }", "title": "" }, { "docid": "66a23323f21822f787ac4518b40f367f", "score": "0.66259", "text": "function colorHeader(event) {\n\tlet path = (window.location.pathname).split(\"/\").pop();\n\tfor (let i = 0; i < elemInHeader.length; i++){\n\t\tif (path == elemInHeader[i].href.split(\"/\").pop())\n\t\t\telemInHeader[i].classList.add(\"active\");\n\t}\t\n}", "title": "" }, { "docid": "74121dd6af5fd3701f3fb497dfd14e56", "score": "0.6624827", "text": "function changeActiveClass (){\n for (let i=0; i<document.querySelectorAll('section').length; i++) {\n let sectionViewPort = document.querySelector(`#section${i+1}`).getBoundingClientRect().y;\n if ((sectionViewPort>-300) & (sectionViewPort<300)) {\n // console.log(\"Section View Port in range\");\n // console.log(\"current y axis is\"+sectionViewPort);\n // document.querySelector(`#section${i+1}`).className = \"your-active-class\";\n document.querySelector(`#section${i+1}`).classList.add(\"your-active-class\");\n\n }\n else {\n // document.querySelector(`#section${i+1}`).className =\"\";\n document.querySelector(`#section${i+1}`).classList.remove(\"your-active-class\");\n\n }\n }\n\n // Add class 'active' to NAV LINK when near top of viewport (adds to nav links)\n // Note: the default class for the nav link is menu__link\n for (let i=0; i<document.querySelectorAll('section').length; i++) {\n let sectionViewPort = document.querySelector(`#section${i+1}`).getBoundingClientRect().y;\n if ((sectionViewPort>-300) & (sectionViewPort<300)) {\n // document.getElementById('navbar__list').children[i].children[0].id =\"active\";\n document.getElementById('navbar__list').children[i].children[0].classList.add(\"active\");\n }\n else {\n // document.getElementById('navbar__list').children[i].children[0].id=\"inactive\";\n document.getElementById('navbar__list').children[i].children[0].classList.remove(\"active\");\n\n }\n }\n}", "title": "" }, { "docid": "4ee8ec5f1769e19342e235458e3fb17a", "score": "0.66121316", "text": "function setActiveSection() {\n if (indexActiveSection() != -1) {\n let aTagList = document.querySelectorAll('.menu__link');\n for (let i = 0; i < sections.length; i++){\n if (i == indexActiveSection()){\n sections[i].classList.add('your-active-class');\n aTagList[i].classList.add('your-active-class');\n } else {\n sections[i].classList.remove('your-active-class');\n aTagList[i].classList.remove('your-active-class');\n }\n }\n }\n}", "title": "" }, { "docid": "8a3f0669ea7424b89172ea621036a2ed", "score": "0.66030514", "text": "function set_active_nav(){\n\t$(\"#\" + $(document).attr('title').toLowerCase()).children('a').addClass(\"active\");\n}", "title": "" }, { "docid": "992b235bfc98e31aed1f043211c0d7e9", "score": "0.65776443", "text": "function highlightLink(currentPage, menuItems) {\n for (item of menuItems) {\n if (currentPage.includes(item.getAttribute('href'))) {\n item.classList.add('active')\n }\n }\n}", "title": "" }, { "docid": "dc9c066c5d666b9a9a451263ae9bb0d4", "score": "0.6577", "text": "function setCurrentNav() {\n var domain = document.domain;\n var navig = $('#mainnav>ul');\n var navLinks = navig.find('a');\n var afterDomain = window.location.pathname;\n\n\n navLinks.each(function(index) {\n var href = $(this).attr('href');\n if (href === afterDomain) {\n //set new current class\n liElem = $(this).closest('li');\n liElem.addClass('current');\n \n if(liElem.parent().hasClass('sub')){\n ulElem = liElem.parent('ul');\n ulElem.addClass('expand');\n ulElem.addClass('show');\n ulElem.parent().addClass('current') ;\n \n }\n\n\n\n }\n\n\n\n\n });\n\n }", "title": "" }, { "docid": "2421360e0ec14d7ec712a6fe80b44912", "score": "0.6576231", "text": "function setActiveTab(path) {\n for (const link of _navLinks) {\n if (path === link.getAttribute(\"href\")) {\n link.classList.add(\"active\");\n } else {\n link.classList.remove(\"active\");\n }\n }\n}", "title": "" }, { "docid": "515b3de761e6814330c9b96995cad685", "score": "0.65741324", "text": "function activate() {\n let nav_list = document.getElementById(\"navbar__list\");\n let links = nav_list.getElementsByClassName(\"menu__link\");\n for (var i = 0; i < links.length; i++) {\n links[i].addEventListener(\"click\", function () {\n let current = document.getElementsByClassName(\"active\");\n if (current.length > 0) {\n current[0].className = current[0].className.replace(\"active\", \"\");\n }\n this.className += \" active\";\n });\n }\n\n}", "title": "" }, { "docid": "d84338e263e0b60263f60cce10ec5015", "score": "0.65461665", "text": "function setActiveTab(pageId) {\r\n let pages = document.querySelectorAll(\".menu a\");\r\n for (let page of pages) {\r\n if (\"#\" + pageId === page.getAttribute(\"href\")) {\r\n page.classList.add(\"active\");\r\n } else {\r\n page.classList.remove(\"active\");\r\n }\r\n\r\n }\r\n}", "title": "" }, { "docid": "adff91ed5643d21669e8460935165881", "score": "0.65403855", "text": "function active(){\n const observer = new IntersectionObserver(\n function (views){\n for (view of views) {\n if (view.isIntersecting){\n view.target.classList.add('your-active-class');\n let navs = document.querySelectorAll('li');\n //add class 'active' to navbar\n for(nav of navs){\n if (view.target.id == nav.textContent){\n nav.classList.add('active');\n }else{nav.classList.remove('active');\n }\n }\n }else{view.target.classList.remove('your-active-class')};\n };\n \n }, {threshold: [0.65]});\n parts.forEach(part => {observer.observe(part)});\n}", "title": "" }, { "docid": "ab52fc721417d2a653cd0a384e951711", "score": "0.6531443", "text": "function activeNavLinks() {\r\n let element = document.getElementsByClassName(\"navigation\");\r\n for (let i = 0; i < element.length; i++) {\r\n element[i].addEventListener(\"click\", function () {\r\n let current = document.getElementsByClassName(\"active\");\r\n if (current.length == 1) {\r\n current[0].className = current[0].className.replace(\" active\", \"\");\r\n }\r\n this.className += \" active\";\r\n });\r\n }\r\n}", "title": "" }, { "docid": "cb758347cbae0bfdfb4739301f03eda2", "score": "0.6518412", "text": "function highlightActiveNavLink() {\n var windowStart = $(window).scrollTop(),\n windowEnd = windowStart + $(window).height(),\n documentHeight = $(document).height(),\n $lastLink = $(\".nav-item:last-child .nav-link\");\n\n for (var i = 0; i < navLinks.length; i++) {\n var id = navLinks[i],\n divStart = $(id).offset().top,\n divEnd = divStart + $(id).height(),\n $link = $(\"a[href='\" + id + \"']\");\n\n //check whether window is currently on passed div\n if (windowStart >= divStart - ARTICLE_MARGIN && windowStart < divEnd) {\n $link.addClass(\"active\");\n } else {\n $link.removeClass(\"active\");\n }\n }\n //check whether window bottom is reached\n if (windowEnd === documentHeight && !$lastLink.hasClass(\"active\")) {\n $(\".active\").removeClass(\"active\");\n $lastLink.addClass(\"active\");\n }\n }", "title": "" }, { "docid": "9ae8377c4121084e36ec82878a012613", "score": "0.65148157", "text": "function staticNavigation() {\n var path = window.location.pathname + window.location.hash;\n\n $(\"#sidebar .menu-item\").removeClass('active');\n\n $(\"#sidebar .menu-item > a\").each(function () {\n var href = $(this).attr('href');\n if (href == '#') {\n href = $(this).attr('data-href');\n }\n\n if (path == href) {\n $(this).parents('.menu-item-has-children').addClass('active');\n $(this).closest('.menu-item').addClass('active');\n }\n });\n}", "title": "" }, { "docid": "4a496e11e04b064a2611794a12435a2b", "score": "0.6497915", "text": "function addActiveClass(section) {\n section.classList.add('your-active-class')\n activeSectionIndex = section.dataset.nav.split(' ')[1]\n navList.childNodes[activeSectionIndex - 1].classList.add('list-active-class')\n}", "title": "" }, { "docid": "edfed719fc983e26a1a0b8f0fbf71f1a", "score": "0.64932156", "text": "function setActive(elmnt) {\n //console.log(\"called set active on \" + elmnt);\n for(var i = 0; i < 4; i++) {\n if (document.links[i].getAttribute(\"href\") == elmnt) {\n //console.log(\"changed element to active\");\n document.links[i].className = 'active';\n }\n else {\n //console.log(document.links[i].getAttribute(\"href\"));\n //console.log(\"changed to inactive\");\n document.links[i].className = 'inactive';\n }\n }\n}", "title": "" }, { "docid": "f4c2689a9f365bc09803cb6e97adfa47", "score": "0.6480723", "text": "function setActiveTab(pageId) {\n let pages = document.querySelectorAll(\".menu a\");\n for (let page of pages) {\n if (\"#\" + pageId === page.getAttribute(\"href\")) {\n page.classList.add(\"active\");\n } else {\n page.classList.remove(\"active\");\n }\n }\n}", "title": "" }, { "docid": "c4db056b78cb67c29efbca4d05dbc25f", "score": "0.647529", "text": "function activeMenu(element) {\n let navHeadItem = document.getElementsByClassName('collapsible-header'),\n navBodyItem = document.querySelectorAll('.collapsible-body .row');\n\n for(let i = 0 ; i < navHeadItem.length ; i++) navHeadItem[i].setAttribute('class', navHeadItem[i].className.replace('active-item', ''))\n for(let i = 0 ; i < navBodyItem.length ; i++) navBodyItem[i].setAttribute('class', navBodyItem[i].className.replace('active-item', ''))\n\n element.setAttribute('class', element.className + ' active-item');\n}", "title": "" }, { "docid": "87afcf6a5b867db6e149d2a2fb321dd8", "score": "0.6473704", "text": "function navTab() {\n toggleFooter(0);\n var pathName = document.location.pathname.substring(6);\n switch (pathName) {\n case \"\":\n document.getElementById('navHome').className = \"active\";\n break;\n case \"Matchmaker\":\n document.getElementById('navMatchmaker').className = \"active\";\n break;\n case \"Requests\":\n document.getElementById('navRequests').className = \"active\";\n break;\n }\n}", "title": "" }, { "docid": "2e87b310690c5b45c47be47a5fb6a2c9", "score": "0.6470707", "text": "function addActive() {\n var posIndex;\n if (window.pageYOffset < contextPos) {\n posIndex = 0;\n } else if (window.pageYOffset >= contextPos && window.pageYOffset < onlineOverviewPos) {\n posIndex = 1;\n } else if (window.pageYOffset >= onlineOverviewPos && window.pageYOffset < blendedPos) {\n posIndex = 2;\n } else if (window.pageYOffset >= blendedPos && window.pageYOffset < designEdPos) {\n posIndex = 3;\n } else if (window.pageYOffset >= designEdPos && window.pageYOffset + document.documentElement.clientHeight !== document.documentElement.scrollHeight) {\n posIndex = 4;\n } else if (window.pageYOffset + document.documentElement.clientHeight === document.documentElement.scrollHeight) {\n posIndex = 5;\n }\n navList.forEach((item, i) => {\n if (posIndex === i) {\n item.classList.add(\"active\");\n } else {\n item.classList.remove(\"active\");\n }\n });\n}", "title": "" }, { "docid": "d84ca16d2b7af226ccd731829fb4ae5b", "score": "0.6451157", "text": "function updateNavheader(){\n\t\tvar current_pathname = window.location.pathname.replace('/','');\n\t\t$scope.pathname = current_pathname;\n\t\t\n\t\t$('.navbar-nav li').removeClass('active');\n\t\tif(current_pathname == 'login')\n\t\t\t$('.navbar-nav .home').addClass('active');\t\n\t\telse\n\t\t\t$('.navbar-nav .'+current_pathname).addClass('active');\n\t}", "title": "" }, { "docid": "e110dd7b8c05c363a4d286910f5b1390", "score": "0.6407109", "text": "function setActiveLink(e) {\n \n const navItemLinks = document.querySelectorAll('.menu__link');\n \n\t\n\tdocument.querySelectorAll('.mytarget')\n // set active for only current clicked link\n if(e.target.classList.contains(\"menu__link\")){\n \n // remove active from all links\n navItemLinks.forEach(link =>{\n link.classList.remove(\"active\");\n \n });\n //activate target link only\n e.target.classList.add(\"active\");\n\t\t\n }\n\t\n\n\t}", "title": "" }, { "docid": "7cfa6c15c01beb666f20ff87c865814f", "score": "0.64033824", "text": "function setActiveLink(){\r\n\t\t\tif( opts.controlLinks ) {\r\n\t\t\t\t$links.find('li').removeClass('active').eq(index).addClass('active');\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "976abd63852608506bcbecbfc0197a3f", "score": "0.6401703", "text": "function setActiveLink(id) {\n\tthis.idclass = $classes[id];\n\t$('.slider-nav a').removeClass('active');\n\t$('.slider-nav a[data-to=' + idclass + ']').addClass('active');\n}", "title": "" }, { "docid": "2baf6512dcf08802976c8f947878584b", "score": "0.6393996", "text": "function setActiveTab(pageId) {\n let pages = document.querySelectorAll(\".set-active a\");\n\n for (let page of pages) {\n if (`#${pageId}` === page.getAttribute(\"href\")) {\n page.parentElement.classList.add(\"active\");\n } else {\n page.parentElement.classList.remove(\"active\");\n }\n\n }\n}", "title": "" }, { "docid": "d12b4e18f56f3f4e0e4a102e7a06eb4f", "score": "0.6388316", "text": "function setActiveNavigation(activeTab) {\n $(\".nav li\").removeClass(\"active\");\n\n $(\"#\" + activeTab).addClass(\"active\");\n }", "title": "" }, { "docid": "dd8c71aad19d0ecc769e1dde5519761c", "score": "0.6385508", "text": "function setActiveOnScroll(){\n const sections = document.querySelectorAll(\"#header, #project-section, #about-section\");\n \n sections.forEach((section) => {\n if(window.pageYOffset >= section.offsetTop - 400){\n sectionTargetId = \"#\" + section.id; \n }\n });\n\n navLinks.forEach((link) => {\n link.classList.remove(\"activeLink\")\n if(link.getAttribute(\"href\") == sectionTargetId){\n link.classList.add(\"activeLink\");\n }\n });\n}", "title": "" }, { "docid": "a71960d46b6c1edf5d53cef48c411eb1", "score": "0.63841504", "text": "function decorateNavigationList(){\n // for each page, we set class to controller_page name\n var bodyClass = $('body').attr('class').split(\" \");\n for (var i = 0, l = bodyClass.length; i < l; ++i) {\n // get the right element - assume id is set for each li\n var navElem = $(\"li#\" + bodyClass[i]);\n // set active class\n $(\"nav.top-bar\").find(navElem).attr('class', 'active');\n }\n}", "title": "" }, { "docid": "e9a81c27b635d03dd55cccbe9fff624b", "score": "0.6382871", "text": "function setSectionActive(link, section, isViewed){\n\tsection.classList.add('your-active-class');\n\tlink.classList.add('active__link');\n\t// for (let j = 0; j < sections_count; j++){\n\t// \tif(j!=i){\n\t// \t\tlink.classList.remove('active__link');\n\t// \t\tsection.classList.remove('your-active-class');\n\t// \t}\n\t}", "title": "" }, { "docid": "c35aee7fd85476bc8cb801f71be00e08", "score": "0.63807154", "text": "function setActivePage() {\n // If the anchor tag inside the pagination list item has an 'href' attribute equal to the current page, set it's the class to active\n for (var i = 0; i < $pagination.children.length; i++) {\n var li = $pagination.children[i];\n if (parseInt(li.children[0].getAttribute(\"href\")) === page.currentPage) {\n li.classList = \"active\";\n }\n else {\n // Otherwise remove any classes it may have\n li.classList = \"\";\n }\n }\n}", "title": "" }, { "docid": "ac2059f76a12b4bdfe4da1af0bd66715", "score": "0.6379337", "text": "function setActiveLink(page) {\n\tlet links = document.querySelectorAll('.pagination a');\n\tfor (let i = 0; i < links.length; i++) {\n\t\tlinks[i].className = '';\n\t}\n\tlinks[page - 1].className = \"active\";\n}", "title": "" }, { "docid": "d472b9c0197d218609e3050939fc19b4", "score": "0.6378171", "text": "function updateActiveNav () {\n const sections = document.querySelectorAll('.section')\n const windowOT = window.scrollY\n const showingId = filterElements(sections, function (section) {\n if (windowOT >= section.offsetTop - (section.offsetHeight * 0.2)) return section\n }).pop().id\n document.querySelectorAll('.nav').forEach(function (ele) {\n if (showingId === ele.getAttribute('data-nav-ref')) {\n ele.classList.add('active')\n } else {\n ele.classList.remove('active')\n }\n })\n}", "title": "" }, { "docid": "295279c93858b11fbae2d0c00ec838da", "score": "0.6368813", "text": "function toggleActiveState(){\r\n for(const section of sections){\r\n // If the section is in the Viewport\r\n if(sectionInViewPort(section)){\r\n // And if section doesn't have class 'active'\r\n if(!section.classList.contains('your-active-class')){\r\n // Add class 'active' to the section\r\n section.classList.add('your-active-class');\r\n }\r\n \r\n let links = document.querySelectorAll(\".menu__link\"); // Select all elements with class '.menu__link'\r\n links.forEach((link) => { // Use forEach method to add or remove class active from the <a> classes\r\n if (section.getAttribute(\"data-nav\") == link.innerText) {\r\n link.classList.add(\"active\"); // Add class active to the <a> element\r\n } else {\r\n link.classList.remove(\"active\"); // Remove class active from the <a> element\r\n }\r\n });\r\n } else { \r\n // Remove class 'active' from the section that is not in the viewport\r\n section.classList.remove('your-active-class') \r\n }\r\n \r\n \r\n }\r\n}", "title": "" }, { "docid": "5d2652276e7674f0ea4762f002a18938", "score": "0.63623947", "text": "function makeActive() {\n // Get menu links\n const menuLinks = document.querySelectorAll('.menu__link')\n // Make the first link item active on page load\n menuLinks[0].classList.add('active');\n\n for(let i = 0; i < sectionsArr.length; i++) {\n window.addEventListener('scroll', () => {\n if(Math.floor(window.scrollY) + navbarList.offsetHeight >= sectionsArr[i].offsetTop) {\n // Toggle the active state of the section which is already active \n document.querySelector('.your-active-class').classList.remove('your-active-class');\n // Make the section scrolled active\n let idSelector = sectionsArr[i].id;\n idSelector = '#' + idSelector;\n document.querySelector(idSelector).classList.add('your-active-class'); \n // Make the link for the section scrolled active\n document.querySelector('.active').classList.remove('active');\n menuLinks[i].classList.add('active');\n }\n }) \n }\n}", "title": "" }, { "docid": "aa2372af7c4bb0226ca18c84c6b863c1", "score": "0.63611287", "text": "function addClassActive() {\n links.forEach(e => e.classList.remove('active'))\n this.classList.add('active')\n}", "title": "" }, { "docid": "d2dd5f64dcc14054ed95dc01a7c51de8", "score": "0.6360336", "text": "function changeActiveNav(nav) {\n $(\".nav-link .sr-only\").remove();\n $(\".active\").removeClass(\"active\");\n nav.addClass(\"active\");\n nav.append(`<span class=\"sr-only\">(current)</span>`);\n }", "title": "" }, { "docid": "4f13a523147f2b795cbea8dfb80ce8bf", "score": "0.6357322", "text": "function setActiveLink(setActive) {\n\tvar links = document.querySelectorAll(\"#menuLinks li\");\n\tArray.prototype.map.call(links, function(e) {\n\t\te.className = \"\";\n\t\tif (e.id == setActive)\n\t\t\te.className = 'active';\n\t})\n}", "title": "" }, { "docid": "5ba062fb894c3369a5f3ce01c54f1ead", "score": "0.6355021", "text": "function nav_setClasses(obj) {\n\tvar id = $(obj).attr('data-id');\n\tvar catId = $(obj).attr('data-cat');\n\n\t//activate nav visually\n\t$('.nav_item').each(function (i,item) {\n\n\t\tif (item != obj[0]) {\n\t\t\t$(item).removeClass('nav_active');\n\t\t} else {\n\t\t\t$(item).addClass('nav_active');\n\t\t}\n\n\t});//end each\n\n\twindow.portCurrentIndex = id;\n\twindow.portCurrent = catId;\n\n}//end f", "title": "" }, { "docid": "c36e0b031b9f60a78b69f34f8fc3e2ce", "score": "0.6350954", "text": "function activeLinkChange() {\n let index = sections.length;\n \n while(--index && window.scrollY + 200 < sections[index].offsetTop) {}\n \n links.forEach((link) => link.classList.remove('active'));\n links[index].classList.add('active');\n }", "title": "" }, { "docid": "f5e0f74977f89c92fb4b441df5559335", "score": "0.63470817", "text": "function inView() {\n for (var i = 0; i < sections.length; i++) {\n let nav_list = document.getElementById(\"navbar__list\");\n let links = nav_list.getElementsByClassName(\"menu__link\");\n if (check(sections[i])) {\n sections[i].className = \"your-active-class\";\n }\n else {\n sections[i].classList.remove(\"your-active-class\")\n }\n }\n}", "title": "" }, { "docid": "ee0c1faf7dc66f97be78b602fd0230f1", "score": "0.63411343", "text": "function active(pageNumber) {\n var page = pageNumber;\n pageLinks.each(function() {\n $(this).removeClass('active');\n if ($(this).text() === page) {\n $(this).addClass('active');\n }\n });\n}", "title": "" }, { "docid": "b9d32f655a732d2088ba88a31507e174", "score": "0.6339791", "text": "function activeAnchor(dataValue)\n{ \n const anchors = document.querySelectorAll('a');//array of all anchor elemnets in DOM.\n for(const anchor of anchors)\n {\n if (anchor.textContent===dataValue)\n {\n anchor.classList.add('active-link');\n }\n else\n {\n anchor.classList.remove('active-link');\n }\n } \n}", "title": "" }, { "docid": "9110bb491b5898570986be3c5bb61a2c", "score": "0.6328532", "text": "function resolveUrl() {\n if (!location.hash) return;\n loadContentSection(location.hash);\n var previousSelection = document.querySelector('.active-menu');\n const newActiveLink = document.querySelector(`[href=\"${location.hash}\"]`);\n if(!newActiveLink) return;\n if (previousSelection) previousSelection.classList.remove('active-menu');\n newActiveLink.classList.add('active-menu');\n \n }", "title": "" }, { "docid": "714d3a19a56c9874ea47e77fec39aef8", "score": "0.6324175", "text": "function makeActiveClasses() {\n for(const section of sections) {\n const rect = section.getBoundingClientRect(); //get Rectangle container for each section\n\n //adding active class to the sections\n\n //mobile first\n let w = window.innerWidth;\n if(w < 600) {\n if(rect.bottom <= window.innerHeight + 600) {\n section.classList.add(\"your-active-class\");\n var whichSection = section.getAttribute(\"id\");\n }\n else {\n section.classList.remove(\"your-active-class\");\n }\n //tablet and desktop \n } else {\n if(rect.bottom <= window.innerHeight) {\n section.classList.add(\"your-active-class\");\n var whichSection = section.getAttribute(\"id\");\n }\n else {\n section.classList.remove(\"your-active-class\");\n }\n }\n \n //adding active class to the navbar Links\n const navlinks = document.getElementsByClassName(\"navLinks\");\n for(let i = 0; i < navlinks.length; i++) {\n if(whichSection == `section${i+1}`) {\n navlinks[i].classList.add(\"active\");\n }\n else {\n navlinks[i].classList.remove(\"active\");\n }\n }\n }\n}", "title": "" }, { "docid": "d27569476424c6348c44a7720aba7cfe", "score": "0.6311463", "text": "function setActive(id) {\n document.getElementById(id).setAttribute(\"class\", \"nav-link active\");\n if (id === \"tab-index\" || id === \"tab-ayer\" || id === \"tab-rango\") {\n document.getElementById('grafico').setAttribute(\"class\", \"nav-link active\");\n }\n}", "title": "" }, { "docid": "01a2cc2e6485e214404867b3c7825dcb", "score": "0.62995523", "text": "function getCurrentMenuItem(containerElement) {\n let url = location.href,\n links = [...containerElement.querySelectorAll('a')];\n links.map(link =>{\n if(link.href === url) return link.classList.add('active');\n })\n}", "title": "" }, { "docid": "2e290911d13094135ceb2738d59b5569", "score": "0.62909937", "text": "classesActiveMenu(hashPath) {\n\t\tif (window.location.hash === '#/' && hashPath === '#/search') {\n\t\t\treturn classNames(\n\t\t\t\t'active-header'\n\t\t\t);\n\t\t}\n\n\t\treturn classNames(\n\t\t\t{'active-header': (hashPath === window.location.hash)}\n\t\t);\n\t}", "title": "" }, { "docid": "9ddc473801142d86b506cb80f8102531", "score": "0.6284128", "text": "function ChangeNavColor() {\n // Get the section name from the navbar' now active URL\n var currentSection = $(\".nav li.active > a\").attr('href');\n // Set the link color\n $(\".nav a:link\").css('color', ColorForSection[currentSection]); \n}", "title": "" }, { "docid": "c80511b5cc4064eea4794213df9689e5", "score": "0.6280116", "text": "function analisisPosicionMenu() {\n\tvar url = $(location).attr('pathname');\n\t$(\"nav ul li\").removeClass();\n\tswitch(url){\n\t\tcase \"/km/\":\n\t\t\t$(\"#navInicio\").addClass('active');\n\t\t\tbreak;\n\t\tcase \"/km/kiosko.jsp\":\n\t\t\t$(\"#navKioskos\").addClass('active');\n\t\t\tbreak;\n\t\tcase \"/km/contacto.jsp\":\n\t\t\t$(\"#navContactos\").addClass('active');\n\t\t\tbreak;\n\t\tcase \"/km/ayuda.jsp\":\n\t\t\t$(\"#navAyuda\").addClass('active');\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "b741105c2c6882080800b8c0d972c43b", "score": "0.6257568", "text": "function setSidebarLinkActive() {\n var sidebar_reservation_link = $('a[href=\"/admin/reservations\"]');\n $(sidebar_reservation_link).removeClass('sidebar__link--active');\n $(sidebar_reservation_link).addClass('sidebar__link--inactive');\n var pagePath = window.location.pathname;\n $('a[href=\"' + pagePath + '\"]').addClass('sidebar__link--active');\n }", "title": "" }, { "docid": "181a12c5cab8b03ac16822f4bac4dd07", "score": "0.6255146", "text": "function markActiveLink(currSection) {\n const currId = currSection.id;\n\n sections.forEach(({id, link}) => {\n if (link) link.classList[(id === currId ? 'add' : 'remove')]('is-active');\n });\n}", "title": "" }, { "docid": "5d15a4dcb3adc06442ef825bc1dba7b0", "score": "0.6239303", "text": "function setCurrentPage() {\r\n var active = document.getElementById(location.pathname.split('/').slice(-1)[0])\r\n if (active != null) {\r\n active.classList.add('active');\r\n var parent = document.getElementById('deroul')\r\n if (parent != null && parent.contains(active)) {\r\n var parent_text = document.getElementById('tops')\r\n if (parent_text != null) {\r\n parent_text.classList.add('active');\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "600ee8812c47d60be28b4c23fc4eae93", "score": "0.6235137", "text": "function setNavActive(e) {\n const closestLi = !!e.target && e.target.closest(\"li\");\n console.log(closestLi);\n var tabs = document.querySelectorAll(\".all-tabs ul li\");\n !!tabs && tabs.forEach((element) => {\n !!element.classList && element.classList.remove(\"active-nav\");\n });\n !!closestLi && !!closestLi.classList && closestLi.classList.add(\"active-nav\");\n }", "title": "" } ]
cc880373eb688d52b153ae4b214abac5
Actual scraper takes Xpath elements of website
[ { "docid": "aa2736b45e609643dd723c75acf8b64e", "score": "0.0", "text": "async function scraperProduct(url, filename, adltsQ){\n console.log('Starting scraper...');\n \n const browser = await puppeteer.launch();\n const page = await browser.newPage();\n await page.goto(url);\n\n console.log('Fetching data...');\n await page.waitFor(3000);\n\n //Departure flight\n //Price\n const [el1] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[1]/journey-container/journey/div/div[2]/carousel-container/carousel/div/ul/li[3]/carousel-item/button/div[2]/ry-price/span[2]');\n const txt = await el1.getProperty('textContent');\n const Price = await txt.jsonValue();\n //From city, to city\n const [el2] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[1]/journey-container/journey/div/div[1]/h3/text()');\n const txt2 = await el2.getProperty('textContent');\n const FromTo = await txt2.jsonValue();\n //Departure date\n const [el3] = await page.$x('/html/body/flights-root/div/div/flights-trip-details-container/flights-trip-details/div/div[2]/text()[2]');\n const txt3 = await el3.getProperty('textContent');\n const DepartureDate = await txt3.jsonValue();\n //Departure time\n const [el4] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[1]/journey-container/journey/flight-list/div/flight-card/div/div/div[1]/div/flight-info/div[1]/span[1]');\n const txt4 = await el4.getProperty('textContent');\n const DepartureTime = await txt4.jsonValue();\n //Arrival time\n const [el5] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[1]/journey-container/journey/flight-list/div/flight-card/div/div/div[1]/div/flight-info/div[3]/span[1]');\n const txt5 = await el5.getProperty('textContent');\n const ArrivalTime = await txt5.jsonValue();\n //Currency\n const [el12] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[1]/journey-container/journey/div/div[2]/carousel-container/carousel/div/ul/li[3]/carousel-item/button/div[2]/ry-price/span[1]');\n const txt12 = await el12.getProperty('textContent');\n const Currency = await txt12.jsonValue();\n // Price element + currency element (euro, pounds, etc..)\n let Departureprice = (Price * adltsQ);\n \n //Return flight\n //Price\n const [el6] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[2]/journey-container/journey/div/div[2]/carousel-container/carousel/div/ul/li[3]/carousel-item/button/div[2]/ry-price/span[2]');\n const txt6 = await el6.getProperty('textContent');\n const Price2 = await txt6.jsonValue();\n //From city, to city\n const [el7] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[2]/journey-container/journey/div/div[1]/h3/text()');\n const txt7 = await el7.getProperty('textContent');\n const FromTo2 = await txt7.jsonValue();\n //Return date\n const [el8] = await page.$x('/html/body/flights-root/div/div/flights-trip-details-container/flights-trip-details/div/div[2]/span[2]');\n const txt8 = await el8.getProperty('textContent');\n const ReturnDate = await txt8.jsonValue();\n //Departure time\n const [el9] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[2]/journey-container/journey/flight-list/div/flight-card[1]/div/div/div[1]/div/flight-info/div[1]/span[1]');\n const txt9 = await el9.getProperty('textContent');\n const DepartureTime2 = await txt9.jsonValue();\n //Arrival time\n const [el10] = await page.$x('/html/body/flights-root/div/div/div/div/flights-summary-container/flights-summary/div/div[2]/journey-container/journey/flight-list/div/flight-card[1]/div/div/div[1]/div/flight-info/div[3]/span[1]');\n const txt10 = await el10.getProperty('textContent');\n const ArrivalTime2 = await txt10.jsonValue();\n // Price element + currency element (euro, pounds, etc..)\n let Returnprice = (Price2 * adltsQ);\n \n var data = {ScrapeDate: Date().toLocaleString(), TotalPrice: (parseFloat(Returnprice) + parseFloat(Departureprice)) + ' ' + Currency, Departure: FromTo.trim(), DepartureDate: DepartureDate + ' ' + d.getFullYear(), Price: Departureprice + ' ' + Currency , DepartureTime: DepartureTime.trim(), ArrivalTime: ArrivalTime.trim(), Return: FromTo2.trim(), ReturnDate: ReturnDate.slice(3, 10) + ' ' + d.getFullYear(), Price2: Returnprice + ' ' + Currency, DepartureTime2: DepartureTime2.trim(), ArrivalTime2: ArrivalTime2.trim(), Currency: Currency};\n var jsonData = JSON.stringify(data);\n console.log('Adding data to file...');\n\n if(firstLine[firstLine.length -1] == false){\n writeToFile(filename +'.json', ',' + jsonData);\n }else{\n writeToFile(filename +'.json', jsonData);\n }\n \n firstLine[firstLine.length - 1] = false;\n console.log('Data has been added to file!');\n}", "title": "" } ]
[ { "docid": "1dcee1d1a235e7c97efdac7aae5c967f", "score": "0.5972121", "text": "function $x(xpath) {\r\n xpath=xpath.replace(/((^|\\|)\\s*)([^/|]+)/g,'$2//$3').replace(/([^.])\\.(\\w*)/g,'$1[@class=\"$2\"]').replace(/#(\\w*)/g,'[@id=\"$1\"]').replace(/\\/\\[/g,'/*[');\r\n var got=document.evaluate(xpath,document,null,0,null), result=[];\r\n while(next=got.iterateNext()) result.push(next);\r\n return result;\r\n}", "title": "" }, { "docid": "82e96a1150187940a5bbcebce316e7a8", "score": "0.59285754", "text": "scrapePage() {\n return Array.from(document.querySelectorAll(\"tr.athing\")).map((el) => {\n let detailsRow = el.nextElementSibling;\n let spacerRow = detailsRow.nextElementSibling;\n\n return {\n // Return a unique ID for each row\n id: String(el.getAttribute(\"id\")),\n\n // Return DOM elements corresponding to this row\n // (this enables DOM manipulation for sorting/filtering)\n rowElements: [el, detailsRow, spacerRow],\n\n // Return data values for the row by scraping\n dataValues: {\n rank: el.querySelector(\"span.rank\"),\n title: el.querySelector(\"a.storylink\"),\n link: el.querySelector(\"a.storylink\").getAttribute(\"href\"),\n },\n\n // Specify where annotations should be injected\n annotationContainer: detailsRow.querySelector(\"td.subtext\") as HTMLElement,\n annotationTemplate: `| <span style=\"color: #f60;\">$annotation</span>`,\n };\n });\n }", "title": "" }, { "docid": "3646796b50947d3c44e7e5d6f254cd7e", "score": "0.59193444", "text": "_extractElements() {\n this.$status = this.$root.querySelector(`.${STATUS_CLASS}`);\n this.$loaderBar = this.$root.querySelector(`.${LOADER_BAR_CLASS}`);\n }", "title": "" }, { "docid": "a3b08174c5a8df898bf62506677cd69f", "score": "0.5898362", "text": "function extractHTML(html) {\n let selectorTool = cheerio.load(html); //selector tool me html load kkardega\n\n let allTables = selectorTool('.table tbody');\n //console.log(allTables.length);\n for (let i = 0; i < 4; i++) {\n let allRows = selectorTool(allTables[i]).find('tr'); // iss se hum saari rows extract kar skte h\n\n //console.log(allRows.length);\n\n //ab saari rows par iterate karte huye har player ke naam ke links nikaalenge\n for (let j of allRows) {\n //selector tool me wrap karna zaroori hota h kyuki usse nhi pata kaise read karna h\n\n let link = selectorTool(j).find('a').attr('href'); //attribute select karne ke liye, hume link chaaiye jo har row me h\n //https://www.espncricinfo.com/\n // console.log(link);\n\n if(link){\n let fullLink=\"https://www.espncricinfo.com/\"+link;\n //console.log(fullLink);\n getBirthday(fullLink);\n }\n\n }\n\n }\n\n\n}", "title": "" }, { "docid": "5af7c12847abf2716eff6958ce8c02fe", "score": "0.58138627", "text": "get productPrices(){ \n\n return $$(\"//tr/td[4]/strong\")\n }", "title": "" }, { "docid": "6a538c2aea7cc0de5123ebf76915b487", "score": "0.58069235", "text": "function $$(xpath,root) { \r\n xpath = xpath\r\n .replace(/((^|\\|)\\s*)([^/|\\s]+)/g,'$2.//$3')\r\n .replace(/\\.([\\w-]+)(?!([^\\]]*]))/g, '[@class=\"$1\" or @class$=\" $1\" or @class^=\"$1 \" or @class~=\" $1 \"]')\r\n .replace(/#([\\w-]+)/g, '[@id=\"$1\"]')\r\n .replace(/\\/\\[/g,'/*[');\r\n str = '(@\\\\w+|\"[^\"]*\"|\\'[^\\']*\\')';\r\n xpath = xpath\r\n .replace(new RegExp(str+'\\\\s*~=\\\\s*'+str,'g'), 'contains($1,$2)')\r\n .replace(new RegExp(str+'\\\\s*\\\\^=\\\\s*'+str,'g'), 'starts-with($1,$2)')\r\n .replace(new RegExp(str+'\\\\s*\\\\$=\\\\s*'+str,'g'), 'substring($1,string-length($1)-string-length($2)+1)=$2');\r\n var got = document.evaluate(xpath, root||document, null, 5, null);\r\n var result=[];\r\n while (next = got.iterateNext())\r\n result.push(next);\r\n return result;\r\n}", "title": "" }, { "docid": "6a538c2aea7cc0de5123ebf76915b487", "score": "0.58069235", "text": "function $$(xpath,root) { \r\n xpath = xpath\r\n .replace(/((^|\\|)\\s*)([^/|\\s]+)/g,'$2.//$3')\r\n .replace(/\\.([\\w-]+)(?!([^\\]]*]))/g, '[@class=\"$1\" or @class$=\" $1\" or @class^=\"$1 \" or @class~=\" $1 \"]')\r\n .replace(/#([\\w-]+)/g, '[@id=\"$1\"]')\r\n .replace(/\\/\\[/g,'/*[');\r\n str = '(@\\\\w+|\"[^\"]*\"|\\'[^\\']*\\')';\r\n xpath = xpath\r\n .replace(new RegExp(str+'\\\\s*~=\\\\s*'+str,'g'), 'contains($1,$2)')\r\n .replace(new RegExp(str+'\\\\s*\\\\^=\\\\s*'+str,'g'), 'starts-with($1,$2)')\r\n .replace(new RegExp(str+'\\\\s*\\\\$=\\\\s*'+str,'g'), 'substring($1,string-length($1)-string-length($2)+1)=$2');\r\n var got = document.evaluate(xpath, root||document, null, 5, null);\r\n var result=[];\r\n while (next = got.iterateNext())\r\n result.push(next);\r\n return result;\r\n}", "title": "" }, { "docid": "ff4f9747d13b22f19b6a859b731a3961", "score": "0.5802322", "text": "function getElementsByXpath(xpath, node = document) {\n // Helper namespace resolver\n function nsResolver(p) {\n let group = {\n mathml: \"http://www.w3.org/1998/Math/MathML\",\n s: \"http://www.w3.org/2000/svg\",\n svg: \"http://www.w3.org/2000/svg\",\n x: \"http://www.w3.org/1999/xhtml\",\n xhtml: \"http://www.w3.org/1999/xhtml\",\n xlink: \"http://www.w3.org/1999/xlink\"\n };\n return group[p] || null;\n };\n // Initialise output\n let output = new Array();\n // Get the node snapshot\n let snapshot = document.evaluate(\n xpath,\n node,\n nsResolver,\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\n null\n );\n // If none, return null\n if (snapshot.snapshotLength === 0) return null;\n // Loop for the snapshot length and push to the output\n for (let i = 0; i < snapshot.snapshotLength; ++i) {\n output.push(snapshot.snapshotItem(i));\n };\n return output;\n}", "title": "" }, { "docid": "df94d7d608054de3404db022f32cb864", "score": "0.57631403", "text": "async function getJobsLinks () {\n\n const browser = await puppeteer.launch({headless:false});\n const page = await browser.newPage();\n // await page.setDefaultNavigationTimeout(0);\n //await page.waitForTimeout(4000);\n await page.goto(\"https://www.welcometothejungle.com/fr/companies/galadrim/jobs\");\n\n const hrefs = await page.$$eval('.gc3qm0-1.elzqlN div article header a', as => as.map(a => a.href)); \n await browser.close();\n //console.log(hrefs);\n return hrefs; \n}", "title": "" }, { "docid": "59740dbf544aff16742f21c84733d1ae", "score": "0.5755229", "text": "getResultElements() {\n return Array.from(this.winRef.document.querySelectorAll('.products > a, .suggestions > a'));\n }", "title": "" }, { "docid": "74034d2a7b2d5f03adae5bd0fe05c564", "score": "0.5692774", "text": "async function scrapPage(page, browser, page_nr) {\n\n let clicked = true;\n\n await page.waitFor(500);\n await page.waitForSelector(\"div.jobContainer\");\n\n\n // ID der Überschriften zum klicken auslesen und in result speichern\n let result = await page.evaluate(() =>\n Array.from(document.querySelectorAll(\"div.jobContainer\"))\n .map(element => ({\n title: element.childNodes[1].innerText,\n city: element.childNodes[2].childNodes[0].innerText,\n href: element.childNodes[1].href,\n days: element.childNodes[2].childNodes[1].innerText,\n company: element.childNodes[0].innerText\n }))\n ); // end of result\n\n let endData = [];\n\n //klick durch die Überschriften\n for (i = 1; i <= result.length; i++) {\n\n if (i == 6) {\n i++;\n }\n\n // klick dletzte an\n try {\n await page.waitFor(100);\n } catch (e) {\n continue;\n }\n\n // klick die i-te Anzeige an\n try {\n await page.waitForSelector(`#MainCol > div > ul > li:nth-child( ${i}) > div.jobContainer > a`, { timeout: 5000 });\n await page.click(`#MainCol > div > ul > li:nth-child( ${i}) > div.jobContainer > a`);\n\n await page.waitFor(100);\n } catch (e) {\n continue;\n }\n\n\n\n await clickIfAv(page, \"#JAModal > div > div.modal_main > span > svg\");\n\n\n // Warte bis alles auf der rechten Seite geladen hat \n try {\n\n await page.waitForSelector(\"#HeroHeaderModule > div.empWrapper.ctasTest > div.empInfo.newDetails > div.title\", { timeout: 2000 });\n\n } catch{\n\n await page.waitFor(500);\n\n await page.goBack();\n\n await page.waitFor(200);\n\n await page.click(`#MainCol > div > ul > li:nth-child( ${i}) > div.jobContainer > a`);\n try {\n await page.waitForSelector(\"#HeroHeaderModule > div.empWrapper.ctasTest > div.empInfo.newDetails > div.title\", { timeout: 2000 });\n\n } catch{\n continue;\n }\n }\n\n /* \n Vergleich Titel von Linke Seite und rechte Seite, falls die eiden nicht übereinstimmen, wird 200ms gewartet, bis die rchte Seite nachlädt\n */\n\n let count_rl = 0;\n let cont = false;\n\n let leftTitle;\n let rightTitle\n\n try {\n\n leftTitle = await page.evaluate((i) => {\n return document.querySelectorAll(\"#MainCol > div > ul > li:nth-child( 1) > div.jobContainer > a\")[0].innerText;\n }, (i));\n\n rightTitle = await page.evaluate(() => {\n return document.querySelector(\"div.title\").innerText;\n });\n\n } catch{\n continue;\n }\n\n // Warten bis rechte Seite geladen hat\n\n let count_n = 0;\n while (leftTitle != rightTitle) {\n\n if (count_n > 5) {\n await page.click(`#MainCol > div > ul > li:nth-child( ${i + 1}) > div.jobContainer > a`);\n await page.click(`#MainCol > div > ul > li:nth-child( ${i}) > div.jobContainer > a`);\n await page.waitFor(300);\n }\n if (count_n > 10) {\n page.evaluate(_ => {\n window.scrollBy(0, window.innerHeight);\n });\n }\n\n\n\n\n await page.waitFor(200);\n\n rightTitle = await page.evaluate(() => {\n return document.querySelector(\"div.title\").innerText;\n });\n\n leftTitle = await page.evaluate((i) => {\n return document.querySelectorAll(\"#MainCol > div > ul > li:nth-child( \" + (i) + \") > div.jobContainer > a\")[0].innerText;\n }, (i));\n count_n++;\n\n }\n\n\n \n try {\n\n await page.waitForSelector(\"div.employerName\", { timeout: 2000 });\n await page.waitForSelector(\"div.location\", { timeout: 2000 });\n await page.waitForSelector(\"div.jobDesc\", { timeout: 2000 });\n await page.waitForSelector(\"#MainCol > div > ul > li:nth-child( 1) > div.jobContainer > a\", { timeout: 2000 });\n\n } catch{\n console.log(\"cont\");\n continue;\n }\n\n\n\n\n\n let info = await page.evaluate((i) => {\n\n let things = [];\n let Title = document.querySelector(\"div.title\").innerText;\n let Company = document.querySelector(\"div.employerName\").innerText;\n let City = document.querySelector(\"div.location\").innerText;\n let Descr = document.querySelectorAll('div.jobDesc')[0].innerText.replace(/\\r\\n|\\n|\\r/gm, \" \");\n\n let URL = document.querySelectorAll(\"#MainCol > div > ul > li:nth-child( \" + i + \") > div.jobContainer > a\")[0].href;\n let Days = document.querySelectorAll(\"#MainCol > div > ul > li:nth-child( \" + i + \") > div.jobContainer\")[0].childNodes[2].childNodes[1].innerText;\n\n things.push({ Title, Company, City, Descr, URL, Days }); // Push an object with the data onto our array\n\n return things; // Return our data array\n }, (i));\n\n // Den text auf Zahlen minimieren, falls keine Zahlen: vor 0 Tagen\n\n let finDate = daysToDate(info[0].Days);\n\n if (finDate == 1900-01-01) {\n continue;\n\n }\n\n info[0].Days = finDate;\n\n\n\n\n endData.push(info);\n\n }\n\n return endData;\n\n} // end of scrapFirstPage--------------------------------------------------------", "title": "" }, { "docid": "7612e289b477f67ef5ecddb26638ef21", "score": "0.56864375", "text": "async function scraping(){\n\tvar urls = [];\n\tawait request('https://www.relaischateaux.com/fr/site-map/etablissements', (error, response,html) => {\n\t\tconst $ = cheerio.load(html);\n\t\t$('#countryF',html).find(\"h3:contains('France')\").parent().find(\".listDiamond > li\").each(function(index){\n\t\t\turls.push($(this).find(\"a\").first()[0].attribs.href);\n\t\t});\n\t\t/*\n\t\tconsole.log(urls[0]);\n\t\tconsole.log(urls[1]);\n\t\t*/\n\t});\n\treturn urls;\n}", "title": "" }, { "docid": "00dcc5ff082307c17003b456c170cadc", "score": "0.5635582", "text": "scrapeAnswers() {\n\t\tvar i;\n\t\tfor ( i = 0; i < 5; i ++ ) {\n\t\t\t//this hack stores the answer element objects in the answers array \n\t\t\tanswers[i] = browser.execute(\"return document.getElementsByClassName('ace-btn--question')[\" + i + \"].text\");\n\t\t\tconsole.log(answers[i].value);\n\t\t}\n\t}", "title": "" }, { "docid": "706e04c96e01d2fbe45eda185baff46e", "score": "0.56155473", "text": "function parseHtml(html) {\n let $ = cheerio.load(html);\n //parsing series\n let cards = $(\".cscore.cscore--final.cricket.cscore--watchNotes\");\n for (let i = 0; i < cards.length; i++) {\n let matchtype = $(cards[i]).find(\".cscore_info-overview\").html();\n let test = matchtype.includes(\"ODI\") || matchtype.includes(\"T20I\");\n if (test === true) {\n // console.log(matchtype);\n let anchors = $(cards[i]).find(\".cscore_buttonGroup ul li a\").attr(\"href\");\n let links = `https://www.espncricinfo.com${anchors}`;\n goToEachMatch(links);\n\n // console.log(\"//////////////////////////////////////////////////////////////\");\n // count++;\n }\n }\n\n\n}", "title": "" }, { "docid": "b092585c8318a7901f7f093f987962e8", "score": "0.56098044", "text": "function selectNodes(xPath,params){\r\n\t\t\tparams=(params||{});\r\n\t\t\treturn (params['doc']||document).evaluate(xPath,(params['node']||document),null,(params['type']||6),null);\r\n\t\t}", "title": "" }, { "docid": "9261b62c299e37afefec60ac5fdd0c38", "score": "0.5598646", "text": "function selectNodes(xPath,params){\n\t\t\tparams=(params||{});\n\t\t\treturn (params['doc']||document).evaluate(xPath,(params['node']||document),null,(params['type']||6),null);\n\t\t}", "title": "" }, { "docid": "7b2af703fe18028b3a0865c2dcfe703e", "score": "0.5597486", "text": "function ScrapeExample(){\n// statement\nconsole.log(\"Scraping the page...\");\n driver.findElement(By.xpath('//input[@value=\"male\"]')).click();\n driver.findElement(By.id('name')).sendKeys(\"Saurabh Kumar student \");\n driver.findElement(By.name('vehicle1')).click();\n\n // Get the text from multiple elements\n\n driver.findElements(By.id('fruits')).then(function(elements){\n for( var i =0; i< elements.length;i++){\n elements[i].getText().then(function(text){\n console.log('List of Fruits \\n' + text)\n });\n }\n });\n \n driver.findElement(By.xpath('//select[@id=\"cars\"]/option[@value=\"BMW\"]')).click();\n \n // getting the href based on search query parameter using partial link\n\n driver.findElement(By.partialLinkText('Jazeb'))\n .getAttribute('href').then(function(value){\n console.log('1st link' + value); \n });\n\n // getting the href based on anchor tag value using linkText\n\n driver.findElement(By.linkText('Jazeb Akram'))\n .getAttribute('href').then(function(value){\n console.log('2nd link' + value);\n });\n\nPause(3,QuitDriver);\n}", "title": "" }, { "docid": "5f455d955cea7ea91663eea18e2cae6a", "score": "0.55948853", "text": "function getLinksGoogle(){\n \n linkBox = document.getElementsByClassName(\"g\")\n for(x = 0; x < 10; x++){\n try{\n var Raw_URL_link = linkBox[x].getElementsByTagName(\"*\");\n console.log(linkBox[x])\n console.log(Raw_URL_link[7].getElementsByTagName(\"*\")[0])\n\n }catch(error){\n console.log(console.error())\n }\n \n }\n var query = document.querySelectorAll(\"[data-hveid]\")\n //console.log(\"data-hveid\")\n //console.log(query[5])\n\n\n \n \n}", "title": "" }, { "docid": "937fd48ebd84f46f3863edd3441279d2", "score": "0.55862", "text": "function xpath_list(xpath, root, order)\n{\n if(!root)\n root = window.document ;\n var result = [] ;\n var snapshot = document.evaluate(xpath, root, null, (order ? XPathResult.ORDERED_NODE_SNAPSHOT_TYPE : XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE), null) ;\n for(var i=0; i<snapshot.snapshotLength; ++i)\n result.push(snapshot.snapshotItem(i)) ;\n return result ;\n}", "title": "" }, { "docid": "a1ff1419eb243c40530ecd2a1ca57c55", "score": "0.55706656", "text": "function searchWebinars(perrentSection) {\n let webinars = [];\n\n perrentSection.forEach(list => {\n\n for (var i = 0; i < list.childNodes.length; i++) {\n if (list.childNodes[i].className == \"webinar\") {\n webinars.push(list.childNodes[i]);\n i++;\n } \n }\n });\n\n return webinars;\n}", "title": "" }, { "docid": "c7ca9862526d26e655a61b98384f5497", "score": "0.5564604", "text": "function selectNodes(xPath,params){\r\n\t\tparams=(params||{});\r\n\t\treturn (params['doc']||document).evaluate(xPath,(params['node']||document),null,(params['type']||6),null);\r\n\t}", "title": "" }, { "docid": "c7ca9862526d26e655a61b98384f5497", "score": "0.5564604", "text": "function selectNodes(xPath,params){\r\n\t\tparams=(params||{});\r\n\t\treturn (params['doc']||document).evaluate(xPath,(params['node']||document),null,(params['type']||6),null);\r\n\t}", "title": "" }, { "docid": "d40c24cd80c9463bff83526065d78cd1", "score": "0.5534411", "text": "function pageFunction(context) {\n // called on every page the crawler visits, use it to extract data from it\n var $ = context.jQuery;\n var results = [];\n\n $(\".regular-search-result\").each( function(i) {\n console.log(\"---------- FEED ITEM -----------\")\n console.log(i)\n\n // grabbing the service area\n var servicing = ''\n if ($(this).find(\"div.secondary-attributes > span.neighborhood-str-list\")[0]) {\n servicing = $(this).find(\"div.secondary-attributes > span.neighborhood-str-list\")[0].innerText.trim()\n }\n var service_area = $(this).find(\".secondary-attributes > div.service-area\").text().trim()\n if (servicing && service_area) {\n servicing = servicing + ', ' + service_area\n } else if (servicing && !service_area) {\n servicing = servicing\n } else {\n servicing = service_area\n }\n\n // grabbing the address\n var addr = $(this).find(\"address\")[0]\n if (addr) {\n addr = $(this).find(\"address\")[0].innerText\n } else {\n addr = ''\n }\n\n // grabbing the phone\n var phone = $(this).find(\"span.biz-phone\")[0]\n if (phone) {\n phone = $(this).find(\"span.biz-phone\")[0].innerText\n } else {\n phone = ''\n }\n\n var scraped_obj = {\n company_name : $(this).find(\"a.biz-name\").text(),\n rating: $(this).find(\"div.i-stars\").attr('title'),\n service_area: servicing,\n address : addr,\n phone: phone,\n yelp_profile_url : \"https://yelp.ca\" + $(this).find(\"a.biz-name\").attr('href')\n }\n results.push(scraped_obj);\n });\n\n var final_results = []\n results.forEach((function(r) {\n var exists = false\n final_results.forEach((function(f) {\n if (f.yelp_profile_url === r.yelp_profile_url) {\n exists = true\n }\n }))\n if (!exists) {\n final_results.push(r)\n }\n }))\n return final_results;\n}", "title": "" }, { "docid": "bd2e9f9323dc89f631bdd43076eb3079", "score": "0.55233", "text": "get item1411 () { return $('//div[@class=\"form-preview-container ng-star-inserted\"]//*[@id=\"mat-checkbox-1\"]//p[contains(text(),\"Vid katetersättning\")]')}", "title": "" }, { "docid": "9a73fa7eb56198a35fb218e471f1f804", "score": "0.55160576", "text": "extractActivationsFromHtml(selector) {\n \tlet root = document;\n \tif (selector !== undefined) {\n\t\t\troot = document.querySelector (selector);\n \t}\n \tif (root === null) return;\n const elements = root.querySelectorAll(\"[data-va-verbs][data-va-subjects]\");\n for (const element of elements) {\n const noRefresh = element.dataset.vaNoRefresh;\n\t\t\tif (selector !== undefined && noRefresh !== undefined && noRefresh === \"true\") continue; \n const target = element.dataset.vaTarget;\n const verbList = element.dataset.vaVerbs;\n const subjectList = element.dataset.vaSubjects;\n const complementList = element.dataset.vaComplements;\n const derived = element.dataset.vaDerived;\n const synonym = element.dataset.vaSynonym;\n const allways = element.dataset.vaAllways;\n const action = element.dataset.vaAction;\n const property = element.dataset.vaProperty;\n const value = element.dataset.vaValue;\n this.expandActivation(\n element, target,\n verbList, subjectList, complementList,\n derived, synonym,\n allways, action, property, value\n );\n }\n }", "title": "" }, { "docid": "b335487c12229a2a9b2db8fc653f5451", "score": "0.5515886", "text": "function checkPillageAmount() {\n // //td/a[text()='\"+name+\"']/../..\n // var table = document.evaluate(\"//th[contains(.,'Processing capacity')]\",\n var d = document.evaluate(\"//table[@class = 'layout listing3']\",\n document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null).snapshotItem(1);\n var t = d.firstChild;\n var temp = [];\n temp[0] = t.childNodes[2].childNodes[1].textContent;\n temp[1] = t.childNodes[3].childNodes[1].textContent;\n return temp;\n}", "title": "" }, { "docid": "b94a1884718250bacb034c483c12a04f", "score": "0.55049354", "text": "getElements(metadata) {\n let $ = Strategy.$;\n let elements = $('h2,p');\n return _.flatten(_.compact(_.map(elements, (element) => {\n let tagName = element.tagName;\n let content = helper.getNodeContent($(element));\n let chunks = helper.splitTextBySentence(content);\n return _.map(chunks, (chunk) => {\n return {...metadata, tagName, content: chunk};\n });\n })));\n }", "title": "" }, { "docid": "0c315e4fc9e7cc75238186d32d9694d3", "score": "0.54951656", "text": "function catch_data() {\n const BASE_URL = \"https://www.openrice.com/zh/hongkong/restaurants?where=%E9%95%B7%E6%B2%99%E7%81%A3\";\n\n async () => {\n let html = await sp.get(BASE_URL);\n let $ = cheerio.load(html.text);\n let RestList = [];\n $('#or-route-poi-list-main ul li').each(function () {\n\n });\n }\n}", "title": "" }, { "docid": "0c7ce1705b070e80afdc4aed6045a44d", "score": "0.5474143", "text": "async function get_target_item(listOfQueries) {\n var i;\n let devtoList = [];\n for(i = 0; i < listOfQueries.length; i++) {\n try {\n const result = await axios.get(listOfQueries[i]['web_name'] + listOfQueries[i]['item']);\n const html = result.data;\n const $ = cheerio.load(html);\n $('.page').each(function(i, elem) {\n devtoList.push($(this).find('h2').text().trim());\n });\n } catch(error){\n console.log(error)\n }\n }\n return devtoList;\n}", "title": "" }, { "docid": "c28f0df76fc623dcaa42286dc4573bc2", "score": "0.5471709", "text": "async function eachScraper (page, tagExtractor){\r\n let items = [];\r\n const startTime = new Date().getTime();\r\n for (let i = 0; i < uris.length; i++) {\r\n const url = uris[i];\r\n console.log(i); \r\n await page.goto(`${url}`, {\"waitUntil\" : \"load\"});\r\n try {\r\n const finalObj = await page.evaluate(tagExtractor);\r\n finalObj.id = url;\r\n items.push(finalObj);\r\n } catch(e) { console.log(e) };\r\n }\r\n const endTime = new Date().getTime();\r\n const timeTaken = (endTime-startTime)/1000;\r\n console.log(`Time taken = ${timeTaken} seconds`);\r\n return items;\r\n}", "title": "" }, { "docid": "bde7418f31364b4e1a10cf51014683ad", "score": "0.54601806", "text": "function parseData(html){\n\tconst {JSDOM} = jsdom;\n\tconst dom = new JSDOM(html);\n \tconst $ = (require('jquery'))(dom.window);\n\n \t//let's start extracting the data\n var items = $(\".element-1207469\");\n //console.log(items.length);\n const ans=[]\n\tfor(var i = 0; i < items.length; i++){\n var names= $(items[i]).children('.atom-fullname').text();//retrieving name\n var profile=$(items[i]).parent().find('a').attr('href');//retrieving profile info\n var headshot=$(items[i]).parent().find('object').attr('data');\n \n\n var title=$(items[i]).children('.atom-text1').text();\n var title=String(title);\n //condition for title info\n if (title.includes('CEO') || title.includes('ceo') || title.includes('Engineer') || title.includes('engineer') || title.includes('Manager') || title.includes('manager'))\n {\n var obj={'name':names,\n 'title':title,\n\n 'profile':'https://www.gophercon.com' + profile,\n 'headshot_data_uri':headshot\n };\n ans.push(obj);\n }\n\t\t\n } \n ans.sort((a, b) => a.name.localeCompare(b.name))\n var num_results=ans.length;\n console.log({\n 'num_results':num_results,\n 'results':ans}\n );\n \t\n}", "title": "" }, { "docid": "a2c7b721aef6bb4f9d603ae358e1c631", "score": "0.545359", "text": "function pageScrapeFunction() {\n\n }", "title": "" }, { "docid": "eef89a876c94a5961ff667bc31d920d9", "score": "0.54466856", "text": "get xboxOneConsoles() { return $('//a[contains(@href, \"/xbox-one-consoles\")]'); }", "title": "" }, { "docid": "bb959c2a7dab03aa30e75955a022d16c", "score": "0.54305613", "text": "html_parse(html) {\n const root = html_parser.parse(html);\n\n var nnodes = this.process_nodes(root);\n //console.log(nnodes)\n var onodes = this.organise_nodes(nnodes);\n\n return onodes;\n }", "title": "" }, { "docid": "cec55c7873fe6d7e1716879db6b2d98f", "score": "0.5427711", "text": "scrape(html, callback){\n let results = callback ? undefined : [];\n callback = callback || ((err, item) => {\n if(err) throw err; else results.push(item);\n });\n\n try {\n let $ = cheerio.load(html);\n $(this.selector).each((_, item) => {\n callback(null, this.transformer($(item)));\n });\n } catch (err) {\n callback(err, null);\n }\n\n return results;\n }", "title": "" }, { "docid": "00628a487b8a36b37bd05ea27fbd0aaf", "score": "0.5414203", "text": "function viewAllResult(html) {\n let selTool = cheerio.load(html);\n let viewResult = selTool(\".label.blue-text.blue-on-hover\");\n let totalMatchResultLink = selTool(viewResult[0]).attr(\"href\");\n let fullMatchesLink = \"https://www.espncricinfo.com\" + totalMatchResultLink;\n //console.log( fullMatchesLink);\n results(fullMatchesLink);\n }", "title": "" }, { "docid": "87aa891df867bc625b604e7a95f7d61a", "score": "0.5408593", "text": "function selectNodes(doc, context, xpath)\n {\n var nodes = doc.evaluate(xpath, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n var result = new Array( nodes.snapshotLength );\n for (var x=0; x < result.length; x++) {\n result[x] = nodes.snapshotItem(x);\n }\n return result;\n }", "title": "" }, { "docid": "e2e949ca9386d05085091461701d9baf", "score": "0.5405895", "text": "function search(elements, start) {\n var list = [];\n pubNubCore.each(elements.split(/\\s+/),\n function(el) {\n pubNubCore.each((start || document).getElementsByTagName(el),\n function(node) {\n list.push(node);\n });\n });\n return list;\n }", "title": "" }, { "docid": "3dcf694fa8f8ac904bfa5609ae748b17", "score": "0.53872025", "text": "function creategetElementsByClassName() { \n// ----------------------------------------------\n//\tDeveloped by Robert Nyman, http://www.robertnyman.com\n//\tCode/licensing: http://code.google.com/p/getelementsbyclassname/\n// ----------------------------------------------\nreturn function (className, tag, elm){\n\tif (document.getElementsByClassName) {\n\t\tgetElementsByClassName = function (className, tag, elm) {\n\t\t\telm = elm || document;\n\t\t\tvar elements = elm.getElementsByClassName(className),\n\t\t\t\tnodeName = (tag)? new RegExp(\"\\\\b\" + tag + \"\\\\b\", \"i\") : null,\n\t\t\t\treturnElements = [],\n\t\t\t\tcurrent;\n\t\t\tfor(var i=0, il=elements.length; i<il; i+=1){\n\t\t\t\tcurrent = elements[i];\n\t\t\t\tif(!nodeName || nodeName.test(current.nodeName)) {\n\t\t\t\t\treturnElements.push(current);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn returnElements;\n\t\t};\n\t}\n\telse if (document.evaluate) {\n\t\tgetElementsByClassName = function (className, tag, elm) {\n\t\t\ttag = tag || \"*\";\n\t\t\telm = elm || document;\n\t\t\tvar classes = className.split(\" \"),\n\t\t\t\tclassesToCheck = \"\",\n\t\t\t\txhtmlNamespace = \"http://www.w3.org/1999/xhtml\",\n\t\t\t\tnamespaceResolver = (document.documentElement.namespaceURI === xhtmlNamespace)? xhtmlNamespace : null,\n\t\t\t\treturnElements = [],\n\t\t\t\telements,\n\t\t\t\tnode;\n\t\t\tfor(var j=0, jl=classes.length; j<jl; j+=1){\n\t\t\t\tclassesToCheck += \"[contains(concat(' ', @class, ' '), ' \" + classes[j] + \" ')]\";\n\t\t\t}\n\t\t\ttry\t{\n\t\t\t\telements = document.evaluate(\".//\" + tag + classesToCheck, elm, namespaceResolver, 0, null);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\telements = document.evaluate(\".//\" + tag + classesToCheck, elm, null, 0, null);\n\t\t\t}\n\t\t\twhile ((node = elements.iterateNext())) {\n\t\t\t\treturnElements.push(node);\n\t\t\t}\n\t\t\treturn returnElements;\n\t\t};\n\t}\n\telse {\n\t\tgetElementsByClassName = function (className, tag, elm) {\n\t\t\ttag = tag || \"*\";\n\t\t\telm = elm || document;\n\t\t\tvar classes = className.split(\" \"),\n\t\t\t\tclassesToCheck = [],\n\t\t\t\telements = (tag === \"*\" && elm.all)? elm.all : elm.getElementsByTagName(tag),\n\t\t\t\tcurrent,\n\t\t\t\treturnElements = [],\n\t\t\t\tmatch;\n\t\t\tfor(var k=0, kl=classes.length; k<kl; k+=1){\n\t\t\t\tclassesToCheck.push(new RegExp(\"(^|\\\\s)\" + classes[k] + \"(\\\\s|$)\"));\n\t\t\t}\n\t\t\tfor(var l=0, ll=elements.length; l<ll; l+=1){\n\t\t\t\tcurrent = elements[l];\n\t\t\t\tmatch = false;\n\t\t\t\tfor(var m=0, ml=classesToCheck.length; m<ml; m+=1){\n\t\t\t\t\tmatch = classesToCheck[m].test(current.className);\n\t\t\t\t\tif (!match) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (match) {\n\t\t\t\t\treturnElements.push(current);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn returnElements;\n\t\t};\n\t}\n\treturn getElementsByClassName(className, tag, elm);\n};\n}", "title": "" }, { "docid": "dc7ed854ef3682a70d1b6f56261e98ab", "score": "0.5378057", "text": "function scrape(){\n\t\n\t//Top Memu Name\n\tscraperjs.StaticScraper.create('http://localhost/x_out.html')\n\t \t\t.scrape(function($) {\n\t \t\t return $(\"#nav a[class!='chosen']\").map(function() {\n \t\t \treturn $(this).text();\n \t\t \t}).get();\n \t\t\t}, function(text) {\n\t\t\tmainMemuIndex = text.length;\n\t\t\tMainMenuTag = [];\n\t\t\t\t\n\t\t\tfor(var i=0; i < mainMemuIndex; i++)\n\t\t\t{\n\t\t\t\tcreateMainMenu();\n\t\t\t\tMainMenuTag[i].Menu_title = text[i];\n\t\t\t}\n\n\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n \t})\n\n/////////////////SubMenu under Top Menu start///////////////////////////////////////////////\n\t\t//Subtitle\n\t \t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(0).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tMenu_subMenu = [];\n\t\t\t\tsub_title_Index = text.length;\n\n\t\t\t\tfor(var i=0; i < sub_title_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMenu_subMenu[i].Submenu_title = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenuTag[0].Menu_subMenu = Menu_subMenu;\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\t\t//Subtitle\n\t \t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(1).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tMenu_subMenu = [];\n\t\t\t\tsub_title_Index = text.length;\n\n\t\t\t\tfor(var i=0; i < sub_title_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMenu_subMenu[i].Submenu_title = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenuTag[1].Menu_subMenu = Menu_subMenu;\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\t \t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(2).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tsub_title_Index = text.length;\n\t\t\t\tMenu_subMenu = [];\n\n\t\t\t\tfor(var i=0; i < sub_title_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMenu_subMenu[i].Submenu_title = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenuTag[2].Menu_subMenu = Menu_subMenu;\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\t\n\t})\n\t \t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(3).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tMenu_subMenu = [];\n\t\t\t\tsub_title_Index = text.length;\n\n\t\t\t\tfor(var i=0; i < sub_title_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMenu_subMenu[i].Submenu_title = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenuTag[3].Menu_subMenu = Menu_subMenu;\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\t \t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(4).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tMenu_subMenu = [];\n\t\t\t\tsub_title_Index = text.length;\n\n\t\t\t\tfor(var i=0; i < sub_title_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMenu_subMenu[i].Submenu_title = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenuTag[4].Menu_subMenu = Menu_subMenu;\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\t \t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(5).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tMenu_subMenu = [];\n\t\t\t\tsub_title_Index = text.length;\n\n\t\t\t\tfor(var i=0; i < sub_title_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMenu_subMenu[i].Submenu_title = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenuTag[5].Menu_subMenu = Menu_subMenu;\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\t\t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(6).find('li').map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tMenu_subMenu = [];\n\t\t\t\tsub_title_Index = text.length;\n\n\t\t\t\tfor(var i=0; i < sub_title_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMenu_subMenu[i].Submenu_title = text[i];\n\t\t\t\t}\n\t\t\n\t\t\t\tMainMenuTag[6].Menu_subMenu = Menu_subMenu;\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\t\t\t\tjson.MainMenu = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n//////////////////////////Top Memu URLs Source/////////////////////////////////////////////////\t\t\t\n\t\t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(1).find('a').map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tsub_links_Index = text.length;\n\t\t\t\tMenu_subMenu = [];\n\n\t\t\t\tfor(var i=0; i < sub_links_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMainMenuTag[1].Menu_subMenu[i].Submenu_link = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\n\t\t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(2).find('a').map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tsub_links_Index = text.length;\n\t\t\t\tMenu_subMenu = [];\n\n\t\t\t\tfor(var i=0; i < sub_links_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMainMenuTag[2].Menu_subMenu[i].Submenu_link = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\t\t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(3).find('a').map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tsub_links_Index = text.length;\n\t\t\t\tMenu_subMenu = [];\n\n\t\t\t\tfor(var i=0; i < sub_links_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMainMenuTag[3].Menu_subMenu[i].Submenu_link = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\t})\n\t\t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(4).find('a').map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tsub_links_Index = text.length;\n\t\t\t\tMenu_subMenu = [];\n\n\t\t\t\tfor(var i=0; i < sub_links_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMainMenuTag[4].Menu_subMenu[i].Submenu_link = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\t\t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(5).find('a').map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tsub_links_Index = text.length;\n\t\t\t\tMenu_subMenu = [];\n\n\t\t\t\tfor(var i=0; i < sub_links_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMainMenuTag[5].Menu_subMenu[i].Submenu_link = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\n\t})\n\t\t.scrape(function($) {\n\t \t\treturn $(\".nav_chosen div\").eq(6).find('a').map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\t\tsub_links_Index = text.length;\n\t\t\t\tMenu_subMenu = [];\n\n\t\t\t\tfor(var i=0; i < sub_links_Index; i++)\n\t\t\t\t{\t\n\t\t\t\t\tcreateMenu_subMenu();\n\t\t\t\t\tMainMenuTag[6].Menu_subMenu[i].Submenu_link = text[i];\n\t\t\t\t}\n\n\t\t\t\tMainMenu.MainMenuTag = MainMenuTag;\n\n\t\t\t\tMenu_subMenu = \"\";\n\t})\n\n//////////////////////////////Right Menu Start/////////////////////////////////////////////\n\t\t//Right Menu title\n\t\t.scrape(function($) {\n\t \t\treturn $(\".submenu li\").map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tRightMenuTag = [];\n\t\t\t\tsubMenuIndex = text.length;\n\t\t\t\t\n\t\t\t\tfor(var i=0; i < subMenuIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tcreateSubMenu();\n\t\t\t\t\tRightMenuTag[i].RightMenu_title = text[i];\n\t\t\t\t}\n\n\t\t\t\tRightMenu.RightMenuTag = RightMenuTag;\n\t\t\t\n\t})\n\t\t//Right Menu URLs Links\n\t\t.scrape(function($) {\n\t \t\treturn $(\".submenu a\").map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tsubMenuIndex = text.length;\n\t\t\t\t\n\t\t\t\tfor(var i=0; i < subMenuIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tRightMenuTag[i].RightMenu_href = text[i];\n\t\t\t\t}\n\n\t\t\t\tRightMenu.RightMenuTag = RightMenuTag;\n\t\t\t\tjson.RightMenu = RightMenu;\n\t\t\t\n\t})\n\n//////////////////////////////Flash Banner(Mid Menu) Start/////////////////////////////////////////////\n\t\t//Flash Banner(Mid Menu) Picture Link\n\t\t.scrape(function($) {\n\t \t\treturn $(\".flashbanner img\").map(function() {\n \t\t\t\treturn $(this).attr('src');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\t\tSubBanner = [];\n\t\t\t\tflashBannerIndex = text.length;\n\n\t\t\t\tfor(var i=0; i < flashBannerIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tcreateFlashBanner();\n\t\t\t\t\tSubBanner[i].FlashBanner_src = text[i];\n\t\t\t\t}\n\n\t\t\t\tFlashBanner.SubBanner = SubBanner;\n\n\t})\n\t\t//Flash Banner(Mid Menu) URLs Link\n\t\t.scrape(function($) {\n\t \t\treturn $(\".flashbanner a\").map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n \t\tflashBannerIndex = text.length;\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(var i=0; i < flashBannerIndex; i++)\n\t\t\t\t{\n\t\t\t\t\tSubBanner[i].FlashBanner_URL = text[i];\n\t\t\t\t}\n\n\t\t\t\tFlashBanner.SubBanner = SubBanner;\n\t\t\t\tjson.FlashBanner = FlashBanner;\n\t\t\t\twriteToJson(json);\n\n\t})\n//////////////////////////////Bottom Content (Mid Menu) Start/////////////////////////////////////////////\n\t// Product Display Description \n\t\t.scrape(function($) {\n\t \t\treturn $(\".td_02 a[target=_blank]\").map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\tP_Display = [];\n\t\t\tcreateDisplayTag();\n\t\t\tP_Display[0].Description = S(text[1]).trim().s;\n\t\t\tcreateDisplayTag();\n\t\t\tP_Display[1].Description = S(text[4]).trim().s;\n\t\t\tcreateDisplayTag();\n\t\t\tP_Display[2].Description = S(text[7]).trim().s;\n\n\t\t\tProduct_Display.P_Display = P_Display;\n\n\t})\n\t\t// Product Display URLs Links\n\t\t.scrape(function($) {\n\t \t\treturn $(\"div[style*='float:left;width:110px;margin:0'] a\").map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\tP_Display[0].Link = text[0];\n\t\t\tP_Display[1].Link = text[3];\n\t\t\tP_Display[2].Link = text[6];\n\n\t\t\tProduct_Display.P_Display = P_Display;\n\t})\n\t\t// Product Display Picture Links\n\t\t.scrape(function($) {\n\t \t\treturn $(\"div[style*='float:left;width:110px;margin:0'] img\").map(function() {\n \t\t\t\treturn $(this).attr('src');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\t\t\tP_Display[0].img_src = text[0];\n\t\t\tP_Display[1].img_src = text[1];\n\t\t\tP_Display[2].img_src = text[2];\n\n\t\t\tProduct_Display.P_Display = P_Display;\n\t\t\tjson.Product_Display = Product_Display;\n\t})\n\n\n///////////////// Company news(Right bottom)\n\n\t\t//Company News Picture\n\t\t.scrape(function($) {\n\t \t\treturn $(\"span[style*='float:left; padding:15px 15px 0 0'] img\").map(function() {\n \t\t\t\treturn $(this).attr('src');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\timg_Company_News = text;\n\t\t\tCompany_News.img_Company_News = img_Company_News;\n\t\t\t\n\t})\n\t\t//Company News Title\n\t\t.scrape(function($) {\n\t \t\treturn $(\"div[style*='padding:6px']\").map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\tnews_Index = text.length;\n\t\t\tC_News = [];\n\t\t\tcreateCompanyNews();\n\t\t\tC_News[0].News_Description = '';\n\t\t\t\n\t\t\tfor(var i=0; i < news_Index; i++)\n\t\t\t{\n\t\t\t\tcreateCompanyNews();\n\t\t\t\tC_News[i+1].News_Description = text[i];\n\t\t\t}\n\n\t\t\tCompany_News.C_News = C_News;\n\t\t\tjson.Company_News = Company_News;\n\t})\n\t\t//Company News URLs Source\n\t\t.scrape(function($) {\n\t \t\treturn $(\"div[style*='padding:6px'] a\").map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\tC_News[0].News_Link = '';\n\t\t\t\n\t\t\tfor(var i=0; i < news_Index; i++)\n\t\t\t{\n\t\t\t\tC_News[i+1].News_Link = text[i];\n\t\t\t}\n\n\t\t\tCompany_News.C_News = C_News;\n\t\t\tjson.Company_News = Company_News;\n\t\t\twriteToJson(json);\n\t})\n\t\t//first News Links\n\t\t.scrape(function($) {\n\t \t\treturn $(\"div[style*='padding:0 0 0 0'] a\").map(function() {\n \t\t\t\treturn $(this).attr('href');\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\tC_News[0].News_Link = text[0];\n\t\t\twriteToJson(json);\n\t})\n\t\t//First News Title\n\t\t.scrape(function($) {\n\t \t\treturn $(\"div[style*='padding:0 0 0 0']\").map(function() {\n \t\t\t\treturn $(this).text();\n \t\t\t }).get();\n \t\t\t}, function(text) {\n\n\t\t\tC_News[0].News_Description = S(text).trim().s;\n\t\t\tjson.Company_News = Company_News;\n\t\t\twriteToJson(json);\n\t})\n\t\n}", "title": "" }, { "docid": "051b50a167a569d950529efe34ea1e5f", "score": "0.5375474", "text": "async function scrapeJobHeader(){\n try{\n const htmlResult = await request.get(url);\n\n // This will return the html from the url in string format\n // console.log(htmlResult);\n\n // This will allow selecting elements using css selectors\n // Using the dollar sign allows to use the same code as the\n // page jquery is using\n const $ = await cheerio.load(htmlResult);\n\n // Getting job titles\n $(\".result-info\").each((index, element) => {\n const resultTitle = $(element).children(\".result-title\");\n const title = resultTitle.text();\n const url = resultTitle.attr(\"href\");\n const datePosted = new Date(\n $(element)\n .children(\"time\")\n .attr(\"datetime\")\n );\n const hood = $(element)\n .find(\".result-hood\")\n .text();\n const scrapeResult = { title, url, datePosted, hood };\n scrapeResults.push(scrapeResult);\n });\n\n return scrapeResults;\n } catch(err){\n console.error(err);\n }\n}", "title": "" }, { "docid": "07e5be95cc4cf2ed6a2a604ce730c9c3", "score": "0.53745", "text": "function scrapeSite() {\n\tconst urlstr = \"https://rpsc.energy.gov/handbooks?items_per_page=All\";\n\t// const urlData = Url.parse(urlstr);\n\n\t// Do the main page\n const pageRequest = scraper.newRequest(urlstr);\n\treturn scraper.requestPage( pageRequest ).then(\n\t\t(loadedPage) => {\n\t\t\tconst $ = loadedPage.window.$;\n\t\t\tconst links = $(\"a.handbook\");\n\t\t\tconsole.log(`found ${links.length} links\\n`);\n\t\t\t// Loop through urls and fetch each page\n const promiseList = [];\n\t\t\t$.each(\n\t\t\t\tlinks,\n\t\t\t\t(index, obj) => {\n promiseList.push(\n loadHandbookPage(index, obj.href, loadedPage.urlData)\n );\n\t\t\t\t}\n\t\t\t);\n\t\t\treturn Promise.all(promiseList);\n\t\t\t// return loadedPage.urlData;\n\t\t},\n\t\tshowError\n\t)\n}", "title": "" }, { "docid": "cdfb8b03e73337c7bdf3545fdb8fc618", "score": "0.53577447", "text": "getElements(parentEl) {\n\t\tconst elements = [];\n\t\tconst foundEls = parentEl.querySelectorAll(`[${this.config.attributes.sources}]`);\n\n\t\tfor (let i = 0; i < foundEls.length; i++) {\n\t\t\tconst el = foundEls[i];\n\t\t\t// const offsetTop = el.getBoundingClientRect().top + (window.pageYOffset || document.documentElement.scrollTop);\n\n\t\t\t// attribute that can be used to ignore specific images when loading\n\t\t\tif (ImageBuddyDOMElement.isCached(el) || ImageBuddyDOMElement.shouldIgnore(el)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\telements.push(new ImageBuddyDOMElement(el, this.config, this.opts));\n\t\t}\n\n\t\treturn elements;\n\t}", "title": "" }, { "docid": "2ab70f4d64c96f5d66e7b4ab3062c84d", "score": "0.53446287", "text": "function scrapeResultsPage(){\n\t/*\n var titles = []; \n var i = 0; \n var res = document.getElementById(\"result_\"+i);\n while (res){\n\t\tid = res.getAttribute(\"name\");\n\t\ttitle = jQuery(res).find(\"h3:first\").text();\n\t\ttitles[id] = title;\n\t\ti++;\n\t\tres = document.getElementById(\"result_\"+i);\n }\n return titles;\n\t*/\n\t// now returns [id, brand, model]\n\tvar titles = []; \n var i = 0; \n var res = document.getElementById(\"result_\"+i);\n while (res){\n\t\n\t\tvar id = res.getAttribute(\"name\");\n\t\tvar title = jQuery(res).find(\"h3:first\").text();\n\t\tvar cost = jQuery(res).find(\".price.addon\").text();\n\t\tcost = $.trim(cost); // in the form of a string: $dd.cc\n\t\ttitle = $.trim(title);\n var brandModel = parseTitle(title);\n if (brandModel != null){\n titles[id] = [brandModel[\"brand\"], brandModel[\"model\"], cost];\n }\n//\t\tvar dataArray = title.split(' ');\n//\t\tvar brand = dataArray[0];\n//\t\tvar model = dataArray[1];\n//\t\ttitles[id] = [brand, model, cost];\n\t\ti++;\n\t\tres = document.getElementById(\"result_\"+i);\n }\n return titles;\n}", "title": "" }, { "docid": "b07ce3c7d444969a415fa95f4b765473", "score": "0.5332156", "text": "function getPrices(){\n console.log('getPrices');\n driver.findElements(By.xpath('// span [@class=\"comparePriceJustPrice\"]/span')).then(function(els){\n for(var i = 0 ; i < els.length; i++){\n els[i].getText().then(function(prices){\n console.log(prices)\n results.rows.push(prices);\n })\n }\n })\n pause(3,compileResults);\n }", "title": "" }, { "docid": "2bfb20eb98de6819b01f4bb2c612329a", "score": "0.5330364", "text": "function getNodes(xpath) {\n const nodes = document.evaluate(\n xpath,\n document,\n null,\n XPathResult.ANY_TYPE,\n null\n );\n\n let nodesArray = [];\n\n while ((node = nodes.iterateNext())) {\n nodesArray.push(node);\n }\n\n return nodesArray;\n}", "title": "" }, { "docid": "951c8f46776937fd4b33065285f867e7", "score": "0.53289616", "text": "_extractElements() {\n this.$startBtn = document.querySelector(`.${START_BTN_CLASS}`);\n this.$timerBar = document.querySelector(`.${TIME_BAR_CLASS}`);\n this.$gameCanvas = document.querySelector(`.${GAME_CANVAS_CLASS}`);\n this.$difficultySelector = document.querySelector(`.${DIFFICULTY_SELECTOR_CLASS}`);\n }", "title": "" }, { "docid": "35c419fa17d50260cd9e68d1a7b02345", "score": "0.5328508", "text": "async getPoints() {\n try {\n return await this.selenium.getTextFromElement(\n \"xpath\",\n \"//div[@class='nba-item-right']\"\n );\n }\n catch (err) {\n console.log(err);\n }\n }", "title": "" }, { "docid": "291eb75865dc989f742f5e8badd3b909", "score": "0.5325064", "text": "function getTitleLocation() {\r\n var paths = new Array();\r\n\tpaths[0] = \"//div[@class='buying']/b[@class='sans']\";\r\n\tpaths[1] = \"//div[@class='content']//b[@class='sans']\";\r\n\tpaths[2] = \"//div[@class='buying']/b[@class='asinTitle']\";\r\n\tpaths[3] = \"//div[@class='content']/b[@class='asinTitle']\";\r\n\tpaths[4] = \"//div[@class='buying']/h1[@class='parseasinTitle']/span[@id='btAsinTitle']\";\r\n\r\n\tvar mainTitleSpan;\r\n\tfor (i=0; i<paths.length; i++) {\r\n\t\tslog(\"Searching for main title span with: \" + paths[i]);\r\n\t\tmainTitleSpan = xpathFirst(paths[i]);\r\n\t\tif (mainTitleSpan) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n return mainTitleSpan;\r\n}", "title": "" }, { "docid": "09daea7776e3b6cfbc4c93acf7ea4d0e", "score": "0.53146327", "text": "function getElementByXpath (path) {\n\t\t\treturn document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n}", "title": "" }, { "docid": "53f0e61d9246d6c38a81fb0a37b3a32e", "score": "0.53106236", "text": "function extract() {\r\n /* [ node, href, response, [ids] ] */\r\n var topics = [];\r\n \r\n /* xpath expressions to find various portions of the data*/\r\n var xpath_forumContent = '/descendant::table[contains(@class, \"forumline\")][1]';\r\n var xpath_topicCells = './descendant::tr/td/span[contains(@class, \"topictitle\")]/..';\r\n var xpath_topicGenSmallLastLink = './span[contains(@class, \"gensmall\")]/a[last()]/attribute::href';\r\n var xpath_topicTitleLink = './span[contains(@class, \"topictitle\")]/a[last()]/attribute::href';\r\n \r\n /* get node containing actual forum contents */\r\n var xpathResult_forumContent = document.evaluate(xpath_forumContent, document,\r\n null, XPathResult.ANY_UNORDERED_NODE_TYPE, null );\r\n\r\n if (xpathResult_forumContent.singleNodeValue != null) {\r\n /* clone the forum contents, we will work on a copy */\r\n forumContent = xpathResult_forumContent.singleNodeValue;\r\n forumContentClone = forumContent.cloneNode(true);\r\n } else {\r\n /* not successfull, then return false */\r\n return false;\r\n }\r\n \r\n /* get the topic table cells from the cloned forum content */\r\n var xpathResult_topicCells = document.evaluate(xpath_topicCells, forumContentClone,\r\n null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null );\r\n\r\n /* iterate of topic table cells and determine if there are multiple pages or a single page */\r\n while (topicCell = xpathResult_topicCells.iterateNext()) {\r\n /* if there are multiple pages a certain element exists within the table cell */\r\n var xpathResult_href = document.evaluate(xpath_topicGenSmallLastLink, topicCell,\r\n null, XPathResult.STRING_TYPE, null );\r\n /* does our previous search yielded a result? */\r\n if (!xpathResult_href.stringValue) {\r\n /* if not search for the url of a single page topic */\r\n xpathResult_href = document.evaluate(xpath_topicTitleLink, topicCell,\r\n null, XPathResult.STRING_TYPE, null );\r\n }\r\n /* if either xpath query yielded a result push the topic to the result array */\r\n if (xpathResult_href.stringValue) {\r\n topics.push([ topicCell, xpathResult_href.stringValue, false, [] ]);\r\n }\r\n }\r\n \r\n /* if we have collected any topic information make our topic array the global topic array */\r\n if (topics.length > 0) {\r\n lTable = topics;\r\n lTableRemaining = lTable.length;\r\n return true;\r\n } else {\r\n /* return false if unsuccessful */\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "d434b3c2e8b5c806bf89a5480ec9f2e0", "score": "0.5289671", "text": "function scrapeData() {\n\trequest(\"http://www.fark.com\", function (error, response, html) {\n\n\t// Load the html into cheerio and save it to a var.\n // '$' becomes a shorthand for cheerio's selector commands, \n // much like jQuery's '$'.\n var $ = cheerio.load(html);\n\n // an empty array to save the data that we'll scrape\n var result = [];\n\n $(\".headline a\").each(function(i, element){\n \t\tvar title = $(this).text();\n \t\tvar url = $(this).attr('href');\n\n\t\tdb.scrapedData.update({\n\t\t\ttitle: title,\n\t\t\turl: url,\n\t\t\tcomment: null\n\t\t}, {\n\t\t\ttitle: title,\n\t\t\turl: url,\n\t\t\tcomment: null\n\t\t}, {upsert:true}, function(err, saved) {\n\t\t \tif (err) throw err;\n\t\t });\n\n });\n});\n}", "title": "" }, { "docid": "683e127cb0064bf9fa704ab10a68b667", "score": "0.52785", "text": "function checkTradePage() {\n //console.log('Checking trade page');\n var allNames, thisName, lastName;\n //Find all trade name elements\n allNames = document.evaluate(\n \"//small[@class='gray']\",\n document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n //Iterate through all and add only odd ones to name and node arrays.\n //console.log (\"Allnames: \"+allNames);\n if (!tradeNames) var tradeNames = new Array();\n for (var i = 0; i < allNames.snapshotLength; i++) {\n thisName = allNames.snapshotItem(i);\n tradeNames.push(thisName.innerHTML);\n tradeNodes.push(thisName);\n //console.log(\"Individual name: \"+thisName.innerHTML);\n }\n //console.log(\"tn length: \"+tradeNames.length);\n tradeNames.sort();\n saveTradePartners(tradeNodes, tradeNames);\n //console.log('Found ' + tradeNodes.length + ' trades.');\n //Iterate through sorted names and compare each to the one before it.\n //If a duplicate is found pass the name to the highlight method to find\n // all element objects and apply highlight.\n for (i = 1; i < tradeNames.length; i++) {\n thisName = tradeNames[i];\n lastName = tradeNames[i - 1];\n //console.log(thisName + \" \" + lastName);\n if (thisName == lastName) {\n //console.log('Found duplicate: ' + thisName + \" == \" + lastName);\n highlightTrade(thisName);\n }\n }\n}", "title": "" }, { "docid": "37874854d406772ae954203712923009", "score": "0.52699304", "text": "getDocumentElement() {}", "title": "" }, { "docid": "6d1c14c7785e0b3244b851dd134cb2bf", "score": "0.52684045", "text": "async function getJobDetails (url, page) {\n\n await page.goto(url);\n /*Get poste name*/\n const poste = await page.$eval('.sc-12bzhsi-3.cnIGeJ', poste => poste.textContent);\n /*Get all icons classename*/ \n const texts = await page.evaluate(() => {\n return [...document.body.querySelectorAll('ul.sc-1qc42fc-4.hybCFl li.sc-1qc42fc-0.kGqTsU span.sc-1qc42fc-3.eEtniG i')]\n .map(element => element.className)\n });\n /*Get all information about the post in an arraylist [Contrat, Salaire, Diplome, Experience]*/\n const value = await page.evaluate(() => {\n return [...document.body.querySelectorAll('ul.sc-1qc42fc-4.hybCFl li.sc-1qc42fc-0.kGqTsU span.sc-1qc42fc-2.cOxsDt')]\n .map(element => element.innerText)\n \n \n });\n \n /*Variables to stock different information*/\n var contrat='' ;\n var salaire='';\n var diplome='';\n var experience='';\n var travail='';\n /*Regular expressions for the content of each class*/\n const contratTest = new RegExp('CDI| CDD| Stage| Alternance|','g');\n const salaireTest = new RegExp('Salaire | €|','g');\n const diplomeTest = new RegExp('Bac | \\+','g');\n const experienceTest = new RegExp('>| ans|','g');\n \n /*Regular expressions for class name*/\n const classeContart = new RegExp(\"sc-qQYBZ djZmiW\",\"g\");\n const classeSalaire = new RegExp(\"sc-qQYBZ ioaGbN\",\"g\");\n const classeDiplome_Exp = new RegExp(\"sc-qQYBZ hOrZFz\",\"g\");\n /*Getting information */\n for(let i =0; i<texts.length;i++){\n /*Check if it's the right class for Contrat*/\n if(classeContart.test(texts[i])){\n /*Check if it's the right syntax for Contrat*/\n if (contratTest.test(value[i]))\n /*Affect value if it's true*/\n contrat = value[i];\n }\n if(classeSalaire.test(texts[i])){\n if (salaireTest.test(value[i]))\n salaire = value[i];\n }\n if(classeDiplome_Exp.test(texts[i])){\n if (diplomeTest.test(value[i]))\n diplome = value[i];\n \n }\n\n else{\n if(classeDiplome_Exp.test(texts[i])){\n if (experienceTest.test(value[i]))\n experience = value[i];\n \n }\n }\n \n \n }\n /*Get post's description*/\n const details = await page.evaluate(() => {\n return [...document.body.querySelectorAll('[data-t=\"191qin1\" ] div.sc-11obzva-1.fKjhRQ ')]\n .map(element => element.innerText)\n .join('\\n'); \n /*Affcet the arraylist result to description*/ \n const description =details; \n \n });\n /*Regular expression for remote jobs*/\n const remoteTest = new RegExp('Télétravail','g');\n /*Check the syntax*/\n if(remoteTest.test(await page.$eval(\".sc-1qc42fc-2.dJqCnn\", travail => travail.textContent)))\n /*Affect value if it's correct*/\n travail = await page.$eval(\".sc-1qc42fc-2.dJqCnn\", travail => travail.textContent);\n \n\n /* return values in an object */\n return {\n Poste : poste, \n Contrat : contrat,\n Salaire : salaire,\n Diplome : diplome,\n Experience : experience,\n Travail : travail,\n Description : description,\n }\n \n \n}", "title": "" }, { "docid": "d38284539c2967a1e7974dfed60fd468", "score": "0.5251654", "text": "async function clickBoton(xpath, xpage) {\n let elementXPath;\n\n let page = xpage;\n\n // Busca el elemento del selector\n await page\n .waitForXPath(xpath)\n .then(() => console.log(\"buscar elemento \"))\n .catch((e) => {\n console.log(\"Error: \" + e);\n });\n\n // Espera cuatro segundos\n await page\n .waitForTimeout(4000)\n .then(() => console.log(\"Espera 4s\"))\n .catch((e) => {\n console.log(\"Error: \" + e);\n });\n\n // CLick sobre el elemento\n elementXPath = await page.$x(xpath);\n await elementXPath[0]\n .click()\n .then(() => console.log(\"click sobre el elemento\"))\n .catch((e) => {\n console.log(\"Error: \" + e);\n });\n\n // Espera cuatro segundos\n await page\n .waitForTimeout(4000)\n .then(() => console.log(\"Listo !\"))\n .catch((e) => {\n console.log(\"Error: \" + e);\n });\n\n // Espera que cargue la pagina\n await page.waitForNavigation({ waitUntil: \"load\" }).catch((e) => {\n console.log(\"La pagina esta demorada\");\n });\n }", "title": "" }, { "docid": "721e08e448c0b1118a7d3b4885edd40f", "score": "0.5248035", "text": "function fetchDataElements() {\r\n elements = activeReportDocument.querySelectorAll(\r\n \"tbody tr [class='data'] [rel]\"\r\n );\r\n\r\n if (elements.length == 0) return;\r\n\r\n lastRel = getLastRel(elements);\r\n}", "title": "" }, { "docid": "23b0eb87a2311d628f1224ada671c9a5", "score": "0.52446806", "text": "function dododo(p){\n\tvar rando = Math.round(Math.random()*100);\n\tsetTimeout(()=>{\n\t\tfetch(\"https://www.thalamus.co/ad_partners?page=\"+(p+1), {\"credentials\":\"include\",\"headers\":{\"accept\":\"*/*;q=0.5, text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\",\"accept-language\":\"en-US,en;q=0.9\",\"x-csrf-token\":\"OWe9hmFXP4GVJ1qdAPzOFj2SYkHNTJHN3jgGzx1EvmD1XE3enTw+BLOJbiJcmvXbVVUKWZLxcVWGul6/TGMKZw==\",\"x-requested-with\":\"XMLHttpRequest\"},\"referrer\":\"https://www.thalamus.co/ad_partners\",\"referrerPolicy\":\"no-referrer-when-downgrade\",\"body\":null,\"method\":\"GET\",\"mode\":\"cors\"})\n\t\t.then(response => response.text()).then(text => {\n\t\treturn text;\n\t\t})\n\t\t.then(html => {\n\t\t\tvar parser = new DOMParser();\n \t\t\tvar doc = parser.parseFromString(html, \"text/html\");\n\t\t\tvar paths = unq(doc.body.innerHTML.match(/(?<=href=\\\"\\\\'\\/ad_partners\\/).+?(?=\\\\')/g))\n\t\t\tconsole.log(paths);\n\t\t\tpaths.forEach(itm=>{containArr.push(itm)})\n\t\t})\n\t},((p+1)*4790)+rando)\n}", "title": "" }, { "docid": "57118432112b54aa5cd4f75ab3375455", "score": "0.5241739", "text": "async scrap (params ) {\n return new Promise(async (resolve, reject) => {\n\n const browser = await pptrFirefox.launch({ product: 'firefox', headless: false , args: ['--no-sandbox', '--disable-setuid-sandbox']});\n // const context = await browser.newContext();\n const page = await browser.newPage();\n \n await page.goto('https://www2.genialinvestimentos.com.br/login');\n\n\n resolve({\n positions: [],\n cash: []\n })\n\n });\n }", "title": "" }, { "docid": "9b0aba0bc077a2baffadc5a8ddfdfc8e", "score": "0.5241407", "text": "function scrapeShirtLinks () {\n let shirtLinks = [];\n\n // gets url from each list item\n // adds urls to array\n scrapeIt(\"http://shirts4mike.com/shirts.php\", {\n shirts: {\n listItem: \".products li a\",\n data: {\n url: {\n attr: \"href\"\n }\n }\n }\n }, (error, data) => {\n if (error) {\n errorLog(error);\n } else {\n shirtsRemaining = data.data.shirts.length;\n\n for (let i =0; i < shirtsRemaining; i++) {\n shirtLinks[i] = `${url}${data.data.shirts[i].url}`;\n scrapeShirt(shirtLinks[i]);\n }\n }\n });\n}", "title": "" }, { "docid": "dafe6c8770260ee91669f6d684361f20", "score": "0.52262974", "text": "function scrapeNews(searchFor){\n return new Promise((resolve, reject) => {\n const url = 'http://www.google.com';\n puppeteer\n .launch({headless: true}) // set headless to \"false\" to see Puppeteer's actions on the browser, and which elements are clicked on \n .then((browser) => { \n return browser.newPage(); \n })\n .then(async (page) => { \n return page.goto(url).then(async () =>{\n await page.setViewport({ width: 1920, height: 1080 }); // open browser window to show puppeteer's actions (for DEBUGGING)\n // await page.focus('.gLFyf.gsfi'); // focus on the search bar\n await page.click('.gLFyf.gsfi'); // click on the search bar\n await page.keyboard.type(searchFor + ' news'); // search for the given term\n await page.keyboard.press('Enter'); \n await page.waitFor(3000); \n await page.click('.Q2MMlc'); // click on button to access News on the topic\n // page.screenshot({path: 'sc.png'}); // DEBUG\n await page.waitFor(3000); \n return page.content(); // returns html content of the page\n });\n })\n .then(async (html) => {\n // work with html content to retrieve news headlines\n const $ = cheerio.load(html);\n var for_links = $('.dbsr').children(); // object containing element for link and its children\n //console.log(for_links.length);\n return for_links; // returns array containing two objects containing html info about news cards (healdines and links)\n }) \n .then(async (news_links) => {\n /* BASIC STRUCTURE OF A NEWS-CARD element:\n - Each news item is inside an HTML element called 'g-card'\n - Every content (news headline, news image, sub headline, date, etc.) is inside a link element, which is a child of 'g-card'\n - This function receives an object which contains the list of all the link elements inside all 'g-card's\n - Each link element further has a child which is an element of class 'yr3B8d KWQBje'. This element contains \n all the news content as its children (headlines, image, sub-headline), which altogether are displayed as a single link.\n - The element of class 'yr3B8d KWQBje' has 2 children, each containing a news element like image, headline, etc.\n - We'll be focusing on the second child, which contains the news headline.\n - This function receives an \"object of objects\" containing a list of all the link elements/nodes. \n - Every node/element is represented as an object, with its attributes, children, parent node, children nodes \n specified as key-value pairs inside the node/element object.\n - The 'children' key inside a node/element object has an array of that node/element children in the DOM tree. \n */\n //console.log(news_links[0]['children'][0]['children'][1]['children'][1]['children'][0]['data']);\n // creating a 2D array\n var items = []; \n for(var i = 0; i < news_links.length; i++){\n var news_h = {\n 'headline' : '',\n 'link' : ''\n };\n if( news_links[i]['name'].localeCompare('a') == 0){\n var link = news_links[i]['attribs']['href'];\n var news_items_container = news_links[i]['children'][0];\n var news_text = news_items_container['children'][1];\n var headline_container = news_text['children'][1];\n var headline = headline_container['children'][0]['data'];\n \n news_h.headline = headline;\n news_h.link = link;\n items.push(news_h); // array to contain sub-objects of news headlines and links\n console.log(headline);\n console.log(' Link: ' + link);\n console.log('\\n'); \n } \n }\n resolve(items); \n console.log('success');\n }) \n .catch((err) => {\n console.log(err);\n });\n }); \n}", "title": "" }, { "docid": "50c754beced2f912a3eeffe894f1d9eb", "score": "0.5220967", "text": "function $xs(p, context) {\r\n if (!context) context = document;\r\n var i, arr = [], xpr = document.evaluate(p, context, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (i = 0; item = xpr.snapshotItem(i); i++) arr.push(item);\r\n return arr;\r\n }", "title": "" }, { "docid": "9f7c0741510bf0c32cd7794b8ceb6b2c", "score": "0.5219488", "text": "function gatherElements () {\n\t elements = {\n\t main: $element[0],\n\t scrollContainer: $element[0].getElementsByClassName('md-virtual-repeat-container')[0],\n\t scroller: $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0],\n\t ul: $element.find('ul')[0],\n\t input: $element.find('input')[0],\n\t wrap: $element.find('md-autocomplete-wrap')[0],\n\t root: document.body\n\t };\n\t elements.li = elements.ul.getElementsByTagName('li');\n\t elements.snap = getSnapTarget();\n\t elements.$ = getAngularElements(elements);\n\t }", "title": "" }, { "docid": "7a558a3e0ad3e007a79a0178712a35c5", "score": "0.52130663", "text": "function parseGamePageLinks() {\n\tvar gamesContainer = document.getElementById(\"_games_container\");\n\tvar gameModule = document.getElementById(\"_game_module\");\n\tvar gameList = document.getElementsByClassName(\"widgetContent2 games list dynamic\");\n\tvar game1 = document.getElementById(\"game_1\");\n\t\n\t\n\t//alert(game1);\n}", "title": "" }, { "docid": "f1e1d5ecf46e7bda35909571fc9adebf", "score": "0.5207468", "text": "function onTestQuerySelector() {\n var selectedElements = document.querySelectorAll('#wrapper span');\n /*Print content of all elements with ID wrapper and tag name span*/\n for (var i = 0; i < selectedElements.length; i++) {\n console.log(selectedElements[i].innerHTML);\n }\n}", "title": "" }, { "docid": "301164cbb5bbf65cfdbad6ee9d763d97", "score": "0.52002335", "text": "function loadFromList(){\n var result = [];\n document.getElementById(\"url-list\").childNodes.forEach(x => result.push(x.innerHTML));\n return result;\n\n}", "title": "" }, { "docid": "442b056b89133bdc922e2f53e78f1e74", "score": "0.51977646", "text": "function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].getElementsByClassName('md-virtual-repeat-container')[0],\n scroller: $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0],\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n }", "title": "" }, { "docid": "442b056b89133bdc922e2f53e78f1e74", "score": "0.51977646", "text": "function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].getElementsByClassName('md-virtual-repeat-container')[0],\n scroller: $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0],\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n }", "title": "" }, { "docid": "267cf472d76bfd4817637b28744d6d65", "score": "0.5185774", "text": "function highlightTradePartners() {\n var color_partners = getSetting(HIGHLIGHT_TRADE_PARTNERS_KEY, true);\n //console.log('Checking trade page');\n\n //if on the main empire page, only check links in the marquee\n //this saves time checking all the other links on the page that are useless\n var query = \"//a[contains(@href,'profile.aspx') or contains(@href,'base.aspx') and not(contains(@class,'header'))]\";\n if (location.indexOf(\"empire.aspx\") != -1 && (getView() == \"\" || getView() == \"Structures\"))\n query = \"//marquee\" + query;\n if (location.indexOf(\"bases_events\") != -1) query = \"//marquee\" + query;\n //console.log(query);\n\n var allLinks, item;\n allLinks = document.evaluate(\n query,\n document,\n null,\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\n null);\n //Iterate through all and add only odd ones to name and node arrays.\n var highlightPlayers = (getSetting(PLAYER_COLORS_KEY, null) != null) && getSetting(HIGHLIGHT_PLAYERS_KEY, true);\n for (var i = 0; i < allLinks.snapshotLength; i++) {\n item = allLinks.snapshotItem(i);\n if (color_partners && isTradePartner(item.innerHTML)) {\n item.style.color = unescape(getSetting(HIGHLIGHT_TRADE_COLOUR_KEY));\n }\n if (highlightPlayers) {\n var guild = getGuild(item.innerHTML);\n //Highlight by guild\n var color = getHighlightColorForGuild(guild);\n if (color != null) {\n item.style.color = color;\n }\n //Apply overrides\n var color = getHighlightColorForPlayer(getPlayerName(item.innerHTML));\n if (color != null) {\n item.style.color = color;\n }\n }\n }\n}", "title": "" }, { "docid": "0703bff551b8b43b808818bcbe637945", "score": "0.5179974", "text": "get linkDeals() { return $(\"//a[contains(text(),'Deals')]\") }", "title": "" }, { "docid": "cffde0c88ef4177d2068b9150ab50931", "score": "0.5178118", "text": "function getAllResults(pageData) {\n let $ = cheerio.load(pageData);\n let results = [];\n let htmlResults = $(\".search-results\").find(\"li\");\n htmlResults.each(function(i, elem) {\n let result = {};\n let allChildren = $(this).children().first().children();\n // get date\n result.date = Date.parse(allChildren.find(\"time\").first().attr(\"datetime\"))/1000;\n // get headline\n let headline = allChildren.find(\"h1\").attr(\"itemprop\",\"headline\").first();\n result.headline = headline.text();\n // get url\n let link = headline.find(\"a\").attr(\"href\");\n result.link = link;\n // done with this one, add result\n results.push(result);\n });\n return results;\n}", "title": "" }, { "docid": "c88c77ebce6a95fb12f0161e0a6b3bcf", "score": "0.5159781", "text": "async function getListings(url){\n //const url2 = listing_ids[1];\n axios.get(url)\n .then(response => {\n //console.log(url);\n const html = response.data;\n const $ = cheerio.load(html)\n const listing_info = $('body').children().text();\n const hyperlink = $('body').data('data-profile-url');\n console.log(hyperlink)\n //console.log(listing_info);\n })\n .catch(console.error);\n}", "title": "" }, { "docid": "188abe2c0649b7e99dd0d9aa57dca63d", "score": "0.51529795", "text": "function getFeatureElements(){\n return axios.get(ia.feature_link);\n }", "title": "" }, { "docid": "b659e35356f023640052abc90b6e776c", "score": "0.51484936", "text": "async function parseItems() {\n\tconsole.log('>>> parse Items ');\n\t// collect items\n\tlet items = await page.$$('[data-testid=\"marketplace_feed_item\"]');\n\tfor(let item of items){\n\t\t// note )-> fb marketplace is making DOM re-rendering, so it's good to take your breath before go next \n\t\tawait page.waitFor(500);\n\t\tlet href = await item.evaluate((node) => {\n\t\t\treturn node.pathname;\n\t\t});\n\t\tconsole.log('----->>>>>>>>>> item href', href);\n\t\t// select item\n\t\titem = await page.waitForSelector('a[href=\"'+href+'\"]');\n\t\tawait item.click();\n\t\t// wait for popup dialog\n\t\tlet dialogElementHandler = await page.waitForSelector('[aria-labelledby=\"marketplace-modal-dialog-title\"]');\n\t\tlet titleElementHandler = await page.waitForSelector('span[data-testid=\"marketplace_pdp_title\"]');\n\t\tlet priceElementHandler = await page.waitForSelector('span[itemprop=\"price\"]');\n\t\tlet descriptionElementHandler = await page.waitForSelector('span[itemprop=\"description\"]');\n\n\t\tconst title = await (await titleElementHandler.getProperty('textContent')).jsonValue();\n\t\tconst price = await (await priceElementHandler.getProperty('textContent')).jsonValue();\n\t\tconst description = await (await descriptionElementHandler.getProperty('textContent')).jsonValue();\n\t\t\n\t\t// push collected data into scrapedData array\n\t\tscrapedData.push({\n\t\t\ttitle, price, description\n\t\t});\n\n\t\t// close the dialog\n\t\tlet closeBtn = await dialogElementHandler.$('[title=\"Close\"]');\n\t\tawait closeBtn.click();\n\n\t\t// take breath\n\t\tawait page.waitFor(1000);\n\t}\n\n}", "title": "" }, { "docid": "4d6ee23d8e6d6e0351a0278848454ebd", "score": "0.5148259", "text": "function traverse() {\n var scrapableElements = document.querySelectorAll( '.scrapable-element' );\n for ( var i = 0; i < scrapableElements.length; i++ ) {\n scrapableElements[i].classList.toggle('scrapable-element'); \n scrapableElements[i].removeEventListener('mouseover', addMouseover ); \n scrapableElements[i].removeEventListener('mouseout', addMouseout ); \n scrapableElements[i].removeEventListener('click', simCrawl );\n }\n}", "title": "" }, { "docid": "6f031697cb9bdc6e50e7112f9e20754a", "score": "0.5147914", "text": "function findElement(_selector, context){\t\t\r\n\t\t\t _selector=trim(_selector.toString().replace(/\\s{2,}/g,\" \"));\r\n\t\t\t \r\n\t\t\t context=context==null? window.document.body : context;\r\n\t\t\t var desc=getDescendants(context);\r\n\t\t\t \t var pats=[{name: \"klass\", pat:/^\\.\\w+/, mtd: function(klass){desc=desc.filter(function(e){return e.classList.contains(klass.substr(1));}); }},\r\n\t\t\t\t\t {name: \"tag\", pat:/^\\w+/, mtd: function(tag){desc=desc.filter(function(e){return e.tagName.toString().toLowerCase()==tag.toLowerCase();})}},\r\n\t\t\t\t\t {name: \"descendant\", pat:/^\\s/, mtd: function(){var new_desc=[]; desc.forEach(function(e){var d=getDescendants(e); if(d.length>0)new_desc=new_desc.concat(d); }); desc=new_desc;}},\r\n\t\t\t\t\t {name: \"id\", pat:/^\\#\\w+/, mtd: function(id){desc=desc.filter(function(e){return e.id==id.substr(1);});}},\r\n\t\t\t\t\t {name: \"child\", pat:/^\\>/, mtd: function(){var new_desc=[]; desc.forEach(function(e){var d=e.children; if(d.length>0){Array.prototype.forEach.call(d, function(el){new_desc.push(el);});} }); desc=new_desc; }},\r\n\t\t\t\t\t {name: \"attribute selector\", pat:/^\\[(\\w+)([~^$* ]?=\\s?)['\"]?([#-&(-~)!]+)['\"]?\\]/, mtd: function(attr_sel){desc=desc.filter(function(e){var _attr=e.getAttribute(attr_sel[1]); if(trim(attr_sel[2])==\"=\") return _attr==attr_sel[3]; else if(trim(attr_sel[2])==\"*=\") {if(_attr) return _attr.match(new RegExp(attr_sel[3].replace(/(\\W)/g, \"\\\\$1\")))} else if(trim(attr_sel[2])==\"^=\") {if(_attr) return _attr.match(new RegExp(\"^\" + attr_sel[3].replace(/(\\W)/g, \"\\\\$1\")))} if(trim(attr_sel[2])==\"$=\") {if(_attr) return _attr.match(new RegExp(attr_sel[3].replace(/(\\W)/g, \"\\\\$1\") + \"$\")) } })}},\r\n\t\t\t\t\t {name: \"adjacent\", pat:/^\\+\\w+/, mtd: function(adj){var found=false; var new_desc=[]; desc.forEach(function(e){var d=e.children; found=false; if(d.length>0){Array.prototype.forEach.call(d, function(el){if(el.tagName.toLowerCase()==adj.substr(1).toLowerCase() && found===false){new_desc.push(el); found=true;}});} }); desc=new_desc; }}\r\n\t\t\t\t\t ];\r\n\t\t\t var match;\r\n\t\t\t while (_selector){\r\n\t\t\t\t match=null;\r\n\t\t\t\t for(var k=0; k<pats.length; k++){\r\n\t\t\t\t\t if(match=pats[k].pat.exec(_selector)){\r\n\t\t\t\t\t\t if(pats[k].name==\"attribute selector\") pats[k].mtd(match);\r\n\t\t\t\t\t\t else pats[k].mtd(match[0]);\t\t\t\t\t\t \r\n\t\t\t\t\t\t _selector=_selector.replace(match[0],\"\");\r\n\t\t\t\t\t\t break;\r\n\t\t\t\t\t }\t\t\t\t\t \r\n\t\t\t\t }\t\t\t\t \r\n\t\t\t\t if(!match) return [];\t\t\t\t \r\n\t\t\t }\r\n\t\t\t return desc;\r\n\t\t }", "title": "" }, { "docid": "025b4937b9357fd77f39e695dead43e4", "score": "0.5147842", "text": "verifySearchBar(){\n return $('//div[@id=\"searchbar\"]');\n }", "title": "" }, { "docid": "9c05d590df7ab3221bd76349a24aad38", "score": "0.51397294", "text": "function doCitizenMarketOffers() {\r\n var results\r\n var allElements\r\n var tmp\r\n results = getElements(document, \"//TD[@colspan='2']\");\r\n allElements = results.snapshotItem(0).children[2]\r\n tmp = allElements.children[0]\r\n \r\n tmp.innerHTML = tmp.innerHTML.replace(/Marketplace/,\"Produktų inka\")\r\n tmp.innerHTML = tmp.innerHTML.replace(/Post new offers/,\"Įdėti naujus pasiūlymus\")\r\n tmp.innerHTML = tmp.innerHTML.replace(/Country/,\"Vasltybė\")\r\n tmp.innerHTML = tmp.innerHTML.replace(/Product/,\"Produktas\")\r\n tmp.innerHTML = tmp.innerHTML.replace(/Quantity/,\"Kiekis\")\r\n tmp.innerHTML = tmp.innerHTML.replace(/Price/,\"Kaina\")\r\n tmp.innerHTML = tmp.innerHTML.replace(/Post new offer/,\"Įdėti naują pasiūlymą\")\r\n tmp.innerHTML = tmp.innerHTML.replace(/Show market offers/,\"Rodyti turgaus pasiūlymus\");\r\n tmp.innerHTML = tmp.innerHTML.replace(/Your storage/,\"Tavo nuosavybė\");\r\n \r\n results = getElements(document, \"//h3[@style='text-align: center']\");\r\n allElements = results.snapshotItem(0)\r\n tmp = allElements\r\n tmp.innerHTML = tmp.innerHTML.replace(/Your offers on market/,\"Tavo pasiūlymai produktų rinkoje\")\r\n \r\n results = getElements(document, \"//table[@style='width: 680px; margin-left: auto; margin-right: auto;']\");\r\n allElements = results.snapshotItem(0).children[0]\r\n tmp = allElements.children[0]\r\n tmp.innerHTML = tmp.innerHTML.replace(/Product/,\"Produktas\")\r\n tmp.innerHTML = tmp.innerHTML.replace(/Seller/,\"Pardavėjas\");\r\n tmp.innerHTML = tmp.innerHTML.replace(/Stock/,\"Kiekis\");\r\n tmp.innerHTML = tmp.innerHTML.replace(/Price/,\"Kaina\");\r\n tmp.innerHTML = tmp.innerHTML.replace(/Gross/,\"Brutto\");\r\n tmp.innerHTML = tmp.innerHTML.replace(/Price/,\"Kaina\");\r\n tmp.innerHTML = tmp.innerHTML.replace(/Net/,\"Netto\");\r\n tmp.innerHTML = tmp.innerHTML.replace(/Import tax/,\"Importo mokestis\");\r\n tmp.innerHTML = tmp.innerHTML.replace(/Delete/,\"Trinti\");\r\n \r\n}", "title": "" }, { "docid": "63f63c6ffa82ff9c13b389b07c5237ac", "score": "0.5134297", "text": "function gatherElements () {\n elements = {\n main: $element[0],\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n }", "title": "" }, { "docid": "9ac44a83a8454d5797955dd1af01d228", "score": "0.5129836", "text": "function getLinks(body) {\n let links = [];\n let $ = cheerio.load(body);\n for (let i = 0; i < $('ul.products li a').length; i++) {\n links[i] = 'http://www.shirts4mike.com/' + $('ul.products li a ').eq(i).attr('href');\n }\n return links;\n}", "title": "" }, { "docid": "695ed02311ff6935c3a42edf634f8e9f", "score": "0.5128371", "text": "async function scrape() {\n\tconsole.log('start scraping data');\n\n const browser = await puppeteer.launch({\n /**\n * Use the default headless mode.\n */\n headless: true,\n args: ['--no-sandbox']\n });\n\n\ttry{\n\t\tconst page = await browser.newPage();\n\n\t\t/**\n\t\t* Visit page\n\t\t*/\n\t\tawait page.goto(SCRAPE_SOURCE);\n\n\t\t/**\n\t\t * Get page content as HTML.\n\t\t */\n\t\tlet content = await loadPage(page);\n\n\t\t/**\n\t\t * Load content in cheerio.\n\t\t */\n\t\tconst $ = cheerio.load(content);\n\n\t\n\t\t/**\n\t\t* Parse document\n\t\t**/\n\t\t$('.cmc-table-listing .cmc-table-row').each( async function (i, elem) {\n\t\t\tlet rank = $(elem).find('.cmc-table__cell--sort-by__rank').find('div').text();\n\t\t\tlet href = $(elem).find('.cmc-table__cell--sort-by__name').find('a');\n\t\t\tlet icon = $(elem).find('.cmc-table__cell--sort-by__name').find('img').attr('src');\n\t\t\tlet name = href.attr('title');\n\t\t\tlet slug = href.attr('href').split('/')[2];\n\t\t\tlet price = $(elem).find('.cmc-table__cell--sort-by__price').find('a').text().replace(/[^0-9.]/g,'');\n\t\t\tlet marketCap = $(elem).find('.cmc-table__cell--sort-by__market-cap').find('div').text().replace(/[^0-9.]/g,'');\n\t\t\tlet volume = $(elem).find('.cmc-table__cell--sort-by__volume-24-h').find('a').text().replace(/[^0-9.]/g,'');\n\t\t\tlet supply = $(elem).find('.cmc-table__cell--sort-by__circulating-supply').find('div').text();\n\t\t\tlet change = $(elem).find('.cmc-table__cell--sort-by__percent-change-24-h').find('div').text();\n\t\t\tlet graph = $(elem).find('.cmc-table__column-graph').find('img').attr('src');\n\n\t\t\tlet currency = await CryptoCurrency.findOne({name:name});\n\t\t\tif(currency){\n\t\t\t\t//console.log(`updating ${currency.name}`);\n\t\t\t\tcurrency.rank = rank;\n\t\t\t\tcurrency.price = price;\n\t\t\t\tcurrency.marketCap = marketCap;\n\t\t\t\tcurrency.volume = volume;\n\t\t\t\tcurrency.supply = supply;\n\t\t\t\tcurrency.change = change;\n\t\t\t\tcurrency.save();\n\t\t\t} else {\n\t\t\t\tconst newCurrency = new CryptoCurrency({\n\t\t\t\t\trank,\n\t\t\t\t\tname,\n\t\t\t\t\ticon,\n\t\t\t\t\tprice,\n\t\t\t\t\tmarketCap,\n\t\t\t\t\tvolume,\n\t\t\t\t\tsupply,\n\t\t\t\t\tchange,\n\t\t\t\t\tgraph,\n\t\t\t\t\tslug\n\t\t\t\t});\n\t\t\t\tnewCurrency.save();\n\t\t\t\t//console.log(`adding new currency ${newCurrency.name}`);\n\t\t\t}\n\t\t});\n\t\tconsole.log('data scraped');\n\n\t\tawait browser.close();\n\t} catch (error) {\n\t\tconsole.log(error);\n\t\tawait browser.close();\n\t} finally {\n\t\tawait browser.close();\n\t}\n}", "title": "" }, { "docid": "5e5c0885efd89b4d0718a619c379f62b", "score": "0.5127341", "text": "async function headlinesABC() {\n const browser1 = await puppeteer.launch({ headless: true });\n const page = await browser1.newPage();\n\n await page.setRequestInterception(true);\n page.on('request', (request) => {\n if (request.resourceType() === 'script') request.abort();\n else request.continue();\n });\n\n const navigationPromise = page.waitForNavigation();\n await page.goto('https://www.abc.net.au/news/justin/');\n // await page.setViewport({ width: 1200, height: 800 })\n\n let title;\n\n for (i = 0; i < 10; i++) {\n await page.waitForSelector(\n '.GvLLo > ._27tpe > ._6TJ0W > ._3XQNk > ._1cg3S'\n );\n await page.click('.GvLLo > ._27tpe > ._6TJ0W > ._3XQNk > ._1cg3S');\n }\n\n for (i = 1; i < 8; i++) {\n await navigationPromise;\n\n await page.waitForSelector(\n `.\\_2kqX-:nth-child(${i}) > .\\_1E-Sb > .\\_38hRP > div > .\\_2HoMm > .zT1nT > .MLQqg`\n );\n await page.click(\n `.\\_2kqX-:nth-child(${i}) > .\\_1E-Sb > .\\_38hRP > div > .\\_2HoMm > .zT1nT > .MLQqg`\n );\n await page.waitForSelector('title');\n await page.waitForSelector('p');\n title = await page.$eval('title', (title) => title.innerHTML);\n const textsJoined = await page.evaluate(() =>\n [...document.querySelectorAll('p')]\n .map((elem) => elem.innerText)\n .join('\\n')\n );\n if ((await re.test(textsJoined)) === false) {\n articles.push({\n heading: title,\n content: await page.evaluate(() =>\n [...document.querySelectorAll('p')].map((elem) => elem.innerText)\n ),\n url: page.url(),\n });\n }\n\n await navigationPromise;\n await page.goBack();\n }\n\n await browser1.close();\n console.log(articles.length);\n }", "title": "" }, { "docid": "a22d04b7e6eaa595e55c07aeb3d059ed", "score": "0.51234764", "text": "processPage() {\n this.els = learnCustomElementNames(this.document);\n this.applyBehaviors();\n }", "title": "" }, { "docid": "0e6c2cb1caa1be1568b73cf4582818a5", "score": "0.51155674", "text": "async function collect(url,browser) \r\n { \r\n let page=await browser.newPage() ;\r\n await page.goto(url);\r\n await page.waitForTimeout(2000);\r\n let info = await page.$$(\".static-tweet-p\");\r\n let start=info.length/2+1;\r\n let promises=[];\r\n for(let i=start;i<info.length;i++)\r\n {\r\n let text=await page.evaluate((data)=>{\r\n\r\n return data.innerText;\r\n },info[i]);\r\n\r\n promises.push(Promise.resolve(text)); \r\n }\r\n\r\npage.close();\r\n \r\nreturn Promise.all(promises);\r\n \r\n}", "title": "" }, { "docid": "a7761ebd99738e0589214185315f04b2", "score": "0.51083344", "text": "function scrape(url) {\n return new Promise(resolve => {\n axios.get(url).then(res => {\n let $ = cheerio.load(res.data)\n \n let reviews = []\n $('.review').each(function(i, elem) {\n if (i > 0) {\n let content = $(elem).find('.review-content').find('p').text()\n \n // eliminate newline characters\n content = content.replace(/\\n/g, '')\n reviews.push(content)\n }\n })\n \n resolve(reviews)\n })\n .catch(err => console.log(err))\n })\n}", "title": "" }, { "docid": "e1345bbb100714fe08c9919a2128788a", "score": "0.5105776", "text": "function cb(error, response, html) {\n // console.log(response);\n // console.log(\"error\",error);\n let cheerioSelector = cheerio.load(html);\n // element select \n let matchcard = cheerioSelector(\".col-md-8.col-16\");\n console.log(matchcard.length);\n gCount = matchcard.length;\n for (let i = 0; i < matchcard.length; i++) {\n // sublock anchors\n let allanchorsofAMatch = cheerioSelector(matchcard[i])\n .find(\".match-cta-container .btn.btn-sm.btn-outline-dark.match-cta\");\n let link = cheerioSelector(allanchorsofAMatch[2]).attr(\"href\");\n let fullLink = \"https://www.espncricinfo.com\" + link;\n // console.log(fullLink);\n request(fullLink, cbsingle);\n\n }\n // let AllAnchors = cheerioSelector('.match-cta-container .btn.btn-sm.btn-outline-dark.match-cta ');\n // console.log(element.length);\n // console.log(element.html());\n // html \n // console.log(element.html());\n // text\n // console.log(element.text());\n}", "title": "" }, { "docid": "c1e4483d29b52eea25228aa56d98d4e3", "score": "0.5086154", "text": "function defineRank() {\n // Get the DOM of the html body\n let documentBody = document.body.getElementsByTagName(\"*\"),\n string = [].map.call( documentBody, function(node) {\n return node.textContent || node.innerText || \"\";\n }).join(\"\");\n\n // console.log(documentBody);\n\n for (i = 0; i < documentBody.length; i++) {\n let htmlElement = documentBody.item(i);\n let element = documentBody.item(i).innerHTML;\n\n\t/* Add text on main page explaining the situation. */\n /* Add text on main page explaining the situation. */\n // if (htmlElement.id == \"resultStats\") {\n // htmlElement.style.fontSize = \"10px\";\n // htmlElement.style.color = \"red\"\n // htmlElement.firstChild.nodeValue = \"This proxy is made to track user-interactions for research purposes. By using this proxy you agree to sharing your user interaction data. In the future it will also be possible to look at your collected data and delete this data.\";\n // }\n\t\n /* Set the query of the search term */\n if (htmlElement.className == \"gLFyf gsfi\") {\n userQuery = htmlElement.getAttribute(\"value\");\n\n // TODO REMOVE THIS\n let queryMessage = \"Search query is: \"\n // console.log(queryMessage.concat(userQuery));\n }\n\n if (htmlElement.className == \"gb_Zc\") {\n // console.log(htmlElement);\n }\n\n /* Remove navigation bar, since the tracking doesnt work there. */\n if (htmlElement.hasAttribute(\"id\") && htmlElement.getAttribute(\"id\") == \"top_nav\") {\n // htmlElement.removeChild(htmlElement.firstChild);\n }\n\n\t/* Remove the top navigation bar, since we only support normal searche functionality */\n\tif (htmlElement.id == \"top_nav\") {\n while (htmlElement.firstChild) {\n htmlElement.removeChild(htmlElement.firstChild);\n }\n }\n\n /* Logic for multiple page module */\n if (htmlElement.hasAttribute(\"id\") && htmlElement.getAttribute(\"id\") == \"navcnt\") {\n setupNextPagesModule(htmlElement);\n }\n\n /* Logic for privacy reminder */\n if (htmlElement.id == \"taw\") {\n\t htmlElement.childNodes[1].removeChild(htmlElement.childNodes[1].childNodes[2]);\n //setupPrivacyModule(htmlElement);\n }\n\n /* Logic for translation container.\n * This container contains a translation tool.\n * Possible:\n * - some image\n * - examples of the word with different meanings (tree -> boom, stamboom).\n */\n if (htmlElement.id == \"tw-container\") {\n setupTranslationModule(htmlElement);\n }\n\n /* Logic for dictionary module */\n if (htmlElement.id == \"dictionary-modules\") {\n setupDictionaryModule(htmlElement);\n }\n\n /* Logic for map image + location under module */\n if (htmlElement.className == \"vk_c\") {\n setupMapImageModule(htmlElement);\n }\n\n /* Google maps module containing additionallocal location suggestions. */\n if (htmlElement.getAttribute(\"class\") != null && htmlElement.getAttribute(\"class\").startsWith(\"AEprdc vk_c\")) {\n setupMapSuggestionsModule(htmlElement);\n }\n\n /* Logic for videos */\n if (htmlElement.getAttribute(\"class\") == \"COEoid\") {\n setupVideosModule(htmlElement, \"videos\");\n }\n\n /* Logic for news videos on online */\n if (htmlElement.getAttribute(\"class\") == \"mJVYJe\") {\n setupVideosModule(htmlElement, \"videos-news\");\n }\n\n /* Logic for image boxes */\n if (htmlElement.className == \"S1KrM\") {\n setupImagesModule(htmlElement);\n }\n\n /* Logic for normal results modules */\n if (htmlElement.className == \"rc\") {\n setupNormalResultModule(htmlElement);\n }\n\n /* Logic for related search result modules */\n if (htmlElement.id == \"extrares\") {\n setupRelatedSearchModule(htmlElement);\n }\n\n /* Catch vertical blocks */\n if (element.startsWith('<div class=\\\"ifM9O\\\">')) {\n setupVerticalModule(htmlElement);\n }\n\n /* Force all href links to open on a new tab */\n addClickLogic(htmlElement);\n }\n\n if (!window.location.href.includes(\"/search?\")) {\n let node = document.createElement(\"div\");\n node.style.fontSize = \"13px\";\n node.style.color = \"red\";\n let textnode = document.createTextNode(\"This proxy is made to track user interactions for research purposes. By using this proxy you agree to sharing your user interaction data.\");\n node.appendChild(textnode);\n document.body.insertBefore(node, documentBody.item(0));\n }\n\n // console.log(\"%%%%%%\");\n // console.log(moduleData);\n let generalData = new GeneralData(moduleData);\n\n let postStructureUrl = fastHttpIp.concat(\"postStructure\");\n httpPostAsync(postStructureUrl, generalData, handlePostResponse);\n\n}", "title": "" }, { "docid": "ae7ed0d3439c5c1ca01aaa9e68084dcc", "score": "0.5086073", "text": "async function getPageContent() {\n const browser = await puppeteer.launch({\n headless: false,\n });\n let page = await browser.newPage();\n await page.goto('http://www.cuhumane.org/Adoption/SearchforAdoptablePets.aspx#/', {\n waitUntil: 'networkidle0',\n timeout: 3e6\n });\n await page.click('__cp-finder-checkbox'); //doesn't work\n const pageContent = await page.content();\n await initCache();\n await writeFileCache('cache', pageContent);\n return pageContent;\n}", "title": "" }, { "docid": "5883fdcf1f81177c4283df403a1fec9b", "score": "0.50758064", "text": "function findElementQueriesElements(container) {\n var query = getQuery(container);\n\n for (var selector in allQueries) if (allQueries.hasOwnProperty(selector)) {\n // find all elements based on the extract query selector from the element query rule\n var elements = query(selector, container);\n\n for (var i = 0, j = elements.length; i < j; i++) {\n setupElement(elements[i], selector);\n }\n }\n }", "title": "" }, { "docid": "6ba6f805365ef655507ea0ee07a3fe41", "score": "0.50700945", "text": "verifyTrendingSection(){\n return $('//h3[text()=\"Trending\"]');\n }", "title": "" }, { "docid": "8d3f8573002d4ab5f7c287ce4170398d", "score": "0.5068974", "text": "function scrapeElementsByTag(url, tagName, func, index){\r\n var realIndex = \"\";\r\n if(index === undefined){\r\n realIndex = \"all\";\r\n }else{\r\n realIndex = index;\r\n }\r\n var xhttp = new XMLHttpRequest();\r\n\txhttp.onreadystatechange = function() {\r\n\t\tif (this.readyState == 4 && this.status == 200) {\r\n\t\t\tfunc(this.responseText);\r\n\t\t}{}\r\n\t};\r\n\txhttp.open(\"GET\", \"lib_php/scrapeElementsByTag.php?tagPass=\" + url + \" \" + tagName + \" \" + realIndex, true);\r\n\txhttp.send();\r\n}", "title": "" }, { "docid": "1bdd4df50226c4e06d67a74a76d9e074", "score": "0.5068367", "text": "function scrapeEnergies(el, $, func) {\n var $el = $(el);\n\n $el.find(\"li\").each(function (i, val) {\n var $val = $(val);\n var type = $val.attr(\"title\");\n func(type, $val);\n });\n}", "title": "" }, { "docid": "0c8c70474cce45bc3655c3c38b1dec10", "score": "0.50602573", "text": "function getElementsByXPath(xpath, node) {\n node = node || document;\n var nodesSnapshot = (node.ownerDocument || node).\n evaluate(xpath, node, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n var data = [];\n for (var i = 0, l = nodesSnapshot.snapshotLength; i < l;\n data.push(nodesSnapshot.snapshotItem(i++)));\n return data.length > 0 ? data : null;\n}", "title": "" }, { "docid": "4234c279efa5bd7645c0df19a9fe1232", "score": "0.50541615", "text": "function forall(xpath,f) { \r\n var results=document.evaluate(xpath,document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);\r\n for (var i=0; i<results.snapshotLength; i++) f(results.snapshotItem(i));\r\n}", "title": "" }, { "docid": "e719c00311a9e036187e7bede761c6a8", "score": "0.5054002", "text": "REUC(HTML){\n let T=this,search_progress=T.$(\"#search_progress\");\n const data = [], \n dom = new JSDOM(HTML), \n resul_panel=T.$(\".result_panel\"),\n main_result = dom.window.document.querySelectorAll(\".tF2Cxc\");\n \n \n\n main_result.forEach(item => { \n data.push(\n { \n domain :item.childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerHTML,\n title: item.childNodes[0].childNodes[0].childNodes[1].innerHTML,\n brief:item.childNodes[1].childNodes[0].innerHTML,\n link: item.childNodes[0].childNodes[0].href\n }\n )\n });\n\n resul_panel.innerHTML=\"\"\n data.forEach(e => {\n T.PSR(e)\n });\n \n\n //blank result for scroll\n let result_blank= T.$CE(\"div\");\n result_blank.className=\"result_blank\";\n resul_panel.appendChild(result_blank)\n T.LCR()\n \n search_progress.style.opacity=0//progress close\n}", "title": "" }, { "docid": "616a901b41a699a9830b17b65c42f055", "score": "0.50522035", "text": "async function runUrls(links){\n let arr = [];\n console.log(\"the links are \", links)\n for(url of links){\n let newPage, oddData;\n try{\n newPage = await browser.newPage();\n await newPage.setViewport({ width: 1366, height: 768});\n }\n catch(err){\n console.log(`Could not open a new page`);\n }\n try{\n await newPage.goto(url, {\n waitUntil: \"domcontentloaded\"\n })\n }\n catch(err){\n console.log(`Could not navigate to the new page => ${err}`);\n }\n try {\n\t\t\t\t\t\t await newPage.waitForSelector(\"button.MLOdds\");\n\t\t\t\t\t\t await newPage.waitFor(1000);\n\t\t\t\t\t\t } catch (err) {\n\t\t\t\t\t\t console.log(err);\n\t\t\t\t\t\t }\n try{\n oddData = await newPage.evaluate(async () => {\n let oddObj = {};\n let event = document.querySelector('div.breadcrumb.breadcrumb-last span.breadcrumb-text').textContent;\n console.log(\"The event content is \", event)\n event = event.split('vs');\n event = event.join('-');\n event = event;\n let dateTime = document.querySelector('.prematch-sc-starting').textContent;\n dateTime = dateTime.split(' ');\n console.log(\"the date data is \", dateTime);\n let time = dateTime.pop();\n let dateData = dateTime.join(' ');\n dateData = dateData.split(', ')[1];\n let dtt = new Date().getFullYear();\n let date = `${dateData} ${dtt}`;\n let odds = document.querySelectorAll('.bet-odds-number');\n odds = Array.prototype.slice.call(odds);\n odds = odds.map(odd => odd.textContent);\n console.log(\"The odds are \", odds);\n oddObj.date = date;\n oddObj.time = time;\n oddObj.event = event;\n oddObj.odds = {};\n oddObj.odds['1'] = odds[0];\n oddObj.odds['X'] = odds[1];\n oddObj.odds['2'] = odds[2];\n oddObj.odds['1X'] = odds[37];\n oddObj.odds['12'] = odds[39];\n oddObj.odds['2X'] = odds[38];\n oddObj.odds['O2.5'] = odds[7];\n oddObj.odds['U2.5'] = odds[8];\n oddObj.odds['GG'] = odds[32];\n oddObj.odds['NG'] = odds[33];\n oddObj.odds['1HT'] = odds[19];\n oddObj.odds['2HT'] = odds[21];\n oddObj.odds['XHT'] = odds[20];\n console.log(\"The data is \", oddObj);\n\t return oddObj;\n });\n }\n catch(err){\n console.log(err);\n }\n // console.log(\"the oddData is \", oddData);\n newPage.close();\n // return oddData;\n arr.push(oddData);\n console.log(\"OddData is \", oddData);\n }\n return arr;\n }", "title": "" }, { "docid": "0fb9610d20a5106320727816e6b151de", "score": "0.50493526", "text": "async function getListingFromAmazon(link, browserInstance,pName){\n let newTab = await browserInstance.newPage();\n await newTab.goto(link);\n await newTab.type(\"#twotabsearchtextbox\", pName,{delay:200});\n await newTab.click(\"#nav-search-submit-button\");\n await newTab.waitForSelector(\".a-section.a-spacing-medium .a-size-medium.a-color-base.a-text-normal\",{visible:true});\n await newTab.waitForSelector(\".a-price-whole\",{visible:true});\n function consoleFn(priceSelector, pNameSelector){\n let priceArr=document.querySelectorAll(priceSelector);\n let pNameArr = s=document.querySelectorAll(pNameSelector);\n let details =[];\n for(let i=0; i<5;i++){\n let price =priceArr[i].innerText;\n let Name = pNameArr[i].innerText;\n details.push({\n price, Name\n\n })\n }\n return details;\n }\n let detailsArr = await newTab.evaluate(consoleFn,\".a-price-whole\",\".a-section.a-spacing-medium .a-size-medium.a-color-base.a-text-normal\");\n return detailsArr;\n //a price whole\n //.a-section.a-spacing-medium .a-size-medium.a-color-base.a-text-normal\n\n\n}", "title": "" }, { "docid": "34f4cf6ed312fe1bde9c7b4b77a7898e", "score": "0.5048396", "text": "async scrap (params ) {\n return new Promise(async (resolve, reject) => {\n \n const browser = await firefox.launch(\n { \n devtools: params.debug,\n headless: params.debug, \n // slowMo: 50 \n }\n );\n const context = await browser.newContext();\n const page = await context.newPage();\n \n await page.goto('https://www.easynvest.com.br/autenticacao');\n \n \n await page.fill(\"#username\", params.credentials.user);\n await page.fill(\"#password\", params.credentials.password);\n \n \n await page.click('text=Entrar');\n \n \n utils.wait(1000);\n \n \n const [responseCustody] = await Promise.all([\n page.waitForResponse('**/api/samwise/v2/custody-position'),\n ]);\n \n await page.screenshot({ path: `src/screenshots/easynvest-${params.credentials.user}.png` });\n\n const jsonCustody = await responseCustody.json();\n \n utils.wait(500);\n try{\n await page.click(\"css=.close-button\");\n }catch(e){\n\n }\n await page.goto(\"https://www.easynvest.com.br/acompanhar/conta\");\n utils.wait(500);\n\n const [responseAccount] = await Promise.all([\n page.waitForResponse('**/api/registrar/v1/customers/accounts'),\n page.click('text=Conta Easynvest')\n ]);\n\n const bankAccount = await responseAccount.json();\n // const bankAccount = {};\n\n const movements = await this.scrapMovements(page);\n\n resolve({\n positions: jsonCustody,\n movements: movements,\n bankAccount: bankAccount[0]\n });\n await browser.close();\n\n });\n }", "title": "" }, { "docid": "c89234d03d1b5e58a70f82ee7fb1c3a1", "score": "0.5047139", "text": "async extractContacts() {\n try {\n return await this.page.evaluate(() => {\n const USER_PROFILE_SELECTOR = 'a[data-control-name=connection_profile].mn-connection-card__link';\n const users = Array.from(window.document.querySelectorAll(USER_PROFILE_SELECTOR));\n return users.map((user) => user.href);\n })\n } catch (err) {\n console.log(\"Can't extract contacts\");\n }\n }", "title": "" }, { "docid": "2ef9adff5a78ee3c4c72d8326efa9637", "score": "0.50439423", "text": "async function scrapeCatalogPage () {\n try {\n console.log('\\nscraping catalog page...');\n\n const response = await got(rootURL + 'shirts.php');\n\n const $ = cheerio.load(response.body);\n const $shirts = $('.products li a');\n const shirtPaths = [];\n\n $shirts.each(function () {\n shirtPaths.push(this.attribs.href) });\n\n return shirtPaths;\n\n } catch (err) { throw err };\n}", "title": "" }, { "docid": "7b42fb93fcb857af6c7f34464d72b009", "score": "0.5042998", "text": "function xpath(query) \r\n{\r\n\treturn document.evaluate(query, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);\r\n}", "title": "" } ]
9d510fb73beb35e01fd9ee8e344f46d2
rotate_left &x2014; material icon named "rotate left".
[ { "docid": "6cb755b750df3d0b18355427e630c629", "score": "0.87956727", "text": "get rotate_left () {\n return new IconData(0xe419,{fontFamily:'MaterialIcons'})\n }", "title": "" } ]
[ { "docid": "c41b0c86ae56ab6921e34e8c12c8bbb1", "score": "0.77069044", "text": "get rotate_right () {\n return new IconData(0xe41a,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "41f019fd5b38576cea95e1e9e938d3a5", "score": "0.7348635", "text": "get arrow_left () {\n return new IconData(0xe5de, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "41f019fd5b38576cea95e1e9e938d3a5", "score": "0.7348635", "text": "get arrow_left () {\n return new IconData(0xe5de, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "a2cdb9750edb76bd2c91fc7eb329b037", "score": "0.7163934", "text": "rotateLeft() {\n // go back 90\n this.degrees += -90;\n this.__img.style.transform = \"rotate(\" + this.degrees + \"deg)\";\n this.__img.toggleClass(\"top\");\n }", "title": "" }, { "docid": "0b3428ced89edb15d9f03c138ce2b5f4", "score": "0.71586746", "text": "get rotate_90_degrees_ccw () {\n return new IconData(0xe418,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "829b415f81709a6296259b9ee9539d5d", "score": "0.7139526", "text": "get chevron_left () {\n return new IconData(0xe5cb, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "829b415f81709a6296259b9ee9539d5d", "score": "0.7139526", "text": "get chevron_left () {\n return new IconData(0xe5cb, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "eae99c67a30bd65c10a9d765ab241eee", "score": "0.6997371", "text": "get threed_rotation () {\n return new IconData(0xe84d,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "eae99c67a30bd65c10a9d765ab241eee", "score": "0.6997371", "text": "get threed_rotation () {\n return new IconData(0xe84d,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "c9bd34f26f6dc02465f28f2fc9696796", "score": "0.6901798", "text": "get format_align_left () {\n return new IconData(0xe236,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "8edea90f556438640cf0cde640e94fac", "score": "0.6894686", "text": "get screen_rotation () {\n return new IconData(0xe1c1,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "8c998622b7bc74da5f944d5f58c14f02", "score": "0.6847278", "text": "get screen_lock_rotation () {\n return new IconData(0xe1c0,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "c667fceb44b1d34180eab2cfd5ebbc79", "score": "0.6840682", "text": "get text_rotate_up () {\n return new IconData(0xe93a,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "ff96022a2fe1912c9fee4db010b0bd86", "score": "0.6677453", "text": "get keyboard_arrow_left () {\n return new IconData(0xe314,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "50e2ac6c5a9c599cd64567480d7d76ce", "score": "0.6675102", "text": "get crop_rotate () {\n return new IconData(0xe437,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "50e2ac6c5a9c599cd64567480d7d76ce", "score": "0.6675102", "text": "get crop_rotate () {\n return new IconData(0xe437,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "1c0665d17c6197f547363c85b9548fd6", "score": "0.6674414", "text": "function onRotateLeft() {\n if ( this.viewport ) {\n var currRotation = this.viewport.getRotation();\n if (currRotation === 0) {\n currRotation = 270;\n }\n else {\n currRotation -= 90;\n }\n this.viewport.setRotation(currRotation);\n }\n}", "title": "" }, { "docid": "e27cde723036170f2a1a62f5c41cbbcd", "score": "0.64987254", "text": "get text_rotation_down () {\n return new IconData(0xe93e,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "7c33b78e96c345cbc2129a53de07342c", "score": "0.648123", "text": "get text_rotation_angleup () {\n return new IconData(0xe93d,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "35e0d7bfc38cc939f67e39d19701b3b5", "score": "0.6477795", "text": "turnLeft() {\n this.setOrientation((this.orientation + 3) % 4);\n }", "title": "" }, { "docid": "5782cb4b6e6466be5b323ed1484de202", "score": "0.64670926", "text": "get text_rotation_angledown () {\n return new IconData(0xe93c,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "7f6c4232063ad03157b33e511b53480a", "score": "0.64238405", "text": "get subdirectory_arrow_left () {\n return new IconData(0xe5d9,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "9bc57cc15ac5ddcfbae6f6920e8aabf2", "score": "0.63217837", "text": "get arrow_right () {\n return new IconData(0xe5df, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "9bc57cc15ac5ddcfbae6f6920e8aabf2", "score": "0.63217837", "text": "get arrow_right () {\n return new IconData(0xe5df, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "5f2f13f31f77417ef5e7fc1876269e0c", "score": "0.62986743", "text": "function ArrowLeft() {\n return (\n <Svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\">\n <Path\n d=\"M7.828 11H20V13H7.828L13.192 18.364L11.778 19.778L4 12L11.778 4.22198L13.192 5.63598L7.828 11Z\"\n fill=\"white\"\n />\n </Svg>\n );\n}", "title": "" }, { "docid": "952c1534f531876771348edf5045e801", "score": "0.6286108", "text": "function rotate_racket_left() {\n ctx.save();\n ctx.translate(left_player_x - 60, left_player_y);\n if (racket_left_x < 50) {\n ctx.rotate(racket_left * Math.PI / 180);\n ctx.drawImage(leftplayer_racket, racket_left_x, racket_left_y, 120, 120);\n }\n else rotate_flag_left = false;\n racket_left += 1;\n racket_left_x += 2;\n racket_left_y -= 2;\n ctx.restore();\n}", "title": "" }, { "docid": "3f785cdf288df1426a96cdcc1d494723", "score": "0.6271586", "text": "get stay_current_landscape () {\n return new IconData(0xe0d3,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "a6173b6a58b2737c4de859ce210bc313", "score": "0.62671673", "text": "get border_left () {\n return new IconData(0xe22e,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "a6173b6a58b2737c4de859ce210bc313", "score": "0.62671673", "text": "get border_left () {\n return new IconData(0xe22e,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "2f3ef6874c249b35c2d732bf49d97c9e", "score": "0.6223661", "text": "rotateLeft() {\n this.images[this.currentIndex].style.display = \"none\";\n this.images[this.currentIndex].classList.remove(\n \"animated\",\n \"slideInLeft\",\n \"slideInRight\",\n \"faster\"\n );\n if (this.currentIndex === 0) {\n this.currentIndex = this.images.length - 1;\n this.images[this.currentIndex].classList.add(\n \"animated\",\n \"slideInLeft\",\n \"faster\"\n );\n this.images[this.currentIndex].style.display = \"block\";\n } else {\n this.currentIndex -= 1;\n this.images[this.currentIndex].classList.add(\n \"animated\",\n \"slideInLeft\",\n \"faster\"\n );\n this.images[this.currentIndex].style.display = \"block\";\n }\n }", "title": "" }, { "docid": "e6c0b4d90060c07425819fb6a2a49b6f", "score": "0.61851376", "text": "get text_rotate_vertical () {\n return new IconData(0xe93b,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "76d31c97ab50c68f01b34ae681cafa29", "score": "0.6166601", "text": "getRotate(){\n if (String(this.state.rotateVal) !== '0') {\n return `rotate(${this.state.rotateVal}deg)`;\n }else { return ''; }\n }", "title": "" }, { "docid": "54a15a09aebf464a41c5b88c71cc4150", "score": "0.6163975", "text": "get text_rotation_none () {\n return new IconData(0xe93f,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "ee0a978155c3cf4e3cdfb62d16aa7f52", "score": "0.6155362", "text": "get swap_horizontal_circle () {\n return new IconData(0xe933,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "9164aa2beaf3ab30da8dc67e0c04c537", "score": "0.6155243", "text": "get camera_roll () {\n return new IconData(0xe3b3,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "9164aa2beaf3ab30da8dc67e0c04c537", "score": "0.6155243", "text": "get camera_roll () {\n return new IconData(0xe3b3,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "be49207bf2ecde07e970a0065b3bbae6", "score": "0.61437726", "text": "get format_align_right () {\n return new IconData(0xe237,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "539dc0b3070afb6a4deb39f76f3824d4", "score": "0.61363333", "text": "function rotateLeft(elapsedTime){\n rotation -= (turnrate * elapsedTime);\n rotationDegrees = Math.abs((rotation * (180/ Math.PI)));\n //WHY DOESN'T THIS UPDATE!\n if(rotationDegrees > 360){\n roation = 0;\n }\n }", "title": "" }, { "docid": "7c2a031ef0a8f698796cd1cf946c3d0d", "score": "0.6112325", "text": "get landscape () {\n return new IconData(0xe3f7,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "377509daabe56c8bd515a0a8819800cc", "score": "0.6099223", "text": "function createLeftArrow() {\r\n\r\n var rightArrow = createRightArrow();\r\n rightArrow.move({x: 95, y: 44});\r\n rightArrow.scale({\r\n x: -1,\r\n y: 1\r\n });\r\n var leftArrow = rightArrow;\r\n return leftArrow;\r\n}", "title": "" }, { "docid": "6eaa5c6d8544efb4f5e98144049457d3", "score": "0.6084341", "text": "get chevron_right () {\n return new IconData(0xe5cc, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "6eaa5c6d8544efb4f5e98144049457d3", "score": "0.6084341", "text": "get chevron_right () {\n return new IconData(0xe5cc, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "a866815ff368e9c9616f0aa3cf26b3fd", "score": "0.60756993", "text": "get keyboard_arrow_right () {\n return new IconData(0xe315,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "443c81837dfd9211468ca6b7d465301d", "score": "0.60372466", "text": "handleRotateToLeft() {\n const { currentRotation, currentZoom } = this.state\n let newRotation = currentRotation - 90\n if (newRotation === -90) {\n newRotation = 270\n }\n this.setState({\n currentRotation: newRotation,\n ...this._keepImageCenteredOnAction(currentZoom, newRotation),\n })\n }", "title": "" }, { "docid": "00bf6af3727f0a27c4d5c72b70e4d167", "score": "0.6012687", "text": "get arrow_forward () {\n return new IconData(0xe5c8, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "00bf6af3727f0a27c4d5c72b70e4d167", "score": "0.6012687", "text": "get arrow_forward () {\n return new IconData(0xe5c8, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "76a93a6888cbe22f639f5c1983c1c61d", "score": "0.5990029", "text": "function rotate(degrees) {\n \n return ' rotate(' + degrees + 'deg) ';\n\n}", "title": "" }, { "docid": "a85c7cb2f24739cba067528fa448dd30", "score": "0.5975614", "text": "get stay_primary_landscape () {\n return new IconData(0xe0d5,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "ba0a7f24c2b76f3b11dc32edac60ea2c", "score": "0.596475", "text": "function iconAnimationForward(){\n setNavRotate(state => ({\n ...state,\n value: 1,\n }));\n }", "title": "" }, { "docid": "bece38ec40eff2995f9c5a0289c9a4f9", "score": "0.5949322", "text": "get screen_lock_landscape () {\n return new IconData(0xe1be,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "3a5071727b4b6a0adb7ef785690a1157", "score": "0.58929247", "text": "function FaAngleDoubleLeft (props) {\n return GenIcon({\"tag\":\"svg\",\"attr\":{\"viewBox\":\"0 0 448 512\"},\"child\":[{\"tag\":\"path\",\"attr\":{\"d\":\"M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z\"}}]})(props);\n}", "title": "" }, { "docid": "2b3c18cc6585d8586d810658f3c4733b", "score": "0.5875986", "text": "get swap_horiz () {\n return new IconData(0xe8d4,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "f43fa82e82d1fdc16364a47ca1ac4251", "score": "0.5853241", "text": "get arrow_forward_ios () {\n return new IconData(0xe5e1, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "f43fa82e82d1fdc16364a47ca1ac4251", "score": "0.5853241", "text": "get arrow_forward_ios () {\n return new IconData(0xe5e1, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "bc74eead6bf4ca11cbc379649f73b4be", "score": "0.583981", "text": "function rotateArrow(angleRelatif){\n\n\t$(\"#arrow\").css({\n\t\t 'transform': 'rotate('+angleRelatif+'deg)',\n\t\t '-moz-transform': 'rotate('+angleRelatif+'deg)',\n\t\t '-o-transform': 'rotate('+angleRelatif+'deg)',\n\t\t '-webkit-transform': 'rotate('+angleRelatif+'deg)'\n\t})\n}", "title": "" }, { "docid": "97074d8bd1bbd07a93a96d61433a3fbf", "score": "0.58100796", "text": "rotate() {}", "title": "" }, { "docid": "64301110223086732e3602c5da91adde", "score": "0.5806007", "text": "rotateLeft(node) {\n if (!node.right) return;\n\n let temp = node.right; // temp var to prevent garbage collection\n node.right = temp.left; // set right connect to be left connection\n temp.left = node; // set temp left to node So temp has a right and left\n temp.color = node.color; // keep the attachment color(can only be black)\n node.color = RED; // set the new attachment to be red because this is the left\n return temp;\n }", "title": "" }, { "docid": "a38cdc984118879015392a8a9396eb81", "score": "0.5797216", "text": "get panorama_wide_angle () {\n return new IconData(0xe40f,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "e60384af63ce93fdc52a5380066bf6d8", "score": "0.57964873", "text": "rotateRight() {\n // spin 90\n this.degrees += 90;\n this.__img.style.transform = \"rotate(\" + this.degrees + \"deg)\";\n this.__img.toggleClass(\"top\");\n }", "title": "" }, { "docid": "c98f23c027b855c6b99616dcc4778ede", "score": "0.5790077", "text": "function turnLeft() {\n\t// \t\t\t\t\t\t [ W | S | E | N ]\n\t// orientation move from [ 3 | 2 | 1 | 0 ] then after 0 we take it back to 3 \n\tif (this.orientation == 0) {\n\t\tthis.orientation = 3;\n\t}\n\telse {\n\t\tthis.orientation -= 1\n\t}\n}", "title": "" }, { "docid": "1d80e7b17cb1a7a5f9430256d2b5d9d7", "score": "0.57784784", "text": "rotate() {\n this.angle += (((Math.PI * 2) / 360) * 1);\n }", "title": "" }, { "docid": "46f8d8ba962e4da5294837acabba213d", "score": "0.57605803", "text": "function spinMenuLeft()\r\n\t\t\t{\r\n\t\t\t if(!(interfaceLock))\r\n\t\t\t {\r\n\t\t\t jQuery(\"#roundrr_container\").roundrrwheel(\"prev\");\r\n\t\t\t }\t\t\t \r\n\t\t\t}", "title": "" }, { "docid": "1628e4bb0b6d7fa3aaaa1e5ecdceff8f", "score": "0.57433546", "text": "function turnLeft() {\n switch (orientation) {\n case \"N\":\n setOrientation(\"O\");\n\n break;\n case \"O\":\n setOrientation(\"S\");\n break;\n case \"S\":\n setOrientation(\"E\");\n break;\n case \"E\":\n setOrientation(\"N\");\n break;\n default:\n console.log(\"direction non valide\");\n break;\n }\n }", "title": "" }, { "docid": "c01ff2cf0a803d960ae89df9f484fc6f", "score": "0.57223535", "text": "function moveLeft() {\n viewer.controls.theta += PI2 / 12;\n }", "title": "" }, { "docid": "62a1f739eb667338bb0b658adec327fd", "score": "0.5715643", "text": "function LEFT() {\n var F = currentPosition.F;\n currentPosition.F = F <= 0 ? 270 : F - 90;\n}", "title": "" }, { "docid": "6fe256c90cca5a803ed1f98409cd0f3b", "score": "0.5713659", "text": "function rotate() {\n if(spaceLeft(currentTet) && spaceRight(currentTet)) {\n undraw();\n currentRotation ++;\n currentRotation = currentRotation%4;\n currentTet = tetArr[currType][currentRotation];\n draw();\n }\n}", "title": "" }, { "docid": "f4f3cede17be43bfeeb4ed00cc8bafc4", "score": "0.5708771", "text": "rotate() {\n this.rotateX(rotateX);\n this.rotateY(rotateY)\n }", "title": "" }, { "docid": "b823497124a4874810eceab745b7dfa3", "score": "0.5707186", "text": "get subdirectory_arrow_right () {\n return new IconData(0xe5da,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "3be483758a89b82596513d07086f2b03", "score": "0.5705162", "text": "left(){if(!this.facing)return false;let degree=(0,_FacingUtils.getFacingDegree)(this.facing);degree-=90;this.facing=(0,_FacingUtils.getFacingOptions)(degree);return true;}", "title": "" }, { "docid": "1eea8862ab0557dd47d1bc8f8f0a78c9", "score": "0.5696515", "text": "function rotateIcon() {\r\n\tif(!document.getElementById('overlay').hasChildNodes()){\r\n\t\tdisableScroll();\r\n\t\tvar angle=0;\r\n\t\tvar rotate = setInterval(function(){\r\n\t\t\tif(angle==200){\r\n\t\t\t\tclearInterval(rotate);\r\n\t\t\t}else{\t\t\t\r\n\t\t\t\tangle++;\r\n\t\t\t\tdocument.getElementById(\"smallGearAni\").style.transform = \"rotate(\"+angle+\"deg)\";\r\n\t\t\t\tdocument.getElementById(\"largeGearAni\").style.transform = \"rotate(\"+(-angle)+\"deg)\";\r\n\t\t\t\tif(angle==100){\r\n\t\t\t\t\tmenuOpen();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},10);\r\n\t}else{\r\n\t\tvar angle=200;\r\n\t\tvar rotate = setInterval(function(){\r\n\t\t\tif(angle==00){\r\n\t\t\t\tclearInterval(rotate);\r\n\t\t\t}else{\t\t\t\r\n\t\t\t\tangle--;\r\n\t\t\t\tdocument.getElementById(\"smallGearAni\").style.transform = \"rotate(\"+angle+\"deg)\";\r\n\t\t\t\tdocument.getElementById(\"largeGearAni\").style.transform = \"rotate(\"+(-angle)+\"deg)\";\r\n\t\t\t\tif(angle==100){\r\n\t\t\t\t\tmenuClose();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},10);\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "5a900b522ec82d74d5eadd3744eeb410", "score": "0.56936026", "text": "get format_textdirection_r_to_l () {\n return new IconData(0xe248,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "6ae5e89e131607cfa21f924e928ee5f6", "score": "0.5692558", "text": "function MoveLeft()\n {\n return MoveTetramino(Progress.CurrentAnchor.x-1, Progress.CurrentAnchor.y);\n }", "title": "" }, { "docid": "143ce8b4859aa06ab72cdbc8bb6b4b2b", "score": "0.56891704", "text": "get play_arrow () {\n return new IconData(0xe037,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "6d2bc2eda9399ab55cb4a514c25796be", "score": "0.5686443", "text": "get navigate_before () {\n return new IconData(0xe408, {fontFamily: 'MaterialIcons', matchTextDirection: true});\n }", "title": "" }, { "docid": "a09bcf03f0605bf8dcef08958f962efd", "score": "0.56716543", "text": "get phone_locked () {\n return new IconData(0xe61e,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "151a4c5c7701e662891dc930bf3f18a2", "score": "0.566979", "text": "get format_textdirection_l_to_r () {\n return new IconData(0xe247,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "70c614c6164fb1f7db37fe8b7dd7d7d9", "score": "0.56571263", "text": "get straighten () {\n return new IconData(0xe41c,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "5c9a22564b2b67ded2932025b3504aa1", "score": "0.5656074", "text": "get lock_open () {\n return new IconData(0xe898,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "a2475bd21eb74794e2e9761277ae2caf", "score": "0.5655521", "text": "_rotateLeft(node) {\n const child = node.right;\n\n if (node === RBTNode.sentinel) {\n throw new Error('Cannot rotate a sentinel node');\n } else if (child === RBTNode.sentinel) {\n throw new Error('Cannot rotate away from a sentinel node');\n }\n\n // turn child's left subtree into node's right subtree\n node.right = child.left;\n if (child.left !== RBTNode.sentinel) {\n child.left.parent = node;\n }\n\n // link node's parent to child\n child.parent = node.parent;\n if (node === this._root) {\n this._root = child;\n } else if (node === node.parent.left) {\n node.parent.left = child;\n } else {\n node.parent.right = child;\n }\n\n // put node on child's left\n child.left = node;\n node.parent = child;\n\n // LOOK AT ME\n // I'M THE PARENT NOW\n }", "title": "" }, { "docid": "33ee132e7244e47f5bc274dffd5ff309", "score": "0.56511116", "text": "function RotateLeft(lValue, iShiftBits) {\n return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));\n }", "title": "" }, { "docid": "d491300f14652fd5acafcf75c49f062d", "score": "0.5644129", "text": "function resetNextAngle(id_image) {\n nextAngle = 0;\n //rotate right image 0 degree\n // rotateRight(id_image, 0);\n}", "title": "" }, { "docid": "a504f2db0bc375fa8c4a392a353a14ad", "score": "0.5641158", "text": "getButtonAlignLeft() {\n return new Button(\n 'align-left',\n '<i class=\"fa fa-align-left\"></i>',\n (button, event) => this.actionAlignLeft(button, event),\n ).build();\n }", "title": "" }, { "docid": "9ad5ed9344142da50d715917ce33e6b9", "score": "0.56378365", "text": "get accessible_forward () {\n return new IconData(0xe934,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "9ad5ed9344142da50d715917ce33e6b9", "score": "0.56378365", "text": "get accessible_forward () {\n return new IconData(0xe934,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "b8739b66c5dc555f82efa8efc6c5ac3f", "score": "0.5620295", "text": "get fast_forward () {\n return new IconData(0xe01f,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "a0d39d9cd36747b069d05f1a393fb037", "score": "0.56071454", "text": "_renderLeftNav() {\n\t\treturn (\n\t\t\t<View style={styles.leftButtonContainer}>\n\t\t\t\t<FontAwesome\n\t\t\t\t\tname=\"bars\"\n\t\t\t\t\tsize={26}\n\t\t\t\t\tcolor=\"#fff\"\n\t\t\t\t\tstyle={styles.rightIcons}\n\t\t\t\t\tonPress={() => this.props.toggleSideMenu()} />\n\t\t\t\t<Image source={logoImg} style={styles.logoImage} />\n\t\t\t</View>\n\t\t)\n\t}", "title": "" }, { "docid": "24eb72cff058233ae64d787fcd7341ef", "score": "0.5601822", "text": "function openfirstcontent(){\n firstLink.style.textDecoration = \"underline\";\n iconcontent1.style.display = \"block\";\n icon1.style.transform = \"rotate(180deg)\";\n \n}", "title": "" }, { "docid": "cc521dcd5c516fe6c8328f024322ec99", "score": "0.5601506", "text": "get compare_arrows () {\n return new IconData(0xe915,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "cc521dcd5c516fe6c8328f024322ec99", "score": "0.5601506", "text": "get compare_arrows () {\n return new IconData(0xe915,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "2ef797f940683749d59063465c75e4dd", "score": "0.5592154", "text": "function genULArrow(x, y, css)\n{\n var s = genDLArrow(x, y, css);\n s.firstChild.setAttribute(\"transform\", \"rotate(90 \" + 8 + \" \" + 8 + \")\");\n return s;\n}", "title": "" }, { "docid": "fa7572af8ead1207d3316bb985ae615e", "score": "0.55782616", "text": "get arrow_upward () {\n return new IconData(0xe5d8,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "fa7572af8ead1207d3316bb985ae615e", "score": "0.55782616", "text": "get arrow_upward () {\n return new IconData(0xe5d8,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "29255b672d48439d13fde8902cfc5327", "score": "0.5573349", "text": "rotateLeft(node) {\n let right = node.right;\n if (this.isLeaf(right)) {\n throw new Error('rotateLeft can\\'t be performed. The tree is corrupted');\n }\n this.replaceNode(node, right);\n\n node.right = right.left;\n if (right.left !== null) {\n right.left.parent = node;\n }\n\n right.left = node;\n node.parent = right;\n }", "title": "" }, { "docid": "0a913fa8627fc6a286773a2e0f9bbb5c", "score": "0.5564324", "text": "function left(angle) {\n turtle.angle -= degToRad(angle);\n drawIf();\n}", "title": "" }, { "docid": "5006d8f7453e41e6069cede5ec69acbb", "score": "0.556196", "text": "get arrow_downward () {\n return new IconData(0xe5db,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "5006d8f7453e41e6069cede5ec69acbb", "score": "0.556196", "text": "get arrow_downward () {\n return new IconData(0xe5db,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "18fd021dc9d3bbf7f0eb792c607bb63a", "score": "0.5560916", "text": "function startRotate(e) {\n // Exit if the shift key wasn't held down when the mouse button was pressed\n if (!e.shiftKey) return;\n // Track the image that we're going to rotate\n imageBeingRotated = this;\n // Store the angle of the mouse at the start of the rotation, relative to the image centre\n var imageCentre = getImageCentre(imageBeingRotated);\n var mouseStartXFromCentre = e.pageX - imageCentre[0];\n var mouseStartYFromCentre = e.pageY - imageCentre[1];\n mouseStartAngle = Math.atan2(mouseStartYFromCentre, mouseStartXFromCentre);\n // Store the current rotation angle of the image at the start of the rotation\n imageStartAngle = $(imageBeingRotated).data('currentRotation');\n // Set up an event handler to rotate the image as the mouse is moved\n $(document).mousemove(rotateImage);\n return false;\n}", "title": "" }, { "docid": "c5f648ad508756669e24cbdf95dfbd3c", "score": "0.55537087", "text": "get transform () {\n return new IconData(0xe428,{fontFamily:'MaterialIcons'})\n }", "title": "" }, { "docid": "a0066c15341a1ca2381491c5f1843e02", "score": "0.5543249", "text": "function left_icon()\r\n\t\t\t{\r\n\t\r\n\t\t\t\tif($('.right-pane').css('display')=='block')\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.right_icon_main').addClass('only_icon');\r\n\t\t\t\t\t\t$('.right_icon_main').removeClass('icon_descri');\r\n\t\t\t\t\t\t$('.thum_view_middle').css('margin-right','91')\r\n\t\t\t\t\t\t$('.thum_view_middle').addClass('for_margin');\r\n\t\t\t\t\t\t$('.middle-pane').addClass('cover_space');\r\n $('.only_left_icon').removeClass('hide_left');\r\n\t\t\t\t\t\t $('.thum_view_middle').removeClass('new_width');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t$('.right_icon_main').removeClass('only_icon');\r\n\t\t\t\t\t$('.right_icon_main').addClass('icon_descri');\r\n\t\t\t\t\t$('.thum_view_middle').removeClass('for_margin');\r\n\t\t\t\t\t$('.middle-pane').removeClass('cover_space');\r\n\t\t\t\t\t $('.only_left_icon').removeClass('hide_left');\r\n\t\t\t\t\t $('.thum_view_middle').addClass('new_width');\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\t}", "title": "" }, { "docid": "23f5e0f6ae4612a5e327f25aaf4dd917", "score": "0.55376583", "text": "get crop_landscape () {\n return new IconData(0xe3c3,{fontFamily:'MaterialIcons'})\n }", "title": "" } ]
15d6ec9c88f7709501ee1c34e6b122d0
Write function RemoveExclamationMarks which removes all exclamation marks from a given string. / Write function RemoveExclamationMarks which removes all exclamation marks from a given string.
[ { "docid": "69c97de8d45f13eb569cf5bbc8d09dbe", "score": "0.80554163", "text": "function removeExclamationMarks(s) {\n s = s.split('');\n for (let i = 0; i < s.length; i++) {\n if (s[i] === '!') {\n s[i] = '';\n }\n }\n return s.join('');\n}", "title": "" } ]
[ { "docid": "8eadbad5450225370ba1a69f2095a274", "score": "0.7704371", "text": "function removeExclamationMarks(s) {\n // check if it includes \"!\" \n \n if(s.includes('!')){\n // if it is true remove '!'\n s = s.replace(/!/g, '')\n } \n return s\n \n \n}", "title": "" }, { "docid": "8d11ef2d40d1ae2b393fec3cf12c5a1f", "score": "0.7663207", "text": "function removeExclamationMarks(s) {\n const result = Array.from(s).filter((element) => {\n return element !== '!';\n });\n return result.join('');\n}", "title": "" }, { "docid": "2e657119ee259f826ba3584a0db41d60", "score": "0.75785524", "text": "function removeExclamation(s) {\n return s.replace(/\\b!+/g, '');\n}", "title": "" }, { "docid": "f48b9be990cc8af86fd49a7bfeea081b", "score": "0.62597865", "text": "function remove(s){\nreturn s = s.replace(/!+$/gm, '');\n}", "title": "" }, { "docid": "023a97a003c712f50325c185914bd998", "score": "0.6222121", "text": "function remove(s){\r\n //coding and coding....\r\n let newStr = '';\r\n let excl = '';\r\n let res = '';\r\n for(let i = 0; i < s.length; i++) {\r\n if(s[i] === '!') {\r\n // excl = s.slice(s[i], s[i+1]);\r\n // console.log(excl);\r\n // newStr += excl;\r\n // console.log(newStr);\r\n excl += s[i];\r\n //console.log(s[i]);\r\n s = s.replace(s[i], '');\r\n\r\n }\r\n\r\n }\r\n console.log(excl);\r\n console.log(s);\r\n res = s.concat(excl);\r\n return res;\r\n}", "title": "" }, { "docid": "6ca86523c6c499f0626daedf171e1ab4", "score": "0.6144242", "text": "function remove(s){\n return `${s.replace(/\\!/g, \"\")}!`\n}", "title": "" }, { "docid": "14a5739fceaeb38dccca820620a9fa84", "score": "0.58703434", "text": "function remove(s,n){\n while(n) {\n s = s.replace(\"!\", \"\");\n n--;\n }\n return s;\n }", "title": "" }, { "docid": "27aa34fc665e01dcb5eda1652c7a553c", "score": "0.5857122", "text": "function exCharRemoval(stringy) {\n\tfor (var n = 0; n < 2; n++) {\n\t\tstringy = stringy.replace(/([~\\`\\^\\*\\[\\]\\\\';,\\/{}|\\\\\":<>])/g, \"\");\n\t\tstringy = stringy.replace(/(\\r\\n|\\n|\\r|\\s+)/gi, \" \").trim();\t\n\t}\n\treturn stringy;\n}", "title": "" }, { "docid": "53775170e1b38fe14ff5db5836478152", "score": "0.5819822", "text": "function remove(s) {\n let arr = s.split(\"\");\n\n for (char of arr) {\n if (arr[arr.length - 1] === \"!\") {\n arr.pop();\n }\n }\n return arr.join(\"\");\n}", "title": "" }, { "docid": "49ddb840fd882062c2102c2aa7e587fc", "score": "0.5808994", "text": "function remove(s) {\n var sSplit = s.split(' ');\n var output = [];\n var bangCount = 0;\n for (var i=0; i<sSplit.length; i++) {\n for (var a=0; a<sSplit[i].length; a++) {\n if (sSplit[i][a] === '!') {\n bangCount++;\n }\n }\n if (bangCount === 0 || bangCount > 1) {\n bangCount = 0;\n output.push(sSplit[i]);\n } else if (bangCount === 1) {\n bangCount = 0;\n }\n }\n return output.join(' ');\n}", "title": "" }, { "docid": "fa6dba33fb43108f59fa3bc905f35645", "score": "0.57789147", "text": "function removeTwo(s){\r\n // let res = '';\r\n // let newS = s.replace(/!/g, '');\r\n // console.log(newS);\r\n // res = newS + '!';\r\n // return res;\r\n\r\n return s.replace(/!/g, '') + '!';\r\n}", "title": "" }, { "docid": "6f4fcde7d0b975ce1a84982803dc6a5a", "score": "0.5769593", "text": "function remove(s, n) {\n for (var i = 0; i < n; i++) {\n s = s.replace(\"!\", \"\");\n }\n console.log(s);\n return s;\n}", "title": "" }, { "docid": "9903222d02a72c3ad3c1bc71f87efedb", "score": "0.5646585", "text": "function clearIgnores(input) {\n let ignoring = false;\n return input.split('').reduce((acc, char) => {\n if (ignoring) ignoring = false; \n else if (char == '!') ignoring = true;\n else acc.push(char);\n return acc;\n }, []).join('');\n}", "title": "" }, { "docid": "a28f33aaecab09740dc9f87b6ce408f5", "score": "0.56046057", "text": "function remove(s,n){\n // initialize loop with for and add condition (i<n)\n // and replace string value \"!\" with \"empty string\"\n // that many times \n // This assumes the operation will be done from \n // left to right \n for (var i=0;i<n;i++) s=s.replace(\"!\",\"\");\n return s;\n }", "title": "" }, { "docid": "849a4a1d09b8487da32ba39f4ed811bb", "score": "0.5510804", "text": "function remove(s,n){\n return s.split('').reduce((r, e, i)=>{\n if(e !== \"!\"){\n r.push(e)\n }else if(e=== \"!\" && n > 0){\n n--\n }else{\n r.push(e)\n }\n return r\n }, []).join('')\n }", "title": "" }, { "docid": "39a9385a216b951a47a95ba6202666a8", "score": "0.5417565", "text": "function remove(s, n) {\n let removed = 0;\n let stringArr = s.split(\"\");\n\n for (let i = 0; removed < n; i++) {\n if (i > stringArr.length) {\n break;\n }\n if (stringArr[i] === \"!\") {\n stringArr.splice(i, 1);\n i--;\n removed++;\n }\n continue;\n }\n return stringArr.join(\"\");\n}", "title": "" }, { "docid": "f2896702908f4f9d4736e2c9857b0e48", "score": "0.5394373", "text": "function removeNoise(str){\n\treturn str.replace(/[%$&/#·@|º\\\\ª]/g, '');\n}", "title": "" }, { "docid": "0337c5259391a313a35e6fa45b8cd8ca", "score": "0.5358641", "text": "function cleanEquation(string)\n\t{\n\t\t// String can be null -- safety code\n\t\tif (!string)\n\t\t\treturn \"\";\n\n\t\t// Call global MathML cleanup. After this, the rest is problem-specific.\n\t\tstring = app.deitalicize(string);\n\t\tstring = app.cleanMML(string);\n\t\tstring = app.convertMinus(string);\n\n\t\t// @FIXME/dg: Clean up after a problem editor bug. This really doesn't belong here.\n\t\t// It also isn't helping.\n\t\tvar regex = /<mtext>(\\s*<mn>.+?\\s*<\\/mn>\\s*)<\\/mtext>/g;\n\t\tstring = string.replace(regex, '$1');\n\n\t\t// Remove display:block from MathML\n\t\tregex = /(<math[^>]*)display=[\"']block[\"']/g;\n\t\tstring = string.replace(regex, '$1');\n\n\t\treturn string;\n\t}", "title": "" }, { "docid": "61246a4f69738c8a75a41fcc05d0d6fe", "score": "0.52702564", "text": "function removePunctuationMarks(text) {\n\tvar cleanText = text.replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-`~()]/g, \" \").replace(/\\s+/g, \" \");\n\treturn cleanText.trim();\n}", "title": "" }, { "docid": "aeceb27a8ded55b13ec355b641cd7535", "score": "0.5231471", "text": "function replace(s) {\n console.log(s.replace(/[aeoiu]/gi, \"!\"));\n return s.replace(/[aeoiu]/gi, \"!\");\n}", "title": "" }, { "docid": "6ad3783ff681b3980a22f1c28962f32f", "score": "0.5138344", "text": "function eliminarcaracteres(stringToReplace){\n var specialChars = \"!@$^&%*()+=-[]{}|<>?,.\";\n for (var i = 0; i < specialChars.length; i++) {\n stringToReplace = stringToReplace.replace(new RegExp(\"\\\\\" + specialChars[i], 'g'), '');\n }\n\n stringToReplace=stringToReplace.replace(new RegExp(\"[0-9]\", \"g\"), \"\");\n\n return stringToReplace;\n}", "title": "" }, { "docid": "e36235674e6f969b1963b695fdac6e1a", "score": "0.5124045", "text": "setExclamationMark() {\n const activeQuestCell = document.querySelector('.active_quest');\n const table = document.querySelector('table');\n const upperCell = table.rows[activeQuestCell.parentElement.rowIndex - 1].cells[activeQuestCell.cellIndex];\n const previousExclamationMark = document.querySelector('.exclamation_mark');\n\n if (previousExclamationMark) previousExclamationMark.classList.remove('exclamation_mark');\n if (activeQuestCell) upperCell.classList.add('exclamation_mark');\n }", "title": "" }, { "docid": "6838aa72848e8046981348e2cf9a9455", "score": "0.50645673", "text": "function remove(s, n) {\n return s.replace(/!/g, c => n-- > 0 ? \"\" : c)\n }", "title": "" }, { "docid": "f9831f4c0eb55ba26d3b2d422a4a2690", "score": "0.50621426", "text": "function removePunctuation(message){\n\t//',;.?!:'\n\tmessage = message.replace(\",\",\"\");\n\tmessage = message.replace(\";\",\"\");\n\tmessage = message.replace(\".\",\"\");\n\tmessage = message.replace(\"?\",\"\");\n\tmessage = message.replace(\"!\",\"\");\n\tmessage = message.replace(\":\",\"\");\n\t\n\t\n\treturn message;\n}", "title": "" }, { "docid": "731940621feeeb44655ac615ec13c3e9", "score": "0.5061001", "text": "function erase(string, startMarker, endMarker) {\n let start = string.indexOf(startMarker)\n let end = string.indexOf(endMarker)\n let toBeErased = string.substring(start, end + endMarker.length)\n\n return string = string.replace(toBeErased, \"\")\n}", "title": "" }, { "docid": "db1c727701e3badba74f654f3ecb2057", "score": "0.5050782", "text": "_removeUnwantedChars(htmlString) {\n\t\tconst partialsRegExp = new RegExp(/({{>)([^}]+)(}})/, 'g')\n\t\t,\tcommentRegExp = new RegExp(/({{!--)((?!--}})[\\s\\S])*(--}})/, 'g')\n\t\t// ,\totherRegExp = new RegExp(/({{)(#|\\/)[^}]+(}})/, 'g')\n\t\t// ,\totherRegExp = new RegExp(/({{)(#)[^}]+(}})(((?!{{\\/)[\\s\\S])*)({{)(\\/)[^}]+(}})/, 'g')\n\t\t,\thandlebarRegExp = new RegExp(/({{(#|\\/)(if|each|with))([^}]*)(}})/, 'g')\n\t\t,\tremoveLinebreaks = new RegExp(/\\r?\\n|\\r/, 'g')\n\t\t,\tnbspRX = new RegExp(/&nbsp;/, 'g');\n\n\t\t// removes linebreaks and multiple whitespaces\n\t\thtmlString = htmlString.replace(removeLinebreaks, ' ').replace(/[\\s]+/g, ' ');\n\n\t\treturn htmlString.replace(partialsRegExp, '')\n\t\t\t\t.replace(commentRegExp, '')\n\t\t\t\t.replace(handlebarRegExp, '')\n\t\t\t\t.replace(nbspRX, ' ');\n\t}", "title": "" }, { "docid": "33dbf47b96058248020a197803e0df86", "score": "0.50298923", "text": "function hide(email){\n\tvar ind = email.indexOf(\"_\");\n\tvar ind2 = email.indexOf(\"@\");\n\tvar dif = ind2 - ind;\n\tvar remove = email.substr(ind, dif);\n\tvar result = email.replace(remove, \"...\");\n\tconsole.log(result);\n}", "title": "" }, { "docid": "1b4e8f06fbe6e525dbf7cf64b433955f", "score": "0.4963896", "text": "function stripscript(s) {\n\t// use regex to prevent some danger word in the message.\n\tvar pattern = new RegExp(\"[`~!@#$^&*()=|{}':;',\\\\[\\\\].<>/?~!@#¥……&*()&mdash;—|{}【】‘;:”“'。,、?]\");\n\tvar rs = \"\"; \n\tfor (var i = 0; i < s.length; i++) { \n\t\trs = rs + s.substr(i, 1).replace(pattern, ''); \n\t}\n\treturn rs;\n}", "title": "" }, { "docid": "96cbe6f6383b138810ba4830a06be8da", "score": "0.49111846", "text": "function addExclamation(message, num) {\n console.log(message, \"!!!\", 100);\n\n var results = num * 2;\n console.log(results);\n}", "title": "" }, { "docid": "df5ea369dc87d66e1e62cfb542b28635", "score": "0.48962754", "text": "function remove_after_special(input_array) {\r\n\tfor (var i = 0; i < input_array.length; i++) {\r\n\t\tvar match = /[!@#$%^&*()_+=\\[\\]{};':\"\\\\|,.<>\\/?]/.exec(input_array[i]);\r\n\t\tif (match) {\r\n\t\t\tinput_array[i] = input_array[i].substring(0, match.index);\r\n\t\t}\r\n\t}\r\n\treturn input_array;\r\n}", "title": "" }, { "docid": "53908e92a6c94777d54649fa1dfeac66", "score": "0.4890474", "text": "function trimServerMarkup(expression, ignorePoundSigns)\n{\n var retVal = expression.toString();\n\n var exp1 = /<cfoutput[^>]*>/gi;\n var exp2 = /<\\/cfoutput[^>]*>/gi;\n\n retVal = retVal.replace(exp1,\"\");\n retVal = retVal.replace(exp2,\"\");\n\n if (!ignorePoundSigns)\n {\n // search for the starting and closing pound signs\n // need to handle pound signs escaped with double pounds\n\n var beginindex = retVal.indexOf(\"#\");\n while (beginindex != -1)\n {\n if (beginindex+1 >= retVal.length || retVal.charAt(beginindex+1) != \"#\")\n {\n break;\n }\n beginindex = retVal.indexOf(\"#\", beginindex+2);\n }\n if (beginindex != -1)\n {\n var endindex = retVal.indexOf(\"#\", beginindex+1);\n while (endindex != -1)\n {\n if (endindex+1 >= retVal.length || retVal.charAt(endindex+1) != \"#\")\n {\n break;\n }\n endindex = retVal.indexOf(\"#\", endindex+2);\n }\n if (beginindex != -1 && endindex != -1)\n {\n retVal = retVal.substring(beginindex+1,endindex);\n }\n }\n }\n\n retVal = dwscripts.trim(retVal);\n\n return retVal;\n}", "title": "" }, { "docid": "cbdbf43d614fe21f68b49e8ec3d97e73", "score": "0.48844707", "text": "function clean(string){\n return string.trim()\n .replace(/_x000D_\\n/g, '')\n .replace(/\\r*\\n+/g, '');\n}", "title": "" }, { "docid": "2683c84eb916da92f35e81225e767a86", "score": "0.4880517", "text": "function stopShouting(message) {\nreturn capitalizeSentence(message.toLowerCase()).replace(/!+/g, '.');\n}", "title": "" }, { "docid": "54f7c5568c40df2b9b7b222787c37431", "score": "0.48280576", "text": "function removeSpecials() {\n var lower = str.toLowerCase();\n var upper = str.toUpperCase();\n\n var res = \"\";\n for(var i = 0; i < lower.length; ++i) {\n // if a character is equal uppercase and lowercase then it is a special character\n // exception made for spaces\n if(lower[i] != upper[i] || lower[i].trim() === '')\n res += str[i];\n else\n res += ' ';\n }\n\n return res;\n }", "title": "" }, { "docid": "d1fbcff74afbde53c9f517506c14e2d7", "score": "0.48141122", "text": "function hideEmail(email) {\n var newString = \"\";\n var newString1 = \"\";\n var p = \"@\";\n\n for (var i = 0; i < email.length; i++) {\n if (email[i] === p) {\n var index = i;\n }\n }\n for (var j = 0; j < email.length; j++) {\n if (j < 3) {\n newString += email[j];\n\n } else if (j > index - 1) {\n newString1 += email[j];\n }\n }\n return newString + \"...\" + newString1;\n}", "title": "" }, { "docid": "6eb292d100c420a22f8e58e9bcf7f3aa", "score": "0.479969", "text": "function maskify(string) {\n if (string.length < 5) {\n return string;\n }\n var array = string.split(\"\");\n for (var i = 0; i < array.length - 4; i++) {\n array[i] = \"#\";\n }\n string = array.join(\"\");\n return string;\n}", "title": "" }, { "docid": "bd35fb1479b8939717cf519ef002716a", "score": "0.47950825", "text": "function hideEmail(email){\n var domain = email.split('@');\n return domain[0].slice(0,3) + \".....\" + '@' + domain[1].toString(); \n }", "title": "" }, { "docid": "f6fa625f47b972cde187ad56721474bc", "score": "0.479058", "text": "function stopShouting(message) {\n return capitalizeSentence(message.toLowerCase()).replace(/!+/g, '.');\n}", "title": "" }, { "docid": "971845bebfded180241159d0204208ae", "score": "0.47674257", "text": "function clearString(str)\r\n{\r\n\tvar newstr = str.replace(/^\\s+|\\s+$/g,\"\");\r\n\treturn newstr.replace(/\\&amp;/g,'&');\r\n}", "title": "" }, { "docid": "0141c977c8ad5d8ae4fcf8a17ab7a0e0", "score": "0.47651556", "text": "function searchCleaner(string) {\n return string.toLowerCase().replace(/[<>#!$%^&*(),.\\[\\]\\\"@\\'\\s]/gi, '');\n}", "title": "" }, { "docid": "065570ed68279751c19f867cca581045", "score": "0.4737809", "text": "function removeCharacters(str, ignore) {\n let ansStr = '';\n let add = true;\n\n for (let i = 0; i < str.length; i++) {\n for (let j = 0; j < ignore.length; j++) {\n if (str[i] === ignore[j]) {\n add = false;\n } \n }\n \n if (add) {\n ansStr += str[i]\n }\n\n add = true;\n\n }\n\n return ansStr;\n}", "title": "" }, { "docid": "57a3a27f24010f5c69fc2c17cf8b6cc3", "score": "0.47115865", "text": "function StripStringOfVulnerableChars(sString,bStripSpaces)\r\n{\r\n\t\r\n\tvar s = sString.replace(/'/g,\"\"); \t// remove tics from string\r\n\ts = s.replace(/;/g,\"\"); \t\t\t// remove semicolons from string\r\n\ts = s.replace(/\\(/g,\"\"); \t\t\t// remove lefts paren from string\r\n\ts = s.replace(/\\)/g,\"\"); \t\t\t// remove right parens from string\r\n\ts = s.replace(/\\*/g,\"\"); \t\t\t// remove asterisk from string\r\n\ts = s.replace(/\"/g,\"\"); \t\t\t// remove double quotes from string\r\n\ts = s.replace(/--/g,\"\"); \t\t\t// remove double dash from string\r\n\ts = s.replace(/=/g,\"\"); \t\t\t// remove equal signs from string\r\n\r\n\t//s = s.replace(/#/g,\"\"); \t\t\t// remove pound signs from string\r\n\tif (bStripSpaces)\r\n\t{\r\n\t\ts = s.replace(/ /g,\"\"); \t\t// remove spaces from string\r\n\t}\r\n\treturn s;\r\n}", "title": "" }, { "docid": "6662f7d8619be25dd6fdbeaed554678f", "score": "0.47114393", "text": "function emailReplace() {\n var dot = \".\"\n var position = str.indexOf(\"@\");\n newstr = str.substr(0, 3).concat(dot.repeat(position - 3), str.substring(position));\n return newstr;\n}", "title": "" }, { "docid": "eedfb84875ba9090fdc9d1199fd1f18e", "score": "0.46999273", "text": "function punctuationless(stringToStrip) {\n return stringToStrip.replace(/[^A-z0-9_]/g,\"\");\n}", "title": "" }, { "docid": "f986ae191f653960664c99c6779fbb5d", "score": "0.4698755", "text": "function removeChars(stringers1) {\n\tif (stringers1.includes('-')){\n\t\tstringers1 = stringers1.replace('-', '');\n\t}\n\tif (stringers1.includes('\\'')){\n\t\tstringers1 = stringers1.replace('\\'', '');\n\t}\n\tif (stringers1.includes('.')){\n\t\tstringers1 = stringers1.replace('.', '');\n\t}\n\treturn stringers1;\n}", "title": "" }, { "docid": "e63cc8da21ca7ba5c58064fa6a94d3f7", "score": "0.46974972", "text": "function hideEmail(string) {\n var newString = '';\n var newString2 = '';\n var index;\n for(var i = 0; i < string.length; i++) {\n if(i < 3) {\n newString += string[i];\n }\n if(string[i] === '@') {\n index = i;\n }\n if(index) {\n newString2 += string[i];\n }\n }\n return newString + '...' + newString2\n}", "title": "" }, { "docid": "25171a60eab72c9697211aeda068d946", "score": "0.46922407", "text": "function clean(text) {\r\n if (typeof(text) === \"string\")\r\n return text.replace(/`/g, \"`\" + String.fromCharCode(8203)).replace(/@/g, \"@\" + String.fromCharCode(8203));\r\n else\r\n return text;\r\n}", "title": "" }, { "docid": "f3fb2d22d6636213ea1830da8975b336", "score": "0.46848404", "text": "function sanitize(aStr) {\n let unprintableRE = new RegExp(\"[\\\\x00-\\\\x1F\\\\x7F]\" ,\"gi\");\n return aStr.replace(unprintableRE, \"\");\n}", "title": "" }, { "docid": "75d596b7d1e0367b264915d2e9497140", "score": "0.46787772", "text": "function maskify(str) {\n var strToArray = str.split('');\n for(var i = 0; i < str.length-4; i++){\n strToArray.splice(i,1,'#');\n }\n return strToArray.join('');\n}", "title": "" }, { "docid": "9971d70d8b4e8e0f675621e379935c93", "score": "0.46776897", "text": "function clean(text) {\r\n\tif (typeof(text) === \"string\")\r\n\t\treturn text.replace(/`/g, \"`\" + String.fromCharCode(8203)).replace(/@/g, \"@\" + String.fromCharCode(8203));\r\n\telse\r\n\t\treturn text;\r\n}", "title": "" }, { "docid": "8dce98335f60e8a97fde2fbb299035f6", "score": "0.46734267", "text": "function clearDot(number) {\n output = number.replace(\".\", \"\");\n return output;\n}", "title": "" }, { "docid": "6c9b06d5df143654dd8291a36b785217", "score": "0.46678552", "text": "cleanString (string,illegalChars){\n let baseIllegalChars = '<>()+';\n let regex = null;\n let cleanedString = '';\n if(typeof illegalChars === 'string'){\n\n }\n else if(Array.isArray(illegalChars)){\n\n }\n\n regex = new RegExp(`[${baseIllegalChars}]`);\n return cleanedString.replace(regex,'');\n }", "title": "" }, { "docid": "c76738933b29168fc7e02407acfe871a", "score": "0.46647632", "text": "function clearString(string) {\n return string.replace(/['\"]+/g, '');\n}", "title": "" }, { "docid": "075ed27c7934b7da882d4ac7498b13da", "score": "0.46627828", "text": "function socSanitize(x){ \n if (typeof x != 'string')\n x += \"\";\n return x.replace('-','');\n}", "title": "" }, { "docid": "b576e3e2f98a94bbee43086b9614387c", "score": "0.46589404", "text": "function removeSpecialChars(stHTML){\n\tstHTML = stHTML.replace(new RegExp(\"&amp;\", 'g'), \"ampamp;\"); ////preserve the &amp; (char of '&') by changing to a special word; or the & will be modified\n\tstHTML = stHTML.replace(new RegExp(\" & \", 'g'), \" and \");\n\tstHTML = stHTML.replace(new RegExp(\"&\", 'g'), \"&amp;\");\n\tstHTML = stHTML.replace(new RegExp(\"ampamp;\", 'g'), \"&amp;\"); ////recover the &amp;\n\tstHTML = stHTML.replace(new RegExp(\"&nbsp;\", 'g'), \"\");\n\tstHTML = stHTML.replace(new RegExp(\"&amp;nbsp;\", 'g'), \"\");\n\treturn stHTML;\n}", "title": "" }, { "docid": "63dab2f5e87a0b83c13c3c38e3da083a", "score": "0.46468872", "text": "function filtroemail(string) {\n var out = '';\n var filtro = 'abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑ[email protected]'; //Caracteres validos\n for (var i = 0; i < string.length; i++) {\n if (filtro.indexOf(string.charAt(i)) != -1) {\n out += string.charAt(i);\n } else {\n charRemoveAt(string, i);\n }\n }\n return out;\n}", "title": "" }, { "docid": "17df3fcb638ec1a7a5ad19405f97f4f5", "score": "0.46455777", "text": "function removePunctuation(str) {\n return str.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g, \"\");\n}", "title": "" }, { "docid": "9ecfe6b81318d14f93de03b06dffb089", "score": "0.46435726", "text": "function removeEllipses(str) {\n return str.replace(/(…)|(\\.\\.\\.)/g, \"\");\n }", "title": "" }, { "docid": "a61a620f138373a9247a026ce5a24364", "score": "0.464352", "text": "function stopShouting(message) {\n return capitalizeSentence(message.toLowerCase()).replace(/!+/g, \".\");\n}", "title": "" }, { "docid": "1accd60c3864348cff622f5311604447", "score": "0.4639012", "text": "function clean(text) {\n if (typeof(text) === \"string\") {\n return text.replace(/`/g, \"`\" + String.fromCharCode(8203)).replace(/@/g, \"@553983197378117635\" + String.fromCharCode(8203));\n } else {\n return text;\n }\n}", "title": "" }, { "docid": "662526a56dad814aac5abcc1f45d1365", "score": "0.4631914", "text": "function clean(text) {\n if (typeof(text) === \"string\")\n return text.replace(/`/g, \"`\" + String.fromCharCode(8203)).replace(/@/g, \"@\" + String.fromCharCode(8203));\n else\n return text;\n}", "title": "" }, { "docid": "aab8e0e003c66f318b9250a2022e7b09", "score": "0.4630557", "text": "function stripMarkdown (str) {\n return (\n str\n // Remove code blocks\n .replace(/```([.\\s\\S]*?)```/gm, '')\n // Remove images\n .replace(/\\!\\[(.*?)\\][\\[\\(].*?[\\]\\)]/g, '')\n // Strip emphasis\n .replace(/([\\*_`]{1,3})(\\S.*?\\S{0,1})\\1/g, '$2')\n );\n}", "title": "" }, { "docid": "0a2ef69a7407e1efa5841e9a2c8465a6", "score": "0.46282998", "text": "function removeLetters(lettersToRemove) {\n\n if (alpha.indexOf(lettersToRemove) === -1) {\n\n document.querySelector(\".\" + lettersToRemove).innerHTML = \"-\";\n\n }\n\n }", "title": "" }, { "docid": "f87f9bc05f11c3b2b860c6295c0ba2cd", "score": "0.46188638", "text": "function Check(input) {\n input.value = input.value.replace(/[^a-zA-Z-'\\n\\r.]+/g, '');\n}", "title": "" }, { "docid": "681006baf18e2405d1a7043b28fc6c7a", "score": "0.46038687", "text": "function removeShit(txt){\n txt = txt.replace(/o\\#/g,\"o\");\n return txt.replace(/(ør?)\\#/g,\"$1\");\n\n }", "title": "" }, { "docid": "290f3500a5fda5e05bc5f9248c4bb1fe", "score": "0.45933297", "text": "function _sqliClean(text) { return text.replace(/[<>\"=;/\\(\\)\\[\\]\\{\\}]/g, \"\"); }", "title": "" }, { "docid": "b0957c01e2c7eaff8414a6cd0cd599cd", "score": "0.45887375", "text": "function strip(data){\n return data.replace(/[`~!@#$%^&*()_|+\\-=?;:'\",<>\\{\\}\\[\\]\\\\\\/]/gi,'');\n}", "title": "" }, { "docid": "de90d70773ca56bf083101dd8e655f91", "score": "0.4582603", "text": "function removeCharacters(string, chars) {\n let output = \"\";\n for (let i = 0; i < string.length; i++) {\n let contained = true;\n for (let j = 0; j < chars.length; j++) {\n if (string[i] === chars[j]) {\n contained = false;\n }\n }\n if (contained) {\n output += string[i];\n }\n }\n return output;\n}", "title": "" }, { "docid": "0fd6eba85fda2ab588e876a766e29a22", "score": "0.45793948", "text": "function removeMascaraCPFCNPJ(texto){\n let aux = \"\";\n aux = texto.replace(/\\./g,\"\").replace(/\\-/g,\"\").replace(\"/\",\"\");\n return aux;\n}", "title": "" }, { "docid": "7b1657089842b7c8ef7471e732d0cfa1", "score": "0.4573713", "text": "function remove(str) {\n var letter, code;\n var new_str = \"\";\n var msg = \"\";\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if ((code == 32) || // space\n (code > 64 && code < 91) || // upper alpha (A-Z)\n (code > 96 && code < 123)) { // lower alpha (a-z)\n new_str += str.charAt(i);\n } else if ((code == 44) || (code == 46) || (code == 63) || (code == 33)) { // dont display error over some punctuation\n new_str += \" \";\n } else {\n msg = \"❕only use alphabetic characters\";\n new_str += \" \";\n }\n }\n document.getElementById(\"error\").innerHTML = msg;\n return new_str;\n}", "title": "" }, { "docid": "35db49f003d4ee82fe520ebdbedc7859", "score": "0.45656568", "text": "function removeNonAscii(str) {\n if ((str===null) || (str===''))\n return false;\n else str = str.toString();\n return str.replace(/[^\\x20-\\x7E]/g, '');\n}", "title": "" }, { "docid": "cb60a428f26c79f2da18206fde06d87f", "score": "0.45628503", "text": "function textCheck (val) {\n val = val.replace(/[#\\[\\]]/g, '');\n }", "title": "" }, { "docid": "e4a727f737e7e7c32ea9615b3e9467bb", "score": "0.455709", "text": "function placeholder_no_math(x) {\n\treturn x.replaceAll(math_placeholder_regex, \"\");\n}", "title": "" }, { "docid": "49d795bb38073007c89a30eaf5efa3ec", "score": "0.45548564", "text": "function sanitize(s) {\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n}", "title": "" }, { "docid": "5a446ac88043aec66e9afa1cac2da759", "score": "0.4542898", "text": "function delMinusChar(s) {\n s = String(s).trim();\n if (s.length > 0) {\n s = removeItem(s, \"-\");\n return s;\n } else {\n return '';\n }\n}", "title": "" }, { "docid": "fd54a7f86b357ad51999b072dc8619c5", "score": "0.45340922", "text": "function removeM (str) {\n return str.replace('m','')\n}", "title": "" }, { "docid": "a39b11faddd940a4194c52e5163f5d4a", "score": "0.4526401", "text": "function addExcitement (theWordArray, character) {\n let fullSentence = \"\"\n let wordCount = 1\n let exclamationCount = 0\n let exclaim = \"\"\n for (let index = 0; index < theWordArray.length; index++) {\n let word = theWordArray[index];\n /* Determine if The remainder of WordCount is equal to 0 to add exclamation points (every 3rd word)*/\n if ((wordCount % 3) === 0) {\n /* Determine the amount of exclamation points needed by dividing 3 by wordCount */\n let exclamationCount = (3/wordCount)\n /* loop through to create the number of characters needed */\n for (let index = 0; index < exclamationCount; index++) {\n exclaim = exclaim + character\n }\n fullSentence = fullSentence+\" \"+word+exclaim\n }\n else fullSentence = fullSentence+\" \"+word\n console.log(fullSentence)\n wordCount++\n \n \n }\n}", "title": "" }, { "docid": "6311e9fb38dabd60ae729482d457faa0", "score": "0.4523788", "text": "function removeMascaraCep(texto){\n let aux = \"\";\n aux = texto.replace(/\\./g,\"\").replace(/\\-/g,\"\");\n return aux;\n}", "title": "" }, { "docid": "2d8fe6fd517eb6ea9729f7b54ebc566b", "score": "0.45086485", "text": "function parseNotEqualSign()\n{\n\tif (text.indexOf('!=') < 0 && text.indexOf('=/=') < 0)\n\t{\n\t\treturn;\n\t}\n\n\tlet m, regexp = /\\b (?:!|=\\/)=(?= \\b)/g;\n\twhile (m = regexp.exec(text))\n\t{\n\t\taddTag(m.index + 1, m[0].length - 1, \"\\u2260\");\n\t}\n}", "title": "" }, { "docid": "cade77e36c5b4037ddf3cc8673da03af", "score": "0.45017886", "text": "function deleteCharacter(){\n showNotice(false);\n var display = document.getElementById('emailDisplay');\n if (display.innerText.length > 1){\n display.innerText = display.innerText.slice(0, -1);\n }\n }", "title": "" }, { "docid": "f90d79eb4ae867324ff8f13271a2226f", "score": "0.4497624", "text": "function remove(s) {\n return s.replace(/<[^>]*>/g, \"\").trim();\n}", "title": "" }, { "docid": "5be97a3a62327c97e099864f878dedbc", "score": "0.44963148", "text": "function obfuscateEmail(email) {\n\n //Calculate the obfuscation points\n var numLettersToObfuscate = Math.floor(email.length / 2);\n var startingPoint = Math.floor(numLettersToObfuscate / 2);\n\n //Return the obfuscated email address\n return email.substr(0, startingPoint) +\n '...' +\n email.substr(startingPoint+numLettersToObfuscate, email.length);\n}", "title": "" }, { "docid": "85523d8d6069f4fea5edc98fc16c0a52", "score": "0.44953626", "text": "function removeCharacters (string, chars) {\n let returnString ='';\n for (let i=0; i<string.length; i++) {\n if (!chars.includes(string[i])) {\n returnString += string[i];\n }\n }\n return returnString;\n}", "title": "" }, { "docid": "57afa52e6e9d5f29eae13aa26fbe35f9", "score": "0.449506", "text": "function remove( marks ) {\n let k = \",\" + ((clr < 0 || secondary === undefined) ? key : key + secondary );\n let i = marks.indexOf( k );\n while ( clr !== 0 && i > -1 ) {\n let e = marks.indexOf( \",\", i + 1);\n marks = marks.slice( 0, i) + marks.slice( e);\n changed = true;\n i = marks.indexOf( k );\n }\n return marks;\n } // end function remove", "title": "" }, { "docid": "a194f885d2f8e232e28cf3be8baa7a11", "score": "0.44922495", "text": "function removeVowels(string)\n{\n string = string.replace(/(.)(?=\\1)/gi,'');\n string = string.replace(/[aeiou]+/gi,'');\n return string;\n}", "title": "" }, { "docid": "c410994cfcc3c4529bdf4842e1414069", "score": "0.44890752", "text": "stripPunctuation(text) {\n return text.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\"\");\n }", "title": "" }, { "docid": "83335ce35bf12bd1fdf5a79da95c018a", "score": "0.44878426", "text": "function strip(strng){\n\t// convert string into array of letters\n\tvar letters = Array.from(strng);\n\n\t// remove space characters and return\n\treturn filter(letters, function(element){\n\t\treturn element.charCodeAt(0) != 32;\n\t}).join('');\n}", "title": "" }, { "docid": "f67f7ea08382dafec1f4a24a1afee444", "score": "0.44777524", "text": "function questionMark(string) {\n if (!/[?]$/.test(string))\n string = string.concat('?');\n return string;\n}", "title": "" }, { "docid": "efd91207309ec36a26f4bf3beb0e57a3", "score": "0.44728252", "text": "function noteTextRemover (noteType){\n for (i = 0; i < noteType.length; i++){\n text = text.replace(noteType[i][0], \"\")\n }\n}", "title": "" }, { "docid": "8300256e62406658254f4ea7a5303b5c", "score": "0.4469798", "text": "function rtrim(s)\r\n{\r\n return s.replace( /s*$/, “” );\r\n}", "title": "" }, { "docid": "0e81d3a755330bab37ccf58ad5ff08a3", "score": "0.4457841", "text": "function processMarkStrChars(str) {\nvar i = 0;\nvar retStr = '';\n\tfor ( i = 0; i < str.length; i++ ) {\n\t\tif ( isMarkStrChar(str.charAt(i)) == true )\n\t\t\tretStr += '\\\\';\n\t\tretStr += str.charAt(i);\n\t}\n\treturn retStr;\n}", "title": "" }, { "docid": "94dbf72d51ceb9cf1da2cfa47bc038f8", "score": "0.4449424", "text": "function RemoveCharacter(string, index) {\n\n var newString = \"\";\n\n for (var i = 0; i < string.length; i++) {\n\n if (i != index)\n newString += string[i];\n }\n\n return newString;\n}", "title": "" }, { "docid": "dde8ad9d1e7393fe529657e94990c11c", "score": "0.44492462", "text": "function removeUnwantedChars(val){\n var string = val.substring(2);\n return string.substring(0, string.indexOf('>>'));\n }", "title": "" }, { "docid": "8e26fe1e0116cb79ce9cdd66a0ddf14f", "score": "0.44355118", "text": "function removeInappropriates(txt){\n var valid = txt.replace(/(<([^>]+)>)/gi, \"\");\n valid = valid.replace(/[|\\^{\\};&\\?\"#%\\\\]/g, \"\");\n return valid;\n }", "title": "" }, { "docid": "f2344331a8b8daad80024ff41a5bf889", "score": "0.44336736", "text": "function remove(str, vowels) {\n let newStr = ''\n let newVowels = []\n for(let j=0; j<vowels.length; j++){\n newVowels.push(vowels[j])\n }\n console.log(newVowels)\n for(let i=0; i<str.length; i++){\n if(!newVowels.includes(str[i])) {\n newStr += str[i]\n }\n }\n return newStr\n}", "title": "" }, { "docid": "0d9ca0a6ba46ca2b8c324d152a94cc52", "score": "0.44335222", "text": "function RemoveVocal(MyString) {\nconvertToString=MyString.split ('')\nvar vocal = ['a','i','u','e','o']\n if (MyString.index\n )\nreturn MyString.splice(vocal)\n\n}", "title": "" }, { "docid": "346b21316e9530e57a5f485229d5f2d7", "score": "0.44329444", "text": "function clean(text) { return (''+text).replace( /[<>]/g, '' ) }", "title": "" }, { "docid": "a4f452e84df34f408ce364ef5db9ce42", "score": "0.44240957", "text": "function clearRexEx (inputArray) {\n for (var i=0;i<inputArray.length;i++) {\n //Only stripping word boundaries.\n if (inputArray[i].includes(\"\\\\b\")) {\n inputArray[i] = inputArray[i].replace(/\\\\b/g, \"\");\n }\n }\n return inputArray;\n }", "title": "" }, { "docid": "71f64321eb6f81b9aa2e983ea05d66d0", "score": "0.442085", "text": "function cleanseFilename(string){\n\treturn string.replace(/['\";{}]/g,\"\");\n}", "title": "" }, { "docid": "e14ad2ccff6b46c0234b53e30934f7ae", "score": "0.44146097", "text": "function cl(strToClean) {\r\n return strToClean.replace(/[^a-zA-Z0-9ß-ü-_]/g,'');\r\n}", "title": "" } ]
5a5ed890b6acbbcf8bf7cb1e6adc8842
write a function that filters the odd numbers from an array and returns a new array consisting only the evens
[ { "docid": "9cfd7d40cec090263a627f0c31b61dc1", "score": "0.81313694", "text": "function filter_odd_numbers(input) {\n var new_array = [];\n for (var i = 0; i < input.length; i++) {\n if (input[i] % 2 === 0) {\n new_array.push(input[i]);\n }\n }\n return new_array;\n}", "title": "" } ]
[ { "docid": "fbd6aeac65677b33afd27f190256135d", "score": "0.87021625", "text": "function filterEvens(array){\n return array.filter(x => x %2 ===0)\n}", "title": "" }, { "docid": "959440e45f6d47dbb2fa5c7ab9245247", "score": "0.8691836", "text": "function evensOnly(arr) {\n return arr.filter(x=> x%2==0)\n \n}", "title": "" }, { "docid": "6f33321ff57d8f22b6f8656e6423e897", "score": "0.8690543", "text": "function evensOnly(arr) {\n return arr.filter(num => num % 2 === 0)\n }", "title": "" }, { "docid": "6b24dff174bc7ad80c85dcbc4d519881", "score": "0.8666347", "text": "function evensOnly(arr) {\n return arr.filter( a => a%2 === 0)\n}", "title": "" }, { "docid": "99034de918ceef7d4b2c292b07642864", "score": "0.8664342", "text": "function evensOnly(arr){\n var arr = [3, 6, 8, 2];\n return arr.filter( number => number % 2 == 0);\n\n \n \n}", "title": "" }, { "docid": "b175e58387b02b12f4260c51cd6524f2", "score": "0.8517744", "text": "function evens (array1) {\n return array1.filter((element) => element % 2 === 0)\n}", "title": "" }, { "docid": "e27078bf754f99e687b48accb71502a5", "score": "0.85106987", "text": "function evens(arr)\n{\n let result = arr.filter(function(num)\n {\n if (num % 2 == 0)\n return num;\n }\n )\n return result;\n}", "title": "" }, { "docid": "4a27206811e87a95af8e91f0d39b1556", "score": "0.8469697", "text": "function filterOddElements(arr) {\n // your code here\n return arr.filter( e => {\n return e % 2 === 1;\n })\n}", "title": "" }, { "docid": "58ab43424261af3dbb45c25d9958cc22", "score": "0.8400874", "text": "function oddNumbers(array) {\n return array.filter(function(number){\n return number % 2 != 0;\n });\n}", "title": "" }, { "docid": "ea3479096fbfe724d0e88054c5fc2f41", "score": "0.8394139", "text": "function evenOnly(arr)\n{\n var result=arr.filter(elem=> elem%2==0)\n\n\n return result;\n}", "title": "" }, { "docid": "ee82be9a390f7a4790817463d80a041c", "score": "0.83873993", "text": "function returnEvens(array) {\n return array.filter(e => e % 2 === 0)\n }", "title": "" }, { "docid": "bc8d200b7a26e29b47f5d272d0fe747d", "score": "0.83868456", "text": "function myFilter(arr) {\n var newArr = [];\n\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] % 2 === 0) { // An even number from the array (arr)\n newArr.push(arr[i]);\n }\n }\n\n return newArr;\n}", "title": "" }, { "docid": "5804a59b551558502c926aa428870a38", "score": "0.8370815", "text": "function filterEvenElements(arr) {\n // your code here\n return arr.filter( e => {\n return e % 2 === 0;\n })\n}", "title": "" }, { "docid": "92ea996f2dee1e3229f817bc7c4cec12", "score": "0.82836187", "text": "function odds (array1) {\n return array1.filter((element) => Math.abs(element % 2) === 1)\n}", "title": "" }, { "docid": "6a4ba26f47c1bf15f7439a16d7de140f", "score": "0.8262517", "text": "function onlyEvenValues(arr) {\n\n const outOnlyEvens = arr.filter(function (inVal) {\n return inVal % 2 === 0;\n })\n\n return outOnlyEvens;\n\n}", "title": "" }, { "docid": "df1b04335a06e1805c2367f183ca3c94", "score": "0.82470965", "text": "function evens(arr) {\n var newArr = []\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] % 2 != 0) {\n newArr.push(arr[i])\n }\n }\n return newArr\n}", "title": "" }, { "docid": "8a4f4e6ec0a3d27b9a95e53fa9655709", "score": "0.82301235", "text": "function evensOnly(arr) {\n result = [];\n if (Array.isArray(arr)){\n result = arr.filter(function (x) {\n return x%2 === 0;\n })\n }\n return result;\n}", "title": "" }, { "docid": "202672f2a04c3f4999606e1f99771c36", "score": "0.8097858", "text": "function evenNums(arr) {\n return arr.filter(num => num % 2 == 0);\n}", "title": "" }, { "docid": "2306af586ed7db5300621d246a09c9d6", "score": "0.80965203", "text": "function onlyEven(array) {\n return array.filter(isEven);\n}", "title": "" }, { "docid": "d4a0d34cdf39e945a05794408d43eef3", "score": "0.8070747", "text": "function oddElementsOf(arr) {\n return arr.filter(function(elem, i){\n if (i % 2 !== 0) {\n return elem;\n }\n });\n}", "title": "" }, { "docid": "f4d354b2740b4857536d13ee94a849cf", "score": "0.80661607", "text": "function deleteEvenNumbers(array)\r\n{\r\n\tfunction condition(value)\r\n\t{\r\n\t\treturn value%2==1;\r\n\t}\r\n\tvar arr = array.filter(condition);\r\n\treturn arr;\r\n}", "title": "" }, { "docid": "3315eb97efc774a4a9f0b573f557d8cd", "score": "0.8063836", "text": "function evensOnly(arr) {\n // Step 1 -> Declare `evenArray` variable and set to empty array\n var evenArray = [];\n // Step 2 -> Loop through entire array of numbers\n for (var i = 0; i < arr.length; i++) {\n // Loop Step 1 -> use modulus operator `%` in conditional to check if even number\n if (arr[i] % 2 === 0) {\n // Loop Step 2 -> if even, push into `evenArray`\n evenArray.push(arr[i]);\n }\n }\n\n // Step 3 -> Return `evenArray`\nreturn evenArray;\n}", "title": "" }, { "docid": "545b37cab09d810e44cb93f485de0e98", "score": "0.805985", "text": "function getEvenNumbers(numbersArray){\r\n let newArray = numbersArray.filter(function(number) {\r\n return number % 2 == 0;\r\n });\r\n return newArray;\r\n }", "title": "" }, { "docid": "85924df87eced9c4176d9d1d8ce9cb6b", "score": "0.80494", "text": "function doubleOddNumbers(arr) {\n let newArr = []\n arr.filter(x => {\n if(x % 2 !== 0) {\n newArr.push(x);\n }\n })\n return newArr.map(x => {\n return x *= 2;\n })\n}", "title": "" }, { "docid": "66bd84d6e6ff48d721764fd16bac0e7e", "score": "0.8043108", "text": "function oddities(arr) {\n let result = [];\n\n if ( arr.length > 0 ) {\n result = arr.filter( (num, idx) => {\n if ( idx % 2 === 0 ) {\n return num;\n }\n });\n }\n\n return result;\n}", "title": "" }, { "docid": "e057d692d50b93493212dd88da29945e", "score": "0.7948657", "text": "function onlyTheEvenSurvive(array) {\n const even = array.filter(index => index % 2 === 0)\n return even\n}", "title": "" }, { "docid": "4a8a83e0f8b35dcdf9f8173c4a6f4ea9", "score": "0.7939803", "text": "function filterEven(ar) {\n let result = [];\n for (let i = 0; i < ar.length; i++) {\n // check every element\n // if it's even add it to result\n if (ar[i] % 2 === 0) {\n result.push(ar[i])\n }\n }\n return result\n}", "title": "" }, { "docid": "da0a9f27d47a42540ce00942626b5ce9", "score": "0.79308283", "text": "function noOdds(values) {\n // let evenArr = [];\n // for (let i = 0; i < values.length; i++) {\n // if (values[i] % 2 === 0) {\n // evenArr.push(values[i]);\n // }\n // }\n // return evenArr;\n return values.filter((x) => x % 2 === 0);\n}", "title": "" }, { "docid": "5d3be1f16fa177efadf0e1312b1bbe99", "score": "0.79248506", "text": "function arrayOdd(arr){\n var newArr = [];\n for(var i = 0; i < arr.length; i++){\n if(arr[i] % 2 !== 0){\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "4e5731f25e38398f70a344a32f1487f6", "score": "0.7845935", "text": "function getEvenNumbers(array) {\n // Your code here.\n let newArr = [];\n\n for (const item of array){\n if (item % 2 === 0){\n newArr.push(item);\n }\n }\n\n return newArr;\n }", "title": "" }, { "docid": "7ae3d916c5d6ea65d0da818198867300", "score": "0.7842608", "text": "function getEvens (array){\n\n var evenNumbersInArray = [];\n for (var i in array){\n if (array[i] % 2 != 1){\n evenNumbersInArray.push(array[i]); \n }\n\n }\n\n return evenNumbersInArray;\n}", "title": "" }, { "docid": "2f43b2c68506b00a80d7adc662dccc22", "score": "0.7839208", "text": "function odds(numArray){\n var finalArray = []\n\n numArray.forEach( value => {\n if(value % 2 == 1 || value % 2 == -1) finalArray.push(value)\n })\n \n return finalArray\n}", "title": "" }, { "docid": "f592f69a12b43f77753322dd76fdf613", "score": "0.78299814", "text": "function doubleOddNumbers(arr){\r\n return arr.filter(function(val){\r\n return val % 2 !==0;\r\n }).map(function(val){\r\n return val*2;\r\n });\r\n}", "title": "" }, { "docid": "a2b5df6de368d7368d92b21bcef080d4", "score": "0.7829355", "text": "function evens (numArr) {\n let evenArr = []\n for (let i = 0; i < numArr.length; i++) {\n if (numArr[i] % 2 === 0) {\n evenArr.push(numArr[i])\n }\n }\n return evenArr\n}", "title": "" }, { "docid": "3d8a5ce4c0b235f423df141844f198f6", "score": "0.7825662", "text": "function findOddElements(array) {\n var newArray = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i] % 2 != 0) {\n\n newArray[i] = array[i];\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "96b51fd02ba85654254c8f32cb60aaac", "score": "0.7823539", "text": "function getEvenList(array) {\n return array.filter((ele, index) => index % 2 === 1 );\n}", "title": "" }, { "docid": "f0f76ee7953f0ce7f3c07f59eb16c2c9", "score": "0.7808347", "text": "function collectOddsForLoop(arr) {\n const result = []\n for(let value of arr)\n if(value % 2 !== 0)\n result.push(value)\n return result\n}", "title": "" }, { "docid": "338ae175a72bb64701f1fe3922f31a60", "score": "0.78068334", "text": "function evenIndexOddLength(arr){\nvar result=arr.filter(function(elem, index){\n\nreturn elem.length%2!==0 && index%2==0\n\n}\n)\n\n\n\n return result;\n}", "title": "" }, { "docid": "3b4db3d5c71cbc745cf6736ea02a4975", "score": "0.77713686", "text": "function filterYourself(array) {\n let answer = []\n for (let number = 0; number < array.length; number++) {\n if (array[number] % 2 === 0) {\n answer.push(array[number])\n }\n }\n return answer\n}", "title": "" }, { "docid": "9d38aab10c78c6b9a19dfdd663623adc", "score": "0.77647996", "text": "function removeEven(arr) {\n return arr.filter((v => (v % 2) != 0))\n}", "title": "" }, { "docid": "5f7ff2b9788534d5a62cc1d9e358589a", "score": "0.77530074", "text": "function evens(numArray){\n var finalArray = []\n\n numArray.forEach( value => {\n if(value % 2 == 0) finalArray.push(value)\n })\n \n return finalArray\n}", "title": "" }, { "docid": "efd6a9192b2743d003e16f81ccd26c9a", "score": "0.7711493", "text": "function removeOdd(array){\n var rv = [];\n for (var i = 0; i < array.length; i++) {\n if (! (array[i] % 2)) {\n rv.push(array[i]);\n }\n }\n return rv;\n}", "title": "" }, { "docid": "4f171e84debc2beb6b038721b5fb6bbd", "score": "0.77046824", "text": "function doubleOddNumbers(arr) {\n return arr\n .filter(function (val) {\n return val % 2 !== 0;\n })\n .map(function (val) {\n return val * 2;\n });\n}", "title": "" }, { "docid": "68e5bcb1fc83917b7f8fa68a96ec3a96", "score": "0.7686936", "text": "function onlyEvenValues(arr) {\n let newArr = [];\n arr.forEach(el => {if(el % 2 === 0) {newArr.push(el)}});\n return newArr;\n}", "title": "" }, { "docid": "99586aeb032bc83925391753ab89f660", "score": "0.768579", "text": "function doubleOddNumbers(arr) {\n let a = arr.filter(function (value) {\n return (value % 2) != 0;\n });\n return a.map(function (value, index, arr) {\n return value * 2;\n });\n}", "title": "" }, { "docid": "e8d34dccb8875689704807111b5d5cc3", "score": "0.76720434", "text": "function removeEven1(arr) {\n return arr.filter((v => (v % 2) != 0))\n}", "title": "" }, { "docid": "6292322a5ff49ffb81e3cc4af08ce5b5", "score": "0.7671018", "text": "function evens(number_array){\n var evens_array = [];\n var length = number_array.length;\n for (i = 0; i < length; i++){\n if (i % 2 == 0) {\n evens_array.push(number_array[i]);\n };\n };\n return evens_array;\n}", "title": "" }, { "docid": "9a55fda89225e7bcd7cdbc6f593bf09b", "score": "0.7662214", "text": "function onlyEvenValues(arr){\r\n var output = [];\r\n arr.forEach(element => {\r\n if (element % 2 == 0){\r\n output.push(element);\r\n }\r\n });\r\n return output;\r\n}", "title": "" }, { "docid": "7dbebfa94bccf03ae0309d4cc6a382e3", "score": "0.7658928", "text": "function removeEven(array){\n var rv = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i] % 2) {\n rv.push(array[i]);\n }\n }\n return rv;\n}", "title": "" }, { "docid": "39dd5871c5529952bd198126abdd6e3f", "score": "0.7657504", "text": "function findOddNumbers(arr){\n let result = [];\n arr.forEach(el => {\n if(el % 2 === 1){\n result.push(el)\n }\n })\n return result;\n }", "title": "" }, { "docid": "395ef9df8f9e1224e0bee2bd0f919a49", "score": "0.76498955", "text": "function evenNumbersOnly(array) {}", "title": "" }, { "docid": "9e5b64d861bae444d768b6bafa32fd60", "score": "0.76468885", "text": "function onlyEvenValues(arr) {\n var newArr = [];\n arr.forEach(function (value, index, arr) {\n if (value % 2 === 0)\n newArr.push(value);\n });\n return newArr;\n}", "title": "" }, { "docid": "53b22236e59c2b05fb0a383a33011604", "score": "0.7607877", "text": "function odds(values){\n return values.filter( v => v%2 )\n }", "title": "" }, { "docid": "27a42b1cf895907579e357cfb59cc5d5", "score": "0.7603132", "text": "function printOddNumbersOnly(arr) {\n arr = arr.filter(e => e % 2 == 1);\n\n console.log(`\\tAnswer: `, arr, '\\n');\n}", "title": "" }, { "docid": "085761f1e4f723bfa5f4d516f0d7fdd1", "score": "0.7600487", "text": "function collectOddValues(arr) {\n\tlet result = [];\n\tfunction helper(helperInput) {\n\t\tif (helperInput.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tif (helperInput[0] % 2 !== 0) {\n\t\t\tresult.push(helperInput[0]);\n\t\t}\n\t\thelper(helperInput.slice(1));\n\t}\n\thelper(arr);\n\treturn result;\n}", "title": "" }, { "docid": "f3a63aed4643574b66ad58ebd1fef36e", "score": "0.75762326", "text": "function odd_only(xs) {\n return filter(x => math_abs(x) % 2 === 1, xs);\n}", "title": "" }, { "docid": "06f3477149a6112493f45574fd075740", "score": "0.75688535", "text": "function evenFinder(arr) {\n arrTwo = [];\n for (i = 0; i < arr.length; i++) {\n if (arr[i] % 2 === 0) {\n arrTwo.push(arr[i]);\n }\n }\n return arrTwo;\n}", "title": "" }, { "docid": "4ed85a346ab5b46613d2a6e6f9310a32", "score": "0.75606585", "text": "function onlyEvens(...nums){\n return nums.filter(num => num%2===0); \n}", "title": "" }, { "docid": "7f32d9cbeeff05d980b5f0040c3ba813", "score": "0.7556431", "text": "function removeEveryOther(arr){\n var x = arr.filter(function(v, i){\n return i % 2 == 0;\n });\n return x\n}", "title": "" }, { "docid": "ab4ddd53e8649ede8dc69fec43463574", "score": "0.7555615", "text": "function evenNumbersOnly(array) {\n let evenArray = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i] % 2 === 0) {\n evenArray.push(array[i]);\n }\n }\n console.log(evenArray);\n return evenArray;\n}", "title": "" }, { "docid": "69b14969d2d46e6a78ed9c3869b14a06", "score": "0.7550669", "text": "function getOddEl(arr) {\n return arr.filter((val, idx) => idx % 2 !== 0);\n}", "title": "" }, { "docid": "de5801b3a9ca876f488f2d0a698c374a", "score": "0.75499666", "text": "function filterOutEven (n) {\n\tvar array = new Array();\n\tarray = pushRandom(n);\n\tvar filterResult = array.filter(function (item){return (item % 2 !== 0);});\n\treturn filterResult;\n}", "title": "" }, { "docid": "ad021744a631b7d70271cc12f0bf4cba", "score": "0.75404966", "text": "function removeEven2(arr) {\n return arr.filter(n => (n % 2) != 0);\n}", "title": "" }, { "docid": "068cf9ab379eb975b294ae9fe2876e33", "score": "0.75398403", "text": "function onlyEvens() {\n // in ES5, this is how we turned something\n // array-like into an actual array\n var nums = Array.prototype.slice.call(arguments); //this is replaced in line 105, in the arguments of the function\n return nums.filter(function (num) {\n return num % 2 === 0;\n });\n}", "title": "" }, { "docid": "4b7ce1bb08993b6ce342d5fb9b8791f8", "score": "0.75335443", "text": "function evenFinder(arr){\n arrTwo = [];\n for (i = 0; i < arr.length; i++){\n if ((arr[i] % 2) === 0) {\n arrTwo.push(arr[i]);\n }\n }\n return arrTwo;\n}", "title": "" }, { "docid": "0f5e3564dca7d4fed40a3a44fa9a4692", "score": "0.7531267", "text": "function doubleOddNumbers(arr) {\n\n const nbrsOdd = arr.filter(function (fxinNbr) {\n return fxinNbr % 2 === 1;\n })\n\n const outDoubleOdds = nbrsOdd.map(function (fxinNbr) {\n return fxinNbr * 2;\n })\n\n return outDoubleOdds;\n}", "title": "" }, { "docid": "caa2593f8663b5d47f52bb2aa6c19c81", "score": "0.7530349", "text": "function collectOddValues(arr){\n \n let result = [];\n\n function helper(helperInput){\n if(helperInput.length === 0) {\n return;\n }\n \n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n // calling helper method on subarray (everything on the array excluding the first element)\n // (remember the dragon story)\n helper(helperInput.slice(1)) \n }\n \n helper(arr)\n\n return result;\n}", "title": "" }, { "docid": "d701846853cca2fd0fa37c39cc5cab31", "score": "0.75286734", "text": "function getOddNums (array) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n const currentVal = array[i];\n if(currentVal % 2){\n result.push(currentVal);\n }\n }\n return result;\n}", "title": "" }, { "docid": "12233624d6e7fbe871fd8e7f034696b9", "score": "0.75259525", "text": "function onlyEvenValues(arr){\r\n var x=[];\r\n arr.forEach((element) => {if(element%2==0) \r\n x.push(element) })\r\n return x;\r\n}", "title": "" }, { "docid": "85e55a2d5319b17be74cfffc92faed6c", "score": "0.75003886", "text": "function odds (numArr) {\n let oddArr = []\n for (let i = 0; i < numArr.length; i++) {\n if (numArr[i] % 2 !== 0) {\n oddArr.push(numArr[i])\n }\n }\n return oddArr\n}", "title": "" }, { "docid": "ea8a162b0e672fec6b6c6e5aa09c4811", "score": "0.74964106", "text": "function onlyTheEvenIndexedSurvive(array) {\n const even = array.filter((index, indexposition) => indexposition % 2 === 0)\n return even\n}", "title": "" }, { "docid": "65dd2a151c14e3114793fe6aa8fc07cd", "score": "0.74807924", "text": "function evenOddArr(arr)\n{\n // let even = [];\n // let odd = [];\n // for(let i = 0; i < arr.length; i++)\n // {\n // if(i % 2 == 0)\n // {\n // even.push(arr[i])\n // }\n // else\n // {\n // odd.push(arr[i])\n // }\n // }\n // return even;\n}", "title": "" }, { "docid": "5a2176e7b7ca6f4c7ae8da90cdc421ff", "score": "0.7476566", "text": "function oddarray(){\n var newarr=[];\n for(var i=1;i<=50;i++){\n if(i%2!=0){\n newarr.push(i);}\n }\n return newarr;\n}", "title": "" }, { "docid": "cdd7b6872afe0041ee7a47a312a1f1d0", "score": "0.74710566", "text": "function getEvenNums (array) {\n const result = [];\n for (let i = 0; i < array.length; i++) {\n const currentVal = array[i];\n if(!(currentVal % 2)){\n result.push(currentVal);\n }\n }\n return result;\n}", "title": "" }, { "docid": "e4a729b8306e79112097bf58e14a99fc", "score": "0.74618834", "text": "function collectOddValues(arr){\n let newArr = [];\n\n if(arr.length === 0) {\n return newArr;\n }\n\n if(arr[0] % 2 !== 0){\n newArr.push(arr[0]);\n }\n\n newArr = newArr.concat(collectOddValues(arr.slice(1)));\n return newArr;\n}", "title": "" }, { "docid": "f646efd5b7a667c1b0a58487074be92a", "score": "0.74552494", "text": "function noOdds(values){\n return values.filter(n => n%2===0)\n}", "title": "" }, { "docid": "78986327f9797f3e3ad6937d6f5ae77c", "score": "0.74493223", "text": "function collectOddValues(arr){\r\n \r\n let result = [];\r\n\r\n function helper(helperInput){\r\n if(helperInput.length === 0) {\r\n return;\r\n }\r\n \r\n if(helperInput[0] % 2 !== 0){\r\n result.push(helperInput[0]);\r\n }\r\n \r\n helper(helperInput.slice(1));\r\n }\r\n \r\n helper(arr);\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "da7ddc79f0ce36c11dcc5e1a85f3d15a", "score": "0.7439539", "text": "function odds(values){\n // arrow it\n return values.filter(num => num % 2 === 1);\n}", "title": "" }, { "docid": "6c4c9bc5b18f58c14b427b2a67ad47b2", "score": "0.7431262", "text": "function collectOddValues(arr){\n let newArr = [];\n\n if(newArr.length === 0) return newArr;\n if(arr[0] % 2 !== 0){\n newArr.push(arr[0]);\n }\n newArr = newArr.concat(collectOddValues(arr.slice(1)));\n return newArr;\n}", "title": "" }, { "docid": "9e776e28878eba549bbd01b47cda53ec", "score": "0.74255115", "text": "function odds(values) {\n // arrow it\n return values.filter((value) => value % 2 !== 0);\n}", "title": "" }, { "docid": "914e0e8956c2386783af623a1c4e415b", "score": "0.74233973", "text": "function numOdd(arr){\n for (let i = 0; i < arr.length; i++){\n if (arr[i] % 2 !== 0){\n newArr.push(arr[i])\n }\n }\n return newArr\n}", "title": "" }, { "docid": "3aec4aa52f33a7f94fabb95fc33c715c", "score": "0.74188125", "text": "function odds(values){\n // arrow it\n \n let newArr = []\n for(let i = 0; i<values.length;i++){\n if(values[i] % 2 !== 0){\n newArr.push(values[i])\n }\n }return newArr\n }", "title": "" }, { "docid": "89a16a90a65b1795b1925ca97fbd809b", "score": "0.7417017", "text": "function remove_odd(arr) {\n var evenArr = [];\n for(var i = 0; i < arr.length; i++){\n if(arr[i]%2 == 0){\n evenArr.push(arr[i]);\n }\n }\n document.write(evenArr);\n document.write(\"<br>\");\n}", "title": "" }, { "docid": "c31438c22accbb782727d98dac419c41", "score": "0.7412125", "text": "function evenFinder(arr) {\n var evenArr = [];\n arr.forEach(function (value, index) {\n if (value % 2 === 0) {\n evenArr.push(value)\n ''\n }\n });\n return evenArr;\n}", "title": "" }, { "docid": "f3abc2a3553a16310ac4beb8e3ae0a2b", "score": "0.7407124", "text": "function collectOddValues(arr) {\n let newArr = [];\n if (arr.length === 0) {\n return newArr;\n }\n if (arr[0] % 2 !== 0) {\n newArr.push(arr[0]);\n }\n newArr = newArr,concat(collectOddValues(arr.slice(1)));\n return newArr;\n}", "title": "" }, { "docid": "d0889c2c9fd8a1c533b4815dca28fc60", "score": "0.74029416", "text": "function noOdds(arr) {\n const noOddsArr = []\n for (var i = 0; i < arr.length; i++) {\n console.log(arr[i])\n if (arr[i] % 2 === 0) {\n noOddsArr.push(arr[i])\n }\n }\n console.log('final', noOddsArr)\n return noOddsArr\n}", "title": "" }, { "docid": "600345119377b3ec669ffc9838be78e1", "score": "0.7394447", "text": "function oddArray(arr){\n\tvar arr1=[];\n\tfor (i=0;i<arr.length;i++){\n\t\tif (arr[i]%2==1){\n\t\t\tarr1.push(arr[i]);\n\n\t\t}\n\t}return arr1;\n\n}", "title": "" }, { "docid": "65795c5b30c5295f1296c711b19bbb80", "score": "0.73936063", "text": "function getOdds(arr) {\n if (arr.length) {\n let result = arr.filter(word => word % 2 != 0);\n result = result.map(function (num) {\n return num * result.length;\n });\n return result;\n\n }\n return [];\n}", "title": "" }, { "docid": "2eeadb4abf51884b66ad39237a16a61a", "score": "0.7381134", "text": "function array_odd(){\n\n var arr= [];\n for(var i=0; i<50; i++){\n if(i%2!==0){\n\n arr.push(i);\n\n }\n }\n return arr;\n}", "title": "" }, { "docid": "ac2618fce1969570a5c6d17a0cfa9c7b", "score": "0.73783565", "text": "function odds(values) {\n return values.filter(x => x & 1)\n }", "title": "" }, { "docid": "fd379124c38e8068479fd35f91b4bfe2", "score": "0.7377341", "text": "function even(array) {\n\tfor (var i = 0; i < array.length; i++) {\n\t\tif (array[i] % 2 !== 0) {\n\t\t\tarray.splice(i, 1);\n\t\t}\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "f5624dfc3eaa7ca6c975e7e3b1f7c749", "score": "0.73665524", "text": "function reject(array) {\n \n return array.filter(function(num){ return num % 2 !== 0 })\n\n}", "title": "" }, { "docid": "6d427ff03de7a210de1428025f587ad5", "score": "0.7364251", "text": "function returnOddsVerbose(array) {\n for (let i = 0; i < array.length; i += 1) {\n if (array[i] % 2 === 0) {\n array.splice(i, 1)\n }\n } return array;\n}", "title": "" }, { "docid": "67dfdbbad8ab069020b4d9d5ef924b03", "score": "0.73632747", "text": "function returnOdds(array) {\n\n}", "title": "" }, { "docid": "31470ea2e8e7c0ad23aaea06a061ffb9", "score": "0.7361951", "text": "function collectOddValues(arr){\n\n let oddArr = [];\n function helper(arr) {\n if(arr.length === 0){\n return\n }\n if(arr[0] % 2 !== 0){\n oddArr.push(arr[0])\n }\n helper(arr.slice(1));\n }\n helper(arr);\n\n return oddArr;\n}", "title": "" }, { "docid": "223673ee518b38a54c83aabe75a5fcc4", "score": "0.7360703", "text": "function getodd(items){\n \n let odd=items.filter(items =>{ return isEven(items)==0;\n \n })\n // another solution\n // let m=items.length;\n // for(let i=0;i<m;i++){\n // if(isEven(items[i])==0){\n // odd.push(items[i]);\n // }\n // }\n \n \n document.write(odd);\n }", "title": "" }, { "docid": "f0739a02d1495e6ed5886944a54f1056", "score": "0.73373055", "text": "function numOdd(arr){\n\tfor (let i = 0; i < arr.length; i++){\n\t if (arr[i] % 2 !== 0){\n\t\t newArr.push(arr[i])\n\t }\n\t}\n\t return newArr\n }", "title": "" }, { "docid": "ba2ac857961275000ae9942b8dc75a25", "score": "0.7330505", "text": "function oddsAndEvens(nums){\n for (i = 0; i < nums.length; i++){\n if ((nums[i] % 2) === 0){\n evens.push(nums[i]);\n }else {\n odds.push(nums[i]);\n }\n }\n return evens;\n}", "title": "" }, { "docid": "3972c4aed6403704b118af38a677b796", "score": "0.7321459", "text": "function onlyEvenValues(arr) {\n let a = [];\n\n arr.forEach(function (value, index, arr) {\n if ((value % 2) == 0) {\n a.push(value);\n };\n });\n\n return a;\n}", "title": "" }, { "docid": "cfcd27bb1a6509d0dc201c8054ffd664", "score": "0.73113763", "text": "function oddities(array) {\n let newArray = [];\n for (let index = 0; index < array.length; index += 2) {\n newArray.push(array[index]);\n }\n return newArray;\n}", "title": "" } ]
719462292c43a284995dddf57188fda2
Method used to set the main Application state Passed down from the main Application
[ { "docid": "aeeed42579a7157f48921972902f98b3", "score": "0.57324344", "text": "handleSetGlobalState(newStateData, toSet) {\r\n this.props.onSetGlobalState(newStateData, toSet);\r\n }", "title": "" } ]
[ { "docid": "f3c9a03bd6083a121c546743d48dd0a9", "score": "0.6701232", "text": "function main() {\n menu = new states.Menu();\n config.ACTIVE_STATE = constants.MENU_STATE;\n currentstate = menu;\n}", "title": "" }, { "docid": "918fad4a3c09d5a86b32b7fafb989bfd", "score": "0.6447901", "text": "putGlobalState(){\n\n }", "title": "" }, { "docid": "5ba89f22a51efa52de98c699bf4e2096", "score": "0.643632", "text": "setAppState(obj) {\n this.setState.bind(this)(obj);\n if (obj.orgName) this.setSocketRoom(obj);\n }", "title": "" }, { "docid": "40a6af53d17d1a8144a50427b5c6d38d", "score": "0.6429829", "text": "get state() {\r\n return appState;\r\n }", "title": "" }, { "docid": "27a18d2c7de2da4dc16d1e9ab76fe615", "score": "0.63478", "text": "_onChange() {\n this.setState(getAppState());\n }", "title": "" }, { "docid": "b807cd99f2800d7682b180497ea53de8", "score": "0.625423", "text": "constructor() {\n super();\n this.state = {\n originalApplicationStatuses: {},\n applicationsDict: {},\n showModal: false,\n selectedApplication: null,\n error: null,\n displayMessage: null\n };\n }", "title": "" }, { "docid": "3134100f43f4280886aa04e953972180", "score": "0.6247917", "text": "function updateState(applicationState) {\n chrome.storage.local.set({ state: JSON.stringify(applicationState) });\n}", "title": "" }, { "docid": "1660b9e0ceb4f27f69bf2be4060c248f", "score": "0.62250435", "text": "updateAppState(newState) {\n this.setState(newState);\n }", "title": "" }, { "docid": "e940fe3068fe397aa2db79e4207fd8e8", "score": "0.6176404", "text": "function InitApplication() {\n AppSettingsCtrl.ePage.Masters.Application = {};\n AppSettingsCtrl.ePage.Masters.Application.OnApplicationChange = OnApplicationChange;\n }", "title": "" }, { "docid": "36e5f52ea90e9dc3b70bc4ac3dd0df9f", "score": "0.6003058", "text": "function resetApplicationState() {\n isParent = false;\n previousOrParentNode = null;\n}", "title": "" }, { "docid": "27f42b42ff45f2acc39dbb12866c2998", "score": "0.59805995", "text": "updateGlobalState(){\n\n }", "title": "" }, { "docid": "4ae45234801936f2eff4a995538a3dcf", "score": "0.5974814", "text": "function overWriteAppState(new_state){\n\t//replaces the current appstate with new_state\n\tvar appstate = new_state; \n\t//updates the user with the user of the new_state.\n\tvar local_device = appstate.device;\n\t//local session is the current session for this device, stored in local storage\n\tvar local_session = appstate.current_simulation_session;\n\t//the states of the simulation object\n\tvar states = appstate.states;\n\t\n\t\n\t//if the current session has a configuration map\n\t//WHEN WOULD THIS NOT HAPPEN? I guess on initialization?\n\tif( local_session.config_map !== null ){\n\t\t//converts the local_session \n\t\t//CHANGE THIS VARIABLE NAME TO SOMETHING NOT STRING\n\t\tvar String = local_session.config_map.toString();\n\t\t//what are we doing here? If this is a check for something, isn't there a stronger way\n\t\t//to do this? Is this checking if it is a JSON object?\n\t\tif(String.substr(0,1) == '{'){\n\t\t\t//decodes the local session if it is a JSON object.\n\t\t\tlocal_session.config_map = JSON.parse(local_session.config_map);\n\t\t}\n\t\t\n\t}\n\t//sets the current application on this device to the new state.\n\tlocal_application = appstate.application;\n\t//places all of the changes into the local storage of the device\n\tputinStorage( 'appstate', JSON.stringify(appstate) );\n\tputinStorage('states', JSON.stringify(states) );\n\tputinStorage( 'session', JSON.stringify(local_session) );\n\tputinStorage( 'device', JSON.stringify(local_device) );\n\tputinStorage( 'application', JSON.stringify(local_application) );\n}", "title": "" }, { "docid": "f8dd9eb197af527e86a856e6f2a3a1db", "score": "0.59262735", "text": "function StateManager(_event_emitter) {\n\tvar self = this;\n\tthis.event_emitter = _event_emitter;\n\tthis.ascii = new _ascii;\n\t/* Initialize applications here and add them to the apps array. \n\t * \n\t * If an applicaiton is active then a user has clicked into that app while it was visible\n\t * all events are delegated to the app if this is the case. \n\t * \n\t * Otherwise loop through apps array displaying one visible app at a time. A visible app\n\t * displays it's homescreen until it is clicked into. \n \t */\n\tvar testApp = new _testApp(_event_emitter, this.ascii);\n\tvar clockApp = new _clock(_event_emitter, this.ascii);\n\tvar pizzaApp = new _pizza(_event_emitter, this.ascii);\n\n\tthis.apps = [clockApp, pizzaApp, testApp];\n\tthis.activeApp = null;\n\tthis.visibleApp = this.apps[0];\n\tthis.currentAppIndex = 0;\n\t\n\t\n\t/* onClockwise\n\t * On clockwise event if we have an active app - an app that we have clicked into\n\t * then delegate the clockwise event handling to that app, otherwise update the \n\t * visible app and display the homescreen for that app. \n \t */\n\tthis.event_emitter.on('clockwise', function() {\n\t\tif( self.activeApp ) {\n\t\t\tself.activeApp.clockwise();\n\t\t} else {\n\t\t\tself.currentAppIndex = ( self.currentAppIndex + 1 >= self.apps.length ) ? 0 : self.currentAppIndex + 1;\n\t\t\tself.visibleApp = self.apps[self.currentAppIndex];\n\t\t}\n\t\tself.display();\n\t});\n\t\n\t\n\t/* onCounterClockwise\n\t * On counterclockwise event if we have an active app - an app that we have clicked into\n\t * then delegate the counterclockwise event handling to that app, otherwise update the \n\t * visible app and display the homescreen for that app. \n \t */\n\tthis.event_emitter.on('counterclockwise', function() {\n\t\tif( self.activeApp ) {\n\t\t\tself.activeApp.counterclockwise();\n\t\t} else {\n\t\t\tself.currentAppIndex = ( self.currentAppIndex - 1 < 0 ) ? self.apps.length - 1 : self.currentAppIndex - 1;\n\t\t\tself.visibleApp = self.apps[self.currentAppIndex];\n\t\t}\n\t\tself.display();\n\t});\n\t\n\t\n\t/* onClick\n\t * On click event if we have an active app then delegate the event handling to that app. \n\t * Otherwise if the visible app is valid - meaning it has multiple states to 'click' into then \n\t * set the visible app to the active app and delegate the click event. \n \t */\n\tthis.event_emitter.on('click', function () {\n\n\t\tif( !self.activeApp ) {\n\t\t\tvar validApp = self.visibleApp.states && self.visibleApp.states.length > 0;\n\t\t\tif( validApp ) {\n\t\t\t\tself.activeApp = self.visibleApp;\n\t\t\t\tself.activeApp.click();\n\t\t\t}\n\t\t} else {\n\t\t\tself.activeApp.click();\n\t\t}\n\t\t\n\t});\n\t\n\t\n\t/* onHome\n\t * On home event clear the active app and reset state to point to the visible app - in this case\n\t * point it to the clock as the home app.\n \t */\n\tthis.event_emitter.on('home', function () {\n\t\tself.activeApp = null;\n\t\tself.currentAppIndex = 0;\n\t\tself.visibleApp = self.apps[self.currentAppIndex];\n\t});\n\t\n\t\n\t/* display\n\t * If there is no active app - we are on the root level displaying all apps then delegate \n\t * to the visible app to display it's home screen. \n\t */\n\tthis.display = function() {\n\t\tif( !this.activeApp ) {\n\t\t\tthis.visibleApp.displayHomeScreen();\n\t\t}\n\t};\n}", "title": "" }, { "docid": "bf52c17c07ba034c6c0a88bfbabe912b", "score": "0.5923627", "text": "function createAppState() {\n const appState = {\n assembled: null,\n running: false,\n plugins: [],\n };\n return appState;\n}", "title": "" }, { "docid": "8a7175576141174466dd9a6cea68c18c", "score": "0.59169704", "text": "function switchToMainPage() {\n switchToState({ page: 'main' });\n}", "title": "" }, { "docid": "1a0ae53c2c2eed57b13dbe48e6ba89b1", "score": "0.59091204", "text": "inital(app:IApp):void {\n\n\t\tthis.step = new Step(app);\n\n\t\tthis.state = new State(app.main,app);\n\n\t}", "title": "" }, { "docid": "d3f8579efd819eaba95c9d2a43a70cf7", "score": "0.58167875", "text": "function updateMainApp(runtime, addr, mainAppId, params) {\n const mainApprovalProgram = getProgram('stateful.py', {\n PERIOD: PERIOD,\n BOND_LENGTH: BOND_LENGTH,\n START_BUY_DATE: START_BUY_DATE,\n END_BUY_DATE: END_BUY_DATE,\n MATURITY_DATE: MATURITY_DATE,\n BOND_COST: BOND_COST,\n BOND_COUPON: BOND_COUPON,\n BOND_PRINCIPAL: BOND_PRINCIPAL,\n ...params\n });\n\n runtime.updateApp(addr, mainAppId, mainApprovalProgram, clearProgram, {}, {});\n}", "title": "" }, { "docid": "f344a7e876ef3bf2b59a7b5b8361aa4e", "score": "0.5762217", "text": "function fnStoreCurrentAppStateAndAdjustURL() {\n\t\t\tif (!bAppStateDirty){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar oState = oSettings.getCurrentState() || Object.create(null);\n\t\t\tfnTransferStateToAnalyzedState(oState);\n\t\t\tfnTransferAnalyzedStateToUrl();\n\t\t}", "title": "" }, { "docid": "6c31a6b6a57eec4fe881c8d4e4b2024b", "score": "0.57597333", "text": "function openWithMainState(state/*:Object = null*/)/*:void*/ {if(arguments.length<=0)state=null;\n this.getCollectionViewContainer().show();\n\n if (state) {\n var mainStateBean/*:Bean*/ = this.getCollectionView().getCollectionViewModel().getMainStateBean();\n mainStateBean.updateProperties(state);\n }\n }", "title": "" }, { "docid": "91d3077ee35b9683ecb78efcf13888fc", "score": "0.57273066", "text": "toggleAppState(pageName) {\n // switch statement to get the state\n // debugger;\n switch (pageName.toLowerCase()) {\n case 'home':\n this.state = 'home';\n break;\n case 'profile':\n this.state = 'profile';\n break;\n case 'athletes':\n this.state = 'athletes';\n break;\n case 'logout':\n this.state = 'logout';\n break;\n\n default:\n 'home';\n break;\n }\n // call the render page function on the state\n this.renderPage(this.state);\n }", "title": "" }, { "docid": "3f9729e0146dcb6de53fdd9ce7284b7f", "score": "0.570308", "text": "function Application(){\n\t\tthis.oDummyBookmarkData\t= {\n\t\t\tlocation\t\t: 'cw01~BranchingPage',\n\t\t\tcompletion\t\t: 'incomplete',\n\t\t\tsuspend_data\t: '{\"cw_completion\":[],\"page_completion\":[],\"activity_scoringUID\":{}}'\n\t\t\t};\t\t\t\n\t\tthis.SCORMDebug\t\t\t= true;\n\t\tthis.sEnvironment;\n\t\tthis.sType;\n\t\tthis.scorm;\n\t\tthis.lmsConnected = false;\n\t\tthis.startTime;\n\n\t\tthis.oBookmarkData;\n\n\t\tthis.setEnvironmentVariables\t= this.setEnvironmentVariables.bind(this);\n\t\tthis.postBookmark\t\t\t\t= this.postBookmark.bind(this);\n\t\tthis.onBookmarkExists\t\t\t= this.onBookmarkExists.bind(this);\n\t}", "title": "" }, { "docid": "70b89fa0df31fe6d6e71b9c552fd7a32", "score": "0.56529725", "text": "function setCurrentState(stateArray) {\n\tfor ( var i = 0; i < stateArray.length; i++ ) {\n\t\ttry {\n\t\t\tif (stateArray[i].altered) {\n\t\t\t\tapp.refresh();\n\t\t\t\tactiveDocument.activeLayer = stateArray[i].layer;\n\t\t\t\tstateArray[i].layer.allLocked = stateArray[i].allLocked;\n\t\t\t\tif ( ! stateArray[i].allLocked) {\n\t\t\t\t\tstateArray[i].layer.pixelsLocked = stateArray[i].pixelsLocked;\n\t\t\t\t\tstateArray[i].layer.positionLocked = stateArray[i].positionLocked;\n\t\t\t\t\tstateArray[i].layer.transparentPixelsLocked = stateArray[i].transparentPixelsLocked;\n\t\t\t\t}\n\t\t\t\tstateArray[i].layer.visible = stateArray[i].visible;\n\t\t\t}\n\t\t}\n\t\tcatch(e) { alert(e + \":\" + e.line); }\n\t}\n}", "title": "" }, { "docid": "65255a6db1e89d2c05018a7b70c81add", "score": "0.56269175", "text": "function setState() {\n // Are we in an iframe?\n if (inFrame()) {\n // If so, make functions available to the outer frame.\n parent.hxSetData = hxSetData;\n parent.hxClearData = hxClearData;\n parent.hxGetData = hxGetData;\n parent.hxGetAllData = hxGetAllData;\n parent.hxBackpackLoaded = hxBackpackLoaded;\n // Tell the edX page we're ready.\n let host = parent.parent.location.origin;\n parent.parent.postMessage('backpack_ready', host);\n } else {\n console.log('Not running in an iframe.');\n }\n\n console.log('setting state');\n // Make sure we're getting the right thing from edX.\n state_string = arguments.length === 1 ? arguments[0] : arguments[1];\n // edX stores the state as stringified JSON. Parse it.\n hx_state = JSON.parse(state_string);\n // We compressed the data element when we stored it. Decompress it.\n hx_state.data = JSON.parse(\n LZString.decompressFromEncodedURIComponent(hx_state.data)\n );\n // Keep the old one so we can discard changes if we need to.\n last_state = hx_state;\n // Set the live state appropriately.\n let box = document.getElementById('agree');\n if (hx_state.answer === true) {\n box.checked = true;\n document.getElementById('checkboxlabel').textContent = 'Thank you.';\n }\n }", "title": "" }, { "docid": "cfbf9d877cea77202eef8dc2c8069483", "score": "0.5619723", "text": "function main(initialHmrState) {\n\t return platform_browser_dynamic_1.bootstrap(app_1.App, browser_1.PLATFORM_PROVIDERS.concat(environment_1.ENV_PROVIDERS, app_1.APP_PROVIDERS))\n\t .then(environment_1.decorateComponentRef)\n\t .catch(function (err) { return console.error(err); });\n\t}", "title": "" }, { "docid": "075853facc6d665836e130db8e442c5c", "score": "0.55873597", "text": "setAppState(key, value) {\n\t\tthis.setState({ [key]: value });\t\t\n\t}", "title": "" }, { "docid": "ba881c138bfc61761fe9aca29b704fe1", "score": "0.5583531", "text": "setCurrentState(state) {\n\t\tif (this.user.conversationData) {\n\t\t\tthis.user.conversationData.currentState = state;\n\t\t}\n\t}", "title": "" }, { "docid": "5803d185c67cf7661706a4686d4eaecf", "score": "0.5578215", "text": "function AppState() {\n this.net = new Network();\n this.flowIdToFlow = {};\n this.flowFilter = $(\"#flow-filter\")[0];\n this.webSocket = new WebSocketAdapter(self, config);\n this.chartToData = {};\n this.chartToBars = {};\n this.chartToYLabels = {};\n this.maxLatInCurrWindow = 0;\n this.xLabels = [];\n this.timeValues = [];\n\n var t = getCurrTimeStr();\n for (var i = 0; i <= NUM_X_TICKS; i++) {\n this.timeValues.push(t);\n }\n}", "title": "" }, { "docid": "bed3209f0c184c47380cce8e04eaac63", "score": "0.5563193", "text": "function main(){\n\tconst initResult = initializeApp(); //Initial app state, background, etc.\n\t\n\t//If init had a problem, don't execute any code further\n\tif (initResult === false){\n\t\tconsole.error(\"The application has stopped because of an error during initialization.\");\n\t\treturn;\n\t}\n\n}", "title": "" }, { "docid": "5d9b504e9382ef78c6b3dfd9204bbd7d", "score": "0.5553632", "text": "constructor(props) {\n super(props);\n this.state={\n importedData: initialData[0].importedData,\n roadmapData: null, \n userSettings: APP_USER_SETTINGS,\n groupSettings: null,\n appSettings: APP_INIT_SETTINGS,\n roadmapPeriod: APP_ROADMAP_PERIOD,\n headerOption: APP_ROADMAP_HEADER_SETTINGS,\n actions: APP_INIT_ACTIONS,\n }\n this.updateState = this.updateState.bind(this);\n this.launchAppFunctions = this.launchAppFunctions.bind(this);\n this.handleKeyPress = this.handleKeyPress.bind(this);\n }", "title": "" }, { "docid": "b6ec94ddc355ca96a8dbf6189d191c72", "score": "0.55464923", "text": "get appServiceState() {\n return this.__appServiceState.get();\n }", "title": "" }, { "docid": "2a4f2b22095f093ebccf29dc95da3062", "score": "0.5541785", "text": "function initState(){\n active = stateCommands[stateIds.welcome];\n this.emit(':ask', active.value.call(this));\n}", "title": "" }, { "docid": "edc277e49889c111e9d274c71e24a672", "score": "0.55351233", "text": "function switchApp(appName) {\n //switch app, and remember mouse position\n save_mouse_position_for_now()\n api.launch(appName);\n restore_mouse_position_for_now()\n}", "title": "" }, { "docid": "d36d99ccb83248aa066c90897bd2a913", "score": "0.55198145", "text": "function testOne() {\n state += 2;\n controller.restartApplication('testTwo');\n}", "title": "" }, { "docid": "d83fbd3e1fbf14a6b6723e01aec74faa", "score": "0.5509847", "text": "function main() {\r\n const lIsPendant = window.location.hostname === '192.168.5.2';\r\n $('#estop-button').on('click', onEstopClicked)\r\n $('#app-launcher-button').on('click', onAppLauncherClicked);\r\n \r\n showContent();\r\n\r\n lGetMachineAppState().then(function(pState) {\r\n if (pState === undefined) {\r\n console.error('Failed to load the initial MachineApp state');\r\n return;\r\n }\r\n\r\n if (pState.isRunning) {\r\n onUpdateMessageReceived({\r\n timeSeconds: Date.now(),\r\n level: 'app_start',\r\n message: 'MachineApp is running'\r\n });\r\n \r\n if (pState.isPaused) {\r\n onUpdateMessageReceived({\r\n timeSeconds: Date.now(),\r\n level: 'app_pause',\r\n message: 'MachineApp is paused'\r\n });\r\n }\r\n }\r\n });\r\n\r\n connectToSocket();\r\n lGetEstop().then(function(pIsSet) {\r\n if (pIsSet) {\r\n console.log('Estop is active.');\r\n onEstopSet();\r\n }\r\n });\r\n\r\n if (lIsPendant) {\r\n // If we're on the pendant, we want to show the software keyboard\r\n // whenever someone touches an input. To do this, we scan the DOM\r\n // every 250 ms to add the keyboard if it is not present.\r\n keyboard_init();\r\n setInterval(keyboard_pre_bind, 250);\r\n }\r\n }", "title": "" }, { "docid": "04fda2024c825c9b6639ff584d6956ed", "score": "0.5478632", "text": "function _init() {\n _changeState();\n }", "title": "" }, { "docid": "0c797a9d8992e57c4471554208cfba7c", "score": "0.5464102", "text": "handleAppStateChange(nextAppState) {\n\n // If the app went to 'active' from 'background', refresh the mode\n if (this.currentState == 'background' && nextAppState == 'active') {\n this.refreshMode();\n }\n\n this.currentState = nextAppState;\n }", "title": "" }, { "docid": "c5acf037125baa70ec5786a7d376d6d5", "score": "0.545153", "text": "static set state(value) {}", "title": "" }, { "docid": "b2465a2d406ae16dff008a52d1b7a909", "score": "0.54286295", "text": "function LANDING_I___app_main() \n {\n //=========================\n // //\\\\ home8lemmas\n // //\\\\ sets ids and titles\n //===============================\n //ns.url2conf( fconf );\n sn( 'pathToContentSite', fconf, '.' );\n sn( 'sappId', fconf, 'home-pane' );\n ssF.spawns_lemsDefArr(); //converts ix to id, lemma ix \"is well established\"\n var lemBriefDef = fconf.sappId2lemmaDef[ fconf.sappId ];\n sapp.ix = lemBriefDef.ix;\n document.title = lemBriefDef.caption;\n fconf.sappIdUnCamel = nsmethods.camelName2cssName( fconf.sappId );\n //=========================\n // \\\\// sets ids and titles\n //===============================\n\n //===============================\n // //\\\\ preconstructs home8lemmas\n //===============================\n engCssMs.dispatchesHome8LemmaCss();\n html.builds_body_4_home8lemma();\n html.builds_homePane();\n //===============================\n // \\\\// preconstructs home8lemmas\n // \\\\// home8lemmas\n //=========================\n\n if( fconf.sappId === 'home-pane' ) {\n //// home. apparently does not do any modules landing-load\n LANDING_VII___landingFlag_8_nextLemmaButtons();\n sDomN.homeButton$().click();\n ns.doScrollToHash();\n } else {\n if( !haz( fconf, 'lemmaHasHomeButton' ) ) {\n sDomN.homeButton$.css( 'display', 'none' );\n }\n //// lemma\n LANDING_II___main_lemma( lemBriefDef );\n }\n }", "title": "" }, { "docid": "4b561f59144ea8711b6ee445a1acefe3", "score": "0.54193646", "text": "function Motivate() {\n BaseApp.call(this);\n}", "title": "" }, { "docid": "b6f684fc69f3092dee0f28cb10150f3c", "score": "0.54130816", "text": "start() {\n this.handle_start_application();\n }", "title": "" }, { "docid": "713b77a840f599f7bb3ffd263414817c", "score": "0.54110396", "text": "function switchStates(){\n //call various update based on appState\n\tvar dt = 16.0;\n\tswitch (appState){\n\t\t// case GAME_MODE.SPLASH:\n\t\t\t// splash();\n\t\t\t// garageDoor();\n\t\t// break;\n\t\t\n\t\tcase GAME_MODE.MAIN_MENU:\n\t\t\t//mainMenu();\n\t\t\t//console.log('main menu switch');\n\t\tbreak; \n\t\tcase GAME_MODE.SALE_VIEW:\n\t\t\tSaleView.update(dt);\n\t\tbreak;\n\t\tre.update();\n\t\tbreak;\n\t\t\n\t\tcase GAME_MODE.SLOTS:\n\t\t\t//slots.update();\n\t\t\t//slots();\n\t\t\t// setStatBar();\n\t\t break;\n\t\t\t\n\t\tdefault:\n\t\t\tGAME_MODE.RUNNING; \n\t\t\t\n\t\t// etc...\n\t}\n}", "title": "" }, { "docid": "315ea7729c9d8f9da355f92cc5d09408", "score": "0.5408412", "text": "function goToMainPage() {\n $state.go('main');\n }", "title": "" }, { "docid": "ba82b09f1f7ac23ba45f3eb3d633e837", "score": "0.5406971", "text": "function makeApp(initial={}) {\n\tvar app;\n\tvar rootEl;\n\tvar routes = [];\n\tvar bus = new EventBus();\n\tvar emit = bus.emit.bind(bus);\n\tvar state = new StateMap(initial, emit);\n\tvar onChangeState;\n\n\treturn (app = {\n\t\tstate,\n\t\troutes,\n\t\tupdate,\n\t\ton,\n\t\temit,\n\t\tmount: (el) => {\n\t\t\trootEl = el;\n\t\t\t// console.log('mount', rootEl, app);\n\t\t\ton('change', () => {\n\t\t\t\tframe(app);\n\t\t\t})\n\t\t\tframe(app);\n\t\t\temit('load');\n\t\t},\n\t\troute: (tester, route) => {\n\t\t\troutes.push([tester, route]);\n\t\t}\n\t})\n\n\tfunction on(evName, fn) {\n\t\treturn bus.on(evName, () => fn(state, update))\n\t}\n\n\tfunction update(newState) {\n\t\tfor([key, updatedVal] of Object.entries(newState)) {\n\t\t\tstate[key] = updatedVal;\n\t\t}\n\t}\n\n\tfunction findRoute() {\n\t\tfor(let [test, route] of routes) {\n\t\t\tif(test(state)) {\n\t\t\t\treturn route;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction frame() {\n\t\tvar route = findRoute();\n\t\tassert(route, 'found no route for state');\n\t\t// run the route with the current data (state)\n\t\t// and an emitter function for the state to\n\t\t// emit events on.\n\t\troute(state, emit)\n\t\t// .then(toHtmlStream)\n\t\t// .then(appendNodes)\n\t\t.then(result => {\n\t\t\t// TODO: Update the dom tree more graciously\n\t\t\trootEl.innerHTML = result;\n\t\t});\n\t}\n}", "title": "" }, { "docid": "5f8e2edf3f83109c4048613b37ed9516", "score": "0.53989786", "text": "function main($rootScope, $state) {\n console.info('client lance');\n\n $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams){\n console.warn('stateChangeStart : ' + toState.name);\n });\n}/* ! main */", "title": "" }, { "docid": "47600c78ae56eb00d622fad048bf7d78", "score": "0.5395968", "text": "reset() {\r\n\t\tthis.activeStateName = this.config.initial;\r\n\t}", "title": "" }, { "docid": "53d9444b2bdaaba4c64380d5542ae84c", "score": "0.5391659", "text": "sysPredictionButton () {\n this.state['sysPredictionChoice'] = true;\n //send back to app\n this.props.callbackFunction (this.state);\n }", "title": "" }, { "docid": "fe4bccf50e5f44f8f3bb17fac1d196ca", "score": "0.537589", "text": "function MainRun($rootScope, $state, $locale, ENV, MockService, amMoment, LoaderInterceptor, Analytics) {\n\n // Event listener - before state change\n $rootScope.$on('$stateChangeStart', function (event, toState, toStateParams) {\n $rootScope.toState = toState;\n $rootScope.toStateParams = toStateParams;\n });\n\n // Event listener - after state changed\n $rootScope.$on('$stateChangeSuccess', function (event, toState, toStateParams, fromState, fromStateParams) {\n $rootScope.previousStateName = fromState.name;\n $rootScope.previousStateParams = fromStateParams;\n });\n\n // Function to handle app back button states\n $rootScope.back = function () {\n if ($state.get($rootScope.previousStateName) === null) {\n $state.go('map');\n } else {\n $state.go($rootScope.previousStateName, $rootScope.previousStateParams);\n }\n };\n\n // Bind configuration values to main scope\n $rootScope.ENV = ENV;\n\n // Mock backend endpoints\n MockService.passThrough();\n\n // Angular moment locale set\n amMoment.changeLocale('hu');\n\n // Set group separator to space\n $locale.NUMBER_FORMATS.GROUP_SEP = ' ';\n\n // Ignore endpoints in loader interceptor\n LoaderInterceptor.addIgnoredEndpoint('facebook.com');\n LoaderInterceptor.addIgnoredEndpoint('googleapis.com');\n LoaderInterceptor.addIgnoredEndpoint(ENV.apiEndpoint + 'game');\n\n // Send a page view request to analytics\n Analytics.pageView();\n\n}", "title": "" }, { "docid": "04252adb695dd6a886c91c1baa60f624", "score": "0.53720117", "text": "function returnToMain() {\n clearTimer();\n toggleView();\n }", "title": "" }, { "docid": "0a287ac5b6875879810913fd5bd7a25e", "score": "0.5367699", "text": "function initializeState() {\n state.library = {};\n firstInit();\n}", "title": "" }, { "docid": "ca559c5be44dd23ee7bcf2080c852497", "score": "0.53676635", "text": "function setGameState(gamestate) {\n CURRENT_STATE = gamestate;\n executeState();\n}", "title": "" }, { "docid": "cdf13dd2dfc7cbf1fb6828d8011d7e80", "score": "0.53526044", "text": "initialize()\n {\n if (this._initialized)\n throw new Error(\"App controller is already initialized.\");\n\n this._initialized = true;\n\n // FIXME: eventually all code within WI.loaded should be distributed elsewhere.\n WI.loaded();\n }", "title": "" }, { "docid": "2d93c73b0bf91d06348c3f4b3ed34a1c", "score": "0.5343103", "text": "function checkState() {\n\tif ('appStarted' in bg) {\n\t\tinit();\n\t} else {\n\t\tsetTimeout(checkState, 100);\n\t}\n}", "title": "" }, { "docid": "77d8cf7a0be41e377933d5d3bf1720bb", "score": "0.5342042", "text": "function setAppSingleInstance (singleInstanceMode) {\n if(!singleInstanceMode) return;\n\n const lock = app.requestSingleInstanceLock()\n if(!lock) { \n app.quit()\n } else {\n app.on('second-instance', function(commandLine, workingDirectory) {\n // Someone tried to run a second instance, we should focus our window.\n if(mainWindow) {\n if (mainWindow.isMinimized()) mainWindow.restore();\n mainWindow.focus();\n }\n });\n }\n}", "title": "" }, { "docid": "4f42e4dcd8dc10d143a9545401efa59b", "score": "0.5334943", "text": "function reset() {\n appState = { HttpStatus: '0', Resource: null };\n}", "title": "" }, { "docid": "c6a2735f42c7cdaf0cbfd449c3b949a7", "score": "0.533383", "text": "function setworkingstates() {\n store.setStoreItem('working_basemap', false);\n store.setStoreItem('working_mapinfo', false);\n store.setStoreItem('working_zonalstats', false);\n store.setStoreItem('working_search', false);\n store.setStoreItem('working_s3retreive', false);\n store.setStoreItem('working_s3save', false);\n store.setStoreItem('working_drawlayers', false);\n}", "title": "" }, { "docid": "7c52732ce801f74b18bed95edb9d2ea3", "score": "0.5333565", "text": "constructor(){\n super()\n this.state = {\n activeView: \"DefaultView\",\n isHome: true,\n classes: \"App\",\n filter: \"body-filter filter-on\",\n pulse: \"pulse\",\n isOpen: false,\n screenSize: helpers.determineScreenSize()\n }\n this.setActiveView = this.setActiveView.bind(this);\n this.checkSize = this.checkSize.bind(this);\n this.toggleOpen = this.toggleOpen.bind(this);\n }", "title": "" }, { "docid": "86ab4c70e28a169366d30d77c642aec8", "score": "0.5330464", "text": "function initializeApp(){\n\t\n\tif (changeState(\"MENU\") === false) return false;\n\t//TODO: Make sure application configurations are valid:\n\t// - No negative level numbers\n\t// - There should be at least cardsPerLevel questions for each level if levelsEnabled is true\n\t// - There should be at least cardsIfNoLevel questions if levelsEnabled is false\n\t// - Discount identical questions from the count (related to the two points above)\n\t//TODO: Delete identical questions from the questions pool\n\t//TODO: load config from file (validate it previously, if not correct, throw alert and stop execution)\n\t//TODO: Add background to the app\n\tdocument.body.style.backgroundImage = \"url(\" + background + \")\";\n\tdocument.body.style.backgroundRepeat = \"repeat\";\n\t//TODO: [OPTIONAL] Add music\n\treturn true;\n}", "title": "" }, { "docid": "2ef6ecb41051f920e4450cc778352f98", "score": "0.5325406", "text": "startApp(){\n\t\tthis.mainView = new MainView(this.app);\n\t\tthis.app.stage.addChild(this.mainView);\n\t\tthis.app.start();\n\t}", "title": "" }, { "docid": "6848cd4b8bfa3edbca81458ca18c6c88", "score": "0.53158677", "text": "boot() {\n this.initialize();\n this.env = this.lookup(`environment:/${this.rootName}/main/main`);\n this._render();\n }", "title": "" }, { "docid": "ca27049d8154ec0ea26c8b9cad9e99e4", "score": "0.531133", "text": "static InitState() {}", "title": "" }, { "docid": "c89b0dfdca8dc6f9bca7676dec292969", "score": "0.5307239", "text": "reset() {\r\n\t\t\t\r\n\t\t\tthis.state = this.config['initial'];\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "9645c699240dff6f119e9dec778337fd", "score": "0.53013915", "text": "function RunMainBlock($rootScope, $state, $stateParams, $window, $amRoot) {\n $rootScope.$state = $state;\n $rootScope.$stateParams = $stateParams;\n\n // initialize database and default syncing mechanism with automint server\n $amRoot.initDb();\n }", "title": "" }, { "docid": "f96ed0a2d4c36d5ea9e0d61cbb387b8a", "score": "0.5290114", "text": "set state(value) {\n defineProperty(this, '_state$', {configurable: true, value: value});\n }", "title": "" }, { "docid": "09f42cb184a0f0f0ae8e580cd43fef58", "score": "0.5286182", "text": "updateContent(appStateModel) {\n const map = {\n home: HomeApp,\n footwear: FootwearApp,\n apparel: ApparelApp,\n story: StoryApp,\n give: GiveApp,\n contact: ContactApp,\n blog: BlogApp,\n notFound: NotFoundApp\n };\n this.app && this.app.close();\n const app = appStateModel.get('app');\n const Constructor = map[app];\n this.app = new Constructor({\n target: this.$('.js-content'),\n appState: this.appStateCollection.getAppStateModel(app)\n });\n this.app.render();\n }", "title": "" }, { "docid": "f1ecf9130ca58b7f357108a8544aac6c", "score": "0.5283382", "text": "function updateState() {\n if (!ui) {\n throw new Error(\n 'Cannot render UI without defining a node for the widget. Have you run `widget.attach()`?'\n );\n }\n const state = fsm.getCurrentState();\n const jobState = jobManager.getJob();\n try {\n FSMBar.showFsmBar({\n ui,\n state,\n job: jobState,\n });\n } catch (error) {\n console.warn('Could not display FSM state:', error);\n }\n\n if (!viewOnly && model.getItem('outdated')) {\n const outdatedBtn = ui.getElement('outdated');\n outdatedBtn.setAttribute(\n 'data-content',\n 'This app has a newer version available! ' +\n \"There's probably nothing wrong with this version, \" +\n 'but the new one may include new features. Add a new \"' +\n model.getItem('newAppName') +\n '\" app cell for the update.'\n );\n }\n\n let stateName;\n // hideous way to find the name of the current state\n for (const name of Object.keys(AppStates.STATE)) {\n if (_.isEqual(AppStates.STATE[name], state.state)) {\n stateName = name;\n break;\n }\n }\n\n // set the execMessage\n if (stateName && stateName in stateMessages) {\n setExecMessage(stateMessages[stateName]);\n } else if (jobState) {\n setExecMessage(Jobs.createJobStatusSummary(jobState));\n }\n\n // Tab state\n\n // TODO: let user-selection override auto-selection of tab, unless\n // the user-selected tab is no longer enabled or is hidden.\n\n // disable tab buttons\n // If current tab is not enabled in this state, then forget that the user\n // made a selection.\n\n const userStateTab = state.ui.tabs[selectedTabId()];\n if (!userStateTab || !userStateTab.enabled || userStateTab.hidden) {\n userSelectedTab = false;\n }\n\n let tabSelected = false;\n Object.keys(state.ui.tabs).forEach((tabId) => {\n const tab = state.ui.tabs[tabId];\n let tabState;\n if (tab instanceof Array) {\n tabState = tab.filter((mode) => {\n if (\n (mode.selector.viewOnly && viewOnly) ||\n (!mode.selector.viewOnly && !viewOnly)\n ) {\n return true;\n }\n })[0].settings;\n } else {\n tabState = tab;\n }\n tabState.enabled ? ui.enableButton(tabId) : ui.disableButton(tabId);\n\n // TODO honor user-selected tab.\n // Unless the tab is not enabled in this state, in which case\n // we do switch to the one called for by the state.\n if (tabState.selected && !userSelectedTab) {\n tabSelected = true;\n selectTab(tabId);\n }\n tabState.hidden ? ui.hideButton(tabId) : ui.showButton(tabId);\n });\n // If no new tabs selected (even re-selecting an existing open tab)\n // close the open tab.\n if (!tabSelected && !userSelectedTab) {\n unselectTab();\n }\n\n actionButtonWidget.setState(state.ui.actionButton);\n }", "title": "" }, { "docid": "a04173c0bb59c8edd3cb7d07b13ae831", "score": "0.52826613", "text": "function _setupStates() {\n\t\tvar g = this;\n\t\t// Setup default states (mostly menu controls)\n\t\t/*\n\t\tvar startMenu = function(){ \n\t\t\t//$('header, footer').show();\n\t\t};\n\t\tvar endMenu = function(){\n\t\t\t//$('header, footer').hide();\n\t\t}\n\t\t*/\n\t\tif (!g.state.hasState(\"boot\")) {\n\t\t\tg.state.addState({\n\t\t\t\tname: \"boot\",\n\t\t\t\tautoView: true\n\t\t\t});\n\t\t}\n\t\tif (!g.state.hasState(\"preload\")) {\n\t\t\tg.state.addState({\n\t\t\t\tname: \"preload\",\n\t\t\t\tautoView: true\n\t\t\t});\n\t\t}\n\t\tif (!g.state.hasState(\"game\")) {\n\t\t\tg.state.addState({\n\t\t\t\tname: \"game\"\n\t\t\t});\n\t\t}\n\n\t\t/*\n\t\tg.state.addStates({\n\t\t\t\"boot\": { \t\tautoView: true },\n\t\t\t\"preload\": { \tautoView: true },\n\t\t\t\"mainmenu\": { \tautoView: true, start: startMenu, end: endMenu },\n\t\t\t\"new\": { \t\tautoView: true, start: startMenu, end: endMenu },\n\t\t\t\"save\": { \t\tautoView: true, start: startMenu, end: endMenu },\n\t\t\t\"load\": { \t\tautoView: true, start: startMenu, end: endMenu },\n\t\t\t\"help\": { \t\tautoView: true, start: startMenu, end: endMenu },\n\t\t\t\"settings\": { \tautoView: true, start: startMenu, end: endMenu },\n\t\t\t\"credits\": { \tautoView: true, start: startMenu, end: endMenu },\n\t\t\t\"share\": { \t\tautoView: true, start: startMenu, end: endMenu },\t\n\t\t\t\"game\": {}\n\t\t});\n\t\t*/\n\t\t/*\n\t\tg.state.add(\"game\",{\n\t\t\tstart : function(){\n\t\t\t\t$('header, footer').hide();\n\t\t\t\tthis.$view.show();\n\t\t\t}, end : function(){\n\t\t\t\t$('header, footer').show();\n\t\t\t\tthis.$view.hide();\n\t\t\t}\n\t\t});\n\t\t*/\n\t\t\n\t\t//g.state.get(\"game\").$view.show();\n\n\t\tg.state._setupTransitionLinks();\n\t\tg.state.start(\"boot\");\n\t\treturn g;\n\t}", "title": "" }, { "docid": "34bafa2bac3405c67d08c418c4f8101c", "score": "0.52810246", "text": "enterState() {\n (0, _utils.fireAllMethodsInArray)(this.options.onFirstRun, this.eventData('firstRun'));\n (0, _utils.fireAllMethodsInArray)(this.options.onEnter, this.eventData('enter'));\n this.options.onFirstRun = [];\n this.active = true;\n }", "title": "" }, { "docid": "e7500d10d6efb2107c572eaa697ee4d8", "score": "0.52654135", "text": "function setupApplication () {\n\n // Print build information\n console.info(`Build: ${Application.build()}`);\n console.info(`Build identifier: ${Application.build_identifier()}`);\n console.info(`Platform: ${Application.platform()}`);\n console.info(`System information: ${Application.sysinfo()}`);\n\n // Print settings.ini\n let settings = Application.settings();\n console.log(`Settings \\r\\n${JSON.stringify(settings, null, 2)}`, settings);\n\n Window.set_show_cursor(null, true, true);\n Window.set_clip_cursor(null, false);\n Window.set_mouse_focus(null, true);\n\n let args = Application.argv();\n console.info(`Arguments: ${args.join(' ')}`);\n }", "title": "" }, { "docid": "fe9eebfe9dfb26372ffc434ae1169185", "score": "0.52650607", "text": "constructor(){\n super()\n this.state = {\n activeView: \"DefaultView\",\n isHome: true,\n classes: \"App\",\n filter: \"body-filter filter-on\",\n pulse: \"pulse\",\n screenSize: helpers.determineScreenSize()\n }\n this.setActiveView = this.setActiveView.bind(this);\n this.checkSize = this.checkSize.bind(this);\n }", "title": "" }, { "docid": "45aa43bad9c4278ac1ab3fb68cda3b47", "score": "0.52623296", "text": "set state(stateObj) {\n this.view.setState(stateObj);\n }", "title": "" }, { "docid": "920b2b43ac9eae78b33265ff9239b0d3", "score": "0.5249063", "text": "onNewState (state) {\n scena.setState(state);\n }", "title": "" }, { "docid": "afa69fcc4a2aabd7c792b833de147843", "score": "0.5241157", "text": "initMain() {\n this.initUtilities();\n this.initModelMethods();\n this.turnOnHacks();\n this.initInterface();\n this.applyModel();\n this.initComponents();\n this.makeExtraSubscriptions();\n this.start();\n }", "title": "" }, { "docid": "1fa671a2fe1ccb8b59ebe13fb1759ada", "score": "0.523657", "text": "function main(){\n getApp()\n}", "title": "" }, { "docid": "58e4bfa53cfd403089700a258486dee4", "score": "0.5231573", "text": "performSetup(){\n\t\t// Only allow to perform this setup once.\n\t\tif(this.ee){ return; }\n\n\t\t// Setup eventemitter.\n\t\tthis.ee = new EventEmitter();\n\t\tthis.on = this.ee.on.bind(this);\n\t\tthis.emit = this.ee.emit.bind(this);\n\n\t\t// Setup state.\n\t\tthis.state = this.getDefaultState();\n\t\tthis.set(this.getSavedState());\n\n\t\tthis.setApi();\n\t}", "title": "" }, { "docid": "71c59d3c4fd2d4df24f53dc6136f70cf", "score": "0.5227462", "text": "function defaultActiveStateChangeHandler(state) {\n ActiveStore.updateState(state);\n}", "title": "" }, { "docid": "63d6a415eddcb9daa3735e8d77c06aec", "score": "0.5226017", "text": "run() {\n APP.Model.ACTIONS = APP.ACTIONS;\n // run application step by step\n APP.initLogs();\n APP.initModulesAndPlugins();\n APP.catchErrors();\n APP.runMainModulesAndPlugins();\n }", "title": "" }, { "docid": "b04503f1ebd8f3d581bd6b3ed233ed66", "score": "0.52234805", "text": "handle_start_application() {\n // Show interface elements\n this.view.get(EL.text_title).show();\n this.view.get(EL.button_start).show();\n this.view.get(EL.text_question).show();\n }", "title": "" }, { "docid": "a569e48f1931990439443cb705ded723", "score": "0.5222561", "text": "function loadApplication() {\n console.log(\"Application Loaded.\");\n showMainMenu();\n}", "title": "" }, { "docid": "eef767de54e5f7849b022b9a3160c2e5", "score": "0.5215647", "text": "function InitApplication() {\n DataExtReportFieldsCtrl.ePage.Masters.Application = {};\n DataExtReportFieldsCtrl.ePage.Masters.Application.OnApplicationChange = OnApplicationChange;\n }", "title": "" }, { "docid": "21ed8a98d385d18b60ae41e23619192e", "score": "0.521519", "text": "function setGlobalState(nextState) {\n state = {\n ...state,\n ...nextState\n };\n draw();\n}", "title": "" }, { "docid": "96681f3c5739fdaece0aee81781349f5", "score": "0.5214155", "text": "function resetGlobalState() {\n\t var defaultGlobals = new MobXGlobals();\n\t for (var key in defaultGlobals)\n\t if (persistentKeys.indexOf(key) === -1)\n\t globalState[key] = defaultGlobals[key];\n\t globalState.allowStateChanges = !globalState.enforceActions;\n\t}", "title": "" }, { "docid": "df38df618d8ce95433e9e9d5574ccc77", "score": "0.5209914", "text": "setUIstate(str) {\n this.state.currentPlayerUIstate = str;\n }", "title": "" }, { "docid": "3af88ffee7956eaffacde74936d987e5", "score": "0.52096575", "text": "function state() { }", "title": "" }, { "docid": "5dc1e7d543a37ed6e8529b19b1c7fec2", "score": "0.52086866", "text": "function getAppState() {\n\treturn {\n\t\trooms: RoomStore.getRooms(),\n\t\tselected_room: RoomStore.getSelectedRoom(),\n\t\tselected_price_type_id: 2, // other // not used now !!!\n\t\treg_type_prices: RoomStore.getRegTypePrices(),\n\t\tselected_beds: RoomStore.getSelectedBeds(),\n\t\tnights_count: RoomStore.getNightsCount(),\n\t\tselected_upsells: RoomStore.get_selected_upsells(),\n\n\t\tselected_reg_types: RoomStore.get_selected_reg_types(),\n\t\tsuitable_reg_types: RoomStore.get_suitable_reg_types(),\n\n\t\tselected_reg_items: RoomStore.get_selected_reg_items(),\n\t\tsuitable_reg_items: RoomStore.get_suitable_reg_items(),\n\n\t\tlate_reg_start: RoomStore.get_late_reg_start(),\n\t\tselected_meals: RoomStore.get_selected_meals(),\n\t\tselected_queries: RoomStore.get_selected_queries(),\n\t\tbooking_id: false,\n\t\tpayment_id: false,\n\t\temail: '[email protected]'\n\t};\n}", "title": "" }, { "docid": "13707305c08ff8ae851da018644f2e6f", "score": "0.51961035", "text": "reset() {\r\n this.state = this.config.initial; \r\n }", "title": "" }, { "docid": "07c1b7eb75cda4cafe000b212b73071b", "score": "0.5195624", "text": "function SetMenuState() {\n var menuIcon = $('.main-menu-icon');\n var menuBox = $('.top-bar-right ul');\n //var menuWrap = $('.top-bar-right');\n\n menuBox.toggleClass('main-menu-open');\n menuIcon.toggleClass('hover');\n if (menuBox.hasClass('main-menu-open')) {\n localStorage.setItem('lastState', 'on');\n } else {\n localStorage.setItem('lastState', 'off');\n }\n }", "title": "" }, { "docid": "9c66d1fa896ceaef2c0bdf5b129c04e0", "score": "0.5190536", "text": "OPEN (state) {\n state.activationRequested = true\n }", "title": "" }, { "docid": "817d7679ea4bbe3fec0d5c659645445c", "score": "0.5184116", "text": "handleMainStateChanged(state) {\n this.log.error('Display: Implement me: '+this.handleMainStateChanged.name);\n }", "title": "" }, { "docid": "f93bcf814ba75a0467640d7830d6e131", "score": "0.51806307", "text": "function onMain() {\n console.log(\"on main\");\n fin.System.getVersion()\n .then(version => {\n const ofVersion = document.querySelector('#of-version');\n ofVersion.innerText = version;\n fin.Window.getCurrentSync().getOptions()\n .then(opts => {\n serverPort = opts.customData;\n console.log(\"Server Port: \" + serverPort);\n }).catch(err => console.log(err));\n }).catch(err => {\n console.log(\"Error Retrieving Runtime version: \" + err);\n });\n setTrayIcon()\n .then(\n clickInfo => console.log(clickInfo)).catch(err => console.log(err)\n );\n buildContent();\n}", "title": "" }, { "docid": "2b3a9a2b4d8500af63a0085494effb78", "score": "0.5179808", "text": "function Awake() {\n\t\tif( instance == null )\n\t\t{\n\t\t\tinstance = this;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDebug.LogError( \"Cannot instantiate StateManager twice !\" );\n\t\t}\n\n\t\tinit( );\n\t\tstate = defaultState;\n\t}", "title": "" }, { "docid": "1128c60b2891a84f62606e3d6fe10e95", "score": "0.5176055", "text": "function initAppliDesktop() {\n return;\n}", "title": "" }, { "docid": "1128c60b2891a84f62606e3d6fe10e95", "score": "0.5176055", "text": "function initAppliDesktop() {\n return;\n}", "title": "" }, { "docid": "85490a9023f3c9922c71daef7cb621e8", "score": "0.5173209", "text": "changeState(state) {\n this.state = state;\n this.showUIByState();\n }", "title": "" }, { "docid": "1b5adf86aeac84fa7a395089206cf657", "score": "0.5171969", "text": "reset() {\r\n this.state = this.config.initial;\r\n }", "title": "" }, { "docid": "36c9fdc84ec01a61b9a712ebb384b02a", "score": "0.5168806", "text": "function Application(){\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "a076f6844b3f6c049970c608f97c3b41", "score": "0.5157802", "text": "hackUIController() {\n const { navigationUIController } = this.props;\n\n // see: @atlaskit/navigation-next/dist/esm/ui-controller/UIController.js\n const orgStoreState = navigationUIController.storeState;\n navigationUIController.storeState = async(state) => {\n await navigationUIController.setState(state);\n orgStoreState(state);\n };\n }", "title": "" }, { "docid": "a1054814da74c87ad6de5cc8160dcfa1", "score": "0.51570296", "text": "set state(newState) {\n this.currentState = newState;\n this.show();\n }", "title": "" }, { "docid": "d7b6b1c8084ce1eb812c67259d91d196", "score": "0.51470053", "text": "function initApp() {\r\n if (!appInitialized) {\r\n appInitialized = true;\r\n nw.Window.get().hide();\r\n\r\n nw.App.on(\"open\", function(args) {\r\n editorManager.addWindow(args);\r\n });\r\n\r\n editorManager.addWindow((nw.App.argv.length > 0) ? nw.App.argv[0] : \"\");\r\n }\r\n }", "title": "" }, { "docid": "f0adaac3c31d3e3c1282026d417033f8", "score": "0.5144499", "text": "function setCurrentPage(newCurrentPage) {\n App.State.set({currentPage: newCurrentPage});\n }", "title": "" }, { "docid": "9b024707f961feb0bf5eebf10823760e", "score": "0.51413226", "text": "function GetAppStateOnPageLoad(){\n Contract.currentState().then(function(result){\n switch(result){\n case 0:\n GetAmountToPay();\n AppState0();\n break;\n case 1:\n AppState1();\n break;\n case 2:\n AppState2();\n break;\n case 3:\n AppState3();\n break;\n }\n });\n}", "title": "" } ]
8abad629a77a17ccc50332422cd9d401
conversion from rbg to xyz
[ { "docid": "1fc59a909a2c9e1a7f06dfdeb3e086f4", "score": "0.60197663", "text": "function RGBtoXYZ(r, b, g) {\n let _R = r / 255;\n let _G = g / 255;\n let _B = b / 255;\n // adjusting the R variable\n if (_R > 0.04045) {\n _R = Math.pow(((_R + 0.055) / 1.055), 2.4)\n } else {\n _R = _R / 12.92\n }\n // Adjusting the G variable\n if (_G > 0.04045) {\n _G = Math.pow(((_G + 0.055) / 1.055), 2.4)\n } else {\n _G = _G / 12.92\n }\n // Adjusting the B variable\n if (_B > 0.04045) {\n _B = Math.pow(((_B + 0.055) / 1.055), 2.4)\n } else {\n _B = _B / 12.92\n }\n // a final adjustment to them all\n _R = _R * 100;\n _G = _G * 100;\n _B = _B * 100;\n // getting the X Y and Z values\n let X = _R * 0.4124 + _G * 0.3576 + _B * 0.1805;\n let Y = _R * 0.2126 + _G * 0.7152 + _B * 0.0722;\n let Z = _R * 0.0193 + _G * 0.1192 + _B * 0.9505;\n return[X,Y,Z]\n}", "title": "" } ]
[ { "docid": "8b2934724469da81ad6338bbde91eb28", "score": "0.7022159", "text": "toXYZ() {\r\n let y = (this.l * 100 + 16) / 116;\r\n let x = this.a / 5 + y;\r\n let z = y - this.b / 2;\r\n [x, y, z] = [x, y, z].map((v) => {\r\n const v3 = v * v * v;\r\n return (v3 > 0.008856451) ? v3 : (v - 16 / 116) / 7.787037;\r\n });\r\n return new XYZColor_1.XYZColor(x * XYZColor_1.XYZColor.D65.x, y * XYZColor_1.XYZColor.D65.y, z * XYZColor_1.XYZColor.D65.z);\r\n }", "title": "" }, { "docid": "d3bca5d65fa187ba9a66ebaa81d07c5b", "score": "0.6891279", "text": "function rgbToXyz(r,g,b) {\n\tvar _r = ( r / 255 );\n\tvar _g = ( g / 255 );\n\tvar _b = ( b / 255 );\n\n\tif ( _r > 0.04045 ) {\n\t\t_r = Math.pow(( ( _r + 0.055 ) / 1.055 ), 2.4);\n\t}\n\telse {\n\t\t_r = _r / 12.92;\n\t}\n\n\tif ( _g > 0.04045 ) {\n\t\t_g = Math.pow(( ( _g + 0.055 ) / 1.055 ), 2.4);\n\t}\n\telse { \n\t\t_g = _g / 12.92;\n\t}\n\n\tif ( _b > 0.04045 ) {\n\t\t_b = Math.pow(( ( _b + 0.055 ) / 1.055 ), 2.4);\n\t}\n\telse { \n\t\t_b = _b / 12.92;\n\t}\n\n\t_r = _r * 100;\n\t_g = _g * 100;\n\t_b = _b * 100;\n\n\t//Observer. = 2°, Illuminant = D65\n\tX = _r * 0.4124 + _g * 0.3576 + _b * 0.1805;\n\tY = _r * 0.2126 + _g * 0.7152 + _b * 0.0722;\n\tZ = _r * 0.0193 + _g * 0.1192 + _b * 0.9505;\n\n\treturn [X, Y, Z];\n}", "title": "" }, { "docid": "6646eca8551f6c2f4dcd798257e752ad", "score": "0.6625032", "text": "function rgbToXyz(r, g, b) {\r\n var _r = (r / 255);\r\n var _g = (g / 255);\r\n var _b = (b / 255);\r\n\r\n if (_r > 0.04045) {\r\n _r = Math.pow(((_r + 0.055) / 1.055), 2.4);\r\n }\r\n else {\r\n _r = _r / 12.92;\r\n }\r\n\r\n if (_g > 0.04045) {\r\n _g = Math.pow(((_g + 0.055) / 1.055), 2.4);\r\n }\r\n else {\r\n _g = _g / 12.92;\r\n }\r\n\r\n if (_b > 0.04045) {\r\n _b = Math.pow(((_b + 0.055) / 1.055), 2.4);\r\n }\r\n else {\r\n _b = _b / 12.92;\r\n }\r\n\r\n _r = _r * 100;\r\n _g = _g * 100;\r\n _b = _b * 100;\r\n\r\n X = _r * 0.4124 + _g * 0.3576 + _b * 0.1805;\r\n Y = _r * 0.2126 + _g * 0.7152 + _b * 0.0722;\r\n Z = _r * 0.0193 + _g * 0.1192 + _b * 0.9505;\r\n\r\n return [X, Y, Z];\r\n }", "title": "" }, { "docid": "5dd127bcf0d85fbea5cb05488938f129", "score": "0.64256096", "text": "xyz() {\n const { r, g, b } = this;\n return rgb2xyz(r, g, b);\n }", "title": "" }, { "docid": "5dd127bcf0d85fbea5cb05488938f129", "score": "0.64256096", "text": "xyz() {\n const { r, g, b } = this;\n return rgb2xyz(r, g, b);\n }", "title": "" }, { "docid": "e0a5d788254a3f2173ac2d4c218be89f", "score": "0.63795185", "text": "function rgbToXyz(rgb){\n var _r = (rgb[0] / 255);\n var _g = (rgb[1] / 255);\n var _b = (rgb[2] / 255);\n \n if (_r > 0.04045) {\n _r = Math.pow(((_r + 0.055) / 1.055), 2.4);\n }\n else {\n _r = _r / 12.92;\n }\n \n if (_g > 0.04045) {\n _g = Math.pow(((_g + 0.055) / 1.055), 2.4);\n }\n else { \n _g = _g / 12.92;\n }\n \n if (_b > 0.04045) {\n _b = Math.pow(((_b + 0.055) / 1.055), 2.4);\n }\n else { \n _b = _b / 12.92;\n }\n \n _r = _r * 100;\n _g = _g * 100;\n _b = _b * 100;\n \n X = _r * 0.4124 + _g * 0.3576 + _b * 0.1805;\n Y = _r * 0.2126 + _g * 0.7152 + _b * 0.0722;\n Z = _r * 0.0193 + _g * 0.1192 + _b * 0.9505;\n \n return [X, Y, Z];\n}", "title": "" }, { "docid": "723538d2e072dc9b60f40fed375449ae", "score": "0.61388516", "text": "function x2R (xyz) {\n var X = xyz[0] / 100,\n Y = xyz[1] / 100,\n Z = xyz[2] / 100,\n T = 1 / 2.4;\n\n var R = X * 3.2406 + Y * -1.5372 + Z * -0.4986,\n G = X * -0.9689 + Y * 1.8758 + Z * 0.0415,\n B = X * 0.0557 + Y * -0.2040 + Z * 1.0570;\n\n R = 255 * (R > 0.0031308? 1.055 * Math.pow (R, T) - 0.055 : 12.92 * R);\n G = 255 * (G > 0.0031308? 1.055 * Math.pow (G, T) - 0.055 : 12.92 * G);\n B = 255 * (B > 0.0031308? 1.055 * Math.pow (B, T) - 0.055 : 12.92 * B);\n\n return [R, G, B, xyz[3]];\n }", "title": "" }, { "docid": "1b5db3d97f1c8b7cd0f52d8bd34e1e2f", "score": "0.6092633", "text": "function RGBtoXYZ(rgb) {\n var red2 = rgb[0] / 255;\n var green2 = rgb[1] / 255;\n var blue2 = rgb[2] / 255;\n if (red2 > 0.04045) {\n red2 = (red2 + 0.055) / 1.055;\n red2 = Math.pow(red2, 2.4);\n }\n else {\n red2 = red2 / 12.92;\n }\n if (green2 > 0.04045) {\n green2 = (green2 + 0.055) / 1.055;\n green2 = Math.pow(green2, 2.4);\n }\n else {\n green2 = green2 / 12.92;\n }\n if (blue2 > 0.04045) {\n blue2 = (blue2 + 0.055) / 1.055;\n blue2 = Math.pow(blue2, 2.4);\n }\n else {\n blue2 = blue2 / 12.92;\n }\n red2 = (red2 * 100);\n green2 = (green2 * 100);\n blue2 = (blue2 * 100);\n var x = (red2 * 0.4124) + (green2 * 0.3576) + (blue2 * 0.1805);\n var y = (red2 * 0.2126) + (green2 * 0.7152) + (blue2 * 0.0722);\n var z = (red2 * 0.0193) + (green2 * 0.1192) + (blue2 * 0.9505);\n var xyzresult = new Array();\n xyzresult[0] = x;\n xyzresult[1] = y;\n xyzresult[2] = z;\n return(xyzresult);\n}", "title": "" }, { "docid": "d5ca79921a80c6b2670b7e0af242ba14", "score": "0.60369414", "text": "function XYZtoLAB(xyz) {\n var x = xyz[0];\n var y = xyz[1];\n var z = xyz[2];\n var x2 = x / 95.047;\n var y2 = y / 100;\n var z2 = z / 108.883;\n if (x2 > 0.008856) {\n x2 = Math.pow(x2, 1 / 3);\n }\n else {\n x2 = (7.787 * x2) + (16 / 116);\n }\n if (y2 > 0.008856) {\n y2 = Math.pow(y2, 1 / 3);\n }\n else {\n y2 = (7.787 * y2) + (16 / 116);\n }\n if (z2 > 0.008856) {\n z2 = Math.pow(z2, 1 / 3);\n }\n else {\n z2 = (7.787 * z2) + (16 / 116);\n }\n var l = 116 * y2 - 16;\n var a = 500 * (x2 - y2);\n var b = 200 * (y2 - z2);\n var labresult = new Array();\n labresult[0] = l;\n labresult[1] = a;\n labresult[2] = b;\n return labresult;\n}", "title": "" }, { "docid": "05c5b8e91e20ae0b21c15451849d62c5", "score": "0.60295314", "text": "function xyzToLab(x, y, z) {\n var ref_X = 95.047;\n var ref_Y = 100.000;\n var ref_Z = 108.883;\n\n var _X = x / ref_X; //ref_X = 95.047 Observer= 2°, Illuminant= D65\n var _Y = y / ref_Y; //ref_Y = 100.000\n var _Z = z / ref_Z; //ref_Z = 108.883\n\n if ( _X > 0.008856 ) {\n\n \t_X = Math.pow(_X, ( 1/3 ));\n }\n else { \n \t_X = ( 7.787 * _X ) + ( 16 / 116 );\n }\n\n if ( _Y > 0.008856 ) {\n \t_Y = Math.pow(_Y, ( 1/3 ));\n }\n else {\n _Y = ( 7.787 * _Y ) + ( 16 / 116 );\n }\n\n if ( _Z > 0.008856 ) {\n \t_Z = Math.pow(_Z, ( 1/3 ));\n }\n else { \n \t_Z = ( 7.787 * _Z ) + ( 16 / 116 );\n }\n\n var CIE_L = ( 116 * _Y ) - 16;\n var CIE_a = 500 * ( _X - _Y );\n var CIE_b = 200 * ( _Y - _Z );\n\n\treturn [CIE_L, CIE_a, CIE_b];\n}", "title": "" }, { "docid": "da3f55cf2147966c78d1e4ed10bc8aed", "score": "0.5993599", "text": "function xyzToLab(xyz){\n var ref_X = 95.047;\n var ref_Y = 100.000;\n var ref_Z = 108.883;\n \n var _X = xyz[0] / ref_X;\n var _Y = xyz[1] / ref_Y;\n var _Z = xyz[2] / ref_Z;\n \n if (_X > 0.008856) {\n _X = Math.pow(_X, (1/3));\n }\n else { \n _X = (7.787 * _X) + (16 / 116);\n }\n \n if (_Y > 0.008856) {\n _Y = Math.pow(_Y, (1/3));\n }\n else {\n _Y = (7.787 * _Y) + (16 / 116);\n }\n \n if (_Z > 0.008856) {\n _Z = Math.pow(_Z, (1/3));\n }\n else { \n _Z = (7.787 * _Z) + (16 / 116);\n }\n \n var CIE_L = (116 * _Y) - 16;\n var CIE_a = 500 * (_X - _Y);\n var CIE_b = 200 * (_Y - _Z);\n \n return [CIE_L, CIE_a, CIE_b];\n}", "title": "" }, { "docid": "de835415054fe0d020fb69c6a7579f3e", "score": "0.5892359", "text": "function XYZtoLAB(x, y, z){\n let _X = x / 95.047;\n let _Y = y / 100;\n let _Z = z / 108.883;\n // doin the thang to X\n if (_X > 0.008856) {\n _X = Math.pow(_X, 1/3)\n } else {\n _X = (7.787 * _X) + (16 / 116)\n }\n // doin the thang to Z\n if (_Y > 0.008856) {\n _Y = Math.pow(_Y, 1/3)\n } else {\n _Y = (7.787 * _Y) + (16 / 116)\n }\n // doin the thang to Z\n if (_Z > 0.008856) {\n _Z = Math.pow(_Z, 1/3)\n } else {\n _Z = (7.787 * _Z) + (16 / 116)\n }\n let L = ( 116 * _Y ) - 16;\n let a = 500 * ( _X - _Y );\n let b = 200 * ( _Y - _Z );\n return[L,a,b]\n}", "title": "" }, { "docid": "f718b2d372f87e847f1e5eb5388eecd6", "score": "0.58872527", "text": "function xyz_rgb(c) {\n return 255 * (c <= 0.00304 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055);\n }", "title": "" }, { "docid": "c2abfd7d2196c6dacb90dcf77e5b8c21", "score": "0.5863068", "text": "function rgb_xyz(c) {\n if ((c /= 255) <= 0.04045)\n return c / 12.92;\n return Math.pow((c + 0.055) / 1.055, 2.4);\n }", "title": "" }, { "docid": "13207a49d6f3f6662baa277ab12b8aee", "score": "0.57226175", "text": "function xyzToLab(x, y, z) {\r\n var ref_X = 95.047;\r\n var ref_Y = 100.000;\r\n var ref_Z = 108.883;\r\n\r\n var _X = x / ref_X;\r\n var _Y = y / ref_Y;\r\n var _Z = z / ref_Z;\r\n\r\n if (_X > 0.008856) {\r\n _X = Math.pow(_X, (1 / 3));\r\n }\r\n else {\r\n _X = (7.787 * _X) + (16 / 116);\r\n }\r\n\r\n if (_Y > 0.008856) {\r\n _Y = Math.pow(_Y, (1 / 3));\r\n }\r\n else {\r\n _Y = (7.787 * _Y) + (16 / 116);\r\n }\r\n\r\n if (_Z > 0.008856) {\r\n _Z = Math.pow(_Z, (1 / 3));\r\n }\r\n else {\r\n _Z = (7.787 * _Z) + (16 / 116);\r\n }\r\n\r\n var CIE_L = (116 * _Y) - 16;\r\n var CIE_a = 500 * (_X - _Y);\r\n var CIE_b = 200 * (_Y - _Z);\r\n\r\n return [CIE_L, CIE_a, CIE_b];\r\n }", "title": "" }, { "docid": "879c6e3a3f815de13e19bf2acd48bb8f", "score": "0.55740535", "text": "function xyz2lab(xyz, w, h) {\n\t function f(x) {\n\t if (x > 0.00856)\n\t return Math.pow(x, 0.33333333);\n\t else\n\t return 7.78706891568 * x + 0.1379310336;\n\t }\n\t var xw = 1.0 / 3.0,\n\t yw = 1.0 / 3.0,\n\t Yw = 1.0,\n\t Xw = xw / yw,\n\t Zw = (1-xw-yw) / (yw * Yw),\n\t ix = 1.0 / Xw,\n\t iy = 1.0 / Yw,\n\t iz = 1.0 / Zw,\n\t labData = new Float32Array(3*w*h);\n\t for (var i = 0; i<w*h; i++) {\n\t var fx = f(xyz[i] * ix),\n\t fy = f(xyz[w*h + i] * iy),\n\t fz = f(xyz[2*w*h + i] * iz);\n\t labData[i] = 116.0 * fy - 16.0;\n\t labData[i + w*h] = 500.0 * (fx - fy);\n\t labData[i + 2*w*h] = 200.0 * (fy - fz);\n\t }\n\t return labData;\n\t }", "title": "" }, { "docid": "fbfc240b1cc759256150b2ba4065a0d3", "score": "0.5557444", "text": "function rgb2xyz(rgba, w, h) {\n\t var xyz = new Float32Array(3*w*h),\n\t gamma = 2.2;\n\t for (var i = 0; i<w*h; i++) {\n\t // 1.0 / 255.9 = 0.00392156862.\n\t var r = rgba[4*i+0] * 0.00392156862,\n\t g = rgba[4*i+1] * 0.00392156862,\n\t b = rgba[4*i+2] * 0.00392156862;\n\t r = Math.pow(r, gamma);\n\t g = Math.pow(g, gamma);\n\t b = Math.pow(b, gamma);\n\t xyz[i] = (r * 0.4887180 + g * 0.310680 + b * 0.2006020);\n\t xyz[i + w*h] = (r * 0.1762040 + g * 0.812985 + b * 0.0108109);\n\t xyz[i + 2*w*h] = (g * 0.0102048 + b * 0.989795);\n\t }\n\t return xyz;\n\t }", "title": "" }, { "docid": "ff771f2eac3b129ee4c06819f4725500", "score": "0.5521119", "text": "toSRGB() {\r\n return this.toXYZ().toRGB().toSRGB();\r\n }", "title": "" }, { "docid": "84b38170fcd76d9e56b59e0117eafb33", "score": "0.5477213", "text": "static XYZtoLAB(xyz, normalizedInput = false, normalizedOutput = false) {\n let c = (normalizedInput) ? xyz.$normalize(false) : xyz.clone();\n // adjust for D65 \n c.divide(Color.D65);\n let fn = (n) => (n > 0.008856) ? Math.pow(n, 1 / 3) : (7.787 * n) + 16 / 116;\n let cy = fn(c[1]);\n let cc = Color.lab((116 * cy) - 16, 500 * (fn(c[0]) - cy), 200 * (cy - fn(c[2])), xyz.alpha);\n return (normalizedOutput) ? cc.normalize() : cc;\n }", "title": "" }, { "docid": "4cc7e40dfc34608245b29260d5d60017", "score": "0.5449338", "text": "toRGB() {\r\n return this.toXYZ().toRGB();\r\n }", "title": "" }, { "docid": "b041867382c48216a19253fd254153ed", "score": "0.53157145", "text": "function getXYZ(array) {\n\t\tdebug('Running getXYZ on ' + array);\n\t\tvar xyz = {};\n\n\t\t// console.log(array);\n\n\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\tswitch (array[i][0].toLowerCase()) {\n\t\t\t\tcase 'x':\n\t\t\t\t\txyz.x = scale(parseFloat(array[i].substring(1)));\n\t\t\t\t\tdebug('\\tX was determined to be ' + xyz.x);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\txyz.y = scale(parseFloat(array[i].substring(1))) * -1;\n\t\t\t\t\tdebug('\\tY was determined to be ' + xyz.y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'z':\n\t\t\t\t\txyz.z = scale(parseFloat(array[i].substring(1)));\n\t\t\t\t\tdebug('\\tZ was determined to be ' + xyz.z);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tdebug('\\tTranslating the coordinates to the visual origin.');\n\t\tdebug('\\tReturn values:')\n\n\t\treturn translateToVisualOrigin(xyz);\n\t}", "title": "" }, { "docid": "f8740b85a4cd4db6fb3d60070750722e", "score": "0.5293148", "text": "static LABtoXYZ(lab, normalizedInput = false, normalizedOutput = false) {\n let c = (normalizedInput) ? lab.$normalize(false) : lab;\n let y = (c[0] + 16) / 116;\n let x = (c[1] / 500) + y;\n let z = y - c[2] / 200;\n let fn = (n) => {\n let nnn = n * n * n;\n return (nnn > 0.008856) ? nnn : (n - 16 / 116) / 7.787;\n };\n let d = Color.D65;\n // adjusted\n let cc = Color.xyz(\n // Math.max(0, Math.min( 100, d[0] * fn(x) )),\n // Math.max(0, Math.min( 100, d[1] * fn(y) )),\n // Math.max(0, Math.min( 100, d[2] * fn(z) )),\n Math.max(0, d[0] * fn(x)), Math.max(0, d[1] * fn(y)), Math.max(0, d[2] * fn(z)), lab.alpha);\n return (normalizedOutput) ? cc.normalize() : cc;\n }", "title": "" }, { "docid": "b6e86b31817d65ec6320e34a353d777f", "score": "0.5278874", "text": "toExtended(r) {\n r.X.mul(this.X, this.Z);\n r.Y.mul(this.Y, this.Z);\n r.Z.square(this.Z);\n r.T.mul(this.X, this.Y);\n }", "title": "" }, { "docid": "8f466313b1ec80e0bb30b7f2cb2d7798", "score": "0.5256341", "text": "hcg() {\n const { r, g, b } = this;\n return rgb2hcg(r, g, b);\n }", "title": "" }, { "docid": "8f466313b1ec80e0bb30b7f2cb2d7798", "score": "0.5256341", "text": "hcg() {\n const { r, g, b } = this;\n return rgb2hcg(r, g, b);\n }", "title": "" }, { "docid": "f61365429ee25a262ed2b2b82a290d43", "score": "0.52302986", "text": "function xytoz(x, y) {\n return `${x}+${y}`;\n}", "title": "" }, { "docid": "dc058fff85c23452d4b239b7a57d8029", "score": "0.5229177", "text": "function write_Blxf(data,o){if(!o)o=new_buf(10);o.write_shift(1,0);/* dg */o.write_shift(1,0);o.write_shift(4,0);/* color */o.write_shift(4,0);/* color */return o;}", "title": "" }, { "docid": "69b39221790da3fc0b62f816a7f5e13b", "score": "0.52274257", "text": "function readxyz(xx : int, yy:int,zz:int){\n\n\tvar dataList = mySource[0].Split(\"\\t\"[0]);\n\tvar s = \"Clone\";\n\n\tAxis.transform.GetChild(0).gameObject.transform.GetChild(0).gameObject.GetComponent(TextMesh).text = \"X : \" + dataList[xx];\n\tAxis.transform.GetChild(2).gameObject.transform.GetChild(0).gameObject.GetComponent(TextMesh).text = \"Y : \" + dataList[yy];\n\tAxis.transform.GetChild(1).gameObject.transform.GetChild(0).gameObject.GetComponent(TextMesh).text = \"Z : \" + dataList[zz];\n\tvar str1 = \"X: \" + dataList[xx] + \"\\tY: \" + dataList[yy] + \"\\tZ: \" + dataList[zz];\n\taxisCanvas.text = str1;\n\n\tfor(var i=1; i<mySource.length-3; i++){\n\n\t\tvar str = s + i;\n\t\tvar go :GameObject = GameObject.Find(str);\n\t\tif(go==null)\tcontinue;\n\n\t\tvar pos = go.transform.position;\n\t\tpos = -pos;\n\n\t\tdataList = mySource[i].Split(\"\\t\"[0]);\n\t\tif(dataList.Length >1){\n\n\t\t\tx=y=z=0;\n\n\t\t\tif (dataList[xx]==\"\") dataList[xx]=\"0\";\n\t\t\tx = parseFloat(dataList[xx]);\n\t\t\tif (dataList[yy]==\"\") dataList[yy]=\"0\";\n\t\t\ty = parseFloat(dataList[yy]);\n\t\t\tif (dataList[zz]==\"\") dataList[zz]=\"0\";\n\t\t\tz = parseFloat(dataList[zz]);\n\n\t\t\tvar xPct : float = (x -xMinMax[0])/ (xMinMax[1] - xMinMax[0]);\n\t\t\tx = (xPct *(axesMinMax[1] - axesMinMax[0])) + axesMinMax[0];\n\t\t\tvar yPct : float = (y -yMinMax[0])/ (yMinMax[1] - yMinMax[0]);\n\t\t\ty = (yPct *(axesMinMax[1] - axesMinMax[0])) + axesMinMax[0];\n\t\t\tvar zPct : float = (z -zMinMax[0])/ (zMinMax[1] - zMinMax[0]);\n\t\t\tz = (zPct *(axesMinMax[1] - axesMinMax[0])) + axesMinMax[0];\n\n\t\t\tpos += Vector3(x,y,z);\n\t\t\tgo.transform.Translate(pos,Space.World);\t\n\n\t\t}\t\n\t}\n}", "title": "" }, { "docid": "dae39b4ab66f083ca48998da9233150b", "score": "0.515893", "text": "function sterilize(xyzcoords) {\n var lines = xyzcoords.split(\"\\n\");\n var out = \"\";\n for (l in lines) {\n\tvar line = lines[l];\n\tif (typeof line != \"string\") continue;\n\t//removes whitespace\n\t//console.log(line);\n\tline = line.replace(/^\\s*/g, '').replace(/\\s*$/g, '');\n\tline = line.replace(/[ ]{2,}|\\t/g, ' ');\n\t//checks if the regex matches proper form\n\t//ex C 0 -.1 1.2e-4 valid number formats\n\tline = line.replace(/^((?!([a-zA-Z]{1,2}([ \\t]-?(\\d+\\.?\\d*|\\.\\d+)(e-?\\d+)?){3})).)*$/, '');\n\t//console.log(line);\n\tif (line != \"\") {\n\t if (l == 0) {\n\t\tout += line;\n\t } else {\n\t\tout +=\"\\n\" + line;\n\t }\n\t}\n }\n return out;\n}", "title": "" }, { "docid": "08b9465861e9947233664f663c47a0a9", "score": "0.5147259", "text": "function x2L (xyz) {\n var X = xyz[0] / 95.047,\n Y = xyz[1] / 100,\n Z = xyz[2] / 108.883,\n T = 1 / 3,\n K = 16 / 116;\n\n X = X > 0.008856? Math.pow (X, T) : (7.787 * X) + K;\n Y = Y > 0.008856? Math.pow (Y, T) : (7.787 * Y) + K;\n Z = Z > 0.008856? Math.pow (Z, T) : (7.787 * Z) + K;\n\n var L = (116 * Y) - 16,\n a = 500 * (X - Y),\n b = 200 * (Y - Z);\n\n return [L, a, b, xyz[3]];\n }", "title": "" }, { "docid": "3372d89ed4b319d98d37ff79ed8c96ff", "score": "0.5137071", "text": "static ria_to_xyz(radius, inclination, azimuth){\n return [radius * Math.sin(inclination) * Math.cos(azimuth), //x\n radius * Math.sin(inclination) * Math.sin(azimuth), //y\n radius * Math.cos(inclination)] //z\n }", "title": "" }, { "docid": "b763170c31d97081d2ee085a898e34fd", "score": "0.51179564", "text": "function ZePicLZjGzCAjldytpcXXA() {}", "title": "" }, { "docid": "be28f275d2acfc6d54aab824a2842845", "score": "0.51137334", "text": "lab2cmyk(lab) {\n\tlet xyz = lab2xyz(lab)\n\tlet rgb = xyz2rgb(xyz)\n\tlet cmyk = rgb2cmyk(rgb);\n\tconsole.log(\"xyz\", xyz)\n\tconsole.log(\"rgb\",rgb)\n\tconsole.log(\"cmyk\",cmyk)\n return cmyk;\n }", "title": "" }, { "docid": "ff41c39f502d7449121ed7747854d465", "score": "0.511126", "text": "function gf(a){this.bg=a;this.Og=\"\";this.tm=new RegExp(this.Ea,\"g\")}", "title": "" }, { "docid": "a77f5efda2096d00fd49dc1724ce199b", "score": "0.50845796", "text": "function hcc2hgs(x, y, z, B0, L0) {\n if (typeof z == \"undefined\") z = Math.sqrt(RSUN_REF * RSUN_REF - x * x - y * y);\n var r = Math.sqrt(x * x + y * y + z * z);\n var lat = Math.asin((y * Math.cos(B0) + z * Math.sin(B0)) / r);\n var lng = L0 + Math.atan2(x, z * Math.cos(B0) - y * Math.sin(B0));\n if (lng < 0) lng = lng + 2 * Math.PI;\n if (lng > 2 * Math.PI) lng = lng - 2 * Math.PI;\n return [lng, lat, r];\n}", "title": "" }, { "docid": "17286dbc1a4af38efbd4a3de6694c6e2", "score": "0.5084525", "text": "function sph2xyz(obj) {\n\n arr = [obj.r * Math.cos(obj.ph) * Math.cos(obj.th),\n obj.r * Math.cos(obj.ph) * Math.sin(obj.th),\n obj.r * Math.sin(obj.ph)];\n\n return {x: arr[0], y: arr[1], z: arr[2], arr:arr};\n}", "title": "" }, { "docid": "df10cda523122af2c8f10371b26a58a8", "score": "0.50787276", "text": "function coordsXYToZ(x, y) {\t\r\n\tx = parseInt(x);\r\n\ty = parseInt(y);\r\n\tvar coordZ = (x + 401) + ((400 - y) * 801);\r\n\treturn coordZ;\r\n}", "title": "" }, { "docid": "8bd70437bc1fa0be6772f554158bbb5e", "score": "0.50781286", "text": "function convertBackplaneNumbers() {\n var used;\n\n used = initUsed2();\n for(var y0 = 0; y0 < h; y0++) {\n for(var x0 = line0[y0]; x0 < line1[y0]; x0++) {\n if(used[y0][x0]) continue;\n if (world[y0][x0].metasymbol != 'g') continue;\n\n var number = world[y0][x0].number;\n var dir = -1;\n\n for(var i = 0; i < 4; i++) { // N, E, S, W\n var x2 = x0 + ((i == 1) ? 1 : ((i == 3) ? -1 : 0));\n var y2 = y0 + ((i == 0) ? -1 : ((i == 2) ? 1 : 0));\n if(x2 < 0 || x2 >= w || y2 < 0 || y2 >= h) continue;\n var c2 = world[y2][x2].metasymbol;\n if(!digitmap[c2]) continue;\n if(world[y2][x2].numbertype != NUMBER_GLOBAL) continue;\n dir = i;\n break;\n }\n\n if(dir == -1) continue;\n\n var stack = [[x0, y0]];\n used[y0][x0] = true;\n\n var array = [];\n while (stack.length) {\n var s = stack.pop();\n var x = s[0];\n var y = s[1];\n if(x < 0 || x >= w || y < 0 || y >= h) continue;\n if (world[y][x].numbertype != NUMBER_GLOBAL) continue;\n var c = world[y][x].metasymbol;\n if(array.length > 0 && !digitmap[c]) continue; // g's themselves don't interact\n array.push(s);\n\n var i = dir;\n var x2 = x + ((i == 1) ? 1 : ((i == 3) ? -1 : 0));\n var y2 = y + ((i == 0) ? -1 : ((i == 2) ? 1 : 0));\n if(x2 < 0 || x2 >= w || y2 < 0 || y2 >= h) continue;\n if(used[y2][x2]) continue;\n stack.push([x2, y2]);\n used[y2][x2] = true;\n if (world[y2][x2].numbertype < NUMBER_GLOBAL) world[y2][x2].numbertype = NUMBER_GLOBAL;\n }\n\n for(var i = 0; i < array.length; i++) {\n var x = array[i][0];\n var y = array[i][1];\n if(!digitmap[world[y][x].metasymbol]) continue;\n world[y][x].circuitsymbol = 'g';\n world[y][x].number = number;\n world[y][x].circuitextra = (dir & 1) + 1;\n }\n }\n }\n}", "title": "" }, { "docid": "a22e256cd30e7392fec4abcfdccef7e0", "score": "0.50715834", "text": "function g3ZawgyiConverter(zawgyi_in) {\n\n // output = output.replace(patttern, replacement);\n\n}", "title": "" }, { "docid": "23e82a916b3e45ce61e834a0488bf96c", "score": "0.50626534", "text": "function GoogleCloud() {}", "title": "" }, { "docid": "01afee3e4f013ea3fefed2d492660d71", "score": "0.5060353", "text": "function objsonConvert(source){\n\tsource = source.replace(/^#[\\x20-\\x7e]+\\s$/gm, '');\n\tsource = source.replace(/^g[\\x20-\\x7e]+\\s$/gm, '');\n\tsource = source.replace(/^g\\s$/gm, '');\n\tsource = source.replace(/\\x20{2,}/gm, '\\x20');\n\tsource = source.replace(/^\\s/gm, '');\n\tvar rows = source.match(/[\\x20-\\x7e]+\\s/gm);\n\tvar i, j, k, l;\n\tvar a, b, c, d;\n\tvar len, dest, fNormal;\n\tvar pos = 0;\n\tvar nor = 0;\n\tvar tex = 0;\n\tvar position = [];\n\tvar normal = [];\n\tvar texCoord = [];\n\tvar vertex = [];\n\tvar index = [];\n\tvar indices = [];\n\tfor(i = 0, len = rows.length; i < len; i++){\n\t\tswitch(rows[i].substr(0, 2)){\n\t\t\tcase 'v ':\n\t\t\t\ta = rows[i].match(/-?[\\d\\.]+(e(?=-)?|e(?=\\+)?)?[-\\+\\d\\.]*/g);\n\t\t\t\tif(vertex[pos] == null){\n\t\t\t\t\tvertex[pos] = new objsonVertexData();\n\t\t\t\t\tvertex[pos].faceIndex = [];\n\t\t\t\t}\n\t\t\t\tvertex[pos].position = [a[0], a[1], a[2]];\n\t\t\t\tpos++;\n\t\t\t\tbreak;\n\t\t\tcase 'vn':\n\t\t\t\ta = rows[i].match(/-?[\\d\\.]+(e(?=-)?|e(?=\\+)?)?[-\\+\\d\\.]*/g);\n\t\t\t\tif(vertex[nor] == null){\n\t\t\t\t\tvertex[nor] = new objsonVertexData();\n\t\t\t\t\tvertex[nor].faceIndex = [];\n\t\t\t\t}\n\t\t\t\tvertex[nor].normal = [a[0], a[1], a[2]];\n\t\t\t\tnor++;\n\t\t\t\tbreak;\n\t\t\tcase 'vt':\n\t\t\t\ta = rows[i].match(/-?[\\d\\.]+(e(?=-)?|e(?=\\+)?)?[-\\+\\d\\.]*/g);\n\t\t\t\tif(vertex[tex] == null){\n\t\t\t\t\tvertex[tex] = new objsonVertexData();\n\t\t\t\t\tvertex[tex].faceIndex = [];\n\t\t\t\t}\n\t\t\t\tvertex[tex].texCoord = [a[0], a[1]];\n\t\t\t\ttex++;\n\t\t\t\tbreak;\n\t\t\tcase 'f ':\n\t\t\t\ta = rows[i].match(/[\\d\\/]+/g);\n\t\t\t\tindex.push(a[0], a[1], a[2]);\n\t\t\t\tif(a.length > 3){\n\t\t\t\t\tindex.push(a[2], a[3], a[0]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif(nor === 0){\n\t\tj = index.length / 3;\n\t\tfNormal = new Array(j);\n\t\tfor(i = 0; i < j; i++){\n\t\t\ta = index[i * 3 ].split(/\\//);\n\t\t\tb = index[i * 3 + 1].split(/\\//);\n\t\t\tc = index[i * 3 + 2].split(/\\//);\n\t\t\tfNormal[i] = faceNormal(vertex[a[0] - 1].position, vertex[b[0] - 1].position, vertex[c[0] - 1].position);\n\t\t\tvertex[a[0] - 1].faceIndex.push(i);\n\t\t\tvertex[b[0] - 1].faceIndex.push(i);\n\t\t\tvertex[c[0] - 1].faceIndex.push(i);\n\t\t}\n\t\tfor(i = 0; i < pos; i++){\n\t\t\ta = [0.0, 0.0, 0.0];\n\t\t\tb = vertex[i].faceIndex;\n\t\t\tk = b.length;\n\t\t\tfor(j = 0; j < k; j++){\n\t\t\t\ta[0] += parseFloat(fNormal[b[j]][0]);\n\t\t\t\ta[1] += parseFloat(fNormal[b[j]][1]);\n\t\t\t\ta[2] += parseFloat(fNormal[b[j]][2]);\n\t\t\t}\n\t\t\tvertex[i].normal = vec3Normalize(a);\n\t\t}\n\t}\n\tfor(i = 0, len = index.length; i < len; i++){\n\t\tj = Math.floor(i / 3);\n\t\ta = index[i].split(/\\//);\n\t\tk = a[0] - 1;\n\t\tif(indices[k] == null){\n\t\t\tindices[k] = new objsonVertexData();\n\t\t\tindices[k].position = k;\n\t\t}\n\t\tif(a[2] != null){\n\t\t\tif(a[2] !== ''){\n\t\t\t\tif(indices[k].normal == null){\n\t\t\t\t\tindices[k].normal = a[2] - 1;\n\t\t\t\t}else{\n\t\t\t\t\tif(indices[k].normal !== a[2] - 1){\n\t\t\t\t\t\tindices[pos] = new objsonVertexData();\n\t\t\t\t\t\tindices[pos].position = k;\n\t\t\t\t\t\tindices[pos].normal = a[2] - 1;\n\t\t\t\t\t\tk = pos;\n\t\t\t\t\t\tpos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(a[1] != null){\n\t\t\tif(a[1] !== ''){\n\t\t\t\tif(indices[k].texCoord == null){\n\t\t\t\t\tindices[k].texCoord = a[1] - 1;\n\t\t\t\t}else{\n\t\t\t\t\tif(indices[k].texCoord !== a[1] - 1){\n\t\t\t\t\t\tindices[pos] = new objsonVertexData();\n\t\t\t\t\t\tindices[pos].position = a[0] - 1;\n\t\t\t\t\t\tif(a[2] != null){\n\t\t\t\t\t\t\tif(a[2] !== ''){\n\t\t\t\t\t\t\t\tindices[pos].normal = a[2] - 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindices[pos].texCoord = a[1] - 1;\n\t\t\t\t\t\tk = pos;\n\t\t\t\t\t\tpos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tindex[i] = k;\n\t}\n\tfor(i = 0, len = indices.length; i < len; i++){\n\t\ta = indices[i];\n\t\tb = []; c = []; d = [];\n\t\tif(a != null){\n\t\t\tk = a.position;\n\t\t\tb = vertex[k].position;\n\t\t\tposition[i * 3] = b[0];\n\t\t\tposition[i * 3 + 1] = b[1];\n\t\t\tposition[i * 3 + 2] = b[2];\n\t\t\tif(nor > 0){k = a.normal;}\n\t\t\tc = vertex[k].normal;\n\t\t\tnormal[i * 3] = c[0];\n\t\t\tnormal[i * 3 + 1] = c[1];\n\t\t\tnormal[i * 3 + 2] = c[2];\n\t\t\tif(tex > 0){\n\t\t\t\tk = a.texCoord;\n\t\t\t\td = vertex[k].texCoord;\n\t\t\t\ttexCoord[i * 2] = d[0];\n\t\t\t\ttexCoord[i * 2 + 1] = d[1];\n\t\t\t}\n\t\t}else{\n\t\t\tb = vertex[i].position;\n\t\t\tposition[i * 3] = b[0];\n\t\t\tposition[i * 3 + 1] = b[1];\n\t\t\tposition[i * 3 + 2] = b[2];\n\t\t\tc = vertex[i].normal;\n\t\t\tnormal[i * 3] = c[0];\n\t\t\tnormal[i * 3 + 1] = c[1];\n\t\t\tnormal[i * 3 + 2] = c[2];\n\t\t\tif(tex > 0){\n\t\t\t\td = vertex[i].texCoord;\n\t\t\t\ttexCoord[i * 2] = d[0];\n\t\t\t\ttexCoord[i * 2 + 1] = d[1];\n\t\t\t}\n\t\t}\n\t}\n\tdest = '{';\n\tdest += '\"vertex\":' + indices.length;\n\tdest += ',\"face\":' + index.length / 3;\n\tdest += ',\"position\":[' + position.join(',') + ']';\n\tdest += ',\"normal\":[' + normal.join(',') + ']';\n\tif(tex > 0){dest += ',\"texCoord\":[' + texCoord.join(',') + ']';}\n\tdest += ',\"index\":[' + index.join(',') + ']';\n\tdest += '}';\n\treturn dest;\n}", "title": "" }, { "docid": "b6de20a283270dce9b21bff3aaf316cf", "score": "0.50596374", "text": "function parseBackplanes() {\n for(var y = 0; y < h; y++) {\n for(var x = line0[y]; x < line1[y]; x++) {\n var c = world[y][x].circuitsymbol;\n if(c == 'g') {\n var n = world[y][x].number;\n if(!backplanes_g[n]) backplanes_g[n] = [];\n backplanes_g[n].push([x, y]);\n }\n }\n }\n}", "title": "" }, { "docid": "f90fb03eac702fb62b30a8c4f320c1bc", "score": "0.5054915", "text": "function parse_RgceLoc(blob,length,opts){if(opts&&opts.biff>=2&&opts.biff<=5)return parse_RgceLoc_BIFF2(blob,length,opts);var r=blob.read_shift(opts&&opts.biff==12?4:2);var c=parse_ColRelU(blob,2);return{r:r,c:c[0],cRel:c[1],rRel:c[2]};}", "title": "" }, { "docid": "2db9ccc5c978a7efbb5090668f2a69cc", "score": "0.50522345", "text": "function qam64Type(d){\n console.log(d); \n var msb = d.Symbol.slice(0,3);\n var lsb = d.Symbol.slice(3,6);\n //msb = msb.toString(10);\n //lsb = lsb.toString(10);\n \n console.log(\"msb: \" + msb + \" lsb: \" + lsb);\n //d.x = msb;\n //d.y = lsb;\n switch(msb){\n case '000':\n d.x = -7;\n break;\n case '001':\n d.x = -5;\n break;\n case '011':\n d.x = -3;\n break; \n case '010':\n d.x = -1;\n break;\n case '110':\n d.x = 1;\n break;\n case '111':\n d.x = 3;\n break;\n case '101':\n d.x = 5;\n break;\n case '100':\n d.x = 7;\n break; \n default:\n d.x = 0; \n }\n switch(lsb){\n case '000':\n d.y = -7;\n break;\n case '001':\n d.y = -5;\n break;\n case '011':\n d.y = -3;\n break; \n case '010':\n d.y = -1;\n break;\n case '110':\n d.y = 1;\n break;\n case '111':\n d.y = 3;\n break;\n case '101':\n d.y = 5;\n break;\n case '100':\n d.y = 7;\n break; \n default:\n d.y = 0; \n } \n d.fill = \"Transparent\";\n //console.log(\"x: \" + d.x + \" y: \" + d.y); \n return d;\n}", "title": "" }, { "docid": "cb36a56640292f2b99aad42a522d1803", "score": "0.504262", "text": "function gr(a,b){this.ye=[];this.Vf=a;this.Jf=b||null;this.Kd=this.gd=!1;this.fc=void 0;this.nf=this.kg=this.Ge=!1;this.Ae=0;this.Xa=null;this.He=0}", "title": "" }, { "docid": "e03b53d88d9e3166273dbdd4583982cf", "score": "0.50383055", "text": "function convertToOligoB(seq) {\n var startsWithG = seq[0] === 'g';\n var seqRC = reverseComplement(seq);\n\n if (startsWithG) {\n return 'AAAC' + seqRC;\n } else {\n return 'AAAC' + seqRC + 'C';\n }\n}", "title": "" }, { "docid": "a750a2c7f46dcebcaf85b2e8733d64b6", "score": "0.50276524", "text": "_namedColorToRBA(str) {\r\n var c = COLORS[str.toLowerCase()];\r\n if (!c) {\r\n return null;\r\n }\r\n return {\r\n r: c[0],\r\n g: c[1],\r\n b: c[2],\r\n a: 1,\r\n };\r\n }", "title": "" }, { "docid": "183288521396f9af5c87f0bb9795252c", "score": "0.50135845", "text": "function r2X (rgb) {\n var R = rgb[0] / 255,\n G = rgb[1] / 255,\n B = rgb[2] / 255;\n\n R = 100 * (R > 0.04045? Math.pow ((R + 0.055) / 1.055, 2.4) : R / 12.92);\n G = 100 * (G > 0.04045? Math.pow ((G + 0.055) / 1.055, 2.4) : G / 12.92);\n B = 100 * (B > 0.04045? Math.pow ((B + 0.055) / 1.055, 2.4) : B / 12.92);\n\n var X = R * 0.4124 + G * 0.3576 + B * 0.1805,\n Y = R * 0.2126 + G * 0.7152 + B * 0.0722,\n Z = R * 0.0193 + G * 0.1192 + B * 0.9505;\n\n return [X, Y, Z, rgb[3]];\n }", "title": "" }, { "docid": "5043b325b6a2479c30a9ff73596270d0", "score": "0.5011097", "text": "function makeString()\n\t{\n\t\tvar _ret = \"\";\n\t\tif(p.m == 0)\n\t\t{\n\t\t\t_ret = \"<i>y</i> = \"+p.b;\n\t\t}else if(p.b == 0)\n\t\t{\n\t\t\t_ret += \"<i>y</i> = \";\n\t\t\t_ret += p.m != undefined ? p.m == 1 ? \"\" : p.m == -1 ? \"-\" : p.m : \"<i>m</i>\";\n\t\t\t_ret += \"<i>x</i>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t_ret = \"<i>y</i> = \";\n\t\t\t_ret += p.m != undefined ? p.m == 1 ? \"\" : p.m == -1 ? \"-\" : p.m : \"<i>a</i>\";\n\t\t\t_ret += p.m > 0 || p.m < 0 ? \"<i>x</i>\" : \"\";\n\t\t\t_ret += p.b != undefined && p.m != undefined && p.b > 0? \" + \" : p.b < 0 ? \" - \" :\"\";\n\t\t\t_ret += p.b != undefined ? Math.abs(p.b) : \"\";\n\t\t\t//_ret += \"<i>x</i>\";\n\t\t}\n\t\treturn _ret;\n\t}", "title": "" }, { "docid": "30163eb7db7d0e1ad77c864261fe96ee", "score": "0.50100684", "text": "get mathXYZ() {\n return [this.E, this.N, this.height];\n }", "title": "" }, { "docid": "7c18f57d85183e9a1a54dc9e58901a31", "score": "0.49750826", "text": "function g(t) {\n return t.substr(24, 12) + t.substr(19, 4) + t.substr(16, 2) + t.substr(14, 2) + t.substr(11, 2) + t.substr(9, 2) + t.substr(6, 2) + t.substr(4, 2) + t.substr(2, 2) + t.substr(0, 2);\n }", "title": "" }, { "docid": "eee2167f2432452dfbcf6c4f101ad28d", "score": "0.4951497", "text": "function xyz_to_rgb(cs,\n xc, yc, zc\n /* *r, *g, *b*/)\n{\n var xr, yr, zr, xg, yg, zg, xb, yb, zb;\n var xw, yw, zw;\n var rx, ry, rz, gx, gy, gz, bx, by, bz;\n var rw, gw, bw;\n\n xr = cs.xRed; yr = cs.yRed; zr = 1 - (xr + yr);\n xg = cs.xGreen; yg = cs.yGreen; zg = 1 - (xg + yg);\n xb = cs.xBlue; yb = cs.yBlue; zb = 1 - (xb + yb);\n\n xw = cs.xWhite; yw = cs.yWhite; zw = 1 - (xw + yw);\n\n /* xyz -> rgb matrix, before scaling to white. */\n\n rx = (yg * zb) - (yb * zg); ry = (xb * zg) - (xg * zb); rz = (xg * yb) - (xb * yg);\n gx = (yb * zr) - (yr * zb); gy = (xr * zb) - (xb * zr); gz = (xb * yr) - (xr * yb);\n bx = (yr * zg) - (yg * zr); by = (xg * zr) - (xr * zg); bz = (xr * yg) - (xg * yr);\n\n /* White scaling factors.\n Dividing by yw scales the white luminance to unity, as conventional. */\n\n rw = ((rx * xw) + (ry * yw) + (rz * zw)) / yw;\n gw = ((gx * xw) + (gy * yw) + (gz * zw)) / yw;\n bw = ((bx * xw) + (by * yw) + (bz * zw)) / yw;\n\n /* xyz -> rgb matrix, correctly scaled to white. */\n\n rx = rx / rw; ry = ry / rw; rz = rz / rw;\n gx = gx / gw; gy = gy / gw; gz = gz / gw;\n bx = bx / bw; by = by / bw; bz = bz / bw;\n\n /* rgb of the desired point */\n\n return [(rx * xc) + (ry * yc) + (rz * zc) /*r*/,\n (gx * xc) + (gy * yc) + (gz * zc) /*g*/,\n (bx * xc) + (by * yc) + (bz * zc) /*b*/];\n}", "title": "" }, { "docid": "2bde23805824197a11cfcf173071865e", "score": "0.49484694", "text": "rgb2bgr(rgb) {\n const bgr = rgb.match(/.{2}/g).reverse().join('');\n return bgr;\n }", "title": "" }, { "docid": "0fec7381c3ab7fdbfb3f0c292bb1a25e", "score": "0.49480313", "text": "get animation () {\n return (this.bbgData[13] << 24) + (this.bbgData[14] << 16) + (this.bbgData[15] << 8) + this.bbgData[16]\n }", "title": "" }, { "docid": "3922999363bca9b2a9c6f924cb346160", "score": "0.4947834", "text": "function Zg(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}", "title": "" }, { "docid": "553bd10c69603e09cd37e4c70b439edf", "score": "0.49455783", "text": "function parse_RgceArea_BIFF2(blob){var r=parse_ColRelU(blob,2),R=parse_ColRelU(blob,2);var c=blob.read_shift(1);var C=blob.read_shift(1);return{s:{r:r[0],c:c,cRel:r[1],rRel:r[2]},e:{r:R[0],c:C,cRel:R[1],rRel:R[2]}};}", "title": "" }, { "docid": "280bccc35ec40a025835c2f0a7c9831b", "score": "0.49402758", "text": "function RGBtoXY(red, green, blue, model)\n{\n\n if(red > 1 || green > 1 || blue > 1)\n {\n red /= 255;\n green /= 255;\n blue /= 255;\n }\n\n red = (red > 0.04045) ? Math.pow((red + 0.055) / (1.0 + 0.055), 2.4) : (red / 12.92);\n green = (green > 0.04045) ? Math.pow((green + 0.055) / (1.0 + 0.055), 2.4) : (green / 12.92);\n blue = (blue > 0.04045) ? Math.pow((blue + 0.055) / (1.0 + 0.055), 2.4) : (blue / 12.92);\n\n var X = red * 0.649926 + green * 0.103455 + blue * 0.197109;\n var Y = red * 0.234327 + green * 0.743075 + blue * 0.022598;\n var Z = red * 0.0000000 + green * 0.053077 + blue * 1.035763;\n\n var cx = X / (X + Y + Z);\n var cy = Y / (X + Y + Z);\n\n if (isNaN(cx)) {\n cx = 0.0;\n }\n\n if (isNaN(cy)) {\n cy = 0.0;\n }\n\n//Check if the given XY value is within the colourreach of our lamps.\n var xyPoint = XYPoint(cx, cy);\n\n var colorPoints = colorPointsForModel(model);\n\n var inReachOfLamps = checkPointInLampsReach(xyPoint, colorPoints);\n\n if (!inReachOfLamps)\n {\n //It seems the colour is out of reach\n //let's find the closest colour we can produce with our lamp and send this XY value out.\n\n //Find the closest point on each line in the triangle.\n\n var pAB =getClosestPointToPoints( colorPoints[cptRED], colorPoints[cptGREEN], xyPoint);\n\n var pAC =getClosestPointToPoints( colorPoints[cptBLUE], colorPoints[cptRED], xyPoint);\n\n var pBC =getClosestPointToPoints( colorPoints[cptGREEN], colorPoints[cptBLUE], xyPoint);\n\n //Get the distances per point and see which point is closer to our Point.\n var dAB = getDistanceBetweenTwoPoints(xyPoint, pAB);\n var dAC = getDistanceBetweenTwoPoints(xyPoint, pAC);\n var dBC = getDistanceBetweenTwoPoints(xyPoint, pBC);\n\n var lowest = dAB;\n\n var closestPoint = pAB;\n\n if (dAC < lowest) {\n lowest = dAC;\n closestPoint = pAC;\n }\n if (dBC < lowest) {\n lowest = dBC;\n closestPoint = pBC;\n }\n\n //Change the xy value to a value which is within the reach of the lamp.\n cx = closestPoint.x;\n cy = closestPoint.y;\n }\n\n return {\n x: cx,\n y: cy,\n bri: Y\n };\n}", "title": "" }, { "docid": "fa5ce4d9d6fb2e46fdfe96452950ac75", "score": "0.49241358", "text": "function parse_Rgce(blob,length,opts){var target=blob.l+length;var R,id,ptgs=[];while(target!=blob.l){length=target-blob.l;id=blob[blob.l];R=PtgTypes[id];if(id===0x18||id===0x19)R=(id===0x18?Ptg18:Ptg19)[blob[blob.l+1]];if(!R||!R.f){/*ptgs.push*/parsenoop(blob,length);}else{ptgs.push([R.n,R.f(blob,length,opts)]);}}return ptgs;}", "title": "" }, { "docid": "ba10441133f130d548f36c027782086a", "score": "0.49207324", "text": "function Yg(a){this.zg=a;this.og=[];new Float32Array(0)}", "title": "" }, { "docid": "70f6bc4c4926ec5cda2db88ee3bc7d76", "score": "0.49191788", "text": "_rgbaColorToRGBA(str) {\r\n if (str.indexOf('rgba(') === 0) {\r\n str = str.match(/rgba\\(([^)]+)\\)/)[1];\r\n var parts = str.split(/ *, */).map(Number);\r\n return {\r\n r: parts[0],\r\n g: parts[1],\r\n b: parts[2],\r\n a: parts[3],\r\n };\r\n }\r\n }", "title": "" }, { "docid": "a68bfde4f25a7ecd5166f292ff819ff7", "score": "0.49107057", "text": "function decodeReturn(pv, start) {\n var a = pv[start];\n var b = pv[start+1];\n var w = pv[start+3];\n if (a === 0 && b === 0 && w === 0)\n return 0; // no value seen, eg when all y +ve\n if (w !== 255) {\n //console.log(\"unexpected decode ~ probably empty object?\");\n return NaN;\n }\n if (a === 0 && b === 0) return NaN;\n // var c = pv[2];\n var d = a + b/255; // rejoin from split, four.fs ^^^^\n var scaleVary = d/127 - 1; // work back to scaleVary, see four.fs %%%%\n var l = scaleVary;\n var ll = 0;\n if (l < 0) ll = Math.exp(-l*20); // work back to len, see threek.vs %%%%\n if (l > 0) ll = -Math.exp(l*20); // work back to len, see threek.vs %%%%\n return ll;\n //var mmsg = \"pixel \" + a + \" \" + b + \" d=\" + d + \" scaleVary=\" + scaleVary + \" len=\" + len + \" gscale=\" + isc.toFixed(3);\n //console.log(mmsg);\n}", "title": "" }, { "docid": "b8fce3a4e5a5ca6354272bc21a3e73fc", "score": "0.48693368", "text": "function xyz2abcd(cuts, rec, tri, inv) {\n\tvar X = tri[0], Y = tri[1], Z = tri[2];\n\tvar A = rec[0], B = rec[1], C = rec[2], D = rec[3];\n\n// construct points E, F, L, M, N\n\tvar p = getPoints(X, Y, Z, A, B, C, D);\n\tvar E = p.E, F = p.F, L = p.L, M = p.M, N = p.N;\n\n\tif (vec3.equals(M, E)) console.log(\"M=E\");//\n\tif (vec3.equals(M, L)) console.log(\"M=L\");\n\tif (vec3.equals(N, B)) console.log(\"N=B\");//\n\tif (vec3.equals(L, D)) console.log(\"L=D\");//\n\tif (vec3.equals(L, A)) console.log(\"L=A\");//\n\tif (vec3.equals(N, C)) console.log(\"N=C\");//\n\tif (vec3.equals(N, B) != vec3.equals(L, D)) {\n\t\tconsole.log(\"w=sup unstable\");console.log(N);console.log(B);console.log(L);console.log(D);\n\t}\n\tif (vec3.equals(N, C) != vec3.equals(L, A)) {\n\t\tconsole.log(\"w=h/2 unstable\");console.log(N);console.log(C);console.log(L);console.log(A);\n\t}\n\n// generate pieces within each quadrilateral or triangle\n\tvar AEL = lineCutSameSide(cuts, E, L, A);\n\tvar DFML = lineCutSameSide(AEL.oppo, F, M, D);\n\tvar BEMN = lineCutSameSide(DFML.oppo, M, N, midPoint(B, E));\n\tvar CFMN = BEMN.oppo;\n\tcuts = AEL.concat(DFML).concat(BEMN).concat(CFMN);//special case handling\n\n\tif (inv) {\n\t\tfor (var i = 0; i < cuts.length; i++) {\n\t\t\tvar poly = cuts[i];\n\t\t\tmovePiece(poly);// pieces actually moved (from within rec)\n\t\t\tmat4.invert(poly.move, poly.move);\n\t\t}\n\t}\n\n// update poly.move\n\tvar AELt = mat4.create();\n\tvar vLF = vec3.create();\n vec3.sub(vLF, F, L);\n vec3.scale(vLF, vLF, 2);\n mat4.fromTranslation(AELt, vLF);\n chainMove(AEL, AELt);\n chainMove(DFML, ctrSymm2D(F));\n\tchainMove(BEMN, ctrSymm2D(N));\n\n// move resulting tri to match original XYZ\n\tchainMove(cuts, triCoincide(cuts, M, N, F, X, Y, Z));\n\treturn cuts;\n}", "title": "" }, { "docid": "63b03ddc65f07ffea63aa026536d56ca", "score": "0.48648894", "text": "function makeString()\n\t{\n\t\tvar _ret = \"\";\n\t\tif(p.m == 0)\n\t\t{\n\t\t\t_ret = \"<i>y = </i>\"+p.b;\n\t\t}\n\t\telse if(p.m == 1)\n\t\t{\n\t\t\t_ret = p.b == 0 && p.a >0 ? \"<i>y</i> = <i>x</i> -\"+p.a : p.b == 0 && p.a <0 ? \"<i>y</i> = <i>x</i> + \"+Math.abs(p.a):\"\";\n\t\t\t_ret = p.b == 0 && p.a == 0 ? \"<i>y</i> = <i>x</i>\" : p.b == 0 && p.a >0 ? \"<i>y</i> = <i>x</i> - \"+p.a:p.b == 0 && p.a <0 ? \"<i>y</i> = <i>x</i> + \"+Math.abs(p.a) : p.b < 0 && p.a == 0 ? \"<i>y</i> + \"+Math.abs(p.b)+\" = <i>x</i>\": p.b > 0 && p.a == 0 ? \"<i>y</i> - \"+p.b+\" = <i>x</i>\": p.b > 0 && p.a >0 ? \"<i>y</i> - \"+p.b+ \" = <i>x</i> - \"+p.a : p.b < 0 && p.a <0 ? \"<i>y</i> + \"+Math.abs(p.b)+ \" = <i>x</i> + \"+Math.abs(p.a):p.b > 0 && p.a <0 ? \"<i>y</i> - \"+Math.abs(p.b)+ \" = <i>x</i> + \"+Math.abs(p.a) : p.b < 0 && p.a >0 ?\"<i>y</i> + \"+Math.abs(p.b)+ \" = <i>x</i> - \"+p.a:\"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t_ret = p.b == 0 && p.a == 0 ? \"<i> y </i> = \"+p.m+\"<i>x </i>\" : p.b == 0 && p.a >0 ? \"<i>y</i> = \"+p.m+\"(<i>x </i> - \"+p.a+\")\":p.b == 0 && p.a <0 ? \"<i>y = </i>\"+p.m+\"(<i>x </i>+ \"+Math.abs(p.a)+\")\" :p.b < 0 && p.a == 0 ? \"<i>y </i>+ \"+Math.abs(p.b)+\" = \"+p.m+\"<i>x</i>\":p.b > 0 && p.a == 0 ? \"<i>y </i>- \"+p.b+\" = \"+p.m+\"<i>x</i>\":(p.b > 0 && p.a >0) && p.m == -1 ? \"<i>y </i>- \"+p.b+ \" = -(<i>x </i>- \"+p.a+\")\" :(p.b > 0 && p.a >0) ? \"<i>y </i>- \"+p.b+ \" = \"+p.m+\"(<i>x </i>- \"+p.a+\")\" :(p.b < 0 && p.a <0)&& p.m == -1 ? \"<i>y </i>+ \"+Math.abs(p.b)+ \" = -(<i>x </i>+ \"+Math.abs(p.a)+\")\": p.b < 0 && p.a <0 ? \"<i>y </i>+ \"+Math.abs(p.b)+ \" = \"+p.m+\"(<i>x </i>+ \"+Math.abs(p.a)+\")\": (p.b > 0 && p.a <0) && p.m == -1 ? \"<i>y </i>- \"+Math.abs(p.b)+ \" = -(<i>x </i>+ \"+Math.abs(p.a)+\")\" : p.b > 0 && p.a <0 ? \"<i>y </i>- \"+Math.abs(p.b)+ \" = \"+p.m+\"(<i>x </i>+ \"+Math.abs(p.a)+\")\" : (p.b < 0 && p.a >0) && p.m == -1 ? \"<i>y </i>+ \"+Math.abs(p.b)+ \" = -(<i>x </i>- \"+p.a+\")\": p.b < 0 && p.a >0 ? \"<i>y </i>+ \"+Math.abs(p.b)+ \" = \"+p.m+\"(<i>x </i>- \"+p.a+\")\" :\"\";\n\t\t}\n\t\treturn _ret;\n\t}", "title": "" }, { "docid": "3f87a5d294e6a7937afd096ff0452f36", "score": "0.48636842", "text": "toExtended(e) {\r\n\t e.X.mul(this.X, this.T);\r\n\t e.Y.mul(this.Y, this.Z);\r\n\t e.Z.mul(this.Z, this.T);\r\n\t e.T.mul(this.X, this.Y);\r\n\t }", "title": "" }, { "docid": "0d52e1d35c40e34bae5bce73440efbc4", "score": "0.4853498", "text": "function xB(){return typeof window>\"u\"&&(self.window=self),function(n){var e={parse:function(i){var o=e._bin,s=new Uint8Array(i);if(o.readASCII(s,0,4)==\"ttcf\"){var a=4;o.readUshort(s,a),a+=2,o.readUshort(s,a),a+=2;var l=o.readUint(s,a);a+=4;for(var u=[],f=0;f<l;f++){var h=o.readUint(s,a);a+=4,u.push(e._readFont(s,h))}return u}return[e._readFont(s,0)]},_readFont:function(i,o){var s=e._bin,a=o;s.readFixed(i,o),o+=4;var l=s.readUshort(i,o);o+=2,s.readUshort(i,o),o+=2,s.readUshort(i,o),o+=2,s.readUshort(i,o),o+=2;for(var u=[\"cmap\",\"head\",\"hhea\",\"maxp\",\"hmtx\",\"name\",\"OS/2\",\"post\",\"loca\",\"glyf\",\"kern\",\"CFF \",\"GPOS\",\"GSUB\",\"SVG \"],f={_data:i,_offset:a},h={},p=0;p<l;p++){var m=s.readASCII(i,o,4);o+=4,s.readUint(i,o),o+=4;var g=s.readUint(i,o);o+=4;var v=s.readUint(i,o);o+=4,h[m]={offset:g,length:v}}for(p=0;p<u.length;p++){var x=u[p];h[x]&&(f[x.trim()]=e[x.trim()].parse(i,h[x].offset,h[x].length,f))}return f},_tabOffset:function(i,o,s){for(var a=e._bin,l=a.readUshort(i,s+4),u=s+12,f=0;f<l;f++){var h=a.readASCII(i,u,4);u+=4,a.readUint(i,u),u+=4;var p=a.readUint(i,u);if(u+=4,a.readUint(i,u),u+=4,h==o)return p}return 0}};e._bin={readFixed:function(i,o){return(i[o]<<8|i[o+1])+(i[o+2]<<8|i[o+3])/65540},readF2dot14:function(i,o){return e._bin.readShort(i,o)/16384},readInt:function(i,o){return e._bin._view(i).getInt32(o)},readInt8:function(i,o){return e._bin._view(i).getInt8(o)},readShort:function(i,o){return e._bin._view(i).getInt16(o)},readUshort:function(i,o){return e._bin._view(i).getUint16(o)},readUshorts:function(i,o,s){for(var a=[],l=0;l<s;l++)a.push(e._bin.readUshort(i,o+2*l));return a},readUint:function(i,o){return e._bin._view(i).getUint32(o)},readUint64:function(i,o){return 4294967296*e._bin.readUint(i,o)+e._bin.readUint(i,o+4)},readASCII:function(i,o,s){for(var a=\"\",l=0;l<s;l++)a+=String.fromCharCode(i[o+l]);return a},readUnicode:function(i,o,s){for(var a=\"\",l=0;l<s;l++){var u=i[o++]<<8|i[o++];a+=String.fromCharCode(u)}return a},_tdec:typeof window<\"u\"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(i,o,s){var a=e._bin._tdec;return a&&o==0&&s==i.length?a.decode(i):e._bin.readASCII(i,o,s)},readBytes:function(i,o,s){for(var a=[],l=0;l<s;l++)a.push(i[o+l]);return a},readASCIIArray:function(i,o,s){for(var a=[],l=0;l<s;l++)a.push(String.fromCharCode(i[o+l]));return a},_view:function(i){return i._dataView||(i._dataView=i.buffer?new DataView(i.buffer,i.byteOffset,i.byteLength):new DataView(new Uint8Array(i).buffer))}},e._lctf={},e._lctf.parse=function(i,o,s,a,l){var u=e._bin,f={},h=o;u.readFixed(i,o),o+=4;var p=u.readUshort(i,o);o+=2;var m=u.readUshort(i,o);o+=2;var g=u.readUshort(i,o);return o+=2,f.scriptList=e._lctf.readScriptList(i,h+p),f.featureList=e._lctf.readFeatureList(i,h+m),f.lookupList=e._lctf.readLookupList(i,h+g,l),f},e._lctf.readLookupList=function(i,o,s){var a=e._bin,l=o,u=[],f=a.readUshort(i,o);o+=2;for(var h=0;h<f;h++){var p=a.readUshort(i,o);o+=2;var m=e._lctf.readLookupTable(i,l+p,s);u.push(m)}return u},e._lctf.readLookupTable=function(i,o,s){var a=e._bin,l=o,u={tabs:[]};u.ltype=a.readUshort(i,o),o+=2,u.flag=a.readUshort(i,o),o+=2;var f=a.readUshort(i,o);o+=2;for(var h=u.ltype,p=0;p<f;p++){var m=a.readUshort(i,o);o+=2;var g=s(i,h,l+m,u);u.tabs.push(g)}return u},e._lctf.numOfOnes=function(i){for(var o=0,s=0;s<32;s++)i>>>s&1&&o++;return o},e._lctf.readClassDef=function(i,o){var s=e._bin,a=[],l=s.readUshort(i,o);if(o+=2,l==1){var u=s.readUshort(i,o);o+=2;var f=s.readUshort(i,o);o+=2;for(var h=0;h<f;h++)a.push(u+h),a.push(u+h),a.push(s.readUshort(i,o)),o+=2}if(l==2){var p=s.readUshort(i,o);for(o+=2,h=0;h<p;h++)a.push(s.readUshort(i,o)),o+=2,a.push(s.readUshort(i,o)),o+=2,a.push(s.readUshort(i,o)),o+=2}return a},e._lctf.getInterval=function(i,o){for(var s=0;s<i.length;s+=3){var a=i[s],l=i[s+1];if(i[s+2],a<=o&&o<=l)return s}return-1},e._lctf.readCoverage=function(i,o){var s=e._bin,a={};a.fmt=s.readUshort(i,o),o+=2;var l=s.readUshort(i,o);return o+=2,a.fmt==1&&(a.tab=s.readUshorts(i,o,l)),a.fmt==2&&(a.tab=s.readUshorts(i,o,3*l)),a},e._lctf.coverageIndex=function(i,o){var s=i.tab;if(i.fmt==1)return s.indexOf(o);if(i.fmt==2){var a=e._lctf.getInterval(s,o);if(a!=-1)return s[a+2]+(o-s[a])}return-1},e._lctf.readFeatureList=function(i,o){var s=e._bin,a=o,l=[],u=s.readUshort(i,o);o+=2;for(var f=0;f<u;f++){var h=s.readASCII(i,o,4);o+=4;var p=s.readUshort(i,o);o+=2;var m=e._lctf.readFeatureTable(i,a+p);m.tag=h.trim(),l.push(m)}return l},e._lctf.readFeatureTable=function(i,o){var s=e._bin,a=o,l={},u=s.readUshort(i,o);o+=2,u>0&&(l.featureParams=a+u);var f=s.readUshort(i,o);o+=2,l.tab=[];for(var h=0;h<f;h++)l.tab.push(s.readUshort(i,o+2*h));return l},e._lctf.readScriptList=function(i,o){var s=e._bin,a=o,l={},u=s.readUshort(i,o);o+=2;for(var f=0;f<u;f++){var h=s.readASCII(i,o,4);o+=4;var p=s.readUshort(i,o);o+=2,l[h.trim()]=e._lctf.readScriptTable(i,a+p)}return l},e._lctf.readScriptTable=function(i,o){var s=e._bin,a=o,l={},u=s.readUshort(i,o);o+=2,l.default=e._lctf.readLangSysTable(i,a+u);var f=s.readUshort(i,o);o+=2;for(var h=0;h<f;h++){var p=s.readASCII(i,o,4);o+=4;var m=s.readUshort(i,o);o+=2,l[p.trim()]=e._lctf.readLangSysTable(i,a+m)}return l},e._lctf.readLangSysTable=function(i,o){var s=e._bin,a={};s.readUshort(i,o),o+=2,a.reqFeature=s.readUshort(i,o),o+=2;var l=s.readUshort(i,o);return o+=2,a.features=s.readUshorts(i,o,l),a},e.CFF={},e.CFF.parse=function(i,o,s){var a=e._bin;(i=new Uint8Array(i.buffer,o,s))[o=0],i[++o],i[++o],i[++o],o++;var l=[];o=e.CFF.readIndex(i,o,l);for(var u=[],f=0;f<l.length-1;f++)u.push(a.readASCII(i,o+l[f],l[f+1]-l[f]));o+=l[l.length-1];var h=[];o=e.CFF.readIndex(i,o,h);var p=[];for(f=0;f<h.length-1;f++)p.push(e.CFF.readDict(i,o+h[f],o+h[f+1]));o+=h[h.length-1];var m=p[0],g=[];o=e.CFF.readIndex(i,o,g);var v=[];for(f=0;f<g.length-1;f++)v.push(a.readASCII(i,o+g[f],g[f+1]-g[f]));if(o+=g[g.length-1],e.CFF.readSubrs(i,o,m),m.CharStrings){o=m.CharStrings,g=[],o=e.CFF.readIndex(i,o,g);var x=[];for(f=0;f<g.length-1;f++)x.push(a.readBytes(i,o+g[f],g[f+1]-g[f]));m.CharStrings=x}if(m.ROS){o=m.FDArray;var w=[];for(o=e.CFF.readIndex(i,o,w),m.FDArray=[],f=0;f<w.length-1;f++){var _=e.CFF.readDict(i,o+w[f],o+w[f+1]);e.CFF._readFDict(i,_,v),m.FDArray.push(_)}o+=w[w.length-1],o=m.FDSelect,m.FDSelect=[];var S=i[o];if(o++,S!=3)throw S;var M=a.readUshort(i,o);for(o+=2,f=0;f<M+1;f++)m.FDSelect.push(a.readUshort(i,o),i[o+2]),o+=3}return m.Encoding&&(m.Encoding=e.CFF.readEncoding(i,m.Encoding,m.CharStrings.length)),m.charset&&(m.charset=e.CFF.readCharset(i,m.charset,m.CharStrings.length)),e.CFF._readFDict(i,m,v),m},e.CFF._readFDict=function(i,o,s){var a;for(var l in o.Private&&(a=o.Private[1],o.Private=e.CFF.readDict(i,a,a+o.Private[0]),o.Private.Subrs&&e.CFF.readSubrs(i,a+o.Private.Subrs,o.Private)),o)[\"FamilyName\",\"FontName\",\"FullName\",\"Notice\",\"version\",\"Copyright\"].indexOf(l)!=-1&&(o[l]=s[o[l]-426+35])},e.CFF.readSubrs=function(i,o,s){var a=e._bin,l=[];o=e.CFF.readIndex(i,o,l);var u,f=l.length;u=f<1240?107:f<33900?1131:32768,s.Bias=u,s.Subrs=[];for(var h=0;h<l.length-1;h++)s.Subrs.push(a.readBytes(i,o+l[h],l[h+1]-l[h]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(i,o){for(var s=0;s<i.charset.length;s++)if(i.charset[s]==o)return s;return-1},e.CFF.glyphBySE=function(i,o){return o<0||o>255?-1:e.CFF.glyphByUnicode(i,e.CFF.tableSE[o])},e.CFF.readEncoding=function(i,o,s){e._bin;var a=[\".notdef\"],l=i[o];if(o++,l!=0)throw\"error: unknown encoding format: \"+l;var u=i[o];o++;for(var f=0;f<u;f++)a.push(i[o+f]);return a},e.CFF.readCharset=function(i,o,s){var a=e._bin,l=[\".notdef\"],u=i[o];if(o++,u==0)for(var f=0;f<s;f++){var h=a.readUshort(i,o);o+=2,l.push(h)}else{if(u!=1&&u!=2)throw\"error: format: \"+u;for(;l.length<s;){h=a.readUshort(i,o),o+=2;var p=0;for(u==1?(p=i[o],o++):(p=a.readUshort(i,o),o+=2),f=0;f<=p;f++)l.push(h),h++}}return l},e.CFF.readIndex=function(i,o,s){var a=e._bin,l=a.readUshort(i,o)+1,u=i[o+=2];if(o++,u==1)for(var f=0;f<l;f++)s.push(i[o+f]);else if(u==2)for(f=0;f<l;f++)s.push(a.readUshort(i,o+2*f));else if(u==3)for(f=0;f<l;f++)s.push(16777215&a.readUint(i,o+3*f-1));else if(l!=1)throw\"unsupported offset size: \"+u+\", count: \"+l;return(o+=l*u)-1},e.CFF.getCharString=function(i,o,s){var a=e._bin,l=i[o],u=i[o+1];i[o+2],i[o+3],i[o+4];var f=1,h=null,p=null;l<=20&&(h=l,f=1),l==12&&(h=100*l+u,f=2),21<=l&&l<=27&&(h=l,f=1),l==28&&(p=a.readShort(i,o+1),f=3),29<=l&&l<=31&&(h=l,f=1),32<=l&&l<=246&&(p=l-139,f=1),247<=l&&l<=250&&(p=256*(l-247)+u+108,f=2),251<=l&&l<=254&&(p=256*-(l-251)-u-108,f=2),l==255&&(p=a.readInt(i,o+1)/65535,f=5),s.val=p??\"o\"+h,s.size=f},e.CFF.readCharString=function(i,o,s){for(var a=o+s,l=e._bin,u=[];o<a;){var f=i[o],h=i[o+1];i[o+2],i[o+3],i[o+4];var p=1,m=null,g=null;f<=20&&(m=f,p=1),f==12&&(m=100*f+h,p=2),f!=19&&f!=20||(m=f,p=2),21<=f&&f<=27&&(m=f,p=1),f==28&&(g=l.readShort(i,o+1),p=3),29<=f&&f<=31&&(m=f,p=1),32<=f&&f<=246&&(g=f-139,p=1),247<=f&&f<=250&&(g=256*(f-247)+h+108,p=2),251<=f&&f<=254&&(g=256*-(f-251)-h-108,p=2),f==255&&(g=l.readInt(i,o+1)/65535,p=5),u.push(g??\"o\"+m),o+=p}return u},e.CFF.readDict=function(i,o,s){for(var a=e._bin,l={},u=[];o<s;){var f=i[o],h=i[o+1];i[o+2],i[o+3],i[o+4];var p=1,m=null,g=null;if(f==28&&(g=a.readShort(i,o+1),p=3),f==29&&(g=a.readInt(i,o+1),p=5),32<=f&&f<=246&&(g=f-139,p=1),247<=f&&f<=250&&(g=256*(f-247)+h+108,p=2),251<=f&&f<=254&&(g=256*-(f-251)-h-108,p=2),f==255)throw g=a.readInt(i,o+1)/65535,p=5,\"unknown number\";if(f==30){var v=[];for(p=1;;){var x=i[o+p];p++;var w=x>>4,_=15&x;if(w!=15&&v.push(w),_!=15&&v.push(_),_==15)break}for(var S=\"\",M=[0,1,2,3,4,5,6,7,8,9,\".\",\"e\",\"e-\",\"reserved\",\"-\",\"endOfNumber\"],C=0;C<v.length;C++)S+=M[v[C]];g=parseFloat(S)}f<=21&&(m=[\"version\",\"Notice\",\"FullName\",\"FamilyName\",\"Weight\",\"FontBBox\",\"BlueValues\",\"OtherBlues\",\"FamilyBlues\",\"FamilyOtherBlues\",\"StdHW\",\"StdVW\",\"escape\",\"UniqueID\",\"XUID\",\"charset\",\"Encoding\",\"CharStrings\",\"Private\",\"Subrs\",\"defaultWidthX\",\"nominalWidthX\"][f],p=1,f==12&&(m=[\"Copyright\",\"isFixedPitch\",\"ItalicAngle\",\"UnderlinePosition\",\"UnderlineThickness\",\"PaintType\",\"CharstringType\",\"FontMatrix\",\"StrokeWidth\",\"BlueScale\",\"BlueShift\",\"BlueFuzz\",\"StemSnapH\",\"StemSnapV\",\"ForceBold\",0,0,\"LanguageGroup\",\"ExpansionFactor\",\"initialRandomSeed\",\"SyntheticBase\",\"PostScript\",\"BaseFontName\",\"BaseFontBlend\",0,0,0,0,0,0,\"ROS\",\"CIDFontVersion\",\"CIDFontRevision\",\"CIDFontType\",\"CIDCount\",\"UIDBase\",\"FDArray\",\"FDSelect\",\"FontName\"][h],p=2)),m!=null?(l[m]=u.length==1?u[0]:u,u=[]):u.push(g),o+=p}return l},e.cmap={},e.cmap.parse=function(i,o,s){i=new Uint8Array(i.buffer,o,s),o=0;var a=e._bin,l={};a.readUshort(i,o),o+=2;var u=a.readUshort(i,o);o+=2;var f=[];l.tables=[];for(var h=0;h<u;h++){var p=a.readUshort(i,o);o+=2;var m=a.readUshort(i,o);o+=2;var g=a.readUint(i,o);o+=4;var v=\"p\"+p+\"e\"+m,x=f.indexOf(g);if(x==-1){var w;x=l.tables.length,f.push(g);var _=a.readUshort(i,g);_==0?w=e.cmap.parse0(i,g):_==4?w=e.cmap.parse4(i,g):_==6?w=e.cmap.parse6(i,g):_==12?w=e.cmap.parse12(i,g):console.debug(\"unknown format: \"+_,p,m,g),l.tables.push(w)}if(l[v]!=null)throw\"multiple tables for one platform+encoding\";l[v]=x}return l},e.cmap.parse0=function(i,o){var s=e._bin,a={};a.format=s.readUshort(i,o),o+=2;var l=s.readUshort(i,o);o+=2,s.readUshort(i,o),o+=2,a.map=[];for(var u=0;u<l-6;u++)a.map.push(i[o+u]);return a},e.cmap.parse4=function(i,o){var s=e._bin,a=o,l={};l.format=s.readUshort(i,o),o+=2;var u=s.readUshort(i,o);o+=2,s.readUshort(i,o),o+=2;var f=s.readUshort(i,o);o+=2;var h=f/2;l.searchRange=s.readUshort(i,o),o+=2,l.entrySelector=s.readUshort(i,o),o+=2,l.rangeShift=s.readUshort(i,o),o+=2,l.endCount=s.readUshorts(i,o,h),o+=2*h,o+=2,l.startCount=s.readUshorts(i,o,h),o+=2*h,l.idDelta=[];for(var p=0;p<h;p++)l.idDelta.push(s.readShort(i,o)),o+=2;for(l.idRangeOffset=s.readUshorts(i,o,h),o+=2*h,l.glyphIdArray=[];o<a+u;)l.glyphIdArray.push(s.readUshort(i,o)),o+=2;return l},e.cmap.parse6=function(i,o){var s=e._bin,a={};a.format=s.readUshort(i,o),o+=2,s.readUshort(i,o),o+=2,s.readUshort(i,o),o+=2,a.firstCode=s.readUshort(i,o),o+=2;var l=s.readUshort(i,o);o+=2,a.glyphIdArray=[];for(var u=0;u<l;u++)a.glyphIdArray.push(s.readUshort(i,o)),o+=2;return a},e.cmap.parse12=function(i,o){var s=e._bin,a={};a.format=s.readUshort(i,o),o+=2,o+=2,s.readUint(i,o),o+=4,s.readUint(i,o),o+=4;var l=s.readUint(i,o);o+=4,a.groups=[];for(var u=0;u<l;u++){var f=o+12*u,h=s.readUint(i,f+0),p=s.readUint(i,f+4),m=s.readUint(i,f+8);a.groups.push([h,p,m])}return a},e.glyf={},e.glyf.parse=function(i,o,s,a){for(var l=[],u=0;u<a.maxp.numGlyphs;u++)l.push(null);return l},e.glyf._parseGlyf=function(i,o){var s=e._bin,a=i._data,l=e._tabOffset(a,\"glyf\",i._offset)+i.loca[o];if(i.loca[o]==i.loca[o+1])return null;var u={};if(u.noc=s.readShort(a,l),l+=2,u.xMin=s.readShort(a,l),l+=2,u.yMin=s.readShort(a,l),l+=2,u.xMax=s.readShort(a,l),l+=2,u.yMax=s.readShort(a,l),l+=2,u.xMin>=u.xMax||u.yMin>=u.yMax)return null;if(u.noc>0){u.endPts=[];for(var f=0;f<u.noc;f++)u.endPts.push(s.readUshort(a,l)),l+=2;var h=s.readUshort(a,l);if(l+=2,a.length-l<h)return null;u.instructions=s.readBytes(a,l,h),l+=h;var p=u.endPts[u.noc-1]+1;for(u.flags=[],f=0;f<p;f++){var m=a[l];if(l++,u.flags.push(m),(8&m)!=0){var g=a[l];l++;for(var v=0;v<g;v++)u.flags.push(m),f++}}for(u.xs=[],f=0;f<p;f++){var x=(2&u.flags[f])!=0,w=(16&u.flags[f])!=0;x?(u.xs.push(w?a[l]:-a[l]),l++):w?u.xs.push(0):(u.xs.push(s.readShort(a,l)),l+=2)}for(u.ys=[],f=0;f<p;f++)x=(4&u.flags[f])!=0,w=(32&u.flags[f])!=0,x?(u.ys.push(w?a[l]:-a[l]),l++):w?u.ys.push(0):(u.ys.push(s.readShort(a,l)),l+=2);var _=0,S=0;for(f=0;f<p;f++)_+=u.xs[f],S+=u.ys[f],u.xs[f]=_,u.ys[f]=S}else{var M;u.parts=[];do{M=s.readUshort(a,l),l+=2;var C={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(u.parts.push(C),C.glyphIndex=s.readUshort(a,l),l+=2,1&M){var A=s.readShort(a,l);l+=2;var P=s.readShort(a,l);l+=2}else A=s.readInt8(a,l),l++,P=s.readInt8(a,l),l++;2&M?(C.m.tx=A,C.m.ty=P):(C.p1=A,C.p2=P),8&M?(C.m.a=C.m.d=s.readF2dot14(a,l),l+=2):64&M?(C.m.a=s.readF2dot14(a,l),l+=2,C.m.d=s.readF2dot14(a,l),l+=2):128&M&&(C.m.a=s.readF2dot14(a,l),l+=2,C.m.b=s.readF2dot14(a,l),l+=2,C.m.c=s.readF2dot14(a,l),l+=2,C.m.d=s.readF2dot14(a,l),l+=2)}while(32&M);if(256&M){var E=s.readUshort(a,l);for(l+=2,u.instr=[],f=0;f<E;f++)u.instr.push(a[l]),l++}}return u},e.GPOS={},e.GPOS.parse=function(i,o,s,a){return e._lctf.parse(i,o,s,a,e.GPOS.subt)},e.GPOS.subt=function(i,o,s,a){var l=e._bin,u=s,f={};if(f.fmt=l.readUshort(i,s),s+=2,o==1||o==2||o==3||o==7||o==8&&f.fmt<=2){var h=l.readUshort(i,s);s+=2,f.coverage=e._lctf.readCoverage(i,h+u)}if(o==1&&f.fmt==1){var p=l.readUshort(i,s);s+=2;var m=e._lctf.numOfOnes(p);p!=0&&(f.pos=e.GPOS.readValueRecord(i,s,p))}else if(o==2&&f.fmt>=1&&f.fmt<=2){p=l.readUshort(i,s),s+=2;var g=l.readUshort(i,s);s+=2,m=e._lctf.numOfOnes(p);var v=e._lctf.numOfOnes(g);if(f.fmt==1){f.pairsets=[];var x=l.readUshort(i,s);s+=2;for(var w=0;w<x;w++){var _=u+l.readUshort(i,s);s+=2;var S=l.readUshort(i,_);_+=2;for(var M=[],C=0;C<S;C++){var A=l.readUshort(i,_);_+=2,p!=0&&(F=e.GPOS.readValueRecord(i,_,p),_+=2*m),g!=0&&(B=e.GPOS.readValueRecord(i,_,g),_+=2*v),M.push({gid2:A,val1:F,val2:B})}f.pairsets.push(M)}}if(f.fmt==2){var P=l.readUshort(i,s);s+=2;var E=l.readUshort(i,s);s+=2;var I=l.readUshort(i,s);s+=2;var D=l.readUshort(i,s);for(s+=2,f.classDef1=e._lctf.readClassDef(i,u+P),f.classDef2=e._lctf.readClassDef(i,u+E),f.matrix=[],w=0;w<I;w++){var V=[];for(C=0;C<D;C++){var F=null,B=null;p!=0&&(F=e.GPOS.readValueRecord(i,s,p),s+=2*m),g!=0&&(B=e.GPOS.readValueRecord(i,s,g),s+=2*v),V.push({val1:F,val2:B})}f.matrix.push(V)}}}else{if(o==9&&f.fmt==1){var z=l.readUshort(i,s);s+=2;var Z=l.readUint(i,s);if(s+=4,a.ltype==9)a.ltype=z;else if(a.ltype!=z)throw\"invalid extension substitution\";return e.GPOS.subt(i,a.ltype,u+Z)}console.debug(\"unsupported GPOS table LookupType\",o,\"format\",f.fmt)}return f},e.GPOS.readValueRecord=function(i,o,s){var a=e._bin,l=[];return l.push(1&s?a.readShort(i,o):0),o+=1&s?2:0,l.push(2&s?a.readShort(i,o):0),o+=2&s?2:0,l.push(4&s?a.readShort(i,o):0),o+=4&s?2:0,l.push(8&s?a.readShort(i,o):0),o+=8&s?2:0,l},e.GSUB={},e.GSUB.parse=function(i,o,s,a){return e._lctf.parse(i,o,s,a,e.GSUB.subt)},e.GSUB.subt=function(i,o,s,a){var l=e._bin,u=s,f={};if(f.fmt=l.readUshort(i,s),s+=2,o!=1&&o!=4&&o!=5&&o!=6)return null;if(o==1||o==4||o==5&&f.fmt<=2||o==6&&f.fmt<=2){var h=l.readUshort(i,s);s+=2,f.coverage=e._lctf.readCoverage(i,u+h)}if(o==1&&f.fmt>=1&&f.fmt<=2){if(f.fmt==1)f.delta=l.readShort(i,s),s+=2;else if(f.fmt==2){var p=l.readUshort(i,s);s+=2,f.newg=l.readUshorts(i,s,p),s+=2*f.newg.length}}else if(o==4){f.vals=[],p=l.readUshort(i,s),s+=2;for(var m=0;m<p;m++){var g=l.readUshort(i,s);s+=2,f.vals.push(e.GSUB.readLigatureSet(i,u+g))}}else if(o==5&&f.fmt==2){if(f.fmt==2){var v=l.readUshort(i,s);s+=2,f.cDef=e._lctf.readClassDef(i,u+v),f.scset=[];var x=l.readUshort(i,s);for(s+=2,m=0;m<x;m++){var w=l.readUshort(i,s);s+=2,f.scset.push(w==0?null:e.GSUB.readSubClassSet(i,u+w))}}}else if(o==6&&f.fmt==3){if(f.fmt==3){for(m=0;m<3;m++){p=l.readUshort(i,s),s+=2;for(var _=[],S=0;S<p;S++)_.push(e._lctf.readCoverage(i,u+l.readUshort(i,s+2*S)));s+=2*p,m==0&&(f.backCvg=_),m==1&&(f.inptCvg=_),m==2&&(f.ahedCvg=_)}p=l.readUshort(i,s),s+=2,f.lookupRec=e.GSUB.readSubstLookupRecords(i,s,p)}}else{if(o==7&&f.fmt==1){var M=l.readUshort(i,s);s+=2;var C=l.readUint(i,s);if(s+=4,a.ltype==9)a.ltype=M;else if(a.ltype!=M)throw\"invalid extension substitution\";return e.GSUB.subt(i,a.ltype,u+C)}console.debug(\"unsupported GSUB table LookupType\",o,\"format\",f.fmt)}return f},e.GSUB.readSubClassSet=function(i,o){var s=e._bin.readUshort,a=o,l=[],u=s(i,o);o+=2;for(var f=0;f<u;f++){var h=s(i,o);o+=2,l.push(e.GSUB.readSubClassRule(i,a+h))}return l},e.GSUB.readSubClassRule=function(i,o){var s=e._bin.readUshort,a={},l=s(i,o),u=s(i,o+=2);o+=2,a.input=[];for(var f=0;f<l-1;f++)a.input.push(s(i,o)),o+=2;return a.substLookupRecords=e.GSUB.readSubstLookupRecords(i,o,u),a},e.GSUB.readSubstLookupRecords=function(i,o,s){for(var a=e._bin.readUshort,l=[],u=0;u<s;u++)l.push(a(i,o),a(i,o+2)),o+=4;return l},e.GSUB.readChainSubClassSet=function(i,o){var s=e._bin,a=o,l=[],u=s.readUshort(i,o);o+=2;for(var f=0;f<u;f++){var h=s.readUshort(i,o);o+=2,l.push(e.GSUB.readChainSubClassRule(i,a+h))}return l},e.GSUB.readChainSubClassRule=function(i,o){for(var s=e._bin,a={},l=[\"backtrack\",\"input\",\"lookahead\"],u=0;u<l.length;u++){var f=s.readUshort(i,o);o+=2,u==1&&f--,a[l[u]]=s.readUshorts(i,o,f),o+=2*a[l[u]].length}return f=s.readUshort(i,o),o+=2,a.subst=s.readUshorts(i,o,2*f),o+=2*a.subst.length,a},e.GSUB.readLigatureSet=function(i,o){var s=e._bin,a=o,l=[],u=s.readUshort(i,o);o+=2;for(var f=0;f<u;f++){var h=s.readUshort(i,o);o+=2,l.push(e.GSUB.readLigature(i,a+h))}return l},e.GSUB.readLigature=function(i,o){var s=e._bin,a={chain:[]};a.nglyph=s.readUshort(i,o),o+=2;var l=s.readUshort(i,o);o+=2;for(var u=0;u<l-1;u++)a.chain.push(s.readUshort(i,o)),o+=2;return a},e.head={},e.head.parse=function(i,o,s){var a=e._bin,l={};return a.readFixed(i,o),o+=4,l.fontRevision=a.readFixed(i,o),o+=4,a.readUint(i,o),o+=4,a.readUint(i,o),o+=4,l.flags=a.readUshort(i,o),o+=2,l.unitsPerEm=a.readUshort(i,o),o+=2,l.created=a.readUint64(i,o),o+=8,l.modified=a.readUint64(i,o),o+=8,l.xMin=a.readShort(i,o),o+=2,l.yMin=a.readShort(i,o),o+=2,l.xMax=a.readShort(i,o),o+=2,l.yMax=a.readShort(i,o),o+=2,l.macStyle=a.readUshort(i,o),o+=2,l.lowestRecPPEM=a.readUshort(i,o),o+=2,l.fontDirectionHint=a.readShort(i,o),o+=2,l.indexToLocFormat=a.readShort(i,o),o+=2,l.glyphDataFormat=a.readShort(i,o),o+=2,l},e.hhea={},e.hhea.parse=function(i,o,s){var a=e._bin,l={};return a.readFixed(i,o),o+=4,l.ascender=a.readShort(i,o),o+=2,l.descender=a.readShort(i,o),o+=2,l.lineGap=a.readShort(i,o),o+=2,l.advanceWidthMax=a.readUshort(i,o),o+=2,l.minLeftSideBearing=a.readShort(i,o),o+=2,l.minRightSideBearing=a.readShort(i,o),o+=2,l.xMaxExtent=a.readShort(i,o),o+=2,l.caretSlopeRise=a.readShort(i,o),o+=2,l.caretSlopeRun=a.readShort(i,o),o+=2,l.caretOffset=a.readShort(i,o),o+=2,o+=8,l.metricDataFormat=a.readShort(i,o),o+=2,l.numberOfHMetrics=a.readUshort(i,o),o+=2,l},e.hmtx={},e.hmtx.parse=function(i,o,s,a){for(var l=e._bin,u={aWidth:[],lsBearing:[]},f=0,h=0,p=0;p<a.maxp.numGlyphs;p++)p<a.hhea.numberOfHMetrics&&(f=l.readUshort(i,o),o+=2,h=l.readShort(i,o),o+=2),u.aWidth.push(f),u.lsBearing.push(h);return u},e.kern={},e.kern.parse=function(i,o,s,a){var l=e._bin,u=l.readUshort(i,o);if(o+=2,u==1)return e.kern.parseV1(i,o-2,s,a);var f=l.readUshort(i,o);o+=2;for(var h={glyph1:[],rval:[]},p=0;p<f;p++){o+=2,s=l.readUshort(i,o),o+=2;var m=l.readUshort(i,o);o+=2;var g=m>>>8;if((g&=15)!=0)throw\"unknown kern table format: \"+g;o=e.kern.readFormat0(i,o,h)}return h},e.kern.parseV1=function(i,o,s,a){var l=e._bin;l.readFixed(i,o),o+=4;var u=l.readUint(i,o);o+=4;for(var f={glyph1:[],rval:[]},h=0;h<u;h++){l.readUint(i,o),o+=4;var p=l.readUshort(i,o);o+=2,l.readUshort(i,o),o+=2;var m=p>>>8;if((m&=15)!=0)throw\"unknown kern table format: \"+m;o=e.kern.readFormat0(i,o,f)}return f},e.kern.readFormat0=function(i,o,s){var a=e._bin,l=-1,u=a.readUshort(i,o);o+=2,a.readUshort(i,o),o+=2,a.readUshort(i,o),o+=2,a.readUshort(i,o),o+=2;for(var f=0;f<u;f++){var h=a.readUshort(i,o);o+=2;var p=a.readUshort(i,o);o+=2;var m=a.readShort(i,o);o+=2,h!=l&&(s.glyph1.push(h),s.rval.push({glyph2:[],vals:[]}));var g=s.rval[s.rval.length-1];g.glyph2.push(p),g.vals.push(m),l=h}return o},e.loca={},e.loca.parse=function(i,o,s,a){var l=e._bin,u=[],f=a.head.indexToLocFormat,h=a.maxp.numGlyphs+1;if(f==0)for(var p=0;p<h;p++)u.push(l.readUshort(i,o+(p<<1))<<1);if(f==1)for(p=0;p<h;p++)u.push(l.readUint(i,o+(p<<2)));return u},e.maxp={},e.maxp.parse=function(i,o,s){var a=e._bin,l={},u=a.readUint(i,o);return o+=4,l.numGlyphs=a.readUshort(i,o),o+=2,u==65536&&(l.maxPoints=a.readUshort(i,o),o+=2,l.maxContours=a.readUshort(i,o),o+=2,l.maxCompositePoints=a.readUshort(i,o),o+=2,l.maxCompositeContours=a.readUshort(i,o),o+=2,l.maxZones=a.readUshort(i,o),o+=2,l.maxTwilightPoints=a.readUshort(i,o),o+=2,l.maxStorage=a.readUshort(i,o),o+=2,l.maxFunctionDefs=a.readUshort(i,o),o+=2,l.maxInstructionDefs=a.readUshort(i,o),o+=2,l.maxStackElements=a.readUshort(i,o),o+=2,l.maxSizeOfInstructions=a.readUshort(i,o),o+=2,l.maxComponentElements=a.readUshort(i,o),o+=2,l.maxComponentDepth=a.readUshort(i,o),o+=2),l},e.name={},e.name.parse=function(i,o,s){var a=e._bin,l={};a.readUshort(i,o),o+=2;var u=a.readUshort(i,o);o+=2,a.readUshort(i,o);for(var f,h=[\"copyright\",\"fontFamily\",\"fontSubfamily\",\"ID\",\"fullName\",\"version\",\"postScriptName\",\"trademark\",\"manufacturer\",\"designer\",\"description\",\"urlVendor\",\"urlDesigner\",\"licence\",\"licenceURL\",\"---\",\"typoFamilyName\",\"typoSubfamilyName\",\"compatibleFull\",\"sampleText\",\"postScriptCID\",\"wwsFamilyName\",\"wwsSubfamilyName\",\"lightPalette\",\"darkPalette\"],p=o+=2,m=0;m<u;m++){var g=a.readUshort(i,o);o+=2;var v=a.readUshort(i,o);o+=2;var x=a.readUshort(i,o);o+=2;var w=a.readUshort(i,o);o+=2;var _=a.readUshort(i,o);o+=2;var S=a.readUshort(i,o);o+=2;var M,C=h[w],A=p+12*u+S;if(g==0)M=a.readUnicode(i,A,_/2);else if(g==3&&v==0)M=a.readUnicode(i,A,_/2);else if(v==0)M=a.readASCII(i,A,_);else if(v==1)M=a.readUnicode(i,A,_/2);else if(v==3)M=a.readUnicode(i,A,_/2);else{if(g!=1)throw\"unknown encoding \"+v+\", platformID: \"+g;M=a.readASCII(i,A,_),console.debug(\"reading unknown MAC encoding \"+v+\" as ASCII\")}var P=\"p\"+g+\",\"+x.toString(16);l[P]==null&&(l[P]={}),l[P][C!==void 0?C:w]=M,l[P]._lang=x}for(var E in l)if(l[E].postScriptName!=null&&l[E]._lang==1033)return l[E];for(var E in l)if(l[E].postScriptName!=null&&l[E]._lang==0)return l[E];for(var E in l)if(l[E].postScriptName!=null&&l[E]._lang==3084)return l[E];for(var E in l)if(l[E].postScriptName!=null)return l[E];for(var E in l){f=E;break}return console.debug(\"returning name table with languageID \"+l[f]._lang),l[f]},e[\"OS/2\"]={},e[\"OS/2\"].parse=function(i,o,s){var a=e._bin.readUshort(i,o);o+=2;var l={};if(a==0)e[\"OS/2\"].version0(i,o,l);else if(a==1)e[\"OS/2\"].version1(i,o,l);else if(a==2||a==3||a==4)e[\"OS/2\"].version2(i,o,l);else{if(a!=5)throw\"unknown OS/2 table version: \"+a;e[\"OS/2\"].version5(i,o,l)}return l},e[\"OS/2\"].version0=function(i,o,s){var a=e._bin;return s.xAvgCharWidth=a.readShort(i,o),o+=2,s.usWeightClass=a.readUshort(i,o),o+=2,s.usWidthClass=a.readUshort(i,o),o+=2,s.fsType=a.readUshort(i,o),o+=2,s.ySubscriptXSize=a.readShort(i,o),o+=2,s.ySubscriptYSize=a.readShort(i,o),o+=2,s.ySubscriptXOffset=a.readShort(i,o),o+=2,s.ySubscriptYOffset=a.readShort(i,o),o+=2,s.ySuperscriptXSize=a.readShort(i,o),o+=2,s.ySuperscriptYSize=a.readShort(i,o),o+=2,s.ySuperscriptXOffset=a.readShort(i,o),o+=2,s.ySuperscriptYOffset=a.readShort(i,o),o+=2,s.yStrikeoutSize=a.readShort(i,o),o+=2,s.yStrikeoutPosition=a.readShort(i,o),o+=2,s.sFamilyClass=a.readShort(i,o),o+=2,s.panose=a.readBytes(i,o,10),o+=10,s.ulUnicodeRange1=a.readUint(i,o),o+=4,s.ulUnicodeRange2=a.readUint(i,o),o+=4,s.ulUnicodeRange3=a.readUint(i,o),o+=4,s.ulUnicodeRange4=a.readUint(i,o),o+=4,s.achVendID=[a.readInt8(i,o),a.readInt8(i,o+1),a.readInt8(i,o+2),a.readInt8(i,o+3)],o+=4,s.fsSelection=a.readUshort(i,o),o+=2,s.usFirstCharIndex=a.readUshort(i,o),o+=2,s.usLastCharIndex=a.readUshort(i,o),o+=2,s.sTypoAscender=a.readShort(i,o),o+=2,s.sTypoDescender=a.readShort(i,o),o+=2,s.sTypoLineGap=a.readShort(i,o),o+=2,s.usWinAscent=a.readUshort(i,o),o+=2,s.usWinDescent=a.readUshort(i,o),o+=2},e[\"OS/2\"].version1=function(i,o,s){var a=e._bin;return o=e[\"OS/2\"].version0(i,o,s),s.ulCodePageRange1=a.readUint(i,o),o+=4,s.ulCodePageRange2=a.readUint(i,o),o+=4},e[\"OS/2\"].version2=function(i,o,s){var a=e._bin;return o=e[\"OS/2\"].version1(i,o,s),s.sxHeight=a.readShort(i,o),o+=2,s.sCapHeight=a.readShort(i,o),o+=2,s.usDefault=a.readUshort(i,o),o+=2,s.usBreak=a.readUshort(i,o),o+=2,s.usMaxContext=a.readUshort(i,o),o+=2},e[\"OS/2\"].version5=function(i,o,s){var a=e._bin;return o=e[\"OS/2\"].version2(i,o,s),s.usLowerOpticalPointSize=a.readUshort(i,o),o+=2,s.usUpperOpticalPointSize=a.readUshort(i,o),o+=2},e.post={},e.post.parse=function(i,o,s){var a=e._bin,l={};return l.version=a.readFixed(i,o),o+=4,l.italicAngle=a.readFixed(i,o),o+=4,l.underlinePosition=a.readShort(i,o),o+=2,l.underlineThickness=a.readShort(i,o),o+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(i,o){var s=i.cmap,a=-1;if(s.p0e4!=null?a=s.p0e4:s.p3e1!=null?a=s.p3e1:s.p1e0!=null?a=s.p1e0:s.p0e3!=null&&(a=s.p0e3),a==-1)throw\"no familiar platform and encoding!\";var l=s.tables[a];if(l.format==0)return o>=l.map.length?0:l.map[o];if(l.format==4){for(var u=-1,f=0;f<l.endCount.length;f++)if(o<=l.endCount[f]){u=f;break}return u==-1||l.startCount[u]>o?0:65535&(l.idRangeOffset[u]!=0?l.glyphIdArray[o-l.startCount[u]+(l.idRangeOffset[u]>>1)-(l.idRangeOffset.length-u)]:o+l.idDelta[u])}if(l.format==12){if(o>l.groups[l.groups.length-1][1])return 0;for(f=0;f<l.groups.length;f++){var h=l.groups[f];if(h[0]<=o&&o<=h[1])return h[2]+(o-h[0])}return 0}throw\"unknown cmap table format \"+l.format},e.U.glyphToPath=function(i,o){var s={cmds:[],crds:[]};if(i.SVG&&i.SVG.entries[o]){var a=i.SVG.entries[o];return a==null?s:(typeof a==\"string\"&&(a=e.SVG.toPath(a),i.SVG.entries[o]=a),a)}if(i.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:i.CFF.Private?i.CFF.Private.defaultWidthX:0,open:!1},u=i.CFF,f=i.CFF.Private;if(u.ROS){for(var h=0;u.FDSelect[h+2]<=o;)h+=2;f=u.FDArray[u.FDSelect[h+1]].Private}e.U._drawCFF(i.CFF.CharStrings[o],l,u,f,s)}else i.glyf&&e.U._drawGlyf(o,i,s);return s},e.U._drawGlyf=function(i,o,s){var a=o.glyf[i];a==null&&(a=o.glyf[i]=e.glyf._parseGlyf(o,i)),a!=null&&(a.noc>-1?e.U._simpleGlyph(a,s):e.U._compoGlyph(a,o,s))},e.U._simpleGlyph=function(i,o){for(var s=0;s<i.noc;s++){for(var a=s==0?0:i.endPts[s-1]+1,l=i.endPts[s],u=a;u<=l;u++){var f=u==a?l:u-1,h=u==l?a:u+1,p=1&i.flags[u],m=1&i.flags[f],g=1&i.flags[h],v=i.xs[u],x=i.ys[u];if(u==a)if(p){if(!m){e.U.P.moveTo(o,v,x);continue}e.U.P.moveTo(o,i.xs[f],i.ys[f])}else m?e.U.P.moveTo(o,i.xs[f],i.ys[f]):e.U.P.moveTo(o,(i.xs[f]+v)/2,(i.ys[f]+x)/2);p?m&&e.U.P.lineTo(o,v,x):g?e.U.P.qcurveTo(o,v,x,i.xs[h],i.ys[h]):e.U.P.qcurveTo(o,v,x,(v+i.xs[h])/2,(x+i.ys[h])/2)}e.U.P.closePath(o)}},e.U._compoGlyph=function(i,o,s){for(var a=0;a<i.parts.length;a++){var l={cmds:[],crds:[]},u=i.parts[a];e.U._drawGlyf(u.glyphIndex,o,l);for(var f=u.m,h=0;h<l.crds.length;h+=2){var p=l.crds[h],m=l.crds[h+1];s.crds.push(p*f.a+m*f.b+f.tx),s.crds.push(p*f.c+m*f.d+f.ty)}for(h=0;h<l.cmds.length;h++)s.cmds.push(l.cmds[h])}},e.U._getGlyphClass=function(i,o){var s=e._lctf.getInterval(o,i);return s==-1?0:o[s+2]},e.U.getPairAdjustment=function(i,o,s){var a=!1;if(i.GPOS)for(var l=i.GPOS,u=l.lookupList,f=l.featureList,h=[],p=0;p<f.length;p++){var m=f[p];if(m.tag==\"kern\"){a=!0;for(var g=0;g<m.tab.length;g++)if(!h[m.tab[g]]){h[m.tab[g]]=!0;for(var v=u[m.tab[g]],x=0;x<v.tabs.length;x++)if(v.tabs[x]!=null){var w,_=v.tabs[x];if((!_.coverage||(w=e._lctf.coverageIndex(_.coverage,o))!=-1)&&v.ltype!=1){if(v.ltype==2){var S=null;if(_.fmt==1){var M=_.pairsets[w];for(p=0;p<M.length;p++)M[p].gid2==s&&(S=M[p])}else if(_.fmt==2){var C=e.U._getGlyphClass(o,_.classDef1),A=e.U._getGlyphClass(s,_.classDef2);S=_.matrix[C][A]}if(S){var P=0;return S.val1&&S.val1[2]&&(P+=S.val1[2]),S.val2&&S.val2[0]&&(P+=S.val2[0]),P}}}}}}}if(i.kern&&!a){var E=i.kern.glyph1.indexOf(o);if(E!=-1){var I=i.kern.rval[E].glyph2.indexOf(s);if(I!=-1)return i.kern.rval[E].vals[I]}}return 0},e.U._applySubs=function(i,o,s,a){for(var l=i.length-o-1,u=0;u<s.tabs.length;u++)if(s.tabs[u]!=null){var f,h=s.tabs[u];if(!h.coverage||(f=e._lctf.coverageIndex(h.coverage,i[o]))!=-1){if(s.ltype==1)i[o],h.fmt==1?i[o]=i[o]+h.delta:i[o]=h.newg[f];else if(s.ltype==4)for(var p=h.vals[f],m=0;m<p.length;m++){var g=p[m],v=g.chain.length;if(!(v>l)){for(var x=!0,w=0,_=0;_<v;_++){for(;i[o+w+(1+_)]==-1;)w++;g.chain[_]!=i[o+w+(1+_)]&&(x=!1)}if(x){for(i[o]=g.nglyph,_=0;_<v+w;_++)i[o+_+1]=-1;break}}}else if(s.ltype==5&&h.fmt==2)for(var S=e._lctf.getInterval(h.cDef,i[o]),M=h.cDef[S+2],C=h.scset[M],A=0;A<C.length;A++){var P=C[A],E=P.input;if(!(E.length>l)){for(x=!0,_=0;_<E.length;_++){var I=e._lctf.getInterval(h.cDef,i[o+1+_]);if(S==-1&&h.cDef[I+2]!=E[_]){x=!1;break}}if(x){var D=P.substLookupRecords;for(m=0;m<D.length;m+=2)D[m],D[m+1]}}}else if(s.ltype==6&&h.fmt==3){if(!e.U._glsCovered(i,h.backCvg,o-h.backCvg.length)||!e.U._glsCovered(i,h.inptCvg,o)||!e.U._glsCovered(i,h.ahedCvg,o+h.inptCvg.length))continue;var V=h.lookupRec;for(A=0;A<V.length;A+=2){S=V[A];var F=a[V[A+1]];e.U._applySubs(i,o+S,F,a)}}}}},e.U._glsCovered=function(i,o,s){for(var a=0;a<o.length;a++)if(e._lctf.coverageIndex(o[a],i[s+a])==-1)return!1;return!0},e.U.glyphsToPath=function(i,o,s){for(var a={cmds:[],crds:[]},l=0,u=0;u<o.length;u++){var f=o[u];if(f!=-1){for(var h=u<o.length-1&&o[u+1]!=-1?o[u+1]:0,p=e.U.glyphToPath(i,f),m=0;m<p.crds.length;m+=2)a.crds.push(p.crds[m]+l),a.crds.push(p.crds[m+1]);for(s&&a.cmds.push(s),m=0;m<p.cmds.length;m++)a.cmds.push(p.cmds[m]);s&&a.cmds.push(\"X\"),l+=i.hmtx.aWidth[f],u<o.length-1&&(l+=e.U.getPairAdjustment(i,f,h))}}return a},e.U.P={},e.U.P.moveTo=function(i,o,s){i.cmds.push(\"M\"),i.crds.push(o,s)},e.U.P.lineTo=function(i,o,s){i.cmds.push(\"L\"),i.crds.push(o,s)},e.U.P.curveTo=function(i,o,s,a,l,u,f){i.cmds.push(\"C\"),i.crds.push(o,s,a,l,u,f)},e.U.P.qcurveTo=function(i,o,s,a,l){i.cmds.push(\"Q\"),i.crds.push(o,s,a,l)},e.U.P.closePath=function(i){i.cmds.push(\"Z\")},e.U._drawCFF=function(i,o,s,a,l){for(var u=o.stack,f=o.nStems,h=o.haveWidth,p=o.width,m=o.open,g=0,v=o.x,x=o.y,w=0,_=0,S=0,M=0,C=0,A=0,P=0,E=0,I=0,D=0,V={val:0,size:0};g<i.length;){e.CFF.getCharString(i,g,V);var F=V.val;if(g+=V.size,F==\"o1\"||F==\"o18\")u.length%2!=0&&!h&&(p=u.shift()+a.nominalWidthX),f+=u.length>>1,u.length=0,h=!0;else if(F==\"o3\"||F==\"o23\")u.length%2!=0&&!h&&(p=u.shift()+a.nominalWidthX),f+=u.length>>1,u.length=0,h=!0;else if(F==\"o4\")u.length>1&&!h&&(p=u.shift()+a.nominalWidthX,h=!0),m&&e.U.P.closePath(l),x+=u.pop(),e.U.P.moveTo(l,v,x),m=!0;else if(F==\"o5\")for(;u.length>0;)v+=u.shift(),x+=u.shift(),e.U.P.lineTo(l,v,x);else if(F==\"o6\"||F==\"o7\")for(var B=u.length,z=F==\"o6\",Z=0;Z<B;Z++){var K=u.shift();z?v+=K:x+=K,z=!z,e.U.P.lineTo(l,v,x)}else if(F==\"o8\"||F==\"o24\"){B=u.length;for(var se=0;se+6<=B;)w=v+u.shift(),_=x+u.shift(),S=w+u.shift(),M=_+u.shift(),v=S+u.shift(),x=M+u.shift(),e.U.P.curveTo(l,w,_,S,M,v,x),se+=6;F==\"o24\"&&(v+=u.shift(),x+=u.shift(),e.U.P.lineTo(l,v,x))}else{if(F==\"o11\")break;if(F==\"o1234\"||F==\"o1235\"||F==\"o1236\"||F==\"o1237\")F==\"o1234\"&&(_=x,S=(w=v+u.shift())+u.shift(),D=M=_+u.shift(),A=M,E=x,v=(P=(C=(I=S+u.shift())+u.shift())+u.shift())+u.shift(),e.U.P.curveTo(l,w,_,S,M,I,D),e.U.P.curveTo(l,C,A,P,E,v,x)),F==\"o1235\"&&(w=v+u.shift(),_=x+u.shift(),S=w+u.shift(),M=_+u.shift(),I=S+u.shift(),D=M+u.shift(),C=I+u.shift(),A=D+u.shift(),P=C+u.shift(),E=A+u.shift(),v=P+u.shift(),x=E+u.shift(),u.shift(),e.U.P.curveTo(l,w,_,S,M,I,D),e.U.P.curveTo(l,C,A,P,E,v,x)),F==\"o1236\"&&(w=v+u.shift(),_=x+u.shift(),S=w+u.shift(),D=M=_+u.shift(),A=M,P=(C=(I=S+u.shift())+u.shift())+u.shift(),E=A+u.shift(),v=P+u.shift(),e.U.P.curveTo(l,w,_,S,M,I,D),e.U.P.curveTo(l,C,A,P,E,v,x)),F==\"o1237\"&&(w=v+u.shift(),_=x+u.shift(),S=w+u.shift(),M=_+u.shift(),I=S+u.shift(),D=M+u.shift(),C=I+u.shift(),A=D+u.shift(),P=C+u.shift(),E=A+u.shift(),Math.abs(P-v)>Math.abs(E-x)?v=P+u.shift():x=E+u.shift(),e.U.P.curveTo(l,w,_,S,M,I,D),e.U.P.curveTo(l,C,A,P,E,v,x));else if(F==\"o14\"){if(u.length>0&&!h&&(p=u.shift()+s.nominalWidthX,h=!0),u.length==4){var N=u.shift(),H=u.shift(),j=u.shift(),O=u.shift(),$=e.CFF.glyphBySE(s,j),ne=e.CFF.glyphBySE(s,O);e.U._drawCFF(s.CharStrings[$],o,s,a,l),o.x=N,o.y=H,e.U._drawCFF(s.CharStrings[ne],o,s,a,l)}m&&(e.U.P.closePath(l),m=!1)}else if(F==\"o19\"||F==\"o20\")u.length%2!=0&&!h&&(p=u.shift()+a.nominalWidthX),f+=u.length>>1,u.length=0,h=!0,g+=f+7>>3;else if(F==\"o21\")u.length>2&&!h&&(p=u.shift()+a.nominalWidthX,h=!0),x+=u.pop(),v+=u.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,v,x),m=!0;else if(F==\"o22\")u.length>1&&!h&&(p=u.shift()+a.nominalWidthX,h=!0),v+=u.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,v,x),m=!0;else if(F==\"o25\"){for(;u.length>6;)v+=u.shift(),x+=u.shift(),e.U.P.lineTo(l,v,x);w=v+u.shift(),_=x+u.shift(),S=w+u.shift(),M=_+u.shift(),v=S+u.shift(),x=M+u.shift(),e.U.P.curveTo(l,w,_,S,M,v,x)}else if(F==\"o26\")for(u.length%2&&(v+=u.shift());u.length>0;)w=v,_=x+u.shift(),v=S=w+u.shift(),x=(M=_+u.shift())+u.shift(),e.U.P.curveTo(l,w,_,S,M,v,x);else if(F==\"o27\")for(u.length%2&&(x+=u.shift());u.length>0;)_=x,S=(w=v+u.shift())+u.shift(),M=_+u.shift(),v=S+u.shift(),x=M,e.U.P.curveTo(l,w,_,S,M,v,x);else if(F==\"o10\"||F==\"o29\"){var re=F==\"o10\"?a:s;if(u.length==0)console.debug(\"error: empty stack\");else{var ie=u.pop(),ee=re.Subrs[ie+re.Bias];o.x=v,o.y=x,o.nStems=f,o.haveWidth=h,o.width=p,o.open=m,e.U._drawCFF(ee,o,s,a,l),v=o.x,x=o.y,f=o.nStems,h=o.haveWidth,p=o.width,m=o.open}}else if(F==\"o30\"||F==\"o31\"){var pe=u.length,he=(se=0,F==\"o31\");for(se+=pe-(B=-3&pe);se<B;)he?(_=x,S=(w=v+u.shift())+u.shift(),x=(M=_+u.shift())+u.shift(),B-se==5?(v=S+u.shift(),se++):v=S,he=!1):(w=v,_=x+u.shift(),S=w+u.shift(),M=_+u.shift(),v=S+u.shift(),B-se==5?(x=M+u.shift(),se++):x=M,he=!0),e.U.P.curveTo(l,w,_,S,M,v,x),se+=4}else{if((F+\"\").charAt(0)==\"o\")throw console.debug(\"Unknown operation: \"+F,i),F;u.push(F)}}}o.x=v,o.y=x,o.nStems=f,o.haveWidth=h,o.width=p,o.open=m};var t=e,r={Typr:t};return n.Typr=t,n.default=r,Object.defineProperty(n,\"__esModule\",{value:!0}),n}({}).Typr}", "title": "" }, { "docid": "cfba4bf5ca454f04048834d2cf31b0c4", "score": "0.48528883", "text": "toBytes(bytes) {\n const recip = new FieldElement();\n const x = new FieldElement();\n const y = new FieldElement();\n recip.invert(this.Z);\n x.mul(this.X, recip);\n y.mul(this.Y, recip);\n y.toBytes(bytes);\n bytes[31] ^= x.isNegative() << 7;\n }", "title": "" }, { "docid": "617baa28db2e910b47bfefb176c27c4e", "score": "0.48503926", "text": "static LUVtoXYZ(luv, normalizedInput = false, normalizedOutput = false) {\n let [l, u, v] = (normalizedInput) ? luv.$normalize(false) : luv;\n let y = (l + 16) / 116;\n let cubeY = y * y * y;\n y = (cubeY > 0.008856) ? cubeY : (y - 16 / 116) / 7.787;\n let refU = (4 * Color.D65[0]) / (Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]));\n let refV = (9 * Color.D65[1]) / (Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]));\n u = u / (13 * l) + refU;\n v = v / (13 * l) + refV;\n y = y * 100;\n let x = -1 * (9 * y * u) / ((u - 4) * v - u * v);\n let z = (9 * y - (15 * v * y) - (v * x)) / (3 * v);\n return Color.xyz(x, y, z, luv.alpha);\n }", "title": "" }, { "docid": "b411a18388f3198f2b4ef86c29ddb33c", "score": "0.48495594", "text": "toRGBAString() {\n\t\t\treturn `rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})`;\n\t\t}", "title": "" }, { "docid": "24fe7802f80b90aa655e27e7fb87a409", "score": "0.48440883", "text": "function luminanace (r, g, b) {\n var a = [r, g, b].map(function (v) {\n v /= 255;\n return v <= 0.03928\n ? v / 12.92\n : Math.pow((v + 0.055) / 1.055, 2.4)\n })\n return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;\n}", "title": "" }, { "docid": "ce673c0e29aa83968955c0280a1e791e", "score": "0.48377675", "text": "function blake2bG(r,i,a,b,c,d){\n\ta = a.add(b);\n\td = rotr64(d.xor(a), 32);\n\tc = c.add(d);\n\tb = rotr64(b.xor(c), 24);\n\ta = a.add(b);\n\td = rotr64(d.xor(a), 16);\n\tc = c.add(d);\n\td = rotr64(b.xor(c), 63);\n}", "title": "" }, { "docid": "3b1b96d401f25c495801d70ff23c2ce4", "score": "0.48150885", "text": "function parse_RgceArea_BIFF2(blob) {\n\t\t\tvar r = parse_ColRelU(blob, 2),\n\t\t\t R = parse_ColRelU(blob, 2);\n\t\t\tvar c = blob.read_shift(1);\n\t\t\tvar C = blob.read_shift(1);\n\t\t\treturn { s: { r: r[0], c: c, cRel: r[1], rRel: r[2] }, e: { r: R[0], c: C, cRel: R[1], rRel: R[2] } };\n\t\t}", "title": "" }, { "docid": "537de19ef060122df9741ab43a2e550e", "score": "0.48142582", "text": "function makeString()\n\t{\t\t\n\t\t//p.a = Number(p.a).toFixed(1) * 1;\n\t\t//p.b = Number(p.b).toFixed(1) * 1;\n\t\t//p.c = Number(p.c).toFixed(1) * 1;\n\t\t\t\t\n\t\tvar _ret = \"\";\n\t\tif(p.a == 0 && p.b == 0)\n\t\t{\n\t\t\t_ret = \"0 = \" + p.c;\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\tif(p.a != 0 && p.b != 0)\n\t\t\t{\n\t\t\t\tp.a == 1 ? p.a = \" \" : p.a == -1 ? p.a = \" –\" : p.a = p.a;\n\t\t\t\t\n\t\t\t\t_ret = p.a + \"<i>x </i>\";\n\n\t\t\t\t_ret = p.b > 0 && p.b == 1 ? _ret + \" +<i> y </i>\" : p.b > 0 ? _ret +\" + \" +p.b+ \"<i>y </i>\" : p.b == -1 ? _ret + \" – <i>y </i>\" : _ret + \" - \" + Math.abs(p.b) + \"<i>y </i>\";\n\n\t\t\t\t_ret += \" = \"+ p.c \n\t\t\t}\n\t\t\telse if(p.a == 0 && p.b != 0)\n\t\t\t{\n\t\t\t\tp.b == 1 ? p.b = \" \" : p.b == -1 ? p.b = \" – \" : p.b = p.b;\n\t\t\t\t_ret = p.b+\"<i>y </i>\" + \" = \" + p.c;\n\t\t\t}\n\t\t\telse if(p.a != 0 && p.b == 0)\n\t\t\t{\n\t\t\t\tp.a == 1 ? p.a = \" \" : p.a == -1 ? p.a = \" –\" : p.a = p.a;\n\t\t\t\t_ret = p.a+\"<i>x </i>\" + \" = \" + p.c;\n\t\t\t}\n\t\t}\n\t\treturn _ret;\n\t}", "title": "" }, { "docid": "38b07132728057a6e919be41a57e4c6c", "score": "0.48130015", "text": "static RGBtoXYZ(rgb, normalizedInput = false, normalizedOutput = false) {\n let c = (!normalizedInput) ? rgb.$normalize() : rgb.clone();\n for (let i = 0; i < 3; i++) {\n c[i] = (c[i] > 0.04045) ? Math.pow((c[i] + 0.055) / 1.055, 2.4) : c[i] / 12.92;\n if (!normalizedOutput)\n c[i] = c[i] * 100;\n }\n let cc = Color.xyz(c[0] * 0.4124564 + c[1] * 0.3575761 + c[2] * 0.1804375, c[0] * 0.2126729 + c[1] * 0.7151522 + c[2] * 0.0721750, c[0] * 0.0193339 + c[1] * 0.1191920 + c[2] * 0.9503041, rgb.alpha);\n return (normalizedOutput) ? cc.normalize() : cc;\n }", "title": "" }, { "docid": "76103033cd43f1d8e053372a2b8196ee", "score": "0.48074326", "text": "function toCoordSeq(buffer) {\n let seq_x = [];\n let seq_y = [];\n let seq_z = [];\n for (let i=0; i<buffer.length; i++) {\n seq_x.push(buffer[i].x); \n seq_y.push(buffer[i].y);\n seq_z.push(buffer[i].z);\n }\n var seq = {'x':seq_x, 'y':seq_y, 'z':seq_z};\n return seq;\n }", "title": "" }, { "docid": "27bbd7571c121c10727f1514e1043be7", "score": "0.48048478", "text": "function convertRGBToHex(rawColorCode) {\n\tvar rgbLen= parseInt(rawColorCode.length)-1;\n\t//var rgbVals= rawColorCode.substring(5,rgbLen);\n\tvar rgbVals= rawColorCode.substring(4,rgbLen);\n\t//alert(\"rgbVals is::\" + rgbVals);\n\tvar rgbArray= rgbVals.split(\",\");\n\t//alert(\"rgbs: r is \" + rgbArray[0] + \", g is \" + rgbArray[1] + \", b is \" + rgbArray[2]);\n\tvar firstVal= calcHex(rgbArray[0]);\n\tvar secondVal= calcHex(rgbArray[1]);\n\tvar thirdVal= calcHex(rgbArray[2]);\n\tvar hexResult= \"#\"+ firstVal + secondVal + thirdVal;\n\treturn hexResult;\n} //end of convertRGBToHex code", "title": "" }, { "docid": "1ba1fede1b638b5e5b34a3e10f9e6eb1", "score": "0.48048317", "text": "toStringHexRGBA() {\n return this.toStringHexRGB() + this.formatHexValue(this.a);\n }", "title": "" }, { "docid": "1333b40681009fb6bbe44ff1eebbb5ff", "score": "0.4803387", "text": "function roty(geo, deg) {\n\t\t\tlet ang = DEG2RAD * deg;\n\t\t\tlet sn = Math.sin(ang);\n\t\t\tlet cs = Math.cos(ang);\n\t\t\tlet x = geo.X;\n\t\t\tlet z = geo.Z;\n\t\t\tgeo.X = cs*x + sn*z;\n\t\t\tgeo.Z = -sn*x + cs*z;\n//\t\t\tconsole.log(sn, cs, x, z, geo.X, geo.Z);\n\t\t}", "title": "" }, { "docid": "f3d0751de1831e42bad4706a749c7f40", "score": "0.47953588", "text": "static coords(q, r) {\n if (q instanceof Hex)\n return `${q.q},${q.r}`;\n return `${q},${r}`;\n }", "title": "" }, { "docid": "15c9891ff06e7331f7210c267fbc5683", "score": "0.47900656", "text": "function parseBgPos(bgPos) {\n var parts = bgPos.split(/\\s/),\n values = {\n \"X\": parts[0],\n \"Y\": parts[1]\n };\n return values;\n }", "title": "" }, { "docid": "4f622566a5d2db40ec655abbbb2c9ab5", "score": "0.47899058", "text": "static XYZtoLUV(xyz, normalizedInput = false, normalizedOutput = false) {\n let [x, y, z] = (normalizedInput) ? xyz.$normalize(false) : xyz;\n let u = (4 * x) / (x + (15 * y) + (3 * z));\n let v = (9 * y) / (x + (15 * y) + (3 * z));\n y = y / 100;\n y = (y > 0.008856) ? Math.pow(y, 1 / 3) : (7.787 * y + 16 / 116);\n let refU = (4 * Color.D65[0]) / (Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]));\n let refV = (9 * Color.D65[1]) / (Color.D65[0] + (15 * Color.D65[1]) + (3 * Color.D65[2]));\n let L = (116 * y) - 16;\n return Color.luv(L, 13 * L * (u - refU), 13 * L * (v - refV), xyz.alpha);\n }", "title": "" }, { "docid": "d319b6bc7bf6a8394225011113e48bea", "score": "0.4787263", "text": "function coordZToX(z) {\r\n\tz = parseInt(z);\r\n\tvar x = ((z - 1) % 801) - 400;\r\n\treturn x;\r\n}", "title": "" }, { "docid": "374500e052cc66ee2a555f186abe8782", "score": "0.47849247", "text": "constructor(r, g, b) {\n this.r = r;\n this.g = g;\n this.b = b;\n }", "title": "" }, { "docid": "4d3833cb3a87b98e6898c9b109e6880c", "score": "0.47833797", "text": "_rgbColorToRGBA(str) {\r\n if (str.indexOf('rgb(') === 0) {\r\n str = str.match(/rgb\\(([^)]+)\\)/)[1];\r\n var parts = str.split(/ *, */).map(Number);\r\n return {\r\n r: parts[0],\r\n g: parts[1],\r\n b: parts[2],\r\n a: 1,\r\n };\r\n }\r\n }", "title": "" }, { "docid": "4fab97dfbcf928b2a068ea7e631988d2", "score": "0.47780555", "text": "function parse_PtgRef(blob,length,opts){//var ptg = blob[blob.l] & 0x1F;\nvar type=(blob[blob.l]&0x60)>>5;blob.l+=1;var loc=parse_RgceLoc(blob,0,opts);return[type,loc];}", "title": "" }, { "docid": "e028300bcd5313a62c188fc9462d0b92", "score": "0.47732514", "text": "scaleMat4v(xyz, m) {\n\n const x = xyz[0];\n const y = xyz[1];\n const z = xyz[2];\n\n m[0] *= x;\n m[4] *= y;\n m[8] *= z;\n m[1] *= x;\n m[5] *= y;\n m[9] *= z;\n m[2] *= x;\n m[6] *= y;\n m[10] *= z;\n m[3] *= x;\n m[7] *= y;\n m[11] *= z;\n\n return m;\n }", "title": "" }, { "docid": "b5498ef4e742f0056e5db4e7e0188b1b", "score": "0.4772481", "text": "function e$3(t){return `rgb(${t.slice(0,3).toString()})`}", "title": "" }, { "docid": "88dbd0111ca39c868f030bb80426b292", "score": "0.47706506", "text": "function Fe(e) { return e.replace(Ne, Pe).replace(Le, function (e, t, n, r) { return Pe(0, t + t, n + n, r + r) }).replace(Je, function (e, t, n) { return je[n] ? (t || \"rgba(\") + je[n] + (t ? \"\" : \",1)\") : e }).replace(Ce, function (e, t, n) { return \"rgba(\" + n.replace(Ie, \"\") + (t ? \"\" : \",1\") + \")\" }) }", "title": "" }, { "docid": "004063201876e27d942c73ea138f722b", "score": "0.47700122", "text": "function spectrum_to_xyz(intensity_cb, adapted=false)\n{\n var i;\n var lambda, X = 0, Y = 0, Z = 0, XYZ;\n\n for (i = 0, lambda = 380; lambda < 780.1; i++, lambda += 5) {\n var Me;\n\n Me = intensity_cb(lambda);\n X += Me * cie_colour_match[adapted ? max(i-3,0) : i][0];\n Y += Me * cie_colour_match[i][1];\n Z += Me * cie_colour_match[i][2];\n }\n XYZ = (X + Y + Z);\n return [X / XYZ /*x*/,\n Y / XYZ /*y*/,\n Z / XYZ /*z*/,\n XYZ];\n}", "title": "" }, { "docid": "752e5ba4c7fca58eff76f535ccbbcc38", "score": "0.47623277", "text": "function write_Blxf(data, o) {\n\t\t\tif (!o) o = new_buf(10);\n\t\t\to.write_shift(1, 0); /* dg */\n\t\t\to.write_shift(1, 0);\n\t\t\to.write_shift(4, 0); /* color */\n\t\t\to.write_shift(4, 0); /* color */\n\t\t\treturn o;\n\t\t}", "title": "" }, { "docid": "6bd65a1e4afc9197f5c6269dd8563449", "score": "0.47588655", "text": "function amr544986() { return '.R'; }", "title": "" }, { "docid": "76ce7fbb76e5745523ebcedf962229ab", "score": "0.47560072", "text": "function xyzMesh () {\n let A = [-R, 0, R] // f_l_d \n let B = [R, 0, R] // f_r_d\n let D = [-R, maxH, R] // f_l_u\n let C = [R, maxH, R] // f_r_u\n\n let H = [-R, 0, -R] // b_l_d\n let E = [R, 0, -R] // b_r_d\n let G = [-R, maxH, -R] // b_l_u\n let F = [R, maxH, -R] // b_r_u\n\n let colors = new Array(18).fill(0.5) \n\n let verticesX = [...E, ...B, ...C, ...E, ...F, ...C]\n let verticesY = [...C, ...D, ...G, ...C, ...F, ...G]\n let verticesZ = [...B, ...A, ...D, ...B, ...C, ...D]\n\n verticesX.forEach((num, index) => {\n if (index % 3 === 0) {\n verticesX[index] = -100\n }\n })\n\n verticesY.forEach((num, index) => {\n if (index % 3 === 1) {\n verticesY[index] = -100\n }\n })\n\n verticesZ.forEach((num, index) => {\n if (index % 3 === 2) {\n verticesZ[index] = -100\n }\n })\n\n\n\n let xMesh = createMesh(verticesX, colors)\n let yMesh = createMesh(verticesY, colors)\n let zMesh = createMesh(verticesZ, colors)\n\n return {\n xMesh,\n yMesh,\n zMesh\n }\n}", "title": "" }, { "docid": "48d685ef210c1983e03a25ad9109adf5", "score": "0.47454706", "text": "function Zb(){var a;!(a=Ja()&&!Vb())&&(a=Yb||Xb)&&(a=!(0<=Ea(Wb)));this.lg=a;this.ag=!(this.lg||Fb&&!Vb());this.Pg=Ka()||Ja()}", "title": "" }, { "docid": "da09a9a1b7757e109eac348cc536c9f6", "score": "0.4740297", "text": "function getFloatTexData(args) {//fbo, srcTex, destTex, channel) {\n\tvar fbo = args.fbo === undefined ? window.fbo : args.fbo;\n\tvar srcTex = args.srcTex;\n\tvar destTex = args.destTex === undefined ? window.encodeTempTex : args.destTex;\n\tvar channel = args.channel === undefined ? 0 : args.channel;\n\n\tvar destUint8Array = new Uint8Array(destTex.width * destTex.height * 4);\n\tfbo.setColorAttachmentTex2D(0, destTex);\n\tfbo.draw({\n\t\tcallback : function() {\n\t\t\tgl.viewport(0, 0, destTex.width, destTex.height);\n\t\t\tquadObj.draw({\n\t\t\t\tshader : encodeShader[channel],\n\t\t\t\ttexs : [srcTex]\n\t\t\t});\n\t\t\tgl.readPixels(0, 0, destTex.width, destTex.height, destTex.format, destTex.type, destUint8Array);\n\t\t}\n\t});\n\tvar destFloat32Array = new Float32Array(destUint8Array.buffer);\nwindow.destUint8Array = destUint8Array;\nwindow.destFloat32Array = destFloat32Array;\n\treturn destFloat32Array;\n}", "title": "" }, { "docid": "1321ce1ce229536bc6676f510b20d0ca", "score": "0.47369882", "text": "function getHex(r, g, b){\n \treturn '#'+intToHex(r)+intToHex(g)+intToHex(b); \n }", "title": "" }, { "docid": "bdd31e50ecf6a716919c48784fea793a", "score": "0.4728602", "text": "function parse_RgceLoc(blob, length, opts) {\n\t\t\tif (opts && opts.biff >= 2 && opts.biff <= 5) return parse_RgceLoc_BIFF2(blob, length, opts);\n\t\t\tvar r = blob.read_shift(opts && opts.biff == 12 ? 4 : 2);\n\t\t\tvar c = parse_ColRelU(blob, 2);\n\t\t\treturn { r: r, c: c[0], cRel: c[1], rRel: c[2] };\n\t\t}", "title": "" }, { "docid": "5ba3799bf18c25c88099ac0f2f0309a3", "score": "0.4723936", "text": "function bwcartoon(pos, r, g, b, outputData) {\n\tvar offset = pos * 4;\n\tif( outputData[offset] < 120 ) {\n\t\toutputData[offset] = 80;\n\t\toutputData[++offset] = 80;\n\t\toutputData[++offset] = 80;\n\t} else {\n\t\toutputData[offset] = 255;\n\t\toutputData[++offset] = 255;\n\t\toutputData[++offset] = 255;\n\t}\n\toutputData[++offset] = 255;\n\t++offset;\n}", "title": "" }, { "docid": "78dc3389475b1ed1d3ff31f4d17b5d12", "score": "0.47217602", "text": "function write_Blxf(data, o) {\n\t\tif(!o) o = new_buf(10);\n\t\to.write_shift(1, 0); /* dg */\n\t\to.write_shift(1, 0);\n\t\to.write_shift(4, 0); /* color */\n\t\to.write_shift(4, 0); /* color */\n\t\treturn o;\n\t}", "title": "" }, { "docid": "1b063a0a3cd06f1d7b05a25224dc90d4", "score": "0.47194502", "text": "generateZPos() {\n return this.ppg * 20;\n }", "title": "" }, { "docid": "ae09df2938ee8ff11df150aa01de9123", "score": "0.4714235", "text": "translateMat4v(xyz, m) {\n return math.translateMat4c(xyz[0], xyz[1], xyz[2], m);\n }", "title": "" }, { "docid": "540ab6f355907bdc4e7cdb462a2cf9fa", "score": "0.4712713", "text": "static TransformCoordinatesFromFloatsToRef(x, y, z, transformation, result) {\n const m = transformation.m;\n const rx = x * m[0] + y * m[4] + z * m[8] + m[12];\n const ry = x * m[1] + y * m[5] + z * m[9] + m[13];\n const rz = x * m[2] + y * m[6] + z * m[10] + m[14];\n const rw = 1 / (x * m[3] + y * m[7] + z * m[11] + m[15]);\n result.x = rx * rw;\n result.y = ry * rw;\n result.z = rz * rw;\n }", "title": "" } ]
c5a715dcd9f4cb86730e1862bfa9d5ae
Install the rest.bitcoin.com repository.
[ { "docid": "356b687745fe2c5ebc922010718c5580", "score": "0.5881463", "text": "installBchApi () {\n shell.cd(`${__dirname.toString()}/../uut`)\n shell.exec('git clone https://github.com/Permissionless-Software-Foundation/bch-api')\n shell.cd('bch-api')\n shell.exec(`npm install > ${__dirname.toString()}/../html/logs/bch-api/install.txt`)\n }", "title": "" } ]
[ { "docid": "dccfdcc33e365b083956bc4ea9e69152", "score": "0.61278445", "text": "function install() {}", "title": "" }, { "docid": "dccfdcc33e365b083956bc4ea9e69152", "score": "0.61278445", "text": "function install() {}", "title": "" }, { "docid": "dccfdcc33e365b083956bc4ea9e69152", "score": "0.61278445", "text": "function install() {}", "title": "" }, { "docid": "dccfdcc33e365b083956bc4ea9e69152", "score": "0.61278445", "text": "function install() {}", "title": "" }, { "docid": "ea2afc9e07f7617218d2757ee3da0c2f", "score": "0.59966934", "text": "function install() {\n}", "title": "" }, { "docid": "b6a1022672d6e6f9a49741bc447a9950", "score": "0.5710943", "text": "install() {\n\n }", "title": "" }, { "docid": "8154914f717d910221b0c4fda5038b3d", "score": "0.5378121", "text": "install() {\n this.installDependencies();\n }", "title": "" }, { "docid": "994ff322a8a06ae4882e4dd220c07cc7", "score": "0.5300763", "text": "install() {\n if (!this.options.runNpmInstall)\n return;\n\n //Install domain\n //this.npmInstall(['ptz-core-domain'], { 'save': true });\n }", "title": "" }, { "docid": "0d8acbc15d71d14c126a339bc4c7c821", "score": "0.52862847", "text": "async install(level=\"local\") { throw new NotImplementedError(); }", "title": "" }, { "docid": "b42a690ade45f356e40ef69e52520896", "score": "0.5244873", "text": "async function installXar () {\n return src(packageName())\n .pipe(existClient.install({ packageUri }))\n}", "title": "" }, { "docid": "43c0f674972fee0449c30a71ff7d7c77", "score": "0.5064684", "text": "function install(data, reason) {}", "title": "" }, { "docid": "43c0f674972fee0449c30a71ff7d7c77", "score": "0.5064684", "text": "function install(data, reason) {}", "title": "" }, { "docid": "ca58ed4ff38dccaafe84905ef3452beb", "score": "0.5017063", "text": "function installXar () {\n return src(packageName())\n .pipe(existClient.install({ packageUri: package.namespace }))\n}", "title": "" }, { "docid": "332944f4bb3dd1d3e83061b83687c456", "score": "0.49823582", "text": "function apiNotify(package_, version, install, success) {\n download(\"https://npackd.appspot.com/api/notify?package=\" +\n package_ + \"&version=\" + version +\n \"&password=\" + password +\n \"&install=\" + (install ? \"1\" : \"0\") + \n \"&success=\" + (success ? \"1\" : \"0\"));\n}", "title": "" }, { "docid": "9ac19646f4bf6be1140bd7df0e378ec7", "score": "0.4981332", "text": "async function composer() {\n console.log( taskHeader(\n '3/5',\n 'Dependencies',\n 'Install',\n 'Composer (PHP)'\n ) );\n\n try {\n const { stdout, stderr } = await execa.commandSync( 'composer install --prefer-dist --no-interaction --no-suggest' );\n console.log( stdout );\n console.log( stderr );\n } catch ( error ) {\n console.error( error.stdout );\n }\n}", "title": "" }, { "docid": "376322e37512e9eba4be369e15ca4ef7", "score": "0.4939114", "text": "async function install({\n name,\n revision,\n url,\n extract,\n directory,\n executable\n}) {\n let outdir = _path.default.join(directory, revision);\n\n let archive = _path.default.join(outdir, decodeURIComponent(url.split('/').pop()));\n\n let exec = _path.default.join(outdir, executable);\n\n if (!_fs.default.existsSync(exec)) {\n let log = (0, _logger.default)('core:install');\n log.info(`${name} not found, downloading...`);\n\n try {\n // ensure the out directory exists\n await _fs.default.promises.mkdir(outdir, {\n recursive: true\n }); // download the file at the given URL\n\n await new Promise((resolve, reject) => _https.default.get(url, response => {\n // on failure, resume the response before rejecting\n if (response.statusCode !== 200) {\n response.resume();\n reject(new Error(`Download failed: ${response.statusCode} - ${url}`));\n return;\n } // log progress\n\n\n if (log.shouldLog('info')) {\n let size = parseInt(response.headers['content-length'], 10);\n let msg = `${(0, _bytes.default)(size)} (${revision}) [:bar] :percent :etas`;\n let progress = new (require('progress'))(_logger.default.format(msg), {\n stream: _logger.default.stdout,\n incomplete: ' ',\n total: size,\n width: 20\n });\n response.on('data', chunk => {\n progress.tick(chunk.length);\n });\n } // pipe the response directly to a file\n\n\n response.pipe(_fs.default.createWriteStream(archive).on('finish', resolve).on('error', reject));\n }).on('error', reject)); // extract the downloaded file\n\n await extract(archive, outdir); // log success\n\n log.info(`Successfully downloaded ${name}`);\n } finally {\n // always cleanup the archive\n if (_fs.default.existsSync(archive)) {\n await _fs.default.promises.unlink(archive);\n }\n }\n } // return the path to the executable\n\n\n return exec;\n} // commonjs friendly", "title": "" }, { "docid": "77b86a8c7c3f19bfdd4f131d30c3b515", "score": "0.48773083", "text": "install() {\n installed = true;\n }", "title": "" }, { "docid": "95f5101bcb7054cd02441c9e36ef5654", "score": "0.48629364", "text": "_installDependencies() {\n return new Promise((resolve, reject) => {\n const thread = Tasks.npm([\"install\", \"--save\"].concat(this.dependencies), {\n cwd: this.dest,\n stdio: [\"ignore\", 1, 2]\n });\n\n thread.on(\"close\", (code) => {\n if (code == 0) resolve();\n else reject();\n });\n });\n }", "title": "" }, { "docid": "a28a2c8b183626d2238fc6a8a0b9d119", "score": "0.48294935", "text": "install() {\n const hasYarn = commandExists('yarn');\n\n this.installDependencies({\n npm: !hasYarn, // Use npm as fallback, if yarn is not installed\n bower: false, // Do not use bower\n yarn: hasYarn,\n skipMessage: this.options['skip-install-msg'],\n skipInstall: this.options['skip-install']\n });\n }", "title": "" }, { "docid": "caea1dfae31966a55cfdca70e5df3de7", "score": "0.4784776", "text": "function install (dir, name, version, cb) {\n cb = cb || function () {}\n\n debug('installing %s@%s into %s', name, version, dir)\n\n async.waterfall([\n resolve.bind(null, name, version),\n handleResolvedPkg.bind(null, dir)\n ], cb)\n}", "title": "" }, { "docid": "53258f5c5b41c13a0278417179c4eb76", "score": "0.4782173", "text": "checkout(version) {}", "title": "" }, { "docid": "780baf8e1d2b2256e81d79c84d1b0cfd", "score": "0.47541103", "text": "install (packages, dir, done) {\n // Install in the given directory\n this._bowerConfig.cwd = dir;\n\n if (!packages || packages.length == 0) {\n // Let's catch the case where we're being asked to install nothing\n throw new Carmel.Error(Carmel.Error.PACK.NO_PACKAGES);\n }\n\n // Keep track of the installation progress\n var progress = packages.length;\n\n // We're going to parse the package names and make sure we're not being\n // asked to install invalid packages;\n packages.forEach((pkg) => {\n if (!pkg) {\n // Make sure the packages we find are not empty\n throw new Carmel.Error(Carmel.Error.PACK.MISSING_PACKAGE);\n }\n\n // Let's parse the package name (expected format: owner/package)\n pkg = pkg.split('/');\n\n if (pkg.length == 1) {\n // We expect fully qualified package names\n throw new Carmel.Error(Carmel.Error.PACK.MISSING_REPO);\n }\n\n if (!this.hasRepo(pkg[0])) {\n // Looks like this repository does not exist\n throw new Carmel.Error(Carmel.Error.PACK.MISSING_REPO);\n }\n\n // Let's load this package's repo; we can safely assume this never\n // returns a null value; for more details refer to the calling function\n let repo = this.repo(pkg[0]);\n\n // Make sure we handle the shorthand resolver to look within our repository\n this._bowerConfig['shorthand-resolver'] = repo.resolver;\n\n // Run the Bower async install command\n this._bower.commands.install([repo.packageSource(pkg[1])], { save: false }, this._bowerConfig)\n .on('error', function(error) {\n // We're going to go through the trouble of creating a meaningful error\n // that Carmel will understand; we start off with assuming this will be\n // an unknown error\n let errorMessage = null;\n\n if (error.code === 'ENOENT' || error.code === 'ENOTFOUND') {\n // This means that a package could not be installed because it was not\n // found so we have a good error now, but we also want to check which\n // package it was that could not get installed\n errorMessage = Carmel.Error.PACK.MISSING_PACKAGE;\n }\n\n // We're going to stop if we encounter an error and we will return an\n // error that Carmel understands and can process\n done(new Carmel.Error(errorMessage));\n })\n .on('end', function (installed) {\n // Another package was succesfully installed\n progress--;\n\n if (progress <= 0) {\n // We're done, we don't expect to install any other packages\n done();\n }\n });\n });\n }", "title": "" }, { "docid": "fc07fbdbe1f7889798c3683ca3eb5783", "score": "0.47076514", "text": "function InstallWallet() {\n\n const onClickInstall = () => {\n const onboarding = new MetaMaskOnboarding();\n onboarding.startOnboarding();\n }\n\n return (\n <>\n <button onClick={onClickInstall}>Install Metamask</button>\n </>\n );\n}", "title": "" }, { "docid": "798c4b6a06153f5a5efc5688d88b9c9f", "score": "0.47007605", "text": "function startBitcoin() {\n updateLatestChainBlock()\n processBlocks()\n}", "title": "" }, { "docid": "abddcf9e3b1078ec920491e156650a11", "score": "0.4672289", "text": "function peer_rest_deploy(host, port, tls, data, peer_id, cb){\n\tvar proto = 'http';\n\tif(tls === true) proto = 'https';\n\tif(tls === 'https') proto = 'https';\n\tvar url = proto + '://' + host.trim() + ':' + Number(port) + '/chaincode';\n\t//console.log('peer_rest_deploy()', parse_4_peer_shortname(peer_id));\n\n\t$.ajax({\n\t\tmethod: 'POST',\n\t\turl: url,\n\t\tdata: JSON.stringify(data),\n\t\tcontentType: 'application/json',\n\t\tsuccess: function(json){\n\t\t\tconsole.log('Success - deployment', json);\n\t\t\tjson.id = peer_id;\n\t\t\tif(cb) cb(null, json);\n\t\t},\n\t\terror: function(e){\n\t\t\tconsole.log('Error - failed to deploy', e);\n\t\t\tif(cb) cb(e, null);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "254e82ff49d33a9fbabd0fb3ef482087", "score": "0.46716774", "text": "async installSmartContract() {\n logger.warn(`Install smart contract not available with Fabric SDK version: ${this.version.toString()}`);\n }", "title": "" }, { "docid": "9e62c47850b74f1fe8be6cb2276159d2", "score": "0.4656466", "text": "constructor(repoUri = 'https://registry.npmjs.org/', cdnUri = 'https://unpkg.com') {\n this.repoUri = repoUri;\n this.cdnUri = cdnUri;\n }", "title": "" }, { "docid": "b7f2f7d20f8274dfd09a5866b8b6bd6d", "score": "0.4652485", "text": "function install () {\n debug('install()');\n if (iframe) uninstall();\n\n buffered = [];\n\n // listen to messages sent to `window`\n event.bind(window, 'message', onmessage);\n\n // create the <iframe>\n iframe = document.createElement('iframe');\n\n // set `loaded` to true once the \"load\" event happens\n event.bind(iframe, 'load', onload);\n\n // set `src` and hide the iframe\n iframe.src = proxyOrigin + '/wp-admin/rest-proxy/#' + origin;\n iframe.style.display = 'none';\n\n // inject the <iframe> into the <body>\n document.body.appendChild(iframe);\n}", "title": "" }, { "docid": "e1aeaee263e5921736c36efa878331be", "score": "0.46409312", "text": "buyStandardPack(node) {\n console.log(\"Buying standard pack of Kards for: \" + node);\n let config = Promise.all(this.getConfig(node));\n return config.then( response => {\n let web3 = response[0];\n let contract = response[1];\n return web3.eth.getAccounts().then(accounts => {\n return contract.methods.buyStandardPack().send({\n from: accounts[0],\n gas: this.targetGasLimit,\n value: web3.utils.toWei(this.standardPackCost, 'ether')\n })\n })\n });\n }", "title": "" }, { "docid": "b852edfccf0bbdd4498b80d1e485ded7", "score": "0.4632656", "text": "async install(url) {\n if (document.getElementById('repoUtilsEndPreview')) {\n document.getElementById('repoUtilsEndPreview').click();\n }\n const path = require('path');\n const fs = require('fs');\n let info;\n try {\n info = await this.getFileInfo(url);\n }\n catch (e) {\n BdApi.showToast(`Error getting info for install!`, { type: 'error' });\n throw e;\n }\n const isTheme = info.type === 'text/css';\n const filename = info.name;\n const installPath = path.join(isTheme ? this.themeLoc : this.pluginLoc, filename);\n const backupPath = path.join(isTheme ? this.themeLoc : this.pluginLoc, 'backups');\n if (fs.existsSync(installPath)) {\n if (!fs.existsSync(backupPath))\n fs.mkdirSync(backupPath);\n let backupName = filename;\n while (fs.existsSync(path.join(backupPath, backupName)))\n backupName += '_';\n fs.renameSync(installPath, path.join(backupPath, filename));\n }\n this.downloadFile(url, installPath)\n .then(async (_) => {\n const checkObject = isTheme ? bdthemes : bdplugins;\n const name = await new Promise(resolve => {\n setInterval(_ => {\n const name = Object.keys(checkObject).find(e => checkObject[e].filename === filename);\n if (name !== undefined)\n resolve(name);\n }, 100);\n });\n this.collapseAllButtonGroups(this.collapseButtonGroup);\n //BdApi.showToast(`${name} Installed Successfully!`, {type: 'success'});\n switch (this.settings.afterInstall) {\n case 'enable':\n setTimeout(_ => {\n if (isTheme) {\n themeModule.enableTheme(name);\n BdApi.showToast(`${name} enabled.`, { type: 'success' });\n }\n else {\n pluginModule.enablePlugin(name);\n BdApi.showToast(`${name} enabled.`, { type: 'success' });\n }\n }, 250);\n break;\n case 'reveal':\n //@ts-ignore\n document.querySelector('button[aria-label=\"User Settings\"]').click();\n requestAnimationFrame(_ => {\n //@ts-ignore\n document.querySelector(`.ui-tab-bar-item:nth-last-child(${isTheme ? 1 : 2})`).click();\n requestAnimationFrame(_ => {\n document.querySelector(`li[data-name=\"${name}\"]`).scrollIntoView({\n behavior: 'auto',\n block: 'center',\n inline: 'center'\n });\n });\n });\n break;\n case 'nothing':\n BdApi.showToast(`${name} is now available in settings.`, { type: 'info' });\n break;\n }\n })\n .catch(err => {\n BdApi.showToast(`There was an error installing the ${isTheme ? 'theme' : 'plugin'}!`, { type: 'error' });\n throw err;\n });\n }", "title": "" }, { "docid": "d979544de0f7b279131371cfd60deb5f", "score": "0.46269283", "text": "function install(tree, options) {\n if (isObject(tree)) {\n fileMergeContents(root, tree, options);\n }\n\n return rootRequire;\n } // Replace this function to enable Module.prototype.prefetch.", "title": "" }, { "docid": "391e1978616a4d6bc713a4f43f5f5bb1", "score": "0.4625925", "text": "async function main() {\n const [deployer] = await ethers.getSigners();\n\n console.log(\"Deploying account:\", await deployer.getAddress());\n console.log(\n \"Deploying account balance:\",\n (await deployer.getBalance()).toString(),\n \"\\n\"\n );\n\n const NFTXV1Buyout = await ethers.getContractFactory(\"NFTXV1Buyout\");\n const v1Buyout = await upgrades.deployProxy(NFTXV1Buyout, [], {\n initializer: \"__NFTXV1Buyout_init\",\n });\n await v1Buyout.deployed();\n\n console.log(\"NFTXV1Buyout:\", v1Buyout.address);\n\n const ProxyController = await ethers.getContractFactory(\n \"ProxyControllerSimple\"\n );\n\n const proxyController = await ProxyController.deploy(v1Buyout.address);\n await proxyController.deployed();\n console.log(\"ProxyController address:\", proxyController.address);\n\n console.log(\"\\nUpdating proxy admin...\");\n\n await upgrades.admin.changeProxyAdmin(\n v1Buyout.address,\n proxyController.address\n );\n\n console.log(\"Fetching implementation addresses...\");\n\n await proxyController.fetchImplAddress({\n gasLimit: \"150000\",\n });\n\n console.log(\"Implementation address:\", await proxyController.impl());\n\n console.log(\"Transfering ownerships...\");\n await v1Buyout.transferOwnership(founderAddress);\n await proxyController.transferOwnership(founderAddress);\n\n console.log(\"\");\n}", "title": "" }, { "docid": "708e39cdfeccedc4a4e7814ff6c3d110", "score": "0.46003076", "text": "installSmartContract() {\n // TODO\n return Promise.resolve();\n }", "title": "" }, { "docid": "2626045e3ac182613217ede7b6926e5a", "score": "0.4586681", "text": "function bundleInstall(localPath, cb) {\n util.log(\"Installing dependencies\");\n exec('bundle install', { cwd: localPath, env: process.env }, cb);\n}", "title": "" }, { "docid": "602383ac7414c6e45415cf79905df005", "score": "0.4562878", "text": "async installBundle() {\n console.log(\"[LiveBundle] installBundle()\");\n return NativeModules.LiveBundle.installBundle();\n }", "title": "" }, { "docid": "d4551bf97e2feee775b5c98eff96aa9f", "score": "0.45484415", "text": "static get RUBYGEMS_URL() {\n return 'https://rubygems.org'\n }", "title": "" }, { "docid": "d13294df677fc5ea69511fc8395e00ca", "score": "0.45381692", "text": "install() {\n let logMsg = `To install your dependencies manually, run: ${chalk.yellow.bold(`${this.clientPackageManager} install`)}`;\n\n if (this.clientFramework === 'angular1') {\n logMsg = `To install your dependencies manually, run: ${chalk.yellow.bold(`${this.clientPackageManager} install & bower install`)}`;\n }\n\n const injectDependenciesAndConstants = (err) => {\n if (err) {\n this.log('Install of dependencies failed!');\n this.log(logMsg);\n } else if (this.clientFramework === 'angular1') {\n this.spawnCommand('gulp', ['install']);\n }\n };\n\n const installConfig = {\n bower: this.clientFramework === 'angular1',\n npm: this.clientPackageManager !== 'yarn',\n yarn: this.clientPackageManager === 'yarn',\n callback: injectDependenciesAndConstants\n };\n\n this.installDependencies(installConfig);\n }", "title": "" }, { "docid": "45177c679ec9eb097938d7f95eeb1dfe", "score": "0.45250875", "text": "transferBitcoin(uri, speed, args) {\r\n if (this.config.debug) {\r\n console.log(\"WalletBF.transferBitcoin\");\r\n }\r\n\r\n let {\r\n confirmation,\r\n success,\r\n deferredSuccess,\r\n refreshBalance,\r\n } = args;\r\n confirmation = confirmation || function (_x, _y, fn) { fn(); };\r\n\r\n const payment = this._parseBitcoinURI(uri);\r\n if (!payment) {\r\n return Promise.reject(new Error (\"Invalid Bitcoin uri\"));\r\n }\r\n\r\n const {\r\n amount,\r\n address,\r\n message,\r\n label,\r\n } = payment;\r\n\r\n let comment = null;\r\n if (message) {\r\n comment = message;\r\n }\r\n if (label) {\r\n comment = comment ? `${comment} | ${label}` : label;\r\n }\r\n\r\n // The total value redeemed must include the bitcoin\r\n // transaction fee.\r\n // The transaction fee is optional but if the fee paid\r\n // is too little it is likely to take a long time to complete.\r\n\r\n let balance = 0;\r\n const issuerBegin = (res) => {\r\n balance = res;\r\n if (balance < amount) {\r\n throw new Error(\"Insufficient funds\");\r\n }\r\n\r\n const params = {\r\n issuerRequest: {\r\n fn: \"redeem\"\r\n }\r\n };\r\n\r\n return this.issuer(\"begin\", params);\r\n };\r\n\r\n const issuerRedeem = (beginResponse) => {\r\n if (beginResponse.deferInfo) {\r\n throw new Error(beginResponse.deferInfo.reason);\r\n }\r\n\r\n if (beginResponse.status !== \"ok\") {\r\n throw new Error(\"Problem on initialiting issuer\");\r\n }\r\n\r\n const paymentAmount = parseFloat(amount);\r\n if (paymentAmount <= 0) {\r\n throw new Error(\"Amount must be positive\");\r\n }\r\n\r\n const recommendedFees = this.getBlockchainCurrencyInfo(beginResponse, \"XBT\");\r\n const minValue = parseFloat(recommendedFees.minRedemptionValue || \"0.0\");\r\n\r\n if (paymentAmount <= minValue) {\r\n throw new Error(\"Transfer amount too small for this blockchain\");\r\n }\r\n\r\n const bitcoinFee = parseFloat(recommendedFees[speed] || \"0.0\");\r\n const txAmount = this._round(paymentAmount + bitcoinFee, 8);\r\n if (txAmount > balance) {\r\n throw new Error(\"Insufficient funds to pay this blockchain fees\");\r\n }\r\n\r\n let args = {\r\n singleCoin: false, //false so as to minimise the fee element\r\n beginResponse: beginResponse,\r\n target: amount,\r\n speed: speed,\r\n comment: comment,\r\n currency: \"XBT\",\r\n action: `send XBT${amount}`,\r\n uri: uri,\r\n address: address,\r\n };\r\n let coinList = this.getStoredCoins(false, \"XBT\");\r\n let selection = this._coinSelection(txAmount, coinList, args);\r\n if (!selection.targetValue || Number.isNaN(selection.targetValue)) {\r\n throw new Error(\"Amount is not a number\");\r\n }\r\n\r\n if (this.config.debug) {\r\n console.log('args for WalletBF._coinSelection', args);\r\n console.log('list for WalletBF._coinSelection', selection);\r\n }\r\n\r\n // _coinSelection will select coins expecting to pay a fee.\r\n // However, redeemCoins does not attract a fee if the change\r\n // is smaller than the smallest coin sent. For this reason we\r\n // need to remove the smallest coins so long as there are\r\n // sufficient funds to satisfy the transactionAmount \r\n if (selection.targetValue == 0 || selection.faceValue < txAmount) {\r\n throw new Error(\"Insufficient funds\");\r\n }\r\n\r\n let allCoins = selection.toVerify.concat(selection.selection);\r\n allCoins.sort((a,b) => {\r\n //we need allCoins in smallest value order\r\n if (a.value < b.value) { return -1; }\r\n if (a.value > b.value) { return 1; }\r\n return 0;\r\n });\r\n\r\n let change = this._round(selection.faceValue - txAmount, 8);\r\n while(allCoins.length > 1) {\r\n if ((change < allCoins[0].value)) {\r\n break;\r\n }\r\n // remove extra coin\r\n change -= allCoins.shift().value;\r\n }\r\n\r\n args.inCoinCount = allCoins.length;\r\n args.outCoinCount = 1;\r\n args.firstTimeCalled = true;\r\n\r\n return new Promise((resolve, reject) => {\r\n const callbackFunctions = {\r\n deferredSuccess,\r\n refreshBalance,\r\n success,\r\n };\r\n\r\n confirmation(parseFloat(amount), bitcoinFee, () => {\r\n this.redeemCoins(allCoins, address, args, \"XBT\", callbackFunctions)\r\n .then(resolve)\r\n .catch(reject);\r\n });\r\n });\r\n };\r\n\r\n return this.Balance(\"XBT\")\r\n .then(issuerBegin)\r\n .then(issuerRedeem);\r\n }", "title": "" }, { "docid": "bae67c4bac4cac89ab784cd23190f567", "score": "0.45210332", "text": "function I(t,e){if(!s)var s=\"https://ambrpay.io/api\";var a=e,n=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(a||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var n=s+\"/smartContractAddresses\";return r.getRequest(n,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,n,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(n=e,!n.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=n.wallet?n.wallet:t.receiverWallet,!a.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==n.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==n.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==n.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)n.daysInterval=parseInt(t.interval);else if(-1==n.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=n.transferOut),n.acceptedCryptoCurrencies.Ethereum.price>0)return n.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=n.currencyCode){if(o<1)throw\"the minimum amount is \"+n.currencyCode+\" 1.00 \";return r.getExchangePrice(n.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*n.fee,c=1e18*c/1e18,a.utils.isAddress(n.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+n.priceLimitPercentage/100);return new Promise((function(t,i){var l=new a.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,n.daysInterval,a.utils.toWei(d.toString(),\"ether\"),u,a.utils.toWei(c.toString(),\"ether\")).send({value:a.utils.toWei(o.toString(),\"ether\"),gas:5e5,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(a){var c={subscriptionPlanId:n.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:a.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return a.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,a){var n=s+\"/price/\"+t+\"/\"+e+\"/\"+a;return r.getRequest(n)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var a=new XMLHttpRequest;a.open(\"GET\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){if(4==a.readyState&&200==a.status)return e(a.responseText);4==a.readyState&&200!=a.status&&s(a.responseText)},a.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,a){var n=new XMLHttpRequest;n.open(\"POST\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){4==n.readyState&&200==n.status?s(n.responseText):4==n.readyState&&200!=n.status&&a(n.responseText)},n.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==a&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(n)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var n=new a.eth.Contract(r.ABI.abi,r.contractAddress),i=n.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,a){if(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(n){return a.eth.getBalance(n,(function(n,r){if(n)return s(n);var i=a.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,n){var i=new a.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){n(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(n).send({value:a.utils.toWei(t),gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(a.utils.toWei(t)).send({gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "title": "" }, { "docid": "1a0485c2dc263198d33009dfaedb0732", "score": "0.45104486", "text": "async function main() {\n\n if (args.json) {\n process.argv.push(\"--message-format=json\");\n }\n\n // did they ask for what is available?\n if (listAvailable) {\n process.exit(await showAvailableCores());\n }\n\n // show what we have.\n if (args.info) {\n process.exit(await showInstalledExtensions());\n }\n\n if (args.help) {\n // yargs will print the help. We can leave now.\n process.exit(0);\n }\n\n // check to see if local installed core is available.\n const localVersion = resolvePathForLocalVersion(args.version && args.version !== '' ? requestedVersion : null);\n\n // try to use a specified folder or one in node_modules if it is there.\n if (await tryRequire(localVersion, \"app.js\")) {\n return;\n }\n\n // if the resolved local version is actually a file, we'll try that as a package when we get there.\n if (await isFile(localVersion)) {\n // this should try to install the file.\n console.trace(`Found local core package file: '${localVersion}'`);\n requestedVersion = localVersion;\n }\n\n // failing that, we'll continue on and see if NPM can do something with the version.\n console.trace(`Network Enabled: ${await networkEnabled}`);\n\n try {\n /* make sure we have a .autorest folder */\n await ensureAutorestHome();\n\n if (args.reset) {\n console.trace(`Resetting autorest extension folder '${rootFolder}'`);\n await (await extensionManager).reset();\n }\n\n // wait for the bootstrapper check to finish.\n await checkBootstrapper;\n\n\n // logic to resolve and optionally install a autorest core package.\n // will throw if it's not doable.\n let selectedVersion = await selectVersion(requestedVersion, force);\n\n // let's strip the extra stuff from the command line before we require the core module.\n const RemoveArgs = From<string>([\"--version\", \"--list-installed\", \"--list-available\", \"--reset\", \"--latest\", \"--latest-release\", \"--runtime-id\"]);\n // Remove bootstrapper args from cmdline\n process.argv = From<string>(process.argv).Where(each => !RemoveArgs.Any(i => each === i || each.startsWith(`${i}=`) || each.startsWith(`${i}:`))).ToArray();\n\n // use this to make the core aware that this run may be legal even without any inputs\n // this is a valid scenario for \"preparation calls\" to autorest like `autorest --reset` or `autorest --latest`\n if (args.reset || args.latest || args.version == 'latest') {\n // if there is *any* other argument left, that's an indicator that the core is supposed to do something\n process.argv.push(\"--allow-no-input\");\n }\n\n console.trace(`Starting ${corePackage} from ${await selectedVersion.location}`);\n if (!tryRequire(await selectedVersion.modulePath, \"app.js\")) {\n throw new Error(`Unable to start AutoRest Core from ${await selectedVersion.modulePath}`);\n }\n } catch (exception) {\n console.log(\"Failure:\");\n console.error(exception);\n console.error((<Error>exception).stack);\n process.exit(1);\n }\n}", "title": "" }, { "docid": "c7e688d22b4f4324b1e0703a02a647b7", "score": "0.45091453", "text": "function install (mod) {\n mod.init(this)\n}", "title": "" }, { "docid": "c7e688d22b4f4324b1e0703a02a647b7", "score": "0.45091453", "text": "function install (mod) {\n mod.init(this)\n}", "title": "" }, { "docid": "32d52f54cde203ebe2b18959c996f72a", "score": "0.4481695", "text": "function downloadRelease(version) {\n const zipUrl = `https://github.com/mercedes-benz/sechub/releases/download/v${version}-client/sechub-cli-${version}.zip`;\n core.debug('SecHub-Url: ' + zipUrl);\n const secHubZip = `${getWorkspaceParentDir()}/sechub.zip`;\n shelljs_shell.exec(`curl -L ${zipUrl} -o ${secHubZip}`);\n shelljs_shell.exec(`unzip -o ${secHubZip} -d ${getWorkspaceParentDir()}`);\n shelljs_shell.exec(`chmod +x ${secHubCli}`);\n}", "title": "" }, { "docid": "c7685af0e048fe4caf545dd730dc34dc", "score": "0.44805047", "text": "function download(callback) {\n\n console.log('downloading compass ...');\n\n request\n .get(githubUrl)\n .on('error', console.log.bind(console))\n .on('response', function (res) {\n\n headers = res.headers;\n\n fs.writeJson(headerFile, res.headers);\n })\n .pipe(unzip.Extract({path: cacheDirectory}))\n .on('close', function () {\n\n console.log('latest version installed');\n\n if(callback) callback();\n });\n}", "title": "" }, { "docid": "5335d04f53141ce00d23c1cd2ff22e8b", "score": "0.44789156", "text": "function buy() {\n try {\n request\n .show(new Promise(function(resolve) {\n resolve({\n total: {label: 'Total', amount: {currency: 'USD', value: '1.00'}},\n });\n }))\n .then(function(result) {\n print(JSON.stringify(result.details));\n return result.complete('success');\n })\n .catch(function(error) {\n print(error);\n });\n } catch (error) {\n print(error);\n }\n}", "title": "" }, { "docid": "4e6e80e806f351758ca23393c9abe7d4", "score": "0.44719294", "text": "function partTwo() {\n\t\t\t// If there is no package.json file, then we can't do anything\n\t\t\tsafefs.exists(packageJsonPath, function (exists) {\n\t\t\t\tif (!exists) return next();\n\n\t\t\t\t// Prepare command\n\t\t\t\tvar command = ['npm', 'install'].concat(opts.args);\n\n\t\t\t\t// Execute npm install inside the pugin directory\n\t\t\t\tsafeps.spawn(command, opts, next);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "010cce4c4085b631ddb5fbd798983f1e", "score": "0.44473934", "text": "install() {\r\n return this.clone(App, \"Install\").postCore();\r\n }", "title": "" }, { "docid": "ac6b62e6be416c517d4c2dfdb59a093f", "score": "0.44368136", "text": "function installLatest(version) {\n\tconsole.log(`Installing version ${version}`);\n\tchild_process.exec(`npm install -g ${alfredNPMpath}`, (error, stdout, stderr) => {\n\t\tif (error) {\n\t\t\tconsole.log(stderr);\n\t\t\tthrow error;\n\t\t} else {\n\t\t\tconsole.log(stdout);\n\t\t\tconsole.log('Alfred has been udpated and will now quit. Relaunch to get back to work!');\n\t\t}\n\t\tprocess.exit();\n\t});\n}", "title": "" }, { "docid": "b61be67ec92cd3d6a7c4a746dff74eff", "score": "0.4426359", "text": "getVersion() {\n return this.call(\"GET\", \"/version/qbittorrent\")\n }", "title": "" }, { "docid": "f5ef03bdcdfd148c53c3c7355b482af0", "score": "0.4415274", "text": "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "title": "" }, { "docid": "19effdd78d4ace22192ebf57d6042b39", "score": "0.440208", "text": "async install(packageName, save = true, extraArgs = [], cwd) {\n const packageManagerArgs = this.getArguments();\n const installArgs = [packageManagerArgs.install, packageName];\n if (save === 'devDependencies') {\n installArgs.push(packageManagerArgs.saveDev);\n }\n return this.run([...installArgs, ...extraArgs], { cwd, silent: true });\n }", "title": "" }, { "docid": "0ad94af4dfe9d2b46d80aa331f1ddc20", "score": "0.4388484", "text": "function fetchReleases( ) {\n\tconst result = [ 'echo \"see https://github.com/ethereum/solc-bin/blob/gh-pages/bin/list.json\"' ] ;\n\tfor( var version in releaseTable ) {\n\t\tresult.push( 'wget https://raw.githubusercontent.com/ethereum/solc-bin/gh-pages/bin/' + releaseTable[ version ] ) ;\n\t}\n\treturn result.join( '\\n' ) ;\n}", "title": "" }, { "docid": "021efe5f1e7d41bd55fe87029a95c765", "score": "0.43727055", "text": "async function installBuildDependencies() {\n const dependencyList = 'libyaml-dev libgdbm-dev libreadline-dev libncurses5-dev zlib1g-dev libffi-dev'\n\n await installDependencies('ruby-build', dependencyList);\n}", "title": "" }, { "docid": "021efe5f1e7d41bd55fe87029a95c765", "score": "0.43727055", "text": "async function installBuildDependencies() {\n const dependencyList = 'libyaml-dev libgdbm-dev libreadline-dev libncurses5-dev zlib1g-dev libffi-dev'\n\n await installDependencies('ruby-build', dependencyList);\n}", "title": "" }, { "docid": "8feb5442ac8d3fa94f97b1093476ae77", "score": "0.43704838", "text": "function installDeps() {\n exec('node --version', function (err, stdout, stderr) {\n const nodeVersion = stdout && parseFloat(stdout.substring(1));\n if (nodeVersion < 5 || err) {\n installDepsCallback(err || 'Unsupported node.js version, make sure you have the latest version installed.');\n } else {\n exec('yarn --version', function (err, stdout, stderr) {\n if (parseFloat(stdout) < 0.15 || err || process.env.USE_YARN === 'false') {\n process.stdout.write('yarn not found, normal npm i');\n process.stdout.write(chalk.yellow('\\nnpm installing...'));\n exec('npm install', addCheckMark.bind(null, installDepsCallback));\n } else {\n process.stdout.write(chalk.yellow('\\nyarn installing...'));\n exec('yarn install', addCheckMark.bind(null, installDepsCallback));\n }\n });\n }\n });\n}", "title": "" }, { "docid": "bf1a748740fc414fdd7b28ee87e0f0e0", "score": "0.43679467", "text": "install() {\n\n let args = {\n tfs: this.tfs,\n pat: this.pat,\n target: this.target,\n appName: this.applicationName,\n azureSub: this.azureSub,\n kubeName: this.kubeName,\n kubeConfig: this.kubeConfig,\n kubeResourceGroup: this.kubeResourceGroup,\n };\n\n app.run(args, this, function(error, generator) {\n if (error) {\n console.log(error);\n }\n else {\n compose.addBuild(generator);\n compose.addRelease(generator);\n }\n });\n }", "title": "" }, { "docid": "14f7ee7a7825b92f01887b9a6d63fb61", "score": "0.43577102", "text": "async function syncCoin() {\n const date = moment().utc().startOf('minute').toDate();\n // Setup the crex24.com api url.\n const url = `${ config.crex24.api }`;\n const btcurl = `${ config.crex24btc.api }`;\n\n const info = await rpc.call('getinfo');\n const masternodes = await rpc.call('getmasternodecount');\n const maxnodes = await rpc.call('getmaxnodecount');\n const nethashps = await rpc.call('getnetworkhashps');\n\n let market = await fetch(url);\n if (Array.isArray(market)) {\n market = market.length ? market[0] : {};\n }\n\n let cbtcusd = await fetch(btcurl);\n if (Array.isArray(cbtcusd)) {\n cbtcusd = cbtcusd.length ? cbtcusd[0] : {};\n }\n\n let btcusdprc = cbtcusd.last;\n let btcprc = (market.last).toFixed(12);\n let usdprc = (btcusdprc * btcprc);\n\n const coin = new Coin({\n cap: market.volumeInUsd,\n createdAt: date,\n blocks: info.blocks,\n btc: (market.last).toFixed(12),\n diff: info.difficulty,\n mnsOff: masternodes.total - masternodes.stable,\n mnsOn: masternodes.stable,\n maxsOff: maxnodes.total - maxnodes.stable,\n maxsOn: maxnodes.stable,\n netHash: nethashps,\n peers: info.connections,\n status: 'Online',\n supply: info.moneysupply,\n usd: usdprc\n });\n\n//process.stdout.write(\"BTC\" + btcprc + \" \" + \"USD\" + usdprc);\n\n\n await coin.save();\n}", "title": "" }, { "docid": "bb25fec8f61f963ca56c4a2e768c852d", "score": "0.43553302", "text": "function download_oc() {\n let url;\n console.log(colors.blue('================================= Download OC ======================================='));\n const result = readlineSync.question(colors.blue('Do you wish to install an oc binary yes/no ? '));\n if (result === 'yes' || result === 'y') {\n const version = readlineSync.question(colors.blue('What version of oc do you wish to install ? \\n - 3.7\\n - 3.9\\n - 3.10\\n - 3.11\\n - 4.1\\n - 4.2\\n - 4.3\\n - 4.4\\n - 4.5\\n - 4.6\\n'));\n exports.version = version;\n switch (version) {\n case '3.7':\n url = 'https://github.com/openshift/origin/releases/download/v3.7.2/openshift-origin-client-tools-v3.7.2-282e43f-linux-64bit.tar.gz';\n break;\n case '3.9':\n url = 'https://github.com/openshift/origin/releases/download/v3.9.0/openshift-origin-client-tools-v3.9.0-191fece-linux-64bit.tar.gz';\n break;\n case '3.10':\n url = 'https://github.com/openshift/origin/releases/download/v3.10.0/openshift-origin-client-tools-v3.10.0-dd10d17-linux-64bit.tar.gz';\n break;\n case '3.11':\n url = 'https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz';\n break;\n case '4.1':\n url = 'https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.1/linux/oc.tar.gz';\n break;\n case '4.2':\n url = 'https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.2/linux/oc.tar.gz';\n break;\n case '4.3':\n url = 'https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.3/linux/oc.tar.gz';\n break;\n case '4.4':\n url = 'https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.4/linux/oc.tar.gz';\n break;\n case '4.5':\n url = 'https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.5/linux/oc.tar.gz';\n break;\n case '4.6':\n url = 'https://mirror.openshift.com/pub/openshift-v4/clients/oc/4.6/linux/oc.tar.gz';\n break;\n default:\n url = false;\n console.log(colors.blue('No binary present'));\n break;\n }\n\n if (url && !(fs.existsSync(`${version}.tar.gz`))) {\n const req = request({\n uri: url,\n method: 'GET',\n timeout: 10000,\n followRedirect: true,\n maxRedirects: 10,\n }).pipe(fs.createWriteStream(`${version}.tar.gz`));\n // Add loading animation\n cliAnimation.radar('===================================================================================>');\n req.on('close', () => {\n console.log(colors.blue('Request finished writing to file'));\n extract_oc(() => {\n console.log('Extract completed');\n });\n });\n } else {\n console.log(colors.blue('Binary Already Download'));\n extract_oc(() => {\n console.log('Extract completed');\n });\n }\n } else {\n console.log(colors.blue('Skipping Binary Download'));\n change_oc(() => {\n console.log('Extract completed');\n });\n }\n}", "title": "" }, { "docid": "7d8580b52ff7c1c107033ea173da7845", "score": "0.4348629", "text": "function connect(network,next,error) {\r\n var web3 = new Web3(new Web3.providers.HttpProvider(network));\r\n web3.eth.getCoinbase(function(err,result) {\r\n if (err) \r\n error(err)\r\n else\r\n next(web3)\r\n })\r\n}", "title": "" }, { "docid": "adce1cb9e098a8e96d60a606d5644f5c", "score": "0.43483698", "text": "async function deployTellorx(_network, _pk, _nodeURL) {\n console.log(\"deploy tellor 3\")\n await run(\"compile\")\n\n var net = _network\n\n\n ///////////////Connect to the network\n let privateKey = _pk;\n var provider = new ethers.providers.JsonRpcProvider(_nodeURL)\n let wallet = new ethers.Wallet(privateKey, provider)\n\n\n ////////////// Deploy Tellor 3\n\n //////////////// Extension\n console.log(\"Starting deployment for extension contract...\")\n const extfac = await ethers.getContractFactory(\"contracts/tellor3/Extension.sol:Extension\", wallet)\n const extfacwithsigner = await extfac.connect(wallet)\n const extension = await extfac.deploy()\n console.log(\"Extension contract deployed to: \", extension.address)\n\n await extension.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"Extension contract deployed to:\", \"https://etherscan.io/address/\" + extension.address);\n console.log(\" Extension transaction hash:\", \"https://etherscan.io/tx/\" + extension.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"Extension contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + extension.address);\n console.log(\" Extension transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + extension.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n\n\n\n //////////////// Tellor (Test)\n console.log(\"Starting deployment for tellor contract...\")\n const telfac = await ethers.getContractFactory(\"contracts/tellor3/Mocks/TellorTest.sol:TellorTest\", wallet)\n const telfacwithsigner = await telfac.connect(wallet)\n const tellor = await telfac.deploy(extension.address)\n console.log(\"Tellor contract deployed to: \", tellor.address)\n\n await tellor.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"Tellor contract deployed to:\", \"https://etherscan.io/address/\" + tellor.address);\n console.log(\" Tellor transaction hash:\", \"https://etherscan.io/tx/\" + tellor.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"Tellor contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + tellor.address);\n console.log(\" Tellor transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + tellor.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n\n //////////////// Master\n console.log(\"Starting deployment for master contract...\")\n const masfac = await ethers.getContractFactory(\"contracts/tellor3/TellorMaster.sol:TellorMaster\", wallet)\n const masfacwithsigner = await masfac.connect(wallet)\n const master = await masfac.deploy(tellor.address, tellor.address) // use same addr for _OLD_TELLOR and _newTellor?\n console.log(\"Master contract deployed to: \", master.address)\n\n await master.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"Master contract deployed to:\", \"https://etherscan.io/address/\" + master.address);\n console.log(\" Master transaction hash:\", \"https://etherscan.io/tx/\" + master.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"Master contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + master.address);\n console.log(\" Master transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + master.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n\n /////////// Deploy Tellor X\n console.log(\"deploy tellor X\")\n\n ////////////////Governance\n console.log(\"Starting deployment for governance contract...\")\n const gfac = await ethers.getContractFactory(\"contracts/testing/TestGovernance.sol:TestGovernance\", wallet)\n const gfacwithsigner = await gfac.connect(wallet)\n const governance = await gfacwithsigner.deploy(master.address)\n console.log(\"Governance contract deployed to: \", governance.address)\n\n await governance.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"Governance contract deployed to:\", \"https://etherscan.io/address/\" + governance.address);\n console.log(\" Governance transaction hash:\", \"https://etherscan.io/tx/\" + governance.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"Governance contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + governance.address);\n console.log(\" Governance transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + governance.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n\n /////////////Oracle\n console.log(\"Starting deployment for Oracle contract...\")\n const ofac = await ethers.getContractFactory(\"contracts//testing/TestOracle.sol:TestOracle\", wallet)\n const ofacwithsigner = await ofac.connect(wallet)\n const oracle = await ofacwithsigner.deploy(master.address)\n await oracle.deployed();\n\n\n if (net == \"mainnet\") {\n console.log(\"oracle contract deployed to:\", \"https://etherscan.io/address/\" + oracle.address);\n console.log(\" oracle transaction hash:\", \"https://etherscan.io/tx/\" + oracle.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"oracle contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + oracle.address);\n console.log(\" oracle transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + oracle.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n ///////////Treasury\n console.log(\"Starting deployment for Treasury contract...\")\n const tfac = await ethers.getContractFactory(\"contracts/testing/TestTreasury.sol:TestTreasury\", wallet)\n const tfacwithsigner = await tfac.connect(wallet)\n const treasury = await tfacwithsigner.deploy(master.address)\n await treasury.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"treasury contract deployed to:\", \"https://etherscan.io/address/\" + treasury.address);\n console.log(\" treasury transaction hash:\", \"https://etherscan.io/tx/\" + treasury.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"treasury contract deployed to:\", \"https://rinkeby.etherscan.io/address/\" + treasury.address);\n console.log(\" treasury transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + treasury.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n console.log(\"treasury Contract verified\")\n\n //////////////Controler\n console.log(\"Starting deployment for Controller contract...\")\n const cfac = await ethers.getContractFactory(\"contracts/Controller.sol:Controller\", wallet)\n const cfacwithsigners = await cfac.connect(wallet)\n const controller = await cfacwithsigners.deploy(governance.address, oracle.address, treasury.address)\n await controller.deployed()\n\n if (net == \"mainnet\") {\n console.log(\"The controller contract was deployed to:\", \"https://etherscan.io/address/\" + controller.address);\n console.log(\" transaction hash:\", \"https://etherscan.io/tx/\" + controller.deployTransaction.hash);\n } else if (net == \"rinkeby\") {\n console.log(\"The controller contract was deployed to:\", \"https://rinkeby.etherscan.io/address/\" + controller.address);\n console.log(\" transaction hash:\", \"https://rinkeby.etherscan.io/tx/\" + controller.deployTransaction.hash);\n } else {\n console.log(\"Please add network explorer details\")\n }\n\n tellorTest = await ethers.getContractAt(\"contracts/tellor3/Mocks/TellorTest.sol:TellorTest\", master.address)\n await tellorTest.connect(wallet).setBalanceTest(wallet.address, ethers.BigNumber.from(\"1000000000000000000000000\"))\n await master.connect(wallet).changeTellorContract(controller.address)\n tellorNew = await ethers.getContractAt(\"contracts/Controller.sol:Controller\", master.address)\n await tellorNew.connect(wallet).init()\n\n console.log(\"TellorX deployed! You have 1 million test TRB in your wallet.\")\n\n console.log('submitting extension contract for verification...');\n await run(\"verify:verify\",\n {\n address: extension.address,\n },\n )\n console.log(\"extension contract verified\")\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for tx confirmation...');\n await controller.deployTransaction.wait(7)\n\n console.log('submitting contract for verification...');\n\n await run(\"verify:verify\",\n {\n address: controller.address,\n constructorArguments: [governance.address, oracle.address, treasury.address]\n },\n )\n console.log(\"Controller contract verified\")\n\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for tellor tx confirmation...');\n await tellor.deployTransaction.wait(7)\n\n console.log('submitting tellor contract for verification...');\n await run(\"verify:verify\",\n {\n address: tellor.address,\n constructorArguments: [extension.address]\n },\n )\n console.log(\"tellor contract verified\")\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for master tx confirmation...');\n await master.deployTransaction.wait(7)\n\n console.log('submitting master contract for verification...');\n await run(\"verify:verify\",\n {\n address: master.address,\n constructorArguments: [tellor.address, tellor.address]\n },\n )\n console.log(\"master contract verified\")\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for governance tx confirmation...');\n await governance.deployTransaction.wait(7)\n\n console.log('submitting governance contract for verification...');\n await run(\"verify:verify\",\n {\n address: governance.address,\n constructorArguments: [master.address]\n },\n )\n console.log(\"governance contract verified\")\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for treasury tx confirmation...');\n await treasury.deployTransaction.wait(7)\n\n console.log('submitting Treasury contract for verification...');\n\n await run(\"verify:verify\", {\n contract: \"contracts/testing/TestTreasury.sol:TestTreasury\",\n address: treasury.address,\n constructorArguments: [master.address]\n },\n )\n\n // Wait for few confirmed transactions.\n // Otherwise the etherscan api doesn't find the deployed contract.\n console.log('waiting for Oracle tx confirmation...');\n await oracle.deployTransaction.wait(7)\n\n console.log('submitting Oracle contract for verification...');\n\n await run(\"verify:verify\",\n {\n contract: \"contracts/testing/TestOracle.sol:TestOracle\",\n address: oracle.address,\n constructorArguments: [master.address]\n },\n )\n\n console.log(\"Oracle contract verified\")\n}", "title": "" }, { "docid": "0a9f16680b191cf6828a185e87ae7d1b", "score": "0.43414465", "text": "afterInstall () {\n return this.addBowerPackageToProject ('justgage', 'https://github.com/toorshia/justgage.git#1.2.9');\n }", "title": "" }, { "docid": "c59a495e4b84730ebba05fbb8e34c370", "score": "0.43407553", "text": "function installFn () {\n // == BEGIN MODULE SCOPE VARIABLES ==================================\n var\n xhiObj = this,\n\n commandMap = xhiObj.commandMap,\n logFn = xhiObj.logFn,\n prefixStr = xhiObj.makePrefixStr( commandMap ),\n stageStatusMap = xhiObj.stageStatusMap,\n\n aliasStr = commandMap.alias_str,\n childProcObj\n ;\n // == . END MODULE SCOPE VARIABLES ==================================\n\n // == BEGIN EVENT HANLDERS ==========================================\n function onCloseFn ( exit_int ) {\n // Store failure and finish\n if ( exit_int !== 0 ) {\n stageStatusMap[ aliasStr ] = false;\n return xhiObj.catchFn(\n prefixStr + 'Fail'\n + '\\nPlease run \"npm install\" to diagnose.'\n );\n }\n\n // Store success and finish\n stageStatusMap[ aliasStr ] = true;\n\n logFn( prefixStr + 'Success' );\n xhiObj.loadLibsFn();\n xhiObj.nextFn();\n }\n // == . END EVENT HANLDERS ==========================================\n\n // == BEGIN MAIN ====================================================\n function mainFn () {\n logFn( prefixStr + 'Start' );\n\n // Invalidate all these stages\n xhiObj.xhiUtilObj._clearMap_(\n stageStatusMap, [\n 'setup', 'dev_test', 'dev_lint', 'dev_cover', 'build'\n ]\n );\n childProcObj = xhiObj.makeSpawnObj(\n 'npm', [ 'install' ], { stdio : 'inherit'}\n );\n childProcObj.on( 'close', onCloseFn );\n }\n // == . END MAIN ====================================================\n mainFn();\n}", "title": "" }, { "docid": "2e29aacfa54f6f565720e38c9a29fb5e", "score": "0.4326433", "text": "async download(revision, progressCallback = () => { }) {\n const url = downloadURL(this._product, this._platform, this._downloadHost, revision);\n const fileName = url.split('/').pop();\n const archivePath = path.join(this._downloadsFolder, fileName);\n const outputPath = this._getFolderPath(revision);\n if (await existsAsync(outputPath))\n return this.revisionInfo(revision);\n if (!(await existsAsync(this._downloadsFolder)))\n await mkdirAsync(this._downloadsFolder);\n // Use Intel x86 builds on Apple M1 until native macOS arm64\n // Chromium builds are available.\n if (os.platform() !== 'darwin' && os.arch() === 'arm64') {\n handleArm64();\n return;\n }\n try {\n await downloadFile(url, archivePath, progressCallback);\n await install(archivePath, outputPath);\n }\n finally {\n if (await existsAsync(archivePath))\n await unlinkAsync(archivePath);\n }\n const revisionInfo = this.revisionInfo(revision);\n if (revisionInfo)\n await chmodAsync(revisionInfo.executablePath, 0o755);\n return revisionInfo;\n }", "title": "" }, { "docid": "d63200cd795775bf82e86f8033f2f320", "score": "0.43250886", "text": "function fetchAll(base, options) {\n if (options === void 0) { options = Object.create(null); }\n return request_1.default({\n base: base,\n url: '/peers/all',\n options: options\n });\n}", "title": "" }, { "docid": "6329830a9fe36c44ae43a9b318309452", "score": "0.43197063", "text": "async function run() {\n const projectPath = path.resolve(__dirname, \"../../\");\n\n // Install sample data\n // Display message in a rectangle of stars 3 lines high with some newline\n // padding\n console.warn(\"\\n\\n\");\n console.warn(\"*******************************\");\n console.warn(\"* Installing sample data... *\");\n console.warn(\"*******************************\");\n console.warn(\"\\n\\n\");\n\n // Move working directory into the magento directory so we can make magento\n // commands easier\n if (shell.cd(path.resolve(projectPath, \".magento\")).code !== 0) {\n console.error(\"Error: Failed to change directory to .magento\");\n process.exit(1);\n }\n\n // Delete the magento installation git repo as nested repos is just confusing\n if (shell.rm(\"-rf\", path.resolve(projectPath, \".magento/.git\")).code !== 0) {\n console.error(\"Error: Failed to delete the magento installation git repo.\");\n process.exit(1);\n }\n\n if (shell.exec(\"bin/magento sampledata:deploy\").code !== 0) {\n console.error(\"Error: Failed to install sample data.\");\n process.exit(1);\n }\n\n if (shell.exec(\"bin/magento setup:upgrade\").code !== 0) {\n console.error(\"Error: Failed to install sample data.\");\n process.exit(1);\n }\n\n // Disable 2FA\n if (\n shell.exec(\"bin/magento module:disable Magento_TwoFactorAuth\").code !== 0\n ) {\n console.error(\"Error: Failed to disable 2FA.\");\n process.exit(1);\n }\n\n // Final cache flush\n if (shell.exec(\"bin/magento cache:flush\").code !== 0) {\n console.error(\"Error: Failed to flush cache.\");\n process.exit(1);\n }\n\n process.exit(0);\n}", "title": "" }, { "docid": "4cdc6203c58af277d1ce2b67ea733c00", "score": "0.43024126", "text": "function installPackages() {\n\tconst command = `${path.normalize(ENV_YARN)} ${YARN_INSTALL_COMMAND}`;\n\tconsole.log('\\nInstalling Packages');\n\n\tverbose(`Executing: ${command}`);\n\tverbose(`Using Node Version: ${execSync(`${path.normalize(ENV_NODE)} -v`)}`);\n\texecSync(command, {\n\t\tstdio: [0, 1, 2]\n\t});\n\n\treturn symlinkNodeBinary();\n}", "title": "" }, { "docid": "70a10a25f76dc7c039ba1c108e423953", "score": "0.43000573", "text": "getCoins () {\n return createRequest({\n fetcher: this.fetcher,\n url: `${this.url}/coins`,\n config: this.config\n })\n }", "title": "" }, { "docid": "c11a4e82cff80ef77282027a9a46af72", "score": "0.42996657", "text": "function initInlineInstalls()\n{\n $(\"link[rel=chrome-webstore-item]\").attr(\"href\", getWebStoreInstallUrl());\n}", "title": "" }, { "docid": "c11a4e82cff80ef77282027a9a46af72", "score": "0.42996657", "text": "function initInlineInstalls()\n{\n $(\"link[rel=chrome-webstore-item]\").attr(\"href\", getWebStoreInstallUrl());\n}", "title": "" }, { "docid": "2c867b071a93d10a1b8045d4192c42ce", "score": "0.42965186", "text": "constructor(rootCaller) {\r\n this.getBinaries()\r\n // TODO: This needs to use a PocketMine updater in the future.\r\n .then(() => this.downloadFile('https://jenkins.pmmp.io/job/PocketMine-MP/317/artifact/PocketMine-MP_1.7dev-317_0df3b00d_API-3.0.0-ALPHA9.phar', global.path + '/server/PocketMine-MP.phar'))\r\n .then(() => this.copyTemplates())\r\n .catch(err => {\r\n throw err;\r\n });\r\n }", "title": "" }, { "docid": "b7a23b53cfa27545b9e1ea8e264f04ca", "score": "0.4295876", "text": "function initdependencies(){\n process.spawnSync('npm',['install', '--save', 'express'], { cwd: './' });\n process.spawnSync('npm',['install', '--save', 'helmet'], { cwd: './' });\n}", "title": "" }, { "docid": "6f18a83793eb445aa8fa491464ca6d05", "score": "0.42950502", "text": "function installPackages(packages) {\n spawn.sync('npm', [\n 'install',\n '-D',\n ...packages\n ], { stdio: 'inherit' });\n}", "title": "" }, { "docid": "7bd5685b49c80e89df003727c69bc57f", "score": "0.42896906", "text": "function updateBitcoin(url)\n {\n // bitcoinData will hold all requested data(typically object or array) in JSON format\n $.getJSON(url, (bitcoinData) =>\n {\n\t const container = document.getElementById('bitcoin');\n\t\t\t container.innerHTML = bitcoinData.bpi.USD.rate;\n });\n }", "title": "" }, { "docid": "8733325d97e38bad29eb8baafc057aae", "score": "0.42871577", "text": "function installPackages(packages) {\n\tasync.forEach(packages, function(name) {\n\t\tvar installCallback = function(err) {\n\t\t\tif (err) {\n\t\t\t\tlog('error', \"failed to install %s: %s\", name, err);\n\t\t\t} else {\n\t\t\t\tlog('info', \"%s installed successfully\", name);\n\t\t\t}\n\t\t};\n\n\t\tvar query = name + \" jquery language:JavaScript\";\n\t\tgithub.searchRepos(query, function(err, repos) {\n\t\t\tif (err) {\n\t\t\t\tinstallCallback(err);\n\t\t\t} else {\n\t\t\t\tif (repos.length > 0) {\n\t\t\t\t\tretrievePackage(name, repos[0], {force: true}, installCallback);\n\t\t\t\t} else {\n\t\t\t\t\tlog('info', \"%s not found\", name);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "cbb30729b79298403c0fd652c55d1e3b", "score": "0.42793906", "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": "8193d63f9c4380d36fccc8dbc0d76960", "score": "0.42786872", "text": "function deployProxyAndDependencies(proxyDir, options){\n const mvn = require('maven').create({\n debug: true,\n cwd: '.',\n profiles: [options.env],\n debug: false\n });\n\n var mvnArgs = {\n 'username': options.username,\n 'password': options.password,\n 'org': options.org,\n 'options': 'update',\n 'apigee.config.options': 'update'\n };\n mvn.execute(['clean', 'install'], mvnArgs).then(() => {\n console.log(proxyDir+ ' successfully configured!');\n setKVMSecret(options);\n });\n}", "title": "" }, { "docid": "2ce7c06cf38bcbd6b51e037073640b55", "score": "0.42780158", "text": "install() {\n let done = this.async();\n return new Promise((resolve, reject) => {\n let i = 0;\n this.log(`☕ ☕ ☕ ☕ ☕ Start npm install ☕ ☕ ☕ ☕ ☕`);\n let process = this.spawnCommand('npm', ['install']);\n process.on('close', (code, signal) => {\n resolve(code);\n done();\n });\n })\n }", "title": "" }, { "docid": "2da5256ef2cb25d2174661e367cb2a74", "score": "0.4275223", "text": "function npmInstaller() {\n let workingDirectory = process.cwd() + \"/\" + name;\n return new Promise((res, rej) => {\n let npmInstall = spawn(\"npm install\", {cwd: workingDirectory});\n npmInstall.stdout.on(\"data\", (data) => {\n console.log(data);\n });\n npmInstall.stderr.on(\"data\", (data) => {\n console.log(data);\n });\n npmInstall.on(\"close\", (code) => {\n return res();\n });\n });\n }", "title": "" }, { "docid": "634e188be563e87565902d689dacc492", "score": "0.42694694", "text": "function root(req, res) {\n res.send('The github repository for this application can be accessed <a href=\"https://github.com/WayneJr/zuri-crud\">here</a>');\n}", "title": "" }, { "docid": "f932a02844ceb59cb4801d9c41fb9819", "score": "0.42672512", "text": "function install_dependencies(seedInfoFile, callback) {\n require_seed_info_file(seedInfoFile, function(error) {\n if( error ) callback(error);\n else {\n log(\"check\", \"dependencies\"); \n sys.puts(\"STILL NEEDS IMPLEMENTING\");\n //TODO: TJ's server doesn't currently have any seeds with deps to do this.. and I'm lazy.\n splitFilesIntoLines(seedInfoFile, function(err, lines){\n// sys.puts(lines);\n callback();\n });\n }\n }); \n/* require_seed_info_file $1\n log check dependencies\n deps=0\n cat $1 | while read line; do\n [[ $line =~ dependencies: ]] && deps=1\n [[ $deps -ne 0 && $line =~ ^\\s*- ]] && deps=2\n [[ $deps -eq 2 && $line =~ ^\\s*.+: ]] && deps=0\n [[ $deps -eq 2 ]] && kiwi $FLAGS install $(normalize_version $line)\n done */\n}", "title": "" }, { "docid": "1105a866a76fc1fe850b3930678c8c83", "score": "0.42653018", "text": "async download(revision, progressCallback = () => { }) {\n const url = downloadURL(this._product, this._platform, this._downloadHost, revision);\n const fileName = url.split('/').pop();\n const archivePath = path.join(this._downloadsFolder, fileName);\n const outputPath = this._getFolderPath(revision);\n if (await existsAsync(outputPath))\n return this.revisionInfo(revision);\n if (!(await existsAsync(this._downloadsFolder)))\n await mkdirAsync(this._downloadsFolder);\n if (os.arch() === 'arm64') {\n handleArm64();\n return;\n }\n try {\n await downloadFile(url, archivePath, progressCallback);\n await install(archivePath, outputPath);\n }\n finally {\n if (await existsAsync(archivePath))\n await unlinkAsync(archivePath);\n }\n const revisionInfo = this.revisionInfo(revision);\n if (revisionInfo)\n await chmodAsync(revisionInfo.executablePath, 0o755);\n return revisionInfo;\n }", "title": "" }, { "docid": "66c681a64cc79af4dcf1baa6daabfec8", "score": "0.42627695", "text": "function make_request (url, callback) {\n var reqOpts = {\n hostname: 'api.github.com',\n path: url,\n headers: {'User-Agent': 'GitHub StarCounter'},\n //auth: opts.auth || undefined\n }\n https.request(reqOpts, function (res) {\n var body = ''\n res\n .on('data', function (buf) {\n body += buf.toString()\n })\n .on('end', function () {\n //fetch_repos(user, JSON.parse(body), callback);\n callback(JSON.parse(body));\n })\n }).end()\n}", "title": "" }, { "docid": "0c1351be3c0edc1eae8af7c86f507c94", "score": "0.4259285", "text": "async function gemInstall(name, version = undefined, binPath = undefined) {\n let options = ['install', name, '--no-document']\n\n if (version) { options.push('-v', version) }\n if (binPath) { options.push('--bindir', binPath) }\n\n await exec.exec('gem', options)\n}", "title": "" }, { "docid": "55add7ed80c933c7b07f9d6fb880f0c1", "score": "0.42487347", "text": "async function getproductticker ( restapiserver, productid ) {\n\n async function restapirequest ( method, requestpath, body ) { // make rest api request.\n \n // create the prehash string by concatenating required parts of request.\n let timestamp = Date.now() / 1000;\n let prehash = timestamp + method + requestpath;\n if ( body !== undefined ) { prehash = prehash + body; }\n // created the prehash.\n \n // base64 decode the secret.\n let base64decodedsecret = Buffer(secret, 'base64');\n // secret decoded.\n \n // create sha256 hmac with the secret.\n let hmac = crypto.createHmac('sha256',base64decodedsecret);\n // created sha256 hmac.\n \n // sign the require message with the hmac and base64 encode the result.\n let signedmessage = hmac.update(prehash).digest('base64');\n // signed message.\n \n // define coinbase required headers.\n let headers = {\n 'ACCEPT': 'application/json',\n 'CONTENT-TYPE': 'application/json',\n 'CB-ACCESS-KEY': key,\n 'CB-ACCESS-SIGN': signedmessage,\n 'CB-ACCESS-TIMESTAMP': timestamp,\n 'CB-ACCESS-PASSPHRASE': passphrase,\n };\n // defined coinbase required headers. yes... content-type is required.\n // see https://docs.prime.coinbase.com/#requests for more information.\n \n // define request options for http request.\n let requestoptions = { 'method': method, headers };\n if ( body !== undefined ) { requestoptions['body'] = body; }\n // defined request options for http request.\n \n // define url and send request.\n let url = restapiserver + requestpath;\n let response = await fetch(url,requestoptions);\n let json = await response.json();\n // defined url and sent request.\n \n return json;\n \n } // made rest api request.\n\n\n // make request.\n let ticker = await restapirequest ( 'GET', '/products/' + productid + '/ticker' );\n // made request.\n\n // handle response.\n if ( Object.keys(ticker).length === 0 ) { console.log('unable to retrieve information'); }\n else if ( Object.keys(ticker).length === 1 ) { console.log('the Coinbase response is \"' + ticker.message + '\"'); }\n else {\n\n // report ticker.\n return ticker; \n // reported ticker.\n\n }\n // handled response.\n\n}", "title": "" }, { "docid": "73f2755bbce263f11f37c2666ce6369a", "score": "0.42427874", "text": "function install(nameOrFile, versionOrOperator, version, callback) {\n if( version ) version= versionOrOperator + \" \" + version;\n else version= versionOrOperator;\n \n if( !require_seed_name(nameOrFile) ) callback();\n else {\n log( \"install\", nameOrFile + \" \" + (version?version:\"\") );\n path.exists(nameOrFile, function(exists) {\n if( exists ) {\n log( \"install\", \"from file\" );\n splitFilesIntoLines(nameOrFile, function(err,lines){\n //TODO: propagate errors properly..\n var lineIndex=0;\n var installLine= function() {\n var lineArgs= splitArgs(lines[lineIndex]);\n lineArgs.unshift(\"install\");\n parseArguments( lineArgs, function() {\n if( ++lineIndex < lines.length ) installLine();\n else callback();\n });\n };\n installLine();\n }); \n } else {\n var url= \"/\"+nameOrFile+\"/resolve\";\n if( version ) url+= \"?version=\"+escape(version);\n get_from_server( url, function(error, resolvedVersion) {\n if( resolvedVersion == \"seed version does not exist.\" ||\n resolvedVersion == \"seed does not exist.\") {\n abort(resolvedVersion, callback);\n } \n else {\n log(\"resolve\", \"version \"+ resolvedVersion); \n path.exists(path.join(expand_path(SEED_DEST),nameOrFile, resolvedVersion) , function(seedVersionExists){\n if( seedVersionExists ) {\n log(\"install\", \"already installed\");\n callback();\n } else {\n download(nameOrFile, resolvedVersion, function(error, seedPath) {\n unpack(seedPath, function(err) {\n if( err ) callback(err); \n else {\n build(path.dirname(seedPath), function() { \n install_dependencies(path.join(path.dirname(seedPath), \"seed.yml\"), callback);\n });\n }\n });\n });\n }\n });\n }\n });\n }\n });\n } \n}", "title": "" }, { "docid": "f6e84be87a22cbd6322473f843598792", "score": "0.4242396", "text": "function npmInstall() {\n return src(['.temp/dist/package.json'])\n .pipe(install({\n args: ['--production']\n }));\n}", "title": "" }, { "docid": "142dfa7b26bcb6a916ab7a83f37a9752", "score": "0.42402035", "text": "function installRequiredNodeModules(callback) {\n if (modules.length == 0) {\n callback();\n return;\n }\n\n var moduleName = modules.shift();\n installNodeModule(moduleName, function(err) {\n if (err) {\n console.log('Failed to install module ' + moduleName);\n console.log(err);\n return;\n }\n\n console.log('Module ' + moduleName + ' is installed');\n installRequiredNodeModules(callback);\n });\n}", "title": "" }, { "docid": "5a573b24d9d729b326a0eac9a38f0e28", "score": "0.42171437", "text": "ensureLocalPackageManager(forceReinstall) {\n // Example: \"C:\\Users\\YourName\\.rush\"\n const rushHomeFolder = path.join(this._rushConfiguration.homeFolder, '.rush');\n if (!fsx.existsSync(rushHomeFolder)) {\n console.log('Creating ' + rushHomeFolder);\n fsx.mkdirSync(rushHomeFolder);\n }\n const packageManager = this._rushConfiguration.packageManager;\n const packageManagerVersion = this._rushConfiguration.packageManagerToolVersion;\n const packageManagerAndVersion = `${packageManager}-${packageManagerVersion}`;\n // Example: \"C:\\Users\\YourName\\.rush\\pnpm-1.2.3\"\n const packageManagerToolFolder = path.join(rushHomeFolder, packageManagerAndVersion);\n const packageManagerMarker = new LastInstallFlag_1.LastInstallFlag(packageManagerToolFolder, {\n node: process.versions.node\n });\n console.log(`Trying to acquire lock for ${packageManagerAndVersion}`);\n return node_core_library_1.LockFile.acquire(rushHomeFolder, packageManagerAndVersion).then((lock) => {\n console.log(`Acquired lock for ${packageManagerAndVersion}`);\n if (!packageManagerMarker.isValid() || forceReinstall || lock.dirtyWhenAcquired) {\n console.log(colors.bold(`Installing ${packageManager} version ${packageManagerVersion}${os.EOL}`));\n // note that this will remove the last-install flag from the directory\n Utilities_1.default.installPackageInDirectory(packageManagerToolFolder, packageManager, this._rushConfiguration.packageManagerToolVersion, `${packageManager}-local-install`, MAX_INSTALL_ATTEMPTS);\n console.log(`Successfully installed ${packageManager} version ${packageManagerVersion}`);\n }\n else {\n console.log(`Found ${packageManager} version ${packageManagerVersion} in ${packageManagerToolFolder}`);\n }\n packageManagerMarker.create();\n // Example: \"C:\\MyRepo\\common\\temp\"\n if (!fsx.existsSync(this._rushConfiguration.commonTempFolder)) {\n fsx.mkdirsSync(this._rushConfiguration.commonTempFolder);\n }\n // Example: \"C:\\MyRepo\\common\\temp\\pnpm-local\"\n const localPackageManagerToolFolder = path.join(this._rushConfiguration.commonTempFolder, `${packageManager}-local`);\n if (fsx.existsSync(localPackageManagerToolFolder)) {\n fsx.unlinkSync(localPackageManagerToolFolder);\n }\n console.log(os.EOL + 'Symlinking \"' + localPackageManagerToolFolder + '\"');\n console.log(' --> \"' + packageManagerToolFolder + '\"');\n fsx.symlinkSync(packageManagerToolFolder, localPackageManagerToolFolder, 'junction');\n lock.release();\n });\n }", "title": "" }, { "docid": "b7c12bc1a2263b9e5ff6add929af9f71", "score": "0.42166713", "text": "function downloadNodeVersion(version, destination, callback) {\n const url = `http://nodejs.org/dist/v${version}/node-v${version}.tar.gz`;\n const filepath = `${destination}/${version}.tgz`;\n exec(`curl ${url} > ${filepath}`, callback);\n}", "title": "" }, { "docid": "dcb652bcea154056be5ddaac61314033", "score": "0.42119092", "text": "function proxy(options, arg, cbDone)\n{\n console.log(\"github\",arg);\n arg.url = 'https://api.singly.com/proxy/github/repos/'+options.user+'/'+options.repo+'/git'+arg.url+'?access_token='+options.token;\n arg.json = true;\n request(arg, cbDone);\n}", "title": "" }, { "docid": "71c35288880338cdb4af4eaca9f08dae", "score": "0.42072022", "text": "installExtension(success, failure) {\n\n // Ensure link exists in <head>\n let link = document.createElement('link');\n link.rel = 'chrome-webstore-item';\n link.href = 'https://chrome.google.com/webstore/detail/jhabnfakkhdeonggiocgbghgdnpjdocg';\n document.head.appendChild(link);\n\n chrome.webstore.install(link.href, success, failure);\n }", "title": "" }, { "docid": "eccb90ad073bb8a4945b48d552323a78", "score": "0.42054665", "text": "install() {\n this.listen(this.update.bind(this))\n }", "title": "" }, { "docid": "7d708c31ccd2d2b2ed34217c57d25b2f", "score": "0.42040548", "text": "InstallAssembly() {\n\n }", "title": "" }, { "docid": "25d94e057cd653efeedb39073bff43ec", "score": "0.4202375", "text": "async function fundNocust() {\n await nocustManager.deposit(\n BOB_PUB, // Account from which to make a deposit (its private key needs to be in the Web3 instance)\n web3.utils.toWei('0.1','ether'), // Amount to deposit\n web3.utils.toWei('10','gwei'), // Gas price, 10 Gwei\n 150000 // Gas Limit\n );\n}", "title": "" }, { "docid": "3d73baebc405bb89e02e90e98d8f1fc3", "score": "0.42006466", "text": "function runInstall(path) {\n function done(error, stdout, stderr) {\n console.log(stdout);\n console.log(stderr);\n }\n\n if (os.type().match(/Windows.*/)) {\n exec('npm install mongodb --mongodb:native', { maxBuffer:200 * 1024 }, done);\n } else {\n exec('./bin/siteInstall.sh', { timeout:60000, cwd:path }, done);\n }\n}", "title": "" }, { "docid": "45fa86098b5feace9983a17874c7cffb", "score": "0.41966823", "text": "installViaGithub(user, repo, ...data) {\n return (0, checkAbsoluteDirectory_1.default)(\"installViaGithub/directory\", this.directory).then(() => {\n return (0, checkNonEmptyString_1.default)(\"installViaGithub/user\", user);\n }).then(() => {\n return (0, checkNonEmptyString_1.default)(\"installViaGithub/repo\", repo);\n }).then(() => {\n const directory = (0, node_path_1.join)(this.directory, repo);\n return new Promise((resolve, reject) => {\n (0, checkAbsoluteDirectory_1.default)(\"installViaGithub/plugindirectory\", directory).then(() => {\n return reject(new Error(\"\\\"\" + repo + \"\\\" plugin already exists\"));\n }).catch(() => {\n return resolve(directory);\n });\n });\n }).then((directory) => {\n return Promise.resolve().then(() => {\n return (0, gitInstall_1.default)(directory, user, repo);\n }).then(() => {\n // install dependencies & execute install script\n return (0, createPluginByDirectory_1.default)(directory, this.externalRessourcesDirectory, this._logger, ...data);\n // check plugin modules versions\n }).then((plugin) => {\n return this.checkModules(plugin).then(() => {\n return Promise.resolve(plugin);\n });\n }).then((plugin) => {\n return Promise.resolve().then(() => {\n return !plugin.dependencies ? Promise.resolve() : (0, npmInstall_1.default)(directory);\n }).then(() => {\n return plugin.install(...data);\n // execute init script\n }).then(() => {\n this.emit(\"installed\", plugin, ...data);\n return plugin.init(...data);\n }).then(() => {\n this.emit(\"initialized\", plugin, ...data);\n this.plugins.push(plugin);\n return Promise.resolve(plugin);\n }).catch((err) => {\n return this.uninstall(plugin, ...data).then(() => {\n return Promise.reject(err);\n });\n });\n }).catch((err) => {\n return new Promise((resolve, reject) => {\n (0, checkAbsoluteDirectory_1.default)(\"installViaGithub/plugindirectory\", directory).then(() => {\n return (0, rmdirp_1.default)(directory).then(() => {\n return err ? reject(err) : resolve();\n });\n }).catch(() => {\n return err ? reject(err) : resolve();\n });\n });\n });\n });\n }", "title": "" }, { "docid": "795d8b5a2d9afe0fc6e30a308f282243", "score": "0.41959304", "text": "function fetchurl(url, method) {\n var request = new XMLHttpRequest();\n request.open('GET', url, true);\n //call it\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n if (method == \"getbtcaddress\") {\n // parse the data\n var data = JSON.parse(request.responseText);\n //debug\n //console.log(data)\n //set the address\n btcaddress = data.address;\n //set the address in the checkout\n var elbtcaddress = document.getElementById('sr-bitcoinaddress');\n //set the href\n elbtcaddress.setAttribute('href', \"bitcoin:\" + btcaddress);\n //set the address\n elbtcaddress.innerText = btcaddress;\n //do pay from wallet also\n var elbtcaddress = document.getElementById('sr-bitcoinaddresswallet');\n //set the href\n elbtcaddress.setAttribute('href', \"bitcoin:\" + btcaddress);\n //do pay from wallet alo\n //debug\n //console.log(elbtcaddress)\n //generate the qr code\n var elbtcqr = document.getElementById('sr-bitcoinqrcode');\n elbtcqr.setAttribute('src', \"https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=\" + btcaddress);\n //debug\n //console.log(elbtcqr)\n }\n if (method == \"getlightningaddress\") {\n // parse the data\n var data = JSON.parse(request.responseText);\n //debug\n //console.log(data);\n lightningaddress = data.address;\n lightninglabel = data.label;\n //set the label\n var ellabel = document.getElementById('sr-lightninglabel');\n changeClassText( document.getElementById('sr-lightninglabel'),\"Order: \"+lightninglabel);\n //debug\n //console.log(lightninglabel);\n //console.log(lightningaddress);\n //set the address in the checkout\n var eladdress = document.getElementById('sr-lightningaddress');\n //set the href (*todo)\n eladdress.setAttribute('href', \"lightning:\" + lightningaddress);\n //set the address\n eladdress.innerText = lightningaddress;\n //do pay from wallet also\n var eladdress = document.getElementById('sr-lightningaddresswallet');\n //set the href\n eladdress.setAttribute('href', \"lightning:\" + lightningaddress);\n //debug\n //console.log(elbtcaddress)\n //generate the qr code\n var elqr = document.getElementById('sr-lightningqrcode');\n elqr.setAttribute('src', \"https://chart.googleapis.com/chart?chs=500x500&cht=qr&chl=\" + lightningaddress);\n //debug\n //console.log(elbtcqr)\n //todo build the liughtning invoice\n //draw the lightning view\n cartstate(8);\n }\n if (method == \"storeproduct\") {\n //do stuff if you want.\n }\n if (method == \"carttemplate\") {\n //debug\n //console.log(request.responseText);\n //add the cart templatehtml\n document.body.insertAdjacentHTML(\"beforeend\", request.responseText);\n //add the click elements listeners\n clickElements()\n //get an address\n if (serverless == 0) {\n //todo : this is code is called in 2 place so we can refactor it into the init\n var elproduct = document.getElementById('sr-add-to-cart');\n if (elproduct.getAttribute('cart-type') != null) {\n carttype = elproduct.getAttribute('cart-type');\n //alert(carttype)\n }\n var url = serverurl + \"api/btcaddress?uid=\" + uid + \"&carttype=\" + carttype;\n fetchurl(url, 'getbtcaddress')\n } else {\n btcaddress = serverlessbtcaddress;\n //set the address in the checkout\n var elbtcaddress = document.getElementById('sr-bitcoinaddress');\n //set the href\n elbtcaddress.setAttribute('href', \"bitcoin:\" + btcaddress);\n //set the address\n elbtcaddress.innerText = btcaddress;\n //do pay from wallet also\n var elbtcaddress = document.getElementById('sr-bitcoinaddresswallet');\n //set the href\n elbtcaddress.setAttribute('href', \"bitcoin:\" + btcaddress);\n //do pay from wallet alo\n //debug\n //console.log(elbtcaddress)\n //generate the qr code\n var elbtcqr = document.getElementById('sr-bitcoinqrcode');\n elbtcqr.setAttribute('src', \"https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=\" + btcaddress);\n }\n }\n if (method == \"storeuserdetails\") {\n cartstate(3);\n }\n //process the check\n if (method == \"checkpayment\") {\n //process the resulrs\n var data = JSON.parse(request.responseText);\n //debug\n //console.log(data.status)\n //check if we have enough confirmartions\n if (data.status == 1) cartstate(4)\n }\n } else {\n // We reached our target server, but it returned an error\n }\n };\n request.onerror = function() {\n // There was a connection error of some sort\n };\n request.send();\n }", "title": "" }, { "docid": "515883b0543012c0a1b9841217a31b86", "score": "0.4194881", "text": "async function installDependencies() {\n var _a;\n const scannedFiles = Object.values(buildPipelineFiles)\n .map((f) => Object.values(f.filesToResolve))\n .reduce((flat, item) => flat.concat(item), []);\n const installDest = path_1.default.join(buildDirectoryLoc, config.buildOptions.metaUrlPath, 'pkg');\n const installResult = await installOptimizedDependencies(scannedFiles, installDest, commandOptions);\n const allFiles = glob_1.default.sync(`**/*`, {\n cwd: installDest,\n absolute: true,\n nodir: true,\n dot: true,\n follow: true,\n });\n if (!((_a = config.optimize) === null || _a === void 0 ? void 0 : _a.bundle)) {\n for (const installedFileLoc of allFiles) {\n if (!installedFileLoc.endsWith('import-map.json') &&\n path_1.default.extname(installedFileLoc) !== '.js') {\n const proxiedCode = await util_1.readFile(url_1.default.pathToFileURL(installedFileLoc));\n const importProxyFileLoc = installedFileLoc + '.proxy.js';\n const proxiedUrl = installedFileLoc.substr(buildDirectoryLoc.length).replace(/\\\\/g, '/');\n const proxyCode = await build_import_proxy_1.wrapImportProxy({\n url: proxiedUrl,\n code: proxiedCode,\n hmr: false,\n config: config,\n });\n await fs_1.promises.writeFile(importProxyFileLoc, proxyCode, 'utf8');\n }\n }\n }\n return installResult;\n }", "title": "" }, { "docid": "7e0c810458415ca79194f0d06b49b6ea", "score": "0.41879535", "text": "function fetch(query, callback) {\n log.info('fetch', query);\n var data = iduri.resolve(query);\n yuan(config).info(data, function(err, res, body) {\n if (err) {\n // when yuan is not available\n return callback(err);\n }\n var filename;\n if(body.filename) {\n filename = body.filename;\n } else {\n filename = body.name + '-' + body.version + '.tar.gz';\n }\n\n var dest = path.join(config.dest, body.name, body.version);\n var cacheDest = path.join(config.cache, filename);\n\n if (!config.force && file.exists(dest)) {\n var pkgId = body.name + '@' + body.version;\n log.info('found', pkgId);\n callback(null, dest);\n } else if (!config.force && file.exists(cacheDest) && md5file(cacheDest) === body.md5) {\n extract(cacheDest, dest, callback);\n } else {\n fetchTarball('repository/' + body.name + '/' + body.version + '/' + filename, dest, callback);\n }\n });\n}", "title": "" }, { "docid": "61e9ea6f273b846c3597abe5beac79b9", "score": "0.41863894", "text": "async function npmInstall(cwd, prefix) {\n\tconst name = path.basename(cwd);\n\tconsole.log(`${info(prefix)} Installing packages for \"${name}\"...`);\n\n\tconst cp = execFile(\n\t\tnpmCmd,\n\t\t['install', '--no-fund', '--no-shrinkwrap', '--no-audit'],\n\t\t{\n\t\t\tcwd,\n\t\t}\n\t);\n\n\tprefix = prefix || `[${name}]`;\n\tcp.stdout.pipe(createPrefixTransform(info(prefix))).pipe(process.stdout);\n\tcp.stderr.pipe(createPrefixTransform(error(prefix))).pipe(process.stderr);\n\n\tawait onExit(cp);\n}", "title": "" } ]
6022c6aa1e3418f3b907f75f2fcdcda6
ESTA FUNCION SERVIRA PARA MOSTRAR LOS TIPOS DE RAMO
[ { "docid": "08317c8378f6e78676cdbe5d816a59ef", "score": "0.0", "text": "static Search(req,res){\n let id = req.params.id_bouquet;\n new mssql.ConnectionPool(config.config).connect().then((pool)=>{\n return pool.request().query(`EXEC sp_search_bouquet_type ${id}`) \n }).then((fields)=>{\n mssql.close();\n let rows = fields.recordset;\n res.json(rows);\n }).catch(err=>{\n mssql.close();\n res.json(err);\n })\n }", "title": "" } ]
[ { "docid": "6dcf88b19319514a4a0581330dcd43a8", "score": "0.63709027", "text": "function rotaDeFuga() {\n timeRotaDeFuga = new Date().getMilliseconds();\n posicaoAtual();\n nearbyPolices();\n}", "title": "" }, { "docid": "3baae90dd35f220f4573faf381ba3605", "score": "0.63096875", "text": "function affiche() {}", "title": "" }, { "docid": "bcbb124a5bc1e6f5b6e71e8065ed9c83", "score": "0.614974", "text": "function trabajoFaltante(){\n\t\n\tvar analizando = 0\n\tvar rangos = []\n\t\n\tfor (var a=0;a<workers.length;a++){\n\t\t\n\t\tObject.keys(workers[a]).forEach(function(key){\n \n if(key == 'trabajo'){\n\t\t\t\t\n\t\t\t\tif (workers[a][key] == Config.valoresWorkers.trabajoAnalizar){\n\t\t\t\t\t\n\t\t\t\t\tanalizando++\n\t\t\t\t\trangos.push(workers[a]['rango'])\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\t// Hace falta un analizador\n\tif (analizando < analizadores){\n\t\t\n\t\tvar total = 0\n\t\tvar tmpTotal = 0\n\t\t\n\t\trangos.sort(function(a,b){return a-b})\n\t\t\n\t\tfor (var a=0;a<analizadores;a++){\n\t\t\t\n\t\t\t// Ej: (0 * 100) + (100*1) = 100\n\t\t\ttotal += (a*Config.valoresWorkers.xNucleo) + (Config.valoresWorkers.xNucleo + Config.valoresWorkers.pmerInd) // TODO Modificar segun #xNucleo y #indActual\n\t\n\t\t}\n\t\t\n\t\tfor (var a=0;a<rangos.length;a++){\n\t\t\t\n\t\t\ttmpTotal += rangos[a]\n\t\t\t\n\t\t}\n\t\t\n\t\treturn [Config.valoresWorkers.trabajoAnalizar,total-tmpTotal]\n\t\t\n\t// Hace falta un servidor web\n\t}else {\n\t\t\n\t\treturn [Config.valoresWorkers.trabajoWeb]\n\t\t\n\t}\n}", "title": "" }, { "docid": "f153c67eeedecd467ee38cf8d4506fc8", "score": "0.6087745", "text": "function calcolaPrezzo() {\n\n var prezzo = 0;\n\n\n var camera = $(\"#PrenotazioneCamera\").val();\n var speciali = $(\"#PrenotazioneSpeciali\").val().length;\n var trattamento = $(\"#PrenotazioneTrattamento\").val();\n var tipoCliente = $(\"#PrenotazioneTipoCliente\").val();\n prezzo = 90;\n if (camera == \"B\") { prezzo = 100; }\n if (camera == \"C\") { prezzo = 110; }\n if (camera == \"D\") { prezzo = 120; }\n if (camera == \"E\") { prezzo = 130; }\n if (camera == \"F\") { prezzo = 140; }\n if (camera == \"G\") { prezzo = 150; }\n if (camera == \"H\") { prezzo = 160; }\n if (camera == \"L\") { prezzo = 170; }\n if (camera == \"P\") { prezzo = 180; }\n\n prezzo += speciali * 8;\n\n\n if (trattamento == \"FB\") { prezzo += 20; }\n if (trattamento == \"HB\") { prezzo += 10; }\n if (trattamento == \"BB\") { prezzo += 5; }\n if (trattamento == \"SC\") { prezzo += 0; }\n\n\n if (tipoCliente == \"Group\") { prezzo -= prezzo * 0.2; }\n if (tipoCliente == \"Transient\") { prezzo = prezzo; }\n if (tipoCliente == \"Contract\") { prezzo -= prezzo * 0.30; }\n\n\n\n return prezzo;\n }", "title": "" }, { "docid": "6e3e42a49c0e25d54397ce655037c95b", "score": "0.6052857", "text": "infomarCompraRechazada(){\n\t\t//Estado actual: RECHAZADA_POR_INFRACCION\n\t\tthis.estado.nombre = 'RECHAZADA_POR_INFRACCION';\n\t\tthis.estado.timestamp = new Date();\n\t\tthis.estado.transicion_in = '[resultado_infraccion = conInfraccion]';\n\t\tthis.estado.transicion_out = [];\n\t\tthis.logEstado();\n\n\t\tvar topico = '.web.';\n\t\tvar mensaje = new Object();\n\t\tmensaje.evento = 'compraRechazadaPorInfraccion'; \n\t\tmensaje.data = this.data;\n\t\tthis.server.publicarMensaje(topico, mensaje);\n\n\t}", "title": "" }, { "docid": "e781346e6560962caf08135219e521b7", "score": "0.6052091", "text": "function ordenada(){}", "title": "" }, { "docid": "6cb9f0000ad5487ba6604d8bc5d080b9", "score": "0.6035895", "text": "function obten_asignados(id_cliente){\n\n\nObtengo_datos:string; //separado por comas desde Ajax via PHP o python\n\ntexto, substring, \n\n//llamada a funcion de marcado, llenado de cesta \n\nfor texto until longitud; \n\nmarcado_actual(numero);\nagregar_cesta(numero);\n\nend for\n\n\n}", "title": "" }, { "docid": "cb63cf6d6060d2e7a5c07672ebe4793f", "score": "0.6000296", "text": "function calculoRazon(MatrizEcuaciones,arrayColumnaPiote){\n var contador=0;\n var arrayRazon=new Array();\n var booleanRazonPositivo=false;\n //console.log(arrayRazon.valueOf);\n\n for (var i = 0; i < fila-1; i++) {// solo las igualdades de la ecuacion\n for (var j = (column-1); j < column; j++) {// solo las igualdades de la ecuacion\n // recorreos la ultima fila de las igualdades para encontrar la razon//\n //dividir fila de la igualda con fila de pibote\n //console.log(MatrizEcuaciones.valueOf()[i][j]+\"/\"+arrayColumnaPiote.valueOf()[contador]+\" = \"+MatrizEcuaciones.valueOf()[i][j]/arrayColumnaPiote.valueOf()[contador]);\n arrayRazon.push(MatrizEcuaciones.valueOf()[i][j]/arrayColumnaPiote.valueOf()[contador]);\n\n break;//obtengo la columna pibote\n }\n \n contador++;\n }\n\n var indiceFila=0;\n let minRazon = arrayRazon[0]; //nos quedamos con el primer número del array, OK\n for(let i=0; i < arrayRazon.length; i++) { //recorremos el array, OK\n \n if (minRazon > arrayRazon[i] && arrayRazon[i]>=0) {// solo las razoness positivas\n minRazon=arrayRazon[i]; // nuevo mínimo encontrado, nos quedamos con él\n indiceFila=i;\n \n \n }\n }\n // console.log(\"La razon es :\",minRazon);\n // console.log(\"IndiceColumna de la razon : \",indiceColumna);\n if(minRazon>=0){//pregunto si la razon es positiva o negatativa\n booleanRazonPositivo=true;\n }\n \n var respuestaCaculoRazon = { 'arrayRazonDividir':arrayRazon, 'booleanRazonPositivo':booleanRazonPositivo,'valorMinimoRazon':minRazon,'indicePosicionFila':indiceFila}\n return respuestaCaculoRazon;\n }", "title": "" }, { "docid": "13bf72602383f2d31b7d1e0ad45a8c28", "score": "0.5998238", "text": "function rutina(despierto, clase, hambre, masHambre, empanada, luz) {\n despierto();\n clase();\n hambre();\n masHambre();\n empanada();\n luz();\n}", "title": "" }, { "docid": "6918629b14eb5ee51c9466af0ea5f903", "score": "0.5973572", "text": "function chefe(){\n var vetor = []\n entrada(vetor)\n console.log(vetor) \n soma10(vetor)\n console.log(`Valor final do vetor ${vetor}`)\n }", "title": "" }, { "docid": "a1cb2f9ee11ab9077c33ba8acc511a06", "score": "0.5970186", "text": "function buscarHoja(){\n\t//se obtienen los servicios puestos en el html mas uno que se va agregar\n\treturn (Math.floor(numFrapActivos/8));\n}", "title": "" }, { "docid": "7cb05eae15d8b497a80a51b168f150d1", "score": "0.5960776", "text": "function getAnillosXApi( nombreAnillo, fechaAnilloInit, fechaAnilloFin , idEstado, estatusId){\n\tcargaLoading();\n\n\tif( idEstado == -1 ){\n\t\tcierraLoading();\n\t\tcargaMensajeModal(\"Localizador\",\"Seleccione un estado.\", TIPO_MENSAJE_ACEPTAR, TIPO_ESTATUS_ALERTA, null);\n\t\treturn false;}\n\t\t\n\tinvocarJSONServiceAction(\"obtieneAnillosxfiltros\"\n\t\t\t\t\t\t\t,{ idEstado \t: idEstado,\n\t\t\t\t\t\t\t nombreAnillo : nombreAnillo,\n\t\t\t\t\t\t\t fechaIni \t: fechaAnilloInit,\n\t\t\t\t\t\t\t fechaFin \t: fechaAnilloFin,\n\t\t\t\t\t\t\t estatusId : JSON.stringify(estatusId) },\n\t\t\t'response',\n\t\t\tfunction() {\n\n\t\t\t\tcargaMensajeModal(\"Localizador\",\"Error en el servicio consultar radios localizados.\", TIPO_MENSAJE_ACEPTAR, TIPO_ESTATUS_ALERTA, null);\n\t\t\t\tclearMarkers();\n\t\t\t\tpintarGeneradores(radioSeleccionado,null);\n\t\t\t\tpintarMdsAnillos(radioSeleccionado,null);\n\t\t\t\t pintarCompetencias(radioSeleccionado,null);\n\t\t\t\tcierraLoading();\n\t\t\t},\n\t\t\tfunction() {\n\t\t\t\t//Función al finalizar\n\t\t\t});\n\n\tresponse = function(data){\n\t\t\n\t\tmap = null;\n\t\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\t zoom: 6,\n\t\t center: {lat: 19.356703, lng: -99.276124}\n\t\t });\n\t\t\n\t\tboundsGeneral = new google.maps.LatLngBounds(); \n\t\t\n\t\tcleanMapMDsTdas();\n\t\tpintarCompetencias(radioSeleccionado,null);\n\t\tpintarGeneradores(radioSeleccionado,null);\n\t\tpintarMdsAnillos(radioSeleccionado,null);\n\t\tclearMarkers();\n\t\t\n\t\tif( data.codigo == 205 || data.codigo == 400 || data.codigo == 403 || data.radios == undefined){\n\t\t\tcierraLoading();\n\t\t\tcargaMensajeModal(\"Localizador\",data.mensaje, TIPO_MENSAJE_ACEPTAR, TIPO_ESTATUS_ALERTA, null);\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tradiosArray = [];\n\t\tboundsAsig = new google.maps.LatLngBounds();\n\t\t\n\t\tvar estatusN = 0;\n\t\tvar estatusA = 0;\n\t\tvar estatusP = 0;\n\t\tvar estatusS = 0;\n\t\tvar estatusC = 0;\n\t\tvar estatusM = 0;\n\t\t\n\t\t$(\"#estatusN\").html(\"\");\n\t\t$(\"#estatusA\").html(\"\");\n\t\t$(\"#estatusP\").html(\"\");\n\t\t$(\"#estatusS\").html(\"\");\n\t\t$(\"#estatusC\").html(\"\");\n\t\t$(\"#estatusM\").html(\"\");\n\t\t\n\t\t\n\t\tvar vertiendas = $(\"#ver-tiendas-map\").is(\":Checked\");\n\t\tvar vermds = $(\"#ver-mds-map\").is(\":Checked\");\n\t\t\n\t\tdata.TotalTdas.forEach(function(element,index){\n\t\t\tvar mapaPaint = null;\n\t\t\t\n\t\t\tif(vertiendas)\n\t\t\t\tmapaPaint = map;\n\t\t\t\n\t\t\tcrearMarkerTiendasEstado(element,mapaPaint);\n\t\t});\n\t\t\n\t\tdata.TotalMds.forEach(function(element,index){\n\t\t\tvar mapaPaint = null;\n\t\t\t\n\t\t\tif(vermds)\n\t\t\t\tmapaPaint = map;\n\t\t\t\n\t\t\tcrearMarkerMdsEstado(element, mapaPaint);\n\t\t});\n\t\t\n\t\tdata.radios.forEach(function(element,index){\n\t\t\t\n\t\t\t var estatusID = Number.parseInt(element.estatusId);\n\t\t\t \n\t\t\t switch(estatusID){\n\t\t\t\t case 1:\n\t\t\t\t\t estatusN++;\n\t\t\t\t break;\n\t\t\t\t case 2:\n\t\t\t\t\t estatusA++;\n\t\t\t\t break;\n\t\t\t\t case 3:\n\t\t\t\t\t estatusP++;\n\t\t\t\t break;\n\t\t\t\t case 4:\n\t\t\t\t\t estatusS++;\n\t\t\t\t break;\n\t\t\t\t case 5:\n\t\t\t\t\t estatusC++;\n\t\t\t\t break;\n\t\t\t\t case 6:\n\t\t\t\t\t estatusM++;\n\t\t\t\t break;\n\t\t\t }\n\n\t\tcoordenadas = new CoordenadaClass(parseFloat(element.latitud),parseFloat(element.longitud));\n\t\t\n\t\tradio = new ClassRadios();\n\t\t\tradio.id \t\t\t\t= element.radioId;\n\t\t\tradio.sitio \t\t\t= element.nombre;\n\t\t\tradio.anillo \t\t\t= element.longRadio;\n\t\t\tradio.lat \t\t\t= element.latitud;\n\t\t\tradio.lng \t\t\t\t= element.longitud;\n\t\t\tradio.infoSitio \t\t= element.datosRadio;\n\t\t\tradio.estatusId = element.estatusId;\n\t\t\tradio.estatus = element.estatus;\n\t\t\tradio.UsrAsignado = element.UsrAsignado;\n\t\t\tradio.usrAsignadoId = element.usrAsignadoId;\n\t\t\tradio.visitasRadio = element.visitasRadio;\n\t\t\tradio.fechaAsignado = element.fechaAsignado;\n\t\t\tradio.rechazado = element.rechazado;\n\t\t\tradio.totalUE = element.totalUE;\n\t\t\t\n\t\t\tradio.objCoordenadas \t= coordenadas;\n\n\t\t\t/* Crear pines MDs */\n//\t\t\tif(element.mds.length > 0){\n//\t\t\t\tradio.mds = element.mds;\n//\t\t\t\t\n//\t\t\t\tradio.mds.forEach(function(md,index){\n//\t\t\t\t\tcrearMarkerMdsAnillo(md);\n//\t\t\t\t});\t\t\t\t\n//\t\t\t}\n\t\t\t\n\t\t\t/* Crear pines COMPETENCIA */\n\t\t\tif(element.competencia.length > 0){\n\t\t\t\tradio.competencia \t= element.competencia;\n\t\t\t\tradio.competencia.forEach(function(competencia,index){\n\t\t\t\t\tcrearMarkerCompetencias(competencia);\n\t\t\t\t});\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tobjArray[element.radioId] = radio;\n\t\t\taddMarkerEstatus(objArray[element.radioId], map);\t\t\n\t\t\t\n\t\t\t/* Crear pines GENERADORES */\n\t\t\tif(element.generadores.length > 0){\n\t\t\t\tradio.generadores \t= element.generadores;\n\t\t\t\t\n\t\t\t\tradio.generadores.forEach(function(generador,index){\n\t\t\t\t\tcrearMarkerGenerador(generador);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\testatusN >0 ? $(\"#estatusN\").html(\"(\"+estatusN+\")\") : false;\n\t\testatusA >0 ? $(\"#estatusA\").html(\"(\"+estatusA+\")\") : false;\n\t\testatusP >0 ? $(\"#estatusP\").html(\"(\"+estatusP+\")\") : false;\n\t\testatusS >0 ? $(\"#estatusS\").html(\"(\"+estatusS+\")\") : false;\n\t\testatusC >0 ? $(\"#estatusC\").html(\"(\"+estatusC+\")\") : false;\n\t\testatusM >0 ? $(\"#estatusM\").html(\"(\"+estatusM+\")\") : false;\n\n\n\t\tmap.fitBounds(boundsGeneral);\n\t map.panToBounds(boundsGeneral); \n\t\tsetTimeout(function(){cierraLoading();},500);\n\t\ttotalAnillosNuevos();\n\t}\n}", "title": "" }, { "docid": "7d2efd8a0c3f00fd9353c6d6e8dc486b", "score": "0.59522104", "text": "getResumenVentas() {\n let efectivo = document.getElementById(\"lblEfectivo\").value;\n let cambio = efectivo - this.ordenSelected.total - this.propina;\n let fechaOrden = this.convertDate();\n let filter = {\n where: {\n fecha: fechaOrden,\n },\n };\n axios\n .get(this.uriVentas + \"?filter=\" + JSON.stringify(filter))\n .then((response) => {\n this.resumenDeVenta = response.data;\n if (this.resumenDeVenta.length == 0) {\n console.log(\"vacio\");\n this.createResumenDeVentas();\n\n } else {\n console.log(\"AQUI LO LLAMARE updateResumenDeVentas\");\n this.updateResumenDeVentas();\n\n }\n console.log(\"estoy aqui\");\n })\n .catch((e) => {\n console.log(e);\n });\n }", "title": "" }, { "docid": "051f40f0527a9c366d2d628bfb2e04e5", "score": "0.5939279", "text": "curar(paciente) {\n\n }", "title": "" }, { "docid": "cb24eb46750944074ab1d6bdf15801c2", "score": "0.59249", "text": "function llenaPantallaActualizacion(corredor){\r\n\r\n var cantidad = 0; \r\n var cor = \"\"; \r\n var cappro = [0,0];\r\n var corPro = \"\";\r\n var corCap = \"\";\r\n\r\n // variables con legibilidades de segmentos\r\n var duracionAnomalia = 0,\r\n tiempoTrayecto = 0,\r\n demora = 0,\r\n causa = \"\";\r\n\r\n // Vacío ventana \r\n $(\"#corredores .etiquetasCapital\").html(\"\");\r\n $(\"#corredores .etiquetasProvincia\").html(\"\");\r\n $(\"#corredores #corredorCapital\").html(\"\");\r\n $(\"#corredores #corredorProvincia\").html(\"\");\r\n $(\"#avisoProvincia\").html(\"\");\r\n $(\"#avisoCapital\").html(\"\");\r\n $(\"#corredores .corredoresCapital\").html(\"\");\r\n $(\"#corredores .corredoresProvincia\").html(\"\");\r\n $(\"#panelesProvincia\").html(\"\");\r\n $(\"#panelesCapital\").html(\"\");\r\n\r\n //pregunto si hay segmentos de provincia\r\n if ( typeof(corredores[corredor].provincia) != \"undefined\"){\r\n cantidad = corredores[corredor].provincia.length;\r\n cor = corredores[corredor].provincia;\r\n corPro = corredores[corredor].provincia;\r\n cappro[1] = 1;\r\n }\r\n\r\n //pregunto si hay segmentos de capital\r\n if ( typeof(corredores[corredor].capital) != \"undefined\"){\r\n cantidad = corredores[corredor].capital.length;\r\n cor = corredores[corredor].capital;\r\n corCap = corredores[corredor].capital;\r\n cappro[0] = 1;\r\n }\r\n\r\n // armo etiquetas\r\n for (var i = 0 ; i < cor.length ; i++){\r\n var alineado = \"cen\";\r\n if (i === 0){alineado = \"izq\";}\r\n $(\"#corredores .etiquetasCapital\").append('<div class=\"nombreCorredor ' + alineado + '\">' + nombresDeCorredores[cor[i]].nombreSegmento.split(\" - \")[0] + '</div>' );\r\n $(\"#corredores .etiquetasProvincia\").append('<div class=\"nombreCorredor ' + alineado + '\">' + nombresDeCorredores[cor[i]].nombreSegmento.split(\" - \")[0] + '</div>' );\r\n }\r\n $(\"#corredores .etiquetasCapital\").append('<div class=\"nombreCorredor der\">' + nombresDeCorredores[cor[cor.length-1]].nombreSegmento.split(\" - \")[1] + '</div>');\r\n $(\"#corredores .etiquetasProvincia\").append('<div class=\"nombreCorredor der\">' + nombresDeCorredores[cor[cor.length-1]].nombreSegmento.split(\" - \")[1] + '</div>');\r\n\r\n if (cappro[1] === 0 ){\r\n $(\"#avisoProvincia\").append('<div id=\"aviso\">El trayecto no tiene dirección hacia Provincia</div>'); \r\n }\r\n if (cappro[0] === 0 ){\r\n $(\"#avisoCapital\").append('<div id=\"aviso\">El trayecto no tiene dirección hacia Capital</div>');\r\n }\r\n\r\n //armo segmentos\r\n for (var i = 0 ; i < cor.length ; i++){\r\n if (cappro[0] === 0 ){\r\n // el segmento no tiene anomalias\r\n $(\"#corredores .corredoresCapital\").append('<div class=\"corredor segmento estado0\"></div>' );\r\n }else{\r\n //demora = ( (nombresDeCorredores[corCap[i]].tiempo * (nombresDeCorredores[corCap[i]].indicador_anomalia * 100))/100+(nombresDeCorredores[corCap[i]].indicador_anomalia * 100) );\r\n $(\"#corredores .corredoresCapital\").append('<div class=\"corredor segmento estado' + nombresDeCorredores[corCap[i]].anomalia + '\"></div>' );\r\n\r\n\r\n\r\n //asigno tiempo de anomalia\r\n if (nombresDeCorredores[corCap[i]].duracion_anomalia != 0){\r\n duracionAnomalia = nombresDeCorredores[corCap[i]].duracion_anomalia + \"'\";\r\n }else{\r\n duracionAnomalia = \"--\";\r\n }\r\n \r\n //asigno tiempo de trayecto\r\n tiempoTrayecto = nombresDeCorredores[corCap[i]].tiempo;\r\n \r\n //asigno demora\r\n if (nombresDeCorredores[corCap[i]].indicador_anomalia != 0){\r\n var porcentaje = (tiempoTrayecto * (nombresDeCorredores[corCap[i]].indicador_anomalia *100 ).toFixed())/100;\r\n demora = (nombresDeCorredores[corCap[i]].indicador_anomalia *100 ).toFixed() + \"% (+ \" +porcentaje.toFixed()+ \"')\";\r\n }else{\r\n demora = \"--\";\r\n }\r\n\r\n //asigno causa\r\n if (nombresDeCorredores[corCap[i]].causa_id == 0){\r\n causa = \"--\";\r\n }else{\r\n jQuery.map(causasAnomalias.causas, function(obj) {\r\n if(obj.id == nombresDeCorredores[corCap[i]].causa_id){\r\n causa = obj.descripcion;\r\n }\r\n });\r\n }\r\n\r\n //armo el panel\r\n $(\"#panelesCapital\").append('<div class=\"panel\" id=\"c' + corCap[i] + '\">'+\r\n '<div class=\"filaPanel\">Duración anomalía<div class=\"datoPanel\">' + duracionAnomalia +'</div></div>'+\r\n '<div class=\"filaPanel\">Tiempo del trayecto<div class=\"datoPanel\">'+ tiempoTrayecto + \"'\" + '</div></div>'+\r\n '<div class=\"filaPanel\">Demora<div class=\"datoPanel\">'+ demora + '</div></div>'+\r\n '<div class=\"filaPanel\">Causa<div class=\"datoPanel\">'+ causa +'</div></div></div>');\r\n }\r\n \r\n if (cappro[1] === 0 ){\r\n // el segmento no tiene anomalias\r\n $(\"#corredores .corredoresProvincia\").append('<div class=\"corredor segmento estado0\"> </div>' );\r\n }else{\r\n //demora = ( (nombresDeCorredores[corPro[i]].tiempo * (nombresDeCorredores[corPro[i]].indicador_anomalia * 100))/100+(nombresDeCorredores[corPro[i]].indicador_anomalia * 100) );\r\n $(\"#corredores .corredoresProvincia\").append('<div class=\"corredor segmento estado' + nombresDeCorredores[corPro[i]].anomalia + ' \"></div>' );\r\n\r\n\r\n //asigno tiempo de anomalia\r\n if (nombresDeCorredores[corPro[i]].duracion_anomalia != 0){\r\n duracionAnomalia = nombresDeCorredores[corPro[i]].duracion_anomalia + \"'\";\r\n }else{\r\n duracionAnomalia = \"--\";\r\n }\r\n \r\n //asigno tiempo de trayecto\r\n tiempoTrayecto = nombresDeCorredores[corPro[i]].tiempo;\r\n \r\n //asigno demora\r\n if (nombresDeCorredores[corPro[i]].indicador_anomalia != 0){\r\n var porcentaje = (tiempoTrayecto * (nombresDeCorredores[corPro[i]].indicador_anomalia *100 ).toFixed())/100;\r\n demora = (nombresDeCorredores[corPro[i]].indicador_anomalia *100 ).toFixed() + \"% (+ \" +porcentaje.toFixed()+ \"')\";\r\n }else{\r\n demora = \"--\";\r\n }\r\n\r\n //asigno causa\r\n if (nombresDeCorredores[corPro[i]].causa_id == 0){\r\n causa = \"--\";\r\n }else{\r\n jQuery.map(causasAnomalias.causas, function(obj) {\r\n if(obj.id == nombresDeCorredores[corPro[i]].causa_id){\r\n causa = obj.descripcion;\r\n }\r\n });\r\n }\r\n \r\n //armo el panel\r\n $(\"#panelesProvincia\").append('<div class=\"panel\" id=\"c'+corPro[i]+'\">'+\r\n '<div class=\"filaPanel\">Duración anomalía<div class=\"datoPanel\">'+ duracionAnomalia +'</div></div>'+\r\n '<div class=\"filaPanel\">Tiempo del trayecto<div class=\"datoPanel\">'+ tiempoTrayecto + \"'\" +'</div></div>'+\r\n '<div class=\"filaPanel\">Demora<div class=\"datoPanel\">'+ demora + '</div></div>'+\r\n '<div class=\"filaPanel\">Causa<div class=\"datoPanel\">'+ causa +'</div></div></div>');\r\n }\r\n }\r\n\r\n // agrega el listener al panel del segmento que se acaba de agregar.\r\n $(\".panel\").click(function() {\r\n var idPanelClickeado = this.id.replace(\"c\",\"\");\r\n llenoPantallaEdicion(idPanelClickeado);\r\n $(\"#seleccioneTrayecto\").css(\"display\",\"none\");\r\n });\r\n}", "title": "" }, { "docid": "79789a4f9d6b919cb157ca80d5e90138", "score": "0.59181166", "text": "function CalcularViaje(tiempo,distancia){\n\n console.log(\"calcularviaje\",tiempo + \"dist \"+distancia);\n var modificador = modificadorDeTarifaSegunLaHora(hora_del_dia);\n\n valor_viaje = (((distancia/1000)* (530 * modificador)) + (tiempo * (120 * modificador))+ 1800*modificador);\n valor_viaje = Math.round(valor_viaje);\n valor_viaje = redondear(valor_viaje);\n\n //si la tarifa del viaje da menos que 3500 entonces se deja en la minima 3500.\n if(valor_viaje <= 3500){\n valor_viaje = 3500;\n }\n //restamos los descuentos que tenga el usuario al valor del viaje, si el descuento es mayor al valor del viaje\n //entonces el valor del viaje queda en $0 y se resta el valor del viaje al descuento para obtener el nuevo saldo del cliente\n //si el desceunto es menor entonces de deja el nuevo saldo del cliente el $0 y el valor a pagar en el valor del viaje menos el descuento\n valor_cobrar = valor_viaje - descuentos_usuario;\n valor_cobrar = valor_cobrar - saldo_pendiente_usuario;\n valor_cobrar = redondear(valor_cobrar);\n if(valor_cobrar < 0){\n valor_cobrar = 0;\n nuevo_descuento_usuario = descuentos_usuario -valor_viaje;\n }\n\n }", "title": "" }, { "docid": "83d079b404ae74a707921fd5b4bf064e", "score": "0.5908693", "text": "reiniciarConteo() {\n // creamos un objeto, con los valores de ultimo y hoy\n this.ultimo = 0;\n this.grabarArchivo();\n // aqui estamos reiniciando el conteo de los ticket emitidos\n this.tickets = [];\n this.ultimosCuatros = [];\n }", "title": "" }, { "docid": "c0fde71b9b25af0ac619ea697d4c9035", "score": "0.59027565", "text": "function resposta(primeira,segundo,terceiro,quarto)\n{\n\tlet subredeImprime = document.getElementById('subrede');\n\tlet subdecImprime = document.getElementById('subdec');\n\tlet masc = document.getElementById('masc');\n\tlet mascSub = document.getElementById('mascSub');\n\tlet rede = document.getElementById('rede1');\n\tlet broad = document.getElementById('broad1');\n\tlet primHost = document.getElementById('primeiro1');\n\tlet ultHost = document.getElementById('ultimo1');\n\tlet qtsHosts = document.getElementById('qtHost');\n\t//Descobrir de que classe é\n\tclasse(primeira);\n\t//alert(\"Deu certo!\");\n\t//Deu certo, agora verificamos as máscaras de rede e de subrede \n\tlet valuem = parseInt(masc.options[masc.selectedIndex].value);\n\tlet valuesub = parseInt(mascSub.options[mascSub.selectedIndex].value);\n\n\t//Aqui veremos se o usuário escolheu as máscaras\n\tif (valuem!=0) \n\t{\t\t\t\t\t\t\n\t\tlet IP = primeira + segundo + terceiro + quarto;\n\t\t// Visivel para quem é de fora\n\t\t//Sem subrede\t\t\t\t\t\t\t\t\n\t\t//Endereço de rede -> Endereço do primeiro host\n\t\t// Calculo do Endereço de rede\n\t\tlet endRede = enderecorede(IP, valuem);\n\t\trede.innerHTML = ponto(endRede) + \" ------------------ \" + bindec(endRede);\n\t\t//Calculo do endereço do primeiro host\n\t\tlet primeiroHost = primeiroEnd(endRede);\n\t\tprimHost.innerHTML = ponto(primeiroHost) + \" ------------------ \" + bindec(primeiroHost);\n\t\t//Endereço de broacast -> Endereço do último host\n\t\t// Calculo do Endereço de broadcast\t\t\t\n\t\tlet endBroad = enderecobroad(IP, valuem);\n\t broad.innerHTML = ponto(endBroad) + \" ------------------ \" + bindec(endBroad);\n\n\t //Calculo do endereço do ultimo host\n\t\tlet ultimoHost = ultimoEnd(endBroad);\n\t\tultHost.innerHTML = ponto(ultimoHost) + \" ------------------ \" + bindec(ultimoHost);\n\n\t\t//Hosts possíveis da rede\n\t\tlet qts = qtsHost(32-valuem);\n\t\tqtsHosts.innerHTML = qts-2 +`</br>` +`</br>`;\n\t\t\n\t\tif (valuesub!=0) \n\t\t{\t\t\n\t\t\t//Com subrede\n\t\t\tif (valuesub >= valuem) \n\t\t\t{\n\t\t\t\t// console.log(typeof valuesub)\n\t\t\t\t// console.log(typeof valuem)\n\t\t\t\t// alert(\"aaaaa\")\n\t\t\t\t\n\t\t\t\tlet imprime = '', imprimedec = '';\n\t\t\t\t\n\t\t\t\t//Endereço de rede -> Endereço do primeiro host\n\t\t\t\t// Calculo do Endereço de rede da primeira subrede\n\t\t\t\tendRede = enderecorede(IP, valuem);\n\t\t\t\tlet endRedeSub = enderecorede(endRede, valuesub).toString();\n\t\t\t\timprime = imprime + \"Endereço subrede \" + ponto(endRedeSub) +`</br>` +`</br>`;\n\t\t\t\timprimedec = imprimedec + \"Endereço subrede \" + bindec(endRedeSub).toString() +`</br>` +`</br>`;\n\t\t\t\t//Calculo do endereço do primeiro host\n\t\t\t\tprimeiroHost = primeiroEnd(endRedeSub).toString();\n\t\t\t imprime = imprime + \"Primeiro endereço de host \" + ponto(primeiroHost) +`</br>` +`</br>`;\n\t\t\t\timprimedec = imprimedec + \"Primeiro endereço de host \" + bindec(primeiroHost).toString() +`</br>` +`</br>`;\n\t\t\t\t//Calculo do broadcast\n\t\t\t\tendBroad = enderecobroad(endRedeSub, valuesub).toString();\n\n\t\t\t\t//Calculo do endereço do ultimo host\n\t\t\t\tultimoHost = ultimoEnd(endBroad).toString();\n\t\t\t\t\n\t\t\t imprime = imprime + \"Último endereço de host \" + ponto(ultimoHost) +`</br>` +`</br>`;\n\t\t \t imprime = imprime + \"Endereço de broacast \" + ponto(endBroad) +`</br>` +`</br>`;\n\t\t\t\t\n\t\t\t\timprimedec = imprimedec + \"Último endereço de host \" + bindec(ultimoHost).toString() +`</br>` +`</br>`;\n\t\t\t\timprimedec = imprimedec + \"Endereço de broacast \" + bindec(endBroad).toString() +`</br>` +`</br>`;\n\t\t \t\t//Quantidade de hosts válidos na subrede\n\t\t\t\tlet qts = parseInt(qtsHost(32-valuesub));\n\t\t\t\tlet qtsTotal = parseInt(qtsHost(32 -valuem));\n\t\t\t\t\n\t\t\t\tlet numSubredes = qtsTotal/qts;\n\t\t\t\tlet q = '';\n\t\t\t\tqts = qts-2;\n\t\t\t\tq = qts.toString();\n\t\t\t\timprime = imprime + \"Quantidade de host disponível na subrede \" + q +`</br>` +`</br>`;\n\t\t\t\timprime = imprime +`</br>` +`</br>`; \n\n\t\t\t\timprimedec = imprimedec + \"Quantidade de host disponível na subrede \" + q +`</br>` +`</br>`;\n\t\t\t\timprimedec = imprimedec +`</br>` +`</br>`; \n\n\t\t\t\tnumSubredes = numSubredes - 1;\n\t\t\t\t\n\t\t\t\tfor (let i = 0; i < numSubredes; i++) \n\t\t\t\t{\t\n\t\t\t\t\tconsole.log(endBroad)\t\t\t\t\t\n\t\t\t\t\tendRedeSub = primeiroEnd(endBroad, valuesub).toString();\n\t\t\t\t\timprime = imprime + \"Endereço subrede\" + ponto(endRedeSub) +`</br>` +`</br>`;\n\t\t\t\t\timprimedec = imprimedec + \"Endereço subrede\" + bindec(endRedeSub).toString() +`</br>` +`</br>`;\n\t\t\t\t\t\n\t\t\t\t\tprimeiroHost = primeiroEnd(endRedeSub).toString();\n\t\t\t\t\timprime = imprime + \"Primeiro endereço de host \" + ponto(primeiroHost) +`</br>` +`</br>`;\n\t\t\t\t\timprimedec = imprimedec + \"Primeiro endereço de host \" + bindec(primeiroHost).toString() +`</br>` +`</br>`;\n\n\t\t\t\t\t//Calculo do broadcast\n\t\t\t\t\tendBroad = enderecobroad(endRedeSub, valuesub).toString();\n\n\t\t\t\t\t//Calculo do endereço do ultimo host\n\t\t\t\t\tultimoHost = ultimoEnd(endBroad).toString();\n\t\t\t\t\n\t\t\t\t\timprime = imprime + \"Último endereço de host \" + ponto(ultimoHost) +`</br>` +`</br>`;\n\t\t \t\t\timprime = imprime + \"Endereço de broacast \" + ponto(endBroad) +`</br>` +`</br>`;\n\n\t\t \t\t\timprimedec = imprimedec + \"Último endereço de host \" + bindec(ultimoHost).toString() +`</br>` +`</br>`;\n\t\t\t\t\timprimedec = imprimedec + \"Endereço de broacast \" + bindec(endBroad).toString() +`</br>` +`</br>`;\n\t\n\t\t\t \t\t// Quantidade de hosts válidos na subrede\n\t\t\t\t\timprime = imprime + \"Quantidade de host disponível na subrede \" + q +`</br>` +`</br>`;\n\t\t\t\t\timprime = imprime +`</br>` +`</br>`; \n\t\t\t\t\timprimedec = imprimedec + \"Quantidade de host disponível na subrede \" + q +`</br>` +`</br>`;\n\t\t\t\t\timprimedec = imprimedec +`</br>` +`</br>`;\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsubredeImprime.innerHTML = imprime;\n\t\t\t\tsubdecImprime.innerHTML = imprimedec;\n\t\t\t\t\t\t\t\t\n\t\t\t}else\n\t\t\t{\n\t\t\t\talert(\"Mais endereço do que você tem\");\n\t\t\t}\n\t\t}\n\t}\t\t\t\n\n}", "title": "" }, { "docid": "854f8b73b0f9e1e350f84b380ab193b3", "score": "0.58579123", "text": "agregarIva(precio){\n this.precio+=precio*0.21;\n\n }", "title": "" }, { "docid": "da4158235e8a790b8b4e3d9df520d7f3", "score": "0.5842319", "text": "function razonDeCompraNueva()\n{\nvar id = document.getElementById(\"idcliente\").value;\nvar razonDeCompraNueva = document.getElementById(\"razonDeCompraNueva\").value;\n\nvar requerimiento = new RequerimientoGet();\nrequerimiento.setURL(\"datosprincipales/ajax/razonDeCompraNueva.php\");\nrequerimiento.addParametro(\"id\",id);\nrequerimiento.addParametro(\"idrazondecompra\",razonDeCompraNueva);\nrequerimiento.addListener(respuestaRazonDeCompraNueva);\nrequerimiento.ejecutar();\n}", "title": "" }, { "docid": "44fa37fea1b17bad057586773d0c6b33", "score": "0.5838283", "text": "function calculadora(){\n\tconsole.log(\"hola soy la calculadora!!\");\n\t// return \"hola soy la calculadora\".. devuelve algo a la funcion\n}", "title": "" }, { "docid": "272b74eab1f58c41ac6b95d84eccca3c", "score": "0.5827213", "text": "function tabla_principal() {\n /***funcion principal ***/\n var pasillos_arr = [];\n //variables globales\n var pasillos = new tabla_logica();\n var clasificado_8020 = new tabla_logica();\n \n\n clasificado_8020.setPasillo = \"80/20\";\n var contador_80_20 = 0;\n var contador_pasillo = 0;\n \n //ordenar Productos\n PRODUCTOS_ANALIZADOS.sort(function (a, b) {\n if (a.pasillo > b.pasillo) {\n return 1;\n }\n if (a.pasillo < b.pasillo) {\n return -1;\n }\n // a must be equal to b\n return 0;\n });\n\n //obtener 8020\n $.each(PRODUCTOS_ANALIZADOS.filter(cla =>cla.clasificacion_8020 === \"8020\"), (index,item) => {\n llenar_8020(item);\n });\n pasillos_arr.push (clasificado_8020);\n//recorrido datos\n $.each(PRODUCTOS_ANALIZADOS, (index, item) => {\n \n if (index === 0) {\n pasillos = new tabla_logica();\n pasillos.setPasillo = item.pasillo;\n }\n if (pasillos.getPasillo === item.pasillo) {\n\n llenar_pasillo(item);\n }\n else if (pasillos.getPasillo !== item.pasillo) {\n \n pasillos_arr.push(pasillos);\n\n pasillos = new tabla_logica();\n contador_pasillo=0;\n pasillos.setPasillo = item.pasillo;\n llenar_pasillo(item);\n }\n });\n pasillos_arr.push(pasillos);\n\n//funciones\n function llenar_8020(item) {\n \n clasificado_8020.setAvance = (item.BODART_N > 0 || item.BODART_O > 0);\n clasificado_8020.setAvance = (item.LEY_PCIO_N > 0 || item.LEY_PCIO_O > 0);\n clasificado_8020.setAvance = (item.LOPEZ_N > 0 || item.LOPEZ_O > 0);\n clasificado_8020.setAvance = (item.MEZQUITILLO_N > 0 || item.MEZQUITILLO_O > 0);\n clasificado_8020.setAvance = (item.SORIANA_N > 0 || item.SORIANA_O > 0);\n clasificado_8020.setAvance = (item.TERESITA_N > 0 || item.TERESITA_O > 0);\n\n contador_80_20++;\n\n clasificado_8020.setCantidad = contador_80_20;\n clasificado_8020.Acumulado();\n clasificado_8020.Diferencia(); \n }\n function llenar_pasillo(item) {\n\n pasillos.setAvance = (item.BODART_N > 0 || item.BODART_O > 0) ;\n pasillos.setAvance = (item.LEY_PCIO_N > 0 || item.LEY_PCIO_O > 0) ;\n pasillos.setAvance = (item.LOPEZ_N > 0 || item.LOPEZ_O > 0) ;\n pasillos.setAvance = (item.MEZQUITILLO_N > 0 || item.MEZQUITILLO_O > 0) ;\n pasillos.setAvance = (item.SORIANA_N > 0 || item.SORIANA_O > 0) ;\n pasillos.setAvance = (item.TERESITA_N > 0 || item.TERESITA_O > 0) ;\n\n contador_pasillo ++;\n\n pasillos.setCantidad = contador_pasillo ;\n pasillos.Acumulado();\n pasillos.Diferencia();\n }\n /*Funciones del DOM*/\n ReactDOM.render(\n <div className=\"tabla_productos\">\n <Pasillo datos={pasillos_arr} n_clase={\"pasillo\"} />\n </div>\n ,$(\"#principal\")[0]\n );\n}", "title": "" }, { "docid": "31fc2d9d4dedb718f836d193346ee74d", "score": "0.582492", "text": "function actualizaReloj(){ \n\t/* CAPTURAMOS LA HORA, LOS MINUTOS Y LOS SEGUNDOS */ \nmarcacion = new Date() \n\t/* CAPTURAMOS LA HORA */ \nHora = marcacion.getHours() \n\t/* CAPTURAMOS LOS MINUTOS */ \nMinutos = marcacion.getMinutes() \n\t/* CAPTURAMOS LOS SEGUNDOS */ \nSegundos = marcacion.getSeconds() \n\t/* SI LA HORA, LOS MINUTOS O LOS SEGUNDOS \nSIN MENORES O IGUAL A 9, LE AÑADIMOS UN 0 */ \nif (Hora<=9) \nHora = \"0\" + Hora \nif (Minutos<=9) \nMinutos = \"0\" + Minutos \nif (Segundos<=9) \nSegundos = \"0\" + Segundos \n\t/* TERMINA EL SCRIPT DEL RELOJ */\n\t/* COMIENZA EL SCRIPT DE LA FECHA */ \nvar Dia = new Array(\"Domingo\", \"Lunes\", \"Martes\", \"Miercoles\", \"Jueves\", \"Viernes\", \"Sábado\", \n\"Domingo\"); \nvar Mes = new \nArray(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\"); \nvar Hoy = new Date(); \nvar Anio = Hoy.getFullYear(); \nvar Fecha = \"Ciudad Autonoma de Buenos Aires, \" + Dia[Hoy.getDay()] + \", \" + Hoy.getDate() + \" de \" + Mes[Hoy.getMonth()] + \" de \" + Anio + \". Hora local: \"; \n\t/* TERMINA EL SCRIPT DE LA FECHA */ \n\t/* CREAMOS 4 VARIABLES PARA DARLE FORMATO A NUESTRO SCRIPT */ \nvar Inicio, Script, Final, Total \n\t/* EN INICIO LE INDICAMOS UN COLOR DE FUENTE Y UN TAMAÑO */ \nInicio = \" \" \n\t/* EN RELOJ LE INDICAMOS LA HORA, LOS MINUTOS Y LOS SEGUNDOS */ \nScript = Fecha + Hora + \":\" + Minutos + \":\" + Segundos \n\t/* EN FINAL CERRAMOS EL TAG DE LA FUENTE */ \nFinal = \" \" \n\t/* EN TOTAL FINALIZAMOS EL RELOJ UNIENDO LAS VARIABLES */ \nTotal = Inicio + Script + Final \n\t/* CAPTURAMOS UNA CELDA PARA MOSTRAR EL RELOJ */ \ndocument.getElementById('Fecha_Reloj').innerHTML = Total \n\t/* INDICAMOS QUE NOS REFRESQUE EL RELOJ CADA 1 SEGUNDO */ \nsetTimeout(\"actualizaReloj()\",1000) \n}", "title": "" }, { "docid": "d93d093c3af62d47b198869acfee33f3", "score": "0.5824717", "text": "function get_mensajesPacientes_SER810B() {\n\tdatos_envio = datosEnvio() + localStorage['Usuario'] + \"|\" + $_REG_PACI[0].COD + \"|\";\n\t//LEER NOTAS SOBRE EL PACIENTE\n\tvar URL = get_url(\"APP/SALUD/SER810B.DLL\");\n\tpostData({\n\t\t\tdatosh: datos_envio\n\t\t}, URL)\n\t\t.then((data) => {\n\t\t\tdata.NTASPACI[0]['FECHA-NOTA'].trim().length > 0 ?\n\t\t\t\t_ventanaDatos({\n\t\t\t\t\ttitulo: `HAY NOTAS DISPONIBLES SOBRE EL PACIENTE: ${$_REG_PACI[0].DESCRIP}`,\n\t\t\t\t\tcolumnas: [\n\t\t\t\t\t\t\"FECHA-NOTA\",\n\t\t\t\t\t\t\"OPER-OBSE-NOTA\",\n\t\t\t\t\t\t\"FACT-NOTA\"\n\t\t\t\t\t],\n\t\t\t\t\tdata: data['NTASPACI'],\n\t\t\t\t\torden: false,\n\t\t\t\t\tcallback_esc: function () {\n\t\t\t\t\t\tdocument.getElementById(campo).focus();\n\t\t\t\t\t},\n\t\t\t\t\tcallback: function (data) {\n\t\t\t\t\t\tlet params = {\n\t\t\t\t\t\t\ttitulo: `<h5><strong>NOTAS DISPONIBLES SOBRE EL PACIENTE: ${$_REG_PACI[0].COD} ${$_REG_PACI[0].DESCRIP.trim()}</strong></h5>`,\n\t\t\t\t\t\t\tdatos: data\n\t\t\t\t\t\t}\n\t\t\t\t\t\tventanaNtasPaciente(params);\n\t\t\t\t\t}\n\t\t\t\t}) : console.log(\"nota\", \"No hay notas joven\");\n\t\t\tLLAMADO_DLL({\n\t\t\t\tdato: [SAL97C11.EPSPACIW],\n\t\t\t\tcallback: _mostrarentidad_7C11,\n\t\t\t\tnombredll: 'SER110C_08',\n\t\t\t\tcarpeta: 'SALUD'\n\t\t\t})\n\t\t})\n\t\t.catch((error) => {\n\t\t\tconsole.log(error)\n\t\t});\n}", "title": "" }, { "docid": "f684d3f48d5c27c952376941369ed57f", "score": "0.5822375", "text": "presupuestoRestante(cantidad) {\n\n const restante = document.getElementById('restante');\n\n // actualizamos el presupuesto\n const presupuestoNuevo = cantidadPresupuesto.presupuestoRestante(cantidad);\n restante.innerHTML = presupuestoNuevo;\n\n this.cambiaColor();\n }", "title": "" }, { "docid": "5174a7119485b6570707dfc25cb82111", "score": "0.58151966", "text": "constructor(cambio, clutch, freno, frenoEmergencia) {\r\n this.cambio = cambio;\r\n this.clutch = clutch;\r\n this.freno = freno;\r\n this.frenoEmergencia = frenoEmergencia;\r\n this.carroArrancado = false;\r\n this.cont_frenos = 0;\r\n this.tiempoRecorrido = 0;\r\n this.velocidadPromedio = 0;\r\n this.nombreDestino = \"\";\r\n this.carroEncendido = false;\r\n this.destinoSeleccionado = false;\r\n this.distanciaRecorrida = 0;\r\n }", "title": "" }, { "docid": "e150db8c4f34e3e102b658cf94d92b31", "score": "0.57942986", "text": "function enviarDatosSCORM(){\n\n evaluacionesContestadas = numIndicesActivos(totalReactivosSCORM);//cuantas evaluaciones han sido calificadas\n console.log(calificacionSCORM);\n console.log(\"Total objetivos activos: \" +evaluacionesContestadas);\n\n // console.log(objetivoInicialScorm+\" buenasT:\"+intContadorBuenas+ \" reactivosT:\"+intTotalReactivos);\n if(conectividadSCORM !== undefined){\n\n //salvamos los datos de todas las evaluaciones\n for(var idObj=1; idObj<= totalEvaluaciones; idObj++){\n conectividadSCORM.calificarObjetivo(idObj, calificacionSCORM[idObj], totalReactivosSCORM[idObj], 0);\n conectividadSCORM.finalizarObjetivo(idObj); //Mismo número que en el paso anterior\n \n //console.log(\"DATOS ALAMCENADOS: \" +intContadorBuenas+ \" \"+intTotalReactivos);\n }//fin for\n\n \n // salvamos los datos\n conectividadSCORM.salvar(); \n console.log(\"Datos objetivos Salvados\");\n // si todas las evaluaciones han sido contestadasterminar el scorm\n // se guarda suma total de reactivos y suma total de calificacion\n if(evaluacionesContestadas >= totalEvaluaciones){\n //conectividadSCORM.terminar();\n if(modoEvaluacion == \"REACTIVOS\"){ //evaluacion por reactivos\n \n var intContadorBuenas = totalDatos(calificacionSCORM); // (total aciertos)\n var intTotalReactivos = totalDatos(totalReactivosSCORM); // total reactivos\n //\n conectividadSCORM.calificar(intContadorBuenas, intTotalReactivos);\n }else{\n //evaluacion por promedio\n //promediar datos totales del scorm (metodo desconocido)\n //se obtienen los promedios parciales de las actividades y luego se promedian entre el total e evaluaciones\n var calificacionfinal = calificacionFinalPromedio();\n //\n conectividadSCORM.calificar(calificacionfinal, calificacionMaxima);\n console.log(\"Datos Calificacion Salvados \"+calificacionfinal + \" de \"+calificacionMaxima);\n }//fin else\n //\n conectividadSCORM.completar();\n conectividadSCORM.salvar();\n console.log(\"Actividad salvada\");\n }//fin if\n }//fin -- conectividad \n }//fin enviarDatosSCORM", "title": "" }, { "docid": "1555973b0ad7ccc57ac85fa39da4f56d", "score": "0.5777005", "text": "function obtenerDatosRecurso(pRecurso, boolean) {\n initProgressBar();\n if (boolean == true) {\n cont = cont + 1;\n olderQuerys.push({\n \"accion\": \"recurso\",\n \"recurso\": pRecurso\n });\n }\n controladorBotonRecursosAnteriores();\n $.ajax({\n url: \"ServGetJson\",\n data: {\n \"accion\": \"recurso\",\n \"recurso\": pRecurso\n },\n type: \"post\",\n success: function(data) {\n deleteProgressBar();\n $(\"#search\").css(\"visibility\", \"visible\");\n $(\"svg\").remove();\n if (data.includes(\"vacio\")) {\n $(\"svg\").remove();\n swal(\"Oops...\", \"No hay datos para ese recurso concreto\",\n \"info\");\n obtenerDatosRecursoPrevio();\n } else {\n crearGrafo(data);\n }\n }\n });\n}", "title": "" }, { "docid": "4a49b43acd52002bc2d183c954084814", "score": "0.5775725", "text": "function cargarFondo()\n{\n fondo.cargaOk = true;\n dibujarR1();\n}", "title": "" }, { "docid": "bc1f684896b4c9971a0b44a6bb0a2740", "score": "0.5769713", "text": "function recomendacion(comando, grafoUsuarios) {\n let grafo = grafoUsuarios\n let tipo = comando[1]\n let n = parseInt(comando[2], 10)\n let similares = comando.slice(3, comando.length)\n for (let i = 0; i < similares.length; i++) {\n similares[i] = \"CANCION\".concat(\" - \", similares[i])\n }\n let arrayVertices = grafo.obtenerVertices()\n let mapPageRank = new Map()\n for (let i = 0; i < arrayVertices.length; i++) {\n mapPageRank.set(arrayVertices[i], 0)\n }\n for (let i = 0; i < similares.length; i++) {\n let vertice = similares[i]\n fu.pageRankPersonalizado(grafo, vertice, mapPageRank, 1000000) // Cuando mas largo mas tiempo tarda pero consigue mejores resultados.\n }\n let arrayRank = Array.from(mapPageRank.entries())\n arrayRank = arrayRank.sort(function compareNumbers(a, b) {\n return b[1] - a[1];\n })\n let recomendaciones = []\n let i = 0\n while (recomendaciones.length < n && arrayRank[i][1] != 0) {\n if (tipo == \"usuarios\" && arrayRank[i][0].slice(0, 7) == \"USUARIO\") {\n recomendaciones.push(arrayRank[i][0].slice(10, (arrayRank[i][0].length)))\n }\n if (tipo == \"canciones\" && arrayRank[i][0].slice(0, 7) == \"CANCION\") {\n recomendaciones.push(arrayRank[i][0].slice(10, (arrayRank[i][0].length)))\n }\n i++\n }\n let salida = recomendaciones[0]\n for (let i = 1; i < recomendaciones.length; i++) {\n salida += \"; \"\n salida += recomendaciones[i]\n }\n return salida\n}", "title": "" }, { "docid": "105899476ed1b07c14db8b814f3fdc56", "score": "0.57580185", "text": "function getPosiciones(){\n\t\t$.ajax({\n\t\t\ttype:\"GET\",\n\t\t\turl:\"http://localhost/Aitor/classes/chris_residuos/Residuos_chris/getAllPos\",\n\t\t\t//url:\"http://localhost/Aitor/classes/Ierai/trackingapp/index.php/getAllPos\",\n\t\t\t//url:\"http://localhost/workspace/Servidor/PHP/trackingapp/getAllPos\",\n\t\t\t//url:\"http://192.168.1.7:80/trackingapp/getAllPos\",\n\t\t\tdataType:\"JSON\",\n\t\t\tdata:\"\",\n\t\t\tsuccess:function(data){\n\t\t\t\tconsole.log(data);\n\t\t\t\tif(data.estado==\"ok\"){\n\t\t\t\t\t$.each(data.mensaje,function(i,item){\n\t\t\t\t\t\tnuevoMarcadorBD(item.Latitude,item.Longitude,item.Bario,i*150);\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t},\n\t\t\tbeforeSend:function(){\n\n\t\t\t},\n\t\t\tcomplete:function(){\n\n\t\t\t},\n\t\t\terror:function(){\n\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "6a40e6b8b70b7147833e7c61136a3de7", "score": "0.5755063", "text": "diagnostica(paciente) {}", "title": "" }, { "docid": "4764f2e2bfcc95620b29242844f0f11e", "score": "0.5753598", "text": "presupuestoRestante(cantidad){\n const restante = document.querySelector('#restante');\n //leemos el presupuesto restante\n const presupuestoRestanteUsuario = cantidadPresupuesto.presupuestoRestante(cantidad);\n //imprime en pantalla el restante\n restante.innerHTML = presupuestoRestanteUsuario;\n this.comprobarPresupuestoColor();\n }", "title": "" }, { "docid": "edaa38f2cc1ab5f54675540c63154964", "score": "0.57528365", "text": "function controladoraParagrafo(movimento) {\n var paragrafo = document.getElementById('paragrafo');\n viewParagrafo(paragrafo,movimento);\n}", "title": "" }, { "docid": "e552ffebeb96c5c7c62fe1b41e5e6026", "score": "0.57472265", "text": "function escondeMoneda() {\r\n //funsion random:\r\n vGblPosicionMoneda = Math.floor(Math.random() * 9 + 1);\r\n vGblIntentosUsados = 0;\r\n vGblJuegoTerminado = 0;\r\n}", "title": "" }, { "docid": "230b5f56c00cf309852bfb94e65f4eca", "score": "0.5747122", "text": "function iniciarSesion() {\n\n}", "title": "" }, { "docid": "8d919938864f1449fe593b6c4c57d402", "score": "0.57448816", "text": "function procesarExpresion(expresion,tsglobal,tslocal,metodos) {\r\n if (expresion.tipo==TIPO_OPERACION.SUMA) { \r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor+valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n if (valorder.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor+1\r\n };\r\n }else if (valorder.valor==false){\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor+valorder.valor.charCodeAt(0)\r\n };\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)+valorder.valor\r\n };\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n if (valorder.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+1\r\n };\r\n }else if (valorder.valor==false){\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor+Number(valorder.valor.charCodeAt(0))\r\n };\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)+valorder.valor\r\n };\r\n }\r\n break;\r\n case TIPO_DATO.BANDERA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n if (valorizq.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:1+valorder.valor\r\n };\r\n }else if (valorizq.valor==false){\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorder.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n if (valorizq.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:1+valorder.valor\r\n };\r\n }else if (valorizq.valor==false){\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorder.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.BANDERA:\r\n console.log('Booleano no puede sumarse con '+TIPO_DATO.BANDERA);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n console.log('Booleano no puede sumarse con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)+valorder.valor\r\n };\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.charCodeAt(0)+valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor.charCodeAt(0)+valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se puede sumar '+valorizq.tipo+' con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor+valorder.valor)\r\n };\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor+valorder.valor)\r\n };\r\n }\r\n break;\r\n case TIPO_DATO.CADENA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor+String(valorder.valor)\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor+String(valorder.valor)\r\n };\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor+String(valorder.valor)\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor+String(valorder.valor)\r\n };\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor+String(valorder.valor)\r\n };\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden sumar los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n }else if (expresion.tipo==TIPO_OPERACION.RESTA) { //resta\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor-valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n if (valorder.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor-1\r\n };\r\n }else if (valorder.valor==false){\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor-valorder.valor.charCodeAt(0)\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden restar los Entero con '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n if (valorder.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-1\r\n };\r\n }else if (valorder.valor==false){\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor-Number(valorder.valor.charCodeAt(0))\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden restar los Decimal con '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.BANDERA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n if (valorizq.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:1-valorder.valor\r\n };\r\n }else if (valorizq.valor==false){\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:0-valorder.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n if (valorizq.valor==true) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:1-valorder.valor\r\n };\r\n }else if (valorizq.valor==false){\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:0-valorder.valor\r\n };\r\n }else{\r\n console.log('solo se puede operar con true=1 y false=0')\r\n }\r\n break;\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden restar los Bandera con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n console.log('no se pueden restar los Booleano con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden restar los cadena con '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.charCodeAt(0)-valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor.charCodeAt(0)-valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se puede restar '+valorizq.tipo+' con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n console.log('no se pueden restar los Caracter con '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden restar los Caracter con '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden restar los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n \r\n }else if (expresion.tipo==TIPO_OPERACION.MULTIPLICACION) { //multiplicacion\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n //tipos de resultados y su retorno\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor*valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor*valorder.valor.charCodeAt(0)\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*Number(valorder.valor.charCodeAt(0))\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.charCodeAt(0)*valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor.charCodeAt(0)*valorder.valor\r\n };\r\n default:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden multiplicar los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.DIVISION) { //division\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorder.valor!=0) {\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor/valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor/valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor/valorder.valor.charCodeAt(0)\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor/valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor/valorder.valor\r\n };\r\n case TIPO_DATO.BANDERA:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor/Number(valorder.valor.charCodeAt(0))\r\n };\r\n case TIPO_DATO.CADENA:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.charCodeAt(0)/valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor.charCodeAt(0)/valorder.valor\r\n };\r\n default:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo);\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden dividir los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n } \r\n }else{\r\n console.log('no se puede dividir dentro de 0');\r\n }\r\n \r\n //parte para las condicionantes \r\n }else if (expresion.tipo==TIPO_OPERACION.MODULAR) { //MODULAR\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorder.valor!=0) {\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor%valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor%valorder.valor\r\n };\r\n default:\r\n console.log('no se pueden hacer mod en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor%valorder.valor\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor%valorder.valor\r\n };\r\n default:\r\n console.log('no se pueden hacer mod en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden hacer mod en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n } \r\n }else{\r\n console.log('no se puede dividir dentro de 0');\r\n }\r\n //parte para las condicionantes \r\n }else if (expresion.tipo==TIPO_OPERACION.POTENCIA) { //POTENCIA\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorizq.valor==0 && valorder.valor==0) {\r\n console.log('no se puede hace pow(0,0)');\r\n }else{\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Math.pow(valorizq.valor,valorder.valor)\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Math.pow(valorizq.valor,valorder.valor)\r\n };\r\n default:\r\n console.log('no se pueden hacer mod en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Math.pow(valorizq.valor,valorder.valor)\r\n };\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Math.pow(valorizq.valor,valorder.valor)\r\n };\r\n default:\r\n console.log('no se pueden hacer potencia en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n break;\r\n }\r\n break;\r\n default:\r\n console.log('no se pueden hacer hacer potencia en los tipos '+valorizq.tipo+' + '+valorder.tipo)\r\n break;\r\n }\r\n }\r\n //parte para las condicionantes \r\n }else if (expresion.tipo==TIPO_OPERACION.MAYOR) { //mayor OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' > '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor>valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' > '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))>valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))>valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))>Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' > '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.MENOR) { //menor OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' < '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor<valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' < '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))<valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))<valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))<Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' < '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.MENORIGUAL) { //menorigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' <= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor<=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor<=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' <= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))<=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))<=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))<=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' <= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.MAYORIGUAL) { //mayorigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' >= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor>=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor>=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' >='+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))>=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))>=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))>=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' >= '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.IGUALIGUAL) { //igualigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' == '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor==valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor==Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' =='+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))==valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))==valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))==Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' == '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.NOIGUAL) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=valorder.valor\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=Number(valorder.valor.charCodeAt(0))\r\n }\r\n \r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' != '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: valorizq.valor!=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor!=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' !='+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor: Number(valorizq.valor.charCodeAt(0))!=valorder.valor\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))!=valorder.valor\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:Number(valorizq.valor.charCodeAt(0))!=Number(valorder.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('Error Semantico: Imposible realizar '+valorizq.tipo+' != '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.ORR) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor||valorder.valor\r\n }\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' || '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' || '+valorder.tipo);\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.ANDD) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:valorizq.valor&&valorder.valor\r\n }\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' && '+valorder.tipo);\r\n return undefined;\r\n }\r\n break;\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' && '+valorder.tipo);\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.CASTEO) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n var tipoC = expresion.operanIzq;\r\n switch (valorder.tipo) {\r\n case TIPO_DATO.ENTERO:\r\n switch (tipoC) {\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.CARACTER,\r\n valor:String.fromCharCode(valorder.valor)\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Number(valorder.valor)\r\n }\r\n default:\r\n console.log('no se puede hacer casteo de'+valorder.tipo+' a '+tipoC);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.DECIMAL:\r\n switch (tipoC) {\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.CARACTER,\r\n valor:String.fromCharCode(valorder.valor)\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Math.trunc(valorder.valor)\r\n }\r\n default:\r\n console.log('no se puede hacer casteo de'+valorder.tipo+' a '+tipoC);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CARACTER:\r\n switch (tipoC) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Number(valorizq.valor.charCodeAt(0))\r\n }\r\n default:\r\n console.log('no se puede hacer casteo de'+valorder.tipo+' a '+tipoC);\r\n break;\r\n }\r\n break;\r\n case TIPO_DATO.CADENA:\r\n switch (tipoC) {\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Number(valorder.valor)\r\n }\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:Number(valorder.valor)\r\n }\r\n default:\r\n console.log('no se puede hacer casteo de'+valorder.tipo+' a '+tipoC);\r\n break;\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.NOTT) { //noigual OTRA FORMA DE HACER LOS CASTEOS\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal,metodos);\r\n \r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:!valorizq.valor\r\n }\r\n default:\r\n console.log('imposible operar '+valorizq.tipo+' !');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.NEGATIVO) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorizq.tipo==TIPO_DATO.DECIMAL) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:valorizq.valor*-1\r\n };\r\n\r\n }else if (valorizq.tipo==TIPO_DATO.ENTERO) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor*-1\r\n };\r\n\r\n }else{\r\n //error semantico \r\n console.log('Error Semantico para devolver negativo');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TOLOWERR) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorizq.tipo==TIPO_DATO.CADENA) {\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor.toLowerCase()\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo cadena\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TOUPPERR) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n if (valorizq.tipo==TIPO_DATO.CADENA) {\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:valorizq.valor.toUpperCase()\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo cadena\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.LENGTHH) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n if (valorizq.tipo==TIPO_DATO.CADENA) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:valorizq.valor.length\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo valido\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TRUNCATEE) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n if (valorizq.tipo==TIPO_DATO.DECIMAL) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Math.trunc(valorizq.valor)\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo ENTERO valido\"+'\\n';\r\n console.log('inVALIDO');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.ROUNDD) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n if (valorizq.tipo==TIPO_DATO.DECIMAL) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:Math.round(valorizq.valor)\r\n }\r\n }else{\r\n //error semantico \r\n salida+=valor.valor+\" no es de tipo valido\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TIPODE) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"double\"\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"int\"\r\n }\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"boolean\"\r\n }\r\n case TIPO_DATO.CADENA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"string\"\r\n }\r\n case TIPO_DATO.CARACTER:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:\"char\"\r\n }\r\n default:\r\n salida+=valor.valor+\" no es de tipo valido\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TOTEXTO) { //negativo\r\n var valorizq = procesarExpresion(expresion.operanIzq,tsglobal,tslocal,metodos);\r\n //var valorder = procesarExpresion(expresion.operanDer,tsglobal,tslocal);\r\n\r\n //tipos de resultados y su retorno \r\n\r\n //falta si es tipo vector o lista\r\n switch (valorizq.tipo) {\r\n case TIPO_DATO.DECIMAL:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)\r\n }\r\n case TIPO_DATO.ENTERO:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)\r\n }\r\n case TIPO_DATO.BANDERA:\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:String(valorizq.valor)\r\n }\r\n default:\r\n salida+=valor.valor+\" no es de tipo valido\"+'\\n';\r\n console.log('el tipo no es cadena');\r\n return undefined;\r\n }\r\n\r\n }else if (expresion.tipo==TIPO_OPERACION.TERNARIO) { //negativo\r\n var condicion=procesarExpresion(expresion.condicion,tsglobal,tslocal,metodos);\r\n if (condicion==true) {\r\n var resultado= procesarExpresion(expresion.valorVerdadero,tsglobal,tslocal,metodos);\r\n return resultado;\r\n }else if (condicion==false) {\r\n var resultado= procesarExpresion(expresion.valorVerdadero,tsglobal,tslocal,metodos);\r\n return resultado;\r\n }\r\n }else if (expresion.tipo==TIPO_VALOR.DECIMAL) {\r\n return{\r\n tipo:TIPO_DATO.DECIMAL,\r\n valor:expresion.valor\r\n };\r\n }else if (expresion.tipo==TIPO_VALOR.CADENA) {\r\n return{\r\n tipo:TIPO_DATO.CADENA,\r\n valor:expresion.valor\r\n };\r\n \r\n }else if (expresion.tipo==TIPO_VALOR.BANDERA) {\r\n return{\r\n tipo:TIPO_DATO.BANDERA,\r\n valor:expresion.valor\r\n };\r\n \r\n }else if (expresion.tipo==TIPO_VALOR.IDENTIFICADOR) {\r\n //buscar el valor de la tabla de simbolos el valor de la variable en la ts local\r\n if (tslocal != undefined) {\r\n var valorId = tslocal.obtener(expresion.valor); //si la tslocal no esta indefinida busca el valor en esta\r\n if(valorId){\r\n return{\r\n tipo:valorId.tipo,\r\n valor:valorId.valor\r\n };\r\n }else{\r\n valorId=tsglobal.obtener(expresion.valor); //si no encuentra la variable en la local entonces buscara en la global\r\n if(valorId){\r\n return{\r\n tipo:valorId.tipo,\r\n valor:valorId.valor\r\n };\r\n }else{\r\n return undefined;\r\n }\r\n }\r\n }else{\r\n var valorId=tsglobal.obtener(expresion.valor); //si no existe la tslocal entonces de una vez pasa a buscar en la global\r\n if(valorId){\r\n return{\r\n tipo:valorId.tipo,\r\n valor:valorId.valor\r\n };\r\n }else{\r\n return undefined;\r\n }\r\n }\r\n }else if (expresion.tipo==TIPO_VALOR.ENTERO) {\r\n return{\r\n tipo:TIPO_DATO.ENTERO,\r\n valor:expresion.valor\r\n };\r\n }else if (expresion.tipo==TIPO_VALOR.CARACTER) {\r\n return{\r\n tipo:TIPO_DATO.CARACTER,\r\n valor:expresion.valor\r\n };\r\n }\r\n}", "title": "" }, { "docid": "d2ca493c3d30bd98cfd8d5df44dca297", "score": "0.5742259", "text": "async function rayonLocalisation(){\n \n const ville = recupVille(); // fonction qui recupere le nom de ville demandé par l'utilisateur. \n const naf = recupCodeNaf(); // fonction recupere le secteur d'activité demandé dans le menu déroulant \n const rayon = recupRayon(); // fonction recupere le rayon de recherche demandé par utilisateur\n\n // utilisation de l'API adresse.data.gouv pour avoir accès aux coordonnées GPS de la ville demandée\n let loc = await fetch('https://api-adresse.data.gouv.fr/search/?q='+ville).then( resultat => resultat.json()).then(json => json.features[0].geometry.coordinates)\n \n async function radiusEntreprise(){\n // trouve les entreprises dans un rayon de recherche\n // lat/long parametre: radius 5km de base \n // affiche la deuxieme page \n // 10 resultats par pages par default (per_page = ) pour modifier\n const radius = await fetch('https://entreprise.data.gouv.fr/api/sirene/v1/near_point/?lat='+loc[1]+'&long='+loc[0]+'&activite_principale='+naf+'&radius='+rayon+'&per_page=100&page='+pageRayon).then(resultat => resultat.json()).then(json => json)\n console.log('affiche les entreprises de la ville demandée dans un rayon de '+rayon+' km ')\n console.log(radius);\n debutActivite(radius.etablissements);\n addElement(radius.etablissements);\n }\n radiusEntreprise();\n \n \n}", "title": "" }, { "docid": "14736483da2d3d7406551da12cdbda8c", "score": "0.5738168", "text": "getPercorsoImmagineRappresentativa () {\n return this.percorsoImmagine\n }", "title": "" }, { "docid": "6b781fe041595c4dd8d03e24bef1d1d8", "score": "0.57363594", "text": "function CargarDetallesSorteo(sorteo_id){\n\t\tvar route = \"http://yavu.local/cargardetallessorteo/\"+sorteo_id;\n\t\t$.ajax({\n\t\t\turl: route,\n\t\t\ttype: 'GET',\n\t\t\tdataType: 'json',\n\t\t\tsuccess:function(data){\n\t\t\t\tif(data.length > 3){\n\t\t\t\t\t$(\"#ModalGanadorSorteo\").modal('show');\n\t\t\t\t\tvar tiempo = 100000;\n\t\t\t\t\tvar t = 0;\n\t\t\t\t\tvar GanadorFinal = [];\n\t\t\t\t\tdo {\n\t\t\t\t\t\tvar rand = data[aleatorio(0, data.length)];\n\t\t\t\t\t\tconsole.log('Random -> '+rand);\n\t\t\t\t\t\tconsole.log(GanadorFinal.indexOf(rand));\n\t\t\t\t\t\tif(GanadorFinal.indexOf(rand) < 0 && rand !== null){\n\t\t\t\t\t\t\tGanadorFinal.push(rand);\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (GanadorFinal.length < 3);\n\t\t\t\t\tRegistrarParticipanteGanador(JSON.stringify(GanadorFinal));\n\t\t\t\t\tvar EjecucionSorteo = setInterval(function(){\n\t\t\t\t\t\tt = tiempo.toString();\n\t\t\t\t\t\tt = t.substring(0,1);\n\t\t\t\t\t\t$(\"#Tiempo\").text(\"¡Empezó el sorteo! (Finaliza en : \t\"+t+\")\");\n\t\t\t\t\t\ttiempo -= 50;\n\t\t\t\t\t\tif(tiempo === 10000){\n\t\t\t\t\t\t\tclearInterval(EjecucionSorteo);\n\t\t\t\t\t\t\t$(\"#Tiempo\").text(\"¡¡¡ TIEMPO !!!\");\n\t\t\t\t\t\t\tEjecutandose = true;\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}, 5);\n\t\t\t\t}else{\n\t\t\t\t\talert(\"Estimado cliente:\\n\\n Para poder realizar el sorteo, usted debe tener almenos 3 usuarios, actualmente tiene \"+data.length);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\treturn true;\n\t}", "title": "" }, { "docid": "58ea3a3b7ba2429c18e18a2f9ce7e934", "score": "0.5735763", "text": "mostrarEstablecimientos() {\n this.api.obtenerDatos()\n .then(datos => {\n const resultado = datos.respuestaJSON.results;\n // Muestra los pines en el Mapa\n this.mostrarPines(resultado);\n } )\n }", "title": "" }, { "docid": "a2fe7f23bbe83e721d4a673aab4cc86c", "score": "0.57320476", "text": "corrigeVtBranco(){\n let vtBrancoRemovido = objFuncoes.removeVtBranco();;\n\n let titulo = document.querySelector('div.d-1-2 span');\n if(titulo.textContent == 'VEREADOR'){\n for(let i = 0;i<etapas[0].numeros;i++){\n let div1 = document.createElement('div');\n div1.classList.add('numero');\n vtBrancoRemovido.appendChild(div1);\n let espacamento = document.querySelectorAll('div.numero')[i];\n espacamento.style.marginLeft = '5px'\n div1.style.marginRight = '2px'\n }\n\n }\n if(titulo.textContent == 'PREFEITO'){\n for(let i = 0;i<etapas[1].numeros;i++){\n let div1 = document.createElement('div');\n div1.classList.add('numero');\n vtBrancoRemovido.appendChild(div1);\n let espacamento = document.querySelectorAll('div.numero')[i];\n espacamento.style.marginLeft = '5px'\n div1.style.marginRight = '2px'\n }\n }\n }", "title": "" }, { "docid": "2f2d4473c06f97326a0accc1fb623d92", "score": "0.57235456", "text": "function crearOrdenador(){\n\t/* campos de recogida */\n\tIdentificador++;\n\tlet referenciaOrdenador = document.getElementById('referenciaOrdenador').value;\n\tlet marcaOrdenador = document.getElementById('marcaOrdenador').value;\n\tlet pesoOrdenador = document.getElementById('pesoOrdenador').valueAsNumber;\n\tpesoTotal += pesoOrdenador;\n\tvar precioOrdenador = document.getElementById('precioOrdenador').valueAsNumber;\n precio+=precioOrdenador;\n precioIva+=((precioOrdenador*21)/100)+precioOrdenador;\n\tlet procesadorOrdenador = document.getElementById('procesadorOrdenador').value;\n\tlet capacidadOrdenador = document.getElementById('capacidadOrdenador').value;\n\tlet ramOrdenador = document.getElementById('ramOrdenador').value;\n\tlet graficaOrdenador = document.getElementById('graficaOrdenador').value;\n\tlet soOrdenador = document.getElementById('soOrdenador').value;\n\tlet tipoOrdenador = document.getElementById('tipoOrdenador');\n\tif(referenciaOrdenador != \"\" && marcaOrdenador != \"\" && pesoOrdenador != \"\" && precioOrdenador != \"\" && procesadorOrdenador != \"\" && capacidadOrdenador != \"\" && ramOrdenador != \"\" && graficaOrdenador != \"\" && soOrdenador != \"\"){\n\t\t\tif (tipoOrdenador.value == 'sobremesa') {\n\t\t\tlet blueDvd = document.getElementById('blueDvd').value;\n\t\t\tif (blueDvd != \"0\") {\n\t\t\t\tlet nuevoSobremesa = new Sobremesa(Identificador,referenciaOrdenador,marcaOrdenador,pesoOrdenador,precioOrdenador,procesadorOrdenador,capacidadOrdenador,ramOrdenador,graficaOrdenador,soOrdenador,blueDvd);\n\n\t\t\t\tcarrito.push(nuevoSobremesa);\n\t\t\t\tverificarEnvio();\n\t\t\t\talert(\"El ordenador de sobremesa ha sido agregado al carrito\");\n\t\t\t\tblueDvd = document.getElementById('blueDvd').value = \"0\";\n\t\t\t\tresetOrdenador();\n\t\t\t}else{\n\t\t\t\talert(\"Hay campos vacios!\");\n\t\t\t}\n\t\t\t\n\t\t\t}else if(tipoOrdenador.value == 'portatil'){\n\t\t\tlet tamanoPantallaPor = document.getElementById('tamanoPantallaPor').value;\n\t\t\tif (tamanoPantallaPor != \"\") {\n\t\t\t\tverificarEnvio();\n\n\t\t\t\tlet nuevoPortatil = new Portatil(Identificador,referenciaOrdenador,marcaOrdenador,pesoOrdenador,precioOrdenador,procesadorOrdenador,capacidadOrdenador,ramOrdenador,graficaOrdenador,soOrdenador,tamanoPantallaPor);\n\t\t\t\tcarrito.push(nuevoPortatil);\n\t\t\t\tverificarEnvio();\t\n\t\t\t\talert(\"El portatil ha sido agregado al carrito.\");\n\t\t\t\ttamanoPantallaPor = document.getElementById('tamanoPantallaPor').value = \"\";\n\t\t\t\t//resetOrdenador();\n\t\t\t}else{\n\t\t\t\talert(\"Hay campos vacios!\");\n\t\t\t}\n\t\t}\n\n\t}else{\n\t\talert('Hay campos vacios!');\n\t}\n}", "title": "" }, { "docid": "0d437d85efd2357b84e99e950ce7806f", "score": "0.5722703", "text": "creerPartie(){\n let plateaux = jeu.creerAllPateau();\n jeu.afficherAllTableau(plateaux[0], plateaux[1])\n\n }", "title": "" }, { "docid": "448627210e82be57e2494c11f46da4e0", "score": "0.5722265", "text": "static PermiNegaOneMes(){\r\n return db.execute(\"select * from VistaPermisosNegados30Total;\");\r\n}", "title": "" }, { "docid": "4c8059baa537a1427207dbd141072562", "score": "0.5720253", "text": "function recusarAtividade() {}", "title": "" }, { "docid": "fc6e7ae916b00a75a49f72473324e6af", "score": "0.5717829", "text": "createResumenDeVentas() {\n let efectivo = document.getElementById(\"lblEfectivo\").value;\n\n let cambio =\n efectivo - this.ordenSelected.total - this.propina - this.domicilio;\n\n let fechaResumen = this.convertDate();\n let productosOrden = this.ordenSelected.detalleOrden;\n let totalOrden = parseFloat(this.ordenSelected.total.toFixed(2));\n let obj = [];\n for (let i = 0; i < productosOrden.length; i++) {\n let array = {\n nombre: productosOrden[i].nombre,\n cantidad: productosOrden[i].cantidad,\n };\n obj.unshift(array);\n }\n this.nuevoResumen.fecha = fechaResumen;\n this.nuevoResumen.total = totalOrden;\n this.nuevoResumen.productos = obj;\n this.nuevoResumen.propina = parseFloat(this.propina);\n if (this.domicilio > 0) {\n this.nuevoResumen.costoEnvio = parseFloat(this.domicilio);\n }\n console.log(this.nuevoResumen.propina);\n var cadena =\n \"./ordenes.html?alert=Orden%20cobrada:%20\" +\n this.ordenSelected.id.substr(-4) +\n \",%20con%20un%20total%20de:%20$\" +\n (totalOrden + this.propina + this.domicilio) +\n \",%20efectivo%20de:%20$\" +\n efectivo +\n \"%20y%20cambio%20de:%20$\" +\n cambio.toFixed(2);\n axios\n .post(this.uriVentas, JSON.stringify(this.nuevoResumen), {\n headers: {\n \"content-type\": \"application/json\",\n },\n })\n .then((response) => {\n window.location = cadena;\n })\n .catch((ex) => {\n console.log(ex);\n });\n\n }", "title": "" }, { "docid": "b8c04e9b93a660a019ca07e9acbc9394", "score": "0.5696479", "text": "function leerdatoscurso(curso){\n const precio = curso.dataset.precio\n const infocurso = {\n imagen: curso.querySelector('img').src,\n titulo: curso.querySelector('h4').textContent,\n precio: parseFloat(precio),\n cantidad: 1,\n subtotal: parseFloat(precio),\n id: curso.querySelector('a').getAttribute('data-id')\n }\n \n agregarcarrito(infocurso)\n}", "title": "" }, { "docid": "feab3ce66fc9ef6c9ab3641336041950", "score": "0.5689141", "text": "function criaRetangulo (lado1, lado2){\n let objetos = {\n largura:lado1,\n altura: lado2,\n perimetro: perim(lado1,lado2),\n area: ar(lado1, lado2)\n }\n return objetos\n}", "title": "" }, { "docid": "ca95544c08052917ffaee97d3b271f21", "score": "0.5682723", "text": "function calculoruta(map, ruta, latorigen, lonorigen, latdestino, londestino, indicacionestore) {\r\n\r\n\t\t\tvar formats;\r\n\t var indicaciones = []; //string para guardar las indicaciones \r\n\r\n\t if (ruta) { //vaciamos la capa por si ya se ha mostrado alguna ruta\r\n\r\n\t ruta.removeFeatures(ruta.features);\r\n\t }\r\n\t //http://router.project-osrm.org/route/v1/driving/-0.40,39.45;-0.36,39.49?geometries=polyline&steps=true\t\t\t\t\t \r\n\r\n\t $(function() //Primero realizamos una peticion ajax al servicio \r\n\t {\r\n\r\n\t //$.getJSON( \"http://192.168.1.138:5000/route/v1/driving/\" + lonorigen + \",\" + latorigen + \";\" + londestino + \",\" + latdestino + \"?geometries=geojson&steps=true\")\r\n\t $.getJSON(\"https://router.project-osrm.org/route/v1/driving/\" + lonorigen + \",\" + latorigen + \";\" + londestino + \",\" + latdestino + \"?geometries=geojson&steps=true\")\r\n\t .done(function(data, textStatus, jqXHR) {\r\n\r\n\t //Construimos un wkt linestring a partir de parte de los resultados\r\n\t var wkt = 'LINESTRING (';\r\n\t var aux;\r\n\t var data2 = ''; //variable para guardar los datos de indicaciones a mostrar\r\n\t var valores = data.routes[0].legs[0].steps;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar distancia = 'Distancia total: ' + ((data.routes[0].distance)/1000).toFixed(2) + ' kilometros'; //Obtenemos la distancia\r\n\t\t\t\t\t\t\t\tExt.getCmp('distancia').setText(distancia);\r\n\t\t\t\t\t\t\t\t\r\n\r\n\t for (i = 0; i < valores.length; i++) {\r\n\r\n\r\n\t //Creamos un wkt con las geometrias de la ruta \r\n\t aux = valores[i];\r\n\t var res = aux.geometry.coordinates.toString().split(\",\");;\r\n\t //alert(res);\r\n\r\n\t var aux2 = ' ';\r\n\r\n\t for (j = 0; j < res.length; j = j + 2) {\r\n\t if (j != (res.length - 2)) {\r\n\t aux2 = aux2 + res[j] + ' ' + res[j + 1] + ',';\r\n\t } else {\r\n\t aux2 = aux2 + res[j] + ' ' + res[j + 1] + ' ';\r\n\t }\r\n\t }\r\n\r\n\t //alert(aux2);\r\n\t wkt = wkt + aux2;\r\n\r\n\r\n\t if (i != (valores.length - 1)) {\r\n\r\n\t wkt = wkt + ',';\r\n\r\n\t }\r\n\r\n\r\n\r\n\t //Ahora obtenermos las indicaciones\r\n\t if (i == 0 || i == (valores.length - 1) || (aux.maneuver.type == 'new name')) {\r\n\r\n\t var aux3 = aux.maneuver.type + ' ' + aux.name;\r\n\t aux3 = traducir(aux3);\r\n\t var imagen; //variable para almacenar el icono de la direccion\r\n\t indicaciones.push(aux3); //traducimos los textos\r\n\r\n\t } else if ((aux.maneuver.type == 'roundabout') || (aux.maneuver.type == 'rotary') || (aux.maneuver.type == 'roundabout turn')) {\r\n\r\n\t var aux3 = aux.maneuver.type + ' coge la ' + aux.maneuver.exit + ' salida ' + aux.maneuver.modifier + ' ' + aux.name;\r\n\t aux3 = traducir(aux3);\r\n\t indicaciones.push(aux3);\r\n\r\n\t } else {\r\n\r\n\t var aux3 = aux.maneuver.type + ' ' + aux.maneuver.modifier + ' ' + aux.name;\r\n\t aux3 = traducir(aux3);\r\n\t indicaciones.push(aux3);\r\n\r\n\t }\r\n\r\n\t //creamos el icono dependiendo de la direccion\r\n\t if (aux3.includes(\"recto\") == true) {\r\n\r\n\t imagen = 'recto';\r\n\r\n\t } else if (aux3.includes(\"izquierda\") == true) {\r\n\r\n\t imagen = 'izquierda';\r\n\r\n\t } else if (aux3.includes(\"derecha\") == true) {\r\n\r\n\t imagen = 'derecha';\r\n\r\n\t } else if (aux3.includes(\"sentido\") == true) {\r\n\r\n\t imagen = 'vuelta';\r\n\r\n\t } else if (aux3.includes(\"Salida\") == true) {\r\n\r\n\t imagen = 'start_mini';\r\n\r\n\t } else if (aux3.includes(\"llegado\") == true) {\r\n\r\n\t imagen = 'stop_mini';\r\n\r\n\t } else {\r\n\r\n\t imagen = 'recto';\r\n\r\n\t }\r\n\r\n\t //Construimos el store de indicaciones\r\n\t if (i == 0) {\r\n\r\n\t data2 = '[[\"' + imagen + '\",\"' + aux3 + '\",\"' + ((aux.distance) / 1000).toFixed(2) + ' km\"]';\r\n\r\n\t } else {\r\n\t data2 = data2 + ',[\"' + imagen + '\",\"' + aux3 + '\",\"' + ((aux.distance) / 1000).toFixed(2) + ' km\"]';\r\n\r\n\t }\r\n\r\n\t }\r\n\r\n\t // this is the line that swaps out the elements\r\n\t data2 = data2 + ']';\r\n\t data2 = eval(data2);\r\n\t indicacionestore.loadData(data2, false); //cargamos los datos sobre el store original de indicaciones\r\n\r\n\r\n\t wkt = wkt + ')';\r\n\t //alert (indicaciones);\r\n\r\n\t //Ahora leemos el wkt en una variable wkt de openlayers, transformamos al sistema de referencia del mapa y añadimos los registros a la capa ruta del mapa\r\n\t var readwkt = new OpenLayers.Format.WKT();\r\n\t var features = readwkt.read(wkt);\r\n\t features.geometry.transform(new OpenLayers.Projection(\"EPSG:4326\"), map.getProjectionObject());\r\n\t var bounds;\r\n\t if (features) {\r\n\t if (features.constructor != Array) {\r\n\t features = [features];\r\n\t }\r\n\t for (var i = 0; i < features.length; ++i) {\r\n\t if (!bounds) {\r\n\t bounds = features[i].geometry.getBounds();\r\n\t } else {\r\n\t bounds.extend(features[i].geometry.getBounds());\r\n\t }\r\n\r\n\t }\r\n\r\n\t ruta.addFeatures(features);\r\n\t map.addLayer(ruta);\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\r\n\t map.zoomToExtent(bounds);\r\n\t } else {}\r\n\r\n\t Ext.getCmp('indicaciones').toggleCollapse(true); //mostramos el panel de indicaciones al usuario\r\n\r\n\t })\r\n\r\n\t .fail(function(jqXHR, textStatus, errorThrown) {\r\n\t if (console && console.log) {\r\n\t console.log(\"Something failed: \" + textStatus);\r\n\t }\r\n\t });\r\n\r\n\t });\r\n\t }", "title": "" }, { "docid": "f6abc11f3b1d74fbec119371e984fd71", "score": "0.56825787", "text": "function muestratotalvuelta() {\n var arrayhora = document.getElementById('DropHoraVuelta').value.split(\"|\");\n var empresa = arrayhora[2];\n var servicio = arrayhora[3];\n var origen = document.getElementById('DropOrigenVuelta').value;\n var destino = document.getElementById('DropDestinoVuelta').value;\n $.ajax({\n type: \"POST\",\n url: \"WSboleto.asmx/PrecioBoleto\",\n data: '{origen: \"' + origen + '\",destino: \"' + destino + '\",empresa: \"' + empresa + '\",servicio: \"' + servicio + '\"}',\n beforeSend: function () {\n $(\"#cargar\").removeClass(\"ocultar\");\n $(\"#cargar\").addClass(\"mostrar\");\n },\n complete: function () {\n $(\"#cargar\").removeClass(\"mostrar\");\n $(\"#cargar\").addClass(\"ocultar\");\n },\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: resultadopreciovuelta,\n error: errorespreciovuelta\n });\n }", "title": "" }, { "docid": "7afe4c6f7ce221e04439145b61f1211b", "score": "0.56823695", "text": "function calcularMontos() {\n /*SENTENCIA PARA VERIFICAR QUE EL USUARIO HALLA ESCOGIDO UN REGALO Y ASI PUEDA CONTINUAR CON EL EVENTO DE CALCULAR*/\n if (regalo.value === '') {\n alert(\"Debes elegir un regalo para continuar\");\n regalo.focus();\n } else {\n var boletosDia = parseInt(pase_dia.value, 10) || 0,\n boletos2Dias = parseInt(pase_dosdias.value, 10) || 0,\n boletoCompleto = parseInt(pase_completo.value, 10) || 0,\n cantCamisas = parseInt(camisas.value, 10) || 0,\n cantEtiquetas = parseInt(etiquetas.value, 10) || 0;\n\n //CALCULAR EL TOTAL DEL BOLETO POR DIA \n var totalBoletoDia = (boletosDia * 30);\n //CALCULAR EL TOTAL DEL BOLETO POR 2 DIAS\n var totalBoletoDosDias = (boletos2Dias * 45);\n //CALCULAR EL TOTAL DEL BOLETO COMPLETO\n var totalBoletoCompleto = (boletoCompleto * 50);\n //CALCULAR EL TOTAL CON SU DESCUENTO DEL EXTRA(CAMISAS)\n var totalCamisas = ((cantCamisas * 10) * .93);\n //CALCULAR EL TOTAL CON SU DESCUENTO DEL EXTRA(ETIQUETAS)\n var totalEtiquetas = ((cantEtiquetas * 2))\n\n var totalPagar = (boletosDia * 30) + (boletos2Dias * 45) + (boletoCompleto * 50) +\n ((cantCamisas * 10) * .93) + (cantEtiquetas * 2);\n\n //CREACION DEL LISTADO DEL RESUMEN (PRODUCTOS)\n var listadoProductos = [];\n if (boletosDia === 1) {\n listadoProductos.push(boletosDia + ' Pase por dia' + \" $ \" + totalBoletoDia);\n } else if (boletosDia >= 1) {\n listadoProductos.push(boletosDia + ' Pases por dia' + \" $ \" + totalBoletoDia);\n }\n if (boletos2Dias === 1) {\n listadoProductos.push(boletos2Dias + ' Pase por 2 días ' + \" $ \" + totalBoletoDosDias);\n } else if (boletos2Dias >= 1) {\n listadoProductos.push(boletos2Dias + ' Pases por 2 días' + \" $ \" + totalBoletoDosDias);\n }\n if (boletoCompleto === 1) {\n listadoProductos.push(boletoCompleto + ' Pase Completos' + \" $ \" + totalBoletoCompleto);\n } else if (boletoCompleto >= 1) {\n listadoProductos.push(boletoCompleto + ' Pases Completos' + \" $ \" + totalBoletoCompleto);\n }\n //EXTRAS\n if (cantCamisas === 1) {\n listadoProductos.push(cantCamisas + ' Camisa' + \" $ \" + totalCamisas);\n } else if (cantCamisas >= 1) {\n listadoProductos.push(cantCamisas + ' Camisas' + \" $ \" + totalCamisas);\n }\n if (cantEtiquetas === 1) {\n listadoProductos.push(cantEtiquetas + ' Paquete de etiquetas' + \" $ \" + totalEtiquetas);\n } else if (cantEtiquetas >= 1) {\n listadoProductos.push(cantEtiquetas + ' Paquetes de etiquetas' + \" $ \" + totalEtiquetas);\n }\n lista_productos.style.display = \"block\";\n\n //CICLO FOR PARA IMPRIMIR EL ARREGLO DEL RESUMEN DE SELECCION DEL USUARIO \n lista_productos.innerHTML = '';\n for (var i = 0; i < listadoProductos.length; i++) {\n lista_productos.innerHTML += listadoProductos[i] + '<br/>';\n }\n //REALIZAR LA SUMA TOTAL DE LA SELECCION DE LA COMPRA DEL USUARIO \n suma.innerHTML = \"$ \" + totalPagar.toFixed(2);\n }\n }", "title": "" }, { "docid": "f13e139b1a832f5273617c933142b977", "score": "0.568201", "text": "function gestioneImpegnoCaricato(e) {\n var imp = e.subimpegno ? e.subimpegno : e.impegno;\n var impPerCapitolo = e.impegno;\n var capitolo = impPerCapitolo.capitoloUscitaGestione;\n var provvedimento = imp.attoAmministrativo;\n\n // Ottengo la disponibilita\n var disponibilita = imp.disponibilitaLiquidare || 0;\n // Carico i dati\n // Disponibilita\n $(\"#SPAN_disponibileMovimentoGestione\").html(disponibilita.formatMoney());\n // SIAC-5623: flag cassa economale\n $('#SPAN_flagCassaEconomaleMovimentoGestione').html(imp.flagCassaEconomale ? \"SI\" : \"NO\");\n\n // Pulisco i campi prima di riscriverli\n $(\"#datiCapitoloStrutturaMovimentoGestione dl\").html(\"\");\n // Capitolo\n if(capitolo) {\n $(\"#numeroCapitoloCapitolo\").html(createStringForHtml(capitolo.numeroCapitolo));\n $(\"#numeroArticoloCapitolo\").html(createStringForHtml(capitolo.numeroArticolo));\n $(\"#descrizioneCapitolo\").html(createStringForHtml(capitolo.descrizione));\n $(\"#numeroUEBCapitolo\").html(createStringForHtml(capitolo.numeroUEB));\n $(\"#strutturaAmministrativoContabileCapitolo\").html(createStringForHtml(capitolo.strutturaAmministrativoContabile && capitolo.strutturaAmministrativoContabile.codice || \"\"));\n $(\"#tipoFinanziamentoCapitolo\").html(createStringForHtml(capitolo.tipoFinanziamento && capitolo.tipoFinanziamento.codice || \"\"));\n }\n // Atto Amministrativo\n if(provvedimento) {\n $(\"#tipoAttoAttoAmministrativo\").html(createStringForHtml(provvedimento.tipoAtto && provvedimento.tipoAtto.codice || \"\"));\n $(\"#annoAttoAmministrativo\").html(createStringForHtml(provvedimento.anno));\n $(\"#numeroAttoAmministrativo\").html(createStringForHtml(provvedimento.numero));\n $(\"#strutturaAmmContabileAttoAmministrativo\").html(createStringForHtml(provvedimento.strutturaAmmContabile && provvedimento.strutturaAmmContabile.codice || \"\"));\n $(\"#oggettoAttoAmministrativo\").html(createStringForHtml(provvedimento.oggetto));\n $(\"#statoOperativoAttoAmministrativo\").html(createStringForHtml(provvedimento.statoOperativo));\n }\n\n // Mostro i dati\n $(\"#containerDisponibileMovimentoGestione\").removeClass(\"hide\");\n $(\"#datiCapitoloStrutturaMovimentoGestione\").removeClass(\"hide\");\n $('#containerFlagCassaEconomale').removeClass('hide');\n }", "title": "" }, { "docid": "494bb690a193d5fc95322b55239b279c", "score": "0.567847", "text": "inicializar() {\n\n let uri = this.ip + \"Permiso_getPermisoModuloPersonas\";\n\n this.axios.get(uri).then(response => {\n this.permisos = response.data;\n });\n }", "title": "" }, { "docid": "018ad3a33970dd6d73fa2a8aee84f091", "score": "0.56782943", "text": "sacar(valor){\n let taxa = 1.1;\n //USANDO O SUPER OU O THIS DÁ NA MESMA NESSE BLOCO\n return this._sacar(valor, taxa);\n //SE NÃO ENTRAR NO IF ELE RETORNA SALDO 0\n}", "title": "" }, { "docid": "25122f0317d7b3fc02f2b34d7b5bf52e", "score": "0.5677641", "text": "function getMeteo() {\n //dico intanto che la tabella sta caricando\n //poi ciclo sulle righe e per ognuna faccio una chiamata al server\n onTableLoadingChange(true);\n for (let i = 0; i < loadedTable.length; i++) {\n let myNewObj = {};\n const data = loadedTable[i].data;\n const splittedData = data.split('-');\n let provincia = loadedTable[i].denominazione_provincia;\n let year = splittedData[0];\n let month = splittedData[1];\n let day = splittedData[2].split('T')[0];\n const url = `http://localhost:3001/meteo/single-line/${provincia}/${year}/${month}/${day}`;\n // riempio intanto l'oggetto con i dati delle colonne già presenti selezionate\n for (const col of selectedCol) {\n myNewObj[col] = loadedTable[i][col];\n }\n axios.get(url)\n .then(\n (res) => {\n\n myNewObj = { ...myNewObj, ...res.data };\n dispatchUpdate(i, myNewObj);\n myNewData.push(myNewObj);\n if (i === (loadedTable.length - 1)) {\n // se ho recuperato l'ultima riga carico i dati nello stato\n //per estrarre le keys devo accertarmi che la riga sia completa\n for (let x = 0; x < myNewData.length; x++) {\n if ((Object.keys(myNewData[x]).length) > selectedCol.length) {\n //estraggo le keys\n dispatchKeys(Object.keys(myNewData[x]).map((key) => {\n return {\n Header: <p>{key}</p>,\n accessor: parseInt(key, 10) || key,\n key: key,\n show: true,\n id: key,\n added: selectedCol.includes(key) ? false : true,\n }\n }));\n dispatchExtended(true);\n onTableLoadingChange(false);\n break;\n }\n }\n\n\n\n }\n }\n )\n .catch((err) => {\n console.log(err);\n })\n }\n }", "title": "" }, { "docid": "73326d6d7936dc5cd06b50114307de66", "score": "0.56746995", "text": "function obtenerRequerimientos() {\n\t/// <summary>\n\t/// Obteniene los Requerimientos que estan guardados en la base de datos segun el Plan que se eligio.\n\t/// </summary>\n\n\t//sProyecto = \"PRUEBASIAC\";\n\t//sColeccion = \"BLUEOCEAN\";\n\tvar plan = $(\"#iIdPlan option:selected\").val();\n\tvar cRequerimiento = \"\";\n\tvar objRQM = new Array();\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"../../Class/WBS.asmx/Requerimiento\",\n\t\tasync: false,\n\t\tdata: '{\"iIdPlan\": \"' + plan + '\"}',\n\t\tcontentType: \"application/json; charset=utf-8\",\n\t\tdataType: \"json\",\n\t\tsuccess: function (response) {\n\t\t\tcRequerimiento = response.d;\n\t\t},\n\t\terror: function (xhr, estatus) {\n\t\t\tAlertas(2, \"Error\", \"Error de carga de datos de los requerimientos\")\n\t\t}\n\t});\n\tif (cRequerimiento != \"\") {\n\t\t$(cRequerimiento.split(',')).each(function (index, domEle) {\n\t\t\tallRQM.push(parseInt(domEle));\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: \"../../Class/WBS.asmx/NombreRQM\",\n\t\t\t\tasync: false,\n\t\t\t\tdata: '{\"Id\":\"' + parseInt(domEle) + '\", \"sProyecto\": \"' + sProyecto + '\", \"sColeccion\": \"' + sColeccion + '\"}',\n\t\t\t\tcontentType: \"application/json; charset=utf-8\",\n\t\t\t\tdataType: \"json\",\n\t\t\t\tsuccess: function (response) {\n\t\t\t\t\tobjRQM = JSON.parse(response.d)\n\t\t\t\t\tarrRQMGlobal.push({\n\t\t\t\t\t\tiIdRQM: domEle,\n\t\t\t\t\t\tNombre: objRQM.cTitulo,\n\t\t\t\t\t\tcTipoElementoDeTrabajo: objRQM.cTipoElementoDeTrabajo,\n\t\t\t\t\t})\n\t\t\t\t\t//AgregarRQMModal(parseInt(domEle), objRQM);\n\t\t\t\t\t//AgregarRQMModal(parseInt(domEle), nombreRequerimiento);\n\t\t\t\t\t//$(\"#txtModalRQM\").val(\"\");\n\t\t\t\t},\n\t\t\t\terror: function (xhr, estatus) {\n\t\t\t\t\tAlertas(1, \"Alerta\", \"No existe ese requerimiento\")\n\t\t\t\t}\n\t\t\t});\n\t\t\tvar elementoOption = $(\"<option id='RQM_\" + domEle + \"' class='form-control' value='\" + domEle + \"'>\" + domEle + \"-\" + objRQM.cTitulo + \"</option>\");\n\t\t\t$(\"#iIdRequerimiento\").append(elementoOption);\n\t\t\trqmGlobal.push(domEle);\n\t\t\tlocalStorage.Requerimientos = rqmGlobal;\n\t\t});\n\t}\n\n}", "title": "" }, { "docid": "a76fd9d864b61eab02c465dfc5ffd15a", "score": "0.5671663", "text": "function prikazSlobodnihTerminaPregleda() {\n\tobrisiPretragu();\n\tobrisiFilter();\n\tobrisiTabele();\n\t$(\"#lineChart\").hide();\n\tvar obj = JSON.parse(localStorage.getItem('idKlinike'));\n\t$.ajax({\n\t\turl: \"api/pregledi/klinika/\" + obj,\n\t\ttype: \"GET\",\n\t\tcontentType: \"application/json\",\n\t\tdataType: \"json\",\n\t\theaders: {\n\t 'Authorization': 'Bearer '+JSON.parse(localStorage.getItem('user')).token.accessToken\n\t },\n\t\tcomplete: function(data) {\n\t\t\tpregledi = JSON.parse(data.responseText);\n\t\t\tloadDefinisaniPregledi(pregledi);\n\t\t\t\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3989d811076d146966c99bd996b816aa", "score": "0.56713396", "text": "function leerDatosCurso(curso) {\r\n // console.log(curso); // agarra todo lo del curso.. toda la info en la consola.. un renglon\r\n //creando un objeto con toda la info del curso en la consola\r\n const infoCurso = {\r\n imagen: curso.querySelector (\"img\").src , // aca tengo la src en la web\r\n titulo: curso.querySelector(\"h4\").textContent , //quiero el texto en esta parte.. el tituo\r\n precio: curso.querySelector(\".precio span\").textContent, // cada curso tiene un id en el index\r\n id: curso.querySelector(\"a\").getAttribute (\"data-id\"),\r\n cantidad: 1\r\n }\r\n\r\n //revisa si un elemento ya existe en el carrito\r\n const existe = articulosCarrito.some(curso => curso.id === infoCurso.id );\r\n if (existe) {\r\n //actualizamos la cantidad\r\n const cursos = articulosCarrito.map ( curso => { //map itera los elementos del carrito (busca)\r\n if(curso.id === infoCurso.id) {\r\n curso.cantidad++;\r\n return curso; //retorna el objeto actualizado\r\n }else{\r\n return curso; //retorna los objetos que no son duplicados (imagen, etc)\r\n }\r\n } );\r\n articulosCarrito = [...cursos];\r\n } else {\r\n articulosCarrito = [...articulosCarrito, infoCurso]; //arreglamos el arreglo del carrito\r\n }\r\n //agrega elementos al carrito en la web.. la tabla\r\n articulosCarrito = [...articulosCarrito]; //tomo copia del carrito (vacio), tomo la referencia del articulo anterior\r\n console.log(articulosCarrito);\r\n carritoHTML();\r\n}", "title": "" }, { "docid": "75929054389996ab5e2dbb0b114f93ed", "score": "0.56703424", "text": "function chiedoScheda(scheda) { //scheda e' il response xml con la scheda\n//cio che si deve fare e':\n//1 aggiustare PGNCORR\n//2 creare un nuovo rdiv per rimpiazzare il vecchio nella pagina corrente\n//2a aggiungere un bottone per fare risposte.\n//3formattare il frammento\n//appenderlo al nuovo rdiv e appenderlo infine alla pagina\nvar ch = carica(PGNCORR);\nvar mt = ch.createElement('scheda'); //altremineti non vailda con tutti i NS\nvar aq = ch.importNode(scheda.responseXML.documentElement, true);\n\n\n//aggiusto tutto senza NS\nvar pz = ch.evaluate('*', aq, null, XPathResult.ANY_TYPE, null);\ncompose(mt, '.', pz);\nvar b = ['folksonomia', 'edate', 'ecreator'];\n//for(var ao=0; ao<b.length; ao++) clickQuery(mt, b[ao]);\n//gli elimino (a PGNCORR) tutti i figli response precedenti\nvar pe = ch.getElementsByTagName('response');\nfor(var te=0; te<pe.length; te++){\npe[te].parentNode.removeChild(pe[te]);}\n\n\n//antepongo scheda a speciali (in PGNCORR) pena la non validazione\nvar cb = ch.getElementsByTagName('speciali')[0];\ncb.parentNode.insertBefore(mt, cb);\n\n\n//costruzione dell'albero formatta\nvar le = acdf.assem(l, s, true);\nvar rm = doc.importNode(mt, true);\nSCHEDA = rm;\nDSCORR = getStr(rm, '//epublisher');\ncompose(le, 'dati', [rm]); \n//significa che prendo l'elemento dati direttamente da PGNCORR\n\nPGNCORR = serializza(ch);\n\n\nvar ta = serializza(le);\nacdf.formatFrag(ta, DFCORR, gambizza);\n\t}", "title": "" }, { "docid": "94ea3dfab36dc1e1d8f9fb9dbd835628", "score": "0.5670209", "text": "function nombreFuncion(){\n //CODIGO\n}", "title": "" }, { "docid": "e3edeae4831038bf6b13df4a04409695", "score": "0.5667792", "text": "function crearPuntuacion() {\n\n let falla = document.getElementById(this.name);\n let nombre = falla.innerHTML;\n let puntos = this.value;\n\n let puntuacion = JSON.stringify({\n 'idFalla': nombre,\n 'ip': ipHost,\n 'puntuacion': puntos\n });\n\n // Realizar petición HTTP\n comprobarVotacion(puntuacion);\n}", "title": "" }, { "docid": "c5dcf1337f403fdac0b39134c507d69f", "score": "0.56664777", "text": "function cargarVacas()\n{\n vaca.cargaOK = true;\n posicionAnimales()\n}", "title": "" }, { "docid": "5d0e763050b1bbf56c14de671d01365b", "score": "0.5665278", "text": "function recogerdatos() {\n CameraPreview.takePicture({width:854, height:480, quality: 85}, function(base64PictureData){\n\t\tvar fecha = new Date();\n\t\tvar losdatos = {cs: elservidor.contrasena, c: $('#cv').text(), h: $('#hv').text(), p: $('#pmv').text(), fe: fecha, f: base64PictureData};\n\n\n\t\t$.ajax({\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\ttype: 'POST',\n\t\t\t\tcache: false,\n\t\t\t\turl: elservidor.servidor +'/a/n',\n\t\t\t\tdata: JSON.stringify(losdatos),\n\t\t\t\tsuccess: function(response){\n\t\t\t\t\tif (response.error) {\n\t\t\t\t\t\t// ha ocurrido un error, se para la grabación\n\t\t\t\t\t\tconsole.log('error servidor validaciones');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// todo bien\n\t\t\t\t\t\tconsole.log('bien');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(){\n\t\t\t\t\t// algo ha fallado, parar grabación e informar\n\t\t\t\t\tconsole.log('error');\n\t\t\t\t}\n\t\t\t});\n\n\n\t});\n}", "title": "" }, { "docid": "e1a985529f47056d6f39665cfe276bca", "score": "0.5664578", "text": "function soliPrestMass(){\r\n\t\t\tvar Dom \t\t\t= YAHOO.util.Dom,\r\n\t\t\t\r\n\t\t\t\tradiSoli\t\t= Dom.get('radiSoli'),\r\n\t\t\t\tradiNoSoli\t\t= Dom.get('radiNoSoli'),\t\t\t\t\r\n\t\t\t\tmasiva\t\t\t= Dom.get('masiva'),\r\n\t\t\t\telement5\t\t= Dom.get('respuestaPrestMass'),\r\n\t\t\t\t\r\n\t\t\t\tsUrl\t\t= 'requestAjax/masivaPrestamo.php';\r\n\t\t\t\r\n\t\t\tDom.get(\"soliPrestMass\").value \t\t= \"Enviando...\";\r\n\t\t\tDom.get(\"soliPrestMass\").disabled \t= true;\r\n\t\t\t\t\t\r\n\t\t\tvar callback = {\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\tsuccess: function(o) {\t\t\r\n\t\t\t\t\tvar r\t\t= eval('(' + o.responseText + ')');\r\n\t\t\t\t\tDom.removeClass(element5, 'yui-hidden2');\t\r\n\t\t\t\t\t//borramos la tabla de crear expedientes\t\t\t\t\t\t\r\n\t\t\t\t\twhile (masiva.hasChildNodes()) masiva.removeChild(masiva.firstChild);\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (r.respuesta == true) {\r\n\t\t\t\t\t\tvar texto4 \t\t= document.createTextNode(r.mensaje);\r\n\t\t\t\t\t\tvar texto5 \t\t= document.createTextNode(r.existen);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tradiSoli.appendChild(texto4);\r\n\t\t\t\t\t\tradiNoSoli.appendChild(texto5);\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t }else{\r\n\t\t\t\t\t\talert(r.mensaje);\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tfailure: function(o) {\r\n\t\t\t\t\talert(\"Error retornando datos de subSerie \" \r\n\t\t\t\t\t\t\t+ o.status + \" : \" + o.statusText);\r\n\t\t\t\t}\r\n\t\t\t};\t\r\n\t\t\t\r\n\t\t\tvar formObject = masiva;\r\n\t\t\t\tYAHOO.util.Connect.setForm(formObject);\r\n\t\t\t\t\r\n\t\t\tvar transaction = YAHOO.util.Connect.asyncRequest(\r\n\t\t\t\t\t\t\"POST\"\r\n\t\t\t\t\t\t, sUrl\r\n\t\t\t\t\t\t, callback);\r\n\t\t\t\r\n\t\t\tDom.get(\"soliPrestMass\").value = \"Incluir\";\r\n\t\t\tDom.get(\"soliPrestMass\").disabled = false;\t\t\t\r\n\t\t}", "title": "" }, { "docid": "fef13827ad4f7485c38748fba10205d8", "score": "0.5663985", "text": "getFuncionamento() {\n this.diasSemana = this.target.dataset.semana.split(\",\").map(Number);\n this.horarioSemana = this.target.dataset.horario.split(\",\").map(Number);\n }", "title": "" }, { "docid": "18c73a9f51c36a474a88f056ed099199", "score": "0.5662159", "text": "function obtenerVectorAleatorioPreguntas(n,ini,fin,vecFIJO)\n{\t\t\n\t\t//_root.SCORM_debug_mensaje(\"FUNCION ALEATORIO => n:\" + n + \" ini:\" + ini + \" fin:\" + fin + \" vecFijo: \" + vecFIJO.toString())\n\t\t//trace(\"FUNCION ALEATORIO => n:\" + n + \" ini:\" + ini + \" fin:\" + fin)\n\t\tvar cont \n\t\tvar str\n\t\tvar nuevasposiciones\n\t\tvar secuenciaAleatoria=new Array(n )\n\t\tsecuenciaAleatoria[0]=\"-1\"\n\t\tstr=str+ \" [0]=>\" + secuenciaAleatoria[0] + \" \"\n\t\t\n\t\tif (vecFIJO.length<=n)\n\t\t{\n\t\t\tfor (cont=0;cont<vecFIJO.length;cont++)\n\t\t\t{\n\t\t\t\tsecuenciaAleatoria[cont+1]=vecFIJO[cont]\n\t\t\t\tstr=str+ \" VALOR FIJO [\" + (cont+1) + \"]=>\" + secuenciaAleatoria[cont+1] + \" \"\n\t\t\t\t//trace(\"p[\"+cont +\"] => \" + secuenciaAleatoria[cont])\n\t\t\t}\t\t\n\t\t\tfor (cont=vecFIJO.length+1;cont<=n;cont++)\n\t\t\t{\n\t\t\t\tsecuenciaAleatoria[cont]=randRange(ini,fin,secuenciaAleatoria)\n\t\t\t\tstr=str+ \" [\" + cont + \"]=>\" + secuenciaAleatoria[cont] + \" \"\n\t\t\t\t//trace(\"p[\"+cont +\"] => \" + secuenciaAleatoria[cont])\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (cont=0;cont<n;cont++)\n\t\t\t{\n\t\t\t\tsecuenciaAleatoria[cont+1]=vecFIJO[cont]\n\t\t\t\tstr=str+ \" VALOR FIJO [\" + (cont+1) + \"]=>\" + secuenciaAleatoria[cont+1] + \" \"\n\t\t\t\t//trace(\"p[\"+cont +\"] => \" + secuenciaAleatoria[cont])\n\t\t\t}\t\t\n\t\t}\n\t\tstr=str+\"]\"\n\t\t//trace( str)\n\t\t\n\t\t//trace(secuenciaAleatoria)\n\t\t\n\t\tvar resultadoFinal=new Array(n )\n\t\t//var resultadoFinalReordenado=new Array(n-1 )\t\t\n\t\tnuevasposiciones=obtenerVectorAleatorio(n)\n\t\tfor(cont=0;cont<n;cont++)\n\t\t{\n\t\t\tresultadoFinal[nuevasposiciones[cont]]=secuenciaAleatoria[cont+1] \n\t\t}\n\t\t\n\t\t//trace(resultadoFinal)\n\t\t\n\t\t\n\t\treturn resultadoFinal\n}", "title": "" }, { "docid": "2ec1dc80da74a01a6678402e6350c7e1", "score": "0.5661092", "text": "starostVozila(){\r\n console.log(\"Ovo vozilo je staro\" + (2020-this.godinaProizvodnje) + \"godina\");\r\n}", "title": "" }, { "docid": "37ab67f2f89ae3aca5f6fde61cbb2154", "score": "0.5659619", "text": "function cheat() {\n compteur = compteur + 10000000\n console.log(\"tu triche\")\n\n }", "title": "" }, { "docid": "6150349de3370c06500984f2568fede9", "score": "0.56548107", "text": "function buscarProdutos() {\n chamarAPI('/produtos', 'GET', montarListaProdutos);\n}", "title": "" }, { "docid": "b0cedd64b0ee97b4ae44b4954af825f1", "score": "0.56515783", "text": "function es_par (numero) {\r\n\t resul = false; ;\r\n\t\r\n\t//TODO falta de implementar\r\n\t\r\n\treturn resul;\r\n\t\r\n}", "title": "" }, { "docid": "92c4ef15ddb3b73a6f6f3c8ad15f2238", "score": "0.565091", "text": "function inicializarValores(fechacompra, fechainicio, fechafabricacion, denominacion, tipovehiculo, tipo_botones_requeridos) {\n fechaCompra = isFechaValida(fechacompra) ? fechacompra : obtenerFechaString();\n fechaInicio = isFechaValida(fechainicio) ? fechainicio : obtenerFechaString();\n fechaFabrica = isFechaValida(fechafabricacion) ? fechafabricacion : obtenerFechaString();\n Denominacion = denominacion;\n TipoVehiculo = tipovehiculo;\n TipoBotones = tipo_botones_requeridos;\n\n\n\n}", "title": "" }, { "docid": "ecd1ad79babd2d8c501700a5b77b5f5c", "score": "0.5648773", "text": "function iniciarArreglo(arregloDatos){\n for(var ci = 0; ci < totalLimite; ci++){\n arregloDatos[ci] = 0;\n }//fin for\n }//fin ", "title": "" }, { "docid": "40c783c3635565d845d970180c1702fb", "score": "0.5646285", "text": "jugar(thisEleccion){\n if(this.creditos >= 5){ //Si los créditos son mayores a 5, puede apostar.\n this.apostar(); //Apuesta.\n return this.tomar_decicion(thisEleccion); //Llama a la función que retorna tu decisión.\n }\n }", "title": "" }, { "docid": "cc4467ffe7cf09de8ea65613587e78b7", "score": "0.5645572", "text": "function Barreiras(altura,largura,abertura,espaco,notificarPonto){\r\n this.pares= [\r\n new ParDeBarreiras(altura,abertura,largura),\r\n new ParDeBarreiras(altura,abertura,largura + espaco),\r\n new ParDeBarreiras(altura,abertura,largura + espaco * 2),\r\n new ParDeBarreiras(altura,abertura,largura + espaco * 3)\r\n ]\r\n\r\n const deslocamento = 3\r\n\r\n this.animar=()=> {\r\n this.pares.forEach(par => {\r\n par.setX(par.getX() - deslocamento)\r\n \r\n\r\n //quando a barreira sair da tela, vamos jogar ela de volta para a fila da barreiras que vão entrar na tela\r\n if (par.getX() < -par.getLargura()) {\r\n par.setX(par.getX() + espaco * this.pares.length)\r\n par.sortearAbertura()\r\n }\r\n\r\n const meio = largura / 2\r\n\r\n const CruzouOMeio= par.getX() + deslocamento >= meio \r\n && par.getX() < meio \r\n\r\n if(CruzouOMeio) notificarPonto()\r\n\r\n })\r\n }\r\n}", "title": "" }, { "docid": "9c7433886afb54e06d0d5ebca80c1410", "score": "0.5644857", "text": "function limpaPosFixo() {\n console.log(\"ENTROU ZERA POSFIXO\");\n posFixo = [];\n posFixoOperadores = [];\n}", "title": "" }, { "docid": "d1b6969f17cae10ab31200fb4a779530", "score": "0.5642259", "text": "function consultar(index){\n let usuario = usuarios[index]\n usuarioTemporal = index\n let consultaEstatura = usuario.estatura\n let consultaPeso =usuario.peso\n estaturaMetros = consultaEstatura/100\n indiceMasaCorporal = consultaPeso/(estaturaMetros*estaturaMetros) \n convertidoIMC = indiceMasaCorporal.toFixed(1)\n console.log(\"este es el IMC \"+convertidoIMC+ \"del consultado \"+ id)\n\n //Alertas de IMC\n if(convertidoIMC<18.5){\n alert(\"Bajo peso\")\n }else{\n if (30>convertidoIMC && convertidoIMC>=18.5){\n alert(\"Peso normal\")\n }else{\n console.log(\"entro al segundo condicional\")\n if(35>convertidoIMC && convertidoIMC>=30){\n alert(\"Sobre Peso\")\n }else{\n if(35<=convertidoIMC){\n alert(\"obesidad\")\n }\n }\n }\n return;\n } \n \n}", "title": "" }, { "docid": "a2759485c00f398318f5f9755e11cd43", "score": "0.5639287", "text": "interes(req, res)\n {\n var params = req.body;\n if(params.monto === null && params.tipo===null && params.tiempo===null)\n {\n res.status(300).json({msn : \"Inserte todos los datos\"});\n return;\n }\n var tipo=params.tipo;\n const porcentaje= parseFloat(params.tipo / 100);\n \n const aux=parseFloat(Math.pow((1+porcentaje),params.tiempo));\n \n let resultado=parseFloat(params.monto) * parseFloat(aux);\n res.status(200).json({msn:\"El monto total a pagar es \"+ resultado +\" bs.\"});\n }", "title": "" }, { "docid": "e2947e531b13f33303da04c58e753b07", "score": "0.56354815", "text": "function updateRotaDePericulosidade(c) {\n extrairRuaDaPosicao(c, buscarTodasRotasNaRua);\n}", "title": "" }, { "docid": "946dde113461d8c054558c68690a237f", "score": "0.5633478", "text": "function caricaDatiModalitaPagamentoSoggetto() {\n var campoModalitaPagamento = $(\"#modalitaPagamentoDipendenteMovimento\");\n var modalitaPagamentoSoggetto = $(\"#modalitaPagamentoSoggettoMovimento\");\n var obj;\n var url;\n if(!campoModalitaPagamento.val()) {\n // Non ho nulla da fare\n return;\n }\n url = baseUrl + \"_caricaDettaglioPagamento.do\";\n obj = campoModalitaPagamento.serializeObject();\n modalitaPagamentoSoggetto.val(\"\");\n campoModalitaPagamento.overlay(\"show\");\n\n // Invocazione del servizio\n $.postJSON(url, obj, function(data) {\n var movimento;\n if(impostaDatiNegliAlert(data.errori, alertErrori)) {\n // Errori presenti. Esco\n return;\n }\n if(data.messaggi.length && data.listaModalitaPagamentoSoggettoDifferenteIban && data.listaModalitaPagamentoSoggettoDifferenteIban.length) {\n // Devo far selezionare l'IBAN all'utente\n selezioneIban(data.listaModalitaPagamentoSoggettoDifferenteIban);\n return;\n }\n movimento = data.richiestaEconomale && data.richiestaEconomale.movimento;\n // Popolo i dati\n $(\"#dettaglioPagamentoMovimento\").val(movimento && movimento.dettaglioPagamento || \"\");\n $(\"#bicMovimento\").val(movimento && movimento.bic || \"\");\n $(\"#contoCorrenteMovimento\").val(movimento && movimento.contoCorrente || \"\");\n modalitaPagamentoSoggetto.val(data.richiestaEconomale.movimento.modalitaPagamentoSoggetto && data.richiestaEconomale.movimento.modalitaPagamentoSoggetto.uid || \"\");\n }).always(function() {\n campoModalitaPagamento.overlay(\"hide\");\n });\n }", "title": "" }, { "docid": "71e2c8615e645ea76ad2d064d57381f9", "score": "0.56315655", "text": "function obtenerDatosUsuario() {\r\n\r\n}", "title": "" }, { "docid": "1751ab9031f099aa83acde6dd98efbf2", "score": "0.5630215", "text": "function dibujarPuntuaciones(puntuaciones) {\n\n ubicaciones.forEach(id => {\n\n let filtro = puntuaciones.filter(voto => voto.idFalla == id.nombre);\n\n if (filtro.length !== 0) {\n\n let numeroVotaciones = filtro.length;\n let puntuacion = 0;\n\n filtro.forEach(puntos => {\n\n puntuacion += puntos.puntuacion;\n\n });\n\n let media = puntuacion / numeroVotaciones;\n\n document.getElementById(id.idPuntuacion).innerHTML = Math.round(media * 100) / 100;\n let cuadro = document.getElementById(id.divPuntuacion).parentNode;\n\n if (cuadro.className.includes('resaltado')) {\n cuadro.classList.remove('resaltado')\n }\n if (media >= 4) {\n\n cuadro.classList.add('resaltado');\n }\n\n dibujarNumeroPuntuaciones(id.nombre, id.divPuntuacion);\n }\n\n });\n\n}", "title": "" }, { "docid": "94fde7a4b7215240db561d0f94ef3009", "score": "0.5629276", "text": "function repartirNuevamante(){\r\n\trearmarMazo().then(dato => {\r\n\t\tiniciarMano();\r\n\t});\r\n}", "title": "" }, { "docid": "af95407046ec2cbad69b30415020553d", "score": "0.5627807", "text": "function gatilho(){\n setTimeout(function(){\n \n console.log(\"devolvendo resposta pro nodejs\");\n var http = require(\"http\");\n\n var options = {\n \"method\": \"GET\",\n \"hostname\": \"localhost\",\n \"port\": \"3000\",\n \"path\": \"/resEmpilha\",\n \"headers\": {\n \"cache-control\": \"no-cache\",\n \"postman-token\": \"10640850-b7d1-8207-6d5b-17126776c88c\"\n }\n };\n\n var req = http.request(options, function (res) {\n var chunks = [];\n\n res.on(\"data\", function (chunk) {\n chunks.push(chunk);\n });\n\n res.on(\"end\", function () {\n var body = Buffer.concat(chunks);\n console.log(body.toString());\n });\n });\n\n req.end();\n console.log(\"Ja Terminei a ordem devolvendo STATUS\");\n\n },30000);\n}", "title": "" }, { "docid": "f99ae7a314223e8c164cde421004252a", "score": "0.5625912", "text": "function mostrarResumen() {\n \n // Destructuring\n const { nombre, fecha, hora, servicios } = cita;\n\n // Seleccionar el resumen\n\n const resumenDiv = document.querySelector('.contenido-resumen'); // seleccionamos el resumen con la clase que se le dio en el index\n\n\n // limpia el HTML de la pagina 3 previo\n // mientras esta condicion se cumpla osea mientras contenido-resumen tenga HTML se cumplira este while se estara ejecutando\n while ( resumenDiv.firstChild ) {\n resumenDiv.removeChild( resumenDiv.firstChild );\n }\n\n\n console.log('Mostrar Resumen')\n // validacion de objeto\n // aqui veo los valores de el objeto \"cita\"\n if(Object.values(cita).includes('')) { // esto es para ver valor por valor, y si uno esta vacio entonces hacer lo siguiente\n const noServicios = document.createElement('P')\n noServicios.textContent = 'Faltan datos de Servicios, Hora, Fecha o Nombre';\n\n\n noServicios.classList.add('invalidar-cita'); // le damos estilos en _resumen.scss\n\n console.log('mostrar if')\n // agregar a resumenDiv que definimos la constante arriba, le agregamos un hijo\n resumenDiv.appendChild(noServicios);\n // pero no le estamos pasando los valores del objeto que se escribe en la app web. solamente le estamos pasando que no tiene nada y muestre el error.\n return; //para que al ejecutarse este codigo no se ejecute lo siguiente codigo de la funcion\n }\n\n //------------MOSTRAR EL RESUMEN-----------------\n const headingCita = document.createElement('H3'); //creamos un texto\n headingCita.textContent ='Resumen de Cita';\n\n const nombreCita = document.createElement('P');\n // nombreCita.textContent = `<span>Nombre:</span> ${nombre}`; // esto agrega el span como un texto\n nombreCita.innerHTML = `<span>Nombre:</span> ${nombre}`; // esto si trata las etiquetas html como codigo html\n\n \n const fechaCita = document.createElement('P');\n fechaCita.innerHTML = `<span>Fecha:</span> ${fecha}`;\n\n const horaCita = document.createElement('P');\n horaCita.innerHTML = `<span>Hora:</span> ${hora}`;\n\n // --- iterar sobre el arreglo de servicios (reflejar los servicios en pantalla)\n\n const serviciosCita = document.createElement('DIV');\n serviciosCita.classList.add('resumen-servicios');\n\n const headingServicios = document.createElement('H3'); //creamos un texto\n headingServicios.textContent ='Resumen de servicios';\n\n serviciosCita.appendChild(headingServicios); // se lo agregamos al serviciosCita para que se mustre en pantalla\n\n //creamos esta constante para agregarle un hijo de contenedorServicios que esta definido abajo\n\n let cantidad = 0; // aqui definimos esta variable para la sumatoria de el total la cual empieza en 0\n\n servicios.forEach( (servicio) => { // usamos el forEach para ir recorriendo cada uno de los servicios y asignarlos por individual a servicio\n \n const { nombre, precio } = servicio // extraemos los valores de el servicio\n \n const contenedorServicio = document.createElement('DIV'); // entonces se crea un div para cada servicio\n\n contenedorServicio.classList.add('contenedor-servicio'); // le agregamos una clase para darle estilos\n\n const textoServicio = document.createElement('P');\n textoServicio.textContent = nombre; // para mostrar el nombre de el servicio\n const precioServicio = document.createElement('P');\n precioServicio.textContent = precio;\n precioServicio.classList.add('precio');\n\n\n //definiendo para quitarle el signo de el dolar al precio y asi poder empezar a hacer la funcion para el total\n const totalServicio = precio.split('$'); // esto separa el signo de el dolar con el precio\n // console.log(parseInt(totalServicio[1].trim())); // el trim es para eliminar espacios en blanco, el parseInt es para volverlo numero y que pueda sumar\n\n cantidad += parseInt(totalServicio[1].trim());\n\n\n // console.log(textoServicio)\n // console.log(precioServicio)\n\n // COLOCAR TEXTO Y PRECIO EN EL DIV\n\n contenedorServicio.appendChild(textoServicio); // se los agregamos como hijos a contenedorServicio\n contenedorServicio.appendChild(precioServicio); // se los agregamos como hijos a contenedorServicio\n\n\n serviciosCita.appendChild(contenedorServicio); // servicioCita se definio fuera de la funcion para poder agregarselo al resumenDiv que esta por fuera de esta funcion tambien\n // ahora ese contenedorServicio tenemos que agregarlo a un elemento ya existente en el HTML para que se muestre\n // creamos una variable que este por fuera de los servicios\n } );\n\n // console.log(cantidad)\n \n resumenDiv.appendChild(headingCita);\n resumenDiv.appendChild(nombreCita);\n resumenDiv.appendChild(fechaCita);\n resumenDiv.appendChild(horaCita);\n\n resumenDiv.appendChild(serviciosCita);\n\n const cantidadPagar = document.createElement('P');\n cantidadPagar.classList.add('total');\n cantidadPagar.innerHTML = `<span>Total a Pagar: </span> $ ${cantidad}`;\n\n resumenDiv.appendChild(cantidadPagar);\n}", "title": "" }, { "docid": "11c46695c656721a5b910e2ac9e27d8c", "score": "0.5624912", "text": "constructor( titulo, ano, genero, diretor, duracao){ // atributos da classe em javascript, tem que ter exatamente esse nome, tem que colocar isso para definir o atributo, dentro deel voce coloca o parametro que suas variaveis de atributo vão receber\n //ATRIBUTOS\n this.titulo = titulo; //Atributos são como variaveis, só que pertencem a uma classe.Parar criar um, é bem semelhante ao processo de criação de variavel, com a adição do 'this.' antes do nome do atributo\n this.ano = ano;\n this.genero = genero; //Contructor: é basicamente um funçãi especial que é responsavel \n this.diretor = diretor; //por pegar classe e criar uma copia na memoria, ele é responsavel por gerar os objetos na memoria\n this.duracao = duracao; // pega cria um objeto e retorna ele para mim\n this.atores = [];\n\n }", "title": "" }, { "docid": "1a1f89bc7466d8748d9d1a61dde0acc1", "score": "0.5620413", "text": "function cargartres() {\n\n let inscripto = {\n \"curso\": parseInt(Math.floor((Math.random() * 3) + 1)),\n \"nombre\": \"JOAQQQUUIINNNN\",\n \"apellido\": \"HANDDBALLLL\",\n \"mail\": \"[email protected]\",\n };\n cargarinscripcion(inscripto);\n inscripto = {\n \"curso\": parseInt(Math.floor((Math.random() * 3) + 1)),\n \"nombre\": \"Elva\",\n \"apellido\": \"Kehler\",\n \"mail\": \"[email protected]\",\n };\n cargarinscripcion(inscripto);\n inscripto = {\n \"curso\": parseInt(Math.floor((Math.random() * 3) + 1)),\n \"nombre\": \"Sergio\",\n \"apellido\": \"Yañez\",\n \"mail\": \"[email protected]\",\n };\n cargarinscripcion(inscripto);\n\n }", "title": "" }, { "docid": "3918a7a2bf9e385b253854b8aeb57bd8", "score": "0.562008", "text": "function getRetencion(empleadoData) {\n // Ajuste a valores positivos\n empleadoData.bruto = empleadoData.bruto > 0 ? empleadoData.bruto : 0;\n let porcentaje;\n switch (true) {\n case (empleadoData.bruto < 12000):\n porcentaje = 0;\n break;\n case (empleadoData.bruto < 24000):\n porcentaje = 8;\n break;\n case (empleadoData.bruto < 34000):\n porcentaje = 16;\n break;\n default:\n porcentaje = 30;\n break;\n }\n if (empleadoData.hijos > 0 && porcentaje >= 2) {\n porcentaje -= 2;\n }\n return porcentaje;\n}", "title": "" }, { "docid": "f7d8c3cc19cb1d0a255b2bbda757019e", "score": "0.56174463", "text": "constructor(_operaciones) {\n this._operaciones = _operaciones;\n this._operaciones = this.operaciones;\n // this._suma = this.suma\n // this._resta = this.resta\n // this._multiplicacion = this.multiplicacion\n // this._division = this.division\n }", "title": "" }, { "docid": "1d1c9c658e1a8fbf4d155f2b0c1129b5", "score": "0.56170386", "text": "function ObtenerDatos101()\n{\n var movimiento = document.getElementById('bxClase').value;\n var porrc = document.getElementsByName('bx101Prb');\n var lote = document.getElementsByName('bx101Lote');\n var uean = document.getElementsByName('bx101UEAN');//Unidad Medida\n var prov = document.getElementsByName('bx101Prov');\n var cnr = document.getElementsByName('tdCR');//Cantidad Recepcionada\n var cnp = document.getElementsByName('tdCP');//Cantidad\n var ped = document.getElementsByName('tdPedido');\n var pos = document.getElementsByName('tdPos');\n var mat = document.getElementsByName('tdMaterial');\n var alm = document.getElementsByName('tdAlmacen');\n var doc = document.getElementsByName('tdDocCom');\n var cls = document.getElementsByName('tdClase');\n var pro = document.getElementsByName('tdProveedor');\n var txt = document.getElementsByName('tdtxt');\n var ulc = document.getElementsByName('tdulc');\n var cec = document.getElementsByName('tdCeCo');\n var ord = document.getElementsByName('tdOrder');\n var clc = document.getElementsByName('tdClCoste');\n var tim = document.getElementsByName(\"tdTImp\"); ////// Imputacion\n var n1 = 0;\n var n2 = 0;\n var registros = 0;\n switch (movimiento)\n {\n case \"101\":\n for (i = 0; i < porrc.length; i++)\n {\n n1 = parseFloat(porrc[i].value);\n n2 += n1;\n }\n if (n2 <= 0.000) {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"No existen posiciones listas para su recepción\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n for (i = 0; i < porrc.length; i++)\n {\n if (porrc[i].value.length < 1) {\n porrc[i].focus();\n invalido(\"Cantidad Obligatoria no puede ir vacio\");\n return;\n }\n }\n for (i = 0; i < porrc.length; i++)\n {\n if (uean[i].value == \"\") {\n uean[i].focus();\n invalido(\"Unidad de Medida Obligatorio\");\n return;\n }\n }\n for (i = 0; i < porrc.length; i++)\n {\n if (!(porrc[i].value == \"0\")) {\n var tole = GetCantFinal(cnp[i].textContent, uean[i].value, ped[i].textContent, pos[i].textContent);\n var pr2 = parseFloat(cnp[i].textContent) + parseFloat(tole);\n var ccc = parseFloat(porrc[i].value) + parseFloat(cnr[i].textContent);\n if (ccc > pr2) {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"El Material\" + \" \" + mat[i].textContent + \" excede la cantidad de pedido aplicada con tolerancia\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n }\n }\n for (i = 0; i < lote.length; i++)\n {\n if (tim[i].textContent == \"\" && !(mat[i].textContent == \"\")) {\n var isDisabled = $('#bxLote' + i).prop('disabled');\n if (parseInt(porrc[i].value) !== 0) {\n if (isDisabled === false) {\n if (lote[i].value === \"\")\n {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"El Material\" + \" \" + mat[i].textContent + \" esta sujeto a Lote <br> el campo lote es obligatorio\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n }\n }\n }\n }\n ShowMsg(1, \"images/load.gif\", \"audio/sapmsg.wav\");\n $('#ok101').prop(\"disabled\", true);\n $('#Cerra101Taba').prop(\"disabled\", true);\n $('#guardar').prop(\"disabled\", true);\n var random = ObtenerFolioRandom();\n setTimeout(function () {\n GuardaTem101();\n }, 4000);\n break;\n case \"102\":\n var porrec = document.getElementsByName(\"bx102Prb\");\n var claspe = \"\";\n var lotepr = \"\";\n var tdmateri = document.getElementsByName(\"tdMaterial102\");\n var tdtxtmat = document.getElementsByName(\"tdtxt102\");\n var tdalmace = document.getElementsByName(\"tdAlmacen102\");\n var tdlote = document.getElementsByName(\"tdLote102\");\n var tdccance = document.getElementsByName(\"tdCantCa102\");\n var tdccanen = document.getElementsByName(\"tdCanEnt102\");\n var tdunme = document.getElementsByName(\"tdUME102\");\n var tdcentr = document.getElementsByName(\"tdCentro102\");\n var tdfecha = document.getElementsByName(\"tdFecEnt102\");\n var tdprove = document.getElementsByName(\"tdNumProv102\");\n var tddocco = document.getElementsByName(\"tdNumDocCom102\");\n var tdposco = document.getElementsByName(\"tdPosDoc102\");\n var tdceco = document.getElementsByName(\"tdCeCo102\");\n var tdorden = document.getElementsByName(\"tdOrd102\");\n var tdclaco = document.getElementsByName(\"tdClaCos102\");\n var tdmovim = document.getElementsByName(\"tdnumMov\");\n var n1 = 0;\n var n2 = 0;\n for (i = 0; i < porrec.length; i++) {\n n1 = parseInt(porrec[i].value);\n n2 += n1\n }\n\n if (n2 === 0)\n {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"No existen posiciones listas para su recepción\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n for (i = 0; i < porrec.length; i++) {\n if (porrec[i].value.length == 0) {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"La cantidad no puede ir vacia, ingrese una cantidad\";\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n if (!(parseInt(porrec[i].value) == 0)) {\n var cf = (parseFloat(tdccance[i].textContent)) + (parseFloat(porrec[i].value));\n if (cf > parseFloat(tdccanen[i].textContent)) {\n var ven = document.getElementById('VentanaModalAv');\n var msg = \"Cantidad Por Devolver mas Cantidad Cancelada, supera <br> a cantidad Entrante en posición \" + tdposco[i].textContent;\n abrirVentanaAv(ven, msg);\n var theHandle = document.getElementById(\"handleAV\");\n var theRoot = document.getElementById(\"VentanaModalAv\");\n Drag.init(theHandle, theRoot);\n return;\n }\n }\n }\n ShowMsg(1, \"images/load.gif\", \"audio/sapmsg.wav\");\n $('#ok101').prop(\"disabled\", true);\n $('#Cerra101Taba').prop(\"disabled\", true);\n $('#guardar').prop(\"disabled\", true);\n var random = ObtenerFolioRandom();\n setTimeout(function () {\n GuardaTem102();\n }, 4000);\n break;\n }\n\n}", "title": "" }, { "docid": "465e83c8ae15af9abd6e36ddd68399bb", "score": "0.5617009", "text": "presupuestoRestante(cantidad){\n const restante = document.querySelector('#restante');\n const presupuestoRestanteUsuario = cantidadPresupuesto.presupuestoRestante(cantidad);\n\n restante.innerHTML = presupuestoRestanteUsuario;\n\n this.comprobarPresupuesto()\n }", "title": "" }, { "docid": "a302f96725efd2f060af70b3d8b29a1e", "score": "0.5613869", "text": "function recibidor(recibido){\n llenar(recibido);\n}", "title": "" }, { "docid": "227ec329e19bc1510e73a865448d2390", "score": "0.5612327", "text": "function getRotulos(){\n\t\t\t\t \treturn rotulos;\n\t\t\t\t }", "title": "" }, { "docid": "2751d9975f293346dd278566805a2446", "score": "0.56079686", "text": "function Rips(){\n\n this.numCuentaCobro = '';\n var _this = this;\n\n this.generateRips = function(){\n ripsService.generateRips(\n {\n payment_consec : this.numCuentaCobro\n },\n function( success ){\n\n window.location.href=urls.BASE_API+'/rips/downloadTxt/'; \n\n },\n function( error ){\n \n l( error );\n \n }\n );\n }\n\n }", "title": "" }, { "docid": "79a38ae3307b22eeea792d4378b67ddf", "score": "0.5605722", "text": "function perimetrocuadrado(lado) {\r\n return lado * 4;\r\n}", "title": "" }, { "docid": "9990571ea838338a0afa1dad37ce8dbd", "score": "0.56008893", "text": "function RisolviSecondoProblema(){\n switch (bug){\n case 0:\n switch (tipoProblema){\n case \"navigazione generale\":\n DeltaPsi();\n SetLatCreDeltaPhiCre();\n DeltaLambda();\n RottaVera();\n Cammino();\n break;\n case \"navigazione meridiano\":\n NavigazioneMeridiano();\n break;\n case \"navigazione parallelo\":\n NavigazioneParallelo();\n break;\n default:\n alert(\"Errore nella risoluzione del secondo problema di lossodromia.\");\n break;\n }\n break;\n case 1:\n alert(\"Errore, impossibile risolvere il problema, controllare inserimento dati.\");\n break;\n default:\n alert(\"Errore valutazione della risoluzione tramite bug.\");\n break;\n }\n}//end function RisolviSecondoProblema()", "title": "" }, { "docid": "cce9391ca3102401adfafdd08c445f09", "score": "0.55993766", "text": "function IniciarJuego() {\n // Obtenemos datos\n let numFilas = document.getElementById(\"i_filas\").value;\n let numColumnas = document.getElementById(\"i_columnas\").value;\n\n // Generamos tablero\n crearTablero(numFilas, numColumnas);\n\n // Preparamos valores \n let posicionPlayer = casillaAventureroAleatoria(numFilas, numColumnas);\n let posicionesTesoro = casillasTesorosAleatorias(numFilas, numColumnas, posicionPlayer);\n\n console.log(posicionesTesoro);\n\n // Dibujar Aventurero\n dibujarAventurero(posicionPlayer);\n\n // Dibujar Tesoros\n for (let tesoro of posicionesTesoro) {\n dibujarTesoro(tesoro);\n }\n}", "title": "" }, { "docid": "e5017ebc5390093537f78d6cca5266d2", "score": "0.5598576", "text": "function anni_da_raggiungere(){\n let anni_per_arrivare_a_100 = anni_mancanti_a_100 - età;\n return \"Anni mancanti per arrivare a 100: \" + anni_per_arrivare_a_100;\n}", "title": "" }, { "docid": "1dbbb04e340e747609b6b08e11e9760c", "score": "0.5596367", "text": "revisarTrayecto(origen, destino){\r\n let c_origen = origen || document.getElementById('ciudadR').dataset;\r\n let c_destino = destino || document.getElementById('ciudadD').dataset;\r\n\r\n if(c_destino.tipo_trayecto == \"undefined\" && this.codTransp == \"SERVIENTREGA\") return \"NA\";\r\n\r\n if(c_destino.tipo_trayecto == \"TRAYECTO ESPECIAL\"){\r\n return \"Especial\";\r\n } else {\r\n if(c_destino.id == c_origen.id) {\r\n return \"Urbano\";\r\n } else if(c_destino.departamento == c_origen.departamento) {\r\n return \"Zonal\";\r\n } else {\r\n return \"Nacional\";\r\n }\r\n }\r\n }", "title": "" }, { "docid": "256de0f158b0733dc1f3c176bfe5bf40", "score": "0.55945367", "text": "function fine_scuola() {\r\n var fine = new Date('06 06, 2020') ; //costante giorno fine scuola\r\n var giorni_giusti = 86400000 ; //costante millisecondi in un giorno\r\n var manca = (fine - date) / giorni_giusti ; //variabile che fa l' operazione di quanti giorni mancano\r\n var arrotondo = Math.round(manca) ; //variabile che arrotonda il risultato all' intero più vicino\r\n var tl = document.getElementById('manca') ; //varaibile scritta\r\n tl.innerHTML = '<p>Alla fine della scuola mancano ' + arrotondo + ' giorni' + '</p>' ; //stringa che scrive il risultato\r\n}", "title": "" }, { "docid": "691b906308f6a120ffe05acbd3c0200a", "score": "0.5593063", "text": "function init()\n{\n \n solicitarEstimado();\n}", "title": "" } ]
51251be3996b049062c41eb730074a0e
____ _ _ _____ _ / ___| ___ _ __ ___ | | | |_ _| __(_) __ _ __ _ ___ _ __ ___ \___ \ / __| '__/ _ \| | | | || '__| |/ _` |/ _` |/ _ \ '__/ __| ___) | (__| | | (_) | | | | || | | | (_| | (_| | __/ | \__ \ |____/ \___|_| \___/|_|_| |_||_| |_|\__, |\__, |\___|_| |___/ |___/ |___
[ { "docid": "e50bcefef12da659e52cb5b64e975d26", "score": "0.0", "text": "function bindScrollTriggers(element, over_cb, out_cb) {\n // register scroll listeners for element's bounding rectangle\n\n var scroll_listener = function listener() {\n // when element is completely in view, call call over_cb\n // when no longer completely in view, call out_cb\n\n var window_top = scrollY;\n var window_bottom = scrollY + window.innerHeight;\n\n if (window_bottom > listener.top &&\n window_top < listener.bottom) {\n if (!listener.active) {\n listener.active = true;\n over_cb();\n }\n } else if (listener.active) {\n listener.active = false;\n out_cb();\n }\n };\n scroll_listener.active = false;\n\n var resize_listener = function() {\n // update scroll_listener's coordinates\n\n var rect = element.getBoundingClientRect();\n\n // store coordinates relative to document\n scroll_listener.top = rect.top + scrollY;\n scroll_listener.bottom = rect.bottom + scrollY;\n\n };\n\n window.addEventListener('scroll', scroll_listener);\n window.addEventListener('resize', resize_listener);\n resize_listener();\n scroll_listener();\n}", "title": "" } ]
[ { "docid": "10f4afb80d955af0b4a0f7690ea4c94b", "score": "0.5937879", "text": "function _5Ra3VTLNPzq7ojEKUXMbvA() {}", "title": "" }, { "docid": "cc40508e414cd5b9a616a005574d90ab", "score": "0.5756105", "text": "function _5JLIsfM2BDWu5if6PVH9Mw() {}", "title": "" }, { "docid": "1ac507c5d6aac7c114c1a979ee26340d", "score": "0.57385033", "text": "function __axO4V4GhxjCIJCmJ0hzrQQ() {}", "title": "" }, { "docid": "a04645c41c79fde3e31d5562dd22123f", "score": "0.5732277", "text": "function Lycanthrope()\n{ \n}", "title": "" }, { "docid": "1fce695f68ac3e300fa8c04cfde11991", "score": "0.56867504", "text": "function _6yGdN5U6Pj6hvxUip1p9OQ() {}", "title": "" }, { "docid": "9b457cec6da10133f41cb04cd55f46a4", "score": "0.5624434", "text": "function _8SzARJV9njS10hoe_bNfgMg() {}", "title": "" }, { "docid": "55a471b24674cd3c488584140711ea11", "score": "0.56046176", "text": "render () {}", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.55960697", "text": "render() { }", "title": "" }, { "docid": "9f4f6f36652f34541517e8bb317956b6", "score": "0.55948794", "text": "function EBB6YpS42zKw0RTPI65LPQ() {}", "title": "" }, { "docid": "5f1cf1307c31d47b504d6e704640e37f", "score": "0.5594119", "text": "function SzlSjRxM1DexWk1PpKwx2g() {}", "title": "" }, { "docid": "f7c125dd3c87a8f1e8c5d1ca2ff4e1aa", "score": "0.5564712", "text": "function mSRQAu7ItjugQsBXE87Mrw() {}", "title": "" }, { "docid": "77c308d0c7c9dce3aebc021c277bdc52", "score": "0.5562574", "text": "function _82pwGb6BWzOVYZGortTaJw() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5548182", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5548182", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5548182", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5548182", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5548182", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.5548182", "text": "render() {}", "title": "" }, { "docid": "e48e4b7a3aa71df35c483ced1e452129", "score": "0.5493785", "text": "function _2XEbHcHe2jmPYfmsOJUDbA(){}", "title": "" }, { "docid": "4ce9be6b44858a267dc4fcf14ef599d0", "score": "0.5475887", "text": "function h_bkAQX1GXzm_b2rJMB1SHHA() {}", "title": "" }, { "docid": "a50302dba602669b846804da04cc8aad", "score": "0.5463171", "text": "function nw6PUrLXLjqiWJDOBAtITA() {}", "title": "" }, { "docid": "06e71c40eea88f7914bf337f6eaaedac", "score": "0.54427594", "text": "function _2YQqj_bQsOz2H9NScp8H3BQ() {}", "title": "" }, { "docid": "b49aa481639e55b0ad90fd6ea4a41fea", "score": "0.54091585", "text": "function _5MoheFcFBz_aCSksX6eoQvw() {}", "title": "" }, { "docid": "21e226d7ba6a0eb00ab954afa2021370", "score": "0.54033244", "text": "generate() {\n\n }", "title": "" }, { "docid": "84c8ed22fd63f00f2e0bf2151e5ebc30", "score": "0.54019934", "text": "function _9cxlY8V5cDGdDGWegEHKcg() {}", "title": "" }, { "docid": "95e2d64166b9b74c93ee1a7cbd9d881d", "score": "0.5397935", "text": "function ysuN4gr4qzChYPsLPYpY0A() {}", "title": "" }, { "docid": "87dad3b23eed89ec2f521715e8c9922c", "score": "0.5378387", "text": "render() {\n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5373919", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "c2712092d3848dae217c584315897b4a", "score": "0.53504795", "text": "function b6Xro2KKdz21xKZKv4hTiw() {}", "title": "" }, { "docid": "9f11183badffc756e10287142244d9b5", "score": "0.5346415", "text": "function rp7SJnnHHDS3bGGGnOxkBw() {}", "title": "" }, { "docid": "efdafa27bdbf28ff4a654a7154be4dd9", "score": "0.5345526", "text": "function __func(){'ground control to major tom'}", "title": "" }, { "docid": "7d72bb8529271e4db47c81e78b8bcf45", "score": "0.5343953", "text": "function yReE6c_aJazG_bRrkIWAoOng() {}", "title": "" }, { "docid": "03aa46eadbca28480a56e225e57fe929", "score": "0.5343882", "text": "render() {\n }", "title": "" }, { "docid": "f2972cf748d7a64e9188a6ba92a6117c", "score": "0.5309913", "text": "render() {\n }", "title": "" }, { "docid": "f16e4eb5233e3cb62a591c18f7c1e2b5", "score": "0.5292196", "text": "function D6FOYfOFpz_aD_a1dpPFWmdw() {}", "title": "" }, { "docid": "a521917f534cd20ea6b34b36ee10b89b", "score": "0.52751195", "text": "function Hp9PELN2RD2ddZXlwWYHcQ() {}", "title": "" }, { "docid": "221f5ebafec40fa41e338505907afd52", "score": "0.5274322", "text": "function RYcJIMQFdTSYjDitS5HxAQ() {}", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.5271214", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.5271214", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.5271214", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.5271214", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.5271214", "text": "render() {\n\n }", "title": "" }, { "docid": "ecbf91e4896fd5b64db55642b924786d", "score": "0.5264915", "text": "function ilP8cu7JYzamTa6vdby6Sw() {}", "title": "" }, { "docid": "9fd012d3704902897b61c80228721d85", "score": "0.5259409", "text": "function lAn6CEU3QTmDxkbpvG9V2A() {}", "title": "" }, { "docid": "7fe95dc8999f54a842b7c191872421ef", "score": "0.5249675", "text": "function lGm5GClUJD6spHa90dEFnA(){}", "title": "" }, { "docid": "50bde0ca8b77f557a5cbb3dca1d95e15", "score": "0.52343804", "text": "function eVfL3GN9gzKo9J9veEMNRA(){}", "title": "" }, { "docid": "3bd03e8e47276e8ad1c37cf2f2839c9b", "score": "0.52338326", "text": "function TJT9aiKMnjipsTfXwFUaaA() {}", "title": "" }, { "docid": "182f0a775a7bcfcfff98975756ec461c", "score": "0.5216824", "text": "function logo() {\n const fun =\n ` \n _____ _ _ _____ \n / _ \\ | | | | | _ \\ \n | | | | | | | | | |_| | \n | | | | | | | | | _ / \n | |_| | | |_| | | | \\ \\ \n \\_____/ \\_____/ |_| \\_\\ \n\n\n _ __ _____ _____ _ _ _____ _ ___ _____ _____ \n | | / / / _ \\ | _ \\ | | / / | _ \\ | | / | / ___| | ____| \n | | __ / / | | | | | |_| | | |/ / | |_| | | | / /| | | | | |__ \n | | / | / / | | | | | _ / | |\\ \\ | ___/ | | / / | | | | | __| \n | |/ |/ / | |_| | | | \\ \\ | | \\ \\ | | | |___ / / | | | |___ | |___ \n |___/|___/ \\_____/ |_| \\_\\ |_| \\_\\ |_| |_____| /_/ |_| \\_____| |_____| \n `;\n console.log(\"\\x1b[33m\", fun);\n}", "title": "" }, { "docid": "fa6dd38aa115b735c8ab3242acd69b92", "score": "0.5214664", "text": "function amr477308() { return ' x'; }", "title": "" }, { "docid": "ca0b2c0273e9593928c24f0854fe1813", "score": "0.5210012", "text": "function bClNZkm5NTWpSK44QgJKLQ() {}", "title": "" }, { "docid": "c27d14467e87b3547c785b03a3b685bf", "score": "0.5202593", "text": "function lsncNxgPwDmYTBjiUQ9SHg() {}", "title": "" }, { "docid": "f49271ad3b2c0990e358dda1d09c2024", "score": "0.5190903", "text": "makedoor() {\n\n\n\n\n }", "title": "" }, { "docid": "53aee6c0d68eb634cdd463748228e3ed", "score": "0.518302", "text": "cross() {\n\n }", "title": "" }, { "docid": "df913882e634302f81de63d78501094c", "score": "0.518185", "text": "drive() {\n return `VROOM!`;\n }", "title": "" }, { "docid": "a48f29669b3172449c4fa493db0b2eb0", "score": "0.5179585", "text": "function P1zx9prf2zyqe6nJTkKnjA() {}", "title": "" }, { "docid": "9b8cfe405ecad0077b55c4ec364f2395", "score": "0.5160279", "text": "function OIR7mPg6CzqXA_bVsJvcnSg() {}", "title": "" }, { "docid": "2b76de264adbe068b1bc4f07f684103f", "score": "0.5149914", "text": "function FQEbbY3erDWW14X7Ekt7Zg() {}", "title": "" }, { "docid": "0ce8474e7099560937702082d446a5c5", "score": "0.5149028", "text": "render() {\n\n }", "title": "" }, { "docid": "2f3a59eda75e58864946e8e9cd82a94e", "score": "0.5136699", "text": "function _8QvRghRSLD_aKIqiXOklPUA() {}", "title": "" }, { "docid": "30f737f85ebb6af1bbc7db78ad40c1e7", "score": "0.5131801", "text": "function IooF83evvDe5wVUXXK_a_bTw() {}", "title": "" }, { "docid": "53c612b8b2284bc840a602e763ecc699", "score": "0.511751", "text": "function _2KxTnuR36jO0hdg5_apwJ7w() {}", "title": "" }, { "docid": "379d1cb99e603801cd65cfefa504882a", "score": "0.5110478", "text": "function p0iyifet1TKJw2_bTgf9CKA() {}", "title": "" }, { "docid": "ccc2409246b4e35d5b52a65f5646fd9f", "score": "0.5107034", "text": "scratchpad() {}", "title": "" }, { "docid": "dfee0a5968479e7efab789b10cea17c3", "score": "0.5097519", "text": "function DXFsJ7OT0DGtCF_bfLWAf7w(){}", "title": "" }, { "docid": "71f3773a5366f5dd26f6611f628121d2", "score": "0.5086555", "text": "function nyU1o07oBz_af5NoQCY0zrQ() {}", "title": "" }, { "docid": "af82adedbe2871bdbca2742a943f577e", "score": "0.50799924", "text": "function amr648284() { return 'tch '; }", "title": "" }, { "docid": "0ab494f2db6334049cd31cb6cb737a27", "score": "0.5079912", "text": "render() {\n return (\n <div>\n\n </div>\n );\n }", "title": "" }, { "docid": "de04e5138491a041068cd5ba7be2dad1", "score": "0.5073339", "text": "function nTD_a_bCJPaTWOCzpnc22bYg() {}", "title": "" }, { "docid": "f8d2b91b35ec97d559891f88017e4062", "score": "0.50729334", "text": "render () { \n\n }", "title": "" }, { "docid": "95e300bd84b6d3d8474d6b7d6f1c52c0", "score": "0.5071726", "text": "function WF27ZM8Ihj28tbA_bJXntaw() {}", "title": "" }, { "docid": "44fa2f83f93c48a16c7d77b9c442dec2", "score": "0.5071087", "text": "function VzxZCNjbgTKrRFS3y_aYw6w(){}", "title": "" }, { "docid": "9dd689353cfeb0f38c03e25ec771bb9e", "score": "0.5069324", "text": "function mk5Tvhg4pDWi3_bzUjmbDqA(){}", "title": "" } ]
07d9fd8e66fda4184fb81979c6f6cc48
Create promise that rejects with after
[ { "docid": "33ea6ab598ff2212b929d549c304b196", "score": "0.0", "text": "function timeBomb(millis, msg) {\n return new Promise((_, reject) => {\n setTimeout(reject, millis, msg);\n });\n}", "title": "" } ]
[ { "docid": "6b6093ade9d1bb9437c641d10876813c", "score": "0.76824546", "text": "function afterReject() {\n return new Promise((resolve) => {\n resolve();\n });\n}", "title": "" }, { "docid": "516d1d63865e19037d29a8817f036801", "score": "0.69493157", "text": "function afterReject(xhr){\n return new Promise((resolve, reject) => {\n resolve();\n });\n}", "title": "" }, { "docid": "6a80a9f8e0ca80c91fd7446af36a88f6", "score": "0.69009334", "text": "function after(promise) {\n if (!promise.isPending()) return Promise.resolve();\n\n return new Promise(function(resolve) {\n danglingFinally(promise, function() {\n return resolve();\n });\n });\n}", "title": "" }, { "docid": "20236eace6437ed422c808408f547aaf", "score": "0.67591995", "text": "catch(onRejected) {\n return this.toPromise().catch(onRejected)\n }", "title": "" }, { "docid": "a8a75ab5b83a48f29431c5f5f9919737", "score": "0.67255616", "text": "static tryReject(fn) {\n\t\treturn new ArrayPromise(async (resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tresolve(await fn());\n\t\t\t} catch (e) {\n\t\t\t\treject(e);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "1418778c1535db9c3485e7fb106ebc93", "score": "0.6693298", "text": "function fail() {\n return new Promise(function (resolve, reject) {\n reject(new Error(\"boom\"));\n });\n}", "title": "" }, { "docid": "9fcdd37bfd27fa0aeec291aae4978fef", "score": "0.66578805", "text": "function beforeReject(){\n return new Promise((resolve, reject) => {\n resolve();\n });\n}", "title": "" }, { "docid": "9b128c9753d6be98a1362b32ec873aaa", "score": "0.6644469", "text": "function throwPromise(fn) {\n return function () {\n var d = q.defer()\n var args = Array.prototype.slice.call(arguments, 0)\n process.nextTick(function () {\n d.reject(new Error(\"I'm done here\"))\n })\n return d.promise\n }\n }", "title": "" }, { "docid": "304483f21c68452db6d511e378d9561b", "score": "0.66037047", "text": "function beforeReject() {\n return new Promise((resolve) => {\n resolve();\n });\n}", "title": "" }, { "docid": "675c42ec3fe005a6d8afb2741542b446", "score": "0.65139586", "text": "function promiseFn() {\n return Promise.reject(value);\n }", "title": "" }, { "docid": "81dcd3d3ac2f3fa371472cc200689dc9", "score": "0.6357869", "text": "catch(onRejected) {\r\n return this.then(null, onRejected);\r\n }", "title": "" }, { "docid": "e271eabd4af4b7d2e3f6f3dc20847b4c", "score": "0.6351045", "text": "$wrapPromise(p, before, afterResolve, afterReject) {\n validateCallbacks(before, afterResolve, afterReject);\n\n before();\n return getPromise(p)\n .then((value) => {\n afterResolve({ value });\n return value;\n })\n .catch((reason) => {\n if (typeof afterReject === 'function') {\n return afterReject({ reason });\n }\n afterResolve({ reason });\n throw reason;\n });\n }", "title": "" }, { "docid": "3704ecaf0438014a3b1c040a3410d3f0", "score": "0.6301428", "text": "function timeoutPromise(delay) {\n return new Promise(function (resolve, reject) {\n setTimeout(function () {\n reject(\"Timeout!\");\n }, delay);\n });\n}", "title": "" }, { "docid": "d2e872feec255d878ace6def1b0f5970", "score": "0.62370753", "text": "async function sleep(timeout) { \n return new Promise((resolve, reject) => {\n setTimeout(function() {\n reject('hello world');\n }, timeout);\n }).then(function (mes) {\n console.log(mes);\n }).catch(function (mes) {\n return 'reject: ' + mes;\n });\n}", "title": "" }, { "docid": "8e33b68e3e98a7492afe60274431ddda", "score": "0.61901504", "text": "function trycatch(fn, reject) {\n var psd = Promise.PSD;\n return function () {\n var outerPSD = Promise.PSD; // Support Promise-specific data (PSD) in callback calls\n Promise.PSD = psd;\n try {\n fn.apply(this, arguments);\n } catch (e) {\n reject(e);\n } finally {\n Promise.PSD = outerPSD;\n }\n };\n }", "title": "" }, { "docid": "094e47dafaf26bcbf267bf258034b221", "score": "0.6176428", "text": "function reject(reason) {\n\t\t\treturn promise(function(_, reject) {\n\t\t\t\treject(reason);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "094e47dafaf26bcbf267bf258034b221", "score": "0.6176428", "text": "function reject(reason) {\n\t\t\treturn promise(function(_, reject) {\n\t\t\t\treject(reason);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "a58c5ea349f8951cc1711ab7751ab895", "score": "0.61525196", "text": "function getBaz(something, value) {\n // ...\n\n return Promise.reject(new Error('Something went wrong'));\n}", "title": "" }, { "docid": "7005f377936a211fa2d46b3e03ebbd19", "score": "0.6077427", "text": "function rejected(x) {\n\t\t\tvar self = new Promise(function (_, onRejected) {\n\t\t\t\ttry {\n\t\t\t\t\treturn typeof onRejected == 'function'\n\t\t\t\t\t\t? coerce(onRejected(x)) : self;\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn rejected(e);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn self;\n\t\t}", "title": "" }, { "docid": "7005f377936a211fa2d46b3e03ebbd19", "score": "0.6077427", "text": "function rejected(x) {\n\t\t\tvar self = new Promise(function (_, onRejected) {\n\t\t\t\ttry {\n\t\t\t\t\treturn typeof onRejected == 'function'\n\t\t\t\t\t\t? coerce(onRejected(x)) : self;\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn rejected(e);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn self;\n\t\t}", "title": "" }, { "docid": "acdc0b2f525ac5a6d9825fb6d4c50026", "score": "0.60768807", "text": "async after() {\n return Promise.resolve();\n }", "title": "" }, { "docid": "b8e3a01138a486df4ac217e687780591", "score": "0.6063718", "text": "function badPromise() {\n return new WinJS.Promise(function (comp, err, prog) {\n try {\n var newError = new Error(\"I broke my promise :(\");\n throw newError;\n\n // This won’t get called …\n comp();\n } catch (ex) {\n err(ex);\n }\n });\n }", "title": "" }, { "docid": "0f5a77f118041fea2cebfed0634ccdb5", "score": "0.6056823", "text": "catch(onRejected) {\n return this._promise.catch(wrapReject(this._span, onRejected));\n }", "title": "" }, { "docid": "327fb3f7637f1363004e89b7b2c382a6", "score": "0.60238975", "text": "_reject () {\n deferred.reject()\n }", "title": "" }, { "docid": "b0e73fcc383787a90ab1bf518c4de3f7", "score": "0.59921235", "text": "function syncReject(deferred, reason) {\n deferred.reject(reason);\n mockNextTick.flush();\n }", "title": "" }, { "docid": "3544e2ee948cbe2cfd53d5fe29154e88", "score": "0.5981283", "text": "function promiseToGiveItBackLater(value) {\n return new Promise((resolve, reject) => {\n if (value > 100) {\n reject('WRONG VALUE!')\n }\n resolve(value)\n })\n}", "title": "" }, { "docid": "9f59a42e3989140b6717318569a7ea83", "score": "0.5975698", "text": "function doSomething(msg){ \n return new Promise((resolve, reject) => {\n setTimeout(\n () => {\n try {\n throw new Error('bad error');\n console.log(msg);\n resolve();\n } catch(e) {\n reject(e);\n }\n }, \n 1000);\n }) \n}", "title": "" }, { "docid": "0abac3bc28a6f2569bf0804736c33128", "score": "0.59410787", "text": "function fail(reason) {\n var deferred = Q.defer();\n deferred.reject(new Error(reason));\n return deferred.promise;\n}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.59364474", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.59364474", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.59364474", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.59364474", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.59364474", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.59364474", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.59364474", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "d769ee28d34e7a005f31e63e1b7b28f0", "score": "0.59364474", "text": "function FailIfRejected() {}", "title": "" }, { "docid": "fcd7aaf55c0ad735a003c566c01d2d10", "score": "0.59283525", "text": "static reject(value) {\n const promise = new Promise_1().reject(value);\n return promise;\n }", "title": "" }, { "docid": "fd25935fbc84b77ee5d0eac5309260eb", "score": "0.5909991", "text": "function fireAndForgetPromise(fn) {\n fn().catch(err => {\n // Defer til later, so the error doesn't cause the promise to be rejected.\n setTimeout(() => {\n throw err;\n }, 0);\n });\n}", "title": "" }, { "docid": "fd25935fbc84b77ee5d0eac5309260eb", "score": "0.5909991", "text": "function fireAndForgetPromise(fn) {\n fn().catch(err => {\n // Defer til later, so the error doesn't cause the promise to be rejected.\n setTimeout(() => {\n throw err;\n }, 0);\n });\n}", "title": "" }, { "docid": "76dc2bc986c7daac1e7a0585f4cbe7b0", "score": "0.590962", "text": "function returnPromise() { \n if (errorStack.length > 0) {\n reject();\n } else {\n resolve();\n } \n }", "title": "" }, { "docid": "647ab52d139f18ecbb736167230611db", "score": "0.5818808", "text": "promiseTimeout(promise, timeout) {\n var error = new Error(\"Promise hanging, timed out\");\n return new Promise((resolve, reject) => {\n var rejectout = setTimeout(() => {\n reject(error);\n resolve = null;\n reject = null;\n }, timeout);\n promise.then(\n function() {\n clearTimeout(rejectout);\n if (resolve) resolve.apply(this, arguments);\n },\n function() {\n clearTimeout(rejectout);\n if (reject) reject.apply(this, arguments);\n }\n );\n });\n }", "title": "" }, { "docid": "647ab52d139f18ecbb736167230611db", "score": "0.5818808", "text": "promiseTimeout(promise, timeout) {\n var error = new Error(\"Promise hanging, timed out\");\n return new Promise((resolve, reject) => {\n var rejectout = setTimeout(() => {\n reject(error);\n resolve = null;\n reject = null;\n }, timeout);\n promise.then(\n function() {\n clearTimeout(rejectout);\n if (resolve) resolve.apply(this, arguments);\n },\n function() {\n clearTimeout(rejectout);\n if (reject) reject.apply(this, arguments);\n }\n );\n });\n }", "title": "" }, { "docid": "e799a9aed572b3de0089675e25efb4cf", "score": "0.57902586", "text": "function handlePromiseRejections($q, $log, lodash, promise) {\n var defaultFailureCallback = function (error) {\n if (undefined !== error && \"canceled\" !== error) {\n if (lodash.isPlainObject(error)) {\n if (!isAjaxError(error)) {\n $log.error(\"exception caught in promise: \" + JSON.stringify(error));\n }\n }\n else if (!lodash.isBoolean(error)) {\n $log.error(error);\n }\n }\n return $q.reject(error);\n };\n var oldThen = promise.then;\n promise.then = function (successCallback, _failureCallback, notifyCallback) {\n var failureCallback = _failureCallback ? _failureCallback : defaultFailureCallback;\n return oldThen.call(this, successCallback, failureCallback, notifyCallback);\n };\n return promise;\n}", "title": "" }, { "docid": "2bac5cee423c591cea23cbfb4121cd7b", "score": "0.5786182", "text": "function setPromiseTimeout(ms, promise) {\n\tvar timeout = new Promise(function(resolve, reject) {\n\t\tsetTimeout(reject, ms, 'promiseTO');\n\t});\n\n\treturn Promise.race([timeout, promise]);\n}", "title": "" }, { "docid": "1fd5ca0d54a6222e56875bcc85b5a197", "score": "0.577631", "text": "function reject (reason) {\n var defer = YAPI.defer();\n defer.reject(reason);\n return defer.promise;\n}", "title": "" }, { "docid": "d9d1ef52f2f6b7f60ff0a7b8db223f81", "score": "0.57659364", "text": "function RejectPromise(promise, reason) {\n console.assert(promise['[[PromiseState]]'] === 'pending');\n var reactions = promise['[[PromiseRejectReactions]]'];\n set_internal(promise, '[[PromiseResult]]', reason);\n set_internal(promise, '[[PromiseFulfillReactions]]', undefined);\n set_internal(promise, '[[PromiseRejectReactions]]', undefined);\n set_internal(promise, '[[PromiseState]]', 'rejected');\n return TriggerPromiseReactions(reactions, reason);\n }", "title": "" }, { "docid": "d9d1ef52f2f6b7f60ff0a7b8db223f81", "score": "0.57659364", "text": "function RejectPromise(promise, reason) {\n console.assert(promise['[[PromiseState]]'] === 'pending');\n var reactions = promise['[[PromiseRejectReactions]]'];\n set_internal(promise, '[[PromiseResult]]', reason);\n set_internal(promise, '[[PromiseFulfillReactions]]', undefined);\n set_internal(promise, '[[PromiseRejectReactions]]', undefined);\n set_internal(promise, '[[PromiseState]]', 'rejected');\n return TriggerPromiseReactions(reactions, reason);\n }", "title": "" }, { "docid": "e9b7bde04df7e8c0c3fcd8f5d00ceb96", "score": "0.5758716", "text": "function RejectablePromise2(deferred) {\n return new RejectablePromiseImpl(deferred);\n }", "title": "" }, { "docid": "d37156c1c057409e51db3db84379a252", "score": "0.5753076", "text": "function expectReject(promise, err) {\r\n return promise\r\n .then(() => {\r\n throw new Error('expected to reject');\r\n })\r\n .catch(actualErr => {\r\n if (!(actualErr instanceof err)) {\r\n console.error(actualErr.stack);\r\n chai_1.expect(actualErr).to.be.an.instanceof(err);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "688258c42778805f25b5c3d9ac204d8d", "score": "0.57405615", "text": "function promise2(param) {\n\n console.log('param', param)\n\n return Promise.resolve(2)\n .then(() => {\n // Block that can contain an error\n throw new Error('Fail 02...')\n })\n .catch(err => {\n // Pushing the error to the upper level\n throw new Error(`Error in promise2(): ${err.message}`)\n })\n}", "title": "" }, { "docid": "9d591f0af35151c142f96e7e2b6737cf", "score": "0.57287246", "text": "function bar()\n{\n \treturn new Promise(async (resolve, reject) => {\n try {\n await asyncExampleReject(1);\n await asyncExampleResolve(2);\n await asyncExampleResolve(3);\n resolve('everything ok');\n }\n catch\n {\n reject('general error');\n }\n });\n}", "title": "" }, { "docid": "380e19aad97d68173612944e2c619628", "score": "0.57250667", "text": "function unhandledPromiseRejection1() {\n Promise.resolve(true)\n .then(() => {\n throw new Error('error for unhandledPromiseRejection1')\n });\n}", "title": "" }, { "docid": "80d9c6eb4e2fc63ee72ad7f62d3dac28", "score": "0.5722401", "text": "function myPromise() {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(\"I kept my promise\");\n }, 5000);\n });\n}", "title": "" }, { "docid": "a6f34409d9755c9d29d061fb90b0fae9", "score": "0.5722066", "text": "function timeout(duration = 1000, reject = false) {\n return new Promise((res, rej) => {\n setTimeout(reject ? rej : res, duration);\n });\n}", "title": "" }, { "docid": "e7eeda4067d1c9a3e528e078d27f2696", "score": "0.572042", "text": "function sleep(ms){\n return new Promise((resolve, reject)=>{\n \n setTimeout(() =>{\n //resolve();\n reject(\"fatal\");\n\n },ms);\n });\n}", "title": "" }, { "docid": "4045939ea8aae6aebf8167ecadea8be3", "score": "0.5699338", "text": "function PromiseRejectFunction() {\n var F = function(reason) {\n console.assert(Type(F['[[Promise]]']) === 'object');\n var promise = F['[[Promise]]'];\n var alreadyResolved = F['[[AlreadyResolved]]'];\n if (alreadyResolved['[[value]]']) return undefined;\n set_internal(alreadyResolved, '[[value]]', true);\n return RejectPromise(promise, reason);\n };\n return F;\n }", "title": "" }, { "docid": "4045939ea8aae6aebf8167ecadea8be3", "score": "0.5699338", "text": "function PromiseRejectFunction() {\n var F = function(reason) {\n console.assert(Type(F['[[Promise]]']) === 'object');\n var promise = F['[[Promise]]'];\n var alreadyResolved = F['[[AlreadyResolved]]'];\n if (alreadyResolved['[[value]]']) return undefined;\n set_internal(alreadyResolved, '[[value]]', true);\n return RejectPromise(promise, reason);\n };\n return F;\n }", "title": "" }, { "docid": "a65ac000bde05ef15531835065fd588d", "score": "0.5697196", "text": "async function dothings() {\n // if done like this next line, catch can be removed from Promise in delay function\n // const p = await delay(1000).catch((err) => console.log(\"Error:\", err.message));\n // or can be done like this instead\n const p = await delay(1000);\n if (p) {\n console.log(\"Response from Promise:\", p);\n } else {\n console.log(\"Promise rejected\");\n }\n}", "title": "" }, { "docid": "bd64879124b8da2d07ed4d5bd01a9640", "score": "0.56884027", "text": "function func1() {\r\n return new Promise(function (resolve, reject) {\r\n\r\n setTimeout(() => {\r\n const error = true;\r\n if (!error) {\r\n console.log(\"your promises has been resolved\");\r\n resolve();\r\n }\r\n else {\r\n console.log(\"Sorry\");\r\n reject(\"not fullfilled!\");\r\n }\r\n }, 2000);\r\n\r\n })\r\n}", "title": "" }, { "docid": "e56c4697cd4c1f2fd8af28a59e428612", "score": "0.56747675", "text": "function promise2() {\n return Promise.resolve(2)\n .then(() => {\n // Block that can contain an error\n throw new Error('Fail 02...')\n })\n .catch(err => {\n // Pushing the error to the upper level\n throw new Error(`Error in promise2(): ${err.message}`)\n })\n}", "title": "" }, { "docid": "f6d88092b4a13d5128e7e38a79b8083f", "score": "0.5667172", "text": "function error(error){\r\n //param error berasal dari promise.reject()\r\n console.log(`Error : ${error}`);\r\n}", "title": "" }, { "docid": "91acaf5afcd68a711ca6cf2e70d04644", "score": "0.566143", "text": "function FailIfRejected() { }", "title": "" }, { "docid": "91acaf5afcd68a711ca6cf2e70d04644", "score": "0.566143", "text": "function FailIfRejected() { }", "title": "" }, { "docid": "d2f24f676f77fcde04017238e0df2282", "score": "0.56592846", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"error \" + error);\n}", "title": "" }, { "docid": "200a02452ff710128e1e8950979b3cc4", "score": "0.5639656", "text": "async function runAsync2() {\n return await Promise.reject(Error(\"Sorry...\"));\n}", "title": "" }, { "docid": "a0d92dd7dd4f2f1c096347e0977cd9da", "score": "0.5634467", "text": "function createErrorPromise(response) {\n console.log('creating error promise');\n if (response.status < 500) {\n console.log('not a server error');\n return response.json()\n .then(errorList => Promise.reject(errorList.length ? errorList.map(\n err => errorTranslate(err.tag)\n + (err.params ? err.params.join(', ') : '')\n ) : [\"Unknown error\"]));\n }\n else\n return Promise.reject([\"Unknown Error\"]);\n}", "title": "" }, { "docid": "5987f50b2bbeb9c608ac5b6730923d7d", "score": "0.562087", "text": "function promiseReject(reason) {\n\t\t\t\tif(!handlers) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(!handled) {\n\t\t\t\t\tonUnhandled(self, reason);\n\t\t\t\t}\n\n\t\t\t\tresolve(rejected(reason));\n\t\t\t}", "title": "" }, { "docid": "5987f50b2bbeb9c608ac5b6730923d7d", "score": "0.562087", "text": "function promiseReject(reason) {\n\t\t\t\tif(!handlers) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif(!handled) {\n\t\t\t\t\tonUnhandled(self, reason);\n\t\t\t\t}\n\n\t\t\t\tresolve(rejected(reason));\n\t\t\t}", "title": "" }, { "docid": "03f2dc6ed9ce2a9d8930045fdd1c08f0", "score": "0.56167734", "text": "_reject(reject) {\n return (reason) => {\n reject(reason);\n process.nextTick(() => {\n this.emit('error', new error_1.CrtError(reason));\n });\n };\n }", "title": "" }, { "docid": "013e3f049a541f58f0a6064396e55a2b", "score": "0.5613792", "text": "call(promise) {\n\t\treturn promise.catch( (error) => {\n \t if(error.hasOwnProperty('errors') && error.errors['errore']) {\n \t \tlet coopError = error.errors.errore[0];\n \t \treturn new Promise((resolve,reject)=>{reject(new Error({code: coopError.codice, msg: coopError.messaggio, source: coopError.source}))});\n \t }\n \t else {\n \t \treturn new Promise((resolve,reject)=>{reject(new Error({code: 'Exception-00', msg: error.errors.message, source: error.errors.stack}))});\n \t }\n \t});\n\t}", "title": "" }, { "docid": "70639c24ead8cfdb31135c55b3e60ba9", "score": "0.5607063", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "70639c24ead8cfdb31135c55b3e60ba9", "score": "0.5607063", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "565e95baaac2f8cd0edeab8db26d4d80", "score": "0.5604865", "text": "function resolvePromise(value) {\n resolve(value);\n Cypress.off(\"fail\", rejectPromise);\n }", "title": "" }, { "docid": "f5fb9b7424a32be6c44da1da8e7f334c", "score": "0.5601494", "text": "function myPromiseFn(arg) {\n let promise = new Promise((resolve, reject) => {\n myAsyncFn(arg, function (err, result) {\n err ? reject(err) : resolve(result);\n });\n });\n return promise;\n}", "title": "" }, { "docid": "f1e7fc4e492d984508688e342cf19d69", "score": "0.5594503", "text": "function sleep (timeout) {\n const promise = new Promise((resolve, reject) => { // resolve: Function, reject: Function\n if (timeout > 10000) {\n reject(new Error('Rejected promise'))\n }\n setTimeout(() => {\n resolve('Successefully promise')\n }, timeout)\n })\n\n return promise\n}", "title": "" }, { "docid": "c16bc634cd885010544c777765878cfb", "score": "0.5573298", "text": "function r(e){try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}}", "title": "" }, { "docid": "e7a61ab3e2423707bc8e24c36b7ad79f", "score": "0.55716527", "text": "function timeout(ms, promise) {\r\n return new Promise(function(resolve, reject) {\r\n setTimeout(function() {\r\n reject(new Error(\"timeout\"))\r\n }, ms);\r\n promise.then(resolve, reject)\r\n })\r\n}", "title": "" }, { "docid": "b8d1bab3fa38d23e9a5056d60c13b8d0", "score": "0.5567631", "text": "function promiseRejected(err) {\n\t console.error(\"Promise rejected: \", err.message);\n\t }", "title": "" }, { "docid": "d341fc0a6e5e56a8aafc18ccc1a03de4", "score": "0.5564053", "text": "function reject(reason){\n resolve(false,reason);\n }", "title": "" }, { "docid": "d341fc0a6e5e56a8aafc18ccc1a03de4", "score": "0.5564053", "text": "function reject(reason){\n resolve(false,reason);\n }", "title": "" }, { "docid": "2e4ce985fce9962061c7d5104bbe925a", "score": "0.55585176", "text": "function createAbortablePromise(buildPromise, options) {\n const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {};\n return new Promise((resolve, reject) => {\n function rejectOnAbort() {\n reject(new abortController.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : \"The operation was aborted.\"));\n }\n function removeListeners() {\n abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener(\"abort\", onAbort);\n }\n function onAbort() {\n cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort();\n removeListeners();\n rejectOnAbort();\n }\n if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) {\n return rejectOnAbort();\n }\n try {\n buildPromise((x) => {\n removeListeners();\n resolve(x);\n }, (x) => {\n removeListeners();\n reject(x);\n });\n }\n catch (err) {\n reject(err);\n }\n abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener(\"abort\", onAbort);\n });\n}", "title": "" }, { "docid": "96cf85d3c5fe3719b776d98565aa9783", "score": "0.55522215", "text": "async function assertFailure (promise) {\n try {\n await promise;\n } catch (error) {\n return error;\n }\n expect.fail(\"Expected an exception but none was received\");\n}", "title": "" }, { "docid": "99d193084a3e10cefafdde7fc548a3ac", "score": "0.5544825", "text": "reject (rej, gen = false) {\n return ((this._reject && !gen) ? this._reject : ((rej) => { return Promise.reject(rej) })).call(this, rej);\n }", "title": "" }, { "docid": "cd8f03d0a40e234fc548c85f4f0d1235", "score": "0.55445313", "text": "function do_thing_promise(timer){\n\n // this lets us set of the function works, or fails. Used to demo\n // how error handling works. Flick it to false to fail. \n var it_works = true;\n\n return new Promise(function(resolve, reject){\n\n if(it_works){\n\n setTimeout( () => {\n resolve('PROMISE: do a thing completed! :-)');\n },timer);\n\n } else {\n\n setTimeout( () => {\n reject('PROMISE: do a thing failed! :-(');\n },timer);\n\n }\n\n });\n}", "title": "" }, { "docid": "b428d9d6f1622264cdca5677939afecc", "score": "0.55436295", "text": "function promiseRejected(err) {\n\t\t console.error(\"Promise rejected: \", err.message);\n\t\t }", "title": "" }, { "docid": "8c36f82dffe496eac4574a42d42635d2", "score": "0.55293506", "text": "async function usingPromiseCatch() {\n let resolveValue = await asyncFunction('thing that will fail');\n}", "title": "" }, { "docid": "84b1eedefc677b8c077b187f0edef815", "score": "0.5529047", "text": "function afterConfirm() {\n return new Promise((resolve) => {\n resolve();\n });\n}", "title": "" }, { "docid": "18c0e1d8ec3554b596079c5ed6eb2f29", "score": "0.55280936", "text": "async function test(){\n let p = new Promise((resolve,reject)=>{\n setTimeout(()=>{\n reject('ERROR!!!')\n },2000)\n })\n try{\n console.log('ddd',await p)\n }\n catch(e){\n console.log('sss',e)\n }\n console.log('AFTER DONE!!!')\n}", "title": "" }, { "docid": "2b484446c0e22f93ec8cb22130f62b02", "score": "0.55130655", "text": "function getPromise (resolveAfter) {\n return new Promise (function(resolve) {\n setTimeout(() => {\n resolve(\"I am called asynchronously\");\n }, resolveAfter * 1000);\n });\n}", "title": "" }, { "docid": "6fe5ff502bffe8e3a6ffce80156bd686", "score": "0.5507251", "text": "function error(error) {\r\n // Parameter error berasal dari Promise.reject()\r\n console.log(\"Error : \" + error);\r\n}", "title": "" }, { "docid": "5ddd36bf79372f9330c5d987eec22dca", "score": "0.5505109", "text": "defer(fn, time = 0) {\n return this.promise((resolve, reject) => {\n setTimeout(() => {\n fn(resolve, reject);\n }, time);\n });\n }", "title": "" }, { "docid": "72ceb6f4484b5ab2bd484c4c54da88af", "score": "0.54999197", "text": "function failOnly(cancelP) {\n return Q(cancelP).then(function(cancel) { throw cancel; });\n }", "title": "" }, { "docid": "6c7d661bd410392a98aeb1583c7e2f5a", "score": "0.5476777", "text": "function expectFailure(message, promise)\n{\n debug(\"\\n\" + message);\n\n return promise.then(function(result) {\n debug(\"FAILED: Expected failure but got: \" + result);\n\n // Re-throw the error.\n throw new Error(\"Test FAILED: \" + message);\n }, function(error) {\n // Expected to fail, so consider this a success.\n debug(\"SUCCESS (rejected): \" + error.toString());\n return error;\n });\n}", "title": "" }, { "docid": "e603385e7ed7b41a9b552b8cb354af2f", "score": "0.5469444", "text": "function formTimeout(deferred) {\n deferred.reject('Timeout saving image to server');\n}", "title": "" }, { "docid": "25758b9c2bf44de952e996e98326800e", "score": "0.5467119", "text": "resolve() {\n if (typeof this.after === 'function') {\n this.state = states.AFTER;\n const afterPromise = this.after();\n if (promise.isPromise(afterPromise) === true) {\n afterPromise.then(() => {\n this.state = states.RESOLVED;\n this[resolveSym](this);\n return null;\n }).catch(this.reject);\n return;\n }\n }\n this.state = states.RESOLVED;\n this[resolveSym](this);\n }", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.5459474", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.5459474", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.5459474", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.5459474", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.5459474", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" }, { "docid": "fd06bcf2d88331b5d04bfbc31650caf2", "score": "0.5459474", "text": "function error(error) {\n // Parameter error berasal dari Promise.reject()\n console.log(\"Error : \" + error);\n}", "title": "" } ]
94b75371b941bd0751ccc8b1c7b24c08
END FORMS & VALIDATION // // START CONTACT US
[ { "docid": "d5e24c06953491ddb2ee8fe9ac88f828", "score": "0.0", "text": "function contactus(button) {\n if (button.parents(\"form\").find(\".not-valid\").length) {\n return;\n }\n const url = \"/contactus\";\n const _token = $('input[name=\"_token\"]').val();\n const purpose = $(\"#purpose option:selected\").val();\n const subject = $('input[name=\"subject\"]').val();\n const name = $('input[name=\"namecontact\"]').val();\n const email = $('input[name=\"emailcontact\"]').val();\n const details = $(\"#details\").val();\n const phone = $('input[name=\"phonecontact\"]').val();\n const robotChech = grecaptcha.getResponse(contactCaptcha);\n\n var form_data = new FormData();\n form_data.append(\"purpose\", purpose);\n form_data.append(\"subject\", subject);\n form_data.append(\"name\", name);\n form_data.append(\"email\", email);\n form_data.append(\"details\", details);\n form_data.append(\"phonecontact\", phone);\n form_data.append(\"g-recaptcha-response\", robotChech);\n $.ajax({\n headers: {\n \"X-CSRF-TOKEN\": _token\n },\n type: \"POST\",\n url: url,\n data: form_data,\n contentType: false,\n cache: false,\n processData: false,\n success: function(data) {\n console.log(data);\n if (data.success) {\n $(\"#contact-us-form .reset-btn\").click();\n // $('#contact-success').removeClass('d-none');\n // setTimeout(function () {\n // $('#contact-success').addClass('d-none');\n // }, 3000);\n $(\"#thanksFormModal\").modal(\"show\");\n grecaptcha.reset(contactCaptcha);\n setTimeout(function() {\n $(\"#thanksFormModal\").modal(\"hide\");\n }, 3000);\n }\n },\n error: function(data) {\n console.log(\"error\");\n }\n });\n}", "title": "" } ]
[ { "docid": "c56542e5fe88f8604b863f6bd023686a", "score": "0.61774725", "text": "function valContactNumber() {\n \n \n /* FETCH REQUIRED DATA */\n var contactNumber = document.getElementById(\"contactNumber\").value;\n \n \n /* CHECK IF CONTACT NUMBER FIELD IS BLANK */\n if (contactNumber == \"\") {\n \n \n /* DISPLAY ERROR */\n document.getElementById(\"error-9\").innerHTML = '<b>Please enter your Contact Number</b>';\n \n \n } else {\n \n \n /* SET CONTACT NUMBER REGULAR EXPRESSION */\n var phonePattern = /^(?:\\W*\\d){11}\\W*$/;\n \n \n /* CHECK IF EMAIL ADDRESS COMPLIES WITH EMAIL ADDRESS REGULAR EXPRESSSION */\n if (phonePattern.test(contactNumber)) {\n \n \n /* ERASE ERROR MESSAGE */\n document.getElementById(\"error-9\").innerHTML = '';\n \n \n /* CONTINUE WITH QUOTATION */\n $(\"#quote-slide-9\").hide();\n $(\"#quote-slide-10\").show();\n \n \n } else {\n \n \n /* DISPLAY ERROR */\n document.getElementById(\"error-9\").innerHTML = '<b>Please enter a Valid Contact Number</b>';\n \n \n }\n }\n}", "title": "" }, { "docid": "2110f611ce1d8bac9ee22af32cdbf6db", "score": "0.6177241", "text": "function isValidCustomerInformation(formName)\n{\n\tvar str;\n\tvar ch;\n\tvar frm = getForm(formName);\n\tstr = frm.SEQ.value\n\n\tfor (j = 0; j < frm.SEQ.value.length; j++)\n\t{\n\t\tch = str.charAt(j);\n\t\tswitch (ch)\n\t\t{\n\t\t\tcase \"U\":\n\t\t\t\t// Validate user name\n\t\t\t\tif (!isUserName(frm.USERNAME.value))\n\t\t\t\t{\n\t\t\t\t\talert(L10N_INVALID_USER_NAME);\n\t\t\t\t\tfrm.USERNAME.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.USER_NAME_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.USERNAME.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_USER_NAME_REQD);\n\t\t\t\t\t\tfrm.USERNAME.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (frm.USERNAME.value.length > 200)\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_USER_NAME_LENGTH_INVALID);\n\t\t\t\t\t\tfrm.USERNAME.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"F\":\n\t\t\t\t// Validate first name\n\t\t\t\tif (frm.FIRST_NAME.value.length > 124)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_FIRST_NAME_LENGTH_INVALID);\n\t\t\t\t\tfrm.FIRST_NAME.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.FIRST_NAME_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.FIRST_NAME.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_FIRST_NAME_REQD);\n\t\t\t\t\t\tfrm.FIRST_NAME.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"W\":\n\t\t\t\t// Validate password\n\t\t\t\tif (frm.PASSWORD_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.PASSWORD.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_PASSWORD_REQD);\n\t\t\t\t\t\tfrm.PASSWORD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (frm.PASSWORD.value.length < 6)\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_PASSWORD_LENGTH_INVALID1);\n\t\t\t\t\t\tfrm.PASSWORD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (frm.PASSWORD.value.length > 255)\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_PASSWORD_LENGTH_INVALID2);\n\t\t\t\t\t\tfrm.PASSWORD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isEmptyOrSpace(frm.RETYPEPASSWORD.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_RE_TYPE_PASSWORD_REQD);\n\t\t\t\t\t\tfrm.RETYPEPASSWORD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (frm.RETYPEPASSWORD.value != frm.PASSWORD.value)\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_PASSWORD_DO_NOT_MATCH);\n\t\t\t\t\t\tfrm.RETYPEPASSWORD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (frm.PASSWORD.value == \"******\" && frm.RETYPEPASSWORD.value == \"******\")\n\t\t\t\t\t{\n\t\t\t\t\t\tfrm.PASSWORD.value = frm.PASSWORDFROMDB.value;\n\t\t\t\t\t\tfrm.RETYPEPASSWORD.value = frm.PASSWORDFROMDB.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"M\":\n\t\t\t\t// Validate middle name\n\t\t\t\tif (frm.MIDDLE_NAME.value.length > 124)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_MIDDLE_NAME_LENGTH_INVALID);\n\t\t\t\t\tfrm.MIDDLE_NAME.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (frm.MIDDLE_NAME_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.MIDDLE_NAME.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_MIDDLE_NAME_REQD);\n\t\t\t\t\t\tfrm.MIDDLE_NAME.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"L\":\n\t\t\t\t// Validate last name\n\t\t\t\tif (frm.LAST_NAME.value.length > 124)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_LAST_NAME_LENGTH_INVALID);\n\t\t\t\t\tfrm.LAST_NAME.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (frm.LAST_NAME_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.LAST_NAME.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_LAST_NAME_REQD);\n\t\t\t\t\t\tfrm.LAST_NAME.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"o\":\n\t\t\t\t// Validate eGain Support number\n\t\t\t\tif (isEmptyOrSpace(frm.SUPPORT_ACCOUNT_NUMBER.value))\n\t\t\t\t{\n\t\t\t\t\talert(L10N_SUPPORT_ACCOUNT_NUMBER_REQD);\n\t\t\t\t\tdocument.signup.SUPPORT_ACCOUNT_NUMBER.focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"N\":\n\t\t\t\t// Validate Company name\n\t\t\t\tif (isEmptyOrSpace(frm.COMPANY_NAME.value))\n\t\t\t\t{\n\t\t\t\t\talert(L10N_COMPANY_NAME_REQD);\n\t\t\t\t\tdocument.signup.COMPANY_NAME.focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"E\":\n\t\t\t\t// Validate e-mail address\n\t\t\t\tif (frm.EMAIL_ADDRESS.value.length > 200)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_EMAIL_ADDRESS_LENGTH_INVALID);\n\t\t\t\t\tfrm.EMAIL_ADDRESS.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (!isEmailAddr(frm.EMAIL_ADDRESS.value))\n\t\t\t\t{\n\t\t\t\t\talert(L10N_INVALID_EMAIL);\n\t\t\t\t\tfrm.EMAIL_ADDRESS.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.EMAIL_ADDRESS_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.EMAIL_ADDRESS.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_INVALID_EMAIL);\n\t\t\t\t\t\tfrm.EMAIL_ADDRESS.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"Z\":\n\t\t\t\t// Validate zip code\n\t\t\t\tif (frm.ZIP.value.length > 50)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_ZIP_LENGTH_INVALID);\n\t\t\t\t\tfrm.ZIP.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.ZIP_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.ZIP.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_ZIP_REQD);\n\t\t\t\t\t\tfrm.ZIP.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"G\":\n\t\t\t\t// Validate gender\n\t\t\t\tif (frm.GENDER_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.GENDER.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_GENDER_REQD);\n\t\t\t\t\t\tfrm.GENDER.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"A\":\n\t\t\t\t// Validate marital status\n\t\t\t\tif (frm.MARITAL_STATUS_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.MARITAL_STATUS.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_MARITAL_STATUS_REQD);\n\t\t\t\t\t\tfrm.MARITAL_STATUS.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"D\":\n\t\t\t\t// Validate birth date\n\t\t\t\tif (frm.DATE_OF_BIRTH_MM.value.length > 0)\n\t\t\t\t{\n\t\t\t\t\tif (!isNumeric(frm.DATE_OF_BIRTH_MM.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_INVALID_DATE_OF_BIRTH_MM);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_MM.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((frm.DATE_OF_BIRTH_MM.value > 12) || (frm.DATE_OF_BIRTH_MM.value < 1))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_MM_LENGTH_INVALID);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_MM.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tfrm.DATE_OF_BIRTH_MM_HD.value = 1;\n\t\t\t\t}\n\n\t\t\t\t// Day of Date of Birth validation\n\t\t\t\tif (frm.DATE_OF_BIRTH_DD.value.length > 0)\n\t\t\t\t{\n\t\t\t\t\tif (!isNumeric(frm.DATE_OF_BIRTH_DD.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_INVALID_DATE_OF_BIRTH_DD);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_DD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Validate month and days combination\n\t\t\t\t\tif ((frm.DATE_OF_BIRTH_MM.value == 4 || frm.DATE_OF_BIRTH_MM.value == 6\n\t\t\t\t\t\t\t\t\t|| frm.DATE_OF_BIRTH_MM.value == 9 || frm.DATE_OF_BIRTH_MM.value == 11)\n\t\t\t\t\t\t\t\t\t&& ((frm.DATE_OF_BIRTH_DD.value >= 31) || (frm.DATE_OF_BIRTH_DD.value < 1)))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_DD_LENGTH_INVALID1);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_DD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((frm.DATE_OF_BIRTH_MM.value == 1 || frm.DATE_OF_BIRTH_MM.value == 3\n\t\t\t\t\t\t\t\t\t|| frm.DATE_OF_BIRTH_MM.value == 5 || frm.DATE_OF_BIRTH_MM.value == 7\n\t\t\t\t\t\t\t\t\t|| frm.DATE_OF_BIRTH_MM.value == 8 || frm.DATE_OF_BIRTH_MM.value == 10 || frm.DATE_OF_BIRTH_MM.value == 12)\n\t\t\t\t\t\t\t\t\t&& ((frm.DATE_OF_BIRTH_DD.value >= 32) || (frm.DATE_OF_BIRTH_DD.value < 1)))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_DD_LENGTH_INVALID);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_DD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tfrm.DATE_OF_BIRTH_MM_HD.value = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Validate year\n\t\t\t\tif (frm.DATE_OF_BIRTH_YY.value.length > 0)\n\t\t\t\t{\n\t\t\t\t\tif (!isNumeric(frm.DATE_OF_BIRTH_YY.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_INVALID_DATE_OF_BIRTH_YY);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_YY.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((frm.DATE_OF_BIRTH_YY.value < 1753) || (frm.DATE_OF_BIRTH_YY.value > 9999))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_YY_LENGTH_INVALID);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_YY.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Validate day and month combinations\n\t\t\t\t\tif ((frm.DATE_OF_BIRTH_MM.value == 2) && ((frm.DATE_OF_BIRTH_YY.value) % 4 == 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((frm.DATE_OF_BIRTH_DD.value >= 30) || (frm.DATE_OF_BIRTH_DD.value < 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// alert enter date from 1 to 29\n\t\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_DD_LENGTH_INVALID3);\n\t\t\t\t\t\t\tfrm.DATE_OF_BIRTH_DD.focus();\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\telse if ((frm.DATE_OF_BIRTH_MM.value == 2) && ((frm.DATE_OF_BIRTH_YY.value) % 4 != 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((frm.DATE_OF_BIRTH_DD.value >= 29) || (frm.DATE_OF_BIRTH_DD.value < 1))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// alert enter date from 1 to 28\n\t\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_DD_LENGTH_INVALID2);\n\t\t\t\t\t\t\tfrm.DATE_OF_BIRTH_DD.focus();\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\t\n\t\t\t\t\tfrm.DATE_OF_BIRTH_MM_HD.value = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Validate month of birth\n\t\t\t\tif (frm.DATE_OF_BIRTH_MM_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.DATE_OF_BIRTH_MM.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_MM_REQD);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_MM.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Validate day\n\t\t\t\t\tif (isEmptyOrSpace(frm.DATE_OF_BIRTH_DD.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_DD_REQD);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_DD.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Validate year\n\t\t\t\t\tif (isEmptyOrSpace(frm.DATE_OF_BIRTH_YY.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_DATE_OF_BIRTH_YY_REQD);\n\t\t\t\t\t\tfrm.DATE_OF_BIRTH_YY.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"R\":\n\t\t\t\t// Validate address line 1\n\t\t\t\tif (frm.ADDRESSLINE1.value.length > 50)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_ADDRESSLINE1_LENGTH_INVALID);\n\t\t\t\t\tfrm.ADDRESSLINE1.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.ADDRESSLINE1_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.ADDRESSLINE1.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_ADDRESSLINE1_REQD);\n\t\t\t\t\t\tfrm.ADDRESSLINE1.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"I\":\n\t\t\t\t// Validate address line 2\n\t\t\t\tif (frm.ADDRESSLINE2.value.length > 50)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_ADDRESSLINE2_LENGTH_INVALID);\n\t\t\t\t\tfrm.ADDRESSLINE2.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.ADDRESSLINE2_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.ADDRESSLINE2.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_ADDRESSLINE2_REQD);\n\t\t\t\t\t\tfrm.ADDRESSLINE2.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"C\":\n\t\t\t\t// Validate city\n\t\t\t\tif (frm.CITY.value.length > 50)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_CITY_LENGTH_INVALID);\n\t\t\t\t\tfrm.CITY.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.CITY_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.CITY.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_CITY_REQD);\n\t\t\t\t\t\tfrm.CITY.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"T\":\n\t\t\t\t// Validate state\n\t\t\t\tif (frm.STATE.value.length > 50)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_STATE_LENGTH_INVALID);\n\t\t\t\t\tfrm.STATE.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.STATE_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.STATE.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_STATE_REQD);\n\t\t\t\t\t\tfrm.STATE.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"Y\":\n\t\t\t\t// Validate country\n\t\t\t\tif (frm.COUNTRY1.value.length > 50)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_COUNTRY1_LENGTH_INVALID);\n\t\t\t\t\tfrm.COUNTRY1.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.COUNTRY1_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.COUNTRY1.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_COUNTRY1_REQD);\n\t\t\t\t\t\tfrm.COUNTRY1.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"P\":\n\t\t\t\t// Validate phone number\n\t\t\t\tif (frm.PHONE_NUMBER.value.length > 40)\n\t\t\t\t{\n\t\t\t\t\talert(L10N_PHONE_NUMBER_LENGTH_INVALID);\n\t\t\t\t\tfrm.PHONE_NUMBER.focus();\n\t\t\t\t\treturn (false);\n\t\t\t\t}\n\n\t\t\t\tif (frm.PHONE_NUMBER_HD.value != 0)\n\t\t\t\t{\n\t\t\t\t\tif (isEmptyOrSpace(frm.PHONE_NUMBER.value))\n\t\t\t\t\t{\n\t\t\t\t\t\talert(L10N_PHONE_NUMBER_REQD);\n\t\t\t\t\t\tfrm.PHONE_NUMBER.focus();\n\t\t\t\t\t\treturn (false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn (true);\n}", "title": "" }, { "docid": "57fe1d75047f443f7498690328e97e04", "score": "0.6162156", "text": "function validateForm(doc)\n{\n\n //prevent submission of empty forms\n if (blankForm())\n\t{return false;}\n/*---------------------------------------------\n Validate address field\n ----------------------------------------------*/\n var physical_address = document.getElementsByClassName('physical_address')[0];\n var code = document.getElementsByClassName('code')[0];\n var city = document.getElementsByClassName('city')[0];\n var school_number = document.getElementsByClassName('school_number')[0];\n physical_address.style.background = 'White';\n code.style.background = 'White';\n city.style.background = 'White';\n school_number.style.background = 'White';\n \n validity = validate_address(physical_address.value, city.value, code.value, school_number.value)\n if (validity!=0) {\n\t window.scrollTo(100,0);\n\t switch(validity){\n case -1:code.style.background = 'Yellow'; break;\n case 1:physical_address.style.background = 'Yellow'; break;\n case 2:city.style.background = 'Yellow'; break;\n case 3:school_number.style.background = 'Yellow'; break;\n\t }\n\t return false; //Error\n\t}\n \n\n/**********************\n*** EMAIL VALIDATION***\n***********************/\n\n /*---------------------------------------------\n Validate responsible teacher\n ----------------------------------------------*/\n\tvar resp_firstname = document.getElementsByClassName('resp_firstname');\t\t\t// 10 invigilator fields\n\tvar resp_surname = document.getElementsByClassName('resp_surname');\n\tvar resp_phone_primary = document.getElementsByClassName('resp_phone_primary');\n\tvar resp_mail = document.getElementsByClassName('resp_mail');\n\tvar resp_phone_alt = document.getElementsByClassName('resp_phone_alt');\n\t\n\tvalidity = validate_invigilator(resp_firstname[0].value, resp_surname[0].value, resp_phone_primary[0].value, resp_phone_alt[0].value, resp_mail[0].value);\n\n\n resp_firstname[0].style.background = 'White'; \n resp_surname[0].style.background = 'White'; \n resp_phone_primary[0].style.background = 'White'; \n resp_phone_alt[0].style.background = 'White'; \n resp_mail[0].style.background = 'White'; \n\n\n\t\n\tif (validity!=0) {\n\t window.scrollTo(100,500);\n\t switch(validity){\n case -1: alert(\"Responsible teacher field must be completed\"); break;\n case 1:resp_firstname[0].style.background = 'Yellow'; break;\n case 2:resp_surname[0].style.background = 'Yellow'; break;\n case 3:resp_phone_primary[0].style.background = 'Yellow'; break;\n case 4:resp_phone_alt[0].style.background = 'Yellow'; break;\n case 5:resp_mail[0].style.background = 'Yellow'; break;\n\t }\n\t return false; //Error\n\t}\n \n /*---------------------------------------------\n Validate invigilators\n ----------------------------------------------*/\n\tvar invig_firstname = document.getElementsByClassName('invig_firstname');\t\t\t// 10 invigilator fields\n\tvar invig_surname = document.getElementsByClassName('invig_surname');\n\tvar invig_phone_primary = document.getElementsByClassName('invig_phone_primary');\n\tvar invig_mail = document.getElementsByClassName('invig_mail');\n\tvar invig_phone_alt = document.getElementsByClassName('invig_phone_alt');\n\t\n\tvar num_invigilators =0;\n\tif(invig_firstname){\n for(var i = 0; i < 10; ++i)\n {\n validity = validate_invigilator(invig_firstname[i].value, invig_surname[i].value, invig_phone_primary[i].value, invig_phone_alt[i].value, invig_mail[i].value);\n \n invig_firstname[i].style.background = 'White'; \n invig_surname[i].style.background = 'White'; \n invig_phone_primary[i].style.background = 'White'; \n invig_phone_alt[i].style.background = 'White';\n invig_mail[i].style.background = 'White'; \n \n if (validity > 0) //Any error condition\n {\n window.scrollTo(100,500);\n switch(validity){\n case 1:invig_firstname[i].style.background = 'Yellow'; break;\n case 2:invig_surname[i].style.background = 'Yellow'; break;\n case 3:invig_phone_primary[i].style.background = 'Yellow'; break;\n case 4:invig_phone_alt[i].style.background = 'Yellow'; break;\n case 5:invig_mail[i].style.background = 'Yellow'; break;\n }\n return false;\n }\n else if (validity==0) num_invigilators+=1; //else full and valid field\n }\n }\n /*---------------------------------------------\n Validate students\n ----------------------------------------------*/\n\tvar st_firstname = document.getElementsByClassName('st_firstname');\n\tvar st_surname = document.getElementsByClassName('st_surname');\n\tvar pairs = document.getElementsByClassName('pairs');\n\n\tvar count = 0; \n\n\t// count the number of students\t\n\tfor (var j=0; j<st_firstname.length; j++)\n\t{\n\t student_valid = validate_student(st_firstname[j].value, st_surname[j].value);\n st_firstname[j].style.background = 'White';\n\t st_surname[j].style.background = 'White';\n\t \n\t if (student_valid>0){ //error\n\t switch(student_valid){\n\t case 1: st_firstname[j].style.background = 'Yellow'; break;\n\t case 2: st_surname[j].style.background = 'Yellow'; break;\n\t }\n\t return false;\n\t }\n\t if (student_valid == 0) {\n\t st_firstname[j].style.background = 'White';\n\t st_surname[j].style.background = 'White';\n\t count += 1;\n\t }\n\t}\n\t\n\tfor (var k=0; k<pairs.length; k++)\n\t{\n\t if (pairs[k].options[pairs[k].selectedIndex].value > 10){\n\t alert(\"Please ensure that the number of pairs for each grade is between 0 and 10 (inclusive.)\");\n\t window.scrollTo(100,500);\n return false;\n }\n\t count += pairs[k].options[pairs[k].selectedIndex].value*2;\n\t }\n\t\n\t// prompt user to add invigilator\n maxStudents = (pairs[0].length-1)*10 + st_firstname.length;\n\tif (count == maxStudents && num_invigilators < 2)\n\t{\n\tinvig_firstname[1].style.background = 'Yellow';\n invig_surname[1].style.background = 'Yellow';\n invig_phone_primary[1].style.background = 'Yellow';\n invig_mail[1].style.background = 'Yellow'; \n\n\twindow.scrollTo(100,500);\n alert(\"Reminder: A minimum of two invigilators are required for 75 students.\");\n return false;\n }\n \n if (count == 0){\n alert(\"Note: you have not signed up any students (pairs or individuals). Your form will be submitted. You may return to this page to sign up students at a later date.\\n\");\n }\n\n/*********************\n*** ALL TESTS PAST ***\n*********************/\t\n return true;\n}", "title": "" }, { "docid": "c16b80ddc78ff55218b0797fa9ec9310", "score": "0.6081947", "text": "function valider() {\n if (document.contact.first_name.value == \"\") {\n alert(\"Please enter your first name !\");\n document.contact.first_name.focus();\n valid = false;\n return valid;\n }\n if (document.contact.last_name.value == \"\") {\n alert(\"Please enter your name !\");\n document.contact.last_name.focus();\n valid = false;\n return valid;\n }\n\n if (document.contact.email.value == \"\") {\n alert(\"Please enter your email address!\");\n document.contact.email.focus();\n valid = false;\n return valid;\n }\n\n if (document.contact.telephone.value == \"\") {\n alert(\"Please enter your phone number !\");\n document.contact.telephone.focus();\n valid = false;\n return valid;\n }\n if (document.contact.comments.value == \"\") {\n alert(\"Please enter your comment !\");\n document.contact.comments.focus();\n valid = false;\n return valid;\n }\n}", "title": "" }, { "docid": "40e2d8dd667d5ae761554e9078dcf9cb", "score": "0.605328", "text": "function ccRegistrationValidation()\n{\n if(document.ccRegistrationForm.webSite.value!=\"\")\n\t {\n if(!isURL(document.ccRegistrationForm.webSite.value)){\n document.ccRegistrationForm.webSite.focus();\n return false;\n }\n }\n if(document.ccRegistrationForm.complexName.value==\"\")\n\t {\n\t alert(\"Pls Enter Complex Name \");\n\t document.ccRegistrationForm.complexName.focus();\n\t return false;\n\t }else if(document.ccRegistrationForm.complexType.selectedIndex==0)\n\t {\n\t alert(\"Please Select Complex Type\");\n\t\tccRegistrationForm.complexType.focus();\n\t\treturn false;\n\t }\n\t else if(document.ccRegistrationForm.ccAddress.value==\"\")\n\t {\n\t alert(\"Pls Enter Office Address\");\n\t document.ccRegistrationForm.ccAddress.focus();\n\t return false;\n\t }else if(document.getElementById('ccAddress').value.length >=254)\n\t {\n\t alert(\"Your Address Length Must Be Less Then 255 Charcater\");\n\t document.getElementById('ccAddress').focus();\n\t return false;\n\t }else if(document.ccRegistrationForm.countryId.value==\"0\")\n\t {\n\t alert(\"Pls Select the Country \");\n\t document.ccRegistrationForm.countryId.focus();\n\t return false;\n\t }\n\t else if(document.ccRegistrationForm.countryId.value!=\"0\" && (document.ccRegistrationForm.stateId.value==\"\" || document.ccRegistrationForm.stateId.value==\"0\"))\n\t {\n\t alert(\"Pls Select the State \");\n\t document.ccRegistrationForm.stateId.focus();\n\t return false;\n\t }\n\t else if(document.ccRegistrationForm.stateId.value !=\"0\" && (document.ccRegistrationForm.districtId.value==\"\"||document.ccRegistrationForm.districtId.value==\"0\"))\n\t {\n\n\t alert(\"Pls Select the District \");\n\t document.ccRegistrationForm.districtId.focus();\n\t return false;\n\t }\n\t else if(document.ccRegistrationForm.districtId.value!=\"0\" && (document.ccRegistrationForm.cityId.value==\"\"||document.ccRegistrationForm.cityId.value==\"0\"))\n\t {\n\t alert(\"Pls Select the City \");\n\t document.ccRegistrationForm.cityId.focus();\n\t return false;\n\t }\n\t else if(document.ccRegistrationForm.cityId.value!=\"0\" && (document.ccRegistrationForm.postOfficeId.value==\"\"||document.ccRegistrationForm.postOfficeId.value==\"0\"))\n\t {\n\t alert(\"Pls Select the Post Office \");\n\t document.ccRegistrationForm.postOfficeId.focus();\n\t return false;\n\t }\n\t else if(document.ccRegistrationForm.cityId.value !=\"0\" && (document.ccRegistrationForm.pinCodeId.value==\"\" ||document.ccRegistrationForm.pinCodeId.value==\"0\"))\n\t {\n\t alert(\"Pls Enter Pin Code\");\n\t document.ccRegistrationForm.pinCodeId.focus();\n\t return false;\n\t }else if(document.ccRegistrationForm.registrationNo.value==\"\")\n\t {\n\t alert(\"Pls Enter Valid Registration No \");\n\t document.ccRegistrationForm.registrationNo.focus();\n\t return false;\n\t }\n\t else if(document.ccRegistrationForm.pinCodeId.value !=\"\" && !numeric(document.ccRegistrationForm.pinCodeId))\n\t {\n\t document.ccRegistrationForm.pinCodeId.focus();\n\t return false;\n\t }else if (document.ccRegistrationForm.registrationDate.value == \"\") {\n\t\talert(\"Please Enter Registration Date\");\n\t\tdocument.ccRegistrationForm.registrationDate.focus();\n\t\treturn false;\n\t}else if(document.ccRegistrationForm.email.value !=\"\" && !emailValidator(document.ccRegistrationForm.email))\n\t {\n\t document.ccRegistrationForm.email.focus();\n\t return false;\n\t }else if (document.ccRegistrationForm.phoneNo.value == \"\") {\n\t\talert(\"Please Enter Phone No\");\n\t\tdocument.ccRegistrationForm.phoneNo.focus();\n\t\treturn false;\n\t}else if(document.ccRegistrationForm.phoneNo.value !=\"\" && !numeric(document.ccRegistrationForm.phoneNo))\n\t {\n\t document.ccRegistrationForm.phoneNo.focus();\n\t return false;\n\t }else if (document.ccRegistrationForm.landMark.value == \"\") {\n\t\talert(\"Please Enter Land Mark \");\n\t\tdocument.ccRegistrationForm.landMark.focus();\n\t\treturn false;\n\t}else if (document.ccRegistrationForm.layoutImage.value!=\"\") {\n\t var fileTypes=[\"bmp\",\"gif\",\"png\",\"jpg\",\"jpeg\"];\n\t var source=document.ccRegistrationForm.layoutImage.value;\n \t\t var ext=source.substring(source.lastIndexOf(\".\")+1,source.length).toLowerCase();\n for (var i=0; i<=fileTypes.length; i++) if (fileTypes[i]==ext) break;\n\t if (i<fileTypes.length) {}\n \t\t\telse {\n \t\t\talert(\"THAT IS NOT A VALID IMAGE\\nPlease load an image with an extention of one of the following:\\n\\n\"+fileTypes.join(\", \"));\n \t \t\t\t document.ccRegistrationForm.layoutImage.focus();\n\t \t\t\t return false;\n\t \t\t\t}\n\n\t}\n\telse{\n\treturn true;\n }\n}", "title": "" }, { "docid": "750a14070fe9f190292d424c621a32ad", "score": "0.60209435", "text": "function contactSubmitted (formname, feild1, feild2, feild3) {\n\tvar status = validateForm (formname, feild1, feild2, feild3)\n\tif (status == true) {\n\t\tdocument.getElementById(\"contactform\").innerHTML = \"Thank you for your message! Someone will be in contact in a few days.\";\t\t\n\t}\n}", "title": "" }, { "docid": "58de786291be77057544ee85381cf7ac", "score": "0.60144645", "text": "function quotation_contact_form(category){\n \n event.preventDefault()\n\n // if($('#id_contact_name').val() == ''){\n // alert('Contact name is requried')\n // $('#id_contact_name').focus()\n // return false\n // }else if($('#id_organization_type option').filter(':selected').val() != '1' & $('#id_organization_name').val() == ''){\n // alert('Organization name is requried')\n // $('#id_organization_name').focus()\n // return false\n // }else if($('#id_user_address_details_set-0-city').val() == ''){\n // alert('City is requried')\n // $('#id_user_address_details_set-0-city').focus()\n // return false\n // }else if($('#id_user_address_details_set-0-state').val() == ''){\n // alert('State is requried')\n // $('#id_user_address_details_set-1-state').focus()\n // return false\n // }else if($('#id_user_address_details_set-0-country').val() == ''){\n // alert('Country is requried')\n // $('#id_user_address_details_set-0-country').focus()\n // return false\n // }\n\n // if($('.address_is_billing_diff').is(':checked')){\n // if($('#id_user_address_details_set-1-city').val() == ''){\n // alert('City is requried')\n // $('#id_user_address_details_set-1-city').focus()\n // return false\n // }else if($('#id_user_address_details_set-1-state').val() == ''){\n // alert('State is requried')\n // $('#id_user_address_details_set-1-state').focus()\n // return false\n // }else if($('#id_user_address_details_set-1-country').val() == ''){\n // alert('Country is requried')\n // $('#id_user_address_details_set-1-country').focus()\n // return false\n // }\n // }\n \n $.post(\"/contacts/add/\",$(\"#add_quotation_contact_form\").serialize(), function(data){\n if(data != '0'){\n \n $.get(\"/creditnote/contact_fetch/\",function(data){\n if(category == 'customer'){\n $(\"#quotation_customer\").each(function(){\n $('<option/>').val(data.ids).html(data.name).appendTo($(this));\n });\n $('#quotation_customer').val(data.ids).change(); \n\n }\n else if(category == 'employee'){\n $(\"#quotation_sales_person\").each(function(){\n $('<option/>').val(data.ids).html(data.name).appendTo($(this));\n });\n $('#quotation_sales_person').val(data.ids).change(); \n }\n \n \n });\n $(\"#ContactModal\").modal('hide');\n }\n \n});\n}", "title": "" }, { "docid": "eece8d5f09500c679d8dec5823fbfecd", "score": "0.598508", "text": "function validate_co_name() {\n\tCoSpaceFound = \"n\";\n\n\tdoError(\"Start validate_co_name, Co_ApplicantName = |\" + d.main.Co_ApplicantName.value + \"|\");\n\n\td.main.Co_ApplicantName.value = d.main.Co_ApplicantName.value.trim();\n\n\tif (d.main.Co_ApplicantName.value == \"\")\n\t/* if no Co_Applicant, just return from the function */\n\t{\n\t\treturn;\n\t}\n\n\tfor (var i = 0; i < d.main.Co_ApplicantName.value.length; i++) {\n\t\tfor (var j = 0; j < alphaChars.length; j++) \n\t\t{\n\t\t\tif (alphaChars.charAt(j) == \" \") {\n\t\t\t\tCoSpaceFound = \"y\";\n\t\t\t}\n\n\t\t\tif (alphaChars.charAt(j) == d.main.Co_ApplicantName.value.charAt(i)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (j == (alphaChars.length - 1)) {\n\t\t\t\terrormsg += '\"' + d.main.Co_ApplicantName.value.charAt(i) + '\"' + ' is an invalid character for Co-Borrower Name.\\n';\n\t\t\t\terror_cn = true;\n\t\t\t}\n\n\t\t\tif (error_cn) {\n\t\t\t\td.main.Co_ApplicantName.focus();\n\t\t\t\td.main.Co_ApplicantName.select();\n\t\t\t}\n\t\t}\n\t}\n\n\tif (CoSpaceFound == \"n\")\n\t/* if something was entered ... */\n\t{\n\t\terrormsg += \"Please enter coApplicatant's first and last name in the field.\\n\";\n\t\terror_cn = true;\n\t\td.main.Co_ApplicantName.focus();\n\t\td.main.Co_ApplicantName.select();\n\t}\n}", "title": "" }, { "docid": "185b2498e030ff848d203baccc9648a8", "score": "0.5910312", "text": "function Validation(){\n\n\t\t\tconst username = document.getElementById('first&lastname').value;\n\t\t\tlet mobilenumber = document.getElementById('contact').value;\n\t\t\tlet email = document.getElementById('emailaddress').value;\n\t\t\tlet subject = document.getElementById('query').value;\n\t\t\tlet message = document.getElementById('texting').value;\n\t\t\tlet validForm=true;\n\n\t\t\tif(username==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('fullname').innerHTML=\"Please Enter Your Full Name\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\n\t\t\tif(mobilenumber==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('digit').innerHTML=\"Please Enter Your Contact Number\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\n\t\t\tif(email==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('emailid').innerHTML=\"Please Enter Your Email Address\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\t\t\tif(subject==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('headline').innerHTML=\"Please Enter Your Subject\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\t\t\tif(message==\"\")\n\t\t\t{\n\t\t\t\tdocument.getElementById('text').innerHTML=\"Please Write Your Comments\";\n\t\t\t\tvalidForm = false;\n\t\t\t}\n\t\t\t// else{\n\n\t\t\t// alert(\"Form Submitted Successfully!\");\n\t\t\t// return true;\n\t\t\t// }\n\n\t\t\treturn validForm;\n\t\t}", "title": "" }, { "docid": "909d6a52afff8d3a1a2be38c66d7485d", "score": "0.5886762", "text": "function validate_contact_form() {\n \"use strict\";\n var c_fname = document.forms.c_form.contact_fname.value,\n c_email = document.forms.c_form.contact_email.value,\n c_subject = document.forms.c_form.contact_subject.value,\n c_message = document.forms.c_form.contact_message.value,\n email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,\n error_fname = document.getElementById(\"c_fname\"),\n error_email = document.getElementById(\"c_email\"),\n error_subject = document.getElementById(\"c_subject\"),\n error_message = document.getElementById(\"c_message\");\n error_fname.innerHTML = \"\";\n error_email.innerHTML = \"\";\n error_subject.innerHTML = \"\";\n error_message.innerHTML = \"\";\n \n if (c_fname === \"\") {\n error_fname.innerHTML = \"Must input your first name.\";\n document.forms.c_form.contact_fname.focus();\n return false;\n } else {\n error_fname.innerHTML = \"\";\n }\n if (c_email === \"\") {\n error_email.innerHTML = \"Must input an email address.\";\n document.forms.c_form.contact_email.focus();\n return false;\n } else if (c_email.search(email)) {\n error_email.innerHTML = \"The email address you input was not valid, please resubmit a valid email address.\";\n document.forms.c_form.contact_email.focus();\n return false;\n } else {\n error_email.innerHTML = \"\";\n }\n \n if (c_subject === \"\") {\n error_subject.innerHTML = \"Must input a valid subject.\";\n document.forms.c_form.contact_subject.focus();\n return false;\n } else {\n error_subject.innerHTML = \"\";\n }\n if (c_message === \"\") {\n error_message.innerHTML = \"Must input a valid message.\";\n document.forms.c_form.contact_message.focus();\n return false;\n } else {\n error_message.innerHTML = \"\";\n }\n}", "title": "" }, { "docid": "3cb9bb695ff945a5e5ddea0f262ff67a", "score": "0.5877537", "text": "function quote(){\n\tName_fun();\n\tphone_fun();\n\temail_fun();\n\n\t// if(email_regular.test(email)){\n\t\t// document.querySelector(\".email_error\").innerHTML=\"\";\n\t\t\n\t// }\n\t\n\t// else{\n\t\t// document.querySelector(\".email_error\").innerHTML=\"Please enter email properly\";\n\t\t// document.querySelector(\".email_error\").style.color=\"red\";\n\t// }\n}", "title": "" }, { "docid": "6b21258db89621476d502457e30b4f84", "score": "0.58704156", "text": "function validateMain() {\n\t\t\tif (document.forms['permitMeForm'].q.value == \"\") {\n\t\t\talert('Please enter a City & State or Zip Code.');\n\t\t\tdocument.forms['permitMeForm'].q.focus();\n\t\t\treturn false;\n\t\t\t}\n\t\t\tif (document.forms['permitMeForm'].bcat.value == \"bt\") {\n\t\t\talert('Please choose a Business Category.');\n\t\t\tdocument.forms['permitMeForm'].bcat.focus();\n\t\t\treturn false;\n\t\t\t}\n\t\treturn true;\n\t\t}", "title": "" }, { "docid": "8a8361ff34c43349c7b8f1bf98a8cb82", "score": "0.586599", "text": "function validateForm() {\r\n\tvar cn = document.forms[\"CompanyDonation\"][\"companyName\"].value;\r\n\tvar ccn = document.forms[\"CompanyDonation\"][\"contact\"].value;\r\n\tvar em = document.forms[\"CompanyDonation\"][\"email\"].value;\r\n\tvar ph = document.forms[\"CompanyDonation\"][\"phoneNum\"].value;\r\n\t// Following insure that the required fields have input\r\n\tif (cn == \"\") {\r\n\t\talert(\"Please enter a Company name\");\r\n\t\treturn false;\r\n\t}\r\n\tif (ccn == \"\") {\r\n\t\talert(\"Please enter a contact name\");\r\n\t\treturn false;\r\n\t}\r\n\t// validate email\r\n\tif(em.length < 10) {\r\n\t\talert(\"Please enter a valid email\");\r\n\t\treturn false;\r\n\t}\r\n\tif (em.search('@') == -1) {\r\n\t\talert(\"Please enter a valid email\");\r\n\t\treturn false;\r\n\t}\r\n\tif (ph.length < 13) {\r\n\t\talert(\"Please enter a valid phone number\");\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "ae0d1311cf60d1ab8deabde6395ab409", "score": "0.5864462", "text": "function checkAddCustomerForm() {\n var nameValidation = validName(\"nameCustomer\");\n var phoneNumberValidation = validPhoneNumber(\"phoneNumberCustomer\");\n var surnameValidation = validSurname(\"surnameCustomer\");\n var tcNoValidation = validTcNo(\"tcNoCustomer\");\n if (nameValidation && phoneNumberValidation && surnameValidation\n && tcNoValidation) {\n return true;\n } else {\n alert(\"Şu bölümler hatalı:\" + writeErrorsToAlert());\n }\n}", "title": "" }, { "docid": "0df160996bf6a564ad87a0480d58a09d", "score": "0.5859133", "text": "function validateItems() {\n clearErrors();\n var userName = document.forms[\"contact-form\"][\"name\"].value.trim();\n var userEmail = document.forms[\"contact-form\"][\"email\"].value.trim();\n var userPhone = document.forms[\"contact-form\"][\"phone\"].value.trim();\n var reasonForInquiry = document.forms[\"contact-form\"][\"reason-for-inquiry\"].value;\n\n if (userName == \"\") {\n alert(\"You must enter your name to submit this form!\");\n document.forms[\"contact-form\"][\"name\"].parentElement.parentElement = \"form-group row has-error\";\n document.forms[\"contact-form\"][\"name\"].focus();\n return false;\n } else if (!isNaN(userName)) {\n alert(\"Please enter a name, not a number.\");\n document.forms[\"contact-form\"][\"name\"].parentElement.parentElement = \"form-group row has-error\";\n document.forms[\"contact-form\"][\"name\"].focus();\n return false;\n }\n if (userEmail == \"\") {\n alert(\"You must enter your email address so that we may get back to you!\");\n document.forms[\"contact-form\"][\"email\"].parentElement.parentElement = \"form-group row has-error\";\n document.forms[\"contact-form\"][\"email\"].focus();\n return false;\n // Very primite email validation. If I had more time, then I would create a set object\n // of all valid domain names, and query such a data set to see if the user's email ends with\n // one of the domain names, not just whether their email contains the domain name as a substring\n } else if (!userEmail.includes(\"@\") || !userEmail.toLowerCase().includes(\".com\")) {\n alert(\"Please enter a valid email address.\");\n document.forms[\"contact-form\"][\"email\"].parentElement.parentElement = \"form-group row has-error\";\n document.forms[\"contact-form\"][\"email\"].focus();\n return false;\n }\n if (userPhone == \"\") {\n alert(\"Please enter a phone number so we may get back to you!\");\n document.forms[\"contact-form\"][\"phone\"].parentElement.parentElement = \"form-group row has-error\";\n document.forms[\"contact-form\"][\"phone\"].focus();\n return false;\n } else if (!validPhoneNumber(userPhone)) {\n alert(\"Please enter a valid phone number\");\n document.forms[\"contact-form\"][\"phone\"].parentElement.parentElement = \"form-group row has-error\";\n document.forms[\"contact-form\"][\"phone\"].focus();\n return false;\n }\n if (document.forms[\"contact-form\"][\"reason-for-inquiry\"].value == \"select-one\") {\n alert(\"Please specify the reason for your inquiry\");\n document.forms[\"contact-form\"][\"reason-for-inquiry\"].parentElement.parentElement = \"form-group row has-error\";\n document.forms[\"contact-form\"][\"reason-for-inquiry\"].focus();\n return false;\n }\n if (document.forms[\"contact-form\"][\"reason-for-inquiry\"].value == \"other\") {\n if (document.getElementById(\"specify\").value == \"\") {\n alert(\"If you have entered 'other' in the reason for inquiry, you must specify the reason.\");\n document.forms[\"contact-form\"][\"specify\"].parentElement.parentElement = \"form-group row has-error\";\n document.forms[\"contact-form\"][\"specify\"].focus();\n return false;\n }\n }\n // If user data successfully passes above tests, give alert them of success\n alert(\"Congratulations! Your information has been sent and we will get back to you shortly.\");\n // In a real form, all the info should be cleared after it has been submitted, for privacy\n resetForm();\n return false;\n}", "title": "" }, { "docid": "c1fc8e2cb1b59572266957c927c4becf", "score": "0.58447534", "text": "function showContact() {\n if (props.snippetsFilter === \"\\\\Sent\" ||props.snippetsFilter === \"\\\\Draft\" ){\n if (props.email.to.length > 1){\n return props.email.to[0] + \" + \" + parseInt(props.email.to.length - 1)\n } else {return props.email.to[0]}\n } else if(props.email.name){\n return props.email.name\n } else {\n return props.email.from\n }\n}", "title": "" }, { "docid": "c06e9d05998514118c1bd18419dcf845", "score": "0.58380157", "text": "function RegValidate(RegForm) {\n // Declare Variables - get the textbox value and assign it into the variable\n var Uname = RegForm.elements['cid'].value;\n var FirstName = RegForm.elements['url'].value;\n var LastName = RegForm.elements['message'].value;\n var CheckAge = RegForm.elements['phone'].value;\n if (FirstName ==\"\" && LastName ==\"\" && CheckAge ==\"\")\n {\n document.getElementById('url').style.backgroundColor='#FFF4F4';\n document.getElementById('url').style.border = '1px solid #CC0000';\n document.getElementById('lblurl').style.color = '#CC0000';\n document.getElementById('lblurl').innerHTML = 'Empty Field:';\n document.getElementById('message').style.backgroundColor='#FFF4F4';\n document.getElementById('message').style.border = '1px solid #CC0000';\n document.getElementById('lblmessage').style.color = '#CC0000';\n document.getElementById('lblmessage').innerHTML = 'Empty Field:';\n document.getElementById('phone').style.backgroundColor='#FFF4F4';\n document.getElementById('phone').style.border = '1px solid #CC0000';\n document.getElementById('lblphone').style.color = '#CC0000';\n document.getElementById('lblphone').innerHTML = 'Empty Field:';\n alert(\"Please fill in the empty fields.\\n- Phone Number\\n- MO URL\\n- Message.\");\n return false;\n }\n if (FirstName == \"\")\n {\n alert(\"You must enter mo url.\");\n document.getElementById('url').style.backgroundColor='#FFF4F4';\n document.getElementById('url').style.border = '1px solid #CC0000';\n document.getElementById('lblurl').style.color = '#CC0000';\n document.getElementById('lblurl').innerHTML = 'Empty Field:';\n return false;\n }\n if (LastName == \"\")\n {\n alert(\"You must enter message.\");\n document.getElementById('message').style.backgroundColor='#FFF4F4';\n document.getElementById('message').style.border = '1px solid #CC0000';\n document.getElementById('lblmessage').style.color = '#CC0000';\n document.getElementById('lblmessage').innerHTML = 'Empty Field:';\n return false;\n }\n else if (LastName.length > 160) // Check char count, if it is greater than 160 characters\n {\n alert (\"The message is too long.\\n Please enter a message from 1 to 160 characters.\");\n document.getElementById('message').style.backgroundColor='#FFF4F4';\n document.getElementById('message').style.border = '1px solid #CC0000';\n document.getElementById('lblmessage').style.color = '#CC0000';\n document.getElementById('lblmessage').innerHTML = 'Too Long:';\n return false;\n }\n if (CheckAge == \"\")\n {\n alert(\"You must enter phone number.\");\n document.getElementById('phone').style.backgroundColor='#FFF4F4';\n document.getElementById('phone').style.border = '1px solid #CC0000';\n document.getElementById('lblphone').style.color = '#CC0000';\n document.getElementById('lblphone').innerHTML = 'Empty Field:';\n return false;\n }\n if (isNaN(CheckAge) == true)\n {\n alert (\"Phone number cannot contained letters and other characters.\\n Please enter your phone number again.\");\n document.getElementById('phone').style.backgroundColor='#FFF4F4';\n document.getElementById('phone').style.border = '1px solid #CC0000';\n document.getElementById('lblphone').style.color = '#CC0000';\n document.getElementById('lblphone').innerHTML = 'Only Number:';\n return false;\n }\n submitForm(true);\n return true;\n}", "title": "" }, { "docid": "6b5865448561aff7b1307e95300facd1", "score": "0.5825096", "text": "function validateContact() {\n\tvar contact = document.getElementById(\"contact_id\").value;\n\tvar errormessage = document.getElementById(\"contact_id_error\");\n\tcontact.length > 8 && (!isNaN(contact)) ? errormessage.style.visibility = \"hidden\"\n\t\t\t: errormessage.style.visibility = \"visible\";\n}", "title": "" }, { "docid": "f9428fe153353816a9f052564e1eb25a", "score": "0.5818952", "text": "function addContact() {\r\n $('#right>div').hide();\r\n $('#mailUI textarea').val('');\r\n $('#createPhone td input[type=number]').css('box-shadow','none');\r\n $('#createMail td input[type=email]').css('box-shadow','none');\r\n $('#createAddress td input').css('box-shadow','none');\r\n removeRecipient('finalTo','*');\r\n removeRecipient('finalCc','*');\r\n $('#createContact').show();\r\n}", "title": "" }, { "docid": "bf97a1da98cb90e91102694a30b4e2d8", "score": "0.58182895", "text": "function validateForm()\n{\nvar CCN = trimBetweenSpaces(trimBegEndSpaces(stripOffNonDigit(document.ccform.UMcard.value)));\nvar expireDate = trimBetweenSpaces(trimBegEndSpaces(stripOffNonDigit(document.ccform.UMexpir.value)));\nvar bankRouting = trimBetweenSpaces(trimBegEndSpaces(document.ccform.UMrouting.value));\nvar bankAccount = trimBetweenSpaces(trimBegEndSpaces(document.ccform.UMaccount.value));\nvar dlNum = trimBetweenSpaces(trimBegEndSpaces(document.ccform.UMdlnum.value));\nvar dlState = trimBetweenSpaces(trimBegEndSpaces(document.ccform.UMdlstate.value));\nvar amount = trimBetweenSpaces(trimBegEndSpaces(stripOffNonDigit(document.ccform.UMamount.value)));\nvar sku = trimBetweenSpaces(trimBegEndSpaces(document.ccform.UMline1sku.value));\nvar name = document.ccform.UMname.value;\nvar billfname = document.ccform.UMbillfname.value;\nvar billlname = document.ccform.UMbilllname.value;\nvar street = document.ccform.UMstreet.value;\nvar zip = trimBetweenSpaces(trimBegEndSpaces(stripOffNonDigit(document.ccform.UMzip.value)));\nvar paymentMethod = document.ccform.UMcommand.value;\n\nif (amount.length == 0 || amount <= 0)\n{\nalert (\"Error: missing field amount.\\n Please fill out the amount field.\");\ndocument.ccform.UMamount.focus();\nreturn false;\n}\nif (sku.length == 0)\n{\nalert (\"Error: Missing Product ID.\\n Please fill out the Product ID field.\");\ndocument.ccform.UMline1sku.focus();\nreturn false;\n}\n\n//Validate fields under credit card information\nif (paymentMethod == 'cc:sale') {\n //validate cardholder name\n if (name.length == 0 || !isAlphaSymbols(name, \".,' \"))\n {\n alert (\"Error: Please enter the name as it appears on the card using only alphabetic characters.\");\n document.ccform.UMname.focus();\n return false;\n }\n //validate CC # length is at least 12 numbers\n else if (CCN.length == 0) {\n alert(\"Missing credit card number.\")\n document.ccform.UMcard.focus();\n return false;\n }\n else if (CCN.length < 12) {\n alert (\"Error: Make sure the credit card you entered has at least 12 numbers.\");\n document.ccform.UMcard.focus();\n return false;\n }\n else if (expireDate.length < 4) {\n alert (\"Error: Enter a 4 digit expiration date in the MMYY format.\");\n document.ccform.UMexpir.focus();\n return false;\n }\n document.ccform.UMexpir.value = expireDate;\n}\n\n//Validate ACH payment information\nif (paymentMethod == 'check:sale') {\n //validate routing number has been entered\n if (bankRouting.length == 0) {\n alert(\"Please enter your bank routing number.\");\n document.ccform.UMrouting.focus();\n return false;\n }\n //validate account number was entered; min 4 digits\n else if (bankAccount.length == 0) {\n alert (\"Missing bank account number.\");\n document.ccform.UMaccount.focus();\n return false;\n }\n else if (bankAccount.length < 4) {\n alert (\"Bank account number should have a minimum of 4 digits\");\n document.ccform.UMaccount.focus();\n return false;\n }\n else if (dlNum.length == 0) {\n alert(\"please enter your driver's license number.\");\n document.ccform.UMdlnum.focus();\n return false;\n }\n else if (dlState.length == 0) {\n alert(\"Please enter the driver's license issuing state.\")\n document.ccform.UMdlstate.focus();\n return false;\n }\n else if (billfname.length == 0 || !isAlphaSymbols(billfname, \".,' \")) {\n alert(\"Please enter first name under billing information.\");\n document.ccform.UMbillfname.focus();\n return false;\n }\n else if (billlname.length == 0 || !isAlphaSymbols(billlname, \".,' \")) {\n alert(\"Please enter last name under billing information.\");\n document.ccform.UMbilllname.focus();\n return false;\n }\n}\n\nif (street.length == 0)\n{\nalert (\"Error: Please enter the billing address.\");\ndocument.ccform.UMstreet.focus();\nreturn false;\n} \nif (zip.length == 0 || zip.length != 5)\n{\nalert (\"Error: missing or invalid billing zipcode.\\n Please enter a 5 digit zipcode.\");\ndocument.ccform.UMzip.focus();\nreturn false;\n}\n \nreturn true;\n}", "title": "" }, { "docid": "30ba1e2481be17abe3a0115e976eef1d", "score": "0.5816216", "text": "function validateContactForm(e) {\n e.preventDefault();\n console.log(\"The form was submitted\");\n // First name\n var firstNameValue = document.querySelector('#firstName').value;\n if (checkInputLength(firstNameValue) === true) {\n document.querySelector('#firstNameError').style.display = 'none';\n }\n else {\n document.querySelector('#firstNameError').style.display = 'block';\n }\n ;\n // Last name\n var lastNameValue = document.querySelector('#lastName').value;\n if (checkInputLength(lastNameValue) === true) {\n document.querySelector('#lastNameError').style.display = 'none';\n }\n else {\n document.querySelector('#lastNameError').style.display = 'block';\n }\n ;\n // Email address:\n var emailValue = document.querySelector('#email').value;\n if (checkInputLength(emailValue) === true) {\n document.querySelector('#emailError').style.display = 'none';\n }\n else {\n document.querySelector('#emailError').style.display = 'block';\n }\n ;\n if (validateEmail(emailValue) === true) {\n document.querySelector('#invalidEmailError').style.display = 'none';\n }\n else {\n document.querySelector('#invalidEmailError').style.display = 'block';\n }\n ;\n // Error message:\n var messageValue = document.querySelector('#message').value;\n if (checkInputLengthMessage(messageValue) === true) {\n document.querySelector('#messageError').style.display = 'none';\n }\n else {\n document.querySelector('#messageError').style.display = 'block';\n }\n ;\n}", "title": "" }, { "docid": "ae5ece9bb67eef1e2ceb78a10b500d92", "score": "0.5809148", "text": "function validateCF() {\n\tvalid = true;\n\tif (cityForm.countryId.selectedIndex == 0) {\n\t\talert(\"Please Select Country\");\n\t\tcityForm.countryId.focus();\n\t\treturn false;\n\t}\n\tif (cityForm.stateId.selectedIndex == 0) {\n\t\talert(\"Please Select State\");\n\t\tcityForm.stateId.focus();\n\t\treturn false;\n\t}\n\tif (cityForm.districtId.selectedIndex == 0) {\n\t\talert(\"Please Select District\");\n\t\tcityForm.districtId.focus();\n\t\treturn false;\n\t}\n\tif (cityForm.name.value == \"\" || trim(cityForm.name.value) == \"\") {\n\t\talert(\"Please Enter City\");\n\t\tcityForm.name.focus();\n\t\treturn false;\n\t}\n\tif (alphabet(cityForm.name) == false) {\n\t\treturn false;\n\t} else {\n\t\treturn valid;\n\t}\n}", "title": "" }, { "docid": "88538fa5b0654ad9a5d2e347096185a3", "score": "0.5808744", "text": "function creditCardPayment() { // Everything about the credit card payment section, and the zip code, and cvv code validations share the same logic as the name and the email validations, just with the proper id's for the relevent elements. \n const creditCard = /^\\d{13,16}$/\n if (creditCard.test($('#cc-num').val())) {\n $('#cc-num').prev().text(\"Name:\").css('color', 'black');\n return true;\n } else {\n $('#cc-num').prev().text(\"Please enter a valid Card Number.\").css('color', 'red');\n }\n }", "title": "" }, { "docid": "da7d1e517123fa1866333b6d79fe7e52", "score": "0.57959336", "text": "function validateForm() {\r\n // if (nameFlag === true && emailFlag === true && phoneFlag === true) {\r\n if (document.getElementById(\"NameMessage1\").innerHTML === \"\" &&\r\n document.getElementById(\"NameMessage2\").innerHTML === \"\" &&\r\n document.getElementById(\"NameMessage3\").innerHTML === \"\" &&\r\n document.getElementById(\"message1\").innerHTML === \"\" && phoneSubFlag === true && phoneStateFlag === true) {\r\n return true;\r\n }\r\n else {\r\n document.getElementById(\"message0\").innerHTML = \"Please enter accurate information\";\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "ad65c3f5f3c18d3897f4bf405752d641", "score": "0.5794553", "text": "function validateEditOrg()\n{ \n\temail = trim(document.getElementById('UserEmail').value);\t\n address = trim(document.getElementById('UserAddress1').value);\n\tcity = trim(document.getElementById('UserCity').value);\n\tcountry = trim(document.getElementById('UserCountryId').value);\n\tstate = trim(document.getElementById('UserStateId').value);\n\tcountrycode = trim(document.getElementById('UserPhone0').value);\t\n\tareacode = trim(document.getElementById('UserPhone1').value);\t\n\tphoneCode = trim(document.getElementById('UserPhone2').value);\n\t//validation of billing information\n\tfirstname = trim(document.getElementById('OrganisationPaymentFirstname').value);\t\n\tlastname \t= trim(document.getElementById('OrganisationPaymentLastname').value);\n\n\tcompanyname \t= trim(document.getElementById('OrganisationPaymentCompanyname').value); \n\tstreetaddress \t= trim(document.getElementById('OrganisationPaymentStreetaddress').value);\n\tbillingcity \t\t= trim(document.getElementById('OrganisationPaymentCity').value);\n\t billingcountry \t= trim(document.getElementById('OrganizationPaymentDetailCountryId').value);\n\t billingstate \t\t= trim(document.getElementById('OrganizationPaymentDetailStateId').value);\n\t //billingzip \t\t= trim(document.getElementById('OrganizationPaymentDetailZip').value);\n\t//billingphone \t= trim(document.getElementById('OrganizationPaymentDetailPhonenumber').value);\n\t//billingadditionalphone \t= trim(document.getElementById('OrganizationPaymentDetailAdditionalphonenumber').value);\n\tbillingemail \t\t= trim(document.getElementById('OrganisationPaymentEmail').value);\t\n\t paymentCardHolder \t= trim(document.getElementById('OrganisationPaymentHolderName').value);\n\t paymentCardNo \t= trim(document.getElementById('OrganizationPaymentDetailCardNo').value);\n\texpireMonth\t= trim(document.getElementById('OrganizationPaymentDetailExpireMonthMonth').value);\n\t expireYear\t= trim(document.getElementById('OrganizationPaymentDetailExpireYearYear').value);\n\t securityNo\t= trim(document.getElementById('OrganizationPaymentDetailSecurityNo').value);\n\t var checkCC=/^[0-9]{1,4}$/;\n var checkAC=/^[0-9]{2,5}$/;\n\t //var checkPhone1=/^([0-9]( |-)?)?(\\(?[0-9]{3}\\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$/;\n\t//var checkPhone = /^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;\n\tvar alphaTest=/^[a-zA-Z ]{1,20}$/i;\n\tvar alphaNumericTest=/^[a-zA-Z0-9 ]{1,20}$/;\n\tvar numericTest=/^[0-9 ]{1,20}$/;\n\tvar cardNumberTest=/^[0-9]{8,16}$/;\n\tvar checkPhone = /^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;\n\tareacode=areacode.replace(\"-\", \"\");\n\tphoneCode=phoneCode.replace(\"-\", \"\");\n\tphonenumber=''+countrycode+'-'+areacode+'-'+phoneCode;\n\tphonenumber=phonenumber.replace(\"(\", \"\");\n\tphonenumber=phonenumber.replace(\")\", \"\");\n var errorString = \"\";\n \n\t\n if(email==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserEmail').focus();\n\t\t}\n\t\terrorString = errorString + \"-Please enter your valid email address. <br>\";\n\t\t \n\t}\n\tif(email!= ''){\n\t\t\n\t\tvar reg = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\t\tvar address = email;\n\t\tif(reg.test(address) == false) {\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserEmail').focus();\n\t\t}\n\t\terrorString = errorString + \"-Email Address is not valid. <br>\";\n\t\t \n\t\t}\n\t}\n\t \t\n\tif(address == ''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserAddress1').focus();\n\t\t}\n errorString = errorString + \"-Please enter your address <br>\";\n\t\t \n \n\t}\n\tif(city == ''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserCity').focus();\n\t\t}\n errorString = errorString + \"-Please enter your city name. <br>\";\n\t}\n\tif(country == ''){\t\t\n errorString = errorString + \"-Please select your country name. <br>\";\n\t}\n\tif(state == ''){\t\t\n errorString = errorString + \"-Please select your state name. <br>\";\n\t\t \n \n\t}\n \n\n\tif(phonenumber ==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserPhone0').focus();\n\t\t\t\n\t\t}\n errorString = errorString + \"-Please enter phone number. <br>\"; \n\t}else if(checkPhone.test(phonenumber)== false){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserPhone0').focus();\n\t\t\t\n\t\t}\n\t\t errorString = errorString + \"-Please enter valid phone number in (800) 123-1234 or 123-456-7890 format.<br>\"; \n\t}\n\n\t//validation of billing information\n\n\tif(billingemail==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentEmail').focus();\n\t\t}\n\t\terrorString = errorString + \"-Please enter your email address billing contact information. <br>\";\n\t}\n\tif(billingemail!= ''){\n\t\n\t\tvar reg = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\t\tvar address = billingemail;\n\t\tif(reg.test(address) == false) {\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentEmail').focus();\n\t\t}\n\t\terrorString = errorString + \"-Email Address is not valid. <br>\";\t\t \n\t\t}\n\t}\n\n\t if(firstname == '') {\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentFirstname').focus();\n\t\t}\n\t\terrorString = errorString + \"-Please enter first name. <br>\";\n\t }else if(alphaTest.test(firstname)== false){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentFirstname').focus();\n\t\t}\n\t\t errorString = errorString + \"-Please enter first name in characters only.<br>\"; \n\t}\n\t if(lastname == ''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentLastname').focus();\n\t\t}\n errorString = errorString + \"-Please enter last name. <br>\";\n\t }else if(alphaTest.test(lastname)== false){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentLastname').focus();\n\t\t}\n\t\t errorString = errorString + \"-Please enter last name in characters only.<br>\"; \n\t}\n\t\n\tif(companyname ==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentCompanyname').focus();\n\t\t}\n errorString = errorString + \"-Please enter company name. <br>\"; \n\t}\n\n\tif(streetaddress ==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentStreetaddress').focus();\n\t\t}\n errorString = errorString + \"-Please enter street address. <br>\"; \n\t}\n\t\n\tif(billingcity ==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentCity').focus();\n\t\t}\n errorString = errorString + \"-Please enter city in billing contact information.<br>\"; \n\t}\n\tif(billingcountry ==''){\n errorString = errorString + \"-Please choose country in billing contact information.<br>\"; \n\t}\n\tif(billingstate ==''){\n errorString = errorString + \"-Please choose state in billing contact information.<br>\"; \n\t}\n\n\t\n\t\n\tif(paymentCardHolder==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganisationPaymentHolderName').focus();\n\t\t}\n\t\terrorString = errorString + \"-Please enter card holder name in payment information. <br>\";\n\t}\n\n\tif(paymentCardNo ==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganizationPaymentDetailCardNo').focus();\n\t\t}\n errorString = errorString + \"-Please enter card number. <br>\";\n\t}else if(cardNumberTest.test(paymentCardNo)== false){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganizationPaymentDetailCardNo').focus();\n\t\t}\n\t\t errorString = errorString + \"-Please enter card number in numeric and maximum 16 digit only.<br>\"; \n\t}\n\tif(securityNo ==''){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganizationPaymentDetailSecurityNo').focus();\n\t\t}\n errorString = errorString + \"-Please enter card security code. <br>\";\n\t}else if(numericTest.test(securityNo)== false){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('OrganizationPaymentDetailSecurityNo').focus();\n\t\t}\n\t\t errorString = errorString + \"-Please enter card security code in numeric only.<br>\"; \n\t}\n\tif(expireMonth ==''){\n errorString = errorString + \"-Please choose card expiry month. <br>\"; \n\t}\n\tif(expireYear ==''){\n errorString = errorString + \"-Please choose card expiry year. <br>\"; \n\t}\n\t\n\t\n if(errorString != \"\"){\n\t\twindow.scrollTo(0,0);\n\t\tdocument.getElementById(\"jsError\").innerHTML = errorDiv+errorString+\"</p>\"; \n\t\treturn false;\n\t}\n\telse{\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "eacf5deb4fe69f512614ce3fec4ca2ca", "score": "0.57594955", "text": "function formValidate()\r\n{\r\n // Creates an object from the contact form\r\n // Creates new variables from all the input fields\r\n // Sets the default for the variable that will pass/fail\r\n \r\n var contactFormObj = document.getElementById(\"ContactForm\");\r\n var firstName = contactFormObj.firstName.value;\r\n var lastName = contactFormObj.lastName.value;\r\n var eMail = contactFormObj.eMail.value;\r\n var phoneNumber = contactFormObj.phoneNumber.value;\r\n var allvalid = true;\r\n \r\n // Checks each field for the appropriate data.\r\n // If the field comes back as truthful it is failed\r\n // and the validation variable is set to false.\r\n // The later functions will return true if the first\r\n // charcter that matches is at the 0 index\r\n // and false if they fail to satisfy the search criteria.\r\n \r\n if (!validateName(firstName))\r\n {\r\n alert(\"Error: Please enter a valid First Name.\");\r\n allvalid=false;\r\n }\r\n \r\n if (!validateName(lastName))\r\n {\r\n alert(\"Error: Please enter a valid Last Name.\");\r\n allvalid=false;\r\n }\r\n \r\n if (!validatePhone(phoneNumber))\r\n {\r\n alert(\"Error: Please enter a valid phone number.\");\r\n allvalid=false;\r\n }\r\n \r\n if (!validateeMail(eMail))\r\n {\r\n alert(\"Error: Please enter a valid E-Mail address\");\r\n allvalid=false;\r\n }\r\n \r\n // Gives the user a nice message if they fill all forms correctly!\r\n // Otherwise will create an error message.\r\n \r\n if (allvalid)\r\n {\r\n alert(\"Thank you! We will contact you soon.\");\r\n return true\r\n }\r\n else\r\n {\r\n return false\r\n }\r\n}", "title": "" }, { "docid": "592ea37a1eae0a28cb594f8600395b45", "score": "0.5752268", "text": "function validateForm3() {\n\n if(document.providerFrom.userName.value == \"\" ){\n alert( \"Please enter your username.\" );\n document.providerFrom.userName.focus() ;\n return false;\n }\n\n if( document.providerFrom.password.value == \"\" ){\n alert( \"Please enter your password.\" );\n document.providerFrom.password.focus() ;\n return false;\n }\n\n if( document.providerFrom.companyName.value == \"\" ){\n alert( \"Please enter your company name.\" );\n document.providerFrom.companyName.focus() ;\n return false;\n }\n\n if( document.providerFrom.contactName.value == \"\" ){\n alert( \"Please enter a contact person.\" );\n document.providerFrom.contactName.focus() ;\n return false;\n }\n\n var x=document.forms[\"providerFrom\"][\"email\"].value;\n var atpos=x.indexOf(\"@\");\n var dotpos=x.lastIndexOf(\".\");\n if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length){\n\n alert(\"Please Enter a valid email address\");\n return false;\n }\n\n if( document.providerFrom.contactNumber.value == \"\" ){\n alert( \"Please enter a telephone number.\" );\n document.providerFrom.contactNumber.focus() ;\n return false;\n }\n}", "title": "" }, { "docid": "24f1aeb336e7289aa20070fc7a8af616", "score": "0.5739531", "text": "function ContactOrganization()\n{\n \"use strict\";\n}", "title": "" }, { "docid": "8dc9f42141ab317da01a70fc25073934", "score": "0.5736345", "text": "function checkForm () {\n if (!(document.infoForm.lastName.value)) {\n console.log((document.infoForm.lastName));\n return false;\n }\n if (!(document.infoForm.firstName.value)) {\n return false;\n }\n if (!document.infoForm.streetAddress.value) {\n return false;\n }\n if (!document.infoForm.city.value) {\n return false;\n }\n if (!document.infoForm.province.value) {\n return false;\n }\n if (!document.infoForm.postalCode.value) {\n return false;\n }\n // Use a regular expression to check that postal code is in 'A1A 1A1' format.\n else if (!(/^[A-Z]\\d[A-Z] ?\\d[A-Z]\\d$/.test(document.infoForm.postalCode.value))) {\n console.log('Postal code in wrong format');\n alert(\"Postal code should be in 'A1A 1A1' format\");\n return false;\n }\n if (!document.infoForm.phoneNumber.value) {\n return false;\n }\n if (!document.infoForm.email.value) {\n return false;\n }\n if (!document.infoForm.depDate.value) {\n return false;\n }\n if (!document.infoForm.retDate.value) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "3cf48f35be1d8552619222d7ccb20796", "score": "0.57315826", "text": "function ReferenceEntryWidget ( form_name )\n{\n var warning_count = 0;\n \n var no_collection_name;\n var no_city;\n var no_country;\n \n function checkForm() {\n\t\n\tvar frm = document.forms[form_name];\n\t\n\tif ( ! frm )\n\t{\n\t alert(\"ERROR: Form '\" + form_name + \"'not found.\");\n\t return 0;\n\t}\n\t\n\tif ( frm.publication_type.value == \"museum collection\" )\n\t{\n\t return checkMuseumCollection();\n\t}\n\t\n\tvar year = /^[1-2][0-9]{3}$/;\n\t// var capital = /[A-Z]/;\n\tvar capital = XRegExp('\\\\p{Lu}');\n\t\n\t// var period = /[A-Za-z]\\.$/;\n\tvar period = XRegExp('\\\\p{L}\\\\.$');\n\t\n\t// var space = /([A-Za-z])(\\.| | \\.)([A-Za-z])|([A-Z][A-Z])/;\n\t\n\t// var all_caps = /^[A-Z][A-Z]/;\n\tvar all_caps = XRegExp('\\\\p{Lu}{3}');\n\tvar all_lower = XRegExp('\\\\p{Ll}{3}');\n\t\n\tvar other_authors = XRegExp('^\\\\p{L}{2}|\\\\p{L}\\\\.$');\n\t\n\tvar errors = \"\";\n\tvar warnings = \"\";\n\n\t// First Author Initials\n\t// pattern for multiple spaces match\n\tvar last_name_institution = /^\\S+\\s+\\S+\\s+\\S+/;\n\tvar last_name_anon = /^anon/i;\n\tif ( frm.author1init.value == \"\" ) {\n\t if(frm.author1last.value.match(last_name_institution) ||\n frm.author1last.value.match(last_name_anon)){\n\t\t// OK to have a blank first name if the last name is\n\t\t// an institution, or is \"anonymous\"\n\t }\n\t else{\n\t\terrors += \"* First author initials may not be blank\\n\"; \n\t }\n\t} else {\n\t // Check for a capital letter\n\t if ( capital.test ( frm.author1init.value ) == false ) {\n\t\terrors += \"* First author initials should have a capital letter\\n\"; \n\t }\n\t if ( period.test ( frm.author1init.value ) == false ) {\n\t\terrors += \"* The first author's initials must end with a period\\n\"; \n\t }\n\t // if ( space.test ( frm.author1init.value ) == true ) {\n\t // errors += \"* There must be a period and a space between the first author's two initials\\n\"; \n\t // }\n\t}\n\n\t// First Author Last\n\tif ( frm.author1last.value == \"\" ) {\n\t errors += \"* First author last name may not be blank\\n\"; \n\t} else {\n\t // Check for a capital letter\n\t if ( capital.test ( frm.author1last.value ) == false ) {\n\t\tif (! frm.author1last.value.match(last_name_anon)) {\n\t\t errors += \"* First author last name should have a capital letter\\n\"; \n\t\t}\n\t } else if ( all_caps.test ( frm.author1last.value ) == true && frm.author1last.value.length > 3) {\n\t\terrors += \"* First author name can't all consist of capital letters\\n\"; \n }\n\t}\n\n\t// Second Author Initials\n\tif ( frm.author2init.value != \"\" ) {\n\t // Check for a capital letter\n\t if ( capital.test ( frm.author2init.value ) == false ) {\n\t\terrors += \"* Second author initials should have a capital letter\\n\"; \n\t } \n\t if ( period.test ( frm.author2init.value ) == false ) {\n\t\terrors += \"* The second author's initials must end with a period\\n\"; \n\t }\n\t // if ( space.test ( frm.author2init.value ) == true ) {\n\t // errors += \"* There must be a period and a space between the second author's two initials\\n\"; \n\t // }\n\t}\n\n\t// Second Author Last\n\tif ( frm.author2last.value != \"\" ) {\n\t // Check for a capital letter\n\t if ( capital.test ( frm.author2last.value ) == false ) {\n\t\terrors += \"* Second author last name should have a capital letter\\n\"; \n\t } else if ( all_caps.test ( frm.author2last.value ) == true && frm.author2last.value.length > 3) {\n\t\terrors += \"* Second author name can not consist of all capital letters\\n\"; \n }\n\t}\n\n\t// OtherAuthors\n\t// var contents = frm.otherauthors.value;\n\t// var pattern = /(^[A-Z][a-z\\']+)|([A-Z]\\.$)/;\n\t// var result = contents.match(pattern);\n\tif ( frm.otherauthors.value.match(other_authors) )\t{\n\t errors += \"* Names of additional authors must be formatted with \" +\n\t\t\" initials before last names\\n\"+\n\t\t\"Example: P. McCartney, J. P. Jones, J. Hendrix\\n\";\n\t}\n\n\n\t// Publication Year\n\tif ( frm.pubyr.value == \"\" ) {\n\t errors += \"* The publication year may not be blank\\n\"; \n\t} else {\n\t if ( year.test( frm.pubyr.value ) == false ) {\n\t\terrors += \"* The publication year is invalid\\n\"; \n\t }\n\t}\n\n\n\t// Language\n\tif (frm.language && frm.language.selectedIndex != null) {\n var index = frm.language.selectedIndex;\n if ( index == 0 ) {\n\t\terrors += \"* The publication language must be selected\\n\"; \n } \n\t}\n\n\t// Publication Type\n\tif (frm.publication_type && frm.publication_type.selectedIndex != null) {\n var index = frm.publication_type.selectedIndex;\n if ( index == 0 ) {\n\t\terrors += \"* The publication type must be selected\\n\"; \n } else {\n\t\tif ( frm.publication_type.options[frm.publication_type.selectedIndex].text == \"book/book chapter\" ) {\n if ( frm.pubtitle.value == \"\" ) {\n\t\t\terrors += \"* If you select \\\"book/book chapter\\\", you are required to fill in its name\\n\"; \n }\n\t\t}\n }\n\t}\n\t// var contents = frm.editors.value;\n\t// var pattern = /(^[A-Z][a-z\\']+)|([A-Z]\\.$)/;\n\t// var result = contents.match(pattern);\n\tif ( frm.editors.value.match(other_authors) )\t{\n\t errors += \"* Names of editors must be formatted with \" +\n\t\t\" initials before last names\\n\"+\n\t\t\"Example: P. McCartney, J. P. Jones, J. Hendrix\\n\";\n\t}\n\t\n\tif ( ! ( frm.reftitle.value || frm.pubtitle.value ) )\n\t{\n\t errors += \"* You must include either a title or a publication name\\n\";\n\t}\n\t\n\t// if ( /[^A-Za-z0-9\\)\\]\\?\\!\"\\.]$/.test(frm.reftitle.value) )\t{\n\t// if ( /\\.$/.test(frm.reftitle.value) ) {\n\t//\terrors += \"* The reference's title must end with a letter\\n\";\n\t// }\n\tif ( /\\.$/.test(frm.reftitle.value) )\t{\n\t if ( ! / nov\\.$/.test(frm.reftitle.value) && ! /U\\.S\\.A\\.$/.test(frm.reftitle.value) && ! /U\\.S\\.S\\.R\\.$/.test(frm.reftitle.value) && ! / sp\\.$/.test(frm.reftitle.value) && ! / spec\\.$/.test(frm.reftitle.value) && ! / nov\\.$/.test(frm.reftitle.value) )\t{\n\t\twarnings += \"* A reference title shouldn't end with a period\\n\";\n\t\t// warning_count++;\n\t }\n\t}\n\telse if ( /\\.[^0-9 ]/.test(frm.reftitle.value) )\t{\n\t if ( ! / sp\\.(; | ,|\\)|)/.test(frm.reftitle.value) && ! / nov\\.(; |, |\\)|)/.test(frm.reftitle.value) && ! /U\\.S\\.A\\.(; |, |\\)|)/.test(frm.reftitle.value) && ! /U\\.S\\.S\\.R\\.(; |, |\\)|)/.test(frm.reftitle.value) )\t{\n\t\twarnings += \"* The reference title may include a stray period\\n\";\n\t\t// warning_count++;\n\t }\n\t}\n\t//if ( /[~@\\#\\$%\\^\\*_\\+\\{\\}\\|\\\\<>\\t\\n]/.test(frm.reftitle.value) || /[^A-Za-z0-9]\\//.test(frm.reftitle.value) || /[\\/][^A-Za-z0-9]/.test(frm.reftitle.value) || /[:;\\?\\!][A-Za-z0-9]/.test(frm.reftitle.value) )\t{\n\t//\terrors += \"* The reference's title includes weird characters\\n\";\n\t//}\n\tif ( /[^ ]\\&/.test(frm.reftitle.value) || /[^ ]\\&/.test(frm.pubtitle.value) )\t{\n\t errors += \"* There must be a space before &\\n\";\n\t}\n\tif ( /\\&[^ ]/.test(frm.reftitle.value) || /\\&[^ ]/.test(frm.pubtitle.value) )\t{\n\t errors += \"* There must be a space after &\\n\";\n\t}\n\tif ( / /.test(frm.reftitle.value) )\t{\n\t errors += \"* The reference's title includes extra spaces\\n\";\n\t}\n\tif ( all_caps.test(frm.reftitle.value) && ! all_lower.test(frm.reftitle.value) )\t{\n\t errors += \"* Don't capitalize the entire reference title\\n\";\n\t}\n\n\t// if ( /[^A-Za-z0-9\\)\\]\\?\\!\"]$/.test(frm.pubtitle.value) )\t{\n\tif ( /\\.$/.test(frm.pubtitle.value) ) {\n\t errors += \"* The book/serial name must end with a letter\\n\";\n\t}\n\tif ( /[~@\\#\\$%\\^\\*_\\+\\{\\}\\|\\\\<>\\t\\n]/.test(frm.pubtitle.value) || /[^A-Za-z0-9]\\//.test(frm.pubtitle.value) || /[\\/][^A-Za-z0-9]/.test(frm.pubtitle.value) || /[:;\\?\\!][A-Za-z0-9]/.test(frm.pubtitle.value) )\t{\n\t warnings += \"* The book/serial name includes weird characters\\n\";\n\t // warning_count++;\n\t}\n\tif ( /\\.[^0-9 ]/.test(frm.pubtitle.value) )\t{\n\t warnings += \"* The book/serial name may include a stray period\\n\";\n\t // warning_count++;\n\t}\n\tif ( / /.test(frm.pubtitle.value) )\t{\n\t errors += \"* The book/serial name includes extra spaces\\n\";\n\t}\n\tif ( all_caps.test(frm.pubtitle.value) && ! all_lower.test(frm.pubtitle.value) && ! /PLoS ONE/.test(frm.pubtitle.value) )\t{\n\t errors += \"* Don't capitalize the entire book/serial name\\n\";\n\t}\n\t// Report errors\n\t\n\tif ( errors != \"\" )\n\t{\n\t errors = errors + \"\\nPlease fix the problem and resubmit\";\n\t alert ( errors );\n\t warning_count = 0;\n\t return false;\n\t}\n\n\telse if ( warnings != \"\" && warning_count == 0 )\n\t{\n\t warning_count = 1;\n\t warnings = warnings + \"\\nPlease make sure there isn't a mistake and resubmit\\n\";\n\t alert ( warnings );\n\t return false;\n\t}\n\t\n\tfrm.check_status.value = \"done\";\n\treturn true;\n }\n\n this.checkForm = checkForm;\n\n\n function checkMuseumCollection ( )\n {\n\tvar frm = document.forms[form_name];\n\t\n\tvar errors = \"\";\n\tvar warnings = \"\";\n\t\n\tif ( ! frm.museum_name.value )\n\t{\n\t errors = errors + \"* You must specify the museum name\\n\";\n\t}\n\n\tif ( ! frm.museum_collection.value && ! no_collection_name )\n\t{\n\t warnings = warnings + \"* Please enter a collection name if you know it\\n\";\n\t}\n\n\tif ( ! frm.museum_acronym.value )\n\t{\n\t warnings = warnings + \"* Please enter the museum acronym if at all possible\\n\";\n\t}\n\t\n\tif ( frm.museum_city.value && ! frm.museum_country.value && ! no_country )\n\t{\n\t errors = errors + \"* If you specify a city, you must fill in the country and the state/province if there is one\\n\";\n\t}\n\t\n\telse if ( ! frm.museum_city.value && ! no_city )\n\t{\n\t warnings = warnings + \"* Please fill in the museum city, state/province, and country if at all possible\\n\";\n\t}\n\t\n\tif ( errors != \"\" )\n\t{\n\t errors = errors + \"\\nPlease fix the problem and resubmit\";\n\t alert ( errors );\n\t warning_count = 0;\n\t return false;\n\t}\n\t\n\telse if ( warnings != \"\" && warning_count == 0 )\n\t{\n\t warning_count = 1;\n\t warnings = warnings + \"\\nPlease make sure there isn't a mistake and resubmit\\n\";\n\t alert ( warnings );\n\t return false;\n\t}\n\t\n\tfrm.check_status.value = \"done\";\n\treturn true;\n }\n \n \n function adjustRefType()\n {\n\tvar frm = document.forms[form_name];\n\tvar pubtype = frm.publication_type.value;\n\t\n\tif ( pubtype == '' || pubtype == 'unpublished' )\n\t{\n\t document.getElementById('authorinfo').style.display = 'block';\n\t document.getElementById('museuminfo').style.display = 'none';\n\t document.getElementById('miscinfo').style.display = 'block';\n\t document.getElementById('addressinfo').style.display = 'none';\n\t document.getElementById('pubinfo').style.display = 'none';\n\t document.getElementById('editors').style.display = 'none';\t \n\t document.getElementById('titleinfo').style.display = 'block';\n\t document.getElementById('serialinfo').style.display = 'none';\n\t document.getElementById('volinfo').style.display = 'none';\n\t document.getElementById('pageinfo').style.display = 'none';\n\t}\n\t\n\telse if ( pubtype == 'museum collection' )\n\t{\n\t document.getElementById('authorinfo').style.display = 'none';\n\t document.getElementById('museuminfo').style.display = 'block';\n\t document.getElementById('miscinfo').style.display = 'none';\t \n\t document.getElementById('addressinfo').style.display = 'block';\n\t document.getElementById('pubinfo').style.display = 'none';\t \n\t document.getElementById('editors').style.display = 'none';\t \n\t document.getElementById('titleinfo').style.display = 'none';\n\t document.getElementById('serialinfo').style.display = 'none';\n\t document.getElementById('volinfo').style.display = 'none';\n\t document.getElementById('pageinfo').style.display = 'none';\n\t}\n\t\n\telse\n\t{\n\t document.getElementById('authorinfo').style.display = 'block';\n\t document.getElementById('museuminfo').style.display = 'none';\n\t document.getElementById('miscinfo').style.display = 'block';\n\t document.getElementById('addressinfo').style.display = 'none';\n\t document.getElementById('pubinfo').style.display = 'block';\n\t document.getElementById('editors').style.display = 'block';\t \n\t document.getElementById('titleinfo').style.display = 'block';\n\t document.getElementById('serialinfo').style.display = 'block';\n\t document.getElementById('volinfo').style.display = 'block';\n\t document.getElementById('pageinfo').style.display = 'block';\n\t}\n\t\n\t// If this is the initial call to this function, and if this is an edit of an existing\n\t// record, then record whether some of the optional fields are in fact missing. This will\n\t// prevent warnings from being given for them later.\n\n\tif ( frm.reference_no.value )\n\t{\n\t if ( ! frm.museum_collection.value )\n\t\tno_collection_name = 1;\n\n\t if ( ! frm.museum_city.value )\n\t\tno_city = 1;\n\n\t if ( ! frm.museum_country.value )\n\t\tno_country = 1;\n\t}\n\t\n\t//if ( pubtype == 'book' || pubtype == 'book chapter' || pubtype == 'book/book chapter' ||\n\t// pubtype == 'serial monograph' || pubtype == 'compendium' || pubtype == 'guidebook' )\n\t//{\n\t//\tdocument.getElementById('editors').style.display = 'inline';\n\t//} else {\n\t//\tdocument.getElementById('editors').style.display = 'none';\n\t//}\n\t\n\t//if ( pubtype == 'journal article' || pubtype == 'serial monograph' ||\n\t//\tpubtype == 'news article' || pubtype == 'abstract' )\n\t//{\n\t//\tdocument.getElementById('volinfo').style.display = 'inline';\n\t//} else {\n\t//\tdocument.getElementById('volinfo').style.display = 'none';\n\t//}\n\t\n\t//if ( pubtype == 'journal article' || pubtype == 'book chapter' ||\n\t//\tpubtype == 'book/book chapter' || pubtype == 'news article' || pubtype == 'abstract' )\n\t//{\n\t//\tdocument.getElementById('pageinfo').style.display = 'inline';\n\t//} else {\n\t//\tdocument.getElementById('pageinfo').style.display = 'none';\n\t//}\n }\n\n this.adjustRefType = adjustRefType;\n}", "title": "" }, { "docid": "ea0927f977c20bd700ac11a6aabc1169", "score": "0.5731433", "text": "function validateContactData( data ) {\n\t\n\tvar email = data.conEmail;\n\tvar msg = data.conMessage;\n\t\n\tif ( !ValidationUtil.isEmail( email ) ) {\n\t\t\n\t\talert( \"Email address invalid. Please submit a valid email address.\" );\n\t\treturn false;\n\t\t\n\t}\n\n\tif ( ValidationUtil.isEmpty( msg ) ) {\n\t\t\n\t\talert( \"Message cannot be blank. Please submit a message.\" );\n\t\treturn false;\n\t\t\n\t}\n\t\n\treturn true;\n\t\n}", "title": "" }, { "docid": "62e24b7340fb9349666d1aa2ccf1d37a", "score": "0.5729115", "text": "function registrationPreValidation (req, res, next) {\n if (req.body && req.body.solution && req.body.solution.contacts) {\n req.body.solution.contacts = _.filter(\n req.body.solution.contacts,\n c => `${c.contactType}${c.firstName}${c.lastName}${c.emailAddress}${c.phoneNumber}`.trim().length\n )\n }\n\n next()\n}", "title": "" }, { "docid": "7574756292b012d0b4876f52cba53ea3", "score": "0.5726138", "text": "function validateCompanyName(){\n\t\tvar cn = document.getElementById('companyName').value;\n\t\tif(cn.length < 2) {\n\t\t\t$('#cnameMsg').html('Enter your companies name');\n\t\t} else {\n\t\t\t$('#cnameMsg').html('');\n\t\t}\n\t}", "title": "" }, { "docid": "86545d137148ea8084b8e0cb912f1d8c", "score": "0.5709358", "text": "function ValidateForm()\n{\n\t\t// checking if it is empty \n var reemail, retel,repostal;\n var name = document.getElementById(\"name\").value; \n var phone = document.getElementById(\"phone\").value; \n var email = document.getElementById(\"email\").value; \n \tvar address = document.getElementById(\"address\").value; \n var postal = document.getElementById(\"postal\").value;\t\n\t\tif( name == null || name == \"\")\n\t\t{\n\t\t\tdocument.getElementById(\"errmsg\").innerHTML = \"<font color='red'>Name must be filled out.</font>\";\n\t\t\tdocument.cartfrm.name.focus();\n\t\t\treturn false;\n\t\t}\n if(phone == null || phone == \"\")\n\t\t{\n\t\t\tdocument.getElementById(\"errmsg\").innerHTML = \"<font color='red'>Phone number must be filled out.</font>\";\n\t\t\tdocument.cartfrm.phone.focus();\n\t\t\treturn false;\n\t\t}else \n\t\t{\n\t\t\tretel = validateTel(phone);\n\t\t\tif(retel==false)\n\t\t\t{\n document.getElementById(\"errmsg\").innerHTML = \"<font color='red'>Phone number should be ddd-ddd-dddd.</font>\";\n\t\t\t\tdocument.cartfrm.phone.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} \n\t\tif(email == null || email == \"\")\n\t\t{\n\t\t\tdocument.getElementById(\"errmsg\").innerHTML = \"<font color='red'>Email must be filled out.</font>\";\n\t\t\tdocument.cartfrm.email.focus();\n\t\t\treturn false;\n\t\t}else{\n reemail = validateEmail(email);\n if(reemail==false)\n {\n document.getElementById(\"errmsg\").innerHTML = \"<font color='red'>Not a good email address.</font>\";\n document.cartfrm.email.focus();\n return false;\n }\n }\n\t\tif(address == null || address == \"\")\n\t\t{\n\t\t\tdocument.getElementById(\"errmsg\").innerHTML = \"<font color='red'>Address must be filled out.</font>\";\n\t\t\tdocument.cartfrm.address.focus();\n\t\t\treturn false;\n\t\t}\n\t\tif(postal == null || postal == \"\")\n\t\t{\n\t\t\tdocument.getElementById(\"errmsg\").innerHTML = \"<font color='red'>Postal code must be filled out.</font>\";\n\t\t\tdocument.cartfrm.postal.focus();\n\t\t\treturn false;\n\t\t}else{\n repostal = postalFilter(postal);\n }\n if(repostal==false)\n\t\t{\n\t\t\tdocument.getElementById(\"errmsg\").innerHTML = \"<font color='red'>Not a good Postal code.</font>\";\n\t\t\tdocument.cartfrm.postal.focus();\n\t\t\treturn false;\n\t\t}\t\n\t\t\n}", "title": "" }, { "docid": "9aa1eae6f9b3042763c86d61c673c4f5", "score": "0.5699165", "text": "function ccHelp() {\r\n alert(\"1) Is there anyone you need to copy on this email?\");\r\n}", "title": "" }, { "docid": "309a109f995970da55f01f15fbe5b19f", "score": "0.56939316", "text": "function validateForm() {\n var x = document.forms[\"contactUs\"][\"fullName\"].value;\n if (x == \"\") {\n alert(\"Please enter a Name\");\n return false;\n }\n\t\n\tvar y = document.forms[\"contactUs\"][\"emailAdd\"].value;\n if (!y.includes(\"@\")) { //must include an @ symbol\n alert(\"Please enter a valid email\");\n return false;\n }\n\t\n\tvar z = document.forms[\"contactUs\"][\"dropdown\"].value;\n\tif (z == \"blank\") {\n\t\talert(\"Please select a choice\");\n\t\treturn false;\n\t\t}\n}", "title": "" }, { "docid": "76d672dadf7a27f09c4e4886f02082d4", "score": "0.5690133", "text": "function addcontact(fullname, number, email, address, notes, website)\n{\n if (typeof (plhandler) !== 'undefined' && plhandler !== null)\n return plhandler.AddContact(fullname, number, email, address, notes, website);\n else\n return false;\n}", "title": "" }, { "docid": "d86f8e2cc46f67c0b2ead2f9190f0514", "score": "0.5689982", "text": "function validateForm()\n{\n\tif(document.form.fName.value == \"\")\n\t{\n\t\talert(\"Enter your First Name!\");\n\t\tdocument.form.fName.focus();\n\t\treturn false;\n\t}\n\tif(document.form.lName.value == \"\")\n\t{\n\t\talert(\"Enter your Last Name!\");\n\t\tdocument.form.lName.focus();\n\t\treturn false;\n\t}\n\tif(document.form.fathersFirstName.value == \"\")\n\t{\n\t\talert(\"Enter your Father's First Name!\");\n\t\tdocument.form.fathersFirstName.focus();\n\t\treturn false;\n\t}\n\tif(document.form.fathersLastName.value == \"\")\n\t{\n\t\talert(\"Enter your Father's Last Name!\");\n\t\tdocument.form.fathersLastName.focus();\n\t\treturn false;\n\t}\n\tif(document.form.dob.value == \"\")\n\t{\n\t\talert(\"Enter your Date of Birth!\");\n\t\tdocument.form.dob.focus();\n\t\treturn false;\n\t}\n\tif(document.form.email.value == \"\")\n\t{\n\t\talert(\"Enter your Email ID!\");\n\t\tdocument.form.email.focus();\n\t\treturn false;\n\t}\n\tif(document.form.mobileNo.value == \"\")\n\t{\n\t\talert(\"Enter your Mobile Number!\");\n\t\tdocument.form.mobileNo.focus();\n\t\treturn false;\n\t}\n\tvar address = document.form.permAddress;\n\tif(trimfield(address.value) == \"\")\n\t{\n\t\talert( \"Enter your Permanent Address!\");\n\t\tdocument.form.permAddress.focus();\n\t\treturn false;\n\t}\n\taddress = document.form.commAddress;\n\tif(trimfield(address.value) == \"\")\n\t{\n\t\talert(\"Enter your Communication Address!\");\n\t\tdocument.form.commAddress.focus();\n\t\treturn false;\n\t}\n\tif(document.form.username.value == \"\")\n\t{\n\t\talert(\"Enter your username in aplphanumerics{[a-z],[A-Z],[0-9]} only!\");\n\t\tdocument.form.username.focus();\n\t\treturn false;\n\t}\n\tif(document.form.password1.value == \"\")\n\t{\n\t\talert(\"Enter a password for your account!\");\n\t\tdocument.form.password1.focus();\n\t\treturn false;\n\t}\n\tif(document.form.password2.value == \"\")\n\t{\n\t\talert(\"Confirm your password here!\");\n\t\tdocument.form.password2.focus();\n\t\treturn false;\n\t}\n\tif(document.form.iAgree.checked == false)\n\t{\n\t\talert(\"You need to agree with the terms and conditions!\");\n\t\tdocument.form.iAgree.focus();\n\t\treturn false;\t\n\t}\n\tif(confirm('Are you sure you want to submit it?'))\n\t\tupdateStudentTable();\n}", "title": "" }, { "docid": "618b8c072f011e869577647060fcd875", "score": "0.56812316", "text": "function validation()\n{\n\tvar a = document.form.name.value;\nif(a==\"\")\n{\nalert(\"Please Enter Your Name\");\ndocument.form.name.focus();\nreturn false;\n}\nif(!/^[A-Za-z ]+[A-Za-z0-9]*$/g.test(document.form.name.value))\n{\nalert(\"Please Enter Only Characters\");\ndocument.form.name.select();\nreturn false;\n}\n\nvar b = document.form.mobile.value;\nif(b==\"\")\n{\nalert(\"Please Enter Your Phone Number\");\ndocument.form.mobile.focus();\nreturn false;\n}\nif(isNaN(b))\n{\nalert(\"Please Enter Valid Phone Number\");\ndocument.form.mobile.focus();\nreturn false;\n}\nif(b.length<10)\n{\n\talert(\"Phone Number should be minimum 10 digits\");\n\tform.mobile.focus();\n\treturn false;\n}\n\nvar c = document.getElementById(\"email\").value;\nif(c == \"\")\n{\n\talert(\"Please Enter Your Email Id \");\n\treturn false;\n}\nif(c.indexOf('@')<=0)\n{\n\talert(\"Please Enter Valid Email-Id\");\n\treturn false;\n}\nif((c.charAt(c.length-4)!='.') && (c.charAt(c.length-3)!='.'))\n{\n\talert(\"Invalid Email-Id\");\n\treturn false;\n}\n\nreturn true;\n}", "title": "" }, { "docid": "0ff7c658d3793360a00c9763910af526", "score": "0.5680229", "text": "function validateForm()\n{\n //let form be contactForm\n let contactForm =document.forms;\n if(contactForm)//if contactFrom exists\n {\n //get element by id 'firstName' and let it be firstNameValidate\n let firstNameValidate =document.getElementById(\"firstName\");\n firstNameValidate.addEventListener(\"blur\",(event)=> //when the firstNameValidate has lost focus\n {\n if(firstNameValidate.value.length <2) //if the input length of firstName is less than 2\n {\n firstNameValidate.focus(); //make it get focus \n console.log(`your first name length is too short.`);//display this in console\n }\n else //if not\n {\n console.log(`your first name is saved`); //display this in console.\n }\n }); \n\n //get element by id 'lastName' and let it be lastNameValidate\n let lastNameValidate =document.getElementById(\"lastName\");\n lastNameValidate.addEventListener(\"blur\",(event)=> //when the lastNameValidate has lost focus\n {\n if(lastNameValidate.value.length <2) //if the input length of lastName is less than 2\n {\n lastNameValidate.focus(); //make it get focus \n console.log(`your last name length is too short.`);//display this in console\n }\n else//if not\n {\n console.log(`your last name is saved`);//display this in console\n }\n });\n\n //get element by id 'contactNumber' and let it be contactNumberValidate\n let contactNumberValidate =document.getElementById(\"contactNumber\");\n contactNumberValidate.addEventListener(\"blur\",(event)=> //when the contactNumberValidate has lost focus\n {\n if(contactNumberValidate.value.length <10) //if the input length of contact number is less than 10\n {\n contactNumberValidate.focus(); //make it get focus \n console.log(`your contact number length is less than 10.`); //display this in console\n }\n else //if not\n {\n console.log(`your contact number is saved`); //display this in console\n }\n });\n //get element by id 'emailName' and let it be emailAddressValidate\n let emailAddressValidate =document.getElementById(\"email\");\n emailAddressValidate.addEventListener(\"blur\",(event)=> //when the emailAddressValidate has lost focus\n {\n if(emailAddressValidate.value.length <=0) //if the user didn't put email address\n {\n emailAddressValidate.focus(); //make it get focus \n console.log(`please enter your email address`); //display this in console\n }\n else //if the user put email address\n {\n console.log(`your email address is saved`); //display this in console\n }\n });\n //get element by id 'yourMessage' and let it be yourMessageValidate\n let yourMessageValidate =document.getElementById(\"yourMessage\");\n yourMessageValidate.addEventListener(\"blur\",(event)=> //when the yourMessageValidate has lost focus\n {\n if(yourMessageValidate.value.length >50) //if length of message is more than 50\n {\n yourMessageValidate.focus(); //make it get focus \n console.log(`your message is too long. please write less than 50 letters`); //display this in console\n }\n else //if not\n {\n console.log(`your message is saved`); //display this in console\n }\n });\n\n\n\n }\n\n}", "title": "" }, { "docid": "289188a959aad4ad75e0443f32dfd7b0", "score": "0.5671905", "text": "function validate()\n {\n \n if( document.dporderform.shopname.value == \"\" )\n {\n alert( \"Please provide your ShopName / College Name!\" );\n document.dporderform.shopname.focus() ;\n return false;\n }\n\t\t if( document.dporderform.address.value == \"\" )\n {\n alert( \"Please provide your Address!\" );\n document.dporderform.address.focus() ;\n return false;\n }\n\t\t if( document.dporderform.city.value == \"\" )\n {\n alert( \"Please provide your City!\" );\n document.dporderform.city.focus() ;\n return false;\n }\n\t\t if( document.dporderform.postalcode.value == \"\" )\n {\n alert( \"Please provide your Postal Code!\" );\n document.dporderform.postalcode.focus() ;\n return false;\n }\n \n if( document.dporderform.district.value == \"\" )\n {\n alert( \"Please provide your District\" );\n document.dporderform.district.focus() ;\n return false;\n }\n\t\t \n\t\t if( document.dporderform.district.value == \"\" )\n {\n alert( \"Please provide your District\" );\n document.dporderform.district.focus() ;\n return false;\n }\n\t\t \n\t\t if( document.dporderform.state.value == \"\" )\n {\n alert( \"Please provide your State\" );\n document.dporderform.state.focus() ;\n return false;\n }\n \n\t\t if( document.dporderform.name.value == \"\" )\n {\n alert( \"Please provide your Name\" );\n document.dporderform.name.focus() ;\n return false;\n }\n \n if( document.dporderform.mobile.value == \"\" ||\n isNaN( document.dporderform.mobile.value ) ||\n document.dporderform.mobile.value.length != 10 )\n {\n alert( \"Please provide a mobile in the format #####.\" );\n document.dporderform.mobile.focus() ;\n return false;\n }\n if( document.dporderform.email.value == \"\" )\n {\n alert( \"Please provide your Email\" );\n document.dporderform.email.focus() ;\n return false;\n }\n \n\t \tif ( ( dporderform.board[0].checked == false ) && ( dporderform.board[1].checked == false ) ) \n\t\t{\n\t\talert ( \"Please Choose Yes or No\" ); \n\t\tdocument.dporderform.board[0].focus() ;\n\t\treturn false;\n\t\t}\n return( true );\n }", "title": "" }, { "docid": "5eb2c31a1ac2e07e7dc7bc3b8052cd86", "score": "0.56645674", "text": "function check_customerInfo_form(){\n var creditcard = document.forms[\"customerInfo\"][\"cc_number\"].value;\n var amno = /^(?:3[47][0-9]{13})$/;\n var mcno = /^(?:5[1-5][0-9]{14})$/;\n var vsno = /^(?:4[0-9]{16})$/;\n var cemail = document.forms[\"customerInfo\"][\"email\"].value;\n var mc = /\\S+@\\S+\\.\\S+/;\n var cname = document.forms[\"customerInfo\"][\"name\"].value;\n var nc = /^[a-zA-Z ]{1,30}$/;\n var uexp = document.forms[\"customerInfo\"][\"cc_exp\"].value;\n var uexpc = /^[0-9]{6}$/;\n var exp_year = uexp % 10000;\n var exp_month = (uexp - exp_year)/10000;\n var today = new Date();\n var ty = today.getFullYear();\n var tm = today.getMonth()+1;\n if (!cname.match(nc)){\n alert(\"Bad name\");\n return false;\n }\n if (!cemail.match(mc)){\n alert(\"The email address is incorrect\");\n return false;\n }\n if (!(creditcard.match(amno) || creditcard.match(vsno) || creditcard.match(mcno))){\n alert(\"Please input correct credit card number\");\n return false;\n }\n if (!uexp.match(uexpc)){\n alert(\"The expire date is incorrect\");\n return false;\n }\n if (exp_year < ty || (exp_year == ty && exp_month <= tm) || exp_month >12 ){\n alert(\"The expire date is incorrect\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "749ed160cef4c50de1f4dd892f3e9a08", "score": "0.5645449", "text": "function ImmediateCoNameCheck() {\n\tdoError(\"Start ImmediateCoNameCheck(), Name = |\" + d.main.Co_ApplicantName.value + \"|\");\n\treset_error();\n\tvalidate_co_name();\n\tif (error_cn) {\n\t\talert(errormsg);\n\t\treset_error();\n\t}\n}", "title": "" }, { "docid": "6627d0f0539fa379ebcb3ba1afdc687d", "score": "0.5641003", "text": "function validateForm() {\n var name = document.forms[\"contact\"][\"full_name\"].value;\n var email = document.forms[\"contact\"][\"email\"].value;\n var message = document.forms[\"contact\"][\"message\"].value;\n\n if (name == \"\" || email == \"\" || message == \"\") {\n alert(\"Details are missing in the contact form.\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "79f3332539528c98a8d80aa5a14677df", "score": "0.5638581", "text": "function rawContact2W3CContact(rawContact)\n{\n //Fill Contact Name\n var _contactName = new ContactName(rawContact.name['formatted'], rawContact.name['familyName'],\n rawContact.name['givenName'], rawContact.name['middleName'], rawContact.name['honorificPrefix'],\n rawContact.name['honorificSuffix']);\n\n //Phone Numbers\n var _contactPhoneNumbers = new Array(rawContact.phoneNumbers.length);\n for ( var j = 0; j < rawContact.phoneNumbers.length; j++)\n {\n _contactPhoneNumbers[j] = new ContactField(rawContact.phoneNumbers[j]['value'], rawContact.phoneNumbers[j]['type'],\n Boolean(rawContact.phoneNumbers[j]['pref'] == \"true\"));\n }\n\n //Email Addresses\n var _contactEmails = new Array(rawContact.emails.length);\n for ( var j = 0; j < rawContact.emails.length; j++)\n {\n _contactEmails[j] = new ContactField(rawContact.emails[j]['value'], rawContact.emails[j]['type'],\n Boolean(rawContact.emails[j]['pref'] == \"true\"));\n }\n\n //Post Addresses _formatted\n var _contactAddresses = new Array(rawContact.addresses.length);\n for ( var j = 0; j < rawContact.addresses.length; j++)\n {\n _contactAddresses[j] = new ContactAddress(rawContact.addresses[j]['formatted'], rawContact.addresses[j]['type'],\n rawContact.addresses[j]['streetAddress'], Boolean(rawContact.addresses[j]['pref'] == \"true\"));\n }\n\n //Instant Messengers\n var _contactIms = new Array(rawContact.ims.length);\n for ( var j = 0; j < rawContact.ims.length; j++)\n {\n _contactIms[j] = new ContactField(rawContact.ims[j]['value'], rawContact.ims[j]['type'],\n Boolean(rawContact.ims[j]['pref'] == \"true\"));\n }\n\n //Organizations\n var _contactOrgs = new Array(rawContact.organizations.length);\n for ( var j = 0; j < rawContact.organizations.length; j++)\n {\n _contactOrgs[j] = new ContactOrganization(rawContact.organizations[j]['name'], rawContact.organizations[j]['type'],\n Boolean(rawContact.organizations[j]['pref'] == \"true\"), rawContact.organizations[j]['title']);\n }\n\n //Urls\n var _contactUrls = new Array(rawContact.urls.length);\n for ( var j = 0; j < rawContact.urls.length; j++)\n {\n _contactUrls[j] = new ContactField(rawContact.urls[j]['value'], rawContact.urls[j]['type'],\n Boolean(rawContact.urls[j]['pref'] == \"true\"));\n }\n\n //Photos (always 1, with libGCal)\n var _contactPhotos = new Array(rawContact.photos.length);\n for ( var j = 0; j < rawContact.photos.length; j++)\n {\n //Constructor ContactField(_value, _type, _pref)\n var _photo = \"\";\n if (rawContact.photos[j]['value'].trim().indexOf('file:') === 0)\n {\n var fs = require('fs');\n var Buffer = require('buffer').Buffer;\n //var constants = require('constants');\n \n _photo = new Buffer(fs.readlinkSync(rawContact.photos[j]['value'].trim())).toString('base64');\n }\n else\n {\n _photo = rawContact.photos[j]['value'].trim();\n }\n \n _contactPhotos[j] = new ContactField(_photo, rawContact.photos[j]['type'],\n Boolean(rawContact.photos[j]['pref'] == \"true\"));\n }\n\n //Fill Contact\n /*\n * _id, _displayName, _name, _nickname, _phonenumbers, _emails, _addrs, _ims,\n * _orgs, _rev, _birthday, _gender, _note, _photos, _catgories, _urls,\n * _timezone\n *\n */\n\n var _contact = new Contact(rawContact.id, rawContact.displayName, _contactName, rawContact.nickname,\n _contactPhoneNumbers, _contactEmails, _contactAddresses, _contactIms, _contactOrgs, new Date(rawContact.revision),\n new Date(rawContact.birthday), rawContact.gender, rawContact.note, _contactPhotos, rawContact.categories,\n _contactUrls, rawContact.timezone);\n\n return _contact;\n}", "title": "" }, { "docid": "1ac7bb364ce2e2fa5a174294bdaedb1c", "score": "0.5631027", "text": "function formValidation(subject, body, queryString){\n\t\t\t\t\n\t\tvar message = \"Please fill out the following:\"; \n\t\tvar test = true; \t\t\t\t\t\t\t \n\t\t\t\t\n\t\tif(queryString == ''){ // If captcha not filled out\n\t\t\t\n\t\t\talert(\"Please fill out captcha.\");\n\t\t\treturn false;\n\t\t} \n\t\t\t\t\n\t\tif(subject == null || subject == \"\"){ // If email not filled out\n\t\t\t\n\t\t\ttest = false;\n\t\t\tmessage = message + \" subject\";\n\t\t} \n\t\t\n\t\tif(body == null || body == \"\"){ // If name not filled out\n\t\t\ttest = false;\n\t\t\tif(message.indexOf(\"subject\") != -1){\t\n\t\t\t\t\n\t\t\t\tmessage = message + \", body\";\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tmessage = message + \" body\";\n\t\t\t}\n\t\t} \n\t\t\t\t\n\t\tif(test == false){ // If tests fail show user message\n\t\t\t\n\t\t\talert(message + \".\");\n\t\t\treturn false;\n\t\t}\n\t\telse{ // Else tests pass\n\t\t\t\n\t\t\treturn true;\n\t\t} \t\t\n\t}", "title": "" }, { "docid": "9a93cd10277713eedc254eddf1e4d76b", "score": "0.5623156", "text": "function validate()\n { \n \n if( document.enquiryForm.name.value == \"\" )\n {\n alert( \"Please provide your name!\" );\n document.enquiryForm.name.focus() ;\n return false;\n }\n //if( ! document.enquiryForm.gender.checked || )\n /*if(!document.getElementById('gender').checked) \n {\n alert( \"Please provide your gendername!\" );\n //document.enquiryForm.name.focus() ;\n return false;\n }*/\n if( document.enquiryForm.phoneNo.value==\"\" )\n {\n alert( \"Please provide your phone number!\" );\n document.enquiryForm.phoneNo.focus() ;\n return false;\n }\n if( document.enquiryForm.address.value==\"\" )\n {\n alert( \"Please provide your address!\" );\n document.enquiryForm.address.focus() ;\n return false;\n }\n if( document.enquiryForm.email.value==\"\" )\n {\n alert( \"Please provide your email!\" );\n document.enquiryForm.email.focus() ;\n return false;\n } \n return (true);\n }", "title": "" }, { "docid": "d1ad76636cd5c207312091898d7e5bb0", "score": "0.56212753", "text": "function compose_email() {\n\n // Show compose view and hide other views\n document.querySelector('#emails-view').style.display = 'none';\n document.querySelector('#email-detail-view').style.display = 'none'\n document.querySelector('#compose-view').style.display = 'block';\n\n // Clear out composition fields\n document.querySelector('#compose-recipients').value = '';\n document.querySelector('#compose-subject').value = '';\n document.querySelector('#compose-body').value = '';\n\n // check for optional argument\n if (arguments.length != 0) {\n console.log(arguments[0])\n const context = arguments[0]\n\n document.querySelector('#compose-recipients').value = context.sender;\n // check if subject already starts with \"Re:\", if not add it\n if (context.subject.slice(0, 4) === 'Re: ') {\n document.querySelector('#compose-subject').value = context.subject;\n } else {\n document.querySelector('#compose-subject').value = 'Re: ' + context.subject;\n }\n\n document.querySelector('#compose-body').value = context.timestamp + \" \" + context.sender + \" wrote: \" + context.body;\n\n }\n\n} // end of compose_email", "title": "" }, { "docid": "06c7c01f735ced81d29396b08eb20bf1", "score": "0.5608216", "text": "function CF_submit(obj,url) \r\n{\r\n\tif(document.getElementById(\"CF_email\")){\r\n\t\t_e=document.getElementById(\"CF_email\");\r\n\t\tstr= str + \"&CF_email=\" + encodeURI( document.getElementById(\"CF_email\").value ) \r\n\t}\r\n\tif(document.getElementById(\"CF_name\")){\r\n\t\t_n=document.getElementById(\"CF_name\");\r\n\t\tstr= str + \"&CF_name=\" + encodeURI( document.getElementById(\"CF_name\").value ) \r\n\t}\r\n\tif(document.getElementById(\"CF_message\")){\r\n\t\t_m=document.getElementById(\"CF_message\");\r\n\t\tstr= str + \"&CF_message=\" + encodeURI( document.getElementById(\"CF_message\").value ) \r\n\t}\r\n\tif(document.getElementById(\"CF_subject\")){\r\n\t\t_s=document.getElementById(\"CF_subject\");\r\n\t\tstr= str + \"&CF_subject=\" + encodeURI( document.getElementById(\"CF_subject\").value ) \r\n\t}\r\n\tif(document.getElementById(\"CF_captcha\")){\r\n\t\t_c=document.getElementById(\"CF_captcha\");\r\n\t\tstr= str + \"&CF_captcha=\" + encodeURI( document.getElementById(\"CF_captcha\").value ) \r\n\t}\r\n\t\r\n\t/* Validation */\r\n\tif(document.getElementById(\"CF_name\") && _n.value==\"\")\r\n\t{\r\n\t\talert(\"Please enter the name.\");\r\n\t\t_n.focus();\r\n\t\treturn false; \r\n\t}\r\n\telse if(document.getElementById(\"CF_email\") && _e.value==\"\")\r\n\t{\r\n\t\talert(\"Please enter the email address.\");\r\n\t\t_e.focus();\r\n\t\treturn false; \r\n\t}\r\n\telse if(document.getElementById(\"CF_email\") && _e.value!=\"\" && (_e.value.indexOf(\"@\",0)==-1 || _e.value.indexOf(\".\",0)==-1))\r\n\t{\r\n\t\talert(\"Please enter valid email.\")\r\n\t\t_e.focus();\r\n\t\t_e.select();\r\n\t\treturn false;\r\n\t} \r\n\telse if(document.getElementById(\"CF_subject\") && _s.value==\"\")\r\n\t{\r\n\t\talert(\"Please enter your subject.\");\r\n\t\t_s.focus();\r\n\t\treturn false; \r\n\t}\r\n\telse if(document.getElementById(\"CF_message\") && _m.value==\"\")\r\n\t{\r\n\t\talert(\"Please enter your message.\");\r\n\t\t_m.focus();\r\n\t\treturn false; \r\n\t}\r\n\telse if(document.getElementById(\"CF_captcha\") && _c.value==\"\")\r\n\t{\r\n\t\talert(\"Please enter enter below security code.\");\r\n\t\t_c.focus();\r\n\t\treturn false; \r\n\t}\r\n\r\n\r\n\tdocument.getElementById('CF_alertmessage').innerHTML = \"Sending...\";\r\n\r\n\t/* Redirecting the values to mail.php */\r\n\tCFPOSTRequest(url+'mail.php', str);\r\n}", "title": "" }, { "docid": "c02277a8a5c0bf308c0f3ead0d221128", "score": "0.5605582", "text": "function validateForm9() {\n if( document.operatorAddContactForm.name.value == \"\" )\n {\n alert( \"Please enter your name\" );\n document.operatorAddContactForm.name.focus() ;\n return false;\n }\n if( document.operatorAddContactForm.surName.value == \"\" )\n {\n alert( \"Please enter your surname\" );\n document.operatorAddContactForm.surName.focus() ;\n return false;\n }\n if( document.operatorAddContactForm.contactNumber.value == \"\" )\n {\n alert( \"Please enter a contact number\" );\n document.operatorAddContactForm.contactNumber.focus() ;\n return false;\n }\n var x=document.forms[\"operatorAddContactForm\"][\"email\"].value;\n var atpos=x.indexOf(\"@\");\n var dotpos=x.lastIndexOf(\".\");\n if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)\n {\n alert(\"Please enter a valid email address\");\n return false;\n }\n\n}", "title": "" }, { "docid": "f17100f8f65db314cce300624e354b74", "score": "0.5601536", "text": "function validateForm() {\n // Retrieving the values of form elements \n var id = document.contactForm.id.value;\n var password = document.contactForm.password.value;\n var usertype = document.contactForm.usertype.value;\n \n\t// Defining error variables with a default value\n var idErr = passwordErr = usertypeErr = true;\n \n\n // Validate name\n if(id == \"\") {\n printError(\"idErr\", \"Please enter your id\");\n } else {\n printError(\"idErr\", \"\");\n idErr = false;\n \n }\n // Validate email address\n if(password == \"\") {\n printError(\"passwordErr\", \"Please enter your password\");\n } else {\n printError(\"passwordErr\", \"\");\n passwordErr = false;\n \n }\n // Validate name\n if(usertype == \"\") {\n printError(\"usertypeErr\", \"Please enter your usertype\");\n } else {\n printError(\"usertypeErr\", \"\");\n usertypeErr = false;\n \n }\n \n \n // Prevent the form from being submitted if there are any errors\n if((idErr || passwordErr || usertypeErr) == true) {\n return false;\n } else {\n // Creating a string from input data for preview\n var dataPreview = \"You've entered the following details: \\n\" +\n \n \"New password: \" + password + \"\\n\";\n \n \n \n // Display input data in a dialog box before submitting the form\n alert(dataPreview);\n }\n}", "title": "" }, { "docid": "e5395815b8fbdbfc97a5299635ee6bfa", "score": "0.560044", "text": "function validarContacto() {\r\n if (validarFormulario()) {\r\n guardarConsulta();\r\n }\r\n}", "title": "" }, { "docid": "8ddf4360de3a44084d84680a5c7e2177", "score": "0.5599731", "text": "function formSubmit(form) {\r\n //window.location = \"mailto:[email protected]\";\r\n var name = document.getElementById(\"name\").value;\r\n var email = document.getElementById(\"email\").value;\r\n var message = document.getElementById(\"message\").value;\r\n var randomNum = Math.floor((Math.random() * 10000) + 1);\r\n var inquire = \"INQ-\" + randomNum;\r\n\r\n if (name === \"Name...\" || email === \"Email...\" || message === \"Message...\") {\r\n window.alert(\"You have to fill out all three fields.\");\r\n } else {\r\n window.location.href = \"mailto:[email protected]?subject=Consulting Inquiry&body=Name: \" + name\r\n + \"%0d%0a%0d%0aEmail: \" + email + \"%0d%0a%0d%0aInquiry Number: \" + inquire + \"%0d%0a%0d%0aInquiry Question:%0d%0a\" + message;\r\n }\r\n}", "title": "" }, { "docid": "a4c0136337fba9786bedf69e91070bff", "score": "0.5598274", "text": "function validateForm() {\n\t\t\t//Creates variable that grabs input of form and the index of essential symbols @ and .\n \t\tvar x = document.forms[\"myForm\"][\"email\"].value;\n \t\tvar atpos = x.indexOf(\"@\");\n \t\tvar dotpos = x.lastIndexOf(\".\");\n \t\t//Tests to see if email address fits valid email format and if incorrect triggers not a valid e-mail address\n \t\tif (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length) {\n \t\t\t//Javascript for Invalid Email Modal\n \t\t$(\"#invalidModal\").show();\n\t\t\t\tfunction invalidModal () {\n\t\t\t\t\t$(\"#invalidModal\").hide();\n\t\t\t\t}\n\t\t\t\t$(document).on(\"click\", \".invalidClose\", invalidModal);\n \t\treturn false;\n \t\t}\n \t\t//If format is correct, it sends the e-mail\n \t\telse {\n \t\t\temailjs.send(\"gmail\",\"events_template\",{\n \t\t\t\tto_email: emailAdd, \n \t\t\t\thtml: tableHTML\n\t\t\t\t});\n\t\t\t\t//Javascript for Sent Message Modal\n\t\t \t$(\"#sentModal\").show();\n\t\t\t\tfunction sentModal () {\n\t\t\t\t\t$(\"#sentModal\").hide();\n\t\t\t\t}\n\t\t\t\t$(document).on(\"click\", \".sentClose\", sentModal);;\n\t\t \treturn true;\n \t\t}\n\t\t}", "title": "" }, { "docid": "6a792c0f28524bb6df6864c1c71987e4", "score": "0.55938005", "text": "function validateSendMoneyForm(){\n\t// user contact no.\n\tvar c = document.getElementById(\"mobile\").value;\n\tif(c == null || c == \"\" || c == \" \")\n\t{\n\t\talert(\"Please enter user contactNo !\");\n\t\treturn false;\n\t}\n\tif(c.length!=10)\n\t\t{\n\t\talert(\"Please enter 10 digit correct mobile no.\");\n\t\t}\n\t rz=/^[0-9]+$/;\n\t\n\t \tif(!(rz.test(c)))\n\t \t{\n\t \t\tflag=false;\n\t \t\talert(\"mobile number should contain numbers only\");\n\t \t\tdocument.getElementById(\"mobile\").value = \"\";\n\t \t}\n\n\n// validation of beneficiary name\n\n\n var f = document.getElementById(\"firstname\").value;\n if(f == \"\")\n \t {\n\talert(\"Enter Beneficiary Name\");\n\treturn false;\n \t}\n \n rz=/^[A-Za-z]+$/;\n \tif(!(rz.test(f)))\n \t{\n \t\tflag=false;\n \t\talert(\"First name should contain characters only\");\n \t\tdocument.getElementById(\"firstname\").value = \"\";\n \t}\n \tif(f.length>30)\n \t\t{\n \t\talert(\"Please enter less than 30 characters\");\n \t\treturn false;\n \t\t}\n\t//validation of beneficiary mobile number\n \t\n \tvar c = document.getElementById(\"mobilenumber\").value;\n\tif(c == null || c == \"\" || c == \" \")\n\t{\n\t\talert(\"Please enter beneficiary contactNo !\");\n\t\treturn false;\n\t}\n\tif(c.length!=10)\n\t\t{\n\t\talert(\"Please enter 10 digit correct mobile no.\");\n\t\t}\n\t rz=/^[0-9]+$/;\n\t\n\t \tif(!(rz.test(c)))\n\t \t{\n\t \t\tflag=false;\n\t \t\talert(\"mobile number should contain numbers only\");\n\t \t\tdocument.getElementById(\"mobile\").value = \"\";\n\t \t}\t\n\t\n}", "title": "" }, { "docid": "c30b0552e8669799e3f60666968d1800", "score": "0.5592966", "text": "function validateSendNewsletter(){\n\tquestion = trim(document.getElementById('NewsletterTitle').value);\t \t\n \n\tvar errorString = \"\";\n\t if(question == ''){\n errorString = errorString + \"-Please enter newsletter title. <br>\";\n\t}\n\t\n\tif(errorString != \"\"){\n\t\twindow.scrollTo(0,0);\n\t\tdocument.getElementById(\"jsError\").innerHTML = errorDiv+errorString+\"</p>\"; \n\t\treturn false;\n\t}\n\telse{\n\t\treturn true;\n\t }\n\t}", "title": "" }, { "docid": "142c573d336d04179fbba1cbb7a40e6d", "score": "0.5591137", "text": "function validateCorreo(){\n\t\n// section correo \n\tvar email = document.getElementById(\"input-email\");\n\tvar correo = document.createTextNode(\"verifica tu correo\");\n\tvar salida3 = document.createTextNode(\"correo invalido\");\n\tvar expresion = /^[a-zA-Z0-9_\\.\\-]+@[a-zA-Z0-9\\-]+\\.[a-zA-Z0-9\\-\\.]+$/;\n\tif(email.value == \"\"){\n\t\tmensaje(\"input-email\", correo);\n\t}\n\telse if(!expresion.test(email.value)){\n\t\tmensaje(\"input-email\", salida3);\n\t}\n\telse{\n\t\teliminar(\"input-email\");\n\t}\n}", "title": "" }, { "docid": "a35116b19449a73c556fd84f3182a03b", "score": "0.5585913", "text": "function validate()\n{\n \n var reg = /[a-zA-Z][a-zA-Z0-9.]+@([a-zA-Z][a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,100}/;\n if (!reg.test(document.forms[0].email.value))\n {\n alert(\"Invalid email address\");\n // Validating Email\n return false;\n }\n document.forms[0].postal.value = document.forms[0].postal.value.toUpperCase();\n var reg2 = /(^[A-Z]\\d[A-Z] ?\\d[A-Z]\\d$)|(^\\d{5}( ?\\d{4})?$)/i;\n if (!reg2.test(document.forms[0].postal.value))\n {\n alert(\"Invalid postal code\");\n // Validating Postal Code\n return false;\n }\n return confirm(\"Continue Submitting?\");\n }", "title": "" }, { "docid": "93926825665597a62859332b6090ef38", "score": "0.5580585", "text": "function Contact(firstName, lastName, phoneNumber, emails, workAddress, homeAddress) {\n this.firstName = firstName,\n this.lastName = lastName,\n this.phoneNumber = phoneNumber,\n this.emails = emails,\n this.workAddress = workAddress,\n this.homeAddress = homeAddress\n}", "title": "" }, { "docid": "5f4e04fc9ed154a531ff16bb0e1f6dd5", "score": "0.5576094", "text": "function formValidation()\n{\n var uname = document.registration.username;\n var uemail = document.registration.email;\n var uphone = document.registration.phone;\n if (allLetter(uname)) \n { \n if (ValidateEmail(uemail)) \n {\n if(phonenumber(uphone))\n {\n }\n\n }\n return false;\n }\n}", "title": "" }, { "docid": "8b13b97e532ad111b8fab6591ef636c2", "score": "0.55752516", "text": "function Contact(firstName, lastName, phoneNumber, emailHome, addressHome, emailWork, addressWork) {\n this.firstName = firstName,\n this.lastName = lastName,\n this.phoneNumber = phoneNumber,\n this.emailHome = emailHome,\n this.addressHome = addressHome,\n this.emailWork = emailWork,\n this.addressWork = addressWork\n // function hideEmpty() {\n // if (this.addressHome == null) {\n // $(\"#address-home\").hide;\n // // this.addressHome.remove();\n // }\n // }\n}", "title": "" }, { "docid": "be867ac0e87dddff567290be8aa01340", "score": "0.5569867", "text": "function validationContact(e){\n\n // default behavior of submit event is avoided\n e.preventDefault();\n // run checkInputs function instead\n validInputs();\n \n // all inputs must be true so the form can be submitted correctly\n // if so, confirmation message and red close button are displayed\n if(formValid === true) {\n form.style.display = 'none';\n console.log(lastName.value, firstName.value, email.value, message.value);\n \n return true;\n }\n \n}", "title": "" }, { "docid": "d7e7712ea231f53b5665a57940110a51", "score": "0.5564627", "text": "function validateAndSaveCustomer() {\n\t// hide all validation messages\n\n\thideAllValidationMessages();\n\tvar isFirstName = nameValidation(\"firstName\", \"firstNameValidationMessage\");\n\tvar isLastName = nameValidation(\"lastName\", \"lastNameValidationMessage\");\n\tvar isPhone = phoneNumberValidation();\n\tvar isEmail = emailValidation();\n\tvar isaddress = addressValidation();\n\tvar iscompany = companyValidation();\n\n\tif (isFirstName && isLastName && isPhone && isEmail && isaddress && iscompany) {\n\t\thideAllValidationMessages();\n\t\tsaveCustomer();\n\t\temptyAllFields();\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "22356d5195cc276256d6961df68f0143", "score": "0.5564529", "text": "function validate() {\n\n datetimepicker = document.getElementById('datetimepicker').value \n fName = document.getElementById('form6Example1').value \n lName = document.getElementById('form6Example2').value \n var service = document.getElementById('serviceid').value\n const phone = document.getElementById(\"form6Example6\").value;\n const creditcard = document.getElementById(\"form6Example7\").value;\n var phoneRGEX = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\\s\\.]{0,1}[0-9]{3}[-\\s\\.]{0,1}[0-9]{4}$/;\n var cardregexp = /^[(]{0,1}[0-9]{4}[)]{0,1}[-\\s\\.]{0,1}[0-9]{4}[-\\s\\.]{0,1}[0-9]{4}[-\\s\\.]{0,1}[0-9]{4}$/;\n \n var phoneResult = phoneRGEX.test(phone);\n var cardResult = cardregexp.test(creditcard)\n \n if(phoneResult == false) {\n alert( \"Please enter your phone number with the proper format! e.g. 123-456-7899 or 1234567899\");\n return false;\n }\n else if (cardResult == false) {\n alert( \"Please enter your credit card number with the proper format! e.g. 1234-1234-1234-1234\");\n return false;\n }\n else{\n alert(\"Thanks for booking!\\n\"+\n \"Your booking time: \" + datetimepicker+\n \"\\nYour name: \" + fName +\" \"+lName +\n \"\\nYour Service: \"+service);\n }\n }", "title": "" }, { "docid": "d347ec999bb04fde8ceb96cfdcba5543", "score": "0.55554885", "text": "function formValidation(){\n var fname = document.customerRegistration.firstName\n var lname = document.customerRegistration.lastName\n var phone = document.customerRegistration.phoneNo\n var nin = document.customerRegistration.nin\n\n event.preventDefault()\n \n if(allLetter(fname)){\n if(lastnameValidate(lname)){\n if(allnumeric(phone)){\n if(nin_Validation(nin, 3,13)){\n\n }\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "973c2eab1b52a0358f84862a59dfbb45", "score": "0.5544728", "text": "function validateOwnerDetails() {\n\tvalid = true;\n\tif (ownerDetailsForm.ownerName.value == \"\") {\n\t\talert(\"Please Enter the ownerName\");\n\t\townerDetailsForm.ownerName.focus();\n\t\treturn false;\n\t}\n\t\tif (alphabet(ownerDetailsForm.ownerName) == false) {\n\t\treturn false;\n\t}\n\n\tif (ownerDetailsForm.permanentAddress.value == \"\") {\n\t\talert(\"Please Enter Address\");\n\t\townerDetailsForm.permanentAddress.focus();\n\t\treturn false;\n\t}\n\tif ((ownerDetailsForm.permanentCountry.value != \"\") && (ownerDetailsForm.permanentCountry.selectedIndex == 0)) {\n\t\talert(\"Please Select Country\");\n\t\townerDetailsForm.permanentCountry.focus();\n\t\treturn false;\n\t}\n\n\tif (ownerDetailsForm.permanentState.selectedIndex == 0) {\n\t\talert(\"Please Select State\");\n\t\townerDetailsForm.permanentState.focus();\n\t\treturn false;\n\t}\n\n\tif (ownerDetailsForm.permanentDistrictId.selectedIndex == 0) {\n\t\talert(\"Please Select District\");\n\t\townerDetailsForm.permanentDistrictId.focus();\n\t\treturn false;\n\t}\n\tif (ownerDetailsForm.permanentCity.selectedIndex == 0) {\n\t\talert(\"Please Select City\");\n\t\townerDetailsForm.permanentCity.focus();\n\t\treturn false;\n\t}\n\tif (ownerDetailsForm.permanentPostOffice.selectedIndex == 0) {\n\t\talert(\"Please Select Post Office\");\n\t\townerDetailsForm.permanentPostOffice.focus();\n\t\treturn false;\n\t}\n\tif (ownerDetailsForm.permanentPin.selectedIndex == 0) {\n\t\talert(\"Please Select PIN Code\");\n\t\townerDetailsForm.permanentPin.focus();\n\t\treturn false;\n\t}\n\tif (ownerDetailsForm.ownerPhone.value == \"\") {\n\t\talert(\"Please Enter Your Phone No.\");\n\t\townerDetailsForm.ownerPhone.focus();\n\t\treturn false;\n\t}\n\tif (numeric(ownerDetailsForm.ownerPhone) == false) {\n\t\treturn false;\n\t}\n\t/*if ( ownerDetailsForm.ownerPhone.value.length > 1) {\n\t\talert(\"Please Enter a Valid Phone No.\");\n\t\townerDetailsForm.ownerPhone.value = \"\";\n\t\townerDetailsForm.ownerPhone.focus();\n\t\treturn false;\n\t}*/\n\n\tif (ownerDetailsForm.ownerEmailId.value == \"\") {\n\t\talert(\"Please Enter Your E Mail Id\");\n\t\townerDetailsForm.ownerEmailId.focus();\n\t\treturn false;\n\t}\n\tif (emailValidator(ownerDetailsForm.email) == false) {\n\t\treturn false;\n\t}\n else {\n\t\treturn valid;\n\t}\n}", "title": "" }, { "docid": "3dc62f6b417b0b1ba653070e900e988c", "score": "0.5541488", "text": "function formSubmitted() {\n let name=document.getElementById(\"name\").value;\n let email=document.getElementById(\"email\").value;\n mycontact=new Contact(name, email);\n console.log(mycontact);\n abm.add(mycontact);\n abm.displayContactTable(\"contacts\");\n return false;\n\n //YOUR CODE HERE\n}", "title": "" }, { "docid": "3c5faa9d714e75c6c6390b391366e10f", "score": "0.5535488", "text": "function validationContact(){\n let isError = false;\n const warning = document.getElementById(\"warning\");\n warning.innerHTML = \"\";\n let inputIds = [\"firstname\", \"name\", \"email\", \"adresse\", \"city\"];\n let inputTexts = [\"firstname\",\"name\", \"mail\", \"adresse\", \"ville\"];\n for (let i = 0; i < inputIds.length; i++){\n const input = document.getElementById(inputIds[i]);\n \n if (inputIds[i] === \"name\" || inputIds[i] === \"firstname\" || inputIds[i] === \"city\"){\n if (isAlpha(input.value) === false){\n isError = true;\n warning.appendChild(alertMessage(\"text-warning\",\"Merci de renseigner votre \"+ inputTexts[i]+ \" \" + \"en toutes lettres\" +\".\"));\n }\n }\n if (inputIds[i] === \"email\"){\n if (validateEmail(input.value) === false){\n isError = true;\n warning.appendChild(alertMessage(\"text-warning\",\"Merci de renseigner une adresse \" + inputTexts[i] +\" \" + \"valide\"));\n }\n }\n if (inputIds[i] === \"adresse\"){\n if (isAdresse(input.value) === false){\n isError = true;\n warning.appendChild(alertMessage(\"text-warning\",\"Merci de renseigner votre \" + inputTexts[i] +\" \" + \"postale\"));\n }\n }\n \n }\n return isError;\n}", "title": "" }, { "docid": "0676d179748109af6d18746d9a6ddad9", "score": "0.55303526", "text": "function uniqueContact(e)\n{\n\tvar c1 = Ti.App.Properties.getString($.lbl_contact1Name+\"_name\");\n\tvar c1_phone = Ti.App.Properties.getString($.lbl_contact1Name+\"_phone\");\n\tif(e.person.fullName == c1 && e.value == c1_phone)\n\t\treturn false;\n\t\n\t/*var c2 = Ti.App.Properties.getString($.lbl_contact2Name+\"_name\");\n\tvar c2_phone = Ti.App.Properties.getString($.lbl_contact2Name+\"_phone\");\n\tif(e.person.fullName == c2 && e.value == c2_phone)\n\t\treturn false;\n\t\n\tvar c3 = Ti.App.Properties.getString($.lbl_contact3Name+\"_name\");\n\tvar c3_phone = Ti.App.Properties.getString($.lbl_contact3Name+\"_phone\");\n\tif(e.person.fullName == c3 && e.value == c3_phone)\n\t\treturn false;\n\t*/\n\t\n\treturn true;\n}", "title": "" }, { "docid": "e1b121552317339001311181de8d8b2d", "score": "0.55300426", "text": "function contactUs()\n{\n templatePage(\"ContactUs\");\n}", "title": "" }, { "docid": "e98ae36b927a3ac7a98780359bf828c8", "score": "0.5528252", "text": "function validate(){\n\n var name = document.myform.name.value;\n var phone = document.myform.phone.value;\n var email = document.myform.email.value;\n\n var namepatt = /^[a-zA-Z\\s]+$/i;\n var phonepatt = /^[0-9]{10}$/i;\n var emailpatt = /^\\S+@\\S+\\.\\S+$/i;\n\n if(name == \"\"){\n alert(\"Enter Name.\");\n return false;\n }\n else if(!(namepatt.test(name))){\n alert(\"Name must only consist of alphabets.\");\n return false;\n }\n\n if(phone == \"\"){\n alert(\"Enter Phone.\");\n return false;\n }\n else if(!(phonepatt.test(phone))){\n alert(\"Phone number must consist of only 10 digits with no alphabets.\");\n return false;\n }\n\n if(email == \"\"){\n alert(\"Enter Email.\");\n return false;\n }\n else if(!(emailpatt.test(email))){\n alert(\"Email must consist of @ and . in order.\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "467a371c8d594a37aaabf6e5a2879b09", "score": "0.5519219", "text": "function ContactName()\n{\n\t\"use strict\";\n}", "title": "" }, { "docid": "c5c6d9f259c5d0bb7296722fbf7316d0", "score": "0.5518706", "text": "function validateBilling(event){\n event.preventDefault();\n \n // form2 validation\n // array that will keep track of the not valid fields.\n var formIsValid = [];\n // counter will contain 1 for each valid field.\n var counter=0;\n \n // name validation\n var nameEX = new RegExp(/^[a-zA-Z ]+$/);\n \n // compare with regular expression, if not modifi the css to alert user.\n if (!nameEX.test(theNameB.value)){\n theNameEB.innerHTML =\"Please enter a valid name\";\n theNameB.style.border = \"2px solid red\";\n theNameB.setAttribute(\"class\", \"invalid\");\n // push the word invalid to the array to keep track of invalid fields\n formIsValid.push(\"invalid\");\n }else{\n theNameB.style.border = \"1px solid #bda990\";\n theNameB.setAttribute(\"class\", \"valid\");\n theNameEB.innerHTML =\"\";\n // push the word valid to the array to keep track of valid fields\n formIsValid.push(\"valid\");\n };\n //last name\n if (!nameEX.test(lastNameB.value)){\n lastNameEB.innerHTML =\"Please enter a valid Lastname\";\n lastNameB.style.border = \"2px solid red\";\n lastNameB.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n lastNameB.style.border = \"1px solid #bda990\";\n lastNameB.setAttribute(\"class\", \"valid\");\n lastNameEB.innerHTML =\"\";\n formIsValid.push(\"valid\");\n };\n \n //Street\n var streetEXB = new RegExp(/^[a-zA-Z0-9 ]+$/);\n if (!streetEXB.test(streetB.value)){\n streetEB.innerHTML =\"Please enter a valid Street\";\n streetB.style.border = \"2px solid red\";\n streetB.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n streetB.style.border = \"1px solid #bda990\";\n streetB.setAttribute(\"class\", \"valid\");\n streetEB.innerHTML =\"\";\n formIsValid.push(\"valid\");\n };\n \n \n //apt number\n var aptnumbEX = new RegExp(/^[0-9]+$/);\n if (!aptnumbEX.test(aptnumbB.value)){\n aptnumbEB.innerHTML =\"Please enter a valid Apt. nubmer\";\n aptnumbB.style.border = \"2px solid red\";\n aptnumbB.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n aptnumbB.style.border = \"1px solid #bda990\";\n aptnumbB.setAttribute(\"class\", \"valid\");\n aptnumbEB.innerHTML =\"\";\n formIsValid.push(\"valid\");\n };\n \n //city\n if (!nameEX.test(cityB.value)){\n cityEB.innerHTML =\"Please enter a valid City Name\";\n cityB.style.border = \"2px solid red\";\n cityB.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n cityB.style.border = \"1px solid #bda990\";\n cityB.setAttribute(\"class\", \"valid\");\n cityEB.innerHTML =\"\";\n formIsValid.push(\"valid\");\n };\n //State\n var stateEX = new RegExp(/^[a-zA-Z]{2}$/);\n if (!stateEX.test(stateB.value)){\n stateEB.innerHTML =\"Please enter a 2 letters State Name\";\n stateB.style.border = \"2px solid red\";\n stateB.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n stateB.style.border = \"1px solid #bda990\";\n stateB.setAttribute(\"class\", \"valid\");\n stateEB.innerHTML =\"\";\n formIsValid.push(\"valid\");\n };\n //zip\n var zipEX = new RegExp(/^[0-9]{5}$/);\n if (!zipEX.test(zipB.value)){\n zipEB.innerHTML =\"Please enter a 5 digits zip code\";\n zipB.style.border = \"2px solid red\";\n zipB.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n zipB.style.border = \"1px solid #bda990\";\n zipB.setAttribute(\"class\", \"valid\");\n zipEB.innerHTML =\"\";\n formIsValid.push(\"valid\");\n };\n //other \n var showing = otherFieldB.style.display;\n // do this if the Other Address type field is visible\n if(showing ==\"block\"){ \n \n if (!nameEX.test(othertypeB.value)){\n othertypeEB.innerHTML =\"Please enter Other type of Address\";\n othertypeB.style.border = \"2px solid red\";\n othertypeB.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n othertypeB.style.border = \"1px solid #bda990\";\n othertypeB.setAttribute(\"class\", \"valid\");\n othertypeEB.innerHTML =\"\";\n formIsValid.push(\"valid\");\n };\n };\n \n // Credit Card \n if (selectedCard.value ==\"null\"){\n selectedCardE.innerHTML =\"Please select a card type\";\n selectedCard.style.border = \"2px solid red\";\n selectedCard.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n selectedCard.style.border = \"1px solid #bda990\";\n selectedCardE.innerHTML =\"\";\n formIsValid.push(\"valid\");\n };\n\n \n // Expression to make sure the field contains just numbers\n var justNumbers = new RegExp(/\\d/g);\n \n // Validate carDate;\n validateCardDate();\n \n// validate cvc number more than 3 digits and only numbes using Expression above.\n if( cvcN.value.length >2 && justNumbers.test(Number(cvcN.value))){ \n cvcerrorMSG.innerHTML = \"\";\n cvcN.setAttribute(\"class\", \"valid\"); \n cvcN.style.border = \"1px solid #bda990\";\n creditCard.cvcNumerIsValid = true;\n formIsValid.push(\"valid\");\n }else{\n cvcerrorMSG.innerHTML = \"Please, type a valid cvc number\";\n cvcN.style.border = '2px solid red';\n cvcN.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n };\n \n \n \n // make sure card field is not empty\n if(!cardN.value == true){\n cardError.innerHTML = \"Please, type a valid credit card number\";\n cardN.style.border = '2px solid red';\n cardN.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n }else{\n if (justNumbers.test(Number(cardN.value))){\n // do if card is just Numbers\n cardError.innerHTML = \"\";\n cardN.setAttribute(\"class\", \"valid\");\n formIsValid.push(\"valid\");\n \n // call function to validate card type and place to Crecit Card object\n creditCard.cardNumberIsValid = validatedcarType();\n console.log(creditCard);\n }else{\n cardError.innerHTML = \"Please, type only numbers\";\n cardN.style.border = '2px solid red';\n cardN.setAttribute(\"class\", \"invalid\");\n formIsValid.push(\"invalid\");\n };\n };\n \n\n // for loop to go over all the element on the array and see if they are all valid\n for (var i=0; i<formIsValid.length ; i++){\n if(formIsValid[i] == \"invalid\")\n {\n //There is at least one invalid field scroll back to the top to see errors\n window.scrollTo(0, 620); \n break;\n }else{ \n //add 1 to counter if field is valid\n counter ++;}\n \n };// end for loop\n \n // if counter is as long as the Array all the fields are valid.\n if( counter == Number(formIsValid.length) && creditCard.cardNumberIsValid == true && creditCard.dateIsValid == true){\n window.alert(\"Thanks you. Your order has been submited.\");\n }\n\n \n}// End function validate card Number", "title": "" }, { "docid": "537a8e1073df86e11d1bf38dfba73de8", "score": "0.5517283", "text": "function ContactField()\n{\n \"use strict\";\n}", "title": "" }, { "docid": "7f84f8d93f13605ccf80b2a5d546c848", "score": "0.5511607", "text": "function ContactAddress()\n{\n \"use strict\";\n}", "title": "" }, { "docid": "c87b263e05979ba9606277e9b0b62023", "score": "0.5509562", "text": "function addContact(){\n\t\t\t\tvar contNo = new contactNumber('output');\n\t\t\t\tcontNo.addContact($('#fName').val(),$('#lName').val(),$('#mobileNo').val(),$('#email').val(),$('#address').val() );\n\t\t\t}", "title": "" }, { "docid": "7e432bfb0c55ac62e6c497d529838e94", "score": "0.55021864", "text": "function contactcompany(contactresult) {\n\n //create paragraph for company contact textInfo\n var contactText = document.createElement('p');\n\n //set classname for abouttext abouttext paragraph\n contactText.className += 'contactInfo';\n\n contactText.innerHTML += '<span class=\"setfont\"><b>Address: </b>' + contactresult.headquarters.address + '</span>';\n contactText.innerHTML += '<span class=\"setfont\"><b>City: </b>' + contactresult.headquarters.city + '</span>';\n contactText.innerHTML += '<span class=\"setfont\"><b>State: </b>' + contactresult.headquarters.state + '</span>';\n contactText.innerHTML += '<span class=\"setfont\"><b>Website: </b>' + '<a href=\"' + contactresult.links.website + '\" target=\"_blank\">' + contactresult.links.website + '</a>' + '</span>';\n contactText.innerHTML += '<span class=\"setfont\"><b>Flickr: </b>' + '<a href=\"' + contactresult.links.flickr + '\" target=\"_blank\">' + contactresult.links.flickr + '</a>' + '</span>';\n contactText.innerHTML += '<span class=\"setfont\"><b>Twitter: </b>' + '<a class = \"weblinks\" href=\"' + contactresult.links.twitter + '\" target=\"_blank\">' + contactresult.links.twitter + '</a>' + '</span>';\n\n //append contactText data to contactcompany which is defined in innerHTML\n document.getElementById('contactcompany').appendChild(contactText);\n }", "title": "" }, { "docid": "c079e3932fd38dedee9b2563a0864f94", "score": "0.5498741", "text": "constructionMail(result, data, uid) {\n let to = \"\";\n let cc = \"\";\n let i = 0;\n let surplusTo = [];\n let surplusCc = [];\n let html = data.toString();\n\n html = html.replace(\"%%SUBJECT%%\", result.subject);\n html = html.replace(\"%%FROM_NAME%%\", result.from.value[0].name);\n html = html.replace(\"%%FROM%%\", result.from.value[0].address);\n\n let virgule = \"\";\n to = '<tr><td class=\"header-title\">À</td><td class=\"header to\">';\n result.to.value.forEach(value => {\n i++;\n if (i <= 5) {\n if (value.name != \"\") {\n to += virgule + \"<span class='adr'><a href='#' class='rcmContactAddress' title = \" + value.address + \">\" + value.name + \"</a></span>\";\n }\n else {\n to += virgule + \"<span class='adr'><a href='#' class='rcmContactAddress' title = \" + value.address + \">\" + value.address + \"</a></span>\";\n }\n virgule = \", \";\n }\n else {\n surplusTo.push(value.address);\n }\n })\n if (surplusTo.length > 0) {\n to += \"<a class='morelink' href='#' title='\" + surplusTo + \"'>\" + (i - 5) + \" de plus... </a>\"\n }\n to += '</td></tr>';\n\n\n if (result.cc != undefined) {\n i = 0;\n cc = '<tr><td class=\"header-title\">Cc</td><td class=\"header cc\">';\n virgule = \"\";\n result.cc.value.forEach(value => {\n i++;\n if (i <= 5) {\n if (value.name != \"\") {\n cc += virgule + \"<span class='adr'><a href='#' class='rcmContactAddress' title = \" + value.address + \">\" + value.name + \"</a></span>\";\n }\n else {\n cc += virgule + \"<span class='adr'><a href='#' class='rcmContactAddress' title = \" + value.address + \">\" + value.address + \"</a></span>\";\n }\n virgule = \", \";\n }\n else {\n surplusCc.push(value.address);\n }\n })\n if (surplusCc.length > 0) {\n cc += \"<a class='morelink' href='#' title='\" + surplusCc + \"'>\" + (i - 5) + \" de plus... </a>\"\n }\n cc += '</td></tr>';\n }\n\n html = html.replace(\"%%TOCC%%\", to + cc);\n\n let date = new Date(result.date);\n let date_fr = date.toLocaleString('fr-FR', { timeZone: 'UTC' })\n html = html.replace(\"%%DATE%%\", date_fr);\n\n // const regex = /(<style(.*?)*)(\\n.*?)*<\\/style>/;\n html = html.replace(\"%%OBJECT%%\", result.object);\n // html = html.replace(\"%%OBJECT%%\", result.object.replace(regex, \"\"));\n\n //Traitement des pièces jointes\n if (result.attachments != []) {\n result.attachments.forEach(element => {\n if (element['contentDisposition'] != \"attachment\") {\n html = html.replace('cid:' + element['cid'], \"data:\" + element['ctype'] + \";base64, \" + element['buf'].toString('base64'));\n }\n else {\n let filename = element['filename'];\n let ctype = element['ctype'].split('/');\n // let size = \" (~\" + functions.formatBytes(element['buf'].toString().length, 0) + \")\";\n\n html = html.replace('style=\"display: none;\"', '');\n html = html.replace('%%ATTACHMENT%%', \"<li id='attach2' class='application \" + ctype[1] + \"'><a href='#' onclick='openAttachment(\" + uid + \",\" + element[\"partid\"] + \")' id='attachment' title='\" + filename + \"'>\" + filename + \"</a></li>%%ATTACHMENT%%\");\n }\n })\n }\n\n html = html.replace('%%ATTACHMENT%%', '');\n return html;\n }", "title": "" }, { "docid": "0a6ecb88cc352fb99890becf81df2c90", "score": "0.5494471", "text": "function ContactOrganization(_name, _type, _pref, _title, _department)\n{\n \"use strict\";\n if (_pref)\n {\n this.pref = Boolean(_pref);\n }\n if (_type)\n {\n this.type = _type;\n }\n if (_name)\n {\n this.name = _name;\n }\n if (_department)\n {\n this.department = _department;\n }\n if (_title)\n {\n this.title = _title;\n }\n}", "title": "" }, { "docid": "19f1bbee74fbe6041de9955559ca7bcf", "score": "0.54941964", "text": "function validation() {\n var firstname = document.getElementById('firstname').value;\n var surname = document.getElementById('surname').value;\n var email = document.getElementById('adress').value;\n var email = document.getElementById('email').value;\n // var marketing = document.getElementById('marketing').value;\n var emailReg = mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\n\n if (firstname === '' || surname === '' || email === '') {\n alert('Please fill all fields!');\n return false;\n }\n else if (!(email).match(emailReg)) {\n alert('Invalid Email!');\n return false;\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "be9947458b0dd667049da5e24094df47", "score": "0.5492874", "text": "function validateHome()\n{ \n \nvar headtitle= trim(document.getElementById('UserFirstname').value);\nvar UserLastname= trim(document.getElementById('UserLastname').value);\t \nvar UserEmail= trim(document.getElementById('UserEmail').value);\t\n var UserAddress1= trim(document.getElementById('UserAddress1').value);\t \n var ContentStatus = trim(document.getElementById('UserStatus').value); \n\nvar UserHomeAreaCode = trim(document.getElementById('UserHomeAreaCode').value);\n\nvar UserHomeContact = trim(document.getElementById('UserHomeContact').value);\n var UserMobileNo= trim(document.getElementById('UserMobileNo').value);\n var errorString = \"\";\nvar UserSecurityQuestion1=trim(document.getElementById('UserSecurityQuestion1').value);\n\nvar UserAnswer1 = trim(document.getElementById('UserAnswer1').value);\n\nvar UserSecurityQuestion2=trim(document.getElementById('UserSecurityQuestion2').value);\n\nvar UserAnswer2= trim(document.getElementById('UserAnswer2').value);\n\n\n//var UserPassword = trim(document.getElementById('UserPassword').value); \n\n//var UserConfirmPassword= trim(document.getElementById('UserConfirmPassword').value);\n\nvar UserZipcode= trim(document.getElementById('UserZipcode').value); \n var userHomeContactId= trim(document.getElementById('UserHomeContactId').value); \n// var UserPassword= trim(document.getElementById('UserPassword').value);\n //var UserConfirmPassword= trim(document.getElementById('UserConfirmPassword').value);\n\n\nvar alphaTest=/^[a-zA-Z ]{1,20}$/i;\n\n\n var errorString = \"\";\n\tif(headtitle == ''){\n\n \n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserFirstname').focus();\n\t\t}\n errorString =errorString+\"-Please enter Firstname.<br/>\"; \n\t}else if(alphaTest.test(headtitle)== false){\n\n\n\n\n \n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserFirstname').focus();\n\t\t}\t\t\n\t\t errorString = errorString + \"-Please enter Firstname in characters only.<br>\"; \n \n\n\n\t} \n\t \n\tif(UserLastname== ''){\n\n \n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserLastname').focus();\n\t\t}\n errorString =errorString+\"-Please enter Lastname.<br/>\"; \n\t}else if(alphaTest.test(UserLastname)== false){\n\n\n\n\n \n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserLastname').focus();\n\t\t}\t\t\n\t\t errorString = errorString + \"-Please enter Last name in characters only.<br>\"; \n \n\n \n\t} \n\tif(UserEmail== ''){\n\n \n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserEmail').focus();\n\t\t}\n errorString =errorString+\"-Please enter Email.<br/>\"; \n\t}\n\n if(UserEmail!= ''){\n\t\n\tvar reg = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\t\tvar address = UserEmail;\n\t\tif(reg.test(address) == false) {\n\t\t\tif(errorString==''){\n\t\t\t\tdocument.getElementById('UserEmail').focus();\n\t\t\t}\n\t\terrorString = errorString + \"-Email Address is not valid. <br>\";\n\t\t \n\t\t}\n\t} \n if(UserAddress1== ''){\n\n \n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserAddress1').focus();\n\t\t}\n errorString =errorString+\"-Please enter First Address<br/>\"; \n\t} \t\n \n if(UserZipcode==''){\n\n if(errorString==''){\n\t\t\tdocument.getElementById('UserZipcode').focus();\n\t\t}\n errorString = errorString + \"-Please enter zip code. <br>\"; \n\t}\n\n\n\n \n \n if((UserHomeAreaCode=='')&&(UserHomeContact=='')){\n if(errorString==''){\n\t\t\tdocument.getElementById('UserHomeAreaCode').focus();\n\t\t}\n\n\n errorString = errorString + \"-Please specify Home area Code. <br>\"; \n \n\n \n\t}\nif(UserMobileNo==''){\n\n if(errorString==''){\n\t\t\tdocument.getElementById('UserMobileNo').focus();\n\t\t}\n errorString = errorString + \"-Please enter User Mobile No <br>\"; \n \n\n \n\t} \n /* var digit_matches=UserPassword.match(/\\d{1,}\\.{0,}\\d{0,}/);\n if(UserPassword==''){\n errorString = errorString + \"-Please enter User Password <br>\"; \n document.getElementById('UserPassword').focus(); \n\t}else if(UserPassword.length<6){\n\t\tif(errorString==''){\n\t\t\tdocument.getElementById('UserPassword').focus();\n\t\t}\n\t\terrorString = errorString + \"-Password is too short (minimum is 6 characters).<br>\";\n\t} \n\nif(UserConfirmPassword!=UserPassword)\n{\n\n\nif(errorString==''){\n\t\t\tdocument.getElementById('UserConfirmPassword').focus();\n\t\t}\n\t\terrorString = errorString + \"-Please Confirm your Password.<br>\";\n}\n*/\n if(UserSecurityQuestion1 ==''){\n\n if(errorString==''){\n\t\t\tdocument.getElementById('UserSecurityQuestion1').focus();\n\t\t}\n errorString = errorString + \"-Please select your Security Question1. <br>\"; \n\t}\nif(UserAnswer1==''){\n\n if(errorString==''){\n\t\t\tdocument.getElementById('UserAnswer1').focus();\n\t\t}\n errorString = errorString + \"-Please enter your Answer for Security Question1. <br>\"; \n\t}\nif(UserSecurityQuestion2==''){\n\n if(errorString==''){\n\t\t\tdocument.getElementById('UserSecurityQuestion2').focus();\n\t\t}\n errorString = errorString + \"-Please select your Security Question2. <br>\"; \n\t}\nif(UserAnswer2==''){\n\n if(errorString==''){\n\t\t\tdocument.getElementById('UserAnswer2').focus();\n\t\t}\n errorString = errorString + \"-Please enter your Answer for Security Question2. <br>\"; \n\t}\n\n\n\n\n\n\n\n\n if(ContentStatus ==''){\n\n if(errorString==''){\n\t\t\tdocument.getElementById('UserStatus').focus();\n\t\t}\n errorString = errorString + \"-Please select User status. <br>\"; \n\t}\n\n\n\n\n if(errorString != \"\"){\n\t\twindow.scrollTo(0,0);\n\t\tdocument.getElementById(\"jsError\").innerHTML = errorDiv+errorString+\"</p>\"; \n\t\treturn false;\n\t}\n\telse{\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "157f3dcdf7e3260bfad701d3432383ed", "score": "0.54890674", "text": "function ValidateContactUs() {\n\n var title = $(\"#name\").val();\n\n var err = \"\";\n if (title == \"Name\" || title == \"\" || title == null) {\n $(\"#name\").addClass(\"validation\");\n\n var err = \"error\";\n } else {\n $(\"#name\").removeClass(\"validation\");\n }\n var email = $(\"#email1\").val();\n if (!(/(.+)@(.+){2,}\\.(.+){2,}/.test(email))) {\n $(\"#email1\").addClass(\"validation\");\n\n var err = \"error\";\n } else {\n $(\"#email1\").removeClass(\"validation\");\n }\n var title = $(\"#message\").val();\n if (title == \"Message\" || title == \"\" || title == null) {\n $(\"#message\").addClass(\"validation\");\n var err = \"error\";\n } else {\n $(\"#message\").removeClass(\"validation\");\n }\n return err;\n}", "title": "" }, { "docid": "12f0043e06f48bd2b76f019f021bedd1", "score": "0.54887205", "text": "function validate(){\n var name = document.getElementById(\"name\").value;\n var subject = document.getElementById(\"subject\").value;\n var phone = document.getElementById(\"phone\").value;\n var email = document.getElementById(\"email\").value;\n var error_message = document.getElementById(\"error_message\");\n \n error_message.style.padding = \"10px\";\n \n var text;\n if(name.length < 5){\n text = \"Please Enter valid Name\";\n error_message.innerHTML = text;\n return false;\n }\n if(subject.length < 5){\n text = \"Please Enter Correct Address\";\n error_message.innerHTML = text;\n return false;\n }\n if(isNaN(phone) || phone.length < 8){\n text = \"Please Enter valid Phone Number\";\n error_message.innerHTML = text;\n return false;\n }\n if(email.indexOf(\"@\") == -1 || email.length < 4){\n text = \"Please Enter valid Email\";\n error_message.innerHTML = text;\n return false;\n }\n alert(\"Thank you for the order!\");\n return true;\n }", "title": "" }, { "docid": "e09dd81e4fe8cb9f85b8ab0aca2da913", "score": "0.5488113", "text": "function formComplete() {\r\n const h1 = document.createElement(\"h1\");\r\n h1.classList.add(\"end\");\r\n h1.appendChild(\r\n document.createTextNode(\r\n `Thanks ${\r\n questions[0].answer\r\n }, We will be getting into contact with you soon!`\r\n )\r\n );\r\n setTimeout(() => {\r\n formBox.parentElement.appendChild(h1);\r\n setTimeout(() => (h1.style.opacity = 1), 50);\r\n }, 1000);\r\n\r\n window.location.href =\r\n \"mailto:[email protected]?subject=Venue Booking Request \" +\r\n questions[3].answer +\r\n \"&body=From \" +\r\n questions[0].answer +\r\n \", %0D%0A I would like to enquire about hosting a \" +\r\n questions[2].answer +\r\n \" event on \" +\r\n questions[3].answer +\r\n \". \" +\r\n questions[4].answer +\r\n \". %0D%0A With Regards, %0D%0A \" +\r\n questions[0].answer;\r\n}", "title": "" }, { "docid": "73348b825b60b38d6666d44f3d597f16", "score": "0.5488054", "text": "function ValidateCustContactSelections() {\n\n var isValid = false;\n RemoveOutlineBorders($(\"#orderDatePicker\"));\n DisplayErrorMessage('', $('#lblErrorMessageCrtOrdr'));\n var customerDdl = $(\"#selectCustSupp\");\n\n if (isValidDropDownListSelection(customerDdl)) {\n\n RemoveOutlineBorders(customerDdl);\n isValid = true;\n var contactDdl = $(\"#selectContact\");\n\n if (isValidDropDownListSelection(contactDdl)) {\n DisplayErrorMessage('', $('#lblErrorMessageCrtOrdr'));\n RemoveOutlineBorders(contactDdl);\n isValid = true;\n }\n else {\n DisplayErrorMessage('Error : Please select contact person to create an order', $('#lblErrorMessageCrtOrdr'));\n ApplyErrorBorder(contactDdl);\n isValid = false;\n }\n }\n else {\n DisplayErrorMessage('Error : Please select customer company to create an order', $('#lblErrorMessageCrtOrdr'));\n ApplyErrorBorder(customerDdl);\n isValid = false;\n }\n return isValid;\n }", "title": "" }, { "docid": "21bffc9c971487e47b6346ff074f5d07", "score": "0.54876465", "text": "function formSubmit(){\n\t\n\t\n\tvar name = document.getElementById('name').value;\n\tvar email = document.getElementById('email').value;\n\tvar phone = document.getElementById('phone').value;\n\tvar state = document.getElementById('state').value;\n\tvar course = document.getElementById('course').value;\n\tvar address = document.getElementById('address').value;\n\n\t// validate Name ///\n\tif(name==\"\"){\n\t\tdocument.getElementById('errMsg1').style.display='block';\n\t\tdocument.getElementById('errMsg1').innerHTML='Fields Are Required';\n\t\treturn false;\n\t}else if( (name.length <=3) || (name.length>15) ) {\n\t\tdocument.getElementById('errMsg1').style.display='block';\n\t\tdocument.getElementById('errMsg1').innerHTML=' Name must be between 3 or 15 Charecter';\n\t\treturn false;\n\t}\n\telse if(!isNaN(name) ) {\n\t\tdocument.getElementById('errMsg1').style.display='block';\n\t\tdocument.getElementById('errMsg1').innerHTML='Numbers are not allowed';\n\t\treturn false;\n\t}\n\t// validate Name End ///\n\n\t// validate email ///\n\tif(email==\"\"){\n\t\tdocument.getElementById('errMsg2').style.display='block';\n\t\tdocument.getElementById('errMsg2').innerHTML='Fields Are Required';\n\t\treturn false;\n\t}else if(email.indexOf('@') <=0){\n\t\tdocument.getElementById('errMsg2').style.display='block';\n\t\tdocument.getElementById('errMsg2').innerHTML='@ position invalid';\n\t\treturn false;\n\t}\n\t// validate email ///\n\n\t// validate phone ///\n\tif(phone==\"\"){\n\t\tdocument.getElementById('errMsg3').style.display='block';\n\t\tdocument.getElementById('errMsg3').innerHTML='Fields Are Required';\n\t\treturn false;\n\t}else if(isNaN(phone)){\n\t\tdocument.getElementById('errMsg3').style.display='block';\n\t\tdocument.getElementById('errMsg3').innerHTML='Only number are allowed';\n\t\treturn false;\n\t}else if((phone.length < 10) || (phone.length > 10)){\n\t\tdocument.getElementById('errMsg3').style.display='block';\n\t\tdocument.getElementById('errMsg3').innerHTML='mobile number must be 10 digit';\n\t\treturn false;\n\t}\n\t// validate phone ///\n\n\t// validate state\n\tif(state==\"\"){\n\t\tdocument.getElementById('errMsg4').style.display='block';\n\t\tdocument.getElementById('errMsg4').innerHTML='Fields Are Required';\n\t\treturn false;\n\t}\n\t// validate state\n\n\t// validate course\n\tif(course==\"\"){\n\t\tdocument.getElementById('errMsg5').style.display='block';\n\t\tdocument.getElementById('errMsg5').innerHTML='Fields Are Required';\n\t\treturn false;\n\t}\n\t// validate course\n\n\n\t// validate address\n\tif(address==\"\"){\n\t\tdocument.getElementById('errMsg6').style.display='block';\n\t\tdocument.getElementById('errMsg6').innerHTML='Fields Are Required';\n\t\treturn false;\n\t}\n\tif((address.length<5) || (address.length>20)){\n\t\tdocument.getElementById('errMsg6').style.display='block';\n\t\tdocument.getElementById('errMsg6').innerHTML='Address should be 5 to 20 Charecters';\n\t\treturn false;\n\t}\n\t// validate address\n\n\n\t\n}", "title": "" }, { "docid": "80e0f5776296882ed500fd680d836e29", "score": "0.54876035", "text": "function validateBookingForm() {\r\n // Retrieving the values of form elements \r\n var name = document.bookingForm.bname.value;\r\n var email = document.bookingForm.bemail.value;\r\n var mobile = document.bookingForm.bmobile.value;\r\n\tvar address = document.bookingForm.baddress.value; \r\n var appointment = document.bookingForm.bappointment.value;\r\n\tvar date = document.bookingForm.bdate.value;\r\n\tvar occasion = document.bookingForm.boccasion.value;\r\n \r\n\t\r\n \t\t\r\n\t// Defining error variables with a default value\r\n var bnameErr = bemailErr = bmobileErr = baddErr = bappErr = boccErr = bdateErr = true;\r\n\t\r\n\t\r\n\t\r\n \r\n \r\n\r\nvar today = new Date();\r\nvar time = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();\r\n if ( date == \"\" ) { \r\n\t\t printError(\"bdateErr\", \"Please select your date\");\r\n } else {\r\n \r\n if(date == time) {\r\n printError(\"bdateErr\", \"Please enter a good date\");\r\n } else {\r\n printError(\"bdateErr\", \"\");\r\n bdateErr = false;\r\n }\r\n }\r\n\t\t\r\n\t\t\r\n\t\r\n\t\r\n \r\n // Validate name\r\n if(name == \"\") {\r\n printError(\"bnameErr\", \"Please enter your name\");\r\n } else {\r\n var regex = /^[a-zA-Z\\s]+$/; \r\n if(regex.test(name) === false) {\r\n printError(\"bnameErr\", \"Please enter a valid name\");\r\n } else {\r\n printError(\"bnameErr\", \"\");\r\n bnameErr = false;\r\n }\r\n }\r\n \r\n // Validate email address\r\n if(email == \"\") {\r\n printError(\"bemailErr\", \"Please enter your email address\");\r\n } else {\r\n // Regular expression for basic email validation\r\n var regex = /^\\S+@\\S+\\.\\S+$/;\r\n if(regex.test(email) === false) {\r\n printError(\"bemailErr\", \"Please enter a valid email address\");\r\n } else{\r\n printError(\"bemailErr\", \"\");\r\n bemailErr = false;\r\n }\r\n }\r\n \r\n // Validate mobile number\r\n if(mobile == \"\") {\r\n printError(\"bmobileErr\", \"Please enter your mobile number\");\r\n } else {\r\n var regex = /^[5]+[1-9]\\d{6}$/;\r\n if(regex.test(mobile) === false) {\r\n printError(\"bmobileErr\", \"Please enter a valid 8 digit mobile number\");\r\n } else{\r\n printError(\"bmobileErr\", \"\");\r\n bmobileErr = false;\r\n }\r\n }\r\n \r\n\t// Validate address\r\n if(address == \"\") {\r\n printError(\"baddErr\", \"Please enter your address\");\r\n } else {\r\n var regex = /^[a-zA-Z0-9\\s][a-zA-Z0-9\\s,-]+$/; \r\n if(regex.test(address) === false) {\r\n printError(\"baddErr\", \"Please enter a valid address\");\r\n } else {\r\n printError(\"baddErr\", \"\");\r\n baddErr = false;\r\n }\r\n }\r\n\t \r\n // Validate appointment\r\n if(appointment == \"\") {\r\n printError(\"bappErr\", \"Please select your appointment type\");\r\n } else {\r\n printError(\"bappErr\", \"\");\r\n bappErr = false;\r\n }\r\n\t// Validate occasion\r\n if(occasion == \"Select\") {\r\n printError(\"boccErr\", \"Please select your occasion\");\r\n } else {\r\n printError(\"boccErr\", \"\");\r\n boccErr = false;\r\n }\r\n \r\n // Prevent the form from being submitted if there are any errors\r\n if((bnameErr || bemailErr || bmobileErr || baddErr || bappErr || boccErr || bdateErr ) == true) {\r\n return false;\r\n } else {\r\n // Creating a string from input data for preview\r\n var dataPreview = \"You've entered the following details: \\n\" +\r\n \"Full Name: \" + name + \"\\n\" +\r\n \"Email Address: \" + email + \"\\n\" +\r\n \"Mobile Number: \" + mobile + \"\\n\" +\r\n\t\t\t\t\t\t \"Address: \" + address + \"\\n\"+\r\n\t\t\t\t\t\t \"Appointment Type: \" + appointment + \"\\n\"+\r\n\t\t\t\t\t\t \"Date: \" + date + \"\\n\"+\r\n \"Occasion: \" + occasion + \"\\n\" ;\r\n \r\n\t\t\t\t\t\t \r\n \r\n // Display input data in a dialog box before submitting the form\r\n alert(dataPreview);\r\n }\r\n}", "title": "" }, { "docid": "8f21fda9548f89d5fdceeb828747c68e", "score": "0.5482995", "text": "function updateContact() {\r\n\r\n}", "title": "" }, { "docid": "81fa74665d2b1f917a3d8aa32ec61239", "score": "0.54822457", "text": "function validateAddAuthor(){\n p=addAuthorName();\n if(p==true)\n q=addAuthorWork();\n if(q==true)\n r=addAuthorCat();\n if(r==true)\n alert(\"Success\");\n }", "title": "" }, { "docid": "3679e9977c2d7ce5ffa87b17f22e8f64", "score": "0.5479832", "text": "function societyRegistrationValidation()\n{\n\n\t if( document.getElementById('back') != null && document.getElementById('back')!=\"undefined\" && document.getElementById('back').value !=\"Back\")\n\t {\n\t return true;\n\t }\n\n\t if(document.societyRegistrationForm.societyName.value.trim().length==0)\n\t {\n\t alert(\"Pls Enter Society Name \");\n\t document.societyRegistrationForm.societyName.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.societyName.value !=\"\" && !alphabet(document.societyRegistrationForm.societyName))\n\t {\n\t document.societyRegistrationForm.societyName.focus();\n\t return false;\n\n\t }\n\t else if(document.societyRegistrationForm.societyPresidentName.value.trim().length==0)\n\t {\n\t alert(\"Pls Enter President Name \");\n\t document.societyRegistrationForm.societyPresidentName.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.societyPresidentName.value !=\"\" && !alphabet(document.societyRegistrationForm.societyPresidentName))\n\t {\n\t document.societyRegistrationForm.societyPresidentName.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.societySecretaryName.value.trim().length==0)\n\t {\n\t alert(\"Pls Enter Secretary Name \");\n\t document.societyRegistrationForm.societySecretaryName.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.societySecretaryName.value !=\"\" && !alphabet(document.societyRegistrationForm.societySecretaryName))\n\t {\n\t document.societyRegistrationForm.societyPresidentName.focus();\n\t return false;\n\n\t }\n\t else if(document.societyRegistrationForm.emailId.value !=\"\" && !emailValidator(document.societyRegistrationForm.emailId))\n\t {\n\t document.societyRegistrationForm.emailId.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.contactNo.value.trim().length==0 || document.societyRegistrationForm.contactNo.value ==\"0\")\n\t {\n\t alert(\"Pls Enter Phone No\");\n\t document.societyRegistrationForm.contactNo.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.contactNo.value !=\"\" && !numeric(document.societyRegistrationForm.contactNo))\n\t {\n\t document.societyRegistrationForm.contactNo.focus();\n\t return false;\n\n\t }\n\t else if(document.societyRegistrationForm.noOfFlats.value.trim().length==0 || document.societyRegistrationForm.noOfFlats.value==\"0\")\n\t {\n\t alert(\"Pls Enter No of Flats\");\n\t document.societyRegistrationForm.noOfFlats.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.noOfFlats.value !=\"\" && !numeric(document.societyRegistrationForm.noOfFlats))\n\t {\n\t document.societyRegistrationForm.noOfFlats.focus();\n\t return false;\n\n\t }\n\t else if(document.societyRegistrationForm.societyAddress.value==\"\")\n\t {\n\t alert(\"Pls Enter Society Address\");\n\t document.societyRegistrationForm.societyAddress.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.countryId.value==\"0\")\n\t {\n\t alert(\"Pls Select the Country \");\n\t document.societyRegistrationForm.countryId.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.countryId.value!=\"0\" && document.societyRegistrationForm.stateId.value==\"\")\n\t {\n\t alert(\"Pls Select the State \");\n\t document.societyRegistrationForm.stateId.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.stateId.value !=\"0\" && document.societyRegistrationForm.districtId.value==\"\")\n\t {\n\n\t alert(\"Pls Select the District \");\n\t document.societyRegistrationForm.districtId.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.districtId.value!=\"0\" && document.societyRegistrationForm.cityId.value==\"\")\n\t {\n\t alert(\"Pls Select the City \");\n\t document.societyRegistrationForm.cityId.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.cityId.value!=\"0\" && document.societyRegistrationForm.postOfficeId.value==\"\")\n\t {\n\t alert(\"Pls Select the Post Office \");\n\t document.societyRegistrationForm.cityId.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.cityId.value !=\"0\" && (document.societyRegistrationForm.pinCode.value.trim().length==0 ||document.societyRegistrationForm.pinCode.value==\"0\"))\n\t {\n\t alert(\"Pls Enter Pin Code\");\n\t document.societyRegistrationForm.pinCode.focus();\n\t return false;\n\t }\n\t else if(document.societyRegistrationForm.pinCode.value !=\"\" && !numeric(document.societyRegistrationForm.pinCode))\n\t {\n\t document.societyRegistrationForm.pinCode.focus();\n\t return false;\n\n\t }\n\t else if(document.societyRegistrationForm.layout1.value==\"\")\n\t {\n\t alert(\"Pls click on Browse to select Layout\");\n\t document.societyRegistrationForm.layout.focus();\n\t return false;\n\t }\n\t return true;\n}", "title": "" }, { "docid": "434cdf5ebf40e7140773c149036c3f4a", "score": "0.54755557", "text": "function checkIfFilled(){\r\n var alreadyFocused = false;\r\n var compoundErrorMessage = \"Please fill in the mandatory fields highlighted in red.<br>\";\r\n var isMatch = false;\r\n\r\n document.getElementById(\"customerFirstName\").style.removeProperty(\"border\");\r\n document.getElementById(\"customerLastName\").style.removeProperty(\"border\");\r\n document.getElementById(\"phoneNumber\").style.removeProperty(\"border\");\r\n document.getElementById(\"address\").style.removeProperty(\"border\");\r\n document.getElementById(\"city\").style.removeProperty(\"border\");\r\n document.getElementById(\"province\").style.removeProperty(\"border\");\r\n document.getElementById(\"postalCode\").style.removeProperty(\"border\");\r\n\r\n if(document.getElementById(\"customerFirstName\").value == \"\"){\r\n document.getElementById(\"customerFirstName\").style.borderColor = \"red\";\r\n compoundErrorMessage += \"Error: The &quot;First Name&quot; field cannot be blank.<br>\";\r\n if(alreadyFocused == false){\r\n alreadyFocused = true;\r\n document.getElementById(\"customerFirstName\").focus();\r\n }\r\n allFieldsValid = false;\r\n } else {\r\n document.getElementById(\"customerFirstName\").value = firstLetterUpperCase(document.getElementById(\"customerFirstName\").value);\r\n allFieldsValid = true;\r\n }\r\n if(document.getElementById(\"customerLastName\").value == \"\"){\r\n document.getElementById(\"customerLastName\").style.borderColor = \"red\";\r\n compoundErrorMessage += \"Error: The &quot;Last Name&quot; field cannot be blank.<br>\";\r\n if(alreadyFocused == false){\r\n alreadyFocused = true;\r\n document.getElementById(\"customerLastName\").focus();\r\n }\r\n allFieldsValid = false;\r\n } else {\r\n document.getElementById(\"customerLastName\").value = firstLetterUpperCase(document.getElementById(\"customerLastName\").value);\r\n }\r\n //calls phone number validation function to validate phone number\r\n if(document.getElementById(\"phoneNumber\").value == \"\"){\r\n document.getElementById(\"phoneNumber\").style.borderColor = \"red\";\r\n compoundErrorMessage += \"Error: The &quot;Phone Number&quot; field cannot be blank. Phone number format must be xxx-xxx-xxxx or 10 numbers without the dashes.<br>\";\r\n if(alreadyFocused == false){\r\n alreadyFocused = true;\r\n document.getElementById(\"phoneNumber\").focus();\r\n }\r\n allFieldsValid = false;\r\n } else if(!validatePhoneNumber(document.getElementById(\"phoneNumber\").value)){\r\n document.getElementById(\"phoneNumber\").style.borderColor = \"red\";\r\n compoundErrorMessage += \"Error: The &quot;Phone Number&quot; format must be xxx-xxx-xxxx or 10 numbers without the dashes.<br>\";\r\n if(alreadyFocused == false){\r\n alreadyFocused = true;\r\n document.getElementById(\"phoneNumber\").focus();\r\n }\r\n allFieldsValid = false;\r\n } else {\r\n document.getElementById(\"phoneNumber\").value = trimWhiteSpace(document.getElementById(\"phoneNumber\").value);\r\n }\r\n //make sure address can't be blank\r\n if(document.getElementById(\"address\").value == \"\"){\r\n document.getElementById(\"address\").style.borderColor = \"red\";\r\n compoundErrorMessage += \"Error: The &quot;Address&quot; field cannot be blank.<br>\";\r\n if(alreadyFocused == false){\r\n alreadyFocused = true;\r\n document.getElementById(\"address\").focus();\r\n }\r\n allFieldsValid = false;\r\n } else {\r\n document.getElementById(\"address\").value = firstLetterUpperCase(document.getElementById(\"address\").value);\r\n }\r\n //make sure city can't be blank\r\n if(document.getElementById(\"city\").value == \"\"){\r\n document.getElementById(\"city\").style.borderColor = \"red\";\r\n compoundErrorMessage += \"Error: The &quot;City&quot; field cannot be blank.<br>\";\r\n if(alreadyFocused == false){\r\n alreadyFocused = true;\r\n document.getElementById(\"city\").focus();\r\n }\r\n allFieldsValid = false;\r\n } else {\r\n document.getElementById(\"city\").value = firstLetterUpperCase(document.getElementById(\"city\").value);\r\n }\r\n //make sure province field can't be the default value\r\n if(document.getElementById(\"province\").value == \"default\"){\r\n document.getElementById(\"province\").style.borderColor = \"red\";\r\n compoundErrorMessage += \"Error: The &quot;Province&quot; selection cannot be the default value, please select a province.<br>\";\r\n if(alreadyFocused == false){\r\n alreadyFocused = true;\r\n document.getElementById(\"province\").focus();\r\n }\r\n allFieldsValid = false;\r\n }\r\n //regex for postal code\r\n if(validatePostalCode(document.getElementById(\"postalCode\").value) == false){\r\n document.getElementById(\"postalCode\").style.borderColor = \"red\";\r\n compoundErrorMessage += \"Error: The &quot;Postal Code&quot; must be in A1B2C3 or in A1B 2C3 format.<br>\";\r\n if(alreadyFocused == false){\r\n alreadyFocused = true;\r\n document.getElementById(\"postalCode\").focus();\r\n }\r\n allFieldsValid = false;\r\n } else {\r\n document.getElementById(\"postalCode\").value = allUpperCase(document.getElementById(\"postalCode\").value.trim());\r\n }\r\n\r\n if( centMk10 == 0 && \r\n centAVRE == 0 && \r\n M4A3E8 == 0 && \r\n t3485 == 0 && \r\n spitfire == 0 && \r\n p51mustang == 0 && \r\n bf109g6 == 0 && \r\n yak3 == 0 ){\r\n alert(\"You have not added anything to the cart! You cannot place an order without purchasing anything.\");\r\n compoundErrorMessage += \"Error: You cannot place an order without anything in the cart.\";\r\n allFieldsValid = false;\r\n }\r\n \r\n //for formatting\r\n if(compoundErrorMessage == \"Please fill in the mandatory fields highlighted in red.<br>\"){\r\n compoundErrorMessage = \"<br>\";\r\n }\r\n document.getElementById(\"errorMessages\").innerHTML = compoundErrorMessage;\r\n}", "title": "" }, { "docid": "8121580d68e1f8fdb9674dd322e3bd94", "score": "0.5471768", "text": "function validate() {\n var firstname = document.getElementById(\"contact_firstname\").value;\n if (firstname == \"\") {\n alert(\"provide your firstname\")\n return false;\n }\n var lastname = document.getElementById(\"contact_lastname\").value;\n if (lastname == \"\") {\n alert(\"provide your lastname\")\n return false;\n }\n var email = document.getElementById(\"contact_email_id\").value;\n if (email == \"\") {\n alert(\"provide your email id\")\n return false;\n }\n\n var gender = document.getElementById(\"contact_gender\").value;\n if (gender == \"\") {\n alert(\"provide your gender\")\n return false;\n }\n}", "title": "" }, { "docid": "18a4897b21eab5fc207b7ab5c7de2d23", "score": "0.54709196", "text": "function checkAddressInput(getRentForm) {\n var address = document.getElementById('street');\n if (address.value == '' || address.value == 'Street Address') {\n address.value = 'address cannot be empty!';\n return false;\n }\n\n //regular expression to match only alphanumeric characters, commas, dash and space\n var addressValidation = /^[\\w,\\-\\s\\.]+$/;\n\n if(!addressValidation.test(address.value)) {\n address.value = 'error: invalid address';\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "96e1677b2d0d7cc6f88b63ece94b71b9", "score": "0.5467419", "text": "function validateForm() {\r\n // Retrieving the values of form elements \r\n var name = document.contactForm.name.value;\r\n var email = document.contactForm.email.value;\r\n var uname = document.contactForm.uname.value;\r\n var pass = document.contactForm.pass.value;\r\n var conpass = document.contactForm.conpass.value;\r\n var mobile = document.contactForm.mobile.value;\r\n var country = document.contactForm.country.value;\r\n var gender = document.contactForm.gender.value;\r\n\r\n var pass_expression = /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-])/;\r\n \r\n \r\n \r\n\t// Defining error variables with a default value\r\n var nameErr = emailErr = unameErr = passErr = conpassErr = mobileErr = countryErr = genderErr = true;\r\n \r\n // Validate name\r\n if(name == \"\") {\r\n printError(\"nameErr\", \"Please enter your name\");\r\n } else {\r\n var regex = /^[a-zA-Z\\s]+$/; \r\n if(regex.test(name) === false) {\r\n printError(\"nameErr\", \"Please enter a valid name\");\r\n } else {\r\n printError(\"nameErr\", \"\");\r\n nameErr = false;\r\n }\r\n }\r\n \r\n // Validate email address\r\n if(email == \"\") {\r\n printError(\"emailErr\", \"Please enter your email address\");\r\n } else {\r\n // Regular expression for basic email validation\r\n var regex = /^\\S+@\\S+\\.\\S+$/;\r\n if(regex.test(email) === false) {\r\n printError(\"emailErr\", \"Please enter a valid email address\");\r\n } else{\r\n printError(\"emailErr\", \"\");\r\n emailErr = false;\r\n }\r\n }\r\n\r\n // Validate uname\r\n if(uname == \"\") {\r\n printError(\"unameErr\", \"Please enter your user name\");\r\n } else {\r\n var regex = /^[a-zA-Z\\s]+$/; \r\n if(regex.test(uname) === false) {\r\n printError(\"unameErr\", \"Please enter a valid user name\");\r\n } else {\r\n printError(\"unameErr\", \"\");\r\n unameErr = false;\r\n }\r\n }\r\n\r\n // Validate password\r\n if(pass=='')\r\n {\r\n alert('Please enter Password');\r\n }\r\n else if(conpass=='')\r\n {\r\n alert('Enter Confirm Password');\r\n }\r\n else if(!pass_expression.test(pass))\r\n {\r\n alert('Upper case, Lower case, Special character and Numeric letter are required in Password filed');\r\n }\r\n else if(pass != conpass)\r\n {\r\n alert('Password not Matched');\r\n }\r\n else if(document.getElementById(\"conpassErr\").value.length < 6)\r\n {\r\n alert('Password minimum length is 6');\r\n }\r\n else if(document.getElementById(\"conpassErr\").value.length > 12)\r\n {\r\n alert('Password max length is 12');\r\n } \r\n else\r\n { \r\n alert('Thank You for Login & You are welcome to pronays website');\r\n \r\n window.location = \"welcome.html\"; \r\n }\r\n \r\n // Validate mobile number\r\n if(mobile == \"\") {\r\n printError(\"mobileErr\", \"Please enter your mobile number\");\r\n } else {\r\n var regex = /^[0-10]\\d{10}$/;\r\n if(regex.test(mobile) === false) {\r\n printError(\"mobileErr\", \"Please enter a valid 11 digit mobile number\");\r\n } else{\r\n printError(\"mobileErr\", \"\");\r\n mobileErr = false;\r\n }\r\n }\r\n \r\n // Validate country\r\n if(country == \"Select\") {\r\n printError(\"countryErr\", \"Please select your city\");\r\n } else {\r\n printError(\"countryErr\", \"\");\r\n countryErr = false;\r\n }\r\n \r\n // Validate gender\r\n if(gender == \"\") {\r\n printError(\"genderErr\", \"Please select your gender\");\r\n } else {\r\n printError(\"genderErr\", \"\");\r\n genderErr = false;\r\n }\r\n \r\n // Prevent the form from being submitted if there are any errors\r\n if((nameErr || emailErr || unameErr || passErr || conpassErr || mobileErr || countryErr || genderErr) == true) {\r\n return false;\r\n }\r\n\r\n \r\n}", "title": "" }, { "docid": "9d88711c4a769e68c3eaba406ff8d662", "score": "0.54666495", "text": "function validateOfferForm() {\n\t\n\t\n\t// Validate cost of service\n\tvar costofservice=document.forms[\"makeoffer\"][\"estimatedcost\"].value;\n\tif (isNaN(costofservice)) { // null or empty\n\t\talert(\"Please enter estimated Cost of Service\");\n\t\treturn false;\n\t}\n\n\tif ( costofservice < 1 ) { // null or empty\n\t\talert(\"Please enter estimated Cost of Service\");\n\t\treturn false;\n\t}\n\t\n\tvar notes=document.forms[\"makeoffer\"][\"notes\"].value;\n\tif (notes==null || notes==\"\") { // null or empty\n\t\talert(\"Please enter a note for the vehicle owner\");\n\t\treturn false;\n\t}\n\t\n\treturn confirm('Do you want to send this offer?');\n\t\n}", "title": "" }, { "docid": "e76b39eefbc8c92a57f38c91d58c7537", "score": "0.5466148", "text": "function valEmailAddress() {\n \n \n /* FETCH REQUIRED DATA */\n var emailAddress = document.getElementById(\"emailAddress\").value;\n \n \n /* CHECK IF EMAIL ADDRESS FIELD IS BLANK */\n if (emailAddress == \"\") {\n \n \n /* DISPLAY ERROR */\n document.getElementById(\"error-8\").innerHTML = '<b>Please enter your Email Address</b>';\n \n \n } else {\n \n \n /* SET EMAIL ADDRESS REGULAR EXPRESSION */\n var emailPattern = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n \n \n /* CHECK IF EMAIL ADDRESS COMPLIES WITH EMAIL ADDRESS REGULAR EXPRESSSION */\n if (emailPattern.test(emailAddress)) {\n \n \n /* ERASE ERROR MESSAGE */\n document.getElementById(\"error-8\").innerHTML = '';\n \n \n /* SUBMIT QUOTATION */\n $(\"#quote-slide-8\").hide();\n $(\"#quote-slide-9\").show();\n \n \n } else {\n \n \n /* DISPLAY ERROR */\n document.getElementById(\"error-8\").innerHTML = '<b>Please enter a Valid Email Address</b>';\n \n \n }\n }\n}", "title": "" }, { "docid": "36fe0b86b3e3f9bc61559b40f50a9e5b", "score": "0.5460665", "text": "function RR_FormValidation(){\r\n \r\n var valid =false;\r\n \r\n if(!validateFirstName()){\r\n document.getElementById(\"RR_firstName\").focus();\r\n return valid;\r\n }\r\n if(!validateGender()){\r\n document.getElementById(\"RR_gender\").focus();\r\n return valid;\r\n }\r\n if(!validateYears()){\r\n document.getElementById(\"RR_years\").focus();\r\n return valid;\r\n }\r\n if(!validateMobile()){\r\n document.getElementById(\"RR_mobile\").focus();\r\n return valid;\r\n }\r\n if(!validateEmail()){\r\n document.getElementById(\"RR_email\").focus();\r\n return valid;\r\n }\r\n if(!validatePlace()){\r\n document.getElementById(\"RR_Place\").focus();\r\n return valid;\r\n }\r\n if(!validateState()){\r\n document.getElementById(\"RR_State\").focus();\r\n return valid;\r\n }\r\n if(!validateDistrict()){\r\n var elem = document.getElementById(\"RR_State\").value;\r\n document.getElementById(elem).focus();\r\n return valid;\r\n }\r\n if(!validateCity()){\r\n document.getElementById(\"RR_City\").focus();\r\n return valid;\r\n }\r\n if(!validateEducation()){\r\n document.getElementById(\"RR_Education\").focus();\r\n return valid;\r\n }\r\n if(!validateDisease()){\r\n document.getElementById(\"RR_Disease\").focus();\r\n return valid;\r\n }\r\n if(!validateMotherTongue()){\r\n document.getElementById(\"RR_MotherTongue\").focus();\r\n return valid;\r\n }\r\n \r\n if(!validateLanguageKnown()){\r\n document.getElementById(\"RR_languageKnown\").focus();\r\n return valid;\r\n }\r\n \r\n if(!validateReferedName()){\r\n document.getElementById(\"RR_ReferedName\").focus();\r\n return valid\r\n }\r\n \r\n if(!validateReferedMobile()){\r\n document.getElementById(\"RR_ReferedMobile\").focus();\r\n return valid;\r\n }\r\n \r\n if(!validateReferedEmail()){\r\n document.getElementById(\"RR_ReferredEmail\").focus();\r\n return valid;\r\n }\r\n submitValues();\r\n return true;\r\n \r\n}", "title": "" }, { "docid": "7d5d121e4c6012d04d51fc273a4e73ba", "score": "0.5460402", "text": "function isValidLetter(form) {\n //It's OK if no data was entered\n if (!$scope.current.name && !$scope.current.age && !$scope.current.gender && !$scope.current.gift) {\n return true;\n }\n //It's not OK if some fields are missing\n else if (!$scope.current.name || !$scope.current.age || !$scope.current.gender || !$scope.current.gift) {\n $scope.blankName = !$scope.current.name;\n $scope.error = 'fields cannot be left blank';\n $timeout(function() {\n $scope.blankName = false;\n $scope.error = null;\n }, 2000);\n return false;\n }\n //It's great when all fields are entered properly\n else {\n addRecipient(form);\n return true;\n }\n }", "title": "" }, { "docid": "7d5d121e4c6012d04d51fc273a4e73ba", "score": "0.5460402", "text": "function isValidLetter(form) {\n //It's OK if no data was entered\n if (!$scope.current.name && !$scope.current.age && !$scope.current.gender && !$scope.current.gift) {\n return true;\n }\n //It's not OK if some fields are missing\n else if (!$scope.current.name || !$scope.current.age || !$scope.current.gender || !$scope.current.gift) {\n $scope.blankName = !$scope.current.name;\n $scope.error = 'fields cannot be left blank';\n $timeout(function() {\n $scope.blankName = false;\n $scope.error = null;\n }, 2000);\n return false;\n }\n //It's great when all fields are entered properly\n else {\n addRecipient(form);\n return true;\n }\n }", "title": "" }, { "docid": "4a43356f79d93584b02cd8466fa4f3fd", "score": "0.5450525", "text": "function addContactFromForm(event) {\n event.preventDefault();\n var submitObject = {};\n var inputArray = event.target.form;\n for (var i = 0; i < inputArray.length; i++) {\n if (inputArray[i].name != '' && inputArray[i].value != '') {\n // event.target[i].name // field name\n // event.target[i].value // input value\n submitObject[inputArray[i].name] = inputArray[i].value;\n }\n }\n // Validate that new objects confirming they have at least a firstname or lastname\n // AND a phone or email.\n if ( (submitObject.firstName != '' || submitObject.lastName != '') &&\n (submitObject.phone != '' || submitObject.email != '') ) {\n addContact(submitObject);\n }\n}", "title": "" }, { "docid": "245765cba3ee261d55410dc2f0574158", "score": "0.54430777", "text": "function checkRequiredFields(retreat) {\n\n const { title, date, duration, description, contactMail,imgUrl, rooms} = retreat.body\n\n if(title==null||date==null||duration==null||description==null||contactMail==null){\n return 'Required fields can not be empty'\n }\n\n else if(title==\"\"||date==\"\"||duration==\"\"||description==\"\"||contactMail==\"\"){\n return 'Required fields can not be empty'\n }\n\n else if (!textValidation(10,25,title)) {\n return 'Title has to have at least 10 and max of 25 characters'\n }\n else if (!dateValidation(date)) {\n return 'Date format is not valid'\n }\n\n else if(!Number.isInteger(parseInt(duration))||parseInt(duration)<=0){\n return 'Duration has to be an integer greater than zero'\n }\n\n else if (!textValidation(30,150,description)) {\n return 'Description has to have at least 30 and max of 150 characters'\n }\n else if (!validateEmail(contactMail)) {\n return 'E-mail missing or in worng format' \n }\n else if (rooms!=null&&!roomsValidation(rooms)) {\n return 'Rooms is in worng format' \n }\n\n else if (imgUrl!=\"\"&&!checkURL(imgUrl)) {\n return 'Link has to point to an image' \n }\n\n else {\n return \"\"\n }\n\n}", "title": "" } ]
138d9ec9e012a8ea0d3147d2252f7e18
receives a cord and returns you all cells within that range
[ { "docid": "21c0fa778028a9e59a5d00ebafd97eb4", "score": "0.58980966", "text": "function getRange(id, range) {\n // split id and get cords\n var cords = id.split('-');\n var x = cords[0] * 1;\n var y = cords[1] * 1;\n\n var area = [];\n // ***********************\n var chadow = document.querySelectorAll(\"td\");\n for (var r = 0; r < chadow.length; r++) {\n var c = chadow[r].id;\n var cSplit = c.split('-');\n var x1 = cSplit[0] * 1;\n var y1 = cSplit[1] * 1;\n\n if (Math.abs(x1 - x) <= range && Math.abs(y1 - y) <= range) {\n area.push(c);\n }\n }\n\n\n\n return area;\n}", "title": "" } ]
[ { "docid": "e0ad15b1f757e46483df06684f194335", "score": "0.63164693", "text": "function getValues(sheet, startCell, endCell) {\n return SpreadsheetApp.getActiveSpreadsheet().getRange(getRangeString(sheet, startCell, endCell)).getValues();\n}", "title": "" }, { "docid": "e2882d03e369a1cf9fed818179f88215", "score": "0.6216673", "text": "function ccGetCellsAround(from, distance) {\n\treturn arrayMap(ccGetMask(distance), function(cell) { return cell + from; });\n}", "title": "" }, { "docid": "3f71b85919c7271871bc8f523168e7fa", "score": "0.60471535", "text": "function getCells(project) {\n return getDataTable(project).table.listCells()\n}", "title": "" }, { "docid": "73e5911cd65542769fb539ba129acae5", "score": "0.60077906", "text": "getCellsDataByBounds(bounds) {\n //TODO este método se puede optimizar fijando un rango de celdas x e y que estén en los bounds especificados.\n //TODO de esta forma, solo se comprobarán los elementos que estén en esas celdas.\n //TODO de momento, recorro todos los elementos validando si están colisionando\n\n let cells = Array();\n\n let cellElementsIt = this._elements.values();\n\n let cellElementsNext = cellElementsIt.next();\n\n while (!cellElementsNext.done) {\n let cell = cellElementsNext.value;\n\n if (Utils.hasCollission(bounds, cell.bounds)) {\n cells.push(cell);\n }\n\n cellElementsNext = cellElementsIt.next();\n }\n\n return cells;\n }", "title": "" }, { "docid": "20ef3d8ede0bd0387d7b6882640753a1", "score": "0.59309673", "text": "getCell(r, c) {\n this._assertBounds(r, c);\n return this._cells[r][c];\n }", "title": "" }, { "docid": "7482f85acf8fd7af1a42d4aa3fe171d9", "score": "0.5911039", "text": "getCells() {\n return this.buffer[this.currentBuf];\n }", "title": "" }, { "docid": "48bc05fc5d946d9ea145ddc94c878a3b", "score": "0.5904659", "text": "function getCells(){\n return document.querySelectorAll(\".cell\");\n}", "title": "" }, { "docid": "bc7e5c5871fb56c9b2a59d71a843fcd3", "score": "0.58538544", "text": "getCells() {\n return this.buffer[this.currentBuf]\n }", "title": "" }, { "docid": "b25b90104d52679c2c4e8901ddbbcd2d", "score": "0.5821917", "text": "getCells() {\n // !!!! IMPLEMENT ME !!!!\n return this.buffer[this.currentBufferIndex];\n }", "title": "" }, { "docid": "b25b90104d52679c2c4e8901ddbbcd2d", "score": "0.5821917", "text": "getCells() {\n // !!!! IMPLEMENT ME !!!!\n return this.buffer[this.currentBufferIndex];\n }", "title": "" }, { "docid": "68c703b2dd71bdd8bf40aefbc8b3e33d", "score": "0.5769446", "text": "function getCustomers() {\r\n let customers = [];\r\n\r\n for (let i = 2; i <= sheet.getLastRow(); i++) {\r\n // for every row of customer data\r\n\r\n const currentPrintCell = sheet.getRange(i, 1).getValue();\r\n if (!currentPrintCell) {\r\n customers.push(sheet.getRange(i, 5).getValue());\r\n }\r\n }\r\n\r\n return customers;\r\n}", "title": "" }, { "docid": "6f5fa1d35c4666ce349bf76b70b443d9", "score": "0.5764276", "text": "function selectAllCells(start, end) {\n jQuery('.cell-col-selected').removeClass('cell-col-selected right-selected left-selected bottom-selected top-selected');\n for (let i = Math.min(start.r, end.r); i <= Math.max(start.r, end.r); i++) {\n for (let j = Math.min(start.c, end.c); j <= Math.max(start.c, end.c); j++) {\n let [top, right, bottom, left] = getTopRightBottomLeftCell(i, j);\n selectCell(jQuery(`.cell-col[data-idx=${i * 100 + j}]`)[0], {\n \"ctrlKey\": true\n }, top, bottom, left, right);\n }\n }\n}", "title": "" }, { "docid": "443bd8b7b7d2ac8eff13ccda15355607", "score": "0.57478464", "text": "getCells() {\n\t\treturn this.cells[this.currentBufferIndex];\n }", "title": "" }, { "docid": "5b0d56c1f717c25a9e8ef3ae3b8c3853", "score": "0.57449055", "text": "function getAllAdjacentCells(row, col) {\n\t\tvar cells = [];\n\t\tfor (var dir = 0; dir < 6; dir++) {\n\t\t\tcells.push(getAdjacentCell(row, col, dir));\n\t\t}\n\t\treturn cells;\n\t}", "title": "" }, { "docid": "8fcbb9c1bcd4f58ee509d695f826897d", "score": "0.5719045", "text": "function reading(range) {\n return range.getValues(); \n}", "title": "" }, { "docid": "2f776c44b6160de48cd3ffce60ccaa9d", "score": "0.568733", "text": "function getCells(selector){\n\n\t\treturn gridElement.querySelectorAll(selector);\n\n\t}", "title": "" }, { "docid": "9d5d7d492baaa8793e5ae84f4b6aa3fc", "score": "0.5626186", "text": "getCells() {\n return this.cells[this.currentBufferIndex];\n }", "title": "" }, { "docid": "9263980c922e8ea880a49b86f648ee4d", "score": "0.5600104", "text": "getCells() {\r\n return this.buffer[this.activeBufferIdx];\r\n }", "title": "" }, { "docid": "70e4d0a86362d4603cd839adc6d96cf0", "score": "0.5590008", "text": "getCells() {\n return this.buffer[this.currentBufferIndex];\n }", "title": "" }, { "docid": "70e4d0a86362d4603cd839adc6d96cf0", "score": "0.5590008", "text": "getCells() {\n return this.buffer[this.currentBufferIndex];\n }", "title": "" }, { "docid": "06966a52f2650660b45560efde0433e5", "score": "0.55271244", "text": "function getDataHelper(r,c,workSheet){\n\tvar row = [];\n\tfor(var i=c.s;i<=c.e;i++){\n\t\tvar cell_address = {r:r,c:i};\n\t\trow.push(workSheet[XLSX.utils.encode_cell(cell_address)]);\n\t}\n\treturn row;\n}", "title": "" }, { "docid": "6ac93c896315c62ca70786a46477f205", "score": "0.5451147", "text": "get cells() {\n return this._cells;\n }", "title": "" }, { "docid": "49b4afc84abef280bdb8e1354c8adf84", "score": "0.543706", "text": "function getCoodinates(e, canvasRef, cell_size) {\n let bound = canvasRef.current.getBoundingClientRect();\n const currentCood = {\n x: e.clientX - bound.left - ((e.clientX - bound.left) % cell_size),\n y: e.clientY - bound.top - ((e.clientY - bound.top) % cell_size),\n };\n return currentCood;\n }", "title": "" }, { "docid": "9533320fc8dfc9788a2f35f8a7e4cc7b", "score": "0.5407626", "text": "function getCells(minX, minY, maxX, maxY) {\r\n var lowCell = getCellLoc(minX, minY);\r\n clampCell(lowCell);\r\n var highCell = getCellLoc(maxX, maxY);\r\n clampCell(highCell);\r\n var toReturn = new Array();\r\n for (var i = lowCell.x; i <= highCell.x; i++) {\r\n for (var j = lowCell.y; j <= highCell.y; j++) {\r\n toReturn.push(_grid[i][j]);\r\n }\r\n }\r\n return toReturn;\r\n }", "title": "" }, { "docid": "c2460e7816c6643d50c0bc3b3fae4385", "score": "0.53843635", "text": "function getCells()\n{\n\tvar smallCells = document.getElementsByClassName('sm-cell');\t// small cells\n\n\tvar cells = [];\n\tfor(let i = 0; i < 9; i++) {\n\t cells[i] = new Array(9);\n\t}\n\n\t// auxiliary variables for extracting DOM elements\n\tvar startPoint = 0;\n\tvar endPoint = 9;\n\tvar temp = 0;\n\n\tfor (let i = 0; i < 9; i++) {\n\t\tfor (let j = startPoint; j < endPoint; j++) {\n\t\t\t\tcells[i][temp] = smallCells[j];\n\t\t\t\ttemp++;\n\t\t}\n\t\ttemp = 0; startPoint += 9; endPoint += 9;\n\t}\n\n\treturn cells;\n}", "title": "" }, { "docid": "3f632c1412c846876f4bed415d523e0a", "score": "0.5371163", "text": "getCells() {\n return this.buffer[this.currentBufferIndex]; // return which grid is in use\n }", "title": "" }, { "docid": "1f3e6077ab38b4f2cbf5b62f043d14f3", "score": "0.5354442", "text": "player1Cells() { return range(1,this.cellCount/2-1); }", "title": "" }, { "docid": "5b6b04a8d5ff7d526d988224ba16b073", "score": "0.53401595", "text": "function getCellsAtColumn(opts,\n// The table\ntable, columnIndex) {\n return table.nodes.map(function (row) {\n return row.nodes.get(columnIndex);\n });\n}", "title": "" }, { "docid": "fa4273c272214b46eb1be8bdfe22541a", "score": "0.5338814", "text": "function get_coords(cell)\r\n{\r\n var row_num = Math.floor(cell / 30); // 22 Rows total\r\n var col_num = cell % 30; // 30 Columns total\r\n return [col_num, row_num];\r\n}", "title": "" }, { "docid": "6e0a009b5646c87587194dc74c527112", "score": "0.5333017", "text": "player2Cells() { return range(this.cellCount/2+1,this.cellCount-1) }", "title": "" }, { "docid": "b92f8491bbbbe2b754480e81da9b3e4e", "score": "0.5322284", "text": "all_cells() {\n return Array.from(this.dependencies.keys()).filter(cell => !this.deleted.has(cell));\n }", "title": "" }, { "docid": "cf5ff6d3c81c2f31f06fd80512fa9938", "score": "0.5310402", "text": "get selectedCellRanges() {\n if (this._selectedCellRanges === null) {\n let coll = new IgrGridSelectedCellRangesCollection();\n let innerColl = this.i.dj;\n if (!innerColl) {\n innerColl = new GridSelectedCellRangesCollection_internal();\n }\n this._selectedCellRanges = coll._fromInner(innerColl);\n }\n return this._selectedCellRanges;\n }", "title": "" }, { "docid": "e214dfc6ca3226fbd2888c2433863c50", "score": "0.53038764", "text": "cell(x, y) {\r\n\t\treturn this.board[y][x]; \r\n\t}", "title": "" }, { "docid": "de10703766c8860574fcd31b23469801", "score": "0.52762437", "text": "getAllBlockCoords(sudoku, coord) {\n const allCoords = [];\n const blockLength = Math.sqrt(sudoku.size);\n const blockX = coord.x - (coord.x % blockLength);\n const blockY = coord.y - (coord.y % blockLength);\n for (let y = 0; y < blockLength; y++) {\n for (let x = 0; x < blockLength; x++) {\n allCoords.push(new Coord_1.Coord(blockX + x, blockY + y));\n }\n }\n return allCoords;\n }", "title": "" }, { "docid": "5ba431ab2b1b337a68f7946e9fddfc5e", "score": "0.52676135", "text": "getCellCoords ( col, row )\n\t{\n\t\t// Coordinates of top-left corner of cell.\n\t\tconst baseCoords = {\n\t\t\tx: this.originX + this.colPadding + col * this.cellSize,\n\t\t\ty: this.originY + this.rowPadding + row * this.cellSize\n\t\t}\n\n\t\t//console.log(this.width);\n\n\t\tswitch ( this.sampleMode )\n\t\t{\n\t\t\tcase \"TOPLEFT\":\n\t\t\t\treturn baseCoords;\n\t\t\tcase \"TOPRIGHT\":\n\t\t\t\tbaseCoords.x += this.cellSize;\n\t\t\t\treturn baseCoords;\n\t\t\tcase \"LEFT\":\n\t\t\t\tbaseCoords.y += this.halfCell;\n\t\t\t\treturn baseCoords;\n\t\t\tcase \"RIGHT\":\n\t\t\t\tbaseCoords.x += this.cellSize;\n\t\t\t\tbaseCoords.y += this.halfCell;\n\t\t\t\treturn baseCoords;\n\t\t\tcase \"BOTTOMLEFT\":\n\t\t\t\tbaseCoords.y += this.cellSize;\n\t\t\t\treturn baseCoords;\n\t\t\tcase \"BOTTOMRIGHT\":\n\t\t\t\tbaseCoords.x += this.cellSize;\n\t\t\t\tbaseCoords.y += this.cellSize;\n\t\t\t\treturn baseCoords;\n\t\t\tcase \"CENTER\":\n\t\t\t\tbaseCoords.x += this.halfCell;\n\t\t\t\tbaseCoords.y += this.halfCell;\n\t\t\t\treturn baseCoords;\n\t\t\tdefault: \n\t\t\t\treturn baseCoords;\n\t\t}\n\t}", "title": "" }, { "docid": "54fa730a877caf14aeb39f9e60813f6e", "score": "0.52547914", "text": "get cells() {\n return DIRECTIONS.map(function (vector) {\n return new Cell(Cell.plus(this, vector));\n }, this);\n }", "title": "" }, { "docid": "b57d227bfa5fbe5a5cecdf54f57ef1db", "score": "0.52514344", "text": "function checkCells(board) {\n const arrayCells = [true]\n\n board.forEach(a => a.forEach(function(b) {\n if (b !== null && b !== 'x' && b !== 'o') { arrayCells[0] = false }\n\n }));\n return arrayCells[0];\n}", "title": "" }, { "docid": "98b580dfd5e8d762a55b9fe28f5a4cb1", "score": "0.5249952", "text": "function findSpecificCells(symbol, array) {\r\n var specificCells = [];\r\n for (var i = 0; i < horizontalCellsCount; i++) {\r\n for (var j = 0; j < verticalCellsCount; j++) {\r\n if (array[i][j] == symbol) {\r\n var specificCell = new Cell(i, j);\r\n /* an object with specific cell position */\r\n specificCells.push(specificCell);\r\n }\r\n }\r\n }\r\n return specificCells;\r\n }", "title": "" }, { "docid": "e34b2df17d0af1b1c17fec466e7200b5", "score": "0.524735", "text": "getCell(x, y) {\n return this.board[x][y];\n }", "title": "" }, { "docid": "f7b8f4ebfc3226856e6eac51cfb5b4ad", "score": "0.5240473", "text": "function CellAt(x, y)\n{\n return document.getElementById(\"c\" + PadNumber(x) + PadNumber(y));\n}", "title": "" }, { "docid": "356d983e229b9a9dfb6405daefd63d7c", "score": "0.523871", "text": "function getNeighbors(cellx, celly) {\n\tvar neighbors = [0, 0, 0];\n\tfor (var x=cellx-1; x<=cellx+1; x++) {\n\t\tfor (var y=celly-1; y<=celly+1; y++) {\n\t\t\tif (x != cellx || y != celly) {\n\t\t\t\tif (!(x<0 || y<0 || x>=gridw || y>=gridh)) {\n\t\t\t\t\tif (cells[pos(x,y)] > 0) {\n\t\t\t\t\t\tneighbors[0]++;\n\t\t\t\t\t\tneighbors[cells[pos(x,y)]]++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn neighbors;\n}", "title": "" }, { "docid": "10c0261353c261265b0ba84670e19144", "score": "0.5231686", "text": "toCells() {\n this.cells = [];\n for (var y = 0; y < 20; y++) {\n for (var x = 0; x < 10; x++) {\n if (this.rows[y][x] !== 'empty') {\n this.cells.push(new Cell(x, y, this.rows[y][x]));\n }\n }\n }\n }", "title": "" }, { "docid": "8dcb2de48586c5271abb4dde5621c28e", "score": "0.5225578", "text": "static whatInCell(coords){\n return field[coords[0]][coords[1]];\n }", "title": "" }, { "docid": "e56dabc71fb46f6bc12bef7e3aa8e868", "score": "0.51997435", "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": "e5f98a965407577fcc62b72f67c83e56", "score": "0.51889086", "text": "buildCandidateCells(board, width, height) {\n let cells = []\n\n for (var j = 1; j < height - 1; j++) {\n for (var i = 1; i < width - 1; i++) {\n let index = j * width + i\n if (board[index] == 0) {\n if (Helper.checkAdjacent(board, width, height, i, j, this.id)) {\n cells.push({x: i, y: j, index: index})\n }\n }\n }\n }\n\n return cells\n }", "title": "" }, { "docid": "1c3083673072c04e4dc8cc877e2df0d2", "score": "0.5182146", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "title": "" }, { "docid": "ca7f498d84b1502b6599a51cd1bb672e", "score": "0.5180605", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n\n tempRange.setEndBefore(ancestor);\n }\n\n process.env.NODE_ENV !== \"production\" ? invariant_1(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant_1(false) ;\n}", "title": "" }, { "docid": "98bbfc210cde80a02f87719461a73bf0", "score": "0.5177798", "text": "function getPosibleMoveCells(moveTemplate, x, y) {\n let possibleCells = new Array;\n let count = 0;\n moveTemplate.forEach(function (move) {\n let _x = +x + move[0];\n let _y = +y + move[1];\n let cell = document.querySelector(`.cell[data-pos-x=\"${_x}\"][data-pos-y=\"${_y}\"]`);\n if (cell && !cell.classList.contains('set')) {\n possibleCells[count++] = cell;\n }\n });\n return possibleCells;\n}", "title": "" }, { "docid": "84ace6443d1b981d63232f3f4f313f48", "score": "0.5172593", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "title": "" }, { "docid": "84ace6443d1b981d63232f3f4f313f48", "score": "0.5172593", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "title": "" }, { "docid": "84ace6443d1b981d63232f3f4f313f48", "score": "0.5172593", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "title": "" }, { "docid": "af793195fdbaa5724c0a0cf5fffe9d66", "score": "0.5170617", "text": "function getRangeClientRectsChrome(range) {\n\t var tempRange = range.cloneRange();\n\t var clientRects = [];\n\t\n\t for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n\t // If we've climbed up to the common ancestor, we can now use the\n\t // original start point and stop climbing the tree.\n\t var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\t if (atCommonAncestor) {\n\t tempRange.setStart(range.startContainer, range.startOffset);\n\t } else {\n\t tempRange.setStart(tempRange.endContainer, 0);\n\t }\n\t var rects = Array.from(tempRange.getClientRects());\n\t clientRects.push(rects);\n\t if (atCommonAncestor) {\n\t var _ref;\n\t\n\t clientRects.reverse();\n\t return (_ref = []).concat.apply(_ref, clientRects);\n\t }\n\t tempRange.setEndBefore(ancestor);\n\t }\n\t\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : undefined;\n\t}", "title": "" }, { "docid": "1dbb029a760182a8bc100f536890c5ed", "score": "0.5148762", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n\n tempRange.setEndBefore(ancestor);\n }\n\n true ? true ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : undefined : undefined;\n}", "title": "" }, { "docid": "194ba3d6b3fbbc1525ec19222c20a240", "score": "0.5140544", "text": "getNeighbors(cell) {\n let neighboringPositions = [\n new Position(cell.position.x - 1, cell.position.y - 1),\n new Position(cell.position.x, cell.position.y - 1),\n new Position(cell.position.x + 1, cell.position.y - 1),\n new Position(cell.position.x - 1, cell.position.y),\n new Position(cell.position.x + 1, cell.position.y),\n new Position(cell.position.x - 1, cell.position.y + 1),\n new Position(cell.position.x, cell.position.y + 1),\n new Position(cell.position.x + 1, cell.position.y + 1)\n ]\n\n return neighboringPositions\n .map((position) => this.getCell(position))\n .filter((optionalCell) => optionalCell.isDefined())\n .map((optionalCell) => optionalCell.get())\n }", "title": "" }, { "docid": "3631b3436f6c74d0f983b72490c47062", "score": "0.5138669", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? true ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : undefined : undefined;\n}", "title": "" }, { "docid": "3631b3436f6c74d0f983b72490c47062", "score": "0.5138669", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? true ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : undefined : undefined;\n}", "title": "" }, { "docid": "0da400ebbfaa61fa7bfb2f10f6d2a28b", "score": "0.5138398", "text": "function incidence(from_cells, to_cells) {\n var index = new Array(from_cells.length)\n for(var i=0, il=index.length; i<il; ++i) {\n index[i] = []\n }\n var b = []\n for(var i=0, n=to_cells.length; i<n; ++i) {\n var c = to_cells[i]\n var cl = c.length\n for(var k=1, kn=(1<<cl); k<kn; ++k) {\n b.length = bits.popCount(k)\n var l = 0\n for(var j=0; j<cl; ++j) {\n if(k & (1<<j)) {\n b[l++] = c[j]\n }\n }\n var idx=findCell(from_cells, b)\n if(idx < 0) {\n continue\n }\n while(true) {\n index[idx++].push(i)\n if(idx >= from_cells.length || compareCells(from_cells[idx], b) !== 0) {\n break\n }\n }\n }\n }\n return index\n}", "title": "" }, { "docid": "0da400ebbfaa61fa7bfb2f10f6d2a28b", "score": "0.5138398", "text": "function incidence(from_cells, to_cells) {\n var index = new Array(from_cells.length)\n for(var i=0, il=index.length; i<il; ++i) {\n index[i] = []\n }\n var b = []\n for(var i=0, n=to_cells.length; i<n; ++i) {\n var c = to_cells[i]\n var cl = c.length\n for(var k=1, kn=(1<<cl); k<kn; ++k) {\n b.length = bits.popCount(k)\n var l = 0\n for(var j=0; j<cl; ++j) {\n if(k & (1<<j)) {\n b[l++] = c[j]\n }\n }\n var idx=findCell(from_cells, b)\n if(idx < 0) {\n continue\n }\n while(true) {\n index[idx++].push(i)\n if(idx >= from_cells.length || compareCells(from_cells[idx], b) !== 0) {\n break\n }\n }\n }\n }\n return index\n}", "title": "" }, { "docid": "0da400ebbfaa61fa7bfb2f10f6d2a28b", "score": "0.5138398", "text": "function incidence(from_cells, to_cells) {\n var index = new Array(from_cells.length)\n for(var i=0, il=index.length; i<il; ++i) {\n index[i] = []\n }\n var b = []\n for(var i=0, n=to_cells.length; i<n; ++i) {\n var c = to_cells[i]\n var cl = c.length\n for(var k=1, kn=(1<<cl); k<kn; ++k) {\n b.length = bits.popCount(k)\n var l = 0\n for(var j=0; j<cl; ++j) {\n if(k & (1<<j)) {\n b[l++] = c[j]\n }\n }\n var idx=findCell(from_cells, b)\n if(idx < 0) {\n continue\n }\n while(true) {\n index[idx++].push(i)\n if(idx >= from_cells.length || compareCells(from_cells[idx], b) !== 0) {\n break\n }\n }\n }\n }\n return index\n}", "title": "" }, { "docid": "70f600e7ce9f1f057a80012e6512d56d", "score": "0.5136821", "text": "function getCell(row, col){\n return document.getElementById(\"r\" + row + \"c\" + col);\n}", "title": "" }, { "docid": "d9356b9937e23e6a6bf93f0603dac842", "score": "0.51359963", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? false ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "title": "" }, { "docid": "ef4c3a45247b31234b80e0bf3aa572b9", "score": "0.51316214", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n tempRange.setEndBefore(ancestor);\n }\n\n true ? true ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "title": "" }, { "docid": "a4640ae0684e18bb74fd709df3b69464", "score": "0.5130237", "text": "getCell(x, y) {\n return this.grid[x][y];\n }", "title": "" }, { "docid": "27151aeb7ec74d404a5c4ad414999041", "score": "0.51268363", "text": "function getRangeClientRectsChrome(range) {\n\t var tempRange = range.cloneRange();\n\t var clientRects = [];\n\n\t for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n\t // If we've climbed up to the common ancestor, we can now use the\n\t // original start point and stop climbing the tree.\n\t var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\t if (atCommonAncestor) {\n\t tempRange.setStart(range.startContainer, range.startOffset);\n\t } else {\n\t tempRange.setStart(tempRange.endContainer, 0);\n\t }\n\t var rects = Array.from(tempRange.getClientRects());\n\t clientRects.push(rects);\n\t if (atCommonAncestor) {\n\t var _ref;\n\n\t clientRects.reverse();\n\t return (_ref = []).concat.apply(_ref, clientRects);\n\t }\n\t tempRange.setEndBefore(ancestor);\n\t }\n\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n\t}", "title": "" }, { "docid": "27151aeb7ec74d404a5c4ad414999041", "score": "0.51268363", "text": "function getRangeClientRectsChrome(range) {\n\t var tempRange = range.cloneRange();\n\t var clientRects = [];\n\n\t for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n\t // If we've climbed up to the common ancestor, we can now use the\n\t // original start point and stop climbing the tree.\n\t var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\t if (atCommonAncestor) {\n\t tempRange.setStart(range.startContainer, range.startOffset);\n\t } else {\n\t tempRange.setStart(tempRange.endContainer, 0);\n\t }\n\t var rects = Array.from(tempRange.getClientRects());\n\t clientRects.push(rects);\n\t if (atCommonAncestor) {\n\t var _ref;\n\n\t clientRects.reverse();\n\t return (_ref = []).concat.apply(_ref, clientRects);\n\t }\n\t tempRange.setEndBefore(ancestor);\n\t }\n\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n\t}", "title": "" }, { "docid": "27151aeb7ec74d404a5c4ad414999041", "score": "0.51268363", "text": "function getRangeClientRectsChrome(range) {\n\t var tempRange = range.cloneRange();\n\t var clientRects = [];\n\n\t for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n\t // If we've climbed up to the common ancestor, we can now use the\n\t // original start point and stop climbing the tree.\n\t var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\t if (atCommonAncestor) {\n\t tempRange.setStart(range.startContainer, range.startOffset);\n\t } else {\n\t tempRange.setStart(tempRange.endContainer, 0);\n\t }\n\t var rects = Array.from(tempRange.getClientRects());\n\t clientRects.push(rects);\n\t if (atCommonAncestor) {\n\t var _ref;\n\n\t clientRects.reverse();\n\t return (_ref = []).concat.apply(_ref, clientRects);\n\t }\n\t tempRange.setEndBefore(ancestor);\n\t }\n\n\t true ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n\t}", "title": "" }, { "docid": "685b5a8a872c9765b1f49de1d9276e86", "score": "0.512399", "text": "function getRange(hexCol) {\n const end = '#FFF';\n return [chroma(hexCol)\n .darken(1.4)\n .hex(), \n hexCol, \n end];\n}", "title": "" }, { "docid": "a7c9f221f06cad05a3eea341c629b453", "score": "0.5123891", "text": "getScheduleCells() {\n\n var cellsDict = this.getAvailableScheduleCells();\n\n // dictionary to store key: start time and value: schedule cell\n this.getUnavailableScheduleCells(cellsDict);\n\n // get a schedule cell for each slot time\n var cells = [];\n\n for (let key in cellsDict) {\n cells.push(cellsDict[key]);\n }\n\n return cells;\n }", "title": "" }, { "docid": "d5eb30afc81fe318f822630c0dafad41", "score": "0.51190865", "text": "function rowC(row) {\n /*jshint validthis: true */\n\t d3.select(this).selectAll('.cellC')\n\t\t.data(row.filter(function(d) { return d.z; }))\n\t\t.enter().append('rect')\n\t\t.attr('class', '.cellC')\n\t\t.attr('x', function(d) { return x(d.x); })\n\t\t.attr('width', x.rangeBand())\n\t\t.attr('height', x.rangeBand())\n\t\t.style('fill-opacity', function(d) { return z(d.z); })\n\t\t.style('fill', function(d) { return nodes[d.x].group === nodes[d.y].group ? c(nodes[d.x].group) : null; })\n\t\t.on('mouseover', mouseover)\n\t\t.on('mouseout', mouseout);\n\t}", "title": "" }, { "docid": "61ec40c27b3688a4443e14bfade57738", "score": "0.5112999", "text": "function getGameBoard() {\nvar gameBoardTable = document.getElementById(\"gameBoard\");\nvar result = [];\nfor (var i = 0; i < 3; i++) {\nfor (var j = 0; j < 3; j++) {\nresult.push(gameBoardTable.rows[i].cells[j]);\n \n}\n}\nreturn result;\n}", "title": "" }, { "docid": "b9b0ebee674941971876dabb44e4b469", "score": "0.51091224", "text": "function incidence(from_cells, to_cells) {\n\t var index = new Array(from_cells.length)\n\t for(var i=0, il=index.length; i<il; ++i) {\n\t index[i] = []\n\t }\n\t var b = []\n\t for(var i=0, n=to_cells.length; i<n; ++i) {\n\t var c = to_cells[i]\n\t var cl = c.length\n\t for(var k=1, kn=(1<<cl); k<kn; ++k) {\n\t b.length = bits.popCount(k)\n\t var l = 0\n\t for(var j=0; j<cl; ++j) {\n\t if(k & (1<<j)) {\n\t b[l++] = c[j]\n\t }\n\t }\n\t var idx=findCell(from_cells, b)\n\t if(idx < 0) {\n\t continue\n\t }\n\t while(true) {\n\t index[idx++].push(i)\n\t if(idx >= from_cells.length || compareCells(from_cells[idx], b) !== 0) {\n\t break\n\t }\n\t }\n\t }\n\t }\n\t return index\n\t}", "title": "" }, { "docid": "8e52b3c1af526f648dc5935d983d3f6a", "score": "0.51078147", "text": "chooseCell(character) {\n var found = [];\n for (var i in this.directions) {\n var x = this.directions[i][0];\n var y = this.directions[i][1];\n if (x >= 0 && x < matrix[0].length && y >= 0 && y < matrix.length) {\n if (matrix[y][x] == character) {\n found.push(this.directions[i]);\n }\n }\n }\n return found;\n }", "title": "" }, { "docid": "26b7196e88a8e9b9857b37b82f3ec6ae", "score": "0.5104204", "text": "function getRangeClientRectsChrome(range) {\n\t for (var tempRange = range.cloneRange(), clientRects = [], ancestor = range.endContainer; null != ancestor; ancestor = ancestor.parentNode) {\n\t // If we've climbed up to the common ancestor, we can now use the\n\t // original start point and stop climbing the tree.\n\t var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\t atCommonAncestor ? tempRange.setStart(range.startContainer, range.startOffset) : tempRange.setStart(tempRange.endContainer, 0);\n\t var rects = Array.from(tempRange.getClientRects());\n\t if (clientRects.push(rects), atCommonAncestor) {\n\t var _ref;\n\t return clientRects.reverse(), (_ref = []).concat.apply(_ref, clientRects);\n\t }\n\t tempRange.setEndBefore(ancestor);\n\t }\n\t invariant(!1);\n\t }", "title": "" }, { "docid": "f6ad314cf26952177dfdd98909509b27", "score": "0.51033884", "text": "function findRangeForIndividualCalcultion(){\n return dataMatrix['101'];\n}", "title": "" }, { "docid": "6aa9e79c48624b84b842e65859dd94c5", "score": "0.50841564", "text": "makeCells() {\n // Create an empty array for the cell to live in\n let cells = [];\n\n // Outer loop goes through the rows\n for (let y = 0; y < this.rows; y++) {\n // Inner loop goes through the columns\n for (let x = 0; x < this.cols; x++) {\n // If the board exists at that position...\n if (this.board[y][x]) {\n // Place the cell at that position\n cells.push({ x, y });\n }\n }\n }\n\n return cells;\n }", "title": "" }, { "docid": "31c85589645a3a12a83a2902027f4cd0", "score": "0.50665426", "text": "function getAdjacentCells(cell){\n\n\t\tvar id = cell.id.split('-');\n\n\t\t// Gets cell position indexes\n\t\tvar row = parseInt(id[1]);\n\t\tvar col = parseInt(id[2]);\n\n\t\tvar adjacent = [];\n\n\t\t// Gets all possible adjacent cells\n\t\tif(row < rows - 1){adjacent.push(getCell(row+1, col));}\n\t\tif(row > 0){adjacent.push(getCell(row-1, col));}\n\t\tif(col < cols - 1){adjacent.push(getCell(row, col+1));}\n\t\tif(col > 0){adjacent.push(getCell(row, col-1));}\n\n\t\treturn adjacent;\n\n\t}", "title": "" }, { "docid": "159e5156d98086f2bb47ea90143db1da", "score": "0.50663847", "text": "function _fnCoordsFromCell( n )\n {\n if ( _oDatatable )\n {\n var oSettings = _oDatatable.fnSettings();\n return [\n jQuery('td', n.parentNode).index(n),\n jQuery('tr', n.parentNode.parentNode).index(n.parentNode) + oSettings._iDisplayStart\n ];\n }\n else\n {\n return [\n jQuery('td', n.parentNode).index(n),\n jQuery('tr', n.parentNode.parentNode).index(n.parentNode)\n ];\n }\n }", "title": "" }, { "docid": "9e2e7f10673dfa501e73e7f6e5a4dd82", "score": "0.5055017", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n\n tempRange.setEndBefore(ancestor);\n }\n\n true ? false ? undefined : invariant(false) : undefined;\n}", "title": "" }, { "docid": "368665307b0596e87f3f10328b0319da", "score": "0.50474817", "text": "function getCellElements(currentRowCellElement) {\n return currentRowCellElement.querySelectorAll(\".cell\")\n\n}", "title": "" }, { "docid": "84a101e7d8c6f13c57dce23fa10e4417", "score": "0.5047332", "text": "function definingActive() {\n var sheet = SpreadsheetApp.getActiveSheet();\n return sheet.getDataRange();\n}", "title": "" }, { "docid": "597650f9b179e606dc9fe664f5ae43bc", "score": "0.50455916", "text": "function getRangeClientRectsChrome(range) {\n var tempRange = range.cloneRange();\n var clientRects = [];\n\n for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n // If we've climbed up to the common ancestor, we can now use the\n // original start point and stop climbing the tree.\n var atCommonAncestor = ancestor === range.commonAncestorContainer;\n\n if (atCommonAncestor) {\n tempRange.setStart(range.startContainer, range.startOffset);\n } else {\n tempRange.setStart(tempRange.endContainer, 0);\n }\n\n var rects = Array.from(tempRange.getClientRects());\n clientRects.push(rects);\n\n if (atCommonAncestor) {\n var _ref;\n\n clientRects.reverse();\n return (_ref = []).concat.apply(_ref, clientRects);\n }\n\n tempRange.setEndBefore(ancestor);\n }\n\n !false ? \"development\" !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}", "title": "" }, { "docid": "93d6bf73a902de34faf733b4e483a9c6", "score": "0.5044866", "text": "function selectDataNodeByColumnValueRange(column, range) {\n\tvar matches = [];\n\t$(\"g.marks\").children().each(function() {\n\t\tif (this.__data__.datum[column] >= range[0] &&\n\t\t\tthis.__data__.datum[column] <= range[1]) {\n\t\t\tmatches.push(this);\n\t\t}\n\t});\n\treturn matches;\n}", "title": "" }, { "docid": "faad8d044074c475490f73730b9643b0", "score": "0.5044076", "text": "function getCoordinates(cell) {\r\n\tconst col = cell.column;\r\n\tconst row = cell.row;\r\n\r\n\tconst x_co = col * cellSize;\r\n\tconst y_co = row * cellSize;\r\n\r\n\treturn [x_co, y_co];\r\n}", "title": "" }, { "docid": "39ea09d4703d069195a511781b656444", "score": "0.5032101", "text": "function _fnCoordsFromCell( n )\n\t{\n\t\tif ( _oDatatable )\n\t\t{\n\t\t\treturn [\n\t\t\t\t$('td', n.parentNode).index(n),\n\t\t\t\t$('tr', n.parentNode.parentNode).index(n.parentNode) + _oDatatable._iDisplayStart\n\t\t\t];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn [\n\t\t\t\t$('td', n.parentNode).index(n),\n\t\t\t\t$('tr', n.parentNode.parentNode).index(n.parentNode)\n\t\t\t];\n\t\t}\n\t}", "title": "" }, { "docid": "333f65df06f3270431143024de704f6a", "score": "0.50276476", "text": "getNeighborCords(node) {\n let neighborCords = [];\n for (let i = 0; i < node.neighborCords.length; i++) {\n neighborCords.push({ row: node.neighborCords[i].row, col: node.neighborCords[i].col });\n }\n return neighborCords;\n }", "title": "" }, { "docid": "92f1a8cd1ed73ea572c0cc3a130ec717", "score": "0.50220555", "text": "function returnCol(cell) {\n return cell % 9;\n}", "title": "" }, { "docid": "976f13e32b42bc8994d5f7eeda0a1218", "score": "0.502115", "text": "_getSelectableRange(item1, item2) {\n var selectables = [];\n var columnCount = this._pane.getColumnConfig().getItemCount();\n\n if (\n item1.row < item2.row ||\n (item1.row == item2.row && item1.column < item2.column)\n ) {\n var start = item1.row * columnCount + item1.column;\n var end = item2.row * columnCount + item2.column;\n } else {\n var start = item2.row * columnCount + item2.column;\n var end = item1.row * columnCount + item1.column;\n }\n\n for (var i = start; i <= end; i++) {\n var cell = {\n row: Math.floor(i / columnCount),\n column: i % columnCount\n };\n\n if (this._isSelectable(cell)) {\n selectables.push(cell);\n }\n }\n return selectables;\n }", "title": "" }, { "docid": "fae784f632105e95d13d833b8fc34d3d", "score": "0.5014692", "text": "function coords(n) {\n var x = n%dimx\n var t = Math.floor(n/dimx)\n var y = t%dimy\n var z = Math.floor(t/dimy)\n console.assert(cell(x,y,z) == n)\n return [x,y,z]\n }", "title": "" }, { "docid": "1f740f9df0246f6f69ab55a2ad165102", "score": "0.5005548", "text": "function getCellByCoords(row, col) {\n const coords = `${col},${row}`; //\"x, y\"\n return GRID[coords];\n}", "title": "" }, { "docid": "88d2db1ccedf228850d96c09a36a13ee", "score": "0.5002272", "text": "function getCellCoordinates(index) {\n\tindex = normalizeIndex(index);\n\tvar y = Math.floor(index/lifeWidth);\n\tvar x = index-(y*lifeWidth);\n\treturn { 'x':x, 'y':y };\n }", "title": "" }, { "docid": "4051fad93d73ed4da6fbd707f70d7610", "score": "0.5001799", "text": "function getCharRange(startChar, endChar) {\n let result = [];\n for (let code = startChar.charCodeAt(0); code <= endChar.charCodeAt(0); code++)\n result.push(String.fromCharCode(code));\n return result;\n }", "title": "" }, { "docid": "a1c654862b663201a5f018fd9545ecb1", "score": "0.49936134", "text": "getCell(row, col) {\n if (this.coordinateValidator(row, col)) return this.board[row][col];\n }", "title": "" }, { "docid": "c6ad08859dcab5eecfac172fbb0cda80", "score": "0.49895012", "text": "getPossilbeLifeCells() {\n const livingCells = this.getAliveCells();\n\n return _.chain(livingCells)\n .map(([x,y]) => this.getNeighbors(x,y))\n .flatten()\n .concat(livingCells)\n .uniqWith(_.isEqual)\n .value();\n }", "title": "" }, { "docid": "9c39a29c70a3bd684de894f033063e9f", "score": "0.49755308", "text": "getNeighbors(row, col) {\n let neighbors = [];\n for(let i = row - 1; i <= row + 1; i++) {\n for(let j = col - 1; j <= col + 1; j++) {\n if(i === row && j === col) continue;\n if(this.grid[i] && this.grid[i][j]) {\n neighbors.push(this.grid[i][j]);\n }\n }\n }\n\n return neighbors;\n }", "title": "" }, { "docid": "3ad993b5089dedc7ce76583eda0f9430", "score": "0.497244", "text": "checkSideCell() {\n let sideCells = [2, 4, 6, 8];\n let res;\n sideCells.forEach((item) => {\n let temp = $('#' + item);\n if (!(temp.hasClass('cellX')) && !(temp.hasClass('cellY'))) {\n res = temp;\n }\n });\n return res;\n }", "title": "" }, { "docid": "18f0b2e647672be07678e6add5884221", "score": "0.49711812", "text": "function GetCell(x, y) {\n return cells[y * 3 + x];\n}", "title": "" }, { "docid": "10b44eef687e21249cdf55f3f54fbd3b", "score": "0.49658746", "text": "function getCellsAtRow(opts,\n// The table\ntable, rowIndex) {\n return table.nodes.get(rowIndex).nodes;\n}", "title": "" }, { "docid": "cb57804405a13a1f97f81a98d281b5b6", "score": "0.4964918", "text": "function getCells() {\n // this.createCells()\n for (let i = 1; i < 9; i++) {\n cellArr.push({ src: `./images/image${i}.png`, value: i, id: `img${i}` })\n }\n cellArr.push({ src: `./images/image0.png`, value: 0, id: `img0` })\n // console.log(cellArr)\n}", "title": "" }, { "docid": "9514c65499ee0c9991a68162ea2e03c9", "score": "0.49583596", "text": "function getCellElements(currentRowElement) {\n return currentRowElement.querySelectorAll(\".cell\")\n}", "title": "" }, { "docid": "7b3ef4f7de41b0b03bed62b9480f7530", "score": "0.4957904", "text": "getContainingCell(x, y) {\n const rc = this.pointToEntry(x, y);\n if (rc !== null) {\n const [r, c] = rc;\n return this.getCell(r, c);\n }\n return null;\n }", "title": "" } ]
63dd3f37ca721bf2dc26564906320195
remove 'isactive' class from every element in an array
[ { "docid": "ee9ff9a03af2f31e3c3f082829b5203a", "score": "0.84037864", "text": "function removeActive (array) {\n if (typeof array == 'object') {\n array = nodeListToArray(array);\n }\n array.forEach(function (item) {\n removeClass(item, 'is-active');\n });\n }", "title": "" } ]
[ { "docid": "bd3ec26cb43eff30451a52edc0c43ea2", "score": "0.8317635", "text": "function removeActiveClassInArr (arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i].classList.remove(\"active\");\n }\n}", "title": "" }, { "docid": "d70d3b5955a92ed0817a7eadcb38b835", "score": "0.75248474", "text": "function removeActive(x) {\n\t\t\tif (x.length > 0) {\n\t\t\t\tfor (var i = 0; i < x.length; i++) {\n\t\t\t\t\tx[i].classList.remove('active');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "1b502bf1afe8d67d015388f03e052dbe", "score": "0.74944216", "text": "function removeClass() {\n list.forEach(el => {\n el.classList.remove('actived');\n })\n }", "title": "" }, { "docid": "c1319b87849e1b2f7e73ca79ad1aee2b", "score": "0.7464606", "text": "function removeAllActive(){\n\n\t// Loop On Images List\n\tsliderImage.forEach(function(img){\n\n\t\timg.classList.remove('active');\n\t});\n\n\t// Loop On Poltes List\n\tpolitsList.forEach(function(polit){\n\n\t\tpolit.classList.remove('active');\n\t});\n}", "title": "" }, { "docid": "a50b70f8798238f1a4afcae86c24812e", "score": "0.7428299", "text": "function removeAllActive() {\n\n // Loop Through Images\n sliderBasket.forEach(function (div) {\n\n div.classList.remove('active');\n\n });\n\n // Loop Through Pagination Bullets\n paginationsBullets.forEach(function (bullet) {\n\n bullet.classList.remove('active');\n\n });\n\n}", "title": "" }, { "docid": "110c1daf965f75fb30548f94ef80e7f2", "score": "0.73928607", "text": "_removeActive(items) {\n\t\t[].slice.call(items).forEach(item => {\n\t\t\titem.classList.remove('active');\n\t\t\titem.setAttribute('aria-selected', 'false');\n\t\t});\n\t}", "title": "" }, { "docid": "a9e3bef47f5d19c9e76f71b81645e941", "score": "0.73577255", "text": "function removeAllClasses () {\n \"use strict\";\n // Loop Through Images\n slidrImages.forEach(function(image){\n image.classList.remove(\"active\");\n });\n // Loop Through Pagination Bullets \n paginationsBullets.forEach(function(bullet){\n bullet.classList.remove(\"active\");\n });\n }", "title": "" }, { "docid": "b33bd02d2fcd8dea8713ef69fb963257", "score": "0.7353566", "text": "function removeActiveClass() {\n images.forEach((image) => {\n if(image.classList.contains('active')) {\n image.classList.remove('active');\n };\n })\n}", "title": "" }, { "docid": "e9f74bb8318621365dc0f727571a151b", "score": "0.73487365", "text": "function removeActiveClasses() {\n cards.forEach((card) => {\n card.classList.remove(\"active\");\n });\n}", "title": "" }, { "docid": "ac43c4a393c321e1cad887d7948ec5f6", "score": "0.7337209", "text": "function removeAllActive() {\n //all throgh images\n sliderImages.forEach(function (img) {\n img.classList.remove('active');\n });\n // loop getUlLi\n getUlLi.forEach(function (el) {\n el.classList.remove('active')\n });\n}", "title": "" }, { "docid": "6902013343acd293c337dcef2f52b1ea", "score": "0.7304547", "text": "function removeAllActive(){\r\n\r\n // loop through images\r\n \r\n sliderImages.forEach(function(img){\r\n img.classList.remove('active');\r\n })\r\n\r\n//loop through pagination Bullets\r\n paginationBullets.forEach(function (bullet){\r\n bullet.classList.remove('active');\r\n \r\n})\r\n}", "title": "" }, { "docid": "9131bed6bd52340e1c3957ac11766778", "score": "0.72342515", "text": "function activeState(items, activeName) {\n for(var i = 0; i < items.length; i++) {\n if(items[i].classList.contains(activeName)) {\n items[i].classList.remove(activeName);\n }\n }\n }", "title": "" }, { "docid": "2e8785c29fc5d729242be4065ec14021", "score": "0.7220175", "text": "function removeAllActive() {\n // Loop Through Images\n sliderImages.forEach(img => {\n img.classList.remove('active');\n });\n // Loop Through Pagination Bullets\n paginationBullets.forEach(bullet => {\n bullet.classList.remove('active'); \n });\n}", "title": "" }, { "docid": "a4bf0dc7d7f5ce314b690a207cb881a3", "score": "0.71883917", "text": "inactive() {\n\t\tfor (const css of this.inactiveValues) {\n\t\t\tthis.element.classList.add(css);\n\t\t}\n\t\tfor (const css of this.activeValues) {\n\t\t\tthis.element.classList.remove(css);\n\t\t}\n\t}", "title": "" }, { "docid": "f138c273953dd26bd2b9b525b5bb3eaf", "score": "0.7149764", "text": "function removeAllActiev() {\n // Loop Trough Imges\n sliderImges.forEach(function (img) {\n img.classList.remove('active');\n });\n\n // Loop Through The paginationBullets\n paginationBullets.forEach(function (bullet) {\n bullet.classList.remove('active');\n });\n}", "title": "" }, { "docid": "2e730bc1c00355409ad7769c02cdb8b1", "score": "0.7145633", "text": "function removeActiveClasses(){\n panels.forEach((panel) => {\n panel.classList.remove(\"active\");\n });\n}", "title": "" }, { "docid": "e8b3672f389ad4a2db94f194ae6f3339", "score": "0.71152896", "text": "function removeClasses(array){\r\n for (var i = 0; i < array.length; i++){\r\n deck.innerHTML = \"\";\r\n [].forEach.call(cards, function(item) {\r\n deck.appendChild(item);\r\n });\r\n array[i].classList.remove(\"show\", \"open\", \"match\", \"disabled\");\r\n }\r\n}", "title": "" }, { "docid": "1d321a5212eb9aa5c5d7854004e4ec5f", "score": "0.71026236", "text": "function removeAllActive(targetElement) {\n for (var i = 0; i < targetElement.length; i++) {\n targetElement[i].classList.remove(\"active\");\n }\n }", "title": "" }, { "docid": "bb9ab09fe48372450dce1aa82f279fd0", "score": "0.7094992", "text": "function removeAllActive() {\n navElements.forEach(el => el.classList.contains(\"active\") ? el.classList.remove(\"active\") : false);\n sections.forEach(el => el.classList.contains(\"active\") ? el.classList.remove(\"active\") : false);\n}", "title": "" }, { "docid": "e1502391557a272bf3b74ef4577092f0", "score": "0.707806", "text": "function removeActiveClass(){\n panels.forEach((panel) => {\n panel.classList.remove('active')\n })\n}", "title": "" }, { "docid": "fb2d2388d1a89fde77e4026083a3f91e", "score": "0.7019133", "text": "function removeAllActive(targetElement) {\n for (var i = 0; i < targetElement.length; i++) {\n targetElement[i].classList.remove('active');\n };\n }", "title": "" }, { "docid": "8d1a63f8097dec42a454249753f167ce", "score": "0.7017135", "text": "active() {\n\t\tfor (const css of this.activeValues) {\n\t\t\tthis.element.classList.add(css);\n\t\t}\n\t\tfor (const css of this.inactiveValues) {\n\t\t\tthis.element.classList.remove(css);\n\t\t}\n\t}", "title": "" }, { "docid": "92f2e6e6932a2158d0fd66dc410e1b1e", "score": "0.7014005", "text": "function removeactiveitem(){\n gallerylists.forEach(gallerylist=>{\n gallerylist.classList.remove('activeitems');\n })\n}", "title": "" }, { "docid": "fa4240f722119267045e1427d4de54b6", "score": "0.7000645", "text": "function removeactiveitem(){\n collectionlists.forEach((collectionlist)=>{\n collectionlist.classList.remove(\"activeitems\");\n })\n}", "title": "" }, { "docid": "fde8e526df746fb22ad6cc6ddd985962", "score": "0.6999078", "text": "function removeActive(x) {\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }", "title": "" }, { "docid": "17dd28f218440031602ffcb768bad69e", "score": "0.6957867", "text": "function removeActiveClasses() {\n panels.forEach((panel) => {\n panel.classList.remove('active');\n })\n}", "title": "" }, { "docid": "d2fff5160681926a3d8c7b22927a5180", "score": "0.6944442", "text": "function removeClass(){\n operator.forEach(function(i){\n if(i.classList.contains(\"clicked\")){\n i.classList.remove(\"clicked\");\n }\n });\n}", "title": "" }, { "docid": "f7ff5eed07a5932ab362e034c7aaf5f9", "score": "0.69426715", "text": "function desactivateAll() {\n for (var i = 0; i < period.length; i++) {\n period[i].classList.remove(\"active\");\n }\n}", "title": "" }, { "docid": "130f64cc91183229bbc53a46f3297acb", "score": "0.6929378", "text": "function clearActives(){\n cards.forEach((card) => {\n if(card.classList.contains(\"active\")){\n card.classList.remove(\"active\");\n }\n })\n}", "title": "" }, { "docid": "9339f24374a7c0a4ee644db929dd6b17", "score": "0.69183207", "text": "function makeInactive(items) {\n const content = Object.keys(items).map(item => {\n $(items[item]).removeClass(\"active show\");\n });\n}", "title": "" }, { "docid": "d5a2b964c60e519105aeb18ce6965fd3", "score": "0.69089293", "text": "function removeActive(x) {\n /*a function to remove the \"active\" class from all autocomplete items:*/\n for (var i = 0; i < x.length; i++) {\n x[i].classList.remove(\"autocomplete-active\");\n }\n }", "title": "" }, { "docid": "5d0663fcaece50bc6e066118fa2f9dd1", "score": "0.68393755", "text": "function resetActiveClass() {\n let children = [];\n // reset active class from all LIs\n children = getChildren(document.getElementById(\"mainMenu\"));\n children.forEach(thisOne => {\n thisOne.classList.remove(\"active\");\n });\n }", "title": "" }, { "docid": "4aa25239e63ec7c802ccfd5d3793430e", "score": "0.6819173", "text": "function removeAllActiveClass() {\r\n html.links.forEach(tab => {\r\n tab.className = tab.className.replace(\" active\", \"\")\r\n })\r\n }", "title": "" }, { "docid": "2803f78b937a672b3ea6e092524544ef", "score": "0.6816524", "text": "removeActive() {\n $('li').each(function() {\n $(this).removeClass('is-active');\n });\n }", "title": "" }, { "docid": "18bbe3c45238e027ba7c089fa1a9cd98", "score": "0.6792675", "text": "function removeActive(x) {\n\tfor (var i = 0; i < x.length; i++) {\n\t\tx[i].style.backgroundColor = '#efefef';\n\t}\n}", "title": "" }, { "docid": "c71a8076cea1ecd2bbb8185646f061fa", "score": "0.677919", "text": "function removingClass(arr, className){\n var copyArr = [...arr];\n return copyArr.forEach(function(el){\n el.classList.remove(className)\n })\n}", "title": "" }, { "docid": "6a20aa2c871ddb272160e9e43dce9ad6", "score": "0.6736451", "text": "function cleanTasksHighLight() {\n var aLi = $(\"#task-list\").getElementsByTagName('li');\n for (var i = 0; i < aLi.length; i++) {\n removeClass(aLi[i], \"active\");\n }\n}", "title": "" }, { "docid": "8fb09fb5eb2d6c563de56c3d1177f498", "score": "0.6705841", "text": "function toggleActive (array, el) {\n var isActive = hasClass(el, 'is-active');\n if (isActive) {\n removeClass(el, 'is-active');\n } else {\n removeActive(array);\n addClass(el, 'is-active');\n }\n }", "title": "" }, { "docid": "bb3419b4077910178a524feb21230131", "score": "0.66506547", "text": "function removeActiveLinks() {\n\t\tfor (i=0; i<tocElements.length; i++) {\n\t\t\ttocElements[i].classList.remove('em-is-active');\n\t\t}\n\t}", "title": "" }, { "docid": "990acbf759b8066107dfba39b3f06614", "score": "0.6632188", "text": "function cleanAllActiveOnStatusButton() {\n removeClass($(\"#all-tasks\"), \"active\");\n removeClass($(\"#unfinish-tasks\"), \"active\");\n removeClass($(\"#finished-tasks\"), \"active\");\n}", "title": "" }, { "docid": "0c5a054ab0b7cbdb64fcafbdefc20371", "score": "0.6598315", "text": "function removeActiveClass(currentClass) {\n let active = document.querySelectorAll('.active');\n for (let i = 0; i < active.length; i++) {\n if (active[i].classList.contains(currentClass)) {\n active[i].classList.remove('active');\n } \n }\n}", "title": "" }, { "docid": "413dbc4a762673eeefc6df449e531647", "score": "0.6561108", "text": "function removeActivaClase() {\n cartas.forEach(carta => {\n carta.classList.remove(\"activa\");\n });\n}", "title": "" }, { "docid": "5b59bbf6bd401ee92b07002bbac64f9b", "score": "0.6550103", "text": "function inactivateClasses(classes) {\n const inactiveClasses = cloneDeep(classes);\n return inactiveClasses.map(c => {\n c.assignments.exams.forEach(quiz => {\n quiz.active = false;\n });\n c.assignments.lessons.forEach(lesson => {\n lesson.is_active = false;\n });\n return c;\n });\n}", "title": "" }, { "docid": "95c866d1fa9ddc9e06befeccaec25428", "score": "0.6549373", "text": "function resetActiveStates() {\n var activeElements = document.querySelectorAll('#'+tabbedViewID+' .active');\n if(activeElements) {\n for(var i = 0; i < activeElements.length; i++) {\n activeElements[i].className = activeElements[i].className.replace('active', '').trim();\n }\n }\n }", "title": "" }, { "docid": "5f3a88e6323abd7a089dc5ac0ba635dd", "score": "0.654262", "text": "function removeClass(elmts) {\n for(var i= 0; i<elmts.length; i++)\n elmts[i].className = '';\n}", "title": "" }, { "docid": "55b00237301c538a147db71fb3115d2d", "score": "0.6530772", "text": "function diactivateClass(target, className){\n // get all items\n var items = Array.from(target.getElementsByClassName(className));\n // diactivate all items\n items.forEach(function(item, index){\n var itemClass = Array.from(item.classList);\n if(itemClass.includes(\"active\")){\n item.classList.remove(\"active\");\n }\n });\n}", "title": "" }, { "docid": "2b78287393b843ad5ccb80c1e2a61b32", "score": "0.650916", "text": "function clearFilterButtonsActiveClass() {\n let filterButtons = document.querySelectorAll('.filterButton');\n filterButtons.forEach(\n filterButton => filterButton.classList.remove('filterButton--active'));\n}", "title": "" }, { "docid": "ef6ee26c1f88a4baad37f7ef28db8fba", "score": "0.6490121", "text": "function hudeImgGallary() {\n galleryImage.forEach(it => {\n it.classList.remove('imgactive')\n })\n }", "title": "" }, { "docid": "3ad23bbe1a111bd119da097d5bbe7756", "score": "0.6454718", "text": "removeActiveSlider(){\n for(var oneKindBlock = 0; oneKindBlock < this.kindSliders.length; oneKindBlock++){\n this.kindSliders[oneKindBlock].classList.remove(\"active\");\n }\n }", "title": "" }, { "docid": "799e275fa23738d12ae8969d4785e9a3", "score": "0.6448292", "text": "function removeColors(array, color){\n array.forEach(element => {\n element.classList.remove(color);\n });\n}", "title": "" }, { "docid": "538a41799ba2c7d08f375589f79f8be7", "score": "0.64473665", "text": "removeActiveTabs() {\n this.sidebarIcons.forEach(icon => {\n icon.classList.remove('active')\n })\n }", "title": "" }, { "docid": "1191bb9ef30240bd0ab7dbbc51cf8d9a", "score": "0.6395017", "text": "function makeSectionsNotHighlighted() {\n for (let i = 0; i < allSectionsList.length; i++) {\n if (allSectionsList[i].classList.contains(\"your-active-class\"))\n allSectionsList[i].classList.remove(\"your-active-class\");\n }\n}", "title": "" }, { "docid": "0b66d190879ce1aa50687892d55b81d9", "score": "0.6377333", "text": "removeCheckedLabelClass(items){\n items.forEach( el => {\n el.classList.remove('checked-label');\n })\n }", "title": "" }, { "docid": "9c27cb343ea5504fc0d04d9ba2e64530", "score": "0.6375045", "text": "function removee() {var i=0;\n for(i=1;i<=4;i++)\n document.getElementById(i).classList.remove(\"active\");\n }", "title": "" }, { "docid": "42703989b9e4d10e43b74304dedabc7d", "score": "0.637058", "text": "function removeBackground(){\n for(let i = 0; i < sections.length; i++){\n sections[i].classList.remove(\"your-active-class\");\n }\n}", "title": "" }, { "docid": "2be4ad4188d6d45db5dae60d6d3eed69", "score": "0.6360308", "text": "function clearClass() {\n\n var x = document.querySelectorAll(\"span.highlighted\");\n for (var i = 0; i < x.length; i++) {\n x[i].removeAttribute('class');\n }\n }", "title": "" }, { "docid": "5ed95aa4691409ad2183e5abf5b78fed", "score": "0.63335675", "text": "function removeClass() {\n const remove = document.querySelector('.active');\n remove.className = '';\n return remove;\n}", "title": "" }, { "docid": "935a5af653ad44605a0d1cf60c8b7a19", "score": "0.63214207", "text": "removeAllActiveItems () {\r\n $('#' + this.id).find('.slider__item').removeClass('animated ' + '' + this.slideEffect)\r\n $('#' + this.id).find('.slider__item').removeClass('' + this.activeClass).addClass('' + this.hiddenClass).removeAttr('style')\r\n $('.slider__bullets').find('.slider__dot').removeClass('' + this.activeClass)\r\n }", "title": "" }, { "docid": "c0df4ae4d1d1c7984cbdeb6fb0bfd4a0", "score": "0.6308097", "text": "function removeClassActiveOfli(){\n document.querySelectorAll('li.your-active-class').forEach((item) => {\n item.classList.remove('your-active-class');\n });\n}", "title": "" }, { "docid": "b73d3862d6690853bdbd6867aa6c23a9", "score": "0.6298061", "text": "function removeActiveClass(seatItemId) {\n seatItemId.split(\"-\").map((seat) => {\n $(`.seat-wrapper[data-id=\"${seat}\"]`).children().removeClass(\"active\");\n });\n}", "title": "" }, { "docid": "1151a233b1d631ed6aeec5a76bc75159", "score": "0.62795275", "text": "function setactivesslide(){\n /* slides.forEach((slide)=>{\n // console.log(slide);\n\n slide.classList.remove('active');\n }); */\n\n slides.forEach(slide=>slide.classList.remove('active'));\n\n slides[activeslide].classList.add('active');\n}", "title": "" }, { "docid": "c4512fbbc3d49457e1f960e6476229ff", "score": "0.62408906", "text": "function uncheckClasses(classes, arrayLength){\n\tfor (var i = 0; i < arrayLength; i++){\n\t\tdocument.getElementById(classes[i]).checked = false;\n\t}\t\n}", "title": "" }, { "docid": "49c4bbadae403c912f9b8f87e7cbfc4e", "score": "0.6237344", "text": "function deleteActive() {\n divs.forEach(div => {\n div.classList.remove('active');\n });\n\n buttons.forEach(btn => {\n buttonsClick.forEach(btn1 => {\n btn1.style.display = \"none\";\n });\n\n btn.style.display = \"block\";\n });\n}", "title": "" }, { "docid": "b45b452b8057a49ec44bca5e457a638b", "score": "0.6231792", "text": "function reActive(classes) {\n for (const sec of secList) {\n const secVP = sec.getBoundingClientRect()\n if (secVP.top >= 0 && secVP.top <= 350) {\n removeAllclasses(classes)\n sec.classList.add(classes[0])\n const selected = document.querySelector('[data-nav-nav = \"' + sec.getAttribute('data-nav') + '\"]')\n selected.classList.add(classes[1])\n }\n }\n}", "title": "" }, { "docid": "79c7d157b971c8bcef3f8f3d899c2fb1", "score": "0.62036884", "text": "function removeActiveFormSections(){\n sections.forEach(function(element){\n element.classList.remove('your-active-class')\n });\n }", "title": "" }, { "docid": "dd9c56223048ce092a661711427969ba", "score": "0.61941165", "text": "function _removeClass() {\n openCards[0].classList.remove('open', 'show');\n openCards[1].classList.remove('open', 'show');\n openCards.splice(0, 2);\n}", "title": "" }, { "docid": "776f3ea5c23065afa63e989bb8e2368e", "score": "0.6187179", "text": "function removeClass(elements, classToRemove) {\n\n for (var index = 0; index < elements.length; index++) { \n elements[index].classList.remove(classToRemove);\n }\n}", "title": "" }, { "docid": "bfe88a12a8251cdfa0be720a7012f72b", "score": "0.61727047", "text": "function removeClass(){\n for(var i=0;i<disabledLetterClasses.length;i++){\n $(\"#\"+disabledLetterClasses[i]).removeClass(\"disabled\");\n }\n disabledLetterClasses = [];\n }", "title": "" }, { "docid": "1837e738c72bcf3e22e3b3c2bac7c913", "score": "0.6169728", "text": "function desactiveAllImages(carouselElement) {\n carouselElement.classList.remove(\"forward\");\n carouselElement.classList.remove(\"back\");\n carouselElement.querySelectorAll(\".image\").forEach(function(img) {\n img.classList.remove(\"is-active\");\n img.classList.remove(\"is-prev-active\");\n img.classList.remove(\"is-next-active\");\n });\n}", "title": "" }, { "docid": "20ab5f092eb6a6a8d4368de31f06566d", "score": "0.6140522", "text": "clearActive() {\n this.toArray().forEach((currentRegion) => {\n const thisRegion = currentRegion;\n thisRegion.active = false;\n });\n }", "title": "" }, { "docid": "0f261fbf229961f5e00773075dcd2cf9", "score": "0.6127523", "text": "function clearListActive() {\n $('.list-group-item').each(function () {\n $(this).removeClass('active');\n })\n}", "title": "" }, { "docid": "a2f762418f9e02c2ca10e25abbbfeb6b", "score": "0.61265725", "text": "function cleanup(){\n document.querySelectorAll('.card').forEach(i => i.classList.remove('active'));\n document.querySelectorAll('.link-filters__items li').forEach(i => i.classList.remove('active'));\n }", "title": "" }, { "docid": "3be005cb9b997f538f0c2cc77160c8ed", "score": "0.6120568", "text": "function liAddActiveClass(numb) {\n navLIS.forEach(li => {\n li.classList.remove(\"active\");\n });\n navLIS[numb].classList.add(\"active\");\n}", "title": "" }, { "docid": "1aaaf7534a4dacbc66521992afc3eeb7", "score": "0.608521", "text": "function toggleClass(el) {\r\n //Declaring and initialising the menu_categories array with the anchor child elements\r\n var menu_categories = document.getElementById(\"menu_categories\").children;\r\n\r\n //lopping through the menu_category links and making them inactive\r\n for (var i = 0; i < menu_categories.length; i++) {\r\n menu_categories[i].classList.remove(\"active\");\r\n }\r\n\r\n //changing the currently clicked link to active\r\n el.classList.add(\"active\");\r\n\r\n //display the respective menu items\r\n filter_items(el);\r\n\r\n}", "title": "" }, { "docid": "fa6e5dbeb5efec9f739bdba9148ab33c", "score": "0.60839", "text": "function clearBoxes(className) {\n //Clearing the checkboxes\n Array.from(document.getElementsByClassName(className)).forEach((element) => element.classList.remove(\"active\"));\n}", "title": "" }, { "docid": "f0a6108945b4471b26bb515f8298573a", "score": "0.6066245", "text": "function reset(){\n for(let i = 0; i < images.length; i++){\n images[i].style.display = 'none';\n images[i].classList.remove('active');\n }\n}", "title": "" }, { "docid": "19908bb668ed13292bf8bf1ca85ce877", "score": "0.6066172", "text": "unFlipCards() {\n this.cardsArray.forEach(card => {\n card.classList.remove('flip-effects');\n });\n\n\n }", "title": "" }, { "docid": "905cd36fa1e7d3e7edc99922decf6b70", "score": "0.605003", "text": "removeContentActiveClass() {\n\t\t\t_.removeClass(this.$parent.$el, c.cls.content_active);\n\t\t}", "title": "" }, { "docid": "d7bfbdd20ed5e03563481310d8701881", "score": "0.6033823", "text": "function clearAllButtons() {\n var buttons = $$(\"categoryselectors\");\n for(var i = 0; i < buttons.length; i++) {\n if(buttons[i].classList.contains(\"categoryActive\")) {\n buttons[i].classList.remove(\"categoryActive\");\n }\n if(!buttons[i].classList.contains(\"grayed\")) {\n buttons[i].classList.add(\"grayed\");\n }\n }\n }", "title": "" }, { "docid": "336c225389c7fc30ee13152586c68d84", "score": "0.6024418", "text": "function setActiveClass() {\n // reset all active classes\n for (item of slideItems) {\n item.classList.remove('active');\n }\n\n // set active class\n slideItems[currentSlide].classList.add('active');\n }", "title": "" }, { "docid": "cabbd6d654c625a6e4d0b7c2178013aa", "score": "0.60176086", "text": "function clearAll(){\n if($(\".auto-active\")){\n $(\".auto-active\").remove()\n }\n }", "title": "" }, { "docid": "67262353aa480acb3ab9d1efdb9294c9", "score": "0.60170215", "text": "function cleanActivesBtn(el) {\n var actives = $('.button-rockola-active');\n\n if (actives.length > 0) {\n actives.each(function(){\n $(this).removeClass('button-rockola-active');\n });\n }\n \n setTimeout(function(){\n $(el).addClass('button-rockola-active');\n }, 100);\n \n \n}", "title": "" }, { "docid": "73687a9590927c7953afcb191ac16c6e", "score": "0.6009535", "text": "function clearActiveClass() {\n document.getElementById('setting-icon-list-item').classList.remove('active-feed');\n document.getElementById('stack-overflow-button').classList.remove('active-feed');\n document.getElementById('google-forum-button').classList.remove('active-feed');\n document.getElementById('page-select').style.display = \"none\";\n activeFeed = null;\n}", "title": "" }, { "docid": "3af529c3971f00de85d663a64ae8b275", "score": "0.6004703", "text": "function clearStatusClass(element) //how to clear previous state\n{\nelement.classList.remove('correct')\nelement.classList.remove('wrong')\n}", "title": "" }, { "docid": "ce86081de88ed830a02e1124cf88d944", "score": "0.5998427", "text": "function removeClass(e, c) {\n elm = document.querySelectorAll(mClass);\n for (var i = 0; i < elm.length; i++) {\n if (c == 'active') {\n elm[i].classList.remove('active');\n } else {\n if (!elm[i].classList.contains('active')) elm[i].querySelector('.dropdown-menu').classList.remove('show');\n }\n }\n}", "title": "" }, { "docid": "fc2afa603f75402ff5e2fb9ccb30eeea", "score": "0.599581", "text": "_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach(klass => this._toggleClass(klass, false));\n } else {\n Object.keys(rawClassVal).forEach(klass => this._toggleClass(klass, false));\n }\n }\n }", "title": "" }, { "docid": "0b10ce25fc98f7f56bf4bbaa7c514371", "score": "0.59931", "text": "function removeClass(lists,cls){\n for(let i=0;i<lists.length;i++){\n lists[i].classList.remove(cls)\n } \n }", "title": "" }, { "docid": "811912d14c13b793dec0703d65174459", "score": "0.5992032", "text": "function doClasses(el, classes, action) {\n for(var i in classes) {\n if(action) {\n el.classList.remove(classes[i])\n } else {\n el.classList.add(classes[i])\n }\n }\n}", "title": "" }, { "docid": "a15b43d501e56d08675b0df01b984258", "score": "0.5990951", "text": "function removeClassToAllElemInList(objects, className) {\n for (let r = 0; r < objects.length; r++) {\n objects[r].classList.remove(className);\n }\n}", "title": "" }, { "docid": "cef1457bef6c59465167050f77df97a9", "score": "0.5982174", "text": "function removeActiveClass(dropDownList) {\n\t\tfor (let i = 0; i < dropDownList.length; i++) {\n\t\t\tdropDownList[i].classList.remove(\"autocomplete-active\");\n\t\t}\n\t}", "title": "" }, { "docid": "d32d742ff535b21b4a720c5f9f3890ca", "score": "0.5975309", "text": "function resetActive() {\n const activeElement = document.querySelector(\".active\");\n activeElement.classList.remove(\"active\");\n}", "title": "" }, { "docid": "03b1b130cdf100e5fa70dbe6561adda4", "score": "0.59694237", "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.59694237", "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.59694237", "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": "18d99cd977191ee2b3bddce49248817e", "score": "0.5969317", "text": "function removeSelected() {\n for (var i = 0; i < buttons.length; i++) {\n buttons[i].classList.remove(\"selected\");\n }\n}", "title": "" }, { "docid": "b293926d90351df5fcc0c7c7799b93e7", "score": "0.5968101", "text": "function linksNonActiveAll() {\n document.getElementById(\"linkTicketsPrivados\").classList.remove('active');\n document.getElementById(\"linkTicketsPublicos\").classList.remove('active');\n document.getElementById(\"linkProfesionales\").classList.remove('active');\n document.getElementById(\"linkAdministrativos\").classList.remove('active');\n document.getElementById(\"linkConsultorios\").classList.remove('active');\n document.getElementById(\"linkAlquileres\").classList.remove('active');\n document.getElementById(\"linkDeudas\").classList.remove('active');\n}", "title": "" }, { "docid": "a83bc0ca745c313b463bdafb02c02401", "score": "0.5966722", "text": "function resetHighlight() {\n operatorBtns.forEach(elem => {\n elem.classList.remove(\"selected\");\n })\n}", "title": "" }, { "docid": "bf298445334e6f9844d89e24d3611611", "score": "0.59645826", "text": "function cleanSelect(array) {\r\n if (array.length > 0) {\r\n $.each(array, function (index, value) {\r\n var el = document.getElementById(value);\r\n el.classList.remove(\"selected\");\r\n\r\n });\r\n }\r\n}", "title": "" }, { "docid": "3d95a18dd1abd2dc6d3f9c0684931ed3", "score": "0.5964011", "text": "function RemoveAddClassByArray(el, classRemove, classAdd) {\n // var _el = document.querySelectorAll(el)\n for (var i = 0;i < el.length;i++) {\n if (classRemove != '') {\n el[i].classList.remove(classRemove)\n }\n if (classAdd != '') {\n el[i].classList.add(classAdd)\n }\n }\n}", "title": "" }, { "docid": "82854dbbce1fcb08112d59b01ddf9f6a", "score": "0.59480596", "text": "function RemoveAddClassByArray(el, classRemove, classAdd) {\n // var _el = document.querySelectorAll(el)\n for (var i = 0; i < el.length; i++) {\n if (classRemove != '') {\n el[i].classList.remove(classRemove)\n }\n if (classAdd != '') {\n el[i].classList.add(classAdd)\n }\n }\n}", "title": "" } ]
f6cfe453c27c14298b0cbb62443f318c
Constructor for a new EndpointManager instance.
[ { "docid": "66fa10e7a23bb11eb7f32576016f1238", "score": "0.5129626", "text": "constructor(endpointFilename, graphFilename) {\n this.endpointFilename = endpointFilename;\n this.graphFilename = graphFilename;\n }", "title": "" } ]
[ { "docid": "7c71c0233e3d1f70961d0fce97ad471f", "score": "0.6330398", "text": "constructor(endpoint) {\n winston.info(\"Creating NtripleClient instance.\");\n this.endpoint = endpoint;\n }", "title": "" }, { "docid": "33754b777118bc18708840317f984fac", "score": "0.5795069", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnEndpoint.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_sagemaker_CfnEndpointProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnEndpoint);\n }\n throw error;\n }\n cdk.requireProperty(props, 'endpointConfigName', this);\n this.attrEndpointName = cdk.Token.asString(this.getAtt('EndpointName', cdk.ResolutionTypeHint.STRING));\n this.endpointConfigName = props.endpointConfigName;\n this.deploymentConfig = props.deploymentConfig;\n this.endpointName = props.endpointName;\n this.excludeRetainedVariantProperties = props.excludeRetainedVariantProperties;\n this.retainAllVariantProperties = props.retainAllVariantProperties;\n this.retainDeploymentConfig = props.retainDeploymentConfig;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::SageMaker::Endpoint\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "591e477efc8c5b47bf107ea7e9dee545", "score": "0.5747698", "text": "constructor(tokenExchangeEndpoint, clientAuthentication) {\n super(clientAuthentication);\n this.tokenExchangeEndpoint = tokenExchangeEndpoint;\n this.transporter = new transporters_1.DefaultTransporter();\n }", "title": "" }, { "docid": "8f66ba064c229a55cbd945ed46e71d2f", "score": "0.5680501", "text": "function AuthenticationEndpointFactory() {\n if(!(this instanceof AuthenticationEndpointFactory)) {\n return new AuthenticationEndpointFactory();\n }\n}", "title": "" }, { "docid": "885d1ce9331b3935d2b5e3a925c68573", "score": "0.5636647", "text": "constructor(endpoint, credentials, options) {\n super(endpoint, credentials, options);\n this.features = new operations.Features(this);\n this.examples = new operations.Examples(this);\n this.model = new operations.Model(this);\n this.apps = new operations.Apps(this);\n this.versions = new operations.Versions(this);\n this.train = new operations.Train(this);\n this.permissions = new operations.Permissions(this);\n this.pattern = new operations.Pattern(this);\n this.settings = new operations.Settings(this);\n this.azureAccounts = new operations.AzureAccounts(this);\n }", "title": "" }, { "docid": "f54f85eccf1c79f2dd460a4c6a4a6f81", "score": "0.55604815", "text": "constructor(endpoint, debug = false) {\n if (endpoint !== undefined) {\n // endpoint passed and not undefined\n this._endpoint = endpoint;\n } else {\n // endpoint not passed or undefined\n this._log('No endpoint specified for API instance.');\n throw new Error('Cannot create GLU.Api instance without specifying the endpoint.');\n }\n // headers are initially empty\n this._headers = [];\n // set up debug context\n this.debug = debug;\n }", "title": "" }, { "docid": "466195d9566fdde9e6e549233a00ae03", "score": "0.55480134", "text": "function ChartEndpointFactory() {\n if(!(this instanceof ChartEndpointFactory)) {\n return new ChartEndpointFactory();\n }\n}", "title": "" }, { "docid": "07250d159f0a76492f311ba157c9d09a", "score": "0.5511037", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnEndpointConfig.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_sagemaker_CfnEndpointConfigProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnEndpointConfig);\n }\n throw error;\n }\n cdk.requireProperty(props, 'productionVariants', this);\n this.attrEndpointConfigName = cdk.Token.asString(this.getAtt('EndpointConfigName', cdk.ResolutionTypeHint.STRING));\n this.productionVariants = props.productionVariants;\n this.asyncInferenceConfig = props.asyncInferenceConfig;\n this.dataCaptureConfig = props.dataCaptureConfig;\n this.endpointConfigName = props.endpointConfigName;\n this.explainerConfig = props.explainerConfig;\n this.kmsKeyId = props.kmsKeyId;\n this.shadowProductionVariants = props.shadowProductionVariants;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::SageMaker::EndpointConfig\", props.tags, { tagPropertyName: 'tags' });\n }", "title": "" }, { "docid": "2a45551abc328ee1a2f5b25d8b4c8917", "score": "0.5463722", "text": "init() {\n const { routesDir } = this.config;\n\n fs.readdirSync(routesDir).forEach(dirName => {\n const routeDir = join(routesDir, dirName);\n const Class = require(routeDir);\n const validators = require(join(routeDir, 'validators'));\n\n const instance = new Class(this);\n\n Object.getOwnPropertyNames(Class.prototype)\n .filter(method => method != 'constructor')\n .forEach(metaData => {\n this.#setEndpoint(metaData, instance, validators)\n });\n });\n }", "title": "" }, { "docid": "48a3b71732d1424b27223fc393ead463", "score": "0.5408955", "text": "constructor() {\n super(SERVICE_ID);\n\n const defaults = {\n configItem: 'publicDirectory',\n enableCache: true,\n };\n\n this.configure(defaults);\n\n this._cache = []; // keep results in cache to avoid too much I/O calls\n this._sharedConfig = this.require('shared-config');\n }", "title": "" }, { "docid": "7f1c615036bc009fb87f742e4f0e8da3", "score": "0.5401435", "text": "function AdapterManager() {\n\t _classCallCheck(this, AdapterManager);\n\n\t this._adapters = {};\n\t this._cache = {};\n\t }", "title": "" }, { "docid": "f9008cafe56f365be4fbbda28572c087", "score": "0.53613216", "text": "constructor(accessToken, type = 'https') {\n if (!endpoints[type]) {\n throw new Error('Invalid endpoint type');\n }\n\n this.endpoint = endpoints[type];\n this.accessToken = accessToken;\n }", "title": "" }, { "docid": "2a9e629aa26188ab01aeb12872fefffa", "score": "0.5356053", "text": "constructor (constructorFn) {\n super()\n if (!constructorFn) throw new Error('JsonRpcEngineMiddlewareSubprovider - no constructorFn specified')\n this._constructorFn = constructorFn\n }", "title": "" }, { "docid": "4fdde67bca96c6179c0c4ff8b9b5e2b9", "score": "0.5316456", "text": "constructor() {\r\n this.adminId = null;\r\n this.peerName = null;\r\n this.chaincodeId = null;\r\n this.adminId = null;\r\n this.orgId = null;\r\n this.endpointURL = null;\r\n this.fabCAClient = null;\r\n this.fabClient = null;\r\n this.channel = null;\r\n this.peer = null;\r\n this.order = null;\r\n }", "title": "" }, { "docid": "2f3dc8c6e8a5572b24ade5ae686bff77", "score": "0.5279179", "text": "createInstance() {\n // Create IOTA instance with host and port as provider\n //todo: move params into config\n this.iota = new iotaLib({\n 'host': 'http://iota.bitfinex.com', // load balanced IOTA server wallet\n 'port': 80,\n// sandbox: true,\n// validate: function\n });\n }", "title": "" }, { "docid": "5dcd0a6577b5f107ec8d0b7d382866ba", "score": "0.5242181", "text": "constructor() {\n super();\n\n let hosts = this.getHostsFromConfig();\n\n this.client = new ElasticSearch.Client({\n host: hosts,\n log: 'error'\n });\n }", "title": "" }, { "docid": "7001f935ffdeaccd7f019290c6cf6165", "score": "0.5178682", "text": "constructor() {\n if (Emitter.instance) {\n return Emitter.instance;\n }\n this.eventEmitter = new events_1.EventEmitter();\n Emitter.instance = this;\n }", "title": "" }, { "docid": "0d5c37e8ceac220e581cebef8f2e5321", "score": "0.5177228", "text": "constructor() {\n this._router = new RouterWrapper();\n this._precacheManager = new PrecacheManager();\n }", "title": "" }, { "docid": "9d1d096630dd1d765fb93ffe8bc5daed", "score": "0.517092", "text": "constructor(apiUri) {\n if (apiUri == null) {\n throw \"The API URI parameter is required: apiUri\";\n }\n\n this.telemetryApiUri = apiUri;\n }", "title": "" }, { "docid": "df374ee072c24cc84b590ebd0d49e577", "score": "0.5150564", "text": "constructor () {\n\n this.__reset()\n\n this.linkTo = this.linkTo.bind(this)\n this.fullLinkTo = this.fullLinkTo.bind(this)\n this.linkToPath = this.linkToPath.bind(this)\n this.fullLinkToPath = this.fullLinkToPath.bind(this)\n this._getFromConfig = this._getFromConfig.bind(this)\n this._setFromConfig = this._setFromConfig.bind(this)\n // Need to keep this the same Proxy instance the whole time\n // so it can be imported using destructuring.\n this.config = new Proxy({}, {\n get: this._getFromConfig,\n set: this._setFromConfig,\n })\n }", "title": "" }, { "docid": "d8ca7b94ade69e2ea5fae29dc7a208fc", "score": "0.5122112", "text": "constructor(authenticator) {\n /**\n * Gets or sets the version of the Verifalia API to use when making requests; defaults to the latest API\n * version supported by this SDK. Warning: changing this value may affect the stability of the SDK itself.\n */\n this.apiVersion = 'v2.2';\n this._baseUris = [\n 'https://api-1.verifalia.com',\n 'https://api-2.verifalia.com',\n 'https://api-3.verifalia.com',\n ];\n if (!authenticator)\n throw new Error('authenticator is null');\n this._authenticator = authenticator;\n }", "title": "" }, { "docid": "29e77311129b26ed3bac7e6c5162629e", "score": "0.50934505", "text": "constructor()\n {\n this.configure();\n }", "title": "" }, { "docid": "7866dea472c8624d240ccb0d7d3e29eb", "score": "0.5065992", "text": "constructor() {\n super();\n this._logger = new pip_services3_components_node_2.CompositeLogger();\n this._connectionResolver = new pip_services3_rpc_node_1.HttpConnectionResolver();\n this._opened = false;\n }", "title": "" }, { "docid": "203d02746716dbb5642e10fb364543f7", "score": "0.5043969", "text": "constructor() { \n \n MFetchFileConfig.initialize(this);\n }", "title": "" }, { "docid": "1b68153354b1b61ec1e14198bc546182", "score": "0.50431216", "text": "constructor() {\n super(SERVICE_ID);\n\n const defaults = {\n configItem: 'setup',\n };\n\n this.configure(defaults);\n this._sharedConfig = this.require('shared-config');\n }", "title": "" }, { "docid": "d93055689d8ba78f354445ba044aae51", "score": "0.5043093", "text": "constructor() {\n\n this.logger = new APSLogger( \"APSEventBus\" );\n\n // noinspection JSValidateTypes\n /**\n * @type {array} busRouters. These routers must provide the subscribe, unsubscribe, and message methods\n * and parameters as this API have. These calls will be forwarded to each added router.\n * Router is a bad name here since each actually takes full responsibility for any\n * messaging. But it also makes things clear and very flexible. The components only\n * uses / knows about this class. Where messages go and where they come from is the\n * responsibility for other code.\n */\n this.busRouters = [];\n\n this.busAddressSet = false;\n }", "title": "" }, { "docid": "3e520c28ddb1c5d626cbab05191e62a3", "score": "0.50259674", "text": "function TransportServer() {\n\tthis.protocolServer = new ProtocolServer();\n\tthis.docNamespaces = new Map();\n}", "title": "" }, { "docid": "fab243289454b50ed5e525ca4f865a82", "score": "0.5024248", "text": "constructor(config) {\n super();\n this.apiUrl = config.exchange.api_url;\n this.latestEndpoint = config.exchange.endpoints.latest;\n this.historicalEndpoint = config.exchange.endpoints.historical;\n }", "title": "" }, { "docid": "438195972c581ac9df2676e5d6d08b95", "score": "0.5019789", "text": "set endpoint(endpoint) {\n\t\tif (Array.isArray(endpoint)) {\n\t\t\tthis._endpoint = endpoint.map((i) => new Reference(i));\n\t\t} else {\n\t\t\tthis._endpoint = [new Reference(endpoint)];\n\t\t}\n\t}", "title": "" }, { "docid": "15bc40b6329c6fbe401666148725f6dc", "score": "0.5005273", "text": "setEndpoint(value) {\n this.url = value;\n return this;\n }", "title": "" }, { "docid": "1c7f277f7f1c0ed92c3a4d954c98547e", "score": "0.50009996", "text": "constructor() { \n \n Host.initialize(this);\n }", "title": "" }, { "docid": "063a167b081e9e40bc5c20e88957e33d", "score": "0.49985966", "text": "function newManager() {\n return new breeze.EntityManager({\n dataService: dataService,\n metadataStore: metadataStore\n });\n }", "title": "" }, { "docid": "5dec35c6c63c6bbc19495a8c73847e7d", "score": "0.49860397", "text": "set endpoint(endpoint) {\n this._endpoint = endpoint;\n if (this.logger)\n this.logger.info(`ObjectStorageClient endpoint set to ${this._endpoint}`);\n }", "title": "" }, { "docid": "497a72959c55883ced52964a69726e85", "score": "0.49858457", "text": "constructor() {\n this._defaultConfig = pip_services3_commons_node_1.ConfigParams.fromTuples(\n // connections.*\n // credential.*\n \"options.max_pool_size\", 2, \"options.keep_alive\", 1, \"options.connect_timeout\", 5000, \"options.auto_reconnect\", true, \"options.max_page_size\", 100, \"options.debug\", true);\n /**\n * The logger.\n */\n this._logger = new pip_services3_components_node_1.CompositeLogger();\n /**\n * The connection resolver.\n */\n this._connectionResolver = new MongoDbConnectionResolver_1.MongoDbConnectionResolver();\n /**\n * The configuration options.\n */\n this._options = new pip_services3_commons_node_1.ConfigParams();\n }", "title": "" }, { "docid": "6461d3a1c2ab104a4d6b6d8f02b8bf14", "score": "0.49837834", "text": "constructor() {\n this.api = new PretendApiServer();\n }", "title": "" }, { "docid": "f1fe8096616b2cc2acc3d22bb8028167", "score": "0.49752334", "text": "init() {\n const self = this;\n\n const { router } = config;\n\n // Add default route. Configurations should be allowed to override this if needed.\n router.get('/', (req, res) => {\n const pkg = require('../package.json');\n res.send({\n name: pkg.name,\n description: pkg.description,\n version: pkg.version\n });\n });\n\n config.options.endpoints = {};\n\n // Load plugins that contain data and routes\n this.plugins();\n\n // Load local data and routes. Local data and routes should override the plugins.\n const routePaths = config.options.routes;\n const dataPath = config.options.data;\n\n // Local data can be missing if only plugins are use for route + data\n if (routePaths && dataPath) {\n this.routes(routePaths, dataPath);\n }\n\n _.each(config.options.endpoints, (endpoint, url) => {\n const route = new Route(url, endpoint, endpoint.dataPath);\n self.add(route);\n });\n }", "title": "" }, { "docid": "8bdac68855b8a642b2e833a841fb32c5", "score": "0.4974982", "text": "_createTransportImpl() {}", "title": "" }, { "docid": "0dbd0e07c97bcfeadfb88968a50f78a2", "score": "0.49742547", "text": "constructor() { \n \n ServicePlan.initialize(this);\n }", "title": "" }, { "docid": "d21623f37d89e92a2cc3cd1b8cdbae5e", "score": "0.49641794", "text": "function Offer()\n{\n this.apiEndpoint = '/offers';\n}", "title": "" }, { "docid": "408e0360cd6dcbc5017bbe4271c6d13f", "score": "0.4928076", "text": "constructor() {\n super();\n this.__listeners = new Set();\n this.__instanceId = instanceId++;\n\n this.register = this.register.bind(this);\n }", "title": "" }, { "docid": "9feb9a2040929cb15137262dfa3b7ada", "score": "0.49206886", "text": "constructor() {\n super(...arguments);\n\n const owner = getOwner(this);\n\n owner.registerOptionsForType('ember-metrics@metrics-adapter', {\n instantiate: false,\n });\n owner.registerOptionsForType('metrics-adapter', { instantiate: false });\n\n const config = owner.factoryFor('config:environment').class;\n const { metricsAdapters = [] } = config;\n const { environment = 'development' } = config;\n\n this._options = { metricsAdapters, environment };\n this.appEnvironment = environment;\n this.activateAdapters(metricsAdapters);\n }", "title": "" }, { "docid": "e505a897578eb2fae99b91ebb1447ed2", "score": "0.4918571", "text": "constructor(ESPM20Contract) {\n this.instance = ESPM20Contract;\n this.bindAllMethods();\n }", "title": "" }, { "docid": "dc39f80ea73d1ed04586ad65a42bd3ba", "score": "0.49058026", "text": "constructor(startPoint, endPoint) {\n \n this.startPoint = new Point(startPoint.x, startPoint.y)\n this.endPoint = new Point(endPoint.x, endPoint.y);\n }", "title": "" }, { "docid": "6451acc7ac7f2f00ffe4595eaa8382b0", "score": "0.49032554", "text": "constructor(config) {\n if (! self) {\n self = this;\n } else {\n throw new Error(`Only one chain instance allowed`);\n }\n\n self.config = config;\n self.wsProvider = new WsProvider(`${config.chain.protocol}://${config.chain.provider}:${config.chain.port}`);\n self.keyring = new Keyring({ type: 'sr25519' });\n\n self.unsubscribeEventListener = null;\n }", "title": "" }, { "docid": "adfb3074b8722a8ea429f7777f384079", "score": "0.4899351", "text": "function ServiceEndpoint(sock, dir, opts) { // true = server->client, false = client->server\r\n\tvar self = this;\r\n\tthis.endpointSocket = sock;\r\n\tthis.endpointSocket.setNoDelay(true);\r\n\tthis.address = sock.remoteAddress+':'+sock.remotePort;\r\n\r\n\tthis.dir = dir;\r\n\r\n\tthis._serviceInfo = {};\r\n\tthis._messageRegistry = {};\r\n\r\n\t// Endpoint id calculated during announcement with service GUID and endpoint name\r\n\t// Important: Endpoint name need to be unique in the endpoints namespace of the service\r\n\tthis.id;\r\n\tthis.longId;\r\n\r\n\tif(opts) {\r\n\t\tif(opts.name) {\r\n\t\t\tthis._serviceInfo.name = opts.name; \r\n\t\t}\r\n\t\tif(opts.guid) {\r\n\t\t\tthis._serviceInfo.guid = opts.guid;\r\n\t\t}\r\n\t\tif(this._serviceInfo.name && this._serviceInfo.guid) {\r\n\t\t\tthis.longId = aguid(this.getGuid()+this.getName());\r\n\t\t\tthis.id = this.longId.split('-')[0];\r\n\t\t}\r\n\t}\r\n\r\n\tthis.pendingSyncResponses = {}; // FIFO buffer for pending requests\r\n\tthis.pendingSyncTimeout = 8000; // Resolve after that time if no response from service\r\n\r\n\tthis.packetRef = 0;\r\n\r\n\t// Setup the bi-directional pipe between the endpoint and socket\r\n\tvar streams = [ this, this.endpointSocket, this ],\r\n\t\tcurrent = streams.shift(),\r\n\t\tnext;\r\n\twhile(next = streams.shift()) {\r\n\t\tcurrent.pipe(next /*, { end : false } */)\r\n\t\t\t// Attach listeners to all streams\r\n\t\t\t.on('error', this._handleError.bind(this))\r\n\t\t\t.on('close', this._handleClose.bind(this))\r\n\t\t\t// For custom stream classes method end() need to be implemented\r\n\t\t\t// or 'end' opts setting to false otherwise will be exception\r\n\t\t\t// when pipe deleted, eg. client disconnect\r\n\t\t\t.on('end', function() {\r\n\t\t\t\tdebug('No more data will be provided');\r\n\t\t\t})\r\n\t\t\t.on('finish', function() {\r\n\t\t\t\tdebug('All data has been flushed to the underlying system');\r\n\t\t\t});\r\n\t\tcurrent = next;\r\n\t}\r\n\r\n\t// Handlers name only for async methods\r\n\tthis.on('SERVICE_ANNCE', this._serviceAnnouncement.bind(this));\r\n\tthis.on('MESSAGE_REGISTER', this._messageRegister.bind(this));\r\n\tthis.on('MESSAGE_UNREGISTER', this._messageUnregister.bind(this));\r\n}", "title": "" }, { "docid": "54e966942a2c3103e10241721d1daa33", "score": "0.48865354", "text": "constructor(endpoint) {\n log.debug(`Constructing new TableController with endpoints: ${endpoint}`);\n\n this.stateCounter = Stream(0);\n this.endpoint = endpoint;\n // keep track of the total number of pages\n this.totalPages = null;\n this.selected = [];\n this.query = { sort: 'default', search: '' };\n }", "title": "" }, { "docid": "2dc384b8240efce96465e8542d292c2e", "score": "0.4881174", "text": "constructor(endpoint, config, logOriginalMessage = false, logUserName = false) {\n this.qnaMaker = new MyAppInsightsQnAMaker(endpoint, config, logOriginalMessage, logUserName);\n }", "title": "" }, { "docid": "0ee7bdbc1ebca85a4234b72f8767a064", "score": "0.488078", "text": "constructor() {\n\t\t//\tCreate a request representation to DataCache map.\n\t\tthis.dataCaches = {};\n\t\tthis.log = new Logger('data');\n\n\t\tDataManager.instance = this;\n\t}", "title": "" }, { "docid": "b7931adec3b129861510718516be9afb", "score": "0.48719412", "text": "static initialize(obj, name, endpoint, provider, active, container, status) { \n obj['name'] = name;\n obj['endpoint'] = endpoint;\n obj['provider'] = provider;\n obj['active'] = active;\n obj['container'] = container;\n obj['status'] = status;\n }", "title": "" }, { "docid": "2a79ccff66fb7993a816a8fe19eb3900", "score": "0.48706564", "text": "constructor() { \n \n ServiceInstanceResult.initialize(this);\n }", "title": "" }, { "docid": "81a7550471d86154384b4fa41d72e049", "score": "0.48623005", "text": "constructor(pluginService, pathToConfigJsonOrPlainObject, envPrefix) {\n const me = this;\n\n me.pluginService = pluginService;\n me.config = configurator(pathToConfigJsonOrPlainObject, envPrefix, true);\n me._checkConfiguration();\n\n me.proxyClient = new ProxyClient(me.config.DEVICE_HIVE_PLUGIN_WS_ENDPOINT);\n }", "title": "" }, { "docid": "a67abcc35f5829f52ab938338359c872", "score": "0.4857628", "text": "constructor() {\n /* ENROUTADOR */\n this.router = express_1.Router();\n this.config();\n }", "title": "" }, { "docid": "a9cb5e6781a94f5b57b2b787db8135f3", "score": "0.4854544", "text": "constructor() { \n \n EmailInfo.initialize(this);\n }", "title": "" }, { "docid": "3f56f6680af5a8ec41040117db3cc3f2", "score": "0.48524293", "text": "constructor(config, socketFactory) {\n this.config = config;\n this.socketFactory = socketFactory;\n }", "title": "" }, { "docid": "0e081fb0c58923a69d429fd681e22991", "score": "0.48509735", "text": "constructor() {\n super(SERVICE_ID);\n\n this._cache = {};\n this._clientItemsMap = {};\n }", "title": "" }, { "docid": "7d1986459c31ed50c00ce05318866ca3", "score": "0.48508775", "text": "constructor() {\n super();\n this._init();\n }", "title": "" }, { "docid": "3f852e29ed83284122c670ef2c3e334d", "score": "0.4848987", "text": "constructor() {\n\t\t}", "title": "" }, { "docid": "d636f80c16f8202ce8ba85e422f50432", "score": "0.48470226", "text": "constructor() {\n if (!this.provider) {\n // Create a provider if one does not exist yet.\n this.provider = new Web3.providers.HttpProvider('http://'+ BlockchainProviderAddress +':8545');\n }\n if (!this.web3) {\n // Create web3 instance if one does not exist yet.\n this.web3 = new Web3(this.provider);\n }\n }", "title": "" }, { "docid": "9633e154ed3fccc3bf5ce302843910d6", "score": "0.48438516", "text": "constructor() {\n this.initServer();\n }", "title": "" }, { "docid": "69b9d1e52062396bb5ff4a3ff31408cc", "score": "0.4829149", "text": "constructor() {\r\n super();\r\n let self = this;\r\n let config = configService.config;\r\n self._pool = mysql.createPool(config.mysql.connectionOptions);\r\n }", "title": "" }, { "docid": "8ea83b01d3380e4a583c58b0b75e353e", "score": "0.48239383", "text": "constructor() {\n super(SERVICE_ID);\n\n const defaults = {\n configItem: 'password'\n };\n\n this.configure(defaults);\n\n /**\n * @private\n * @type {String|Object}\n */\n this._password = null;\n this._sharedConfig = this.require('shared-config');\n }", "title": "" }, { "docid": "6642b14bcccbe0a862c42a7acd9226bd", "score": "0.4814172", "text": "function EventBus() {\r\n this.config = new DataMap();\r\n}", "title": "" }, { "docid": "6cfaf103ada66a180758aa75a29434aa", "score": "0.48072112", "text": "constructor() {\n super();\n this.registerAsType(DefaultDiscoveryFactory.MemoryDiscoveryDescriptor, MemoryDiscovery_1.MemoryDiscovery);\n }", "title": "" }, { "docid": "1569ba00d4e1a0b8003eeb4f9abd3e77", "score": "0.47977692", "text": "constructor (ethereumMgr) {\n this.ethereumMgr = ethereumMgr\n }", "title": "" }, { "docid": "fbc39d78b054bfb52b9f2943f3b14f2c", "score": "0.47827226", "text": "_createEventManager() {\n /**\n * @private\n * @readonly\n * @type {DKTools.EventManager}\n */\n this._eventManager = new DKTools.EventManager(this);\n }", "title": "" }, { "docid": "db5ac920b339897edac37e5cf00ba2bd", "score": "0.47641858", "text": "initHttpClient() {\n this.httpClient = new HttpClient(this.config.endpoint);\n }", "title": "" }, { "docid": "92f94067a8b5d7dab0a2b76939a28ff1", "score": "0.47635376", "text": "function EmailService(config) {\n if (!(this instanceof EmailService)) return new EmailService(config);\n this.config = config;\n this.mailer = _nodemailer2.default.createTransport((0, _nodemailerSesTransport2.default)({\n accessKeyId: config.accessKeyId,\n secretAccessKey: config.secretAccessKey\n }));\n}", "title": "" }, { "docid": "a52d2b321dd59155052bf6853344f307", "score": "0.47621095", "text": "constructor(config) {\n super();\n const opts = {\n name: config.appName,\n network: getNetwork(config.networkId),\n };\n this._latticeConnectClient = new config.latticeConnectClient(opts);\n }", "title": "" }, { "docid": "c1b633306f79ea0cc8abb538c47dddf5", "score": "0.47594565", "text": "constructor() { \n \n CreateComputeResponseProtocol.initialize(this);\n }", "title": "" }, { "docid": "0bb29602f1354fd8f244fef8a1fa4ee2", "score": "0.4752214", "text": "constructor(){\r\n TaskManager.instance = this;\r\n }", "title": "" }, { "docid": "294d340024d9014741b23af0cfb318cd", "score": "0.47479472", "text": "constructor(scope, id, props) {\n super(scope, id, { type: CfnClientVpnEndpoint.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_ec2_CfnClientVpnEndpointProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnClientVpnEndpoint);\n }\n throw error;\n }\n cdk.requireProperty(props, 'authenticationOptions', this);\n cdk.requireProperty(props, 'clientCidrBlock', this);\n cdk.requireProperty(props, 'connectionLogOptions', this);\n cdk.requireProperty(props, 'serverCertificateArn', this);\n this.authenticationOptions = props.authenticationOptions;\n this.clientCidrBlock = props.clientCidrBlock;\n this.connectionLogOptions = props.connectionLogOptions;\n this.serverCertificateArn = props.serverCertificateArn;\n this.clientConnectOptions = props.clientConnectOptions;\n this.clientLoginBannerOptions = props.clientLoginBannerOptions;\n this.description = props.description;\n this.dnsServers = props.dnsServers;\n this.securityGroupIds = props.securityGroupIds;\n this.selfServicePortal = props.selfServicePortal;\n this.sessionTimeoutHours = props.sessionTimeoutHours;\n this.splitTunnel = props.splitTunnel;\n this.tagSpecifications = props.tagSpecifications;\n this.transportProtocol = props.transportProtocol;\n this.vpcId = props.vpcId;\n this.vpnPort = props.vpnPort;\n }", "title": "" }, { "docid": "b79bf5427702d47217a1c9faf5d70a04", "score": "0.47442594", "text": "constructor(host) {\n this.host = host;\n }", "title": "" }, { "docid": "b79bf5427702d47217a1c9faf5d70a04", "score": "0.47442594", "text": "constructor(host) {\n this.host = host;\n }", "title": "" }, { "docid": "cf0301dacea556d82d7c46cfc6c372f4", "score": "0.4743263", "text": "function ApplicationManager() {\n /**@member {object} applicationManagerInstance Contains instance of application manager*/\n /**@member {object} HashTable Contains instance of Hashtable*/\n /**@member {object} serviceResponseHandler Contains instance of serviceResponseHandler*/\n this.applicationManagerInstance = null;\n this.applicationMode = null;\n this.HashTable = null;\n this.actionSheetObject = null;\n this.serviceResponseHandler = null;\n /** numberOfAsyncForPreAppInit\n * 1.getApplicationProperties\n * 2.getProducts\n */\n this.numberOfAsyncForPreAppInit = 3;\n }", "title": "" }, { "docid": "b1d4854b95139ec9c2731be829bdc328", "score": "0.47366065", "text": "constructor(router, advertisementService) {\n this.router = router;\n this.advertisementService = advertisementService;\n }", "title": "" }, { "docid": "4b031a402cce452e1d5d1999fafb9ef1", "score": "0.4734404", "text": "function Backend(router, requestManager) {\n this.router = router;\n this.requestManager = requestManager || new Backend_1.RequestManager();\n }", "title": "" }, { "docid": "1af0e12fe4922ac31c34046e4481e27f", "score": "0.473286", "text": "constructor() {\n super();\n\n /**\n * Meshes are reference counted, and this class owns the references and is responsible for\n * releasing the meshes when they are no longer referenced.\n *\n * @type {import('./mesh.js').Mesh[]}\n * @private\n */\n this._meshes = null;\n }", "title": "" }, { "docid": "24cb28eb04bd3351694db1f8142952f6", "score": "0.47301802", "text": "constructor(config) {\n super(config);\n }", "title": "" }, { "docid": "8b7944f93e202fee371af596dd65286a", "score": "0.47154483", "text": "constructor(configurationService) {\n super(configurationService);\n this.configurationService = configurationService;\n }", "title": "" }, { "docid": "e16fae45cb1338b9725b58bc3f4b3796", "score": "0.47135693", "text": "constructor() {\n this._onProxyConnected = null;\n this._onProxyClosed = null;\n this._onServiceStarted = null;\n this._onServiceEnded = null;\n this._onError = null;\n }", "title": "" }, { "docid": "29472cc6bba526a41c53dc0932a97be9", "score": "0.47132292", "text": "constructor() {\n\n\t\t/**\n\t\t * Current event emitter.\n\t\t * @type {EventEmitter}\n\t\t * @private\n\t\t */\n\t\tthis._emitter = new events.EventEmitter();\n\t\tthis._emitter.setMaxListeners(0);\n\n\t\t/**\n\t\t * Current set of named methods to invoke.\n\t\t * @type {Object}\n\t\t * @private\n\t\t */\n\t\tthis._toInvoke = Object.create(null);\n\n\t\t/**\n\t\t * Current set of flags if the method is in progress.\n\t\t * @type {Object}\n\t\t * @private\n\t\t */\n\t\tthis._inProgress = Object.create(null);\n\t}", "title": "" }, { "docid": "94d7f3ef4c15e8a4ce5b6bffe89c9290", "score": "0.47009864", "text": "constructor(baseUrl) {\n super(EtherscanPluginId);\n defineProperties(this, { baseUrl });\n }", "title": "" }, { "docid": "f79020975126b0965061080919bb3153", "score": "0.4697979", "text": "constructor() { \n \n KMIPClientsConfigPart.initialize(this);\n }", "title": "" }, { "docid": "af5ca04aa552e21d9defb00f905fd551", "score": "0.46972814", "text": "constructor() { \n \n ClientList.initialize(this);\n }", "title": "" }, { "docid": "44cd8648a45e905cf11224a1980dd875", "score": "0.46969342", "text": "constructor(config) {\n if (!config) throw new Error('Missing config options');\n this.config = config;\n }", "title": "" }, { "docid": "7942bb8588a59bf7977ae66ecfd0a442", "score": "0.4695424", "text": "constructor(config) {\r\n super(config);\r\n }", "title": "" }, { "docid": "3f58b3fd8f3c4adc10d3af7656b752ef", "score": "0.4691517", "text": "constructor(context, entityPath, options) {\n super(`${entityPath}/$management`, entityPath, context, \"mgmt\", managementClientLogger, {\n address: options && options.address ? options.address : Constants.management,\n audience: options && options.audience\n ? options.audience\n : `${context.config.endpoint}${entityPath}/$management`\n });\n /**\n * The reply to Guid for the management client.\n */\n this.replyTo = generate_uuid();\n /**\n * Provides the sequence number of the last peeked message.\n */\n this._lastPeekedSequenceNumber = Long.ZERO;\n this._context = context;\n }", "title": "" }, { "docid": "21db253742ca863b6e50dabaad8f06ae", "score": "0.4688968", "text": "constructor() {\n super(SERVICE_ID, true);\n\n this._onError = this._onError.bind(this);\n }", "title": "" }, { "docid": "34756a39f585fb7f0636bc1a8eabf528", "score": "0.46816325", "text": "constructor() {\n this._setup(); // DO NOT REMOVE\n }", "title": "" }, { "docid": "071a60400477acfccc5e309be4a363ca", "score": "0.46806914", "text": "constructor() {\n // Run super\n super();\n\n // Bind private methods\n this._middleware = this._middleware.bind(this);\n\n // Run middleware\n this.eden.router.use(this._middleware);\n }", "title": "" }, { "docid": "1fc5df0b6bce6b7d2486c777acc1d015", "score": "0.4679289", "text": "constructor(config) {\n if (tea_util_1.default.isUnset($tea.toMap(config))) {\n throw $tea.newError({\n code: \"ParameterMissing\",\n message: \"'config' can not be unset\",\n });\n }\n this._accessKeyId = config.accessKeyId;\n this._accessKeySecret = config.accessKeySecret;\n this._securityToken = config.securityToken;\n this._endpoint = config.endpoint;\n this._protocol = config.protocol;\n this._userAgent = config.userAgent;\n this._readTimeout = tea_util_1.default.defaultNumber(config.readTimeout, 20000);\n this._connectTimeout = tea_util_1.default.defaultNumber(config.connectTimeout, 20000);\n this._httpProxy = config.httpProxy;\n this._httpsProxy = config.httpsProxy;\n this._noProxy = config.noProxy;\n this._socks5Proxy = config.socks5Proxy;\n this._socks5NetWork = config.socks5NetWork;\n this._maxIdleConns = tea_util_1.default.defaultNumber(config.maxIdleConns, 60000);\n this._maxIdleTimeMillis = tea_util_1.default.defaultNumber(config.maxIdleTimeMillis, 5);\n this._keepAliveDurationMillis = tea_util_1.default.defaultNumber(config.keepAliveDurationMillis, 5000);\n this._maxRequests = tea_util_1.default.defaultNumber(config.maxRequests, 100);\n this._maxRequestsPerHost = tea_util_1.default.defaultNumber(config.maxRequestsPerHost, 100);\n }", "title": "" }, { "docid": "4c3d4f698c1778bdf86ba6e30e120f95", "score": "0.46782345", "text": "function HTTPRequestManager () {\r\n\tthis.requestList = new Array();\r\n\tthis.index = 0;\r\n}", "title": "" }, { "docid": "86b6cbc52744ab08ff723ea29ba95548", "score": "0.4678092", "text": "constructor() {\n // create reusable transporter object using the default SMTP transport\n this.config = Config.get('email');\n this.baseUrl = Config.get('general.domain');\n this.transporter = Nodemailer.createTransport(this.config.options);\n this.templates = {};\n //\n }", "title": "" }, { "docid": "2bcc7093f09592fb534bafa69244799f", "score": "0.4675973", "text": "constructor(settings) {\n let httpsAgent = null;\n if (settings.tlsVerify) {\n try {\n httpsAgent = new https_1.default.Agent({\n ca: fs_1.default.readFileSync(settings.tlsVerify.tlsCaCertPath),\n cert: fs_1.default.readFileSync(settings.tlsVerify.tlsCertPath),\n key: fs_1.default.readFileSync(settings.tlsVerify.tlsKeyPath),\n });\n }\n catch (error) {\n if (error.code === 'ENOENT') {\n console.error('Cert files not found!');\n }\n else {\n console.error(error);\n }\n }\n }\n this.apiInstance = axios_1.default.create({\n baseURL: settings.baseURL,\n timeout: 1000,\n httpsAgent: httpsAgent,\n });\n }", "title": "" }, { "docid": "2761fef93e897779e1df3f9e5b974ed8", "score": "0.46727523", "text": "constructor() {\n this.docClient = new aws.DynamoDB.DocumentClient(config);\n }", "title": "" }, { "docid": "8f7829bcd12ca79d70cc6301397c9e7f", "score": "0.46707168", "text": "function Manager() {\n\tthis.serverMap = new Map();\n\tthis.serviceMap = new Map();\n\tthis.user = \"\";\n\tthis.curSvc;\n\tthis.readyFinish = false;\n}", "title": "" }, { "docid": "d9bcd6ef1d3abaf8e4e6bdd2118d3e61", "score": "0.46700838", "text": "function ApConnection(endpoint, $http, cookies, $rootScope) {\n // normalise to end with a '/'\n this.endpoint = endpoint.replace(/\\/?$/, '/');\n this.$http = $http;\n this.ticket = false;\n this.cookies = cookies;\n this.$rootScope = $rootScope;\n }", "title": "" }, { "docid": "a603f7e7965cd4f52ef51eed16fef981", "score": "0.4667064", "text": "initClient() {\r\n\r\n this.fabClient = new FabClient();\r\n\r\n // We assume we will work over one channel only.\r\n this.channel = this.fabClient.newChannel(this.channelName);\r\n\r\n // And we will connect to a single peer instance.\r\n this.peer = this.fabClient.newPeer(\r\n creds.peers[this.peerName].url, \r\n { pem: creds.peers[this.peerName].tlsCACerts.pem, \r\n 'ssl-target-name-override': null });\r\n this.channel.addPeer(this.peer);\r\n this.order = this.fabClient.newOrderer(\r\n creds.orderers.orderer.url, \r\n { pem: creds.orderers.orderer.tlsCACerts.pem, \r\n 'ssl-target-name-override': null });\r\n this.channel.addOrderer(this.order);\r\n\r\n logger.debug('Fabric client initialized...')\r\n }", "title": "" }, { "docid": "3021e203f44736da6882f57ac4ee32af", "score": "0.46636018", "text": "constructor() { \n \n Configure.initialize(this);\n }", "title": "" }, { "docid": "7344c8cf701d2d80fef099a2302099bd", "score": "0.46611327", "text": "setRoutes()\n {\n new AllEndpointsService(this.Router);\n }", "title": "" } ]
42aadeb74a3666f001dac5acb58bc23a
Returns library node that definition of the current node is located in, or null if current node is not defined in a library.
[ { "docid": "432486a2482c4bece4790587da7a22ed", "score": "0.7105965", "text": "function getLibraryDefiningNode(nodeToCheck) {\n if (!nodeToCheck.lowLevel) {\n return null;\n }\n var lowLevelNode = nodeToCheck.lowLevel();\n if (!lowLevelNode) {\n return null;\n }\n if (lowLevelNode.key()) {\n var offset = Math.floor((lowLevelNode.keyEnd() + lowLevelNode.keyStart()) / 2);\n var result = getLibraryDefiningNodeByOffset(lowLevelNode.unit(), offset);\n if (result)\n return result;\n }\n if (lowLevelNode.value()) {\n var offset = Math.floor((lowLevelNode.valueEnd() + lowLevelNode.valueStart()) / 2);\n var result = getLibraryDefiningNodeByOffset(lowLevelNode.unit(), offset);\n if (result)\n return result;\n }\n return null;\n}", "title": "" } ]
[ { "docid": "e2335d8bd5347408cfbc8c23689fa7f5", "score": "0.55850583", "text": "function getOwnDefinition(type, def) {\n return def && def.token === type ? def : null;\n }", "title": "" }, { "docid": "b03ec251f3d563c208b25a5bb6b2d932", "score": "0.5558158", "text": "function getOwnDefinition(type, def) {\n return def && def.token === type ? def : null;\n }", "title": "" }, { "docid": "25ad90089f428cd59246ea9008c3de00", "score": "0.5418939", "text": "function getOwnDefinition(type, def) {\n return def && def.token === type ? def : null;\n}", "title": "" }, { "docid": "0d977834c8b6382a94353f2d605c8bda", "score": "0.5324111", "text": "get currentLanguage() {\n\t\tvar node = this.getNode();\n\t\tnode = node? node.parentNode : this.code;\n\t\tvar lang = PL.match(node.closest('[class*=\"language-\"]').className, /language-(\\w+)/, 1);\n\t\treturn PL.aliases[lang] || lang;\n\t}", "title": "" }, { "docid": "2db6f3fc3fc87ebc1ca428b010207529", "score": "0.51783437", "text": "function isLibrary(node) {\n return node.kind() == \"Library\" && node.RAMLVersion() == \"RAML10\";\n}", "title": "" }, { "docid": "2729ac14d27048efbe5a17115594632a", "score": "0.49813884", "text": "get(name) {\n const ref = this.refs[name] && this.refs[name].node\n return ref || null\n }", "title": "" }, { "docid": "80cf3bab647a8e62016dd0aec38d8698", "score": "0.49790606", "text": "get top(): ?NavigationContext {\n var result = null;\n var parentNode = this.__node.getParent();\n while (parentNode) {\n result = parentNode.getValue();\n parentNode = parentNode.getParent();\n }\n return result;\n }", "title": "" }, { "docid": "1216c2f43a30cea8c88d27b530bb11dd", "score": "0.4955159", "text": "root() {\n var node;\n node = this;\n while (node) {\n if (node.type === NodeType.Document) {\n return node.rootObject;\n } else if (node.isRoot) {\n return node;\n } else {\n node = node.parent;\n }\n }\n }", "title": "" }, { "docid": "b1a678b2c970620c4c6f42c1c7304d60", "score": "0.49527177", "text": "function getJSDocHost(node) {\n var jsDoc = getJSDocRoot(node);\n if (!jsDoc) {\n return undefined;\n }\n var host = jsDoc.parent;\n if (host && host.jsDoc && jsDoc === ts.lastOrUndefined(host.jsDoc)) {\n return host;\n }\n }", "title": "" }, { "docid": "80fc866088ac0f4f9186456a93779ba0", "score": "0.49389037", "text": "function isLibraryBase(node) {\n return node.kind() == \"LibraryBase\" && node.RAMLVersion() == \"RAML10\";\n}", "title": "" }, { "docid": "f2424f570c5952611a3ea7660bbfeb9e", "score": "0.49271044", "text": "function findCurrentNode() {\n\tgCurrentNodeData = null;\n\tfindCurrentNodeRecursive(gActionTreeData);\n\treturn gCurrentNodeData;\n}", "title": "" }, { "docid": "5b3c33899c076c354fcf72cd786cb965", "score": "0.49270806", "text": "function GetNodeReferenceOrPrototypeParent(nodeReference){\r\n\tvar node;\r\n\tif (GetSFNode(nodeReference))\r\n\t\tnode = GetSFNode(nodeReference);\r\n\telse\r\n\t\tnode = eonthis.GetParentNode().GetParentNode().GetParentNode();\r\n\treturn node;\t\t\r\n}", "title": "" }, { "docid": "6c9d21e907f02f9f285b6ea0f3789601", "score": "0.48591277", "text": "function glkote_get_library(val) {\n switch (val) {\n case 'Dialog': return Dialog;\n case 'Blorb': return Blorb;\n }\n /* Unrecognized library name. */\n return null;\n}", "title": "" }, { "docid": "0fe83ae221c77714a54e99f9c7aead73", "score": "0.48557478", "text": "function getLibraryForType(type) {\n if (type) {\n for (var name in libraries) {\n\t if (libraries.hasOwnProperty(name)) {\n\t var lib = libraries[name];\n\t if (lib.$wm && lib.$wm.$providedTypes[type]) {\n\t return lib;\n\t }\n\t }\n }\n }\n return null;\n }", "title": "" }, { "docid": "e791fec365b1d06b92b0b975ad3f6d97", "score": "0.48500493", "text": "_getBase() {\n return 'library';\n }", "title": "" }, { "docid": "6bb13b479de3d5e9b736165598df10a5", "score": "0.48449197", "text": "getNativeNode() {}", "title": "" }, { "docid": "2b212f05c2919740d1b937fbbf26a4d0", "score": "0.48401883", "text": "function getSelectedNode() {\n var nativeRange = quill.selection.getNativeRange();\n \n if (!nativeRange || isEmpty(nativeRange)) { return null; }\n \n if (!nativeRange.native || isEmpty(nativeRange.native)) { return null; }\n\n return nativeRange.native.commonAncestorContainer;\n}", "title": "" }, { "docid": "0a0760229032f413b80837b684336f18", "score": "0.48311117", "text": "function getDeclarationTNode(lView) {\n var tView = lView[TVIEW]; // Return the declaration parent for embedded views\n\n if (tView.type === 2\n /* Embedded */\n ) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n } // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n // Falling back to `T_HOST` in case we cross component boundary.\n\n\n if (tView.type === 1\n /* Component */\n ) {\n return lView[T_HOST];\n } // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.\n\n\n return null;\n }", "title": "" }, { "docid": "54bb3b89a9becd3d90894303c847e363", "score": "0.48305404", "text": "get library () {\n\t\treturn this._library;\n\t}", "title": "" }, { "docid": "9fc04c5205b81ab96245eb2b1e2ce751", "score": "0.47886425", "text": "get topNode() {\n return new TreeNode(this, 0, 0, null);\n }", "title": "" }, { "docid": "bdae4456167a5923e0771373da634d98", "score": "0.478439", "text": "function getDeclarationTNode(lView) {\n const tView = lView[TVIEW];\n // Return the declaration parent for embedded views\n if (tView.type === 2 /* Embedded */) {\n ngDevMode && assertDefined(tView.declTNode, 'Embedded TNodes should have declaration parents.');\n return tView.declTNode;\n }\n // Components don't have `TView.declTNode` because each instance of component could be\n // inserted in different location, hence `TView.declTNode` is meaningless.\n // Falling back to `T_HOST` in case we cross component boundary.\n if (tView.type === 1 /* Component */) {\n return lView[T_HOST];\n }\n // Remaining TNode type is `TViewType.Root` which doesn't have a parent TNode.\n return null;\n}", "title": "" }, { "docid": "f58ec9543d3164a09c7a022b8fb2b1a7", "score": "0.476657", "text": "get domNode() {\r\n\t\tif (this.isMounted && isAshNodeAshElement(this.__element.children[0]) && this.__element.stream.__listeners[0] && this.__element.stream.__listeners[0].getRootNode) {\r\n\t\t\tlet rootNode = this.__element.stream.__listeners[0].getRootNode();\r\n\r\n\t\t\tif (rootNode) {\r\n\t\t\t\treturn findNode(rootNode, this.__element.children[0].instance.id, this.__element.children[0].instance.indices);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "title": "" }, { "docid": "0bd1b3eef0b5b9e3cc8b629b48cc58fa", "score": "0.47553247", "text": "function globalResolve(moduleId) {\n\t\tif (moduleId in global) {\n\t\t\treturn global[moduleId];\n\t\t}\n\n\t\t// We'll try walking the object tree too. This supports libraries that use objects for\n\t\t// namespacing.\n\t\tvar result = global;\n\t\tvar scopes = moduleId.split(\"/\");\n\t\tfor (var i = 0, length = scopes.length; i < length; ++i) {\n\t\t\tvar scope = scopes[i];\n\t\t\tif (scope in result) {\n\t\t\t\tresult = result[scope];\n\t\t\t} else {\n\t\t\t\tresult = NOT_FOUND;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (result !== NOT_FOUND) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new Error(\"No definition for module \" + moduleId + \" could be found in the global top level.\");\n\t}", "title": "" }, { "docid": "cc80eda07657c4e8de761bbdc05eb5fe", "score": "0.47401023", "text": "function getUpperFunction(node) {\n let currentNode = node;\n while (currentNode) {\n if (utils_1.ASTUtils.isFunction(currentNode)) {\n return currentNode;\n }\n currentNode = currentNode.parent;\n }\n return null;\n }", "title": "" }, { "docid": "fc3c98e024f9e7de006b7708ca5baad7", "score": "0.47339186", "text": "function NodeDef() {}", "title": "" }, { "docid": "ed2fd8ef90cad7bb7215834ff35522e3", "score": "0.47333032", "text": "function getIncludeTarget(l) {\n const line = l.trim('');\n // try to handle commented includes... not bulletproof\n if (line.startsWith('//') || line.startsWith('/*')) return null;\n\n const pattern = /^#include\\s*[\"<]([^\">]+)/;\n const match = pattern.exec(line);\n return match && match[1];\n }", "title": "" }, { "docid": "8cfaece6c484726c90206e93f8c14c45", "score": "0.4727937", "text": "find(val) {\n if (!this.root) return undefined;\n let currentNode = this.root;\n while (currentNode) {\n if (currentNode.val === val) return currentNode;\n currentNode =\n val > currentNode.val ? currentNode.right : currentNode.left;\n }\n return undefined;\n }", "title": "" }, { "docid": "9add604d740e96cd52d3fb0e43659149", "score": "0.4716362", "text": "function $x1(p, context, docObj) {\r\n\tvar nodeArray = $x(p, context, docObj);\r\n\tif (nodeArray.length > 0) return nodeArray[0];\r\n\treturn null;\r\n}", "title": "" }, { "docid": "c6b22e0abe9b223e54f44d43adb254c9", "score": "0.46845007", "text": "topBlockAt(point) {\n const top = this.topNodeAt(point);\n return top ? this.layout.elementFromNode(top) : null;\n }", "title": "" }, { "docid": "2a3dd600ef8b67c36827a2ddd5dbfed7", "score": "0.4681337", "text": "getRoot() {\n return this.structure.root;\n }", "title": "" }, { "docid": "43490cd51735664540d76687d69559d6", "score": "0.4660178", "text": "get node(){\n if(!this._node){\n this._setUpNode();\n }\n return this._node;\n }", "title": "" }, { "docid": "252f206f36b6a02dcc052ea9b3dc9388", "score": "0.46477962", "text": "function getLibrary(libraryName, next) {\n if (libraryName === '') return next();\n getRegistry(function (error, libraries) {\n if (error) return next(error);\n if (collection[libraryName]) return next(); // Already have this.\n\n var library = libraries[libraryName];\n if (!library) return next('No such library.');\n\n collection[libraryName] = library;\n\n if (library.dependencies) {\n // Find dependencies\n var errors = '';\n var loaded = 0;\n\n for (var i = 0; i < library.dependencies.length; i++) {\n dependency = library.dependencies[i];\n getLibrary(dependency, function (error) {\n if (error) errors += '\\n' + dependency + ': ' + error;\n loaded++;\n\n if (loaded === library.dependencies.length) {\n next(errors === '' ? null : errors);\n }\n });\n }\n }\n else {\n next();\n }\n });\n}", "title": "" }, { "docid": "39c5d12524679cbcd86c823bc970b7c3", "score": "0.4634466", "text": "function getNodeAtPosition(sourceFile, position) {\n var current = sourceFile;\n var getContainingChild = function (child) {\n if (child.pos <= position && (position < child.end || (position === child.end && (child.kind === 1 /* EndOfFileToken */)))) {\n return child;\n }\n };\n while (true) {\n var child = isJavaScriptFile && ts.hasJSDocNodes(current) && ts.forEach(current.jsDoc, getContainingChild) || ts.forEachChild(current, getContainingChild);\n if (!child) {\n return current;\n }\n current = child;\n }\n }", "title": "" }, { "docid": "19739e52b725c120b2cd9428c0346036", "score": "0.46315432", "text": "function getScopeNode(initialToken,position,sourceFile){var scope=initialToken;while(scope&&!ts.positionBelongsToNode(scope,position,sourceFile)){scope=scope.parent;}return scope;}", "title": "" }, { "docid": "b2019b3b9ae598aa278c46e8af36a165", "score": "0.46305624", "text": "function getReferencedImportDeclaration(nodeIn) {\n if (nodeIn.generatedImportReference) {\n return nodeIn.generatedImportReference;\n }\n var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);\n if (node) {\n var symbol = getReferencedValueSymbol(node);\n // We should only get the declaration of an alias if there isn't a local value\n // declaration for the symbol\n if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* Value */) && !getTypeOnlyAliasDeclaration(symbol)) {\n return getDeclarationOfAliasSymbol(symbol);\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "5c0d128df777c87008b2040171f87377", "score": "0.46276048", "text": "function getTopParentElement(node) {\n let parentNode = node;\n while (parentNode.parentNode) {\n switch (parentNode.nodeName) {\n case 'A':\n case 'DIV':\n parentNode = parentNode.parentNode;\n continue;\n case 'ARTICLE':\n case 'LI':\n return parentNode;\n default:\n return null;\n }\n }\n}", "title": "" }, { "docid": "e88492b5b377d686879bed7b8ba9cadb", "score": "0.46269748", "text": "get node() {\n return this.__node.get();\n }", "title": "" }, { "docid": "4905956a603d756d675106ba8a5b4e0c", "score": "0.46258348", "text": "_getNodeDef(data, i) {\n if (this._nodeDefs.length === 1) {\n return this._nodeDefs.first;\n }\n const nodeDef = this._nodeDefs.find(def => def.when && def.when(i, data)) || this._defaultNodeDef;\n if (!nodeDef && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw getTreeMissingMatchingNodeDefError();\n }\n return nodeDef;\n }", "title": "" }, { "docid": "e2b348b0265611693babda31c5a220c6", "score": "0.46237704", "text": "function NodeDef() { }", "title": "" }, { "docid": "e2b348b0265611693babda31c5a220c6", "score": "0.46237704", "text": "function NodeDef() { }", "title": "" }, { "docid": "4b4c17491a0ba5f4e0e44aaf5e2964cc", "score": "0.4622374", "text": "static getNode() {\n\n return database.ref(nodeName);\n\n }", "title": "" }, { "docid": "15494ddedf6c2d6563106b3db3526227", "score": "0.46215552", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n\t// unmounted, potentially).\n\treturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\n\treturn inst;}return null;}", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.46212715", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.46212715", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.46212715", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "80ef957610f3eb9dcb318f7bf0241bae", "score": "0.46199867", "text": "getRootDoc() {\n let rootDoc;\n this.appendMenuItemToDoc(rootDoc);\n for (let doc of this.docsBinder.docs) {\n if (!rootDoc\n && doc.metaInformation.rank === 0) {\n rootDoc = doc;\n }\n }\n return rootDoc;\n }", "title": "" }, { "docid": "fb66486492b4e5be9693f3ddcc05babf", "score": "0.46169135", "text": "getTopNode(r, c) {\n if (r > 0)\n return this.getNode(r - 1, c);\n return null;\n }", "title": "" }, { "docid": "2a1618a6df89181432fa2ce41719ba62", "score": "0.46161756", "text": "function getCurrentDirectiveDef(tData) {\n var currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];\n }", "title": "" }, { "docid": "2a1618a6df89181432fa2ce41719ba62", "score": "0.46161756", "text": "function getCurrentDirectiveDef(tData) {\n var currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];\n }", "title": "" }, { "docid": "f533a3e28befce94feff334e5c712660", "score": "0.4614909", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "6eeac2c1e8456e839324fc7c2f4097ba", "score": "0.46069318", "text": "getBranch() {\r\n return this.querySelector(\"ul\");\r\n }", "title": "" }, { "docid": "3fdda832a954a36fa88ee103e3ebb821", "score": "0.4602091", "text": "_getRootNode() {\n const nativeElement = this._viewContainerRef.element.nativeElement;\n // The directive could be set on a template which will result in a comment\n // node being the root. Use the comment's parent node if that is the case.\n return (nativeElement.nodeType === nativeElement.ELEMENT_NODE ?\n nativeElement : nativeElement.parentNode);\n }", "title": "" }, { "docid": "3fdda832a954a36fa88ee103e3ebb821", "score": "0.4602091", "text": "_getRootNode() {\n const nativeElement = this._viewContainerRef.element.nativeElement;\n // The directive could be set on a template which will result in a comment\n // node being the root. Use the comment's parent node if that is the case.\n return (nativeElement.nodeType === nativeElement.ELEMENT_NODE ?\n nativeElement : nativeElement.parentNode);\n }", "title": "" }, { "docid": "c11774d3eda7de2a710f7b16d2282e3f", "score": "0.45814508", "text": "findRecursively(val, current=this.root) {\n if (!this.root) return undefined;\n\n if (val < current.val){\n if(current.left === null) return undefined;\n return this.findRecursively(val, current.left);\n } else if (val > current.val){\n if(current.right === null) return undefined;\n return this.findRecursively(val, current.right)\n }\n return current;\n }", "title": "" }, { "docid": "693d253af999dcb4b7435424e95318de", "score": "0.45812023", "text": "_getRootNode() {\n const nativeElement = this._viewContainerRef.element.nativeElement;\n // The directive could be set on a template which will result in a comment\n // node being the root. Use the comment's parent node if that is the case.\n return (nativeElement.nodeType === nativeElement.ELEMENT_NODE\n ? nativeElement\n : nativeElement.parentNode);\n }", "title": "" }, { "docid": "8e36648c8f018ffd007f7c4e60314204", "score": "0.45801306", "text": "function getInstanceFromNode(node){var inst=getClosestInstanceFromNode(node);if(inst!=null&&inst._hostNode===node){return inst;}else{return null;}}", "title": "" }, { "docid": "1c8854507f12063d4f49fb92b30350bd", "score": "0.4578186", "text": "get definitionReference() {\n\t\treturn this.__definitionReference;\n\t}", "title": "" }, { "docid": "0dbc6ddc702060eccf248cabea9e7677", "score": "0.4574184", "text": "root() {\n return this._parent.get(this._through).root();\n }", "title": "" }, { "docid": "f7851ec4fc7fe254f20c471115e0a995", "score": "0.45741498", "text": "function loadComponentRenderer(currentDef, tNode, lView) {\n // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n // of creating inner components, when current directive index is available in the state. In order\n // to avoid relying on current def being `null` (thus special-casing root component creation), the\n // process of creating root component should be unified with the process of creating inner\n // components.\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index]);\n }\n\n return lView[RENDERER];\n }", "title": "" }, { "docid": "f7851ec4fc7fe254f20c471115e0a995", "score": "0.45741498", "text": "function loadComponentRenderer(currentDef, tNode, lView) {\n // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n // of creating inner components, when current directive index is available in the state. In order\n // to avoid relying on current def being `null` (thus special-casing root component creation), the\n // process of creating root component should be unified with the process of creating inner\n // components.\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index]);\n }\n\n return lView[RENDERER];\n }", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.4571246", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.4571246", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.4571246", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.4571246", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.4571246", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "5fb084e85198ff2adf09ff417d53421b", "score": "0.45670903", "text": "function loadComponentRenderer(currentDef, tNode, lView) {\n // TODO(FW-2043): the `currentDef` is null when host bindings are invoked while creating root\n // component (see packages/core/src/render3/component.ts). This is not consistent with the process\n // of creating inner components, when current directive index is available in the state. In order\n // to avoid relying on current def being `null` (thus special-casing root component creation), the\n // process of creating root component should be unified with the process of creating inner\n // components.\n if (currentDef === null || isComponentDef(currentDef)) {\n lView = unwrapLView(lView[tNode.index]);\n }\n return lView[RENDERER];\n}", "title": "" }, { "docid": "03744e1b00af1f09ed8c65396abbc1d8", "score": "0.4558545", "text": "function getJsDocTagAtPosition(node, position) {\n var jsDoc = getJsDocHavingNode(node).jsDoc;\n if (!jsDoc)\n return undefined;\n for (var _i = 0, jsDoc_1 = jsDoc; _i < jsDoc_1.length; _i++) {\n var _a = jsDoc_1[_i], pos = _a.pos, end = _a.end, tags = _a.tags;\n if (!tags || position < pos || position > end)\n continue;\n for (var i = tags.length - 1; i >= 0; i--) {\n var tag = tags[i];\n if (position >= tag.pos) {\n return tag;\n }\n }\n }\n }", "title": "" }, { "docid": "25c1c670112cab02fc2b3b1393a35e72", "score": "0.4552549", "text": "root() {\n let node = this;\n while (node.parent()) {\n node = node.parent();\n }\n return node;\n }", "title": "" }, { "docid": "483785c8b20e2e81022372dc693326e3", "score": "0.455074", "text": "function locate_target(){\n // find id referenced by #fragment\n var hash = document.location.hash;\n if(!hash) return null;\n var section = document.getElementById(hash.substr(1));\n if(!section) return null;\n\n // could be div.section, or hidden span at top of div.section\n var name = section.nodeName.toLowerCase();\n if(name != \"div\"){\n if(name == \"span\" && section.innerHTML == \"\" &&\n section.parentNode.nodeName.toLowerCase() == \"div\"){\n section = section.parentNode;\n }\n }\n // now at section div and either way we have to find title element - h2, h3, etc.\n var children = $(section).children(\"h2, h3, h4, h5, h6\");\n return children.length ? children : null;\n }", "title": "" }, { "docid": "44dcd0bc69a7561bc5f40b90538487b6", "score": "0.45432687", "text": "function getClosestInstanceFromNode(node) {\n\t if (node[internalInstanceKey]) {\n\t return node[internalInstanceKey];\n\t }\n\n\t while (!node[internalInstanceKey]) {\n\t if (node.parentNode) {\n\t node = node.parentNode;\n\t } else {\n\t // Top of the tree. This node must not be part of a React tree (or is\n\t // unmounted, potentially).\n\t return null;\n\t }\n\t }\n\n\t var inst = node[internalInstanceKey];\n\t if (inst.tag === HostComponent || inst.tag === HostText) {\n\t // In Fiber, this will always be the deepest root.\n\t return inst;\n\t }\n\n\t return null;\n\t}", "title": "" }, { "docid": "f43f20eabce4e5507c138ded244a9d45", "score": "0.45291194", "text": "function get() {\n return node || create();\n }", "title": "" }, { "docid": "6113fc4dd7a5e45ab15eea477a8a07ae", "score": "0.45240906", "text": "function getCurrentDirectiveDef(tData) {\n const currentDirectiveIndex = instructionState.lFrame.currentDirectiveIndex;\n return currentDirectiveIndex === -1 ? null : tData[currentDirectiveIndex];\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.45197824", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" } ]
91cb36c28a406f6a8e0b41d5e5c19b94
Add submenu item object
[ { "docid": "5ac1443e0839e58b6c0ef9a6bbd9487d", "score": "0.69366264", "text": "function addSubMenuItem(menuId, parentItemState, options) {\n options = options || {};\n\n // Validate that the menu exists\n service.validateMenuExistence(menuId);\n\n // Search for menu item\n for (var itemIndex in service.menus[menuId].items) {\n if (service.menus[menuId].items[itemIndex].state === parentItemState) {\n // Push new submenu item\n service.menus[menuId].items[itemIndex].items.push({\n title: options.title || '',\n state: options.state || '',\n roles: ((options.roles === null || typeof options.roles === 'undefined') ? service.menus[menuId].items[itemIndex].roles : options.roles),\n position: options.position || 0,\n shouldRender: shouldRender\n });\n }\n }\n\n // Return the menu object\n return service.menus[menuId];\n }", "title": "" } ]
[ { "docid": "70dd6ee4c76abae5b39dea82379268fc", "score": "0.75613356", "text": "function mc_addItem(label, action, subMenu) {\n\tvar menuItem;\n\t\n\ttry {\n\t\tmenuItem = new MenuItem(this, label, action, subMenu);\n\t} catch(exception) {\n\t\tthrow exception;\t\t\t\t// Re-throw exception to client code\n\t}\n\t\n\tif(subMenu == '[object MenuContainer]') {\n\t\tsubMenu.parent = this;\t\t\t// Set the parent property\n\t}\n\n\tthis.items.push(menuItem);\n\t\n\treturn menuItem;\n}", "title": "" }, { "docid": "74857e7b1349236e679c6d7ad3579615", "score": "0.7281112", "text": "function addMenuItem(menuItemObj) { // Public method\n if (menuItemObj.displayText == \"-\") {\n var hrElm = createElm(\"hr\");\n var itemElm = createElm(\"div\");\n itemElm.appendChild(hrElm);\n itemElm.id = menuItemObj.id;\n if (menuItemObj.className.length > 0) {\n itemElm.sepClassName = menuItemObj.className;\n }\n else {\n itemElm.sepClassName = menuItemObj.sepClassName;\n }\n itemElm.className = itemElm.sepClassName;\n this.menuObj.appendChild(itemElm);\n itemElm.parent = this;\n itemElm.setClassName = function(className) { // Public method\n this.sepClassName = className;\n this.className = this.sepClassName;\n };\n itemElm.onclick = function(e) { // Private method\n if (!e) {\n var e = window.event;\n e.cancelBubble = true;\n }\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n };\n itemElm.onmouseover = menuItemOver;\n if (menuItemObj.itemName.length > 0) {\n this.items[menuItemObj.itemName] = itemElm;\n }\n else {\n this.items[this.items.length] = itemElm;\n }\n }\n else {\n var itemElm = createElm(\"div\");\n itemElm.id = menuItemObj.id;\n itemElm.actionOnClick = menuItemObj.actionOnClick;\n itemElm.enabled = menuItemObj.enabled;\n itemElm.itemClassName = menuItemObj.className;\n itemElm.itemClassNameOver = menuItemObj.classNameOver;\n itemElm.className = itemElm.itemClassName;\n itemElm.subMenu = null;\n itemElm.arrowClassName = arrowClassName;\n itemElm.arrowClassNameOver = arrowClassNameOver;\n var textNode = document.createTextNode(menuItemObj.displayText);\n itemElm.appendChild(textNode);\n this.menuObj.appendChild(itemElm);\n itemElm.parent = this;\n itemElm.setClassName = function(className) { // Public method\n this.itemClassName = className;\n this.className = this.itemClassName;\n };\n itemElm.setClassNameOver = function(classNameOver) { // Public method\n this.itemClassNameOver = classNameOver;\n };\n itemElm.setDisplayText = function(text) { // Public method\n if (this.childNodes[0].nodeType == 3) {\n this.childNodes[0].nodeValue = text;\n }\n else {\n this.childNodes[1].nodeValue = text;\n }\n };\n\t\n itemElm.setSubMenu = setSubMenu;\n itemElm.showIcon = showMenuItemIcon;\n itemElm.onmouseover = menuItemOver;\n itemElm.onclick = menuItemClick;\n itemElm.onmouseout = menuItemOut;\n if (menuItemObj.itemName.length > 0) {\n this.items[menuItemObj.itemName] = itemElm;\n }\n else {\n this.items[this.items.length] = itemElm;\n }\n }\n}", "title": "" }, { "docid": "a43f521d0110cc377425365def09ef9c", "score": "0.6967228", "text": "_makeSubMenu() {\n snippet.forEach(this.options.menu, menuName => {\n const SubComponentClass = SUB_UI_COMPONENT[menuName.replace(/^[a-z]/, $0 => $0.toUpperCase())];\n\n // make menu element\n this._makeMenuElement(menuName);\n\n // menu btn element\n this._els[menuName] = this._menuElement.querySelector(`#tie-btn-${menuName}`);\n\n // submenu ui instance\n this[menuName] = new SubComponentClass(this._subMenuElement, {\n locale: this._locale,\n iconStyle: this.theme.getStyle('submenu.icon'),\n menuBarPosition: this.options.menuBarPosition\n });\n });\n }", "title": "" }, { "docid": "c23494a62332394a6b1fe50142842292", "score": "0.6964986", "text": "createNavItem( item, submenuItem = false ) {\n let li = document.createElement( 'li' );\n\n let a = document.createElement( 'a' );\n a.textContent = item.name;\n a.setAttribute( 'href', item.url );\n\n if( submenuItem ) {\n // create just a element\n li.className += \"dropdown-item\";\n } else {\n // create wrapper li element\n li.className += \"nav-item\";\n a.className += \"nav-link\";\n\n }\n\n if( item.children ) {\n if( submenuItem ) {\n li.className += \" dropdown-submenu\";\n\n } else {\n\n li.className += \" dropdown\";\n }\n a.className += \" dropdown-toggle\";\n }\n \n li.appendChild( a );\n\n return li;\n }", "title": "" }, { "docid": "650aa064957acbf5a2b2531369a3c768", "score": "0.6956612", "text": "function submenu(container,item){\n var leftPos = 0;\n $.each($(container).children('div'),function(i,mydiv){\n leftPos += $(mydiv).width();\n });\n var submenu = $('<div/>').css({'top':0,'left':leftPos}).appendTo(container);\n if($.browser.msie) { $(submenu).width('200px'); } // Cuz IE don't support auto width\n var subitems = $(item).data('sub').children('li');\n $.each(subitems,function(i,subitem){\n var subsubitem = $(':eq(0)',subitem).clone().data('sub',$(subitem).children('ul')).appendTo(submenu);\n if($(subsubitem).data('sub').length) {\n $(subsubitem).addClass('hasChildMenu');\n if($.browser.safari){\n $(subsubitem).css({'margin-right':'15px'}); \n }\n addWidget(subsubitem);\n }\n });\n }", "title": "" }, { "docid": "86a9352a48cf8fd6bdcbd6c7109e9bb1", "score": "0.68551725", "text": "function _createMenu(item, index, array) {\n var $mainNavItem = document.createElement('li'),\n $mainNavAcnhor = document.createElement('a');\n\n $mainNavItem.className = 'nav_item';\n $mainNavAcnhor.className = 'nav_anchor';\n // set the anchor\n $mainNavAcnhor.innerHTML = item.label;\n $mainNavAcnhor.setAttribute('href', item.url);\n // append childs\n $mainNavItem.appendChild($mainNavAcnhor)\n $mainNav.appendChild($mainNavItem);\n // make sure the item has submenu items before reate a subenu\n if((typeof item.items !== null && typeof item.items !== 'undefined') && item.items.length > 0){\n $mainNavAcnhor.classList.add('nav_anchor__hasDrop')\n _createSubMenu(item.items, $mainNavItem)\n }\n }", "title": "" }, { "docid": "647387ba1cc95ffb96a457df4ac1dadb", "score": "0.6808563", "text": "createSubmenu( items, parent ) {\n let submenuId = this.getSubmenuId();\n let submenu = document.createElement( 'ul' );\n \n submenu.className += \"dropdown-menu\";\n submenu.setAttribute( 'aria-labelledy', submenuId );\n parent.querySelector( '.dropdown-toggle' ).setAttribute( 'id', submenuId );\n\n\n items.forEach( item => {\n let li = this.createNavItem( item, true );\n submenu.appendChild( li );\n if( item.children ) {\n this.createSubmenu( item.children, li );\n }\n return;\n \n } )\n parent.appendChild( submenu );\n \n\n }", "title": "" }, { "docid": "a7d02b53892732b57f9ccc3e00543ad9", "score": "0.67657214", "text": "function _createSubMenu(subMenu, $menuItem) {\n var $subMenu = document.createElement('ul');\n $subMenu.className = 'subnav_list';\n subMenu.forEach(function (item, index, array){\n var $subMenuItem = document.createElement('li'),\n $subMenuAnchor = document.createElement('a');\n $subMenuItem.className = 'subnav_item';\n $subMenuAnchor.className = 'subnav_anchor';\n // set the anchor\n $subMenuAnchor.innerHTML = item.label;\n $subMenuAnchor.setAttribute('href', item.url);\n // append childs\n $subMenuItem.appendChild($subMenuAnchor)\n $subMenu.appendChild($subMenuItem);\n\n // attatch the submenu\n $menuItem.appendChild($subMenu);\n // make sure the item has submenu items before reate a subenu\n // probably with this we can recursively create sub menu's if them exist\n if((typeof item.items !== null && typeof item.items !== 'undefined') && item.items.length > 0){\n $subMenuAcnhor.classList.add('subnav_anchor__hasDrop')\n _createSubMenu(item.items, $subMenuItem);\n }\n });\n }", "title": "" }, { "docid": "4c12f0ee06d3410f7c14075ad780ec37", "score": "0.6734839", "text": "addItems(itemSelector, itemHaveSubMenuSelector, subMenuSelector, activeClass)\n {\n const $itemsInSubMenu = this.$menu.querySelectorAll(itemSelector);\n\n [...$itemsInSubMenu].forEach($itemInSubMenu => {\n if ($itemInSubMenu.closest(subMenuSelector) !== this.$menu) return;\n\n const menuItem = new MenuItem($itemInSubMenu, activeClass);\n const $itemSubMenu = $itemInSubMenu.querySelector(subMenuSelector);\n const subMenu = $itemSubMenu ? new SubMenu($itemSubMenu) : null;\n\n if (subMenu) {\n subMenu.addItems(itemSelector, itemHaveSubMenuSelector, subMenuSelector, activeClass);\n menuItem.addSubMenu(subMenu);\n }\n\n this.menu.push(menuItem);\n });\n }", "title": "" }, { "docid": "6873b4e30c067c60e6872d263eabfa40", "score": "0.67233783", "text": "function menuAddItem(inName, inPrice, inCat) {\r\n\t\tmenuItem[menuItem.length] = new objMenuItem(inName, inPrice, inCat);\r\n }", "title": "" }, { "docid": "431cea2e89ce72724b06a107c752cb1b", "score": "0.65971535", "text": "_add(item) {\n var indent = 20 * (this._getIndentation(item) + 1);\n let elem = new ItemElement(this.x + indent, this.y, this.w - 20 - indent, 26, item.caption); \n Utils.addMenuTo(elem);\n Utils.setVerbs(elem, item, this.context);\n item.element = elem;\n elem.item = item;\n this.items.push(item);\n }", "title": "" }, { "docid": "2fb3bbb8ea73c1032c59f3b301971a89", "score": "0.6570631", "text": "function UilMenuItemCreate( menuHasIcon, menuHasSubmenu ) {\n if ( !this.isSeparator ) {\n this.anchorTag = document.createElement( \"A\" );\n if ( this.action != null ) {\n this.anchorTag.href = \"javascript:menuItemLaunchAction();\";\n if ( this.clientAction != null && !wclIsOpera_ ) {\n this.anchorTag.onclick = this.clientAction;\n }\n }\n else if ( this.submenu != null ) {\n this.anchorTag.href = \"javascript:void(0);\";\n this.anchorTag.onclick = menuItemShowSubmenu;\n }\n else if ( this.clientAction != null ) {\n this.anchorTag.href = \"javascript:menuItemLaunchAction();\";\n if(!wclIsOpera_) this.anchorTag.onclick = this.clientAction;\n }\n this.anchorTag.onfocus = menuItemFocus;\n this.anchorTag.onblur = menuItemBlur;\n this.anchorTag.onkeydown = menuItemKeyDown;\n this.anchorTag.innerHTML = this.text;\n// this.anchorTag.title = this.text; \n this.anchorTag.title = this.anchorTag.innerHTML; \n //this.anchorTag.className = \"pop5\"; //@06C1\n this.anchorTag.className = this.menuStyle; //@06C1\n if ( this.isDefault ) {\n this.anchorTag.style.fontWeight = \"bold\";\n }\n\n var td = document.createElement( \"TD\" );\n td.noWrap = true;\n td.style.padding = \"3px\";\n td.appendChild( this.anchorTag );\n\n // left padding or icon\n var leftPad = document.createElement( \"TD\" );\n leftPad.noWrap = true;\n leftPad.innerHTML = \"&nbsp;\";\n leftPad.style.padding = \"3px\";\n if ( this.icon != null ) {\n var imgTag = document.createElement( \"IMG\" );\n imgTag.src = this.icon;\n if (imgTag.src == \"\" || imgTag.src == null) {\n var imgTag1 = \"<img src=\\\"\" + this.icon + \"\\\"\";\n if ( this.text != null ) {\n imgTag1 += \" alt=\\'\" + this.text + \"\\'\";\n imgTag1 += \" title=\\'\" + this.text + \"\\'\";\n }\n imgTag1 += \"/>\";\n leftPad.innerHTML = imgTag1;\n } else {\n if ( this.text != null ) {\n imgTag.alt = this.text;\n imgTag.title = this.text;\n }\n leftPad.appendChild( imgTag );\n }\n }\n else {\n leftPad.width = padding_;\n }\n\n // right padding\n var rightPad = document.createElement( \"TD\" );\n rightPad.noWrap = true;\n rightPad.width = padding_;\n rightPad.innerHTML = \"&nbsp;\";\n rightPad.style.padding = \"3px\";\n\n this.itemTag = document.createElement( \"TR\" );\n this.itemTag.onmousemove = menuItemMouseMove;\n this.itemTag.onmousedown = menuItemLaunchAction;\n //this.itemTag.className = \"pop5\"; //@06C1\n this.itemTag.className = this.menuStyle;\n // put together the table row\n this.itemTag.appendChild( leftPad );\n this.itemTag.appendChild( td );\n this.itemTag.appendChild( rightPad );\n if ( menuHasSubmenu ) {\n // submenu arrow\n var submenuArrow = document.createElement( \"TD\" );\n submenuArrow.noWrap = true;\n submenuArrow.style.padding = \"3px\";\n if ( this.submenu != null ) {\n var submenuImg = document.createElement( \"IMG\" );\n submenuImg.alt = submenuAltText_;\n submenuImg.title = submenuAltText_;\n submenuImg.width = arrowWidth_;\n submenuImg.height = arrowHeight_;\n if (this.parentMenu.isLTR) submenuImg.src = arrowNorm_;\n else submenuImg.src = arrowNormRTL_;\n submenuArrow.appendChild( submenuImg );\n this.arrowTag = submenuImg;\n }\n else {\n submenuArrow.innerHTML = \"&nbsp;\";\n }\n this.itemTag.appendChild( submenuArrow );\n }\n\n // update the style of the menu item\n this.updateStyle( this.itemTag );\n }\n}", "title": "" }, { "docid": "cfe4d7cbcd1e7f8c2b773928ade8b9b5", "score": "0.6567871", "text": "function addMenuItem(aParent, aLabel, aValue, aCommand) {\n let item = null;\n if (aParent.localName == \"menupopup\") {\n item = document.createXULElement(\"menuitem\");\n item.setAttribute(\"label\", aLabel);\n if (aValue) {\n item.setAttribute(\"value\", aValue);\n }\n if (aCommand) {\n item.command = aCommand;\n }\n aParent.appendChild(item);\n } else if (aParent.localName == \"menulist\") {\n item = aParent.appendItem(aLabel, aValue);\n }\n return item;\n}", "title": "" }, { "docid": "71db634bf80bbdff1cfdc414ecef5baa", "score": "0.6531266", "text": "function AddNewMenuBar(id){\n\tvar name = '<p class=\"menuName\">MENU</p>',\n\t\taddBut = '<input class=\"addSubmenu\" type=\"button\" name=\"add\" value=\"+\"/>',\n\t\tedit = '<input class=\"editMenu\" type=\"button\" name=\"edit\" value=\"EDIT\"/>';\n\treturn '<li id=\"id'+id+'\" class=\"ol_menuRow\"><ol class=\"submenu\" id=listid'+id+'><li class=\"menuRow\">'+name+addBut+edit+'</li><ol class=\"ol_submenuRow\"></ol></ol></li>';\n}", "title": "" }, { "docid": "179d2e2abd9be3dc7cd2d3feae619444", "score": "0.65238583", "text": "function createItem() {\n var item = arguments[0],\n $levelHolder = arguments[1],\n position = arguments[2],\n $itemGroup = $levelHolder.find('ul:first'),\n $item = $(\"<li />\");\n (position < ($itemGroup.find('li').length) && position >= 0) ?\n $item.insertBefore($itemGroup.find('li').eq(position)) : $item.appendTo($itemGroup);\n $item.attr({\"style\": \"text-align: \" + ((instance.settings.direction == 'rtl') ? \"right\" : \"left\")});\n if (item.id != undefined)\n $item.attr({\"id\": item.id});\n var $itemAnchor = $(\"<a />\")\n .prop({\"href\": item.link})\n .text(item.name)\n .appendTo($item),\n $itemIcon = $(\"<i />\")\n .prop({\"class\": ((instance.settings.direction == 'rtl') ? \"floatLeft \" : \"floatRight \") + item.icon})\n .prependTo($itemAnchor);\n if (item.items) {\n $itemAnchor.bind(clickEventType, function(e) {\n itemGroupAnchorClick(e, $levelHolder, $item);\n });\n createItemGroupIcon($itemAnchor);\n item.items.level = parseInt($levelHolder.attr('data-level'), 10) + 1;\n createNestedDOMStructure(item.items, $item);\n } else {\n $itemAnchor.bind(clickEventType, function(e) {\n itemAnchorClick(e, $levelHolder, $item);\n });\n }\n }", "title": "" }, { "docid": "6c2701a6c4cdc6a6608addeb1b9b2f79", "score": "0.65221286", "text": "function UilContextMenuAdd( item ) {\n this.items[ this.items.length ] = item;\n this.isEmpty = false;\n}", "title": "" }, { "docid": "394691682ccf2a200ae24c75ca1e8e3f", "score": "0.6441419", "text": "createMenu(){\n\t\tfor(let key in this.tours){\n\t\t\tthis.menu.appendChild(this.createOption(key,this.tours[key][0]));\n\t\t}\n\t\tthis.initMenu();\n\t}", "title": "" }, { "docid": "ba9f991f875097aa8d3bcb500ace1158", "score": "0.6425457", "text": "function addOptionsMenuItem() {\n var elements = [];\n elements['image'] = createImage('icons/options.png');\n elements['span'] = createSpan('text', onOptionClick, 'Options');\n document.getElementById('menu').appendChild(document.createElement('hr'));\n document.getElementById('menu').appendChild(appendMenuItem(elements));\n}", "title": "" }, { "docid": "48ec54357df3ffcc572ad2dacd1ae1b0", "score": "0.6414598", "text": "function treeAdd(level,txt,link,img,id,accion) {\r\n\tx = treeData.length;//tamaņo elementos del menu\r\n\ttreeData[x] = new tree(level,txt,link,img,id,accion);\r\n}", "title": "" }, { "docid": "cae7a352a7a1bc83d0efa23c1d955aae", "score": "0.63853395", "text": "function attachMenuItem(value, key) {\r\n\t\t\t\t\t\tif (!document.id(document.getElementById(this.menu.get('id') + ':' + key))) {\r\n\t\t\t\t\t\t\tvar listItem = new Element('li', {\r\n\t\t\t\t\t\t\t\tid : this.menu.get('id') + ':' + key,\r\n\t\t\t\t\t\t\t\ttext : key\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tif (value.parentEntry) { // && Object.getLength(value) == 1) {\r\n\t\t\t\t\t\t\t\tlistItem.set({\r\n\t\t\t\t\t\t\t\t\t'class' : 'link',\r\n\t\t\t\t\t\t\t\t\tevents : {\r\n\t\t\t\t\t\t\t\t\t\tclick : function() {\r\n\t\t\t\t\t\t\t\t\t\t\tthis.redirect(value.parentEntry[0])\r\n\t\t\t\t\t\t\t\t\t\t}.bind(this)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.menu.getElement('ul').adopt(listItem);\r\n\t\t\t\t\t\t\tif (Object.some(value, function(subValue, subKey){\r\n\t\t\t\t\t\t\t\treturn subKey !== 'parentEntry';\r\n\t\t\t\t\t\t\t}, this)) {\r\n\t\t\t\t\t\t\t\tlistItem.adopt(new Element('ul'));\r\n\t\t\t\t\t\t\t\tObject.each(value, function(subValue, subKey) {\r\n\t\t\t\t\t\t\t\t\tif (subKey !== 'parentEntry') {\r\n\t\t\t\t\t\t\t\t\t\tvar subListItem = new Element('li', {\r\n\t\t\t\t\t\t\t\t\t\t\t'class' : 'link',\r\n\t\t\t\t\t\t\t\t\t\t\tevents : {\r\n\t\t\t\t\t\t\t\t\t\t\t\tclick : function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.redirect(subValue[0]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}.bind(this)\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\tid : listItem.get('id') + ':' + subKey,\r\n\t\t\t\t\t\t\t\t\t\t\ttext : subKey\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\tlistItem.getElement('ul')\r\n\t\t\t\t\t\t\t\t\t\t\t\t.adopt(subListItem);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}, this);\r\n\t\t\t\t\t\t\t} /* else {\r\n\t\t\t\t\t\t\t\tlistItem.set({\r\n\t\t\t\t\t\t\t\t\t'class' : 'link',\r\n\t\t\t\t\t\t\t\t\tevents : {\r\n\t\t\t\t\t\t\t\t\t\tclick : function() {\r\n\t\t\t\t\t\t\t\t\t\t\tthis.redirect(value[0]);\r\n\t\t\t\t\t\t\t\t\t\t}.bind(this)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t} */\r\n\t\t\t\t\t\t} else { // top if\r\n\t\t\t\t\t\t\tif (typeOf(value) == 'object') {\r\n\t\t\t\t\t\t\t\tObject.each(value, function(subValue, subKey) {\r\n\t\t\t\t\t\t\t\t\tif ((subKey !== 'parentEntry') && !document.id(document.getElementById(\r\n\t\t\t\t\t\t\t\t\t\t\tthis.menu.get('id') + ':' + key + ':' + subKey))) {\r\n\t\t\t\t\t\t\t\t\t\tvar subMenu;\r\n\t\t\t\t\t\t\t\t\t\tif (document.id(document.getElementById(this.menu.get('id') + ':' + key)).getElement('ul')){\r\n\t\t\t\t\t\t\t\t\t\t\tsubMenu = document.id(document.getElementById(this.menu.get('id') + ':' + key)).getElement('ul');\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tsubMenu = new Element('ul');\r\n\t\t\t\t\t\t\t\t\t\t\tdocument.id(document.getElementById(this.menu.get('id') + ':' + key)).adopt(subMenu);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tsubMenu.adopt(new Element('li', {\r\n\t\t\t\t\t\t\t\t\t\t\tid : subMenu.getParent().get('id') + ':' + subKey,\r\n\t\t\t\t\t\t\t\t\t\t\ttext : subKey\r\n\t\t\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t// stupid IE6 workaround\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tdocument.id(document.getElementById(\r\n\t\t\t\t\t\t\t\t\t\t\tthis.menu.get('id')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ ':'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ key\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ (subKey == 'parentEntry' ? ''\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: ':' + subKey)))\r\n\t\t\t\t\t\t\t\t\t\t\t.set({\r\n\t\t\t\t\t\t\t\t\t\t\t\t'class' : 'link',\r\n\t\t\t\t\t\t\t\t\t\t\t\tevents : {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tclick : function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.redirect(subValue[0]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}.bind(this)\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}, this);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tdocument.id(document.getElementById(this.menu.get('id') + ':' + key))\r\n\t\t\t\t\t\t\t\t\t\t.set({\r\n\t\t\t\t\t\t\t\t\t\t\t'class' : 'link',\r\n\t\t\t\t\t\t\t\t\t\t\tevents : {\r\n\t\t\t\t\t\t\t\t\t\t\t\tclick : function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.redirect(value[0]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}.bind(this)\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});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "title": "" }, { "docid": "f160d73e00be3380c9a57d02e4833d43", "score": "0.63318896", "text": "function syncSubMenu( item ){\n var elements;\n\n if( typeof item !== \"undefined\" ) {\n elements = item;\n } else {\n elements = $(\".sidebar-elements > li\", leftSidebar);\n }\n\n $.each( elements, function(){\n var title = $(this).find(\"> a span\").html();\n var ul = $(this).find(\"> ul\");\n var subEls = $(\"> li\", ul);\n title = $('<li class=\"title\">' + title + '</li>');\n var subContainer = $('<li class=\"nav-items\"><div class=\"be-scroller\"><div class=\"content\"><ul></ul></div></div></li>');\n\n if( !ul.find(\"> li.title\").length ){\n ul.prepend( title );\n subEls.appendTo( subContainer.find(\".content ul\") );\n subContainer.appendTo( ul );\n }\n });\n }", "title": "" }, { "docid": "4fefea0f9d2ca4a3def8468f47353180", "score": "0.6320825", "text": "function setSubMenu(menuObj) { // Public method\n var arrowElm = createElm(\"div\");\n arrowElm.id = this.id + \"Arrow\";\n arrowElm.className = this.arrowClassName;\n this.appendChild(arrowElm);\n var height;\n if (ie) {\n height = getPropIntVal(arrowElm, \"height\");\n }\n else {\n height = arrowElm.offsetHeight;\n }\n arrowElm.style.top = Math.floor((this.offsetHeight - height) / 2) + px;\n this.subMenu = menuObj;\n this.arrowObj = arrowElm;\n this.setArrowClassName = function(className) { // Public method\n this.arrowClassName = className;\n this.arrowObj.className = this.arrowClassName;\n };\n this.setArrowClassNameOver = function(classNameOver) { // Public method\n this.arrowClassNameOver = classNameOver;\n };\n menuObj.menuObj.style.zIndex = this.parent.menuObj.level + 1;\n menuObj.menuObj.level = this.parent.menuObj.level + 1;\n}", "title": "" }, { "docid": "d37ecb32103bc6a6a8402094ef87cf5e", "score": "0.63173836", "text": "function appendItem(item){\n\t\t\t//add div to the menu\n\t\t\tif ( item.active.call(null, ev) )\n\t\t\t\tmenu.appendChild(item.DOM);\n\t\t}", "title": "" }, { "docid": "3bc0e98d9d0c4f57f71fb1e088b5565e", "score": "0.6282827", "text": "function appendMenuItem(item) {\n var li = document.createElement('li');\n li.appendChild(item);\n return li;\n}", "title": "" }, { "docid": "adf281e998a688cf8ced347f3e84cc7c", "score": "0.62813467", "text": "function addMenuItem(rest, item){\n\n if (!rest.menus[item.type].includes(item)) {\n rest.menus[item.type].push(item)\n }\n}", "title": "" }, { "docid": "cccbe2ea6bbd85d9901ad2b872a2e595", "score": "0.62637544", "text": "createMenuItem (event) {\n event.preventDefault();\n\n console.log(this.props);\n\n //TODO: add allergen and image\n //NOTE: Took category option out\n const menuItem = {\n name: this.name.value,\n description: this.description.value,\n idx: this.props.idx,\n price: this.price.value,\n image: this.image.value,\n calories: this.calories.value,\n }\n\n /*\n meat: this.meat.value,\n dairy: this.dairy.value,\n nuts: this.nuts.value,\n gluten: this.gluten.value,\n soy: this.soy.value,\n other: this.other.value,\n */\n\n this.props.addMenuItem(menuItem);\n //reset the form so that the next new item can be created\n this.menuItemForm.reset();\n }", "title": "" }, { "docid": "a956aaf1a67f3bfb8120b5a7302b792d", "score": "0.6259617", "text": "addMenu(menu) {\n check(menu, Context.Menu);\n Context.menus[menu.id] = menu;\n }", "title": "" }, { "docid": "1be3326ab3ceef55999cc86d97012928", "score": "0.62433916", "text": "function addMenuItem(elementID, item) {\n\tmenu[elementID].push(item);\n}", "title": "" }, { "docid": "38938e94557ae64988382474d3f1bd30", "score": "0.6234726", "text": "function addMenu(listItem) {\n const menuContainer = document.createElement('div');\n menuContainer.setAttribute('class', 'menu-container');\n\n const triange = document.createElement('div');\n triange.setAttribute('class', 'triangle-up');\n \n const menuListContainer = document.createElement('div');\n menuListContainer.setAttribute('class', 'menu-item-container');\n addMenuItem(menuListContainer);\n\n menuContainer.appendChild(triange)\n menuContainer.appendChild(menuListContainer)\n listItem.appendChild(menuContainer);\n }", "title": "" }, { "docid": "89c0841e510c7790ec0b70ccb7f05834", "score": "0.6195266", "text": "function addMenuItem(menuId, options) {\n options = options || {};\n\n // Validate that the menu exists\n service.validateMenuExistence(menuId);\n\n // Push new menu item\n service.menus[menuId].items.push({\n title: options.title || '',\n state: options.state || '',\n type: options.type || 'item',\n class: options.class,\n roles: ((options.roles === null || typeof options.roles === 'undefined') ? service.defaultRoles : options.roles),\n position: options.position || 0,\n items: [],\n shouldRender: shouldRender\n });\n\n // Add submenu items\n if (options.items) {\n for (var i in options.items) {\n if (options.items.hasOwnProperty(i)) {\n service.addSubMenuItem(menuId, options.state, options.items[i]);\n }\n }\n }\n\n // Return the menu object\n return service.menus[menuId];\n }", "title": "" }, { "docid": "e222f469b5ad67d0a4efa59b8734f35a", "score": "0.61949825", "text": "function addItemAction(parentId) {\n var item = new Item();\n var ref = new Reference();\n\n // TODO: remove need to set the level, should be auto determined (e.g. first or later one)\n\n // retreive data from the form\n item.name = document.getElementById(\"itemName\").value;\n item.state = document.getElementById(\"itemState\").value;\n item.position = document.getElementById(\"itemPosition\").value;\n item.description = document.getElementById(\"itemDescription\").value;\n\n ref.id = document.getElementById(\"itemReference\").value;\n ref.type = document.getElementById(\"itemReferenceType\").value;\n item.reference = ref;\n\n network.addItem(item, parentId);\n\n // addItemToItem.addEventListener(\"mouseenter\", addButtonMouseEnter);\n // addItemToItem.addEventListener(\"mouseleave\", addButtonMouseLeave);\n \n}", "title": "" }, { "docid": "b61b54fc390f9f0f17e4242e4525d1b1", "score": "0.61837274", "text": "function appendItemToMenu(filename) {\n curr_menu = Menu.getApplicationMenu().getMenuItemById(\"saved\").submenu\n\n curr_menu.append(\n new MenuItem({\n label: path.basename(filename, '.html'),\n click() {\n console.log('Saved page opened')\n win.loadFile(savedFolder + path.basename(filename))\n }\n }))\n}", "title": "" }, { "docid": "0b617a55e90b3ecb78d502b859c6c8f2", "score": "0.6143175", "text": "function addNavItem( obj, i ){\n\n if ( obj.node.frontmatter.path ) {\n\n let splitpath = obj.node.frontmatter.path ? obj.node.frontmatter.path.split('/') : [];\n\n let newNav = nav;\n for (i=0;i<splitpath.length;i++) {\n let node = {\n title: capitalize(splitpath[i]),\n name: splitpath[i],\n type: 'directory',\n path: '/' + obj.node.frontmatter.path\n };\n if (i == splitpath.length - 1) {\n node.title = capitalize(obj.node.frontmatter.title);\n node.path = obj.node.frontmatter.path ? '/' + obj.node.frontmatter.path : '/';\n node.description = obj.node.frontmatter.description;\n node.type = 'page';\n }\n newNav[splitpath[i]] = newNav[splitpath[i]] || node;\n newNav[splitpath[i]].children = newNav[splitpath[i]].children || {};\n newNav = newNav[splitpath[i]].children;\n }\n\n }\n\n}", "title": "" }, { "docid": "e130ee7444763355c3a11a748d032068", "score": "0.6131798", "text": "function MenuItem(_ref) {\n let {\n children,\n disabled,\n highlighted,\n href = '',\n icon,\n id,\n onClick,\n openInNewWindow,\n role = 'menuitem',\n spacious,\n submenu,\n tabIndex = -1,\n tip,\n trackingName\n } = _ref;\n const [styles, cx] = (0, _useStyles.default)(_styles.styleSheetItem);\n const [showSubmenu, setShowSubmenu] = (0, _react.useState)(false);\n\n const handleMouseEnter = () => {\n if (submenu) {\n setShowSubmenu(true);\n }\n };\n\n const handleMouseLeave = () => {\n if (submenu) {\n setShowSubmenu(false);\n }\n };\n\n const after = submenu ? _react.default.createElement(_DirectionalIcon.default, {\n decorative: true,\n direction: \"right\",\n left: _IconCaretLeft.default,\n right: _IconCaretRight.default,\n size: \"1.5em\"\n }) : tip;\n return _react.default.createElement(\"li\", {\n role: \"none\",\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave\n }, _react.default.createElement(_ButtonOrLink.default, {\n className: cx(styles.item, (showSubmenu || highlighted) && styles.item_highlighted, disabled && styles.item_disabled, spacious && styles.item_spacious),\n afterIcon: after ? _react.default.createElement(_Text.default, {\n muted: true,\n small: true\n }, after) : null,\n \"aria-expanded\": showSubmenu,\n \"aria-haspopup\": !!submenu,\n beforeIcon: icon,\n disabled: disabled,\n href: href,\n id: id,\n openInNewWindow: openInNewWindow,\n role: role,\n tabIndex: tabIndex,\n trackingName: trackingName,\n onClick: onClick\n }, children), showSubmenu && _react.default.createElement(\"div\", {\n className: cx(styles.submenu)\n }, submenu));\n}", "title": "" }, { "docid": "915532434b1500d75cabc89cafbbceaf", "score": "0.61233443", "text": "add(item) {\n this.state.userMenuItems.add(item);\n this.emitNewState();\n }", "title": "" }, { "docid": "dfb119e22c8c0ea0bfcecb3b320ca41b", "score": "0.6114047", "text": "getSubMenuOrItem(item, index) {\r\n const self = this\r\n // doc: add hideChildrenInMenu\r\n if (item.list && item.list.length && this.getMenuDataFormat(item.list).some(child => child.name)) {\r\n\r\n const { name } = item;\r\n return (\r\n <SubMenu\r\n title={name}\r\n key={item.key}\r\n onTitleClick={({ key, domEvent }) => {\r\n\r\n }}\r\n >\r\n {this.getNavMenuItems(item.list)}\r\n </SubMenu>\r\n );\r\n }\r\n return (\r\n <Menu.Item\r\n key={item.key}\r\n onClick={() => {\r\n\r\n }}\r\n >\r\n {this.getMenuItemPath(item)}\r\n </Menu.Item>\r\n )\r\n }", "title": "" }, { "docid": "d01445a41c37399a4e08a43720efff52", "score": "0.6113783", "text": "function createMenu() {\n const application = {\n label: \"Application\",\n submenu: [\n {\n label: \"About Application\",\n selector: \"orderFrontStandardAboutPanel:\"\n },\n {\n type: \"separator\"\n },\n {\n label: \"Quit\",\n accelerator: \"Command+Q\",\n click: () => {\n app.quit()\n }\n }\n ]\n }\n \n const edit = {\n label: \"Edit\",\n submenu: [\n {\n label: \"Undo\",\n accelerator: \"CmdOrCtrl+Z\",\n selector: \"undo:\"\n },\n {\n label: \"Redo\",\n accelerator: \"Shift+CmdOrCtrl+Z\",\n selector: \"redo:\"\n },\n {\n type: \"separator\"\n },\n {\n label: \"Cut\",\n accelerator: \"CmdOrCtrl+X\",\n selector: \"cut:\"\n },\n {\n label: \"Copy\",\n accelerator: \"CmdOrCtrl+C\",\n selector: \"copy:\"\n },\n {\n label: \"Paste\",\n accelerator: \"CmdOrCtrl+V\",\n selector: \"paste:\"\n },\n {\n label: \"Select All\",\n accelerator: \"CmdOrCtrl+A\",\n selector: \"selectAll:\"\n }\n ]\n }\n \n const template = [\n application,\n edit\n ]\n \n Menu.setApplicationMenu(Menu.buildFromTemplate(template))\n }", "title": "" }, { "docid": "64930db01a7cc772ecf1160e88459287", "score": "0.61045647", "text": "function AddItem(Data) {\n\t\tvar type = '<div></div>';\n\t\tvar _append = Data['parent'];\n\t\t\n\t\t/* If is an item, whe need the span */\n\t\tif(Data['type'] == 'item') {\n\t\t\ttype = '<span></span>';\t\t\t\n\t\t}\n\t\t\n\t\t/* Let's add the item */\n\t\t$(_append).find(\".helper\").remove();\n\t\tvar ID = Data['id'];\n\t\t$(type).html(Data['content']).attr('class',Data['css']).attr('id',ID).appendTo(_append);\n\t\t\n\t\t/* Based on features, we make it droppable and sortable, also add its actions */\n\t\tif(Data['droppable']) {\n\t\t\tdevi.Functions.drop('#'+ID);\n\t\t\tdevi.Functions.accordion('#'+ID);\n\t\t} if(Data['sortable']) {\n\t\t\tdevi.Functions.sort('#'+ID);\n\t\t} if(Data['type'] == 'item') {\n\t\t\t/* Sub-buttons actions */\n\t\t\tdevi.Functions.actions(ID,_append);\n\t\t}\n\t}", "title": "" }, { "docid": "2c12edd79c1756a02c01b87415140f29", "score": "0.61020577", "text": "function createMenuItem(name, price, type) {\n menuItem = {\n name,\n price,\n type,\n };\n return menuItem;\n}", "title": "" }, { "docid": "4edd04774f3ad5ae7718906b9f2cb29f", "score": "0.6092669", "text": "function AddArrayMenu(item, funcid) {\n if (!item || item.length == 0)\n return;\n curserial = menuMaxnum;\n menucount = item.length;\n var menu = new Array();\n $.each(item, function (idx, s) {\n\n var twolevel = getTowlevel(s, funcid);\n menu.push(\n {\n name: s,\n id: 's_' + s,\n level: 1,\n serial: idx.toString(),\n viewer: idx >= menuMaxnum ? 'none' : 'block'\n }\n )\n // console.log(\"menu1\");\n // console.log(menu);\n Array.prototype.push.apply(menu, twolevel);\n // console.log(\"menu2\");\n // console.log(menu);\n });\n //排序\n // var basemenu=menu.sort(\n // function(a, b)\n // {\n // if(a.level < b.level) return -1;\n // if(a.level > b.level) return 1;\n // return 0;\n // });\n var basemenu = getSortMenu(menu);\n //超过6个显示浮动\n if (item.length > menuMaxnum) {\n basemenu.splice(0, 0,\n {\n name: '▲',\n id: 'r-up-menu-item',\n level: 1,\n serial: -1,\n viewer: 'none',\n callback: function () {\n upChange();\n }\n }\n );\n basemenu.push(\n {\n name: '▼',\n id: 'r-down-menu-item',\n level: 1,\n serial: -2,\n viewer: 'block',\n callback: function () {\n downChange();\n }\n }\n );\n }\n return basemenu;\n }", "title": "" }, { "docid": "8ecb63814579be646986d27a2f3b7897", "score": "0.60857683", "text": "function openSubmenu(submenu, itemNode) {\r\n // Ensure the menu is updated before opening.\r\n messaging_1.MessageLoop.sendMessage(submenu, widget_1.Widget.Msg.UpdateRequest);\r\n // Get the current position and size of the main viewport.\r\n var px = window.pageXOffset;\r\n var py = window.pageYOffset;\r\n var cw = document.documentElement.clientWidth;\r\n var ch = document.documentElement.clientHeight;\r\n // Compute the maximum allowed height for the menu.\r\n var maxHeight = ch;\r\n // Fetch common variables.\r\n var node = submenu.node;\r\n var style = node.style;\r\n // Clear the menu geometry and prepare it for measuring.\r\n style.top = '';\r\n style.left = '';\r\n style.width = '';\r\n style.height = '';\r\n style.visibility = 'hidden';\r\n style.maxHeight = maxHeight + \"px\";\r\n // Attach the menu to the document.\r\n widget_1.Widget.attach(submenu, document.body);\r\n // Measure the size of the menu.\r\n var _a = node.getBoundingClientRect(), width = _a.width, height = _a.height;\r\n // Compute the box sizing for the menu.\r\n var box = domutils_1.ElementExt.boxSizing(submenu.node);\r\n // Get the bounding rect for the target item node.\r\n var itemRect = itemNode.getBoundingClientRect();\r\n // Compute the target X position.\r\n var x = itemRect.right - Private.SUBMENU_OVERLAP;\r\n // Adjust the X position to fit on the screen.\r\n if (x + width > px + cw) {\r\n x = itemRect.left + Private.SUBMENU_OVERLAP - width;\r\n }\r\n // Compute the target Y position.\r\n var y = itemRect.top - box.borderTop - box.paddingTop;\r\n // Adjust the Y position to fit on the screen.\r\n if (y + height > py + ch) {\r\n y = itemRect.bottom + box.borderBottom + box.paddingBottom - height;\r\n }\r\n // Update the position of the menu to the computed position.\r\n style.top = Math.max(0, y) + \"px\";\r\n style.left = Math.max(0, x) + \"px\";\r\n // Finally, make the menu visible on the screen.\r\n style.visibility = '';\r\n }", "title": "" }, { "docid": "8ecb63814579be646986d27a2f3b7897", "score": "0.60857683", "text": "function openSubmenu(submenu, itemNode) {\r\n // Ensure the menu is updated before opening.\r\n messaging_1.MessageLoop.sendMessage(submenu, widget_1.Widget.Msg.UpdateRequest);\r\n // Get the current position and size of the main viewport.\r\n var px = window.pageXOffset;\r\n var py = window.pageYOffset;\r\n var cw = document.documentElement.clientWidth;\r\n var ch = document.documentElement.clientHeight;\r\n // Compute the maximum allowed height for the menu.\r\n var maxHeight = ch;\r\n // Fetch common variables.\r\n var node = submenu.node;\r\n var style = node.style;\r\n // Clear the menu geometry and prepare it for measuring.\r\n style.top = '';\r\n style.left = '';\r\n style.width = '';\r\n style.height = '';\r\n style.visibility = 'hidden';\r\n style.maxHeight = maxHeight + \"px\";\r\n // Attach the menu to the document.\r\n widget_1.Widget.attach(submenu, document.body);\r\n // Measure the size of the menu.\r\n var _a = node.getBoundingClientRect(), width = _a.width, height = _a.height;\r\n // Compute the box sizing for the menu.\r\n var box = domutils_1.ElementExt.boxSizing(submenu.node);\r\n // Get the bounding rect for the target item node.\r\n var itemRect = itemNode.getBoundingClientRect();\r\n // Compute the target X position.\r\n var x = itemRect.right - Private.SUBMENU_OVERLAP;\r\n // Adjust the X position to fit on the screen.\r\n if (x + width > px + cw) {\r\n x = itemRect.left + Private.SUBMENU_OVERLAP - width;\r\n }\r\n // Compute the target Y position.\r\n var y = itemRect.top - box.borderTop - box.paddingTop;\r\n // Adjust the Y position to fit on the screen.\r\n if (y + height > py + ch) {\r\n y = itemRect.bottom + box.borderBottom + box.paddingBottom - height;\r\n }\r\n // Update the position of the menu to the computed position.\r\n style.top = Math.max(0, y) + \"px\";\r\n style.left = Math.max(0, x) + \"px\";\r\n // Finally, make the menu visible on the screen.\r\n style.visibility = '';\r\n }", "title": "" }, { "docid": "8ecb63814579be646986d27a2f3b7897", "score": "0.60857683", "text": "function openSubmenu(submenu, itemNode) {\r\n // Ensure the menu is updated before opening.\r\n messaging_1.MessageLoop.sendMessage(submenu, widget_1.Widget.Msg.UpdateRequest);\r\n // Get the current position and size of the main viewport.\r\n var px = window.pageXOffset;\r\n var py = window.pageYOffset;\r\n var cw = document.documentElement.clientWidth;\r\n var ch = document.documentElement.clientHeight;\r\n // Compute the maximum allowed height for the menu.\r\n var maxHeight = ch;\r\n // Fetch common variables.\r\n var node = submenu.node;\r\n var style = node.style;\r\n // Clear the menu geometry and prepare it for measuring.\r\n style.top = '';\r\n style.left = '';\r\n style.width = '';\r\n style.height = '';\r\n style.visibility = 'hidden';\r\n style.maxHeight = maxHeight + \"px\";\r\n // Attach the menu to the document.\r\n widget_1.Widget.attach(submenu, document.body);\r\n // Measure the size of the menu.\r\n var _a = node.getBoundingClientRect(), width = _a.width, height = _a.height;\r\n // Compute the box sizing for the menu.\r\n var box = domutils_1.ElementExt.boxSizing(submenu.node);\r\n // Get the bounding rect for the target item node.\r\n var itemRect = itemNode.getBoundingClientRect();\r\n // Compute the target X position.\r\n var x = itemRect.right - Private.SUBMENU_OVERLAP;\r\n // Adjust the X position to fit on the screen.\r\n if (x + width > px + cw) {\r\n x = itemRect.left + Private.SUBMENU_OVERLAP - width;\r\n }\r\n // Compute the target Y position.\r\n var y = itemRect.top - box.borderTop - box.paddingTop;\r\n // Adjust the Y position to fit on the screen.\r\n if (y + height > py + ch) {\r\n y = itemRect.bottom + box.borderBottom + box.paddingBottom - height;\r\n }\r\n // Update the position of the menu to the computed position.\r\n style.top = Math.max(0, y) + \"px\";\r\n style.left = Math.max(0, x) + \"px\";\r\n // Finally, make the menu visible on the screen.\r\n style.visibility = '';\r\n }", "title": "" }, { "docid": "0ad7dedafa015e2c082226ccb3f1b9ce", "score": "0.6078302", "text": "_createSubmenuButtons() {\n [...this.submenus].forEach((element) => {\n let anchor = element.getElementsByTagName('a')[0];\n let submenu = element.getElementsByTagName('ul')[0];\n let submenuToggle = document.createElement('button');\n let id = `submenu-${this._createUUID()}`;\n let submenuToggleText = this.options.openSubmenuText;\n let submenuToggleIcon = this.options.submenuToggleOpenIcon;\n\n // Add our new unique ID as an ID to the submenu\n submenu.setAttribute('id', id);\n\n // Add our new unique ID to match up with the button.\n submenuToggle.setAttribute('aria-controls', id);\n\n // Set aria-expanded to false by default.\n submenuToggle.setAttribute('aria-expanded', false);\n\n // Add class to button.\n submenuToggle.classList.add(this.options.submenuToggleClass);\n\n // Add icon to button - temporary to help visualise\n submenuToggle.innerHTML = `<span class=\"${this.options.screenReaderClass}\">${submenuToggleText}</span>${submenuToggleIcon}`;\n\n // Add our new button after the anchor.\n anchor.after(submenuToggle);\n });\n }", "title": "" }, { "docid": "ce4f711402243847f61b073f33ca0e98", "score": "0.60558575", "text": "function addToNav(){\n let newElm = document.createElement('li');\n newElm.innerHTML=`<li>\n <a class=\"menu__link\" href=\"#section${idOfSection}\" > Section ${idOfSection}</a>\n </li>` /* set innerhtml and link this item with its section */\n parentNav.appendChild(newElm); // append the new section \n}", "title": "" }, { "docid": "57f1f5e6080998b40f6ae8c816740350", "score": "0.6033246", "text": "function logick_menu_item(name,onclick)\n{\n return menubar_Item(name,onclick,\"element-aktions\");\n}", "title": "" }, { "docid": "37b1683bd1981627597246b9fb00f0dc", "score": "0.60252005", "text": "function addMenu(id, request) {\n var carte = cartes[getCarte(id)];\n if (carte.menu === undefined) {\n carte[\"menu\"] = [];\n var menu = request.body;\n menu.id = parseInt(id + \"\" + 0);\n carte[\"menu\"][0] = menu;\n } else {\n var tailleMenu = carte.menu.length;\n var menu = request.body;\n menu.id = parseInt(id + \"\" + tailleMenu);\n carte.menu.push(menu);\n }\n}", "title": "" }, { "docid": "c0992346c47962cd8294cac7a257d35f", "score": "0.60244894", "text": "addItem(x, y, item) {\r\n this.rootBin.addItem(new QuadTreeItem(x, y, item));\r\n }", "title": "" }, { "docid": "7a21e91caadd13d4f69b5ea975ba5a8f", "score": "0.6021273", "text": "function TopLevelMenu(text, href) {\n var newAnchor = document.createElement(\"a\");\n var newLi = document.createElement(\"li\");\n\n newAnchor.href = href;\n newAnchor.appendChild(document.createTextNode(text));\n newLi.appendChild(newAnchor);\n\n this.li = newLi;\n}", "title": "" }, { "docid": "7feef8f68cbcbc89f17896cf74614e7b", "score": "0.60033804", "text": "function createMenu(menuItem, num) {\r\n\tvar name = 0, className = 1, ref = 2;\r\n\t\r\n\tif (menuItem[className] == \"none\") {\r\n\t\tvar list = document.createElement(\"li\");\r\n\t\tlist.id = \"list\" + num;\r\n\t\tvar anchor = document.createElement(\"a\");\r\n\t\tanchor.href = menuItem[ref];\r\n\t\tanchor.id = \"anchor\" + num;\r\n\t\tdocument.getElementById(\"menu\").appendChild(list);\r\n\t\tdocument.getElementById(\"list\" + num).appendChild(anchor);\r\n\t\tvar descrip = document.createTextNode(menuItem[name]);\r\n\t\tdocument.getElementById(\"anchor\" + num).appendChild(descrip);\r\n\t} else if (menuItem[className] == \"dropdown\") {\r\n\t\tvar dropdown = document.createElement(\"li\");\r\n\t\tvar divDropdown = document.createElement(\"div\");\r\n\t\tdivDropdown.className = menuItem[className];\r\n\t\tvar dropdownMenu = document.createElement(\"div\");\r\n\t\tdropdownMenu.id = menuItem[className];\r\n\t\tdropdownMenu.className = \"content\";\r\n\t\tvar text = document.createTextNode(menuItem[name]);\r\n\t\tdivDropdown.appendChild(text);\r\n\t\tdropdown.appendChild(divDropdown);\r\n\t\tdocument.getElementById(\"menu\").appendChild(dropdown);\r\n\t\tdivDropdown.appendChild(dropdownMenu);\r\n\t} else {\r\n\t\tfor (var x = 0; x < menuItem.length; x++) {\r\n\t\t\tvar list = document.createElement(\"li\");\r\n\t\t\tvar item = document.createElement(\"a\");\r\n\t\t\tvar itemText = document.createTextNode(menuItem[x]);\r\n\t\t\tx++;\r\n\t\t\titem.href = menuItem[x];\r\n\t\t\titem.appendChild(itemText);\r\n\t\t\tlist.appendChild(item);\r\n\t\t\tdocument.getElementsByClassName(\"content\")[content].appendChild(list);\r\n\t\t}\r\n\t\tcontent++;\r\n\t}\r\n}", "title": "" }, { "docid": "c56f09d01b54c7701c3d40cf71b479be", "score": "0.60030216", "text": "function createItem(target, div, options){\r\n\t\tvar item = $(div);\r\n\t\tvar itemOpts = $.extend({}, $.parser.parseOptions(item[0], ['id','name','iconCls','href',{separator:'boolean'}]), {\r\n\t\t\tdisabled: (item.attr('disabled') ? true : undefined),\r\n\t\t\ttext: $.trim(item.html()),\r\n\t\t\tonclick: item[0].onclick\r\n\t\t}, options||{});\r\n\t\titemOpts.onclick = itemOpts.onclick || itemOpts.handler || null;\r\n\t\titem.data('menuitem', {\r\n\t\t\toptions: itemOpts\r\n\t\t});\r\n\t\tif (itemOpts.separator){\r\n\t\t\titem.addClass('menu-sep');\r\n\t\t}\r\n\t\tif (!item.hasClass('menu-sep')){\r\n\t\t\titem.addClass('menu-item');\r\n\t\t\titem.empty().append($('<div class=\"menu-text\"></div>').html(itemOpts.text));\r\n\t\t\tif (itemOpts.iconCls){\r\n\t\t\t\t$('<div class=\"menu-icon\"></div>').addClass(itemOpts.iconCls).appendTo(item);\r\n\t\t\t}\r\n\t\t\tif (itemOpts.id){\r\n\t\t\t\titem.attr('id', itemOpts.id);\r\n\t\t\t}\r\n\t\t\tif (itemOpts.onclick){\r\n\t\t\t\tif (typeof itemOpts.onclick == 'string'){\r\n\t\t\t\t\titem.attr('onclick', itemOpts.onclick);\r\n\t\t\t\t} else {\r\n\t\t\t\t\titem[0].onclick = eval(itemOpts.onclick);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (itemOpts.disabled){\r\n\t\t\t\tsetDisabled(target, item[0], true);\r\n\t\t\t}\r\n\t\t\tif (item[0].submenu){\r\n\t\t\t\t$('<div class=\"menu-rightarrow\"></div>').appendTo(item);\t// has sub menu\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "ec9d64b62316d141c3e39e285fe73927", "score": "0.5990729", "text": "function submenu(){\n \n //Generate the submenu\n //Header\n var nameText = document.getElementById(\"d1\");\n nameText.innerHTML=\"<p class='blinky'>Player \"+myPlayer.name+\" selected</p><br>\";\n\n //Options\n var editName= document.getElementById(\"d2\");\n var deletePlayer= document.getElementById(\"d3\");\n var play= document.getElementById(\"d4\");\n \n editName.innerHTML=\"<a href='#' onclick='#' onmouseover='this.style.color='#FF4500'' onmouseout='this.style.color='white'' >Edit name</a>\";\n deletePlayer.innerHTML=\"<br>\"+\"<a href='javascript:deletePlayer();'>Delete player</a>\";\n play.innerHTML=\"<br>\"+\"<a href='#' onclick='#'>Play Game</a>\"; \n}", "title": "" }, { "docid": "97d43004e43df212313f73150f074792", "score": "0.59596545", "text": "_handleAddItem(e) {\n this.addItem(e.detail);\n }", "title": "" }, { "docid": "5e3b8d342f98dd8cfae1058157485983", "score": "0.5941774", "text": "function mcom_addMenu(name) {\n\tvar menu;\n\ttry {\n\t\tmenu = new MenuContainer(name, this);\n\t} catch(exception) {\n\t\tthrow exception;\t// Re-throw exception to user\n\t}\n\n\tthis.menus[name] = menu;\t// Make the menu accessable with its name\n\t\n\treturn menu;\n}", "title": "" }, { "docid": "9d36f3086727db1d4023ef1f77c8aa0d", "score": "0.5932561", "text": "function popUpSubMenu(menuItemObj) { // Private method\n var parentMenuObj = menuItemObj.parent.menuObj;\n var menuObj = menuItemObj.subMenu.menuObj;\n var x;\n var y;\n if (parentMenuObj.style.position == \"fixed\") {\n x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, brw);\n y = parentMenuObj.offsetTop + menuItemObj.offsetTop + getPropIntVal(parentMenuObj, btw) - getPropIntVal(menuObj, btw);\n menuObj.style.position = \"absolute\";\n menuObj.style.left = getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + px;\n menuObj.style.top = getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + px;\n menuObj.style.position = \"fixed\";\n }\n else {\n if (parentMenuObj.mode == \"static\" && !ie50) {\n x = menuItemObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, blw) - getPropIntVal(parentMenuObj, brw) - getScrollLeft();\n y = menuItemObj.offsetTop - getPropIntVal(menuObj, btw) - getScrollTop();\n if (ie55 || ie6) {\n x += getPropIntVal(parentMenuObj, blw);\n y += getPropIntVal(parentMenuObj, btw);\n }\n if (safari) {\n x += 8;\n y += getPropIntVal(menuObj, btw) + 13;\n }\n menuObj.style.left = (getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + getScrollLeft()) + px;\n menuObj.style.top = (getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + getScrollTop()) + px;\n }\n else {\n x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth - getPropIntVal(parentMenuObj, brw) - getScrollLeft();\n y = parentMenuObj.offsetTop + menuItemObj.offsetTop + getPropIntVal(parentMenuObj, btw) - getPropIntVal(menuObj, btw) - getScrollTop();\n menuObj.style.left = (getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + getScrollLeft()) + px;\n menuObj.style.top = (getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight) + getScrollTop()) + px;\n }\n }\n if (ie && menuObj.mode == \"fixed\") {\n menuObj.initialLeft = parseInt(menuObj.style.left) - getScrollLeft();\n menuObj.initialTop = parseInt(menuObj.style.top) - getScrollTop();\n }\n menuObj.style.visibility = \"visible\";\n}", "title": "" }, { "docid": "f1055fa9da7c840b984af4befecbe271", "score": "0.5930626", "text": "function addMenuItem()\n {\n document.getElementById(\"menu-add\").style.display = \"block\";\n document.getElementById(\"menu-add-button\").style.display = \"none\";\n document.getElementById(\"refresh-menu-button\").style.display = \"none\";\n }", "title": "" }, { "docid": "3e75f06c7b48acbaf36d78d56ceeb987", "score": "0.5929791", "text": "function makeMenuFromJson(jsonObject) {\n\t\t\t\n\t\t\tdocument.getElementById(jsonObject.id).appendChild(menu);\n\t\t\tdocument.getElementById(jsonObject.id).addEventListener('contextmenu', onContextMenu, false);\n\t\t\t\n\t\t\tvar listEl = document.getElementById(menu.id);\t\n\t\t\tmakeMenu(jsonObject.menu,listEl);\n\t\t}", "title": "" }, { "docid": "03bd2eee4c83a44f5f6807226fc3f6e8", "score": "0.5928077", "text": "_createChildElements() {\n this.dom.menuItems.forEach((element) => {\n let menuItem;\n\n if (this.dom.submenuItems.includes(element)) {\n // The menu's toggle controller DOM element.\n const toggler = element.querySelector(this.selectors.submenuToggles);\n // The actual menu DOM element.\n const submenu = element.querySelector(this.selectors.submenus);\n\n // Create the new menu and initialize it.\n const menu = new this._MenuType({\n menuElement: submenu,\n menuItemSelector: this.selectors.menuItems,\n menuLinkSelector: this.selectors.menuLinks,\n submenuItemSelector: this.selectors.submenuItems,\n submenuToggleSelector: this.selectors.submenuToggles,\n submenuSelector: this.selectors.submenus,\n openClass: this.openClass,\n closeClass: this.closeClass,\n isTopLevel: false,\n parentMenu: this,\n hoverType: this.hoverType,\n hoverDelay: this.hoverDelay,\n });\n\n // Create the new menu toggle.\n const toggle = new this._MenuToggleType({\n menuToggleElement: toggler,\n parentElement: element,\n controlledMenu: menu,\n parentMenu: this,\n });\n\n // Add the toggle to the list of toggles.\n this._elements.submenuToggles.push(toggle);\n\n // Create a new menu item.\n menuItem = new this._MenuItemType({\n menuItemElement: element,\n menuLinkElement: toggler,\n parentMenu: this,\n isSubmenuItem: true,\n childMenu: menu,\n toggle,\n });\n } else {\n const link = element.querySelector(this.selectors.menuLinks);\n\n // Create a new menu item.\n menuItem = new this._MenuItemType({\n menuItemElement: element,\n menuLinkElement: link,\n parentMenu: this,\n });\n }\n\n this._elements.menuItems.push(menuItem);\n });\n }", "title": "" }, { "docid": "9e01e3cf28c0c8cf49eebaac90978ce2", "score": "0.5923442", "text": "function initItems() {\n // console.log('=====> SideMenu =====> initItems');\n $('#add-furniture, #add-device').find('.add-item').mousedown(function (e) {\n const modelUrl = $(this).attr('model-url');\n const itemType = parseInt($(this).attr('model-type'));\n const metadata = {\n itemName: $(this).attr('model-name'),\n resizable: true,\n modelUrl: modelUrl,\n itemType: itemType,\n modelCode: $(this).attr('model-code')\n };\n\n blueprint3d.model.scene.addItem(itemType, modelUrl, metadata);\n setCurrentState(scope.states.DEFAULT);\n });\n }", "title": "" }, { "docid": "25829e99ef7aae6a548913d6f99e6209", "score": "0.5917796", "text": "function addToCart(menuItem) {\n let menuArray = []\n restaurant.menu.forEach(current => {\n menuArray = [...menuArray, ...current.items]\n })\n const itemToAdd = menuArray.find(item => item.name === menuItem.value)\n cart.push(itemToAdd);\n displayCartItemsInTopBar();\n}", "title": "" }, { "docid": "3efd64fc3e016035467043d1446008b8", "score": "0.5917271", "text": "function createMenuItem(name, price, type) {\n var newItem = {\n name: name,\n price: price,\n type: type,\n }\n return newItem;\n}", "title": "" }, { "docid": "2639bf19a559c769fc44a9b3299ef212", "score": "0.5894104", "text": "function addNavItem(item) {\n\t _reactor2.default.dispatch(_actionTypes.ADD_NAV_ITEM, item);\n\t}", "title": "" }, { "docid": "566102b0ddbc8041a238e4e11ad0de80", "score": "0.5888881", "text": "getSubmenuId() {\n return 'submenu-' + this.submenuIndex++;\n }", "title": "" }, { "docid": "8c33623630229e823d304930e99f3cc3", "score": "0.5886142", "text": "function menuitemCreate(input) {\n var menuitemHash = commit(\"menuitem\", input.menuitemEntry);\n // Link from menuitem to business\n commit(\"itemLink\", { Links: [{ Base: menuitemHash, Link: input.businessHash, Tag: \"menuitem\" }] });\n // Link from business to menuitem\n commit(\"businessLink\", { Links: [{ Base: input.businessHash, Link: menuitemHash, Tag: \"menuitem\" }] });\n return menuitemHash;\n}", "title": "" }, { "docid": "ae42c34982f5d61db0035209080cdcd5", "score": "0.588532", "text": "function add_item(value){\n\t\t\tvar item_list = document.getElementById('item_list');\n\t\t\n\t\t\tvar new_list_item = document.createElement('li');\n\t\t\tnew_list_item.className += \"list_item\";\n\t\t\tvar new_delete = document.createElement('a');\n\t\t\tnew_delete.className += \"delete_link\";\n\t\t\tnew_delete.textContent =\"delete\";\n\t\t\tnew_delete.onclick = function(){\n\t\t\t\tvar parent = this.parentNode;\n\t\t\t\tvar grand_parent = parent.parentNode;\n\t\t\t\tgrand_parent.removeChild(parent);\n\t\t\t\tupdate_json();\n\t\t\t};\n\n\t\t\tvar new_item = document.createElement('div');\n\t\t\tnew_item.className += 'item';\n\t\t\tnew_item.textContent = value;\n\t\t\tnew_list_item.appendChild(new_item);\n\t\t\tnew_list_item.appendChild(new_delete);\n\t\t\titem_list.appendChild(new_list_item);\n\t\t\tadd_json(value);\n\n\n\t}", "title": "" }, { "docid": "6d1493eb52b2596ccd84cc249a5cb494", "score": "0.58803475", "text": "function add_menu_item_row( target, menu_title, menu_status, menu_id , type, parent_title){\n if (menu_title == ''){\n menu_title = '-';\n }\n target.append(\n \"<tr class='list_row'>\" +\n \"<td>\" + menu_id + \" <input type='hidden' name='menu_item_ids[]' value='\" + menu_id + \"'></td>\" +\n \"<td>\" + menu_title + \" </td>\" +\n \"<td>\" + parent_title + \" </td>\" +\n \"<td>\" + type + \" </td>\" +\n \"<td>\" + menu_status + \"</td>\" +\n \"<td>\" +\n \"<a href='#' data-id='\"+menu_id+\"' class='btn btn-sm btn-success edit_menu_item'>ویرایش</a>\" +\n \"<a href='#' data-id='\"+menu_id+\"' class='btn btn-sm btn-danger delete_menu_item ml-lg-1'>حذف</a>\" +\n \"</td>\" +\n \"</tr>\"\n );\n}", "title": "" }, { "docid": "ff8e9d55b3fa817d8bea2b2b87f1fc68", "score": "0.58545905", "text": "function makeMenus() { }", "title": "" }, { "docid": "ebeea7ef1b69bd10f2f7c7e87cd58db0", "score": "0.58414143", "text": "addImageItems(menu, menuInfo) {\n let copyImage = new MenuItem({\n label: this.stringTable.copyImage(),\n click: () => this.convertImageToBase64(menuInfo.srcURL,\n (dataURL) => clipboard.writeImage(nativeImage.createFromDataURL(dataURL)))\n });\n\n menu.append(copyImage);\n\n let copyImageUrl = new MenuItem({\n label: this.stringTable.copyImageUrl(),\n click: () => clipboard.writeText(menuInfo.srcURL)\n });\n\n menu.append(copyImageUrl);\n return menu;\n }", "title": "" }, { "docid": "846d84f5bd0fe3cc7f400f0cb9047132", "score": "0.58313316", "text": "function init(target, data) {\r\n\t\t\t$.each(data, function(i, item) {\r\n\t\t\t\tvar li = $('<li></li>');\r\n\t\t\t\tvar a = $('<a></a>');\r\n\t\t\t\tvar icon = $('<i></i>');\r\n\t\t\t\t// icon.addClass('glyphicon');\r\n\t\t\t\ticon.addClass(item.icon);\r\n\t\t\t\tvar text = $('<span></span>');\r\n\t\t\t\ttext.addClass('menu-text').text(item.text);\r\n\t\t\t\ta.append(icon);\r\n\t\t\t\ta.append(text);\r\n\t\t\t\tif (item.menus && item.menus.length > 0) {\r\n\t\t\t\t\ta.attr('href', '#');\r\n\t\t\t\t\ta.addClass('dropdown-toggle');\r\n\t\t\t\t\tvar arrow = $('<b></b>');\r\n\t\t\t\t\tarrow.addClass('arrow').addClass('icon-angle-down');\r\n\t\t\t\t\ta.append(arrow);\r\n\t\t\t\t\tli.append(a);\r\n\t\t\t\t\tvar menus = $('<ul></ul>');\r\n\t\t\t\t\tmenus.addClass('submenu');\r\n\t\t\t\t\tinit(menus, item.menus);\r\n\t\t\t\t\tli.append(menus);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar href = 'javascript:addTabs({id:\\'' + item.id\r\n\t\t\t\t\t\t\t+ '\\',title: \\'' + item.text\r\n\t\t\t\t\t\t\t+ '\\',close: true,url: \\'' + item.url\r\n\t\t\t\t\t\t\t+ '\\',icon:\\'' + item.icon + '\\'});';\r\n\t\t\t\t\ta.attr('href', href);\r\n\t\t\t\t\t// if (item.istab)\r\n\t\t\t\t\t// a.attr('href', href);\r\n\t\t\t\t\t// else {\r\n\t\t\t\t\t// a.attr('href', item.url);\r\n\t\t\t\t\t// a.attr('title', item.text);\r\n\t\t\t\t\t// a.attr('target', '_blank')\r\n\t\t\t\t\t// }\r\n\t\t\t\t\tli.append(a);\r\n\t\t\t\t}\r\n\t\t\t\ttarget.append(li);\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "0e4eae926da985e8791d21a49dcd363e", "score": "0.58179754", "text": "function iconic_menu_item(name, props) {\n var menu = document.createElement('span');\n menu.id = 'assistant_menu_' + name;\n menu.className = 'assistantMenu';\n var icon = document.createElement('span');\n icon.className = 'assistantIcon';\n icon.innerHTML = props.icon || '';\n var label = document.createTextNode(i18n[name].label || name);\n menu.appendChild(icon);\n menu.appendChild(label);\n return menu;\n}", "title": "" }, { "docid": "d0370140aeef016e16d2a11b34ecb609", "score": "0.58115137", "text": "function createInstance(){\n return new function(){\n var self = this,\n behaviours = {};\n self.initializeMenu = function(){\n //attach submenu activation handler to declared\n //submenu activators\n $(\".submenu-activator\").click(function(){\n //get the submenu to be activated and call\n //the activation function\n var submenuID = $(this).attr(\"submenu-id\");\n self.showSubmenu(this,submenuID);\n });\n };\n self.showSubmenu = function(activator, submenuID){\n $(activator).addClass(\"active\");\n var submenu = $(\"#\" + submenuID);\n var submenuBehaviour = getSubmenuBehaviour(submenu);\n if(existsBehaviour(submenuBehaviour))\n applyBehaviour(submenuBehaviour,activator,submenu);\n else{\n //TODO : Handle non existent behaviours\n }\n self.toggleSubmenu(activator,submenu);\n };\n self.toggleSubmenu = function(activator, submenu){\n //the submenu is absolute positioned,\n //get the top left corner from the\n //activator page offset\n var submenuX = $(activator).parent(\"li\").offset().left,\n submenuY = $(activator).parent(\"li\").offset().top,\n submenuW = $(activator).parent(\"li\").width();\n var hidden = $(submenu).hasClass(\"submenu-hidden\"),\n closing = !hidden;\n //submenu toggle\n $(submenu)\n .css(\"left\",submenuX + submenuW)\n .css(\"top\",(submenuY-1))\n .removeClass(((hidden)?\"submenu-hidden\":\"submenu-visible\"))\n .addClass((hidden)?\"submenu-visible\":\"submenu-hidden\");\n //if the submenu is in closing, detach all handlers\n if(closing){\n $(submenu).children(\"li\").unbind(\"click\");\n $(activator).removeClass(\"active\");\n }\n };\n self.registerBehaviour = function(behaviour,handler){\n behaviours[behaviour] = handler;\n };\n self.unregisterBehaviour = function(behaviour){\n delete behaviours[behaviour];\n };\n function existsBehaviour(behaviour){\n return behaviours.hasOwnProperty(behaviour);\n };\n function getSubmenuBehaviour(submenu){\n var behaviourID = $(submenu).attr(\"submenu-behaviour\");\n return (behaviourID === undefined ||\n behaviourID === '' ||\n behaviourID === 'defaultBehaviour')?\n 'defaultBehaviour': behaviourID;\n }\n function applyBehaviour(behaviour,activator,submenu){\n return behaviours[behaviour](self,activator,submenu);\n };\n };\n }", "title": "" }, { "docid": "ca5aa72d1164f33681e74c66214be1c8", "score": "0.58088875", "text": "function createMenu (id, obj) {\n var title = obj[id].short\n\n chrome.contextMenus.create({\n 'id': id.toString(),\n 'parentId': 'clipboard',\n 'title': title + ' ...',\n 'contexts': ['all']\n })\n}", "title": "" }, { "docid": "26f7a69404e96f2c0bf821c3a9772384", "score": "0.58038175", "text": "_setupSubmenus() {\n this._anchors.each((i, anchor) => {\n anchor = $(anchor);\n // check if anchor.data('processed') is false\n // check if anchor.data('function')\n // anchor click bind event handler\n // inject ul\n // if anchor has data-processed attribute set to false, set it to true\n if (anchor.data('submenu-processed') === undefined) {\n\n //process the anchor to see if it has dynamic source for its submenu\n this._processDynamicAnchor(anchor);\n\n // check if there's a ul sibling next to anchor\n if (anchor.next('ul').length) {\n // prevent default behaviour (use link just to navigate)\n anchor.click(function (ev) {\n ev.preventDefault();\n });\n\n // add `before` and `after` text\n let anchorTitle = anchor.html();\n anchor.html(\n this.options.submenuLinkBefore +\n anchorTitle +\n this.options.submenuLinkAfter\n );\n\n // add a back button\n if (this.options.showBackLink) {\n let backLink = $(\n '<a href class=\"slide-menu-control\" data-action=\"back\">' +\n anchorTitle +\n '</a>'\n );\n\n backLink.html(\n this.options.backLinkBefore +\n backLink.html() +\n this.options.backLinkAfter\n );\n anchor.next('ul').prepend($('<li>').append(backLink));\n }\n }\n //mark this anchor as processed so it doesn't get set again on update\n anchor.data('submenu-processed', true);\n }\n });\n }", "title": "" }, { "docid": "921ada0042f14c2d6b2bf796ace72592", "score": "0.5803264", "text": "addItem() : Object {\n\t\tlet id = this.getItems().length;\n\t\treturn HomeDispatcher.handleView({ type: 'addItem', id: id, content: `Item ${id.toString()}` });\n\t}", "title": "" }, { "docid": "fa1765583a324fec9f2548eebaf92b4d", "score": "0.57955533", "text": "function addObjectToTree(treeItem, item) {\n\n\t \tvar objectItem = new DataItem(item);\n\t \tobjectItem.sourceType = treeItem.type;\n\t \tobjectItem.sourceId = treeItem.id;\n\t \tvar currentTreeItem = doc[treeItem.type][treeItem.id];\n\t \tdoc.addItem(objectItem);\n\t \tcurrentTreeItem.addItem({\n\t \t\tsourceType: treeItem.type,\n\t \t\tsourceId: treeItem.id,\n\t \t\tobjectId: objectItem.id \n\t \t});\n\t }", "title": "" }, { "docid": "93bab4973921b688fb8a00909e58fb88", "score": "0.57819265", "text": "function addMenuBar(win) {\n\twin.menu = new gui.Menu({ type: \"menubar\" });\n\tvar fileMenu = new gui.MenuItem({\n\t label: \"File\",\n\t submenu: new gui.Menu()\n\t});\n\twin.menu.insert(fileMenu,1);\n\tfileMenu.submenu.append(new gui.MenuItem({\n\t label: \"New\",\n\t click: function () {\n\t \talert(\"New!!!!\")\n\t }\n\t}));\n\tfileMenu.submenu.append(new gui.MenuItem({\n\t type: \"separator\"\n\t}));\n\tfileMenu.submenu.append(new gui.MenuItem({\n\t label: \"Close\",\n\t click: function () {\n\t win.close();\n\t }\n\t}));\n\tvar developerMenu = new gui.MenuItem({\n\t label: \"Developer\",\n\t submenu: new gui.Menu()\n\t});\n\twin.menu.append(developerMenu);\n\tdeveloperMenu.submenu.append(new gui.MenuItem({\n\t label: \"Developer Tools\",\n\t click: function () {\n\t \tif(currentWindow) {\n\t\t \tcurrentWindow.showDevTools();\n\t \t}\n\t }\n\t}));\n}", "title": "" }, { "docid": "b1565bf50e51c5c8291c0f0e8c642e23", "score": "0.577627", "text": "function menuItem() { // Public method\n this.displayText = arguments[0];\n if (this.displayText == \"-\") {\n this.id = \"menuSep\" + (++sepCount);\n this.className = sepClassName;\n }\n else {\n this.id = \"menuItem\" + (++menuItemCount);\n this.className = menuItemClassName;\n }\n this.itemName = \"\";\n this.actionOnClick = \"\";\n this.enabled = true;\n this.classNameOver = menuItemClassNameOver;\n this.sepClassName = sepClassName;\n var len = arguments.length;\n if (len > 1 && arguments[1].length > 0) {\n this.itemName = arguments[1];\n }\n if (len > 2 && arguments[2].length > 0) {\n this.actionOnClick = arguments[2];\n }\n if (len > 3 && typeof(arguments[3]) == \"boolean\") {\n this.enabled = arguments[3];\n }\n if (len > 4 && arguments[4].length > 0) {\n if (arguments[4] == \"-\") {\n this.className = arguments[4];\n this.sepClassName = arguments[4];\n }\n else {\n this.className = arguments[4];\n }\n }\n if (len > 5 && arguments[5].length > 0) {\n this.classNameOver = arguments[5];\n }\n}", "title": "" }, { "docid": "2c2efb7aee5c0bba1b98ce26e6f5768a", "score": "0.57720745", "text": "createItemSubItem() {\n\t\tconst attributeMap = ApplicationMap.generateAttributeMap(\n\t\t\t'ngcfuFileUploadItemItemSubItem',\n\t\t\t'ngcfuFileUploadItemItemSubItemClassName',\n\t\t\t'ngcfuFileUploadItemItemSubItemText'\n\t\t);\n\n\t\tconst subItem = HTMLElement.tryToCreateHTMLElement(\n\t\t\tthis.attrs,\n\t\t\t'span',\n\t\t\tattributeMap\n\t\t);\n\n\t\tif (subItem !== null) {\n\t\t\tthis.infoElement.appendChild(subItem);\n\t\t}\n\n\t\treturn subItem;\n\t}", "title": "" }, { "docid": "0f0d3ca8ac7c321b1f50b9b7e396ba7b", "score": "0.57702583", "text": "function addMenu(menu){\n menuArray.push(menu);\n}", "title": "" }, { "docid": "8b14b0716b77922badb40db903d9108d", "score": "0.57700443", "text": "addItem (prm) {\n try {\n let ret = super.addItem(prm);\n if (undefined === prm) {\n /* getter */\n return ret;\n }\n /* setter */\n if (true !== mf.func.isComp(prm, 'Accordion')) {\n return;\n }\n \n let fnc = (clk_cmp, clk_evt, clk_prm) => {\n try {\n let itm = clk_prm.item();\n for (let iidx in itm) {\n if (clk_cmp.getId() === itm[iidx].getId()) {\n clk_prm.select(parseInt(iidx));\n }\n }\n } catch (e) {\n console.error(e.stack);\n throw e;\n }\n };\n let acc_chd = prm.child();\n for (let aidx in acc_chd) {\n if (true === mf.func.isComp(acc_chd[aidx], 'MenuItem')) {\n acc_chd[aidx].execOption({\n event : [new Click([fnc, this])],\n });\n }\n }\n } catch (e) {\n console.error(e.stack);\n throw e;\n }\n }", "title": "" }, { "docid": "5f6978404959f57d17039f3b5077e8c2", "score": "0.57655543", "text": "handleNewItemSubmit(item){\n this.props.addMenuItem(item);\n }", "title": "" }, { "docid": "3a430382b4b848a730c37cdbfffc3ca0", "score": "0.5765192", "text": "function amazonas_submenu_option_clicked() {\n\n if(!data_submenu_options[0].options[0].submenu_option_enabled_state){\n\n activeRiverIndex = 0;\n river_submenu_clicked = true;\n\n clearSubmenuEnabledStatus(1);\n clearSubmenuEnabledStatus(2);\n clearSubmenuEnabledStatus(3);\n toggleIconAndTextEnabled(\"amazonas_submenu_option_button\", 0);\n\n reloadMenuOptionsAvailabilityForRiver(1, activeRiverIndex);\n reloadMenuOptionsAvailabilityForRiver(2, activeRiverIndex);\n\n clearMap();\n\n removeDisabledRiverPolygons();\n\n last_disabled_river_removed = 0;\n\n if (window.getComputedStyle(document.getElementById(\"selected-river-description\")).display === \"none\") {\n fadeInElements([\"selected-river-description\"], 350);\n }\n\n document.getElementById(\"selected-river-description-text\").setAttribute(\"data-i18n\", \"amazon-river-description\");\n document.getElementById(\"selected-river-description-text\").innerHTML = $.i18n(\"amazon-river-description\");\n addSinglePolygonToMap(\"data/rivers/Amazon/amazon1987_outline_small.json\", \"\", \"polygon\", amazonas_river_outline_data_layer,amazonasRiverOutlineStyle, zoomAndPanToRiverCenter);\n\n }\n\n}", "title": "" }, { "docid": "c192120c2f906bd0c92aae27ff858e9a", "score": "0.5763224", "text": "function setLeftSubMenuInfo(target, subList) {\n target.html(\"\");\n var targetId = 'option_menu_';\n for (var index in subList) {\n var id = 'option_menu_' + index;\n //$(items).append(\"<li id='option_menu_3' tabindex='0' onfocus=item_focus(true,'option_menu_3'); key='4' disable='none' value='' ></li>\");\n var str = subList[index].dup_lang;\n var content = $('<li id=\"' + id + '\" tabindex = \"0\" onfocus=\\'item_focus(true, \"' + id + '\");\\' key=\"' + str + '\" disable=\"none\" value=\"' + subList[index].value + '\" > ' + cutoffString(str) + '</li>');\n content.appendTo(target);\n }\n\n}", "title": "" }, { "docid": "593fa3c3037dc1c58b26c2209b61fc6f", "score": "0.575898", "text": "function Menu() {\n this.FoodData = [];\n\n//Puts a new item on the menu array\n this.AddFoodItem = function(newFoodItem) {\n this.FoodData.push(newFoodItem);\n }\n}", "title": "" }, { "docid": "f4ca45dc65266990c10e2f11074b5aba", "score": "0.5752939", "text": "addItem(_item) {}", "title": "" }, { "docid": "f1b5bbc4947a06cba028d06bacfba6a3", "score": "0.5740388", "text": "function setupLevelMenu(){\n\n menu1 = new MenuObject(400, -30, instructionsimg, false);\n menu2 = new MenuObject(-400, 00, controlsimg, false);\n menu3 = new MenuObject(00, 30, nextlvlimg, true);\n\n}", "title": "" }, { "docid": "79061f4b41c2de27d1edbfb999808088", "score": "0.5719859", "text": "function addMenuItem(id, text, hint, action, classes, download) {\n\t\t\tlet svg = cse111.createSVG(id, null, hint);\n\t\t\tlet node = document.createTextNode(' ' + text);\n\t\t\tlet item = createElem('li', classes, {title : hint});\n\t\t\tif (typeof(action) == 'function') {\n\t\t\t\titem.appendChild(svg);\n\t\t\t\titem.appendChild(node);\n\t\t\t\titem.addEventListener('click', action);\n\t\t\t}\n\t\t\telse if (typeof(action) == 'string') {\n\t\t\t\tlet anchor = createElem('a', null,\n\t\t\t\t\t\tdownload ?\n\t\t\t\t\t\t{download : '', href : action} : {href : action});\n\t\t\t\tanchor.appendChild(svg);\n\t\t\t\tanchor.appendChild(node);\n\t\t\t\titem.appendChild(anchor);\n\t\t\t}\n\t\t\tul.appendChild(item);\n\t\t}", "title": "" }, { "docid": "2dd09db43e5fc3ae23db7bffaba07d50", "score": "0.57066125", "text": "function loadSubMenu(e, data) {\r\n $(p.mShell).find('.innerMenuWrap').mCustomScrollbar(\"destroy\");\r\n var _html = \"<div class='pSubTopicWrapper pSubMenuTopicHeader'> <div class='pSubTopicName'>Ch 1 : One-Dimensional</div><div class='pChapSeperator'></div><div class='pSubTopicInnerMainWrap'> <div class='pSubTopicInnerWrap'> <div class='pSubTopicName'>Ch 1 : One-Dimensional</div><div class='pChapSeperator'></div></div></div></div>\";\r\n var _subchapWrap = $('.innerMenuWrap')[0];\r\n $(_subchapWrap).html(_html);\r\n var _subchapMain = $('.pSubTopicWrapper')[0];\r\n $('.pSubMenuWrap,.pSubmenuButton').removeClass(\"open\");\r\n $(p.mShell).find(\".pSubTopicWrapper\").removeClass(\"tActive\").not(\":first\").remove();\r\n var temp = p.bookData.chapters[data[\"chap\"]];\r\n for (var i in temp.unit) {\r\n for (var j in temp.unit[i][\"section\"]) {\r\n if (j == 0) {\r\n $(_subchapMain).clone().addClass(\"pSubMenuTopicHeader\").appendTo(_subchapWrap).html()\r\n }\r\n\r\n }\r\n }\r\n $('.pSubTopicName').removeClass(\"pHover\");\r\n $('.pSubTopicWrapper').removeClass(\"pHover\").last().remove();\r\n var _pSubTopicInnerWrap = $('.pSubTopicInnerWrap')[0];\r\n var _pSubTopicInnerMainWrap = $('.pSubTopicInnerMainWrap')[0];\r\n $('.pSubTopicWrapper').each(function (i) {\r\n if (!lessonFlag) {\r\n $(this).find('.pSubTopicName').html(\"<span class='accSysmbol'>+</span> Lesson \" + (Number(i) + 1) + \": \" + temp.unit[i][\"section\"][0][\"SectionTitle\"])\r\n } else {\r\n $(this).find('.pSubTopicName').html(\"<span class='accSysmbol'>+</span> \" + temp.unit[i][\"section\"][0][\"SectionTitle\"])\r\n }\r\n var _mainWrpa = $(this).find('.pSubTopicInnerMainWrap');\r\n for (var j in temp.unit[i][\"section\"]) {\r\n\r\n if (j == 0) {\r\n if (!lessonFlag && !temp.unit[i][\"section\"][j].hasOwnProperty(\"link\")) {\r\n $(_pSubTopicInnerWrap).clone().appendTo(_mainWrpa).attr(\"data-subsection\", 0).attr(\"data-chap\", data[\"chap\"]).attr(\"data-topic\", i).attr(\"data-subtopic\", j).addClass(\"pSubMenuTopic\").find('.pSubTopicName').html(\"Lesson Overview\");\r\n }\r\n } else {\r\n if (!lessonFlag) {\r\n if (temp.unit[i]['section'][j][\"subsection\"].length > 1) {\r\n $(_pSubTopicInnerWrap).clone().appendTo(_mainWrpa).addClass(\"pSubMenuTopicHeader\").addClass(\"child\").attr(\"data-chap\", data[\"chap\"]).attr(\"data-topic\", i).attr(\"data-subtopic\", j).find('.pSubTopicName').html(\"<span class='accSysmbol'>+</span>\" + (i + 1) + \".\" + j + \" \" + temp.unit[i]['section'][j][\"SectionTitle\"]);\r\n } else {\r\n $(_pSubTopicInnerWrap).clone().appendTo(_mainWrpa).addClass(\"pSubMenuTopic\").attr(\"data-chap\", data[\"chap\"]).attr(\"data-subsection\", 0).attr(\"data-topic\", i).attr(\"data-subtopic\", j).find('.pSubTopicName').html((i + 1) + \".\" + j + \" \" + temp.unit[i]['section'][j][\"SectionTitle\"]);\r\n }\r\n } else {\r\n if (temp.unit[i]['section'][j][\"subsection\"].length > 1) {\r\n $(_pSubTopicInnerWrap).clone().appendTo(_mainWrpa).addClass(\"pSubMenuTopicHeader\").addClass(\"child\").attr(\"data-chap\", data[\"chap\"]).attr(\"data-topic\", i).attr(\"data-subtopic\", j).find('.pSubTopicName').html(\"<span class='accSysmbol'>+</span>\" + temp.unit[i]['section'][j][\"SectionTitle\"]);\r\n } else {\r\n $(_pSubTopicInnerWrap).clone().appendTo(_mainWrpa).addClass(\"pSubMenuTopic\").attr(\"data-chap\", data[\"chap\"]).attr(\"data-subsection\", 0).attr(\"data-topic\", i).attr(\"data-subtopic\", j).find('.pSubTopicName').html(temp.unit[i]['section'][j][\"SectionTitle\"]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n $(this).find('.pSubTopicInnerMainWrap .pSubTopicInnerWrap').first().remove();\r\n });\r\n $(p.mShell).find('.pSubTopicInnerWrap.child').each(function () {\r\n var chap, unit, section;\r\n chap = Number($(this).attr(\"data-chap\"));\r\n unit = Number($(this).attr(\"data-topic\"));\r\n section = Number($(this).attr(\"data-subtopic\"));\r\n $(_pSubTopicInnerMainWrap).clone().appendTo($(this));\r\n $(this).find('.pSubTopicInnerMainWrap .pSubTopicInnerWrap').not(\":first\").removeClass(\"child\").remove();\r\n var _mainWrpa = $(this).find('.pSubTopicInnerMainWrap');\r\n for (var i in temp.unit[unit]['section'][section][\"subsection\"]) {\r\n i = Number(i);\r\n var chr = String.fromCharCode(97 + i);\r\n if (!lessonFlag) {\r\n $(_pSubTopicInnerWrap).clone().appendTo(_mainWrpa).addClass(\"pSubMenuTopic\").attr(\"data-chap\", data[\"chap\"]).attr(\"data-topic\", unit).attr(\"data-subtopic\", section).attr('data-subsection', i).find('.pSubTopicName').html((unit + 1) + \".\" + section + \".\" + chr + \" \" + temp.unit[unit]['section'][section][\"subsection\"][i][\"SectionHeading\"]);\r\n } else {\r\n if (section == 1) {\r\n $(_pSubTopicInnerWrap).clone().appendTo(_mainWrpa).addClass(\"pSubMenuTopic\").attr(\"data-chap\", data[\"chap\"]).attr(\"data-topic\", unit).attr(\"data-subtopic\", section).attr('data-subsection', i).find('.pSubTopicName').html(temp.unit[unit]['section'][section][\"subsection\"][i][\"SectionHeading\"]);\r\n } else {\r\n $(_pSubTopicInnerWrap).clone().appendTo(_mainWrpa).addClass(\"pSubMenuTopic\").attr(\"data-chap\", data[\"chap\"]).attr(\"data-topic\", unit).attr(\"data-subtopic\", section).attr('data-subsection', i).find('.pSubTopicName').html(\"Lesson \" + (section - 1) + \".\" + chr + \" \" + temp.unit[unit]['section'][section][\"subsection\"][i][\"SectionHeading\"]);\r\n }\r\n }\r\n }\r\n $(this).find('.pSubTopicInnerMainWrap .pSubTopicInnerWrap').first().remove();\r\n });\r\n $(p.mShell).find('.innerMenuWrap').mCustomScrollbar({\r\n theme: \"dark-3\",\r\n axis: \"y\",\r\n scrollInertia: 0,\r\n mouseWheelPixels: 50,\r\n scrollButtons: {\r\n enable: true\r\n }\r\n });\r\n playerEvent();\r\n }", "title": "" }, { "docid": "36c40713bfa38d1da8dbbee3cdcea031", "score": "0.5704193", "text": "function makeMenu(menuItem) {\r\n\t\tvar menuDiv = document.createElement('div');\r\n\t\tmenuDiv.className = 'ygtvitem';\r\n\t\tvar menuTable = document.createElement('table');\r\n\t\tmenuTable.cellPadding = 0;\r\n\t\tmenuTable.cellSpacing = 0;\r\n\t\tmenuDiv.appendChild(menuTable);\r\n\t\tvar menuTbody = document.createElement('tbody');\r\n\t\tmenuTable.appendChild(menuTbody);\r\n\t\tvar menuTr = document.createElement('tr');\r\n\t\tmenuTbody.appendChild(menuTr);\r\n\r\n\t\tvar parents = [menuItem.depth];\r\n\t\tvar parentMenu = menuItem;\r\n\t\tfor(var i = menuItem.depth; i > 0; i--){\r\n\t\t\tparentMenu = parentMenu.parent;\r\n\t\t\tparents[i-1] = parentMenu;\r\n\t\t}\r\n\t\tif(menuItem.depth > 0){\r\n\t\t\tfor(var i = 0; i < menuItem.depth; i++){\r\n\t\t\t\tvar depthTd = document.createElement('td');\r\n\t\t\t\tif(parents[i].isLast ){\r\n\t\t\t\t\tdepthTd.className = 'ygtvblankdepthcell';\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdepthTd.className = 'ygtvdepthcell';\r\n\t\t\t\t}\r\n\t\t\t\tmenuTr.appendChild(depthTd);\r\n\t\t\t\tvar depthDiv = document.createElement('div');\r\n\t\t\t\tdepthDiv.className = 'ygtvspacer';\r\n\t\t\t\tdepthTd.appendChild(depthDiv);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar lineTd = document.createElement('td');\r\n\t\tlineTd.id = \"i_\" + menuItem.id;\r\n\t\tvar lineDiv = document.createElement('div');\r\n\t\tlineDiv.className = 'ygtvspacer';\r\n\t\t\r\n\t\tvar hasChilds = false;\r\n\t\tlineTd.appendChild(lineDiv);\r\n\t\tmenuTr.appendChild(lineTd);\r\n\t\t\r\n\t\t//var menuLi = document.createElement(\"li\");\r\n\r\n\t\tvar itemTd = document.createElement('td');\r\n\t\titemTd.style.width = \"100%\";\r\n\t\tmenuTr.appendChild(itemTd);\r\n\t\t\r\n\t\tvar divMenuItem = document.createElement(\"div\");\r\n\t\tdivMenuItem.id = \"tc_\" + menuItem.id;\r\n\t\tif ( menuItem.children.length > 0) {\r\n\t\t\tif(menuItem.isLast ){\r\n\t\t\t\tlineTd.className = 'ygtvlp';\r\n\t\t\t}else{\r\n\t\t\t\tlineTd.className = 'ygtvtp';\r\n\t\t\t}\r\n\t\t\tEvent.observe(lineTd, 'click', getClickHandler(lineTd, menuItem), false,\"_sidemenu\");\r\n\t\t\thasChilds = true;\r\n\t\t} else {\r\n\t\t\tif(menuItem.isLast){\r\n\t\t\t\tlineTd.className = 'ygtvln';\r\n\t\t\t}else{\r\n\t\t\t\tlineTd.className = 'ygtvtn';\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar divMenuItemIcon = document.createElement(\"div\");\r\n\t\tdivMenuItemIcon.setAttribute(\"id\", \"ti_\" + menuItem.id);\r\n\t\tif ( menuItem.type ){\r\n//\t\t\tvar handler = IS_SiteAggregationMenu.menuDragInit(menuItem, divMenuItemIcon, divMenuItem);\r\n\t\t\tvar handler = IS_SiteAggregationMenu.getDraggable(menuItem, divMenuItemIcon, divMenuItem,\r\n\t\t\t\tfalse,false,container.parentNode.parentNode );\r\n\t\t\tdivMenuItemIcon.handler = handler;\r\n\t\t\t\r\n\t\t\tIS_Event.observe(itemTd, \"mousedown\", function(e){\r\n\t\t\t\tEvent.stop(e);\r\n\t\t\t}, false, \"_sidemenu\");\t\r\n\r\n\t\t\tvar returnToMenuFunc = IS_SiteAggregationMenu.getReturnToMenuFuncHandler( divMenuItemIcon, menuItem.id, handler );\r\n\t\t\tvar displayTabName = IS_SiteAggregationMenu.getDisplayTabNameHandler( divMenuItemIcon, menuItem.id, handler, returnToMenuFunc, \"_sidemenu\" );\r\n\t\t\t\r\n\t\t\tdivMenuItemIcon.className = \"menuItemIcon\";\r\n\t\t\titemTd.style.cursor = \"move\";\r\n\t\t\tIS_Widget.setIcon(divMenuItemIcon, menuItem.type, {multi:menuItem.multi});\r\n\t\t\t\r\n\t\t\tif(IS_Portal.isChecked(menuItem) && !/true/.test(menuItem.multi)){\r\n\t\t\t\tdivMenuItemIcon.handler.destroy();\r\n\t\t\t\tElement.addClassName(divMenuItemIcon, 'menuItemIcon_dropped');\r\n\t\t\t\tIS_Event.observe(divMenuItemIcon, 'mouseover', displayTabName, false, \"_sidemenu\");\r\n\t\t\t\titemTd.style.cursor = \"default\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// 200-300millsec can be lost as addListener executes new Array.\r\n\t\t\tfunction getPostDragHandler(menuItemId, handler){\r\n\t\t\t\tif( Browser.isSafari1 ) {\r\n\t\t\t\t\t// Fix for display of item dropped by clicking\r\n\t\t\t\t\treturn function() {\r\n\t\t\t\t\t\tvar dummyDiv = menuDiv.cloneNode( true );\r\n\t\t\t\t\t\tvar parentNode = menuDiv.parentNode;\r\n\t\t\t\t\t\tparentNode.replaceChild( dummyDiv,menuDiv );\r\n\t\t\t\t\t\tpostDragHandler( menuItemId );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsetTimeout( function() {\r\n\t\t\t\t\t\t\tparentNode.replaceChild( menuDiv,dummyDiv )\r\n\t\t\t\t\t\t},10 );\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn function(){ postDragHandler(menuItemId, handler);};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfunction postDragHandler(menuItemId, handler){\r\n\t\t\t\t//fix 209 Sometimes the widget that can be dropped plurally is dropped to a tab can not be dropped.\r\n\t\t\t\tif( /true/i.test( menuItem.multi ) )\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\r\n//\t\t\t\tEvent.stopObserving(itemTd, \"mousedown\", handler, false);\r\n\t\t\t\tdivMenuItemIcon.handler.destroy();\r\n\t\t\t\t//$(\"ti_\" + menuItemId).className = (/MultiRssReader/.test(menuItem.type)) ? \"menuItemIcon_multi_rss_gray\" : \"menuItemIcon_rss_gray\";\r\n\r\n\t\t\t\tElement.addClassName(divMenuItemIcon, 'menuItemIcon_dropped');\r\n\t\t\t\t\r\n//\t\t\t\tdivMenuItemIcon.className = (/MultiRssReader/.test(menuItem.type)) ? \"menuItemIcon_multi_rss_gray\" : \"menuItemIcon_rss_gray\";\r\n\t\t\t\titemTd.style.cursor = \"default\";\r\n\t\t\t\t\r\n\t\t\t\tvar divMenuItemParent = divMenuItem.parentNode;\r\n\t\t\t\tvar divMenuItemNextSibling = divMenuItem.nextSibling;\r\n\t\t\t\tdivMenuItemParent.removeChild( divMenuItem );\r\n\t\t\t\tif( divMenuItemNextSibling ) {\r\n\t\t\t\t\tdivMenuItemParent.insertBefore( divMenuItem,divMenuItemNextSibling );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdivMenuItemParent.appendChild( divMenuItem );\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tIS_Event.observe(divMenuItemIcon, 'mouseover', displayTabName, false, \"_sidemenu\");\r\n\t\t\t};\r\n\t\t\tIS_EventDispatcher.addListener('dropWidget', menuItem.id, getPostDragHandler(menuItem.id), true);\r\n\t\t\tif( menuItem.properties && menuItem.properties.url ) {\r\n\t\t\t\tvar url = menuItem.properties.url;\r\n\t\t\t\tIS_EventDispatcher.addListener( IS_Widget.DROP_URL,url,( function( menuItem,handler ) {\r\n\t\t\t\t\t\treturn function( widget ) {\r\n\t\t\t\t\t\t\tif( !IS_Portal.isMenuType( widget,menuItem )) return;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tpostDragHandler(menuItem.id, handler);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})( menuItem,handler ) );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction getCloseWidgetHandler(menuItemId){\r\n\t\t\t\tif( Browser.isSafari1 ) {\r\n\t\t\t\t\treturn function() {\r\n\t\t\t\t\t\tmenuDiv.style.display = \"none\"\r\n\t\t\t\t\t\tcloseWidgetHandler( menuItemId );\r\n\t\t\t\t\t\tmenuDiv.style.display = \"block\"\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn function(){ closeWidgetHandler(menuItemId);};\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfunction closeWidgetHandler(menuItemId){\r\n//\t\t\t\tIS_Event.observe(itemTd, \"mousedown\", handler, false, \"_menu\");\r\n\t\t\t\t/*\r\n\t\t\t\tEvent.observe(handler.handle, \"mousedown\", handler.eventMouseDown,\"_sidemenu\");\r\n\t\t\t\tIS_Draggables.register(handler);\r\n\t\t\t\t*/\r\n\t\t\t\tdivMenuItemIcon.handler = IS_SiteAggregationMenu.getDraggable(menuItem, divMenuItemIcon, divMenuItem,\r\n\t\t\t\t\tfalse,false,container.parentNode.parentNode );\r\n\t\t\t\t\r\n\t\t\t\t//$(\"ti_\" + menuItemId).className = (/MultiRssReader/.test(menuItem.type))? \"menuItemIcon_multi_rss\" : \"menuItemIcon_rss\";\r\n\r\n\t\t\t\tElement.removeClassName(divMenuItemIcon, 'menuItemIcon_dropped');\r\n\t\t\t\t\r\n//\t\t\t\tdivMenuItemIcon.className = (/MultiRssReader/.test(menuItem.type))? \"menuItemIcon_multi_rss\" : \"menuItemIcon_rss\";\r\n\t\t\t\titemTd.style.cursor = \"move\";\r\n\t\t\t\t\r\n\t\t\t\tdivMenuItemIcon.title = \"\";\r\n\t\t\t\tIS_Event.stopObserving(divMenuItemIcon, 'mouseover', displayTabName, false, \"_menu\");\r\n\t\t\t}\r\n\t\t\tIS_EventDispatcher.addListener('closeWidget', menuItem.id, getCloseWidgetHandler(menuItem.id, handler), true);\r\n\t\t\tif( menuItem.properties && menuItem.properties.url ) {\r\n\t\t\t\tvar url = menuItem.properties.url;\r\n\t\t\t\tIS_EventDispatcher.addListener( IS_Widget.CLOSE_URL,url,( function( menuItem,handler ) {\r\n\t\t\t\t\t\treturn function( widget ) {\r\n\t\t\t\t\t\t\tif( !IS_Portal.isMenuType( widget,menuItem )) return;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcloseWidgetHandler(menuItem.id, handler);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})( menuItem,handler ) );\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tdivMenuItemIcon.className = \"treemenuItemIcon_blank\";\r\n\t\t}\r\n\t\t\r\n\t\tdivMenuItem.appendChild(divMenuItemIcon);\r\n\t\t\r\n\t\tvar divMenuTitle = document.createElement(\"div\");\r\n\t\tdivMenuTitle.id = \"t_\" + menuItem.id;\r\n\t\tdivMenuTitle.className = \"treeMenuTitle\";\r\n\t\t\r\n\t\tvar title = menuItem.directoryTitle || menuItem.title;\r\n\t\tif (menuItem.href && !menuItem.linkDisabled) {\r\n\t\t\tvar aTag = document.createElement('a');\r\n\t\t\taTag.href = menuItem.href;\r\n\t\t\taTag.appendChild(document.createTextNode(title));\r\n\t\t\tif(menuItem.display == \"self\") {\r\n\t\t\t\taTag.target = \"_self\";\r\n\t\t\t} else if(menuItem.display == \"newwindow\"){\r\n\t\t\t\taTag.target = \"_blank\";\r\n\t\t\t} else {\r\n\t\t\t\tif(menuItem.display == \"inline\")\r\n\t\t\t\t\taTag.target=\"ifrm\";\r\n\t\t\t\tvar aTagOnClick = function(e){\r\n\t\t\t\t\tIS_Portal.buildIFrame(aTag);\r\n\t\t\t\t}\r\n//\t\t\t\tIS_Event.observe(aTag, \"mousedown\", function(e){Event.stop(e);}, false, \"_sidemenu\");\r\n\t\t\t\tIS_Event.observe(aTag, \"click\", aTagOnClick, false, \"_sidemenu\");\r\n\t\t\t}\r\n\t\t\tIS_Event.observe(aTag, \"mousedown\", function(e){Event.stop(e);}, false, \"_sidemenu\");\r\n\t\t\tdivMenuTitle.appendChild(aTag);\r\n\t\t}else{\r\n\t\t\tdivMenuTitle.appendChild(document.createTextNode(title));\r\n\t\t}\r\n\t\tdivMenuTitle.title = title;\r\n\t\t\r\n\t\tif ( Browser.isIE ) {\r\n\t\t\tdivMenuItem.appendChild(divMenuTitle);\r\n\t\t\tdivMenuItem.style.width = \"100%\";\r\n//\t\t\tdivMenuItem.style.whiteSpace = \"nowrap\";\r\n\t\t\tdivMenuItem.style.wordBreak = \"break-all\";\r\n\t\t} else {\r\n\t\t\tdivMenuTitle.style.height = \"auto\";\r\n\t\t\tvar menuItemTable = document.createElement(\"table\");\r\n\t\t\tmenuItemTable.cellSpacing = \"0\";\r\n\t\t\tmenuItemTable.cellPadding = \"0\";\r\n//\t\t\tmenuItemTable.style.width = \"100%\";\r\n//\t\t\tmenuItemTable.style.whiteSpace = \"nowrap\";\r\n\t\t\tvar tr = document.createElement(\"tr\");\r\n\t\t\tvar td = document.createElement(\"td\");\r\n\t\t\ttd.appendChild(divMenuTitle);\r\n\t\t\t\r\n\t\t\ttr.appendChild(td);\r\n\t\t\tmenuItemTable.appendChild(tr);\r\n\t\t\tdivMenuItem.appendChild(menuItemTable);\r\n\t\t}\r\n\t\titemTd.appendChild(divMenuItem);\r\n\t\t\r\n\t\tif(hasChilds){\r\n\t\t\tvar childList = menuItem.children;\r\n\t\t\tvar hasWidget = false;\r\n\t\t\tfor(var i = 0; i < childList.length ;i++){\r\n\t\t\t\tvar childItem = childList[i];\r\n\t\t\t\tif(childItem.type){\r\n\t\t\t\t\thasWidget = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(hasWidget){\r\n\t\t\t\tvar folderFeedContainer = document.createElement(\"div\");\r\n\t\t\t\t\r\n//\t\t\t\tif(Browser.isIE) // The item is set in wrong position in IE if it is not in between BRs\r\n//\t\t\t\t\tfolderFeedContainer.appendChild(document.createElement(\"br\"));\r\n\t\t\t\t\r\n\t\t\t\tfolderFeedContainer.className = \"multiDropHandle\";\r\n\t\t\t\tfolderFeedContainer.style.display = \"none\";\r\n\t\t\t\t\r\n\t\t\t\tvar headerTable = document.createElement(\"table\");\r\n\t\t\t\theaderTable.cellSpacing = 0;\r\n\t\t\t\theaderTable.cellPadding = 0;\r\n\t\t\t\theaderTable.style.width = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tif(Browser.isIE) headerTable.style.marginBottom = \"2px\";\r\n\t\t\t\t\r\n\t\t\t\tvar headerTbody = document.createElement(\"tbody\");\r\n\t\t\t\tvar headerTr = document.createElement(\"tr\");\r\n\t\t\t\tvar closeTd = document.createElement(\"td\");\r\n\t\t\t\theaderTable.appendChild(headerTbody);\r\n\t\t\t\theaderTbody.appendChild(headerTr);\r\n\t\t\t\tfolderFeedContainer.appendChild(headerTable);\r\n\t\t\t\t\r\n\t\t\t\tvar folderIconTd = document.createElement(\"td\");\r\n\t\t\t\tfolderIconTd.className = \"menufolderfeed\";\r\n\t\t\t\t\r\n\t\t\t\tvar folderIcon = document.createElement(\"img\"); \r\n\t\t\t\tfolderIcon.src = imageURL + \"drop_all.gif\";\r\n\t\t\t\tfolderIconTd.appendChild(folderIcon);\r\n\t\t\t\t\r\n\t\t\t\tvar folderFeedTitleTd = document.createElement(\"td\");\r\n\t\t\t\tfolderFeedTitleTd.className = \"menufolderfeed\";\r\n\t\t\t\tfolderFeedTitleTd.style.width = \"100%\";\r\n\t\t\t\tvar folderFeedTitle = document.createElement(\"div\"); \r\n\t\t\t\t\r\n\t\t\t\tfolderFeedTitle.className = \"menufolderfeedTitle\";\r\n\t\t\t\tfolderFeedTitle.innerHTML = IS_R.lb_dropAll;\r\n\t\t\t\tfolderFeedTitleTd.appendChild(folderFeedTitle);\r\n\t\t\t\t\r\n\t\t\t\theaderTr.appendChild(folderIconTd);\r\n\t\t\t\theaderTr.appendChild(folderFeedTitleTd);\r\n//\t\t\t\tvar dragHandler = IS_SiteAggregationMenu.menuDragInit(menuItem, folderFeedContainer, folderFeedContainer, true, true);\r\n\t\t\t\tIS_SiteAggregationMenu.getMultiDropDraggable(folderFeedContainer, menuItem);\r\n\t\t\t\t\r\n\t\t\t\titemTd.appendChild(folderFeedContainer);\r\n//\t\t\t\tIS_Event.observe(folderFeedContainer,\"mousedown\", dragHandler, false, \"_menu\");\r\n\t\t\t\t/*\r\n\t\t\t\tIS_Event.observe(itemTd,\"mouseover\", getTreeOverHandler(folderFeedContainer, lineTd), false, \"_sidemenu\");\r\n\t\t\t\tIS_Event.observe(itemTd,\"mouseout\", getTreeOutHandler(folderFeedContainer), false, \"_sidemenu\");\r\n\t\t\t\t*/\r\n\t\t\t\t\r\n\t\t\t\tIS_Event.observe(itemTd,\"mouseover\", function(){\r\n\t\t\t\t\tclearTimeout(folderFeedContainer.overTimeout);\r\n\t\t\t\t\tclearTimeout(folderFeedContainer.outTimeout);\r\n\t\t\t\t\tif(lineTd.className == 'ygtvtp' || lineTd.className == 'ygtvlp'){\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdelayDisplay.call(itemTd, folderFeedContainer);\r\n\t\t\t\t\t}\r\n\t\t\t\t}.bind(itemTd), false, \"_sidemenu\");\r\n\t\t\t\t\r\n\t\t\t\tIS_Event.observe(itemTd,\"mouseout\", function(){\r\n\t\t\t\t\tclearTimeout(folderFeedContainer.overTimeout);\r\n\t\t\t\t\tclearTimeout(folderFeedContainer.outTimeout);\r\n\t\t\t\t\tif(!IS_Portal.isItemDragging){\r\n\t\t\t\t\t\tdelayDisplayNone.call(itemTd, folderFeedContainer);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, false, \"_sidemenu\");\r\n\t\t\t\t\r\n\t\t\t\tfunction delayDisplay( div ){\r\n\t\t\t\t\tdiv.overTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tdiv.style.display = \"\";\r\n\t\t\t\t\t}.bind(div), 150);\r\n\t\t\t\t}\r\n\t\t\t\tfunction delayDisplayNone( div ){\r\n\t\t\t\t\tdiv.outTimeout = setTimeout(function(){\r\n\t\t\t\t\t\tdiv.style.display = \"none\";\r\n\t\t\t\t\t}.bind(div), 150);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn menuDiv;\r\n\t}", "title": "" }, { "docid": "14d565a0b26b884051abb753709dd98c", "score": "0.57017386", "text": "function AddRecipeToMenu() {\n console.log('add recipe to menu');\n let e = d.Config.enums;\n let menuTitle = u.ID(\"selectMenuForNewRecipe\").value;\n let mealID = parseInt(u.ID(\"selectMealForMenu\").value);\n let recipeTitle = u.ID(\"selectRecipeForMenu\").value;\n let morv = u.ID(\"selectMorvForMenu\").value;\n console.log(menuTitle);\n console.log(mealID);\n console.log(recipeTitle);\n console.log(morv);\n\n Dict.menus.addRecipe(menuTitle, mealID, recipeTitle, morv);\n u.WriteDict(3);\n RefreshEditMenu();\n u.SetValues([[\"selectMealForMenu\", \"Choose Meal\"], [\"selectRecipeForMenu\", \"Choose Recipe\"], [\"selectMorvForMenu\", \"Choose Morv\"]]);\n}", "title": "" }, { "docid": "40922523bb6a792f5c3fe85eeaeda7f2", "score": "0.5701348", "text": "function BattleMenuItem(params) {\n\tthis.hoverReady = false;\n\n\tfor (var key in params) {\n\t\tif (params.hasOwnProperty(key)) {\n\t\t\tthis[key] = params[key];\n\t\t}\n\t}\n\n\t// console.log(this.name);\n\t// if (name != null && description != null && imageUrl != null && color != null && type != null) {\n\t// \tthis.name = name;\n\t// \tthis.description = description;\n\t// \tthis.imageUrl = imageUrl;\n\t// \tthis.color = color;\n\t// \tthis.type = type;\n\n\tif (this[\"childSet\"] != null) {\n\t\tthis[\"childSet\"].parentItem = this;\n\t}\n\t// else {\n\t// \tthrow new Error(errorHeader + \": Invalid battle menu item parameters.\");\n\t// }\n}", "title": "" }, { "docid": "048e09b76a090448b19f8012c2282e57", "score": "0.5700418", "text": "function addMenuItem(menuItemName, functionName, subMenuName, screenToShow, menuItemKey) {\n if (logLevel >= 4) { logToWorkflow(\"entering addMenuItem()\", \"DEBUG\", false); }\n //first add the item to sup_menuitems\n var div = document.getElementById(screenToShow + \"ScreenDiv\");\n var menuStr = div.getAttribute(\"sup_menuitems\");\n var idxOfMenuItemName = menuStr.indexOf(menuItemName);\n if (idxOfMenuItemName != -1) {\n return;\n }\n var comma = (menuStr.length > 0) ? \",\" : \"\";\n menuStr = menuStr + comma + menuItemName + \",\" + menuItemKey;\n try {\n div.setAttribute(\"sup_menuitems\", menuStr); //has no affect on Windows Mobile\n }\n catch (e) {\n }\n\n var request = \"menuitemname=\" + encodeURIComponent(menuItemName);\n request += (\"&onmenuclick=\" + encodeURIComponent(functionName) + \"()\");\n if (isWindowsMobile()) {\n request += \"&submenuname=\";\n if (subMenuName) {\n request += encodeURIComponent(subMenuName);\n }\n else {\n if (resources) {\n request += encodeURIComponent(resources.getString(\"MENU\"));\n }\n else {\n request += \"Menu\";\n }\n }\n var xmlhttp = getXMLHTTPRequest();\n xmlhttp.open(\"POST\", \"/sup.amp?querytype=addMenuItem&\" + versionURLParam, false);\n xmlhttp.send(request);\n }\n else if (isAndroid()) {\n _WorkflowContainer.postData(\"http://localhost/sup.amp?querytype=addMenuItem&\" + versionURLParam, request);\n } \n else if (isBlackBerry()) {\n var xmlhttp = getXMLHTTPRequest();\n xmlhttp.open(\"POST\", \"http://localhost/sup.amp?querytype=addMenuItem&\" + versionURLParam, false);\n xmlhttp.send(request);\n } \n else {\n var curScreenDivId = ((screenToShow) ? screenToShow : getCurrentScreen()) + \"ScreenDiv\";\n var curScreenDiv = document.getElementById(curScreenDivId);\n if (hasjQueryMobile) {\n var divs = curScreenDiv.getElementsByTagName('div');\n \t var menuEl = curScreenDiv.getElementsByTagName('div')[0];\n \t //This is header div, check to see if we can add it into header.\n \t if ( menuEl.getElementsByTagName('a').length < 2 ) {\n \t\t menuEl.innerHTML = menuEl.innerHTML + '<a href=\"javascript:void(0)\" id=\"'+ curScreenDivId +menuItemName + '\" name=\"'\n + menuItemName + '\"' + ' onclick=\"' + functionName + '();\">' + menuItemName + '</a>';\n \t }else {\n \t\t\n \t\t //First try to find footer\n \t\t for( var divIdx = 0; divIdx < divs.length; divIdx++ ) {\n \t\t\t if ( divs[ divIdx].getAttribute('data-role') === 'footer'){\n \t\t\t\t menuEl = divs[ divIdx]; //This should be footer\n \t\t\t\n \t\t\t\t //Check to see if it's realdy existing.\n \t\t\t\t var existLinks = menuEl.getElementsByTagName('a')\n \t\t\t\tfor( var id =0; id <existLinks.length; id++ ) {\n \t\t\t\t\tif ( existLinks[id].getAttribute('id') === (curScreenDivId +menuItemName) ){\n \t\t\t\t\t\tvar screenId = ((screenToShow) ? screenToShow : getCurrentScreen()) ;\n \t\t\t\t\t\talert(\"The menu to be added from your custom code uses the same menu key another menu on the same screen is using. The key was '\"+ menuItemName + \"' on '\"+ screenId +\"' screen. Please change the menu key and try again\");\n \t\t\t\t return;\n \t\t\t\t\t}\n \t\t\t\t}\n \n \t\t\t\t var newlink = document.createElement('a');\n \t\t\t\t newlink.setAttribute('href', 'javascript:void(0)');\n \t\t\t\t newlink.setAttribute('class', 'invisible_button');\n \t\t\t\t newlink.setAttribute('data-role', 'menu'); \n \t\t\t\t newlink.setAttribute('id', curScreenDivId +menuItemName );\n \t\t\t\t newlink.setAttribute('name', menuItemName);\n \t\t\t\t newlink.setAttribute('onclick', functionName + '();');\n \t\t\t\t newlink.innerHTML= menuItemName ;\n \t\t\t menuEl.appendChild(newlink);\n \t\t break;\n \t\t\t }\n \t\t }\n \t}\n \t \n }\n else {\n var menuEl = document.getElementById(curScreenDivId + \"Menu\");\n if (menuEl) {\n menuEl.innerHTML = menuEl.innerHTML + '<li><a class=\"nav\" href=\"javascript:void(0)\"' + ' name=\"'\n + menuItemName + '\"' + ' onclick=\"' + functionName + '();\">' + menuItemName + '</a></li>';\n }\n }\n } \n if (logLevel >= 4) { logToWorkflow(\"exiting addMenuItem()\", \"DEBUG\", false); }\n}", "title": "" }, { "docid": "cd13449be1324c6938f8ef7545ec1634", "score": "0.57002807", "text": "function addTask() {\n\ttry {\n\t\tif (!listMenuItems) {\n\t\t\tthrow new UserException('Menu list not found');\n\t\t}\n\t\tif(listMenuItems.length > 14) {\n\t\t\talert('Task limit exceeds');\n\t\t\treturn false;\n\t\t}\n\t\tvar sideMenuItem = getCreateElement('li');\n\t\tvar menuItem = {name: '', subtasks: []};\n\t\tvar taskInput = getCreateElement('input');\n\t\ttaskInput.id = 'task-'+listMenuItems.length;\n\t\ttaskInput.value = menuItem.name;\n\t\ttaskInput.placeholder = 'Enter Task '+(listMenuItems.length + 1);\n\t\ttaskInput.setAttribute('onclick', 'changeTask(event)');\n\t\tlistMenuItems.push(menuItem);\n\t\tsideMenuItem.appendChild(taskInput);\n\t\tsideMenuList.appendChild(sideMenuItem);\n\t} catch (execption) {\n\t\tconsole.log(execption.message, execption.name);\n\t}\n}", "title": "" }, { "docid": "946d7d0de2ef7dece58db4dc2f0bf232", "score": "0.5696612", "text": "function createMenuItem(title, onClickHandler, parentID) {\n var opt = {\n \"title\": title,\n \"contexts\": contexts\n };\n\n if ( onClickHandler ) {\n opt.onclick = onClickHandler;\n }\n\n if ( parentID ) {\n opt.parentId = parentID;\n }\n\n return chrome.contextMenus.create(opt);\n}", "title": "" }, { "docid": "915c7bbb7b1e5250072de2b019ae217b", "score": "0.5689745", "text": "showSubmenu() {\n $(this).addClass(\"hover\").find(\".subMenu\").show();\n }", "title": "" }, { "docid": "53449c4e611fb7c1ee2afa07de05a315", "score": "0.56821513", "text": "function makeSubmenusDraggable() {\n $('.menu-item').attr('draggable', 'true'); \n}", "title": "" }, { "docid": "acd07e259d9e7d116cee43eae84076b7", "score": "0.56795007", "text": "_constructItem(content) {\n let listItem = document.createElement(\"li\");\n listItem.classList.add(\"dropmic-menu__listItem\");\n this.list.setAttribute(\"role\", \"menuitem\")\n listItem.appendChild(content);\n return listItem;\n }", "title": "" }, { "docid": "a965d9cb3cb053ee3e72968d134ff047", "score": "0.56778455", "text": "function addBlockSubmenu(block, load) {\n load = load || false;\n var id = block['id']; var name = block['name'];\n\n loadable = `<span>${name}</span>`;\n deleteable = !(isNaN(parseFloat(id))) ? `<span onclick=\"deleteBlock('${id}')\" class=\"pull-right btn btn-dark btn-sm delete-block\"><i class=\"material-icons md-14\">close</i></span>` : '';\n fn = load ? 'prepend' : 'append';\n $('#block-submenu')[fn]( \n `<li id=\"block-${id}\">\n <a id=\"load-${id}\">\n ${loadable}\n ${deleteable} \n </a>\n </li>` \n );\n\n $(`#load-${id}`).click(e => {\n nids = loadBlock(blocks[id].data);\n selectNodes(nids)\n });\n}", "title": "" }, { "docid": "672e312a881c4c4f23f9f8e078893712", "score": "0.5673921", "text": "function addItem(category, name, price) {\r\n\t\tRequest.ajax({\r\n\t\t\turl: \"/api/menu/new\",\r\n\t\t\tmethod: \"POST\",\r\n\t\t\t\r\n\t\t\tdata: {\r\n\t\t\t\t\"category\": category,\r\n\t\t\t\t\"name\": name,\r\n\t\t\t\t\"price\": price\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\tdone: function(data, status, xhr) {\r\n\t\t\t\t// if request was successful\r\n\t\t\t\tif(status == \"success\") {\r\n\t\t\t\t\tMenu.appendItem(data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "69471b3e897fa6459181b7ec170798ef", "score": "0.5661578", "text": "function makeMenu(jsonObject, listElement) {\n\t\t\t\n\t\t\tfor(var i in jsonObject) {\n\t\t\t\tvar newLI = document.createElement('li');\n\n\t\t\t\tif (jsonObject[i].sons){\n\t\t\t\t\tnewLI.innerHTML = \"<button type='button' class='menu-btn'><span class='menu-text'>\"+ \n\t\t\t\t\tjsonObject[i].name + \"</span></button>\";\t\n\t\t\t\t\t\n\t\t\t\t\tvar newMenu= document.createElement('menu');\n\t\t\t\t\tnewMenu.className = \"menu\";\n\t\t\t\t\t\t\n\t\t\t\t\tnewLI.className=\"menu-item submenu\";\t\t\n\t\t\t\t\tnewLI.appendChild(newMenu);\t\t\n\t\n\t\t\t\t\tmakeMenu(jsonObject[i].sons,newMenu);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tnewLI.innerHTML=\"<button type='button' class='menu-btn'><span class='menu-text'>\"+ jsonObject[i].name + \"</span></button>\";\n\t\t\t\t\t\n\t\t\t\t\tif(jsonObject[i].status===\"disable\") {\n\t\t\t\t\t\tnewLI.className=\"menu-item disabled\"\n\t\t\t\t\t} else\n\t\t\t\t\t\tnewLI.className=\"menu-item\";\n\t\t\t\t\t\n\t\t\t\t\t//reading onclick handler from JSON\n\t\t\t\t\teval(\"var onclickfn=\"+jsonObject[i].onclick);\n\t\t\t\t\tnewLI.addEventListener('click',onclickfn);\t\t\n\t\t\t\t}\n\t\t\n\t\t\t\tnewLI.id = jsonObject[i].id;\n\t\t\t\tlistElement.appendChild(newLI); \n\t\t\t}\n\t\t}", "title": "" } ]
1ce24f2a5ec4057ab4f126f91b31a706
retrieval and validation routines for query parameters convert each query parameter into a property of the returned object
[ { "docid": "9c5f790275c7662af32c757c1956bffc", "score": "0.0", "text": "function processParameters(e) {\n var options = {key: null, dataset: null};\n for (var key in e.parameters) {\n options[key] = e.parameters[key][0];\n }\n return options;\n}", "title": "" } ]
[ { "docid": "7e44eac6c92fd8a90d0e25f870e03133", "score": "0.65186524", "text": "function parsedQueryParameters() {\n let documentURL = window.location,\n queryParams,\n queryParameterResponseObject = {};\n\n if ((documentURL.search.indexOf('?') > -1) && (documentURL.search.indexOf('fs_query') > -1)) {\n queryParams = documentURL.search.split('?')[1].split('&');\n } else {\n console.log('Search Term Not Included');\n return;\n }\n\n queryParams.forEach((param) => {\n let updatedProp;\n if (param.indexOf('fs_query=') > -1 || param.indexOf('fs_limit=') > -1 || param.indexOf('fs_page=') > -1 ){\n let fsProperty = param.split('=')[0],\n fsValue = param.split('=')[1];\n\n updatedProp = fsValue.replace(/\\+/g, ' ');\n updatedProp = fsValue.replace(/%20/g, ' '); // or decodeURI(str)\n\n queryParameterResponseObject[fsProperty] = updatedProp;\n }\n });\n\n console.log(queryParameterResponseObject);\n return queryParameterResponseObject;\n }", "title": "" }, { "docid": "5b03971c13e1b9dbf4a55db2b353ffdf", "score": "0.6318359", "text": "function getURLParmsObj(query){\n query = query.replace('?','');\n var params = query.split('&');\n var paramObj = params.map(function(item){\n var values = item.split('=');\n var obj = {};\n obj[values[0]] = values[1];\n return obj;\n });\n return paramObj;\n }", "title": "" }, { "docid": "7d6277540bff7fa5467c90b0453e1517", "score": "0.5937804", "text": "getParam(params) {\n let values = {};\n let orderBy = {};\n let fields = {};\n params.split(\"&\").forEach(parametru => {\n if (parametru.includes(\"=\")) {\n const parametrii = parametru.split(\"=\");\n let camp = parametrii[0];\n let valoare = parametrii[1];\n if (!camp.match(MyURLparser.id_name)) {\n camp = camp.toUpperCase();\n }\n switch (MyURLparser.getCommandCode(camp)) {\n case 0:\n if (camp == \"AN\" || camp == \"TOTALVEHICULE\")\n values[camp] = Number.parseInt(valoare.replace(/%20/g, \" \").toUpperCase());\n else\n values[camp] = valoare.replace(/%20/g, \" \").toUpperCase();\n break;\n case 1:\n orderBy[camp.split(MyURLparser.order_by)[1]] = parseInt(valoare);\n break;\n case 2:\n if (valoare == undefined)\n fields[camp.split(MyURLparser.field_name)[1]] = 1;\n else\n fields[camp.split(MyURLparser.field_name)[1]] = parseInt(valoare);\n break;\n }\n }\n });\n return [values, fields, orderBy];\n }", "title": "" }, { "docid": "c5ca6280e130b7dbae2e1121df2afb49", "score": "0.5902135", "text": "buildURLParams({ pagination = {}, filters = {}, query = this.query }) {\n let params = {}\n\n Object.entries(Object.assign({}, pagination, query)).forEach(pair => {\n if (pair[1] === undefined || pair[1] === null) {\n return\n }\n\n params[pair[0]] = pair[1]\n })\n\n Object.assign(params, this.buildFilters(filters, true))\n\n return params\n }", "title": "" }, { "docid": "851011e2e80fb7f26e94b36e3d0f74e1", "score": "0.5869122", "text": "function parseQueryParameters(request, response, next) {\n var urlParts = url.parse(request.url, true);\n if (urlParts && urlParts.query) {\n request.query = urlParts.query;\n } else {\n request.query = {};\n }\n next();\n}", "title": "" }, { "docid": "d6ed33069c4895c968b601b0811d5f52", "score": "0.58512735", "text": "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n } else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "title": "" }, { "docid": "2f6cceda3759bca2ae051ca4b280d98b", "score": "0.58494765", "text": "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "title": "" }, { "docid": "2f6cceda3759bca2ae051ca4b280d98b", "score": "0.58494765", "text": "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "title": "" }, { "docid": "2f6cceda3759bca2ae051ca4b280d98b", "score": "0.58494765", "text": "parseQueryParam(params) {\n const key = matchQueryParams(this.remaining);\n if (!key) {\n return;\n }\n this.capture(key);\n let value = '';\n if (this.consumeOptional('=')) {\n const valueMatch = matchUrlQueryParamValue(this.remaining);\n if (valueMatch) {\n value = valueMatch;\n this.capture(value);\n }\n }\n const decodedKey = decodeQuery(key);\n const decodedVal = decodeQuery(value);\n if (params.hasOwnProperty(decodedKey)) {\n // Append to existing values\n let currentVal = params[decodedKey];\n if (!Array.isArray(currentVal)) {\n currentVal = [currentVal];\n params[decodedKey] = currentVal;\n }\n currentVal.push(decodedVal);\n }\n else {\n // Create a new value\n params[decodedKey] = decodedVal;\n }\n }", "title": "" }, { "docid": "fa958565dde7208f58d3a6d965a51a3e", "score": "0.58376473", "text": "function _setGetPrams(obj) {\n var param = '';\n $.each(obj, function (key, element) {\n param += '&' + key + '=' + encodeURI(element);\n });\n return param.slice(1);\n}", "title": "" }, { "docid": "6ad57c68c9ad5bb76cc720d0c969ad7c", "score": "0.58361024", "text": "makeQueryAndOptions () {\n\t\t// build the query (this is where the derived class does its work)\n\t\tlet query = this.buildQuery();\n\t\tif (typeof query === 'string') {\n\t\t\t// an error in the query parameters\n\t\t\treturn this.errorHandler.error('badQuery', { reason: query });\n\t\t}\n\t\telse if (query === false) {\n\t\t\t// fetch nothing\n\t\t\treturn { fetchNothing: true };\n\t\t}\n\t\t// get options associated with the query we'll run\n\t\tlet queryOptions = this.getQueryOptions();\n\t\tlet func;\n\t\tif (query) {\n\t\t\tfunc = 'getByQuery';\n\t\t}\n\t\telse {\n\t\t\t// we assume if we didn't get a query, that the client wants to fetch documents by ID\n\t\t\tfunc = 'getByIds';\n\t\t\tquery = this.ids || this.request.query.ids || this.request.body.ids;\n\t\t\tif (!query) {\n\t\t\t\treturn this.errorHandler.error('parameterRequired', { info: 'ids' });\n\t\t\t}\n\t\t\tif (typeof query === 'string') {\n\t\t\t\tquery = decodeURIComponent(query).toLowerCase().split(',');\n\t\t\t}\n\t\t}\n\t\treturn { func, query, queryOptions };\n\t}", "title": "" }, { "docid": "ce86e2518afbb9313ae91ee6018c57fd", "score": "0.58219826", "text": "function queryString2Obj(){\n\tlog('Info: queryString2Obj():start')\n\tvar ret={};\n\tvar vars=[],hash;\n\tvar qs=getQueryString();\n\tvar hashes=qs.slice(qs.indexOf('?')+1).split('&');\n\tfor(var i=0;i<hashes.length;i++){\n\t\thash=hashes[i].split('=');\n\t\tvars.push(hash[0]);\n\t\tvars[hash[0]]=hash[1];\n\t}\n\tvars.forEach(function(v,vidx){\n\t\tlog(\"Info: queryString2Obj: var[\"+vidx+\"]: \"+v);\n\t\tret[v]=getQueryVariable(qs,v)\n\t});\n\tlog('Info: queryString2Obj():end')\n\treturn ret;\n}", "title": "" }, { "docid": "9fcff39276ad34b9ca998d28b0053922", "score": "0.5803839", "text": "function coerceQuery (params) {\n Object.keys(params).forEach(function (param) {\n if (params[param] === 'false') { params[param] = false; }\n else if (params[param] === 'true') { params[param] = true; }\n else if (param === 'geometry') {\n params[param] = (params[param].startsWith(\"{\") ? JSON.parse(params[param]) : params[param]);\n }\n else if (param === 'outStatistics') {\n params[param] = (typeof params[param] === \"string\") ? JSON.parse(params[param]) : params[param];\n }\n else if (! isNaN(params[param])) { params[param] = Number(params[param]); }\n })\n return params;\n}", "title": "" }, { "docid": "019d5766b37301907ce991fa733c68a3", "score": "0.57981026", "text": "function processQueryString() {\n console.log(\"processQueryString\");\n\n var query_string = {};\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n for (var i = 0; i < vars.length; i++) {\n var pair = vars[i].split(\"=\");\n // If first entry with this name\n if (typeof query_string[pair[0]] === \"undefined\") {\n query_string[pair[0]] = decodeURIComponent(pair[1]);\n // If second entry with this name\n } else if (typeof query_string[pair[0]] === \"string\") {\n var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];\n query_string[pair[0]] = arr;\n // If third or later entry with this name\n } else {\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\n }\n }\n console.log(\" query_string: \", query_string);\n return query_string;\n }", "title": "" }, { "docid": "038ebdfa5a092127ea7af87aa9312fcf", "score": "0.5793352", "text": "obtainQueryParams() {\n const params = new URLSearchParams(window.location.search);\n const ret = {};\n for (const param in this.parameters) {\n if (this.parameters[param].required || params.get(param) !== null) {\n ret[param] = params.get(param);\n }\n }\n return ret;\n }", "title": "" }, { "docid": "1a3f0945ef8433430e8583cd53e783f1", "score": "0.578707", "text": "static parseQuery(query) {\n\t\tvar queryArr = (query.startsWith('?') ? query.substr(1) : query)\n\t\t\t.split('&').map(q => q.split('=').map(str => str.trim()));\n\t\treturn queryArr.reduce((obj, q) => _with(obj, q[0], q[1]), {});\n\t}", "title": "" }, { "docid": "13d677bd0829012e9cd0715b3381e1de", "score": "0.577536", "text": "_cleanParams(params){let newParams={};for(x in params){const prop=x,value=params[x];if(\"\"===value||null===value||value===void 0){// do nothing\n}else{// add the clean property to the new params object\nnewParams[prop]=value}}return newParams}", "title": "" }, { "docid": "e3ce6e13e8a4d9233645c962c5e7ebd7", "score": "0.57736385", "text": "constructor(){\r\n\t\tthis.query = {};\r\n\t\tlet search = this.getSearch().replace('?', '');\r\n\t\tlet queries = search.split(\"&\");\r\n\r\n\t\tqueries.forEach(q => {\r\n\t\t\tlet _q = q.split(\"=\");\r\n\t\t\tif(_q.length == 2){\r\n\t\t\t\tthis.query[_q[0]] = _q[1];\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t}", "title": "" }, { "docid": "c42a10b99e087fb1b31147f9cb180619", "score": "0.5758415", "text": "function parseQuery ( query ) {\n var Params = new Object ();\n if ( ! query ) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for ( var i = 0; i < Pairs.length; i++ ) {\n var KeyVal = Pairs[i].split('=');\n if ( ! KeyVal || KeyVal.length != 2 ) continue;\n var key = unescape( KeyVal[0] );\n var val = unescape( KeyVal[1] );\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n}", "title": "" }, { "docid": "b8773cfa412613e79355d4d8279ebbd9", "score": "0.57568675", "text": "function queryToQS(query: Object): {[string]: string}", "title": "" }, { "docid": "b23733e92babde625f1ac1fa4b3b7b60", "score": "0.57537293", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n }", "title": "" }, { "docid": "e2ba9f8be6def16313d791aa52fd9aad", "score": "0.5751004", "text": "parseQuery() {\n let paramString = document.location.search.substr(1); // Remove the ? \n let toParse = paramString.split(\"&\");\n\n // Parse all the parameters\n for (let i =0; i<toParse.length; i++) {\n if (toParse[i].length === 0) continue;\n let string = toParse[i];\n\n let strT = string.split(\"=\");\n this.loadParameter.addParam(strT[0],strT[1]);\n }\n }", "title": "" }, { "docid": "8ad05376f2ea48c353d865fb3cdb1b0a", "score": "0.57356477", "text": "function convertQueryStringToObject() {\n let inputArray = window.location.search.slice(1).split('&');\n let convertedInput = {};\n inputArray.forEach((input) => {\n input = input.split('=');\n convertedInput[input[0]] = decodeURIComponent(input[1].replace(/\\+/g, '%20') || '');\n //We can also do: convertedInput[input[0]] = decodeURIComponent(input[1] || ''); It just doesn't handle spaces \n });\n\n return JSON.parse(JSON.stringify(convertedInput));\n}", "title": "" }, { "docid": "1ab995339d66f76b3bdcfa7f4962c87a", "score": "0.5734934", "text": "function readParameters(req){\n var request_parameters = {};\n\n var page_formats = [\"Letter\", \"Legal\", \"Tabloid\",\"Ledger\",\"A0\",\"A1\",\"A2\",\"A3\",\"A4\",\"A5\",\"A6\"];\n\n if (req.query.url && \"\" != req.query.url) {\n request_parameters.url = req.query.url;\n }\n\n if (req.query.scale && !isNaN(parseFloat(req.query.scale))) {\n request_parameters.scale = parseFloat(req.query.scale);\n }\n\n if (req.query.printBackground && 1 === parseInt(req.query.printBackground)) {\n request_parameters.printBackground = true;\n }\n\n if (req.query.landscape && 1 == parseInt(req.query.landscape)) {\n request_parameters.landscape = true;\n }\n\n if (req.query.format && page_formats.indexOf(req.query.format) > -1) {\n request_parameters.format = req.query.format;\n }\n\n if (req.query.delay && parseInt(req.query.delay) > 0) {\n request_parameters.delay = parseInt(req.query.delay);\n }\n\n return Object.assign({}, default_parameters, request_parameters);\n}", "title": "" }, { "docid": "f544a125d1fea4170949bea81a92b8e7", "score": "0.57138795", "text": "parseURLParams(params) {\n let filters = {}\n let pagination = {}\n let query = {}\n\n const paginationMap = {\n page: 'page',\n rowsPerPage: 'rowsPerPage',\n rowsNumber: 'rowsNumber',\n sortBy: 'sortBy',\n descending: 'descending'\n }\n\n Object.entries(params).forEach(pair => {\n if (pair[0].indexOf('filters_') === 0) {\n const filterName = pair[0].match(/^filters_(.+)$/)[1]\n\n if (this.filters[filterName] !== undefined &&\n this.filters[filterName] !== null &&\n typeof this.filters[filterName] === 'object' &&\n this.filters[filterName].length !== undefined) {\n // array filter\n if (typeof pair[1] === 'object') {\n // already array\n filters[filterName] = pair[1]\n } else {\n // push scalar into array\n if (filters[filterName] === undefined) {\n filters[filterName] = []\n }\n filters[filterName].push(pair[1])\n }\n } else {\n // scalar filter\n filters[filterName] = pair[1]\n }\n } else if (Object.keys(paginationMap).indexOf(pair[0]) >= 0) {\n pagination[paginationMap[pair[0]]] = pair[1]\n } else {\n query[pair[0]] = pair[1]\n }\n })\n\n return { pagination, filters, query }\n }", "title": "" }, { "docid": "13d5acf00d1c87b6825de5f586df7d7e", "score": "0.5713407", "text": "function getQueryObject() {\n var queryString = location.search.replace(/\\?/g, ''); // remove ?\n queryString = queryString.replace(/\\+/g, ' '); //remove +\n var queryArray = queryString.split('&');\n var paramsObj = {};\n queryArray.forEach(param => {\n var params = param.split('=');\n paramsObj[params[0]] = params[1];\n })\n return paramsObj;\n}", "title": "" }, { "docid": "4df7d5048d6a3b1d12a11f7152699367", "score": "0.5708915", "text": "getQueryValues() {\n var search = this.window_obj.location.search;\n\n if (search.length <= 1) {\n return {};\n }\n\n search = this.window_obj.location.search.substr(1);\n return this.getRawValues(search, '&', true);\n }", "title": "" }, { "docid": "dfd311b7a1ccce09794bb74fdf640877", "score": "0.56833214", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n }", "title": "" }, { "docid": "51035b83e844a14162ccd246a3536a7b", "score": "0.5683283", "text": "function propsToQuery(propsDef, props) {\n\n\t var params = [];\n\n\t return _promise.SyncPromise.all(Object.keys(props).map(function (key) {\n\n\t var prop = propsDef[key];\n\t var queryParam = key;\n\n\t if (typeof prop.queryParam === 'string') {\n\t queryParam = prop.queryParam;\n\t }\n\n\t return _promise.SyncPromise.resolve().then(function () {\n\n\t var value = props[key];\n\n\t if (!value) {\n\t return;\n\t }\n\n\t if (prop.queryParam === false) {\n\t return;\n\t }\n\n\t if (value === _constants.PROP_DEFER_TO_URL) {\n\t return;\n\t }\n\n\t if (prop.getter) {\n\t return value.call().then(function (result) {\n\t (0, _validate.validateProp)(prop, key, result);\n\t return result;\n\t });\n\t }\n\t }).then(function (value) {\n\n\t if (!value) {\n\t return;\n\t }\n\n\t var result = void 0;\n\n\t if (typeof value === 'boolean') {\n\t result = '1';\n\t } else if (typeof value === 'string') {\n\t result = value.toString();\n\t } else if (typeof value === 'function') {\n\t return;\n\t } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n\t result = JSON.stringify(value);\n\t } else if (typeof value === 'number') {\n\t result = value.toString();\n\t }\n\n\t params.push((0, _lib.urlEncode)(queryParam) + '=' + (0, _lib.urlEncode)(result));\n\t });\n\t })).then(function () {\n\t return params.join('&');\n\t });\n\t}", "title": "" }, { "docid": "1d2c96bb589ae9fe6e5cb26b7c2c77b7", "score": "0.5677757", "text": "function convertToParams(obj) {\n\t\tvar params = {};\n\t\t$.each(fields, function (i, field) {\n\t\t\tif (field.isArray) {\n\t\t\t\tvar concatResult = '';\n\t\t\t\tvar arr = obj[field.name];\n\t\t\t\tif (arr) {\n\t\t\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\t\t\t\tif (concatResult.length > 0)\n\t\t\t\t\t\t\tconcatResult += ',';\n\t\t\t\t\t\tvar elem = field.mapTo\n\t\t\t\t\t\t\t? field.mapTo(arr[i])\n\t\t\t\t\t\t\t: arr[i];\n\t\t\t\t\t\tif (elem != null && elem != undefined)\n\t\t\t\t\t\t\tconcatResult += elem;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (concatResult.length > 0)\n\t\t\t\t\tparams[field.urlName] = concatResult;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (obj[field.name]) {\n\t\t\t\t\tparams[field.urlName] = field.mapTo\n\t\t\t\t\t\t? field.mapTo(obj[field.name])\n\t\t\t\t\t\t: obj[field.name];\n\t\t\t\t}\n\t\t\t\tif (!params[field.urlName] || (field.defaultValue && obj[field.name] == field.defaultValue && !field.alwaysPutIntoUrl))\n\t\t\t\t\tdelete params[field.urlName];\n\t\t\t}\n\t\t});\n\t\treturn params;\n\t}", "title": "" }, { "docid": "68ea78094fc35c0bc621aa620842e81f", "score": "0.56428427", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n }", "title": "" }, { "docid": "6a3ca175d4540537c1a307ea0ff44c1f", "score": "0.563751", "text": "toGetParameters(data) {\n var parameters = \"\";\n var index = 0;\n for(var field in data) {\n if(index++ == 0) {\n parameters += \"?\";\n } else {\n parameters += \"&\";\n }\n parameters += encodeURIComponent(field) + \"=\" + encodeURIComponent(data[field]);\n };\n return parameters;\n }", "title": "" }, { "docid": "66d95f65f279e615d7a66df5be479411", "score": "0.5618894", "text": "function getParams(): {[key: string]: string}", "title": "" }, { "docid": "3594884d5425b90aebe6fb774cf67617", "score": "0.56133926", "text": "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap = this.queryParams.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(p => convertToParamMap(p)));\n }\n return this._queryParamMap;\n }", "title": "" }, { "docid": "17d6b0e6aebb246d106be9da75fd8e5e", "score": "0.5590764", "text": "function queryToObject(queryString){\n var\n queryObject = {},\n pair = null,\n query = queryString.split('&');\n \n for (var i=0; i < query.length; i++){\n pair = query[i].split('=');\n queryObject[pair[0]] = pair[1];\n };\n \n return queryObject;\n }", "title": "" }, { "docid": "225c3c2240f7315171d9215eb8d412dd", "score": "0.55872816", "text": "static parametersToObject(formData) {\n console.log(\"called parametersToObject()\");\n var args = {};\n var split = formData.split(\"&\");\n split.forEach(function (x) {\n const y = x.split('=');\n console.log(y[0] + \" \" + y[1]);\n let new_arg = decodeURIComponent(y[1].replace(/\\+/g, '%20'));\n if (new_arg.includes(','))\n new_arg = split(',');\n args[y[0]] = new_arg;\n });\n console.log(\"finished parametersToObject()\");\n return args;\n }", "title": "" }, { "docid": "5fe26faf4014940fb1065014213cdfdc", "score": "0.55729735", "text": "function queryStringToObject(qs) {\n\t\tvar hashSplit = qs.split('#'),\n\t\t\tkeyVals = hashSplit[0].split('&'),\n\t\t\tkeyValsLen = keyVals.length,\n\t\t\ti, r = {};\n\t\t\n\t\tfor (i=0; i<keyValsLen; i++) {\n\t\t\tvar keyVal = keyVals[i],\n\t\t\t\tsplitVal = keyVal.split('=');\n\t\t\t\n\t\t\tr[decodeURIComponent(splitVal[0])] = decodeURIComponent(splitVal[1]);\n\t\t}\n\t\t\n\t\tif (hashSplit.length > 1) {\n\t\t\tr._ppHash = hashSplit[1];\n\t\t}\n\t\treturn r;\n\t}", "title": "" }, { "docid": "f1c9fff7a330370bf4635057e0078df8", "score": "0.5571395", "text": "function queryStringToObject(value) {\n return value.replace(/^\\?/, '').split('&').reduce(function (acc, val) {\n var _a = val.split('='), key = _a[0], value = _a[1];\n acc[key] = decodeURIComponent(value || '');\n return acc;\n }, {});\n }", "title": "" }, { "docid": "911c984ee247b0d066f4bcc315dc5fa4", "score": "0.5569899", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n}", "title": "" }, { "docid": "e93642f9b82aa4671d354092867cb93f", "score": "0.5565828", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n}", "title": "" }, { "docid": "85dcfc2bd477ec9f4c021abc9dd03859", "score": "0.5559166", "text": "static getODataParamFromPropList(propertyList) {\n // construct the expand query\n var expandList = [];\n for(var i=0; i<propertyList.length; i++) {\n var name = propertyList[i];\n var parts = name.split(\"/\");\n if(parts.length>1) {\n expandList.push(parts.slice(0, parts.length-1).join(\"/\"));\n }\n }\n\n expandList = expandList.filter(function(val, index, list) { // get unique list of nodes to expand\n return list.indexOf(val) === index;\n });\n\n return {\n \"expandQuery\": expandList.join(\",\"),\n \"selectQuery\": propertyList.join(\",\")\n }\n }", "title": "" }, { "docid": "dd913d8f40d103373734dea600dfba20", "score": "0.5558194", "text": "function parseQueryString(query) {\n var obj = {},\n qPos = query.indexOf(\"?\"),\n\t\t tokens = query.substr(qPos + 1).split('&')\n\t\t i = tokens.length - 1;\n\t\tif (qPos !== -1 || query.indexOf(\"=\") !== -1) {\n\t\t\tfor (; i >= 0; i--) {\n\t\t\t\tvar s = tokens[i].split('=');\n\t\t\t\tobj[unescape(s[0])] = s.hasOwnProperty(1) ? unescape(s[1]) : null;\n\t\t\t};\n\t\t}\n\t\treturn obj;\n }", "title": "" }, { "docid": "cb84ba3f2a5f58c3c50bcd0835cc4184", "score": "0.5553145", "text": "function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != '' ? transformToAssocArray(prmstr) : { };\n}", "title": "" }, { "docid": "b6c37fba1cebbfbf7794c457b0f23692", "score": "0.5534658", "text": "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap =\n this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._queryParamMap;\n }", "title": "" }, { "docid": "b6c37fba1cebbfbf7794c457b0f23692", "score": "0.5534658", "text": "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap =\n this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._queryParamMap;\n }", "title": "" }, { "docid": "b6c37fba1cebbfbf7794c457b0f23692", "score": "0.5534658", "text": "get queryParamMap() {\n if (!this._queryParamMap) {\n this._queryParamMap =\n this.queryParams.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_3__[\"map\"])((p) => convertToParamMap(p)));\n }\n return this._queryParamMap;\n }", "title": "" }, { "docid": "8c6124e56e18bb6952315598ebf448cb", "score": "0.5521916", "text": "function WT_QueryParameter(){\n\tthis.category=\"\";\n\tthis.section=\"\";\n\tthis.subsection=\"\";\n\tthis.language=\"\";\n\tthis.ssouid=\"\";\t\t\t\t\n}", "title": "" }, { "docid": "f237aed574e28b2e5dd673aa25c475dd", "score": "0.5521176", "text": "function convertToObj(params) {\n\t\tvar obj = {};\n\t\t$.each(fields, function (i, field) {\n\t\t\tobj[field.name] = _mapFieldToObj(field, params);\n\t\t\tif (field.includeUnmapped)\n\t\t\t\tobj[field.nameUnmapped] = params[field.urlName];\n\t\t});\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "46e40a1b78924ef093648177b50c38a4", "score": "0.5503381", "text": "function buildPropertyObject(query, startIdx) {\n const propsObj = {};\n let i = startIdx;\n let property = '';\n let lastStoredProp;\n let response;\n\n while (true) {\n if (query[i] === ' ' && !property) {\n // do nothing, eat space //\n } else if (query[i] === ' ') {\n propsObj[property] = true;\n lastStoredProp = property;\n property = '';\n } else if (query.slice(i, i+2) === '\\\\n' && property) {\n propsObj[property] = true;\n lastStoredProp = property;\n property = '';\n i++;\n } else if (query[i] === '{' && property) {\n // Recursively call for nested properties //\n response = buildPropertyObject(query, i+1);\n propsObj[property] = response.propsObj;\n property = '';\n // Jump ahead past nested properties //\n i = response.index;\n } else if (query[i] === '{') {\n // Recursively call for nested properties //\n response = buildPropertyObject(query, i+1);\n propsObj[lastStoredProp] = response.propsObj;\n // Jump ahead past nested properties //\n i = response.index;\n } else if (query[i] === '}') {\n return {\n index: i,\n propsObj\n }\n } else if (query.slice(i, i+2) === '\\\\n') {\n i++;\n } else {\n property += query[i];\n }\n i++;\n }\n}", "title": "" }, { "docid": "286dda4f81e32742d89d0235af6133d2", "score": "0.54980755", "text": "build(){let queryString=\"\";for(const[key,value]of this._queryMap.entries()){if(queryString.length===0){queryString+=\"?\";}else{queryString+=\"&\";}queryString+=key+\"=\"+value;}return queryString;}", "title": "" }, { "docid": "f465c0d6a7e624ea211bd8d2d04d5177", "score": "0.5489909", "text": "function queryParser(input) {\n\tlet query = {};\n\tfor (let key in input) {\n\t\tif (input.hasOwnProperty(key)) {\n\t\t\tif (key === \"_id\") {\n\t\t\t\tquery[key] = new mongodb.ObjectID(input[key]);\n\t\t\t} else if (input[key].charAt(0) === \"{\" || input[key].charAt(0) === \"[\") {\n\t\t\t\tquery[key] = JSON.parse(input[key]);\n\t\t\t} else {\n\t\t\t\tquery[key] = input[key];\n\t\t\t}\n\t\t}\n\t}\n\treturn query;\n}", "title": "" }, { "docid": "fcdb9d7b7217f742efcf2deb3cf00b26", "score": "0.54717237", "text": "function getParams(search) {\n var obj = {};\n if (search) {\n var arr = search.split(\"&\"), i = 0, l = arr.length;\n for (; i < l; i++) {\n var k = arr[i].split(\"=\");\n var a = arr[i].match(new RegExp(k[0] + \"=([^\\&]*)(\\&?)\", \"i\"))\n obj[k[0]] = decodeURIComponent(a[1]);\n }\n }\n return obj;\n /*var result = search ? JSON.parse('{\"' + search.replace(/\"/g, '\\\\\"').replace(/&/g, '\",\"').replace(/=/g, '\":\"') + '\"}') : {};\n for(var i in result){\n result[i] = decodeURIComponent(result[i]);\n }\n return result;*/\n }", "title": "" }, { "docid": "a7cc6643e3e59b6772cb34e42c60a8e5", "score": "0.54695773", "text": "get _queryObject() {\n return queryParamsGetQueryObject(this._queryParams);\n }", "title": "" }, { "docid": "fc165d9a1f22220613627bd7b718bfa9", "score": "0.54622406", "text": "function getParams(url) {\r\n\t/* get the search query pairs */\r\n\tvar searchQry = url.substring(url.indexOf(\"?\") + 1, url.length).split(\"&\");\r\n\tvar requestObj = new Array();\r\n\t/* Loop through the pairs and create their name/value pairs in the new object */\r\n\tfor (i in searchQry) {\r\n\t\tvar temp = searchQry[i].split(\"=\");\r\n\t\trequestObj[temp[0]] = temp[1];\r\n\t}\r\n\treturn requestObj;\r\n}", "title": "" }, { "docid": "58ba587a317682349f473e42b89d6cb3", "score": "0.54543316", "text": "function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n if (key.length > 0) {\n acc[key] = decodeURIComponent(value || '');\n }\n return acc;\n }, {});\n }", "title": "" }, { "docid": "58ba587a317682349f473e42b89d6cb3", "score": "0.54543316", "text": "function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n if (key.length > 0) {\n acc[key] = decodeURIComponent(value || '');\n }\n return acc;\n }, {});\n }", "title": "" }, { "docid": "7680e166f55ee034126748f635c609d8", "score": "0.5439649", "text": "function parseQueryString(queryString) {\r\n\t var obj = {};\r\n\t if (!queryString) {\r\n\t return obj;\r\n\t }\r\n\t if (startsWithIgnoreCase_1.startsWithIgnoreCase(queryString, '?')) {\r\n\t queryString = queryString.substring(1);\r\n\t }\r\n\t queryString.split('&').forEach(function (keyValueString) {\r\n\t var _a = keyValueString.split('='), key = _a[0], value = _a[1];\r\n\t obj[decodeURIComponent(key || '')] = decodeURIComponent(value || '');\r\n\t });\r\n\t return obj;\r\n\t}", "title": "" }, { "docid": "852f3f47695e8503ee26d88db44532fe", "score": "0.5408881", "text": "function parseSearchParams($filter, ele){\n\tele.date = $filter('date')(ele.createTime, \"yyyy-MM-dd HH:mm:ss\");\n\tele.params = angular.fromJson(ele.searchParams);\n\tele.params.names = parseStorage(ele.params.names);\n\tele.params.keywords = parseStorageAndSwitch(ele.params.keywords, ele.params.keywordSwitch);\n\tele.params.locations = parseStorage(ele.params.locations);\n\tele.params.investors = parseStorageAndSwitch(ele.params.investors, ele.params.investorSwitch);\n\tele.params.stages = parseStageValue(ele.params.stages);\n\t\n}", "title": "" }, { "docid": "c98a22e60c0945880a030ae0a51af9eb", "score": "0.54086626", "text": "function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n acc[key] = decodeURIComponent(value || '');\n return acc;\n }, {});\n }", "title": "" }, { "docid": "c98a22e60c0945880a030ae0a51af9eb", "score": "0.54086626", "text": "function queryStringToObject(value) {\n return value\n .replace(/^\\?/, '')\n .split('&')\n .reduce((acc, val) => {\n const [key, value] = val.split('=');\n acc[key] = decodeURIComponent(value || '');\n return acc;\n }, {});\n }", "title": "" }, { "docid": "1c1bd28f96e18e0bfc8403b37890bb1f", "score": "0.54042083", "text": "checkAndProcessQuery(query) {\n if (!query) { // empty query\n this.hasQuery = false;\n } else if (typeof query === 'object') { // correct query format\n if (Object.keys(query).length > 0) {\n this.hasQuery = true;\n this.query = MyORM.convertQuery(query, 'AND');\n } else {\n this.hasQuery = false; // empty query\n }\n } else {\n throw new Error('Invalid query format'); // incorrect query format\n }\n }", "title": "" }, { "docid": "42aba9436d1b71d00bc6ee3861882fb1", "score": "0.53916585", "text": "function parseURLParameters() {\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n var output = {};\n for (var i=0; i < vars.length; i++) {\n var pair = vars[i].split(\"=\");\n output[pair[0]] = pair[1];\n }\n return output;\n}", "title": "" }, { "docid": "78d84cfbf7a38b6c6d324334fc908985", "score": "0.5383209", "text": "function getQueryParameters() {\n var e_1, _a;\n var queryParameters = {};\n if (window.location.search !== '') {\n var queryParametersString = window.location.search.substr(1); // remove question mark\n var params = queryParametersString.split('&');\n try {\n for (var params_1 = __values(params), params_1_1 = params_1.next(); !params_1_1.done; params_1_1 = params_1.next()) {\n var pair = params_1_1.value;\n if (pair === '') {\n continue;\n }\n var keyValue = pair.split('=');\n var key = keyValue[0];\n var value = keyValue[1] ? keyValue[1] : '';\n try {\n key = decodeURIComponent(key);\n if (value !== '') {\n value = decodeURIComponent(value);\n }\n }\n catch (error) {\n // skip malformed URI sequence\n continue;\n }\n var existedValue = queryParameters[key];\n if (existedValue) {\n if (existedValue instanceof Array) {\n existedValue.push(value);\n }\n else {\n // existed value is string\n queryParameters[key] = [existedValue, value];\n }\n }\n else {\n queryParameters[key] = value;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (params_1_1 && !params_1_1.done && (_a = params_1.return)) _a.call(params_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n return queryParameters;\n}", "title": "" }, { "docid": "ba5f615b0d292a81088d71e4b71b6f5e", "score": "0.53799057", "text": "function parseQueryString(queryString) {\n\tvar params = {};\n\n\t// Split into key/value pairs\n\tqueryString.split(\"&\").forEach ( function(param) {\n\t\t\ttemp = param.split('=');\n\t\t\tparams[temp[0]] = temp[1];\n\t\t} );\n\n\tparams.getParamByName = function ( paramName ) {\n\t\tparam = this[paramName];\n\t\tif ( param === undefined )\n\t\t\treturn \"\";\n\t\treturn param;\n\t};\n\n\treturn params;\n}", "title": "" }, { "docid": "a382870e38c45ce0bd879b6b272d78b2", "score": "0.53729004", "text": "function removeEmptyPropertiesFromQuery(query) {\n const newObj = {};\n Object.keys(query).forEach((prop) => {\n const value = query[prop];\n\n if (prop === \"international\" && value === false) {\n // Skip international flag if it is false\n } else if (Array.isArray(value)) {\n if (value.length > 0) {\n newObj[prop] = value;\n }\n } else if (value !== undefined && value !== \"\") {\n newObj[prop] = value;\n }\n });\n\n return newObj;\n}", "title": "" }, { "docid": "0bfabc89c30c08ac9e0098b96666dff7", "score": "0.5370112", "text": "paramIs(searchName, field, value, w, req) {\n return w[field.target.field] = req.params[field.param];\n }", "title": "" }, { "docid": "188e6c0a49493268bf6a3b2efe1040c4", "score": "0.53498286", "text": "get params(): {\n name: string,\n value: string | null\n }", "title": "" }, { "docid": "0bb64ed88a5b01afd1fb90a331ea4bc9", "score": "0.53456867", "text": "function custom_query_params_get() {\n var query = document.location.href.split(/\\?/);\n var query_params = {};\n \n if (query[1] != undefined && query[1] != '') {\n query = query[1].split(/\\&/);\n \n for (var i = 0; i < query.length; i++) {\n var params = query[i].split(/\\=/);\n query_params[params[0]] = params[1];\n }\n }\n \n return query_params;\n}", "title": "" }, { "docid": "d5a22c7c56d8668f53fdd8d89061228e", "score": "0.53446704", "text": "extract_query(url) {\n const query_array = url.split(\"?\").slice(1);\n const query_obj = {};\n\n query_array.forEach(q_str => {\n const q_piece = q_str.split(\"=\");\n query_obj[q_piece[0]] = q_piece[1];\n });\n\n return query_obj;\n }", "title": "" }, { "docid": "1da493898d4140086317c6f7dc4bd74d", "score": "0.53422964", "text": "function getQueryParameters(){\n var query = window.location.search;\n var queryObj = new Object();\n var queryArray = query.split(\"&\");\n for (var param in queryArray){\n paramArray = queryArray[param].split(\"=\");\n if (paramArray && paramArray.length == 2){\n var key = paramArray[0].substring(paramArray[0].indexOf('?')+1);\n queryObj[key] = paramArray[1];\n }\n }\n return queryObj;\n}", "title": "" }, { "docid": "6b0eadd6996bff89e1ec84bc4f5f3e72", "score": "0.5337444", "text": "function parseParameters(queryString) {\n var params = {};\n\n // split our query string into its component parts\n var arr = decodeURIComponent(queryString).split(\"&\");\n\n for (var i = 0; i < arr.length; i++) {\n // separate the keys and the values\n var a = arr[i].split(\"=\");\n\n params[a[0]] = a[1];\n }\n\n return params;\n}", "title": "" }, { "docid": "1ab030e3164ea873eb4495ad20ad9ab8", "score": "0.5330399", "text": "processQueryString(querystring) {\n\n // slice off initial \"?\" and split components on \"&\"\n var queryParams = querystring.slice(1).split('&');\n\n // empty query string defaults to evernote connection mode\n if (queryParams.length == 1 && queryParams[0].length == 0) {\n return {\n 'mode': 'evernote'\n }\n\n // single file string defeaults to markdown file viewer mode\n } else if (queryParams.length == 1 && queryParams[0].endsWith('.md')) {\n return {\n mode: 'file',\n location: '.',\n file: queryParams[0]\n }\n\n // otherwise parse the query string\n } else {\n var queryOptions = {};\n queryParams.forEach(p => {\n queryOptions[ p.split('=')[0] ] = p.split('=')[1];\n });\n return queryOptions\n }\n }", "title": "" }, { "docid": "070959f799700bff22ab03a4ab239bda", "score": "0.53299844", "text": "getQueryParams() {\n // This function is anonymous, is executed immediately and\n // the return value is assigned to QueryString!\n var query_string = {};\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n\n for (var i=0;i<vars.length;i++) {\n var pair = vars[i].split(\"=\");\n // If first entry with this name\n if (typeof query_string[pair[0]] === \"undefined\") {\n query_string[pair[0]] = decodeURIComponent(pair[1]);\n // If second entry with this name\n } else if (typeof query_string[pair[0]] === \"string\") {\n var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];\n query_string[pair[0]] = arr;\n // If third or later entry with this name\n } else {\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\n }\n }\n return query_string;\n }", "title": "" }, { "docid": "3f115b34c821647b5f1727d5e8a23249", "score": "0.532888", "text": "function parseQuery(queryString) {\r\n var query = {};\r\n if(queryString instanceof FormData){\r\n temp = [...queryString.entries()];\r\n let query = {};\r\n for(singleValue of temp){\r\n query[singleValue[0]] = singleValue[1]\r\n }\r\n return query;\r\n }else{\r\n var pairs = (queryString[0] === '?' ? queryString.substr(1) : queryString).split('&');\r\n for (var i = 0; i < pairs.length; i++) {\r\n var pair = pairs[i].split('=');\r\n query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1] || '');\r\n }\r\n return query;\r\n }\r\n \r\n}", "title": "" }, { "docid": "241de6a5ca87849c43fef31cbb6e0fe1", "score": "0.53283066", "text": "function GetRequestParameters(req){\r\n var nameValueArray = [];\r\n for (var param in req.query){\r\n nameValueArray.push({'name':param,'value':req.query[param]})\r\n }\r\n return nameValueArray;\r\n}", "title": "" }, { "docid": "9d079152ad85d86deed48076fdde7d94", "score": "0.53276855", "text": "function getParams(query) {\n\tvar aParams = new Array();\n\n\tquery = query.substr(query.indexOf(\"#\") + 1);\n\tquery = query.substr(query.indexOf('?') + 1);\n\n\tvar aQuery = query.split(\"&\");\n\tfor (var i = 0; i < aQuery.length; i++) {\n\t\tvar aParam = aQuery[i].split(\"=\");\n\n\t\taParams[aParam[0]] = aParam[1];\n\t}\n\n\treturn aParams;\n}", "title": "" }, { "docid": "6ce94fad186296d34c184915e857a8b6", "score": "0.53268355", "text": "getQuery() {\n const query =\n Object.keys(this.props.query).length > 0\n ? this.props.query\n : { ...this.props.params };\n if (!query.sort) {\n query.sort = this.props.sort.field;\n query.order = this.props.sort.order;\n }\n query.perPage = this.props.perPage;\n if (!query.page) {\n query.page = 1;\n }\n return query;\n }", "title": "" }, { "docid": "6c76810029e36066b1f6df3c0305a6d2", "score": "0.5322754", "text": "function getURLParamValue(query) {\n var parameters = location.search.substr(1);\n var vars = parameters.split(\"&\");\n var query_string = {};\n for (var i = 0; i < vars.length; i++) {\n var pair = vars[i].split(\"=\");\n var key = decodeURIComponent(pair[0]);\n var value = decodeURIComponent(pair[1]);\n // If first entry with this name\n if (typeof query_string[key] === \"undefined\") {\n query_string[key] = decodeURIComponent(value);\n // If second entry with this name\n } else if (typeof query_string[key] === \"string\") {\n var arr = [query_string[key], decodeURIComponent(value)];\n query_string[key] = arr;\n // If third or later entry with this name\n } else {\n query_string[key].push(decodeURIComponent(value));\n }\n }\n return query_string[query];\n}", "title": "" }, { "docid": "99906bdd132bb997a6b2b9d596be7aa8", "score": "0.53211826", "text": "function cleanObj(query) {\r\n if (query != ''){\r\n var toJson = JSON.stringify(query)\r\n toJson = toJson.replace('[','');\r\n toJson = toJson.replace(']','');\r\n var obj = JSON.parse(toJson);\r\n }else{\r\n obj = \"{}\"\r\n }\r\n\r\n return obj;\r\n}", "title": "" }, { "docid": "059f3eb7198cb6482c0d52af02d4c418", "score": "0.5320826", "text": "function queryAsObject(query) {\n var separator = query.indexOf('&amp;') === -1 ? '&' : '&amp;',\n parts = query.split(separator),\n obj = {};\n\n parts.forEach(function (pair) {\n pair = pair.split('=');\n obj[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n });\n\n return obj;\n }", "title": "" }, { "docid": "afaca8a0bfac9cfed46d5a77f87f02f4", "score": "0.53170985", "text": "function parseQueryString(query) {\n var obj = {},\n qPos = query.indexOf('?'),\n tokens = query.substr(qPos + 1).split('&'),\n i = tokens.length - 1;\n if (qPos !== -1 || query.indexOf('=') !== -1) {\n for (; i >= 0; i--) {\n var s = tokens[i].split('=');\n obj[unescape(s[0])] = s.hasOwnProperty(1) ? unescape(s[1]) : null;\n }\n }\n return obj;\n}", "title": "" }, { "docid": "d65d6c5de0868cfea491cd3e59d127b1", "score": "0.5315191", "text": "function fromQueryString(str, castBoolean) {\n var result = {}, split;\n str = str && str.toString ? str.toString() : '';\n str.replace(/^.*?\\?/, '').split('&').forEach(function(p) {\n var split = p.split('=');\n if(split.length !== 2) return;\n setParamsObject(result, split[0], decodeURIComponent(split[1]), castBoolean);\n });\n return result;\n }", "title": "" }, { "docid": "29a8629a8f59b27dbb13b951b79b70eb", "score": "0.5302992", "text": "function parse_query_string(query) {\n var vars = query.split(\"&\");\n var query_string = {};\n for (var i = 0; i < vars.length; i++) {\n var pair = vars[i].split(\"=\");\n var key = decodeURIComponent(pair[0]);\n var value = decodeURIComponent(pair[1]);\n // If first entry with this name\n if (typeof query_string[key] === \"undefined\") {\n query_string[key] = decodeURIComponent(value);\n // If second entry with this name\n } else if (typeof query_string[key] === \"string\") {\n var arr = [query_string[key], decodeURIComponent(value)];\n query_string[key] = arr;\n // If third or later entry with this name\n } else {\n query_string[key].push(decodeURIComponent(value));\n }\n }\n return query_string;\n}", "title": "" }, { "docid": "cc7c279b1662582a942c77e1bc409b93", "score": "0.5297579", "text": "function parseQueryString () {\n var parsedParameters = {},\n uriParameters = location.search.substr(1).split('&');\n \n for (var i = 0; i < uriParameters.length; i++) {\n var parameter = uriParameters[i].split('=');\n parsedParameters[parameter[0]] = decodeURIComponent(parameter[1]);\n }\n \n return parsedParameters;\n }", "title": "" }, { "docid": "0aaf77b67ac9f04c012eca6111706eaf", "score": "0.5289926", "text": "_setFiltersFromUrl() {\n const { fecha, medico, sucursal } = urlQueryToDict();\n this.date = fecha || this.date;\n this.medico = medico || this.medico;\n this.sucursal = sucursal || this.sucursal;\n }", "title": "" }, { "docid": "1f653d62945bba71f0a0f71ef1f51677", "score": "0.5284123", "text": "function urlQuery() {\n if (typeof document === \"undefined\" || !document.location) return {};\n return (document.location.search || \"\").replace(/^\\?/, \"\").split(\"&\").reduce(function (query$$1, ea) {\n var split = ea.split(\"=\"),\n key = split[0],\n value = split[1];\n if (value === \"true\" || value === \"false\") value = eval(value);else if (!isNaN(Number(value))) value = Number(value);\n query$$1[key] = value;\n return query$$1;\n }, {});\n}", "title": "" }, { "docid": "1f653d62945bba71f0a0f71ef1f51677", "score": "0.5284123", "text": "function urlQuery() {\n if (typeof document === \"undefined\" || !document.location) return {};\n return (document.location.search || \"\").replace(/^\\?/, \"\").split(\"&\").reduce(function (query$$1, ea) {\n var split = ea.split(\"=\"),\n key = split[0],\n value = split[1];\n if (value === \"true\" || value === \"false\") value = eval(value);else if (!isNaN(Number(value))) value = Number(value);\n query$$1[key] = value;\n return query$$1;\n }, {});\n}", "title": "" }, { "docid": "45603a9607b93a7466d382c65f88fff8", "score": "0.5273436", "text": "function extractParams(query) {\n var result = {};\n query.split(\"&\").forEach(function(part) {\n var item = part.split(\"=\");\n result[item[0]] = decodeURIComponent(item[1]);\n });\n return result;\n}", "title": "" }, { "docid": "b6cbf332f2547b1aee5b04d88599f6a3", "score": "0.52673733", "text": "function parseQueryString(query) \n{ \n //example param1=value1&param2=value2\n var dropbox_param = {};\n var vars = query.split(\"&\");\n for (var i=0;i<vars.length;i++) \n {\n var pair = vars[i].split(\"=\");\n if(pair.length > 1)\n \t dropbox_param[pair[0]] = pair[1]; \t\n }\n return dropbox_param; \n}", "title": "" }, { "docid": "a0a322a61444b942ea7ac751172699f3", "score": "0.52662945", "text": "function QueryString_Parse() {\n var query = window.location.search.substring(1);\n var pairs = query.split(\"&\"); for (var i=0;i<pairs.length;i++) {\n var pos = pairs[i].indexOf('=');\n if (pos >= 0) {\n var argname = pairs[i].substring(0,pos);\n var value = pairs[i].substring(pos+1);\n QueryString.keys[QueryString.keys.length] = argname;\n QueryString.values[QueryString.values.length] = value;\n }\n }\n}", "title": "" }, { "docid": "1f46c77b9c55c77fe809742fc4c3ec9e", "score": "0.52604467", "text": "function getParameters() {\n let filtersParameter = filters.val() === '' ? '' : 'filters=' + filters.val();\n\n // let parameters = '?' + filtersParameter;\n return parameters= '?' + filtersParameter;\n }", "title": "" }, { "docid": "71d2e1e080a54a72e6343b6fc29c2b0b", "score": "0.5254333", "text": "function queryParams(params) {\n params.soc = $('#cboSociedad').val(); // add param1\n params.plaza = $('#cboEmp').val(); // add param2\n console.log(JSON.stringify(params));\n return params;\n }", "title": "" }, { "docid": "d5ec7bcb78a367c02a1b000ebc07f619", "score": "0.52535987", "text": "function queryParametersAsLookup() {\n query = window.location.search.replace(\"?\", \"\");\n var hashParts = query.split(\"&\");\n var variables = {};\n // Twitter's widget.js breaks this: for (var i in hashParts)\n for (var i = 0; i < hashParts.length; i++) {\n var subParts = hashParts[i].split(\"=\");\n if (subParts.length > 1 && subParts[1].length) {\n variables[unescape(subParts[0])] = unescape(subParts[1]);\n }\n }\n return variables;\n}", "title": "" }, { "docid": "6d0dfe7574aef6a7f8c1bbbc0599fdbc", "score": "0.52468944", "text": "function getUrlParams(prop) {\n var params = {};\n var search = decodeURIComponent(\n window.location.href.slice(window.location.href.indexOf(\"?\") + 1)\n );\n var definitions = search.split(\"&\");\n\n definitions.forEach(function (val, key) {\n var parts = val.split(\"=\", 2);\n params[parts[0]] = parts[1];\n });\n\n return prop && prop in params ? params[prop] : \"\";\n }", "title": "" }, { "docid": "4da7e43a6656b73683e7374c4e4c9737", "score": "0.5241474", "text": "function queryParams(params) {\n // params.advFilter = \"projectID\";\n params.serviceID = id;\n return(params);\n // return {advFilter: 'projectID', advFilterValue: id};\n}", "title": "" }, { "docid": "a9d284ce8146519a94f36d2fc33be791", "score": "0.5235119", "text": "function urlQueryParser(query) {\n let fields = \"*\";\n let where = [];\n let orderBy;\n let limit, offset;\n\n const keys = Object.keys(query);\n const values = Object.values(query);\n\n //switch statement checking for reserved keys\n //default assume a column name and value were passed for where\n keys.forEach((key, index) => {\n switch (key) {\n case \"_fields\":\n fields = createFields(values[index]);\n break;\n case \"_sortBy\":\n orderBy = createSortBy(values[index]);\n break;\n case \"_limit\":\n limit = `LIMIT ${parseInt(values[index])}`;\n break;\n case \"_offset\":\n offset = `OFFSET ${parseInt(values[index])}`;\n break;\n default:\n where = where.concat(createWhere(key, values[index]));\n break;\n }\n });\n\n //object containing usedful fields for sql queries based on the url query\n return {\n fields: fields ? fields : \"\",\n limit: limit ? limit : \"\",\n offset: offset ? offset : \"\",\n orderBy: orderBy ? orderBy : \"\",\n where: where.length ? `${where.join(\" AND \")}` : \"\"\n };\n}", "title": "" }, { "docid": "d644e031e43c2d8edbe9150a65750aa0", "score": "0.5233489", "text": "function parseQueryString(x) {\n var newObj = {};\n var arrayQuery = x.split(\"?\");\n //create new array and then parse by the &\n var arrayPairs = arrayQuery[1].split(\"&\");\n //write a for loop that runs for each index, split and then make it the key-value\n for (var i = 0; i < arrayPairs.length; i++) {\n // console.log(arrayPairs[i].split('=')[0]);\n //set up the key and value\n newObj[arrayPairs[i].split('=')[0]] = (arrayPairs[i].split('=')[1])\n }\n console.log(newObj);\n}", "title": "" }, { "docid": "a71fcf92f100e4bc915c23e539162394", "score": "0.5228141", "text": "function queryParamsToRestQueryStringParameters(queryParams) {\n var qs = {};\n if (queryParams.isDefault()) {\n return qs;\n }\n var orderBy;\n if (queryParams.index_ === PRIORITY_INDEX) {\n orderBy = \"$priority\" /* PRIORITY_INDEX */;\n }\n else if (queryParams.index_ === VALUE_INDEX) {\n orderBy = \"$value\" /* VALUE_INDEX */;\n }\n else if (queryParams.index_ === KEY_INDEX) {\n orderBy = \"$key\" /* KEY_INDEX */;\n }\n else {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(queryParams.index_ instanceof PathIndex, 'Unrecognized index type!');\n orderBy = queryParams.index_.toString();\n }\n qs[\"orderBy\" /* ORDER_BY */] = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(orderBy);\n if (queryParams.startSet_) {\n qs[\"startAt\" /* START_AT */] = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(queryParams.indexStartValue_);\n if (queryParams.startNameSet_) {\n qs[\"startAt\" /* START_AT */] +=\n ',' + Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(queryParams.indexStartName_);\n }\n }\n if (queryParams.endSet_) {\n qs[\"endAt\" /* END_AT */] = Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(queryParams.indexEndValue_);\n if (queryParams.endNameSet_) {\n qs[\"endAt\" /* END_AT */] +=\n ',' + Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"stringify\"])(queryParams.indexEndName_);\n }\n }\n if (queryParams.limitSet_) {\n if (queryParams.isViewFromLeft()) {\n qs[\"limitToFirst\" /* LIMIT_TO_FIRST */] = queryParams.limit_;\n }\n else {\n qs[\"limitToLast\" /* LIMIT_TO_LAST */] = queryParams.limit_;\n }\n }\n return qs;\n}", "title": "" }, { "docid": "d9b047d0583c8de6b6fa3acf66ba5f9a", "score": "0.52214366", "text": "function getURLParamters(req) {\n var params = url.parse(req.url,true).query;\n console.log(params);\n\n\n var coeffs = [];\n var xvals = [];\n //check if parameters are defined\n if (typeof params['coeffs'] !== 'undefined' && typeof params['xvals'] !== 'undefined') {\n coeffs = params['coeffs'].split(\",\");\n xvals = params['xvals'].split(\",\");\n } else {\n return createSampleParams();\n }\n var params = { coeffs: coeffs, xvals: xvals};\n return params;\n}", "title": "" }, { "docid": "67817f33145702e34b389da3fe929987", "score": "0.52170163", "text": "function getParam(req) {\n return {\n ...req.params,\n ...req.data,\n ...req.query\n // lang: req.params.lang || req.data.lang\n };\n}", "title": "" }, { "docid": "abf6fd915da85e334ed41b769822fca0", "score": "0.5215751", "text": "function processParams(callback){\n var chunks = route.getSubKeys();\n var value;\n var key;\n var haveValue;\n for (var i = 0, l = chunks.length; i < l; i++){\n var chunk = chunks[i];\n var item = chunk.split(\"=\");\n key = item[0];\n value = item[1];\n haveValue = (item.length == 2);\n item.clear();\n item = null;\n if (callback(key, value, haveValue) === false){\n break;\n }\n }\n chunks = null;\n value = null;\n key = null;\n haveValue = null;\n }", "title": "" } ]
01613695140fb985b46805f7a958e429
returns date range of match signs to be used in the matchHover() function
[ { "docid": "eb03d468e8394e1d03470f2375fd5076", "score": "0.6081491", "text": "function getDates(matchsign){\n\tfor (var i = 0; i<SIGN_LIST.length; i++){\n\t\tif (matchsign == SIGN_LIST[i].sign){\n\t\t\treturn SIGN_LIST[i].dates;\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "c61c819756a745f31357f090ee657911", "score": "0.59344095", "text": "function matchHover(){\n\tvar MATCH_TEXT = document.getElementsByClassName(\"match-text\"),\n\t\tMATCH_POPUP = document.getElementById(\"popup\");\t\n\n\tfor (var m of MATCH_TEXT){\n\t\tm.onmouseover = function(e){\n\t\t\tvar matchText = e.target.innerHTML;\n\t\t\tvar matchDates = getDates(matchText);\n\t\t\tvar popUpPositionX = e.target.offsetLeft - 10;\n\t\t\tvar popUpPositionY = e.target.offsetTop + 25;\n\t\t\tMATCH_POPUP.innerHTML += matchDates[0] + \" - \" + matchDates[1];\n\t\t\tMATCH_POPUP.style.display = \"block\"; \n\t\t\tMATCH_POPUP.style.position = \"absolute\";\n\t\t\tMATCH_POPUP.style.left = popUpPositionX + \"px\";\n\t\t\tMATCH_POPUP.style.top = popUpPositionY + \"px\"; \n\t\t\te.target.style.backgroundColor = \"grey\";\n\t\t}\n\t}\n\n\tfor (var m of MATCH_TEXT){\n\t\tm.onmouseout = function(e){\n\t\t\tMATCH_POPUP.innerHTML = \"\";\n\t\t\tMATCH_POPUP.style.display = \"none\";\n\t\t\te.target.style.backgroundColor = \"white\";\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "46cebc27bc827c795dac4c1ba76a9fa2", "score": "0.54537183", "text": "function getMatch()\n {\n return new RegExp('(\\\\'+_start.split('').join('\\\\')+')(.*?)(\\\\'+_end.split('').join('\\\\')+')','g')\n }", "title": "" }, { "docid": "99c344b4be6062edca879d6c5d618537", "score": "0.54328847", "text": "checkDateRange(match_values) {\n var d;\n\n if (Utils.isObject(match_values) === false) {\n return true;\n }\n\n d = new Date();\n\n if (match_values.min !== -1 && new Date(match_values.min) > d) {\n return false;\n }\n\n if (match_values.max !== -1 && new Date(match_values.max) < d) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "711f71d758e5a3707f0b06a3279e5d88", "score": "0.5431173", "text": "dateRange(dimension, filters) {\n const range = filters[dimension].values;\n\n const dateRangeFormatted = {\n from: moment(range[0], 'X').format('YYYY-MM-DD'), // eslint-disable-line no-undef\n to: moment(range[1], 'X').format('YYYY-MM-DD'), // eslint-disable-line no-undef\n };\n\n return `(status_q >= '${dateRangeFormatted.from}' AND status_q <= '${dateRangeFormatted.to}')`;\n }", "title": "" }, { "docid": "d3cb4e31e28fdd29cda2fab56f83a36e", "score": "0.53993344", "text": "getDomain() {\n const { activeButtonZoomIndex, activeGameZoom } = this.props;\n const activeGame = gameForId(activeGameZoom, this.props.schedule);\n const maxTime = this.props.timeseries[this.props.timeseries.length - 1]\n .time;\n const minTime = this.props.timeseries[0].time;\n let min = dayjs(minTime).clone();\n let max = dayjs(maxTime).clone();\n if (activeButtonZoomIndex >= 0) {\n const zoomHours = zoomButtons[activeButtonZoomIndex].hours;\n min = dayjs(maxTime).subtract(zoomHours, \"hours\");\n } else if (activeGame) {\n const [hours, minutes, seconds] = activeGame.duration.split(\":\");\n min = activeGame.startTime;\n max = activeGame.startTime\n .clone()\n .add(hours, \"hours\")\n .add(minutes, \"minutes\")\n .add(seconds, \"seconds\");\n }\n return [min, max];\n }", "title": "" }, { "docid": "83a35d16573faa65561462d98bb9199c", "score": "0.53775007", "text": "function setupMatches() {\n\t\t// June 1\n\t\tsetMatch(0, 0, 0, [2, 12]);\n\t\tsetMatch(0, 0, 1, [4, 11]);\n\t\tsetMatch(0, 0, 2, [7, 8]);\n\t\tsetMatch(0, 0, 3, [5, 9]);\n\t\tsetMatch(0, 1, 0, [3, 12]);\n\t\tsetMatch(0, 1, 1, [4, 10]);\n\t\tsetMatch(0, 1, 2, [1, 7]);\n\t\tsetMatch(0, 1, 3, [6, 9]);\n\t\tsetMatch(0, 2, 0, [3, 11]);\n\t\tsetMatch(0, 2, 1, [5, 10]);\n\t\tsetMatch(0, 2, 2, [1, 2]);\n\t\tsetMatch(0, 2, 3, [6, 8]);\n\t\t// June 8\n\t\tsetMatch(1, 0, 0, [4, 9]);\n\t\tsetMatch(1, 0, 1, [1, 5]);\n\t\tsetMatch(1, 0, 2, [2, 11]);\n\t\tsetMatch(1, 0, 3, [3, 7]);\n\t\tsetMatch(1, 1, 0, [4, 6]);\n\t\tsetMatch(1, 1, 1, [1, 12]);\n\t\tsetMatch(1, 1, 2, [2, 8]);\n\t\tsetMatch(1, 1, 3, [3, 10]);\n\t\tsetMatch(1, 2, 0, [6, 7]);\n\t\tsetMatch(1, 2, 1, [9, 12]);\n\t\tsetMatch(1, 2, 2, [5, 8]);\n\t\tsetMatch(1, 2, 3, [10, 11]);\n\t\t// June 15\n\t\tsetMatch(2, 0, 0, [2, 7]);\n\t\tsetMatch(2, 0, 1, [1, 3]);\n\t\tsetMatch(2, 0, 2, [9, 11]);\n\t\tsetMatch(2, 0, 3, [5, 12]);\n\t\tsetMatch(2, 1, 0, [7, 10]);\n\t\tsetMatch(2, 1, 1, [3, 6]);\n\t\tsetMatch(2, 1, 2, [8, 9]);\n\t\tsetMatch(2, 1, 3, [4, 5]);\n\t\tsetMatch(2, 2, 0, [1, 10]);\n\t\tsetMatch(2, 2, 1, [6, 11]);\n\t\tsetMatch(2, 2, 2, [8, 12]);\n\t\tsetMatch(2, 2, 3, [2, 4]);\n\t\t// June 22\n\t\tsetMatch(3, 0, 0, [7, 9]);\n\t\tsetMatch(3, 0, 1, [11, 12]);\n\t\tsetMatch(3, 0, 2, [1, 8]);\n\t\tsetMatch(3, 0, 3, [2, 10]);\n\t\tsetMatch(3, 1, 0, [3, 9]);\n\t\tsetMatch(3, 1, 1, [5, 11]);\n\t\tsetMatch(3, 1, 2, [4, 8]);\n\t\tsetMatch(3, 1, 3, [6, 10]);\n\t\tsetMatch(3, 2, 0, [2, 3]);\n\t\tsetMatch(3, 2, 1, [5, 7]);\n\t\tsetMatch(3, 2, 2, [4, 12]);\n\t\tsetMatch(3, 2, 3, [1, 6]);\n\t\t// June 29\n\t\tsetMatch(4, 0, 0, [1, 11]);\n\t\tsetMatch(4, 0, 1, [7, 12]);\n\t\tsetMatch(4, 0, 2, [3, 5]);\n\t\tsetMatch(4, 0, 3, [2, 9]);\n\t\tsetMatch(4, 1, 0, [8, 11]);\n\t\tsetMatch(4, 1, 1, [4, 7]);\n\t\tsetMatch(4, 1, 2, [5, 6]);\n\t\tsetMatch(4, 1, 3, [9, 10]);\n\t\tsetMatch(4, 2, 0, [3, 8]);\n\t\tsetMatch(4, 2, 1, [1, 4]);\n\t\tsetMatch(4, 2, 2, [2, 6]);\n\t\tsetMatch(4, 2, 3, [10, 12]);\n\t\t// July 6\n\t\tsetMatch(5, 0, 0, [7, 11]);\n\t\tsetMatch(5, 0, 1, [5, 10]);\n\t\tsetMatch(5, 0, 2, [1, 9]);\n\t\tsetMatch(5, 0, 3, [3, 12]);\n\t\tsetMatch(5, 1, 0, [4, 11]);\n\t\tsetMatch(5, 1, 1, [8, 10]);\n\t\tsetMatch(5, 1, 2, [1, 2]);\n\t\tsetMatch(5, 1, 3, [6, 12]);\n\t\tsetMatch(5, 2, 0, [3, 4]);\n\t\tsetMatch(5, 2, 1, [7, 8]);\n\t\tsetMatch(5, 2, 2, [2, 5]);\n\t\tsetMatch(5, 2, 3, [6, 9]);\n\t\t// July 13\n\t\tsetMatch(6, 0, 0, [4, 9]);\n\t\tsetMatch(6, 0, 1, [1, 5]);\n\t\tsetMatch(6, 0, 2, [2, 11]);\n\t\tsetMatch(6, 0, 3, [3, 7]);\n\t\tsetMatch(6, 1, 0, [4, 6]);\n\t\tsetMatch(6, 1, 1, [1, 12]);\n\t\tsetMatch(6, 1, 2, [2, 8]);\n\t\tsetMatch(6, 1, 3, [3, 10]);\n\t\tsetMatch(6, 2, 0, [6, 7]);\n\t\tsetMatch(6, 2, 1, [9, 12]);\n\t\tsetMatch(6, 2, 2, [5, 8]);\n\t\tsetMatch(6, 2, 3, [10, 11]);\n\t\t// July 20\n\t\tsetMatch(7, 0, 0, [2, 7]);\n\t\tsetMatch(7, 0, 1, [1, 3]);\n\t\tsetMatch(7, 0, 2, [9, 11]);\n\t\tsetMatch(7, 0, 3, [5, 12]);\n\t\tsetMatch(7, 1, 0, [7, 10]);\n\t\tsetMatch(7, 1, 1, [3, 6]);\n\t\tsetMatch(7, 1, 2, [8, 9]);\n\t\tsetMatch(7, 1, 3, [4, 5]);\n\t\tsetMatch(7, 2, 0, [1, 10]);\n\t\tsetMatch(7, 2, 1, [6, 11]);\n\t\tsetMatch(7, 2, 2, [8, 12]);\n\t\tsetMatch(7, 2, 3, [2, 4]);\n\t\t// July 27\n\t\tsetMatch(8, 0, 0, [7, 9]);\n\t\tsetMatch(8, 0, 1, [11, 12]);\n\t\tsetMatch(8, 0, 2, [1, 8]);\n\t\tsetMatch(8, 0, 3, [2, 10]);\n\t\tsetMatch(8, 1, 0, [3, 9]);\n\t\tsetMatch(8, 1, 1, [5, 11]);\n\t\tsetMatch(8, 1, 2, [4, 8]);\n\t\tsetMatch(8, 1, 3, [6, 10]);\n\t\tsetMatch(8, 2, 0, [2, 3]);\n\t\tsetMatch(8, 2, 1, [5, 7]);\n\t\tsetMatch(8, 2, 2, [4, 12]);\n\t\tsetMatch(8, 2, 3, [1, 6]);\n\t\t// August 3\n\t\tsetMatch(9, 0, 0, [1, 11]);\n\t\tsetMatch(9, 0, 1, [7, 12]);\n\t\tsetMatch(9, 0, 2, [3, 5]);\n\t\tsetMatch(9, 0, 3, [2, 9]);\n\t\tsetMatch(9, 1, 0, [8, 11]);\n\t\tsetMatch(9, 1, 1, [4, 7]);\n\t\tsetMatch(9, 1, 2, [5, 6]);\n\t\tsetMatch(9, 1, 3, [9, 10]);\n\t\tsetMatch(9, 2, 0, [3, 8]);\n\t\tsetMatch(9, 2, 1, [1, 4]);\n\t\tsetMatch(9, 2, 2, [2, 6]);\n\t\tsetMatch(9, 2, 3, [10, 12]);\n\t\t// August 10\n\t\tsetMatch(10, 0, 0, [8, 10]);\n\t\tsetMatch(10, 0, 1, [2, 12]);\n\t\tsetMatch(10, 0, 2, [1, 9]);\n\t\tsetMatch(10, 0, 3, [3, 11]);\n\t\tsetMatch(10, 1, 0, [6, 8]);\n\t\tsetMatch(10, 1, 1, [2, 5]);\n\t\tsetMatch(10, 1, 2, [1, 7]);\n\t\tsetMatch(10, 1, 3, [3, 4]);\n\t\tsetMatch(10, 2, 0, [6, 12]);\n\t\tsetMatch(10, 2, 1, [5, 9]);\n\t\tsetMatch(10, 2, 2, [7, 11]);\n\t\tsetMatch(10, 2, 3, [4, 10]);\n\t}", "title": "" }, { "docid": "0ae02ab2c3dca6a434b31ae82c171b88", "score": "0.5327078", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }", "title": "" }, { "docid": "d89b8e011e67615a686f5162d9aaeb7f", "score": "0.53092945", "text": "rangeShallowIntersectingRange(date1, date2) {\n if (!this.dateShallowIntersectsDate(date1, date2)) {\n return null;\n }\n\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the latest start date\n start = thisRange.start > otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // This end date exists\n\n\n if (thisRange.end) {\n // Use this definite end date if other end date is infinite\n if (!otherRange.end) {\n end = thisRange.end;\n } else {\n // Otherwise, use the earliest end date\n end = thisRange.end < otherRange.end ? thisRange.end : otherRange.end;\n } // Other end date exists\n\n } else if (otherRange.end) {\n // Use other definite end date as this one is infinite\n end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "title": "" }, { "docid": "d89b8e011e67615a686f5162d9aaeb7f", "score": "0.53092945", "text": "rangeShallowIntersectingRange(date1, date2) {\n if (!this.dateShallowIntersectsDate(date1, date2)) {\n return null;\n }\n\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the latest start date\n start = thisRange.start > otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // This end date exists\n\n\n if (thisRange.end) {\n // Use this definite end date if other end date is infinite\n if (!otherRange.end) {\n end = thisRange.end;\n } else {\n // Otherwise, use the earliest end date\n end = thisRange.end < otherRange.end ? thisRange.end : otherRange.end;\n } // Other end date exists\n\n } else if (otherRange.end) {\n // Use other definite end date as this one is infinite\n end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "title": "" }, { "docid": "59c71593fd7586b97f0bdc0fbfe14713", "score": "0.5297797", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n\n return date;\n }", "title": "" }, { "docid": "cfadc3283590ad0868b2993001e529e3", "score": "0.526523", "text": "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "title": "" }, { "docid": "cfadc3283590ad0868b2993001e529e3", "score": "0.526523", "text": "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "title": "" }, { "docid": "cfadc3283590ad0868b2993001e529e3", "score": "0.526523", "text": "findShallowIntersectingRange(date1, date2) {\n const thisRange = date1.toRange();\n const otherRange = date2.toRange(); // Start with infinite start and end dates\n\n let start = null;\n let end = null; // This start date exists\n\n if (thisRange.start) {\n // Use this definite start date if other start date is infinite\n if (!otherRange.start) {\n start = thisRange.start;\n } else {\n // Otherwise, use the earliest start date\n start = thisRange.start < otherRange.start ? thisRange.start : otherRange.start;\n } // Other start date exists\n\n } else if (otherRange.start) {\n // Use other definite start date as this one is infinite\n start = otherRange.start;\n } // Assign end date to this one if it is valid\n\n\n if (thisRange.end && (!start || thisRange.end >= start)) {\n end = thisRange.end;\n } // Assign end date to other one if it is valid and before this one\n\n\n if (otherRange.end && (!start || otherRange.end >= start)) {\n if (!end || otherRange.end < end) end = otherRange.end;\n } // Return calculated range\n\n\n return {\n start,\n end\n };\n }", "title": "" }, { "docid": "d345df27bd3b6018dfc37b4e4e51599f", "score": "0.52546316", "text": "function customRange(input) {\n return {\n minDate: (input.id == 'dTo' ? getDate($('#dFrom').val()) : null),\n maxDate: (input.id == 'dFrom' ? getDate($('#dTo').val()) : null)};\n }", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5248685", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5248685", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5248685", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "3311a9a8a7d42fc8f3332253859cf2bc", "score": "0.5195924", "text": "function matchTheDates (input) {\n let regex = /\\b(\\d{1,2})-([A-Z]{1}[a-z]{2})-(\\d{4}\\b)/g;\n let dates = [];\n\n for (let sentence of input) {\n let match = regex.exec(sentence);\n\n while (match) {\n let date = `${match[0]} (Day: ${match[1]}, Month: ${match[2]}, Year: ${match[3]})`;\n dates.push(date);\n\n match = regex.exec(sentence);\n }\n }\n\n console.log(dates.join('\\n'));\n}", "title": "" }, { "docid": "2c4a22f92aecc1c78705252524475591", "score": "0.5193568", "text": "function customRange(input)\n{\n return {minDate: (input.id == 'end' ? $('#start').datepicker( \"getDate\" ) : null),\n maxDate: (input.id == 'start' ? $('#end').datepicker( \"getDate\" ) : null)};\n}", "title": "" }, { "docid": "112f7321966b61e6d4c5ba427679c4a9", "score": "0.5167836", "text": "function showDates(dateRange, parm0, parm1)\n{\n var range = dateRange.value;\n var from = getFromDate(range);\n var to = getToDate(range);\n\n parm0.value=from;\n parm1.value=to;\n}//end ShowDates", "title": "" }, { "docid": "e2c6307918e1ace2d27a94797d6373e2", "score": "0.51583993", "text": "function DatesInRange1(dStrStart, dStrEnd) {\n var dStart = new Date(dStrStart);\n var dEnd = new Date(dStrEnd);\n\n var aDates = [];\n aDates.push(dStart);\n\n if(dStart <= dEnd) {\n for(var d = dStart; d <= dEnd; d.setDate(d.getDate() + 1)) {\n aDates.push(d);\n }\n }\n\n return aDates;\n}", "title": "" }, { "docid": "12e8afb1d8aabdcc48a88a744767ef42", "score": "0.5151946", "text": "timeline() {\n // Loop through the collected ranges and output as elements\n //\n // Example: 10 years ago |----- Gap -----|----- Filled -----|----- Gap -----| Today\n // Imagine 10 years ago is 0% and today is 100%\n return this.ranges().map((range) => {\n const styles = {\n left: `${range.left}%`,\n width: `${Math.abs(range.width)}%`,\n }\n\n return (\n <div\n key={newGuid()}\n className=\"filled\"\n style={styles}\n data-from={extractDate(range.dates.from)}\n data-to={extractDate(range.dates.to)}\n />\n )\n })\n }", "title": "" }, { "docid": "9b4cb7d528b31568597f7fc91d7780c4", "score": "0.5144752", "text": "function getEpiRange(rng_type, param) { \n var dateRange = [];\n var allDates = [];\n var num_epiwks = g.epitime.all.length;\n var last_epiTime = g.epitime.all[g.epitime.all.length-1];\n \n //define startYr, endYr, startMonth, endMonth, startWeek, endWeek - depending on rng_type\n if (rng_type=='epiweek') {\n var endYr = last_epiTime.epiyear;\n var endWeek = last_epiTime.epiweek;\n if (param <= num_epiwks) {\n var start_epiTime = g.epitime.all[num_epiwks-param];\n } else { \n var start_epiTime = g.epitime.all[0]; //if button goes back further than first date, set to first date\n \n }\n var startWeek = start_epiTime.epiweek;\n var startYr = start_epiTime.epiyear; \n\n } else if (rng_type=='epimonth') {\n var endYr = last_epiTime.epiyear; \n if (param ==0) { //if require current month only\n var endMonth = last_epiTime.epimonth;\n var startYr = endYr;\n var startMonth = endMonth;\n } else if (param <= endMonth) { //if number of months required still within current year\n var endMonth = last_epiTime.epimonth-1; \n var startYr = endYr;\n var startMonth = endMonth - param;\n } else { //if number of months required overlaps previous years\n var endMonth = last_epiTime.epimonth-1; \n if ((param % 12) > endMonth) { //if number of months required overlaps additional year despite < 12 months\n var startYr = endYr - Math.floor(param/12) - 1;\n var startMonth = endMonth - (((param % 12)-1)-12);\n } else {\n var startYr = endYr - Math.floor(param/12);\n var startMonth = endMonth - ((param % 12)-1);\n };\n };\n } /*else if (rng_type=='epiyear') {\n if (param ==0) { \n var endYr = last_epiTime.epiyear; \n var startYr = endYr;\n } else {\n var endYr = last_epiTime.epiyear-1;\n var startYr = endYr - param + 1;\n }; \n };*/\n\n if (rng_type=='epiweek') {\n for (i=0; i<num_epiwks; i++) { \n if ((g.epitime.all[i].epiyear == startYr) && (g.epitime.all[i].epiyear == endYr)) {\n if ((g.epitime.all[i].epiweek >= startWeek) && (g.epitime.all[i].epiweek <= endWeek)) {\n allDates.push(g.epitime.all[i].epiDate);\n }\n } else if ((g.epitime.all[i].epiyear == startYr) && (g.epitime.all[i].epiweek >= startWeek)) {\n allDates.push(g.epitime.all[i].epiDate);\n } else if ((g.epitime.all[i].epiyear == endYr) && (g.epitime.all[i].epiweek <= endWeek)) {\n allDates.push(g.epitime.all[i].epiDate);\n } else if ((g.epitime.all[i].epiyear > startYr) && (g.epitime.all[i].epiyear < endYr)) {\n allDates.push(g.epitime.all[i].epiDate);\n }\n } \n } else if (rng_type=='epimonth') {\n for (i=0; i<num_epiwks; i++) { \n if ((g.epitime.all[i].epiyear == startYr) && (g.epitime.all[i].epiyear == endYr)) {\n if ((g.epitime.all[i].epimonth >= startMonth) && (g.epitime.all[i].epimonth <= endMonth)) {\n allDates.push(g.epitime.all[i].epiDate);\n }\n } else if ((g.epitime.all[i].epiyear == startYr) && (g.epitime.all[i].epimonth >= startMonth)) {\n allDates.push(g.epitime.all[i].epiDate);\n } else if ((g.epitime.all[i].epiyear == endYr) && (g.epitime.all[i].epimonth <= endMonth)) {\n allDates.push(g.epitime.all[i].epiDate);\n } else if ((g.epitime.all[i].epiyear > startYr) && (g.epitime.all[i].epiyear < endYr)) {\n allDates.push(g.epitime.all[i].epiDate);\n }\n }\n } /*else if (rng_type=='epiyear') {\n for (i=0; i<num_epiwks; i++) { \n if ((epitime_all[i].epiyear >= startYr) && (epitime_all[i].epiyear <= endYr)) {\n allDates.push(epitime_all[i].epiDate);\n } \n }\n } */\n\n var first, last = new Date();\n allDates.sort(date_sort_asc);\n first = allDates[0]; \n last = allDates.pop();\n \n //var dateRange = [new Date(2015,7,31), new Date(2015,10,30)]; //to test\n var dateRange = [first,last];\n return dateRange;\n}", "title": "" }, { "docid": "99e17f2c60a8da3ede46503d41a25c21", "score": "0.5140853", "text": "getDateRange () {\n let t = this\n let dateRange = []\n if (t.dateRange !== undefined) {\n dateRange.push(t.dateRange[0].toISOString().slice(0, 10))\n dateRange.push(t.dateRange[1].toISOString().slice(0, 10))\n }\n return dateRange\n }", "title": "" }, { "docid": "be84d642b832b4b83abb72c7448e2c15", "score": "0.5135704", "text": "isSelected(date) {\n const { startDate, endDate, hoverTime } = this.state;\n const timeArr = [startDate, endDate];\n if (hoverTime) timeArr.push(hoverTime);\n if (date > min(timeArr) && date < max(timeArr)) {\n return 'selected';\n } else if (date === min(timeArr) || date === max(timeArr)) {\n return 'start-or-end-selected';\n }\n return '';\n }", "title": "" }, { "docid": "f04f8afbb403b002bf68a170e3784a6e", "score": "0.51315796", "text": "function matchToResult(match, timezone) {\n var options = { \n weekday: \"long\", month: \"short\", timeZoneName: \"short\",\n day: \"numeric\", hour: \"2-digit\", minute: \"2-digit\"\n };\n \n if (timezone in timezones) {\n options[\"timeZone\"] = timezones[timezone];\n }\n \n var date = new Date(match.startDate);\n var team1 = \"TBA\";\n var team2 = \"TBA\";\n var score1 = 0;\n var score2 = 0;\n if (match.competitors[0] !== null) {\n team1 = match.competitors[0].name;\n score1 = match.scores[0].value;\n }\n if (match.competitors[1] !== null) {\n team2 = match.competitors[1].name;\n score2 = match.scores[1].value;\n }\n return date.toLocaleTimeString(\"en-us\", options) + \": \" + team1 + \" \" + score1 + \"-\" + score2 + \" \" + team2;\n}", "title": "" }, { "docid": "eea2aa767ce569adaa6d2aee049ddc9e", "score": "0.5129424", "text": "function getDateRange(data) {\n // dates are in first row\n var row = data[0];\n // second item is first date\n var fromDate = AmCharts.stringToDate(row[1], dataDateFormat);\n\n // last item is last date\n var toDate = AmCharts.stringToDate(row[row.length - 1], dataDateFormat);\n\n return {\n fromDate: fromDate,\n toDate: toDate\n };\n}", "title": "" }, { "docid": "7f6156c384d8a24b3e4e88b0dfa8c127", "score": "0.5115466", "text": "function webform_date_component_parse_range(component) {\n try {\n var parts = {};\n var keys = ['start_date', 'end_date'];\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (component.extra[key]) {\n var _parts = component.extra[key].split(' ');\n parts[key] = {\n value: parseInt(_parts[0].replace('+', '')),\n interval: _parts[1]\n };\n } \n }\n if (empty(parts)) { return null; }\n return parts;\n }\n catch (error) { console.log('webform_date_component_parse_range - ' + error); }\n}", "title": "" }, { "docid": "02a3593b115d78af0a8b69ead5f47253", "score": "0.5087729", "text": "tipForMatch(match, text) {\n if (!match) {\n return null;\n }\n\n let more = match.l > 150;\n let str = \"<b>match: </b>\" + Utils.shorten(text.substr(match.i, match.l), 150, true, \"i\") + \"<br/><b>range: </b><code>\" + match.i + \"-\" + (match.i + match.l - 1) + \"</code>\";\n let groups = match.groups,\n l = groups && groups.length;\n\n for (let i = 0; i < l; i++) {\n if (i > 3 && l > 5) {\n more = false;\n str += \"<br><span class='more'>see Details for \" + (l - i) + \" more</span>\";\n break;\n }\n\n let group = groups[i],\n s;\n s = group.i !== undefined ? text.substr(group.i, group.l) : group.s;\n more = more || s && s.length > 50;\n str += i > 0 ? \"<br>\" : \"<hr>\";\n str += \"<b>group #\" + (i + 1) + \": </b>\" + Utils.shorten(s, 50, true, \"i\");\n }\n\n if (more) {\n str += \"<br><span class='more'>see Details for full matches</span>\";\n }\n\n return str;\n }", "title": "" }, { "docid": "5d0b4c335ae6930204880fbf5f9c2219", "score": "0.508499", "text": "getYearRange() {\n let [fromYear, toYear] = [elements.rangeInputs[0].value, elements.rangeInputs[1].value];\n elements.rangeInputs.forEach(input => input.value = '');\n if (fromYear === '' || fromYear < 2004 || fromYear > 2016) fromYear = 2004;\n if (toYear === '' || toYear < 2004 || toYear > 2016) toYear = 2016;\n if (fromYear > toYear) fromYear = 2004;\n if (toYear < fromYear) toYear = 2016;\n return [fromYear, toYear];\n }", "title": "" }, { "docid": "10a82113e44d3fe53ede4dd1d9069916", "score": "0.5084561", "text": "function getTimeRangeQuerySnippet() {\r\n\tvar selectedTimeSearchType = $(\"input:radio[name=timeSearch]:checked\").attr(\"id\");\r\n if (selectedTimeSearchType == null || selectedTimeSearchType == \"anytime\") {\r\n return \"\";\r\n }\r\n\r\n var startDate = new Date();//start from today and alter it based on user selection.\r\n switch(selectedTimeSearchType) {\r\n case \"24hr\":\r\n startDate.setDate(startDate.getDate() - 1);\r\n break;\r\n case \"past-week\":\r\n startDate.setDate(startDate.getDate() - 7);\r\n break;\r\n case \"past-month\":\r\n startDate.setDate(startDate.getDate() - 31);//this is an approximation as extreme precision is not required.\r\n break;\r\n default:\r\n return \"\";//should never get here. Though, if it does, ignore time filter.\r\n }\r\n\r\n return \"&as_q=daterange:\" + formatToGSADate(startDate) + \"..\";\r\n}", "title": "" }, { "docid": "d73bc1892614df9d754d06a5272245e5", "score": "0.50729704", "text": "function getDateRange(dataPassed){\r\n\t//called by slider start & end dates\r\n\t//get first object in dataPassed array, and get the date\r\n\tfirstObj=dataPassed.filter(function(d,i){\r\n\t\treturn i==0\r\n\t});\r\n\t//get last object in dataPassed array, and get the date\r\n\tlastObj = dataPassed.filter(function(d,i){\r\n\t\treturn i==dataPassed.length-1\r\n\t});\r\n\tdatefrom = firstObj[0].Day;\r\n\tdateto=lastObj[0].Day;\r\n\tdatejson = {'start':datefrom,'end':dateto};\r\n\treturn datejson;\r\n}", "title": "" }, { "docid": "49972456593ec15fc007a2fc73dfc4bf", "score": "0.5063368", "text": "function dateRangeHeatmapArray(start_date, end_date, dart1, dart2, dart3, first_nine_darts_heatmap_on){\n all_time_heatmap_stats = myAJAX();\n var darts_hit = [];\n //convert dates into numbers:\n start_date_number = parseInt(start_date.substr(6,4).concat(start_date.substr(3,2)).concat(start_date.substr(0,2)));\n end_date_number = parseInt(end_date.substr(6,4).concat(end_date.substr(3,2)).concat(end_date.substr(0,2)));\n if ((dart1 == true && dart2 == true && dart3 == true) || (dart1 == false && dart2 == false && dart3 == false)){\n if (first_nine_darts_heatmap_on == true){\n for (i = 0; i < all_time_heatmap_stats.length; i++)\n {\n if (all_time_heatmap_stats[i]['darts_in_leg'] < 9){\n date_number = parseInt(all_time_heatmap_stats[i]['date'].substr(6,4).concat(all_time_heatmap_stats[i]['date'].substr(3,2)).concat(all_time_heatmap_stats[i]['date'].substr(0,2)));\n if (date_number >= start_date_number && date_number <= end_date_number){\n darts_hit.push(all_time_heatmap_stats[i]['hit_location']);\n }\n }\n }\n }else{\n for (i = 0; i < all_time_heatmap_stats.length; i++)\n {\n date_number = parseInt(all_time_heatmap_stats[i]['date'].substr(6,4).concat(all_time_heatmap_stats[i]['date'].substr(3,2)).concat(all_time_heatmap_stats[i]['date'].substr(0,2)));\n if (date_number >= start_date_number && date_number <= end_date_number){\n darts_hit.push(all_time_heatmap_stats[i]['hit_location']);\n }\n }\n }\n\n }else{\n if (first_nine_darts_heatmap_on == true){\n if (dart1 == true){\n for (i = 0; i < all_time_heatmap_stats.length; i++)\n {\n if (all_time_heatmap_stats[i]['dart_number'] == \"1\" && all_time_heatmap_stats[i]['darts_in_leg'] < 9)\n {\n date_number = parseInt(all_time_heatmap_stats[i]['date'].substr(6,4).concat(all_time_heatmap_stats[i]['date'].substr(3,2)).concat(all_time_heatmap_stats[i]['date'].substr(0,2)));\n if (date_number >= start_date_number && date_number <= end_date_number){\n darts_hit.push(all_time_heatmap_stats[i]['hit_location']);\n }\n }\n }\n }\n if (dart2 == true){\n for (i = 0; i < all_time_heatmap_stats.length; i++)\n {\n if (all_time_heatmap_stats[i]['dart_number'] == \"2\" && all_time_heatmap_stats[i]['darts_in_leg'] < 9)\n {\n date_number = parseInt(all_time_heatmap_stats[i]['date'].substr(6,4).concat(all_time_heatmap_stats[i]['date'].substr(3,2)).concat(all_time_heatmap_stats[i]['date'].substr(0,2)));\n if (date_number >= start_date_number && date_number <= end_date_number){\n darts_hit.push(all_time_heatmap_stats[i]['hit_location']);\n }\n }\n }\n }\n if (dart3 == true){\n for (i = 0; i < all_time_heatmap_stats.length; i++)\n {\n if (all_time_heatmap_stats[i]['dart_number'] == \"3\" && all_time_heatmap_stats[i]['darts_in_leg'] < 9)\n {\n date_number = parseInt(all_time_heatmap_stats[i]['date'].substr(6,4).concat(all_time_heatmap_stats[i]['date'].substr(3,2)).concat(all_time_heatmap_stats[i]['date'].substr(0,2)));\n if (date_number >= start_date_number && date_number <= end_date_number){\n darts_hit.push(all_time_heatmap_stats[i]['hit_location']);\n }\n }\n }\n }\n }else{\n if (dart1 == true){\n for (i = 0; i < all_time_heatmap_stats.length; i++)\n {\n if (all_time_heatmap_stats[i]['dart_number'] == \"1\")\n {\n date_number = parseInt(all_time_heatmap_stats[i]['date'].substr(6,4).concat(all_time_heatmap_stats[i]['date'].substr(3,2)).concat(all_time_heatmap_stats[i]['date'].substr(0,2)));\n if (date_number >= start_date_number && date_number <= end_date_number){\n darts_hit.push(all_time_heatmap_stats[i]['hit_location']);\n }\n }\n }\n }\n if (dart2 == true){\n for (i = 0; i < all_time_heatmap_stats.length; i++)\n {\n if (all_time_heatmap_stats[i]['dart_number'] == \"2\")\n {\n date_number = parseInt(all_time_heatmap_stats[i]['date'].substr(6,4).concat(all_time_heatmap_stats[i]['date'].substr(3,2)).concat(all_time_heatmap_stats[i]['date'].substr(0,2)));\n if (date_number >= start_date_number && date_number <= end_date_number){\n darts_hit.push(all_time_heatmap_stats[i]['hit_location']);\n }\n }\n }\n }\n if (dart3 == true){\n for (i = 0; i < all_time_heatmap_stats.length; i++)\n {\n if (all_time_heatmap_stats[i]['dart_number'] == \"3\")\n {\n date_number = parseInt(all_time_heatmap_stats[i]['date'].substr(6,4).concat(all_time_heatmap_stats[i]['date'].substr(3,2)).concat(all_time_heatmap_stats[i]['date'].substr(0,2)));\n if (date_number >= start_date_number && date_number <= end_date_number){\n darts_hit.push(all_time_heatmap_stats[i]['hit_location']);\n }\n }\n }\n }\n }\n\n }\n return darts_hit;\n}", "title": "" }, { "docid": "b1cc1c149db0061abc3fe808b2384bfc", "score": "0.50588256", "text": "function getDateRange(date) {\n date = (date) ? new Date(date) : new Date();\n return {\n startTime: formatLocalDate(date, \"00:00:00.000\"), \n endTime: formatLocalDate(date, \"23:59:59.999\")\n };\n}", "title": "" }, { "docid": "545e8bc02dc0983ab1ec0525007cbbfd", "score": "0.50575876", "text": "locateRangesForParenth(wordArray) {\n let hrefIndexRanges = [];\n wordArray.forEach((word, i) => {\n if (word[0] === \"(\" && i !== 0) {\n let urlCandidate = wordArray[i-1];\n if (this.isStringAUrl(urlCandidate)) {\n // find index with ending ')'\n let closeParen = this.locateClosingParenth(wordArray, i);\n if (closeParen !== null) {\n hrefIndexRanges.push([i,closeParen]);\n }\n\n }\n }\n });\n return hrefIndexRanges;\n }", "title": "" }, { "docid": "cb5fc48bed0f84462c7b7b63560bd6a7", "score": "0.50550157", "text": "function add_event_fullcalendar(away_match,rematch,teams){\n\tvar info_about_match = new Array();\n\tvar cont = 0;\n\tfor (var i = 0; i < away_match.length; i++) {\n\t\tvar id_teams = away_match[i].title.split('vs');\n\n\t\tvar data = {\n\t\t\ttitle: get_name_team(teams,id_teams[0]) + \" vs \" + get_name_team(teams,id_teams[1]) ,\n\t\t\tstart: away_match[i].start\n\t\t}\n\t\tinfo_about_match.push(data);\n\t}\n\tfor (var i = 0; i < rematch.length; i++) {\n\t\tvar id_teams = rematch[i].title.split('vs');\n\t\tvar data = {\n\t\t\ttitle: get_name_team(teams,id_teams[0]) + \" vs \" + get_name_team(teams,id_teams[1]) ,\n\t\t\tstart: rematch[i].start\n\t\t}\n\t\tinfo_about_match.push(data);\n\t}\n\treturn info_about_match;\n}", "title": "" }, { "docid": "4fafc72ce31c92abd8956b983a1aace3", "score": "0.50365186", "text": "getRange() {\n let range = this.getAttr('range');\n let startOffset = this.getAttr('start-offset');\n let endOffset = this.getAttr('end-offset');\n\n /*\n If just a value is provided for the range, we should\n just assume that's meant to be the max value.\n */\n if(!isArray(range)) {\n range = [0, range || 1];\n }\n\n // If there are offsets provided (to give space for things like axes),\n // apply those to the range.\n if(startOffset) {\n range[0] = range[0] + startOffset;\n }\n\n if(endOffset) {\n console.log(range[1], range);\n range[1] = range[1] - endOffset;\n }\n\n // Reverse the range as necessart\n if(this.getAttr('invert')) {\n range = range.slice(0).reverse();\n }\n\n return range;\n }", "title": "" }, { "docid": "a2d21257c4c59e5af52d326672394a95", "score": "0.50289893", "text": "function check_date(last, match, res)\r\n {\r\n if(last.y !== undefined && last.m !== undefined) { res.y = parseInt(match[1]); res.m = parseInt(match[2]); }\r\n else { res.n = parseInt(match[1]); }\r\n \r\n \r\n // New\r\n if (last.y !== undefined && res.y > last.y) { return 1; } // y-m\r\n else if(last.y !== undefined && last.m !== undefined && res.y === last.y && res.m > last.m) { return 1; } // y-m\r\n else if(last.y === undefined && last.n !== undefined && res.n > last.n) { return 1; } // n\r\n \r\n // Actual\r\n else if(last.y !== undefined && last.m !== undefined && last.y === res.y && last.m === res.m) { return 0; } // y-m\r\n else if(last.y === undefined && last.n !== undefined && last.n === res.n) { return 0; } // n\r\n \r\n // Old\r\n else { return -1; }\r\n }", "title": "" }, { "docid": "5cb115f4a1b3d40f91639d73cee9abe4", "score": "0.5027355", "text": "function getDateRange(pos, format) {\n var fromDate, toDate;\n switch (pos) {\n case 0: //today\n toDate = moment().endOf('day').format(format);\n fromDate = moment().startOf('day').format(format);\n\n break;\n case 1: //yesterday\n fromDate = moment().subtract(1, 'days').startOf('day').format(format);\n toDate = moment().subtract(1, 'days').endOf('day').format(format);\n\n break;\n case 2: //this week\n\n fromDate = moment().startOf('isoWeek').format(format);\n toDate = moment().endOf('isoWeek').format(format);\n\n break;\n case 3: //last week\n fromDate = moment().subtract(1, 'weeks').startOf('isoWeek').format(format);\n toDate = moment().subtract(1, 'weeks').endOf('isoWeek').format(format);\n break;\n case 4: //this month\n fromDate = moment().startOf('month').format(format);\n toDate = moment().endOf('month').format(format);\n break;\n case 5: //last month\n fromDate = moment().subtract(1, 'months').startOf('month').format(format);\n toDate = moment().subtract(1, 'months').endOf('month').format(format);\n break;\n case 6: //last 3 months\n fromDate = moment().subtract(3, 'months').startOf('month').format(format);\n toDate = moment().endOf('month').format(format);\n break;\n case 7: //last 6 months\n fromDate = moment().subtract(6, 'months').startOf('month').format(format);\n toDate = moment().endOf('month').format(format);\n break;\n case 8: //this year\n fromDate = moment().startOf('year').format(format);\n toDate = moment().endOf('year').format(format);\n break;\n case 9: // lifetime\n return {\n from: moment(\"2013-1-1\").format(format),\n to: moment().format(format)\n };\n break;\n default:\n break;\n\n }\n //return the dates\n return {\n from: fromDate,\n to: toDate\n };\n}", "title": "" }, { "docid": "5cb115f4a1b3d40f91639d73cee9abe4", "score": "0.5027355", "text": "function getDateRange(pos, format) {\n var fromDate, toDate;\n switch (pos) {\n case 0: //today\n toDate = moment().endOf('day').format(format);\n fromDate = moment().startOf('day').format(format);\n\n break;\n case 1: //yesterday\n fromDate = moment().subtract(1, 'days').startOf('day').format(format);\n toDate = moment().subtract(1, 'days').endOf('day').format(format);\n\n break;\n case 2: //this week\n\n fromDate = moment().startOf('isoWeek').format(format);\n toDate = moment().endOf('isoWeek').format(format);\n\n break;\n case 3: //last week\n fromDate = moment().subtract(1, 'weeks').startOf('isoWeek').format(format);\n toDate = moment().subtract(1, 'weeks').endOf('isoWeek').format(format);\n break;\n case 4: //this month\n fromDate = moment().startOf('month').format(format);\n toDate = moment().endOf('month').format(format);\n break;\n case 5: //last month\n fromDate = moment().subtract(1, 'months').startOf('month').format(format);\n toDate = moment().subtract(1, 'months').endOf('month').format(format);\n break;\n case 6: //last 3 months\n fromDate = moment().subtract(3, 'months').startOf('month').format(format);\n toDate = moment().endOf('month').format(format);\n break;\n case 7: //last 6 months\n fromDate = moment().subtract(6, 'months').startOf('month').format(format);\n toDate = moment().endOf('month').format(format);\n break;\n case 8: //this year\n fromDate = moment().startOf('year').format(format);\n toDate = moment().endOf('year').format(format);\n break;\n case 9: // lifetime\n return {\n from: moment(\"2013-1-1\").format(format),\n to: moment().format(format)\n };\n break;\n default:\n break;\n\n }\n //return the dates\n return {\n from: fromDate,\n to: toDate\n };\n}", "title": "" }, { "docid": "4030bcdd36854b3b2ca03177a654bcd1", "score": "0.50224", "text": "GetAllDateTimePatterns() {\n\n }", "title": "" }, { "docid": "5f045dc6947155d8a039504ef12ea04e", "score": "0.5010695", "text": "filterByRange(array,start,end){\n let a = array;\n let b = [];\n \n for(var i = 0;i<a.length;i++){\n if(this.stringToDate(a[i].date)>=this.stringToDate(start) && this.stringToDate(a[i].date)<=this.stringToDate(end)){\n b.push(a[i])\n }\n }\n return b;\n }", "title": "" }, { "docid": "6dd34212db67e60f21e7b34b2bee53f2", "score": "0.50106615", "text": "function getAgeGroupFromAge( scheinDateStr, dobStr ) {\n let dobObj = moment( dobStr, \"DD.MM.YYYY\" );\n let age = moment( scheinDateStr ).diff( dobObj, \"years\" ); //patient is still alive when the schein is created so no need to care about date of death\n let matchedRange;\n\n const groupRange = [\n {start: 0, end: 0.9, groupName: \"unter 1 Jahr\"},\n {start: 1, end: 3, groupName: \"1 - 3 Jahre\"},\n {start: 4, end: 7, groupName: \"4 - 7 Jahre\"},\n {start: 8, end: 11, groupName: \"8 - 11 Jahre\"},\n {start: 12, end: 14, groupName: \"12 - 14 Jahre\"},\n {start: 15, end: 29, groupName: \"15 - 29 Jahre\"},\n {start: 30, end: 39, groupName: \"30 - 39 Jahre\"},\n {start: 40, end: 49, groupName: \"40 - 49 Jahre\"},\n {start: 50, end: 59, groupName: \"50 - 59 Jahre\"},\n {start: 60, end: 69, groupName: \"60 - 69 Jahre\"},\n {start: 70, end: 99999, groupName: \"über 70 Jahre\"}\n ];\n\n for( let index = 0; index < groupRange.length; index++ ) {\n if( (groupRange[index].start <= age) && (age <= groupRange[index].end) ) {\n matchedRange = groupRange[index].groupName;\n break;\n }\n }\n return matchedRange;\n }", "title": "" }, { "docid": "fc8a43198abbf66bf6b43bef45655b3f", "score": "0.4998466", "text": "function getEpiRange(rng_type, param) { \n var dateRange = [];\n var allDates = [];\n var num_epiwks = epitime_all.length;\n var last_epiTime = epitime_all[epitime_all.length-1];\n \n //define startYr, endYr, startMonth, endMonth, startWeek, endWeek - depending on rng_type\n if (rng_type=='epiweek') {\n var endYr = last_epiTime.epiyear;\n var endWeek = last_epiTime.epiweek;\n if (param <= num_epiwks) {\n var start_epiTime = epitime_all[num_epiwks-param];\n } else { \n var start_epiTime = epitime_all[0]; //if button goes back further than first date, set to first date\n \n }\n var startWeek = start_epiTime.epiweek;\n var startYr = start_epiTime.epiyear; \n\n } else if (rng_type=='epimonth') {\n var endYr = last_epiTime.epiyear; \n if (param ==0) { //if require current month only\n var endMonth = last_epiTime.epimonth;\n var startYr = endYr;\n var startMonth = endMonth;\n } else if (param <= endMonth) { //if number of months required still within current year\n var endMonth = last_epiTime.epimonth-1; \n var startYr = endYr;\n var startMonth = endMonth - param;\n } else { //if number of months required overlaps previous years\n var endMonth = last_epiTime.epimonth-1; \n if ((param % 12) > endMonth) { //if number of months required overlaps additional year despite < 12 months\n var startYr = endYr - Math.floor(param/12) - 1;\n var startMonth = endMonth - (((param % 12)-1)-12);\n } else {\n var startYr = endYr - Math.floor(param/12);\n var startMonth = endMonth - ((param % 12)-1);\n };\n };\n } /*else if (rng_type=='epiyear') {\n if (param ==0) { \n var endYr = last_epiTime.epiyear; \n var startYr = endYr;\n } else {\n var endYr = last_epiTime.epiyear-1;\n var startYr = endYr - param + 1;\n }; \n };*/\n\n if (rng_type=='epiweek') {\n for (i=0; i<num_epiwks; i++) { \n if ((epitime_all[i].epiyear == startYr) && (epitime_all[i].epiyear == endYr)) {\n if ((epitime_all[i].epiweek >= startWeek) && (epitime_all[i].epiweek <= endWeek)) {\n allDates.push(epitime_all[i].epiDate);\n }\n } else if ((epitime_all[i].epiyear == startYr) && (epitime_all[i].epiweek >= startWeek)) {\n allDates.push(epitime_all[i].epiDate);\n } else if ((epitime_all[i].epiyear == endYr) && (epitime_all[i].epiweek <= endWeek)) {\n allDates.push(epitime_all[i].epiDate);\n } else if ((epitime_all[i].epiyear > startYr) && (epitime_all[i].epiyear < endYr)) {\n allDates.push(epitime_all[i].epiDate);\n }\n } \n } else if (rng_type=='epimonth') {\n for (i=0; i<num_epiwks; i++) { \n if ((epitime_all[i].epiyear == startYr) && (epitime_all[i].epiyear == endYr)) {\n if ((epitime_all[i].epimonth >= startMonth) && (epitime_all[i].epimonth <= endMonth)) {\n allDates.push(epitime_all[i].epiDate);\n }\n } else if ((epitime_all[i].epiyear == startYr) && (epitime_all[i].epimonth >= startMonth)) {\n allDates.push(epitime_all[i].epiDate);\n } else if ((epitime_all[i].epiyear == endYr) && (epitime_all[i].epimonth <= endMonth)) {\n allDates.push(epitime_all[i].epiDate);\n } else if ((epitime_all[i].epiyear > startYr) && (epitime_all[i].epiyear < endYr)) {\n allDates.push(epitime_all[i].epiDate);\n }\n }\n } /*else if (rng_type=='epiyear') {\n for (i=0; i<num_epiwks; i++) { \n if ((epitime_all[i].epiyear >= startYr) && (epitime_all[i].epiyear <= endYr)) {\n allDates.push(epitime_all[i].epiDate);\n } \n }\n } */\n\n var first, last = new Date();\n allDates.sort(date_sort_asc);\n first = allDates[0]; \n last = allDates.pop();\n \n //var dateRange = [new Date(2015,7,31), new Date(2015,10,30)]; //to test\n var dateRange = [first,last];\n return dateRange;\n}", "title": "" }, { "docid": "cfbe35fad70d6ca2e2a76b9a91b9a098", "score": "0.49966788", "text": "function rangeBetween(start, end) {\n\n}", "title": "" }, { "docid": "96bdad62c7117331c27aeb7d81fffeed", "score": "0.4995594", "text": "function dateRequirement() {\n let startDate = document.getElementById(\"start\").value;\n let endDate = document.getElementById(\"end\").value;\n const valiDate = /^\\d{4}-\\d{2}-\\d{2}$/;\n if (startDate.match(valiDate) && endDate.match(valiDate)) {\n concertFilter()\n } else {\n alert(\"Type in your dates\")\n }\n }", "title": "" }, { "docid": "715f32490204020ebf488b0ff212513f", "score": "0.49920198", "text": "dataRange(key, fromDate, toDate) {\n fromDate = this.formatFromDate(fromDate, this.timePeriod.label);\n toDate = this.formatToDate(toDate, this.timePeriod.label);\n let filteredMoments = this.filteredMomentsByDate(fromDate, toDate);\n let dateValues = filteredMoments.map(x => x.dateValue([key]));\n return {dateValues: dateValues}\n }", "title": "" }, { "docid": "4c7c6f3ef22d6b9b80414de46d87ee1b", "score": "0.49802655", "text": "function findDur(dStart, dEnd){\n\t \t\t$scope.d1 = dStart.split(\"\")\n\t \t\t$scope.d2 = dEnd.split(\"\")\n\t \t\t$scope.mo1 = parseInt($scope.d1[5]+$scope.d1[6])\n\t \t\t$scope.mo2 = parseInt($scope.d2[5]+$scope.d2[6])\n\t \t\t$scope.day1 = parseInt($scope.d1[8]+$scope.d1[9])\n\t \t\t$scope.day2 = parseInt($scope.d2[8]+$scope.d2[9])\n\t \t\tconsole.log([$scope.d1,$scope.d2,$scope.mo1,$scope.mo2,$scope.day1,$scope.day2])\n\n\t \t\tif ($scope.mo1 === $scope.mo2\t){\n\t \t\t\tif ($scope.day2 - $scope.day1 < 9){\n\t \t\t\t\treturn $scope.day2 - $scope.day1 +1\n\t \t\t\t} else { \n\t \t\t\treturn 9\n\t \t\t\t}\n\t \t\t}else {\n\t \t\t\tif (($scope.day2 - $scope.day1 + 30) < 9){\n\t \t\t\t\treturn $scope.day2 - $scope.day1 +31\n\t \t\t\t} else { \n\t \t\t\t\treturn 9 \n\t \t\t\t}\n\t \t\t}\n\t\t}", "title": "" }, { "docid": "af0cab960fde638d4af195c4ec9728fe", "score": "0.4972803", "text": "function tekserveRentalsCompareDates(startDate,endDate) {\n\n\tvar oneDay=1000*60*60*24;\n\tvar date1ms = startDate.getTime();\n \tvar date2ms = endDate.getTime();\n \tvar differencems = date2ms - date1ms;\n \tvar differenceDays = Math.round(differencems/oneDay);\n \tvar differenceEdays = 0;\n \tvar differenceWeeks = 0;\n \tvar differenceEweeks = 0;\n \tif (differenceDays > 7) {\n \t\n \t\tif (differenceDays > 13) {\n \t\t\n \t\t\tdifferenceWeeks = 1;\n \t\t\tdifferenceEweeks = Math.floor((differenceDays-7)/7);\n \t\t\tdifferenceEdays = differenceDays - ((differenceEweeks+1)*7);\n \t\t\n \t\t}\n \t\telse {\n \t\t\n \t\t\tdifferenceWeeks = 1;\n \t\t\tdifferenceEdays = differenceDays - 7;\n \t\t\n \t\t}\t//end if (differenceDays > 13)\n \t\n \t}\n \telse if (differenceDays > 1) {\n \t\n \t\tdifferenceEdays = differenceDays - 1;\n \t\n \t}\t//end if (differenceDays > 7)\n \tvar differences = new Array();\n \tdifferences[0] = differenceDays;\n \tdifferences[1] = differenceEdays;\n \tdifferences[2] = differenceWeeks;\n \tdifferences[3] = differenceEweeks;\n \treturn differences;\n\n}\t//end tekserveRentalsCompareDates(startDate,endDate)", "title": "" }, { "docid": "b4abb0cdb57753dcee6a195e5c5db7e8", "score": "0.49559203", "text": "function getValidRange (_results, _resolutionDate, _medianStartDate) {\n let lowerBound, upperBound\n for (var i in _results) {\n const result = _results[i]\n if (result.date > _medianStartDate && !lowerBound) {\n lowerBound = result.index\n }\n if (result.date > _resolutionDate && !upperBound) {\n upperBound = result.index - 1\n }\n }\n return [lowerBound, upperBound]\n}", "title": "" }, { "docid": "549da42e62ec6c1553ed768355bde06c", "score": "0.49445552", "text": "function RangeMatcher( ranges, include )\n{\n // list of [ start, end ]\n this.ranges = ranges;\n this.include = include; // boolean\n}", "title": "" }, { "docid": "685624bacfcaa80452790dd2d9f281e5", "score": "0.49238288", "text": "static rangeDate(dateInit, dateEnd) {\n const diaInit = moment(dateInit).format('DD');\n const mesInit = moment(dateInit).format('MM');\n const anoInit = moment(dateInit).format('YYYY');\n const diaEnd = moment(dateEnd).format('DD');\n const mesEnd = moment(dateEnd).format('MM');\n\n let value = '';\n\n if (diaInit === diaEnd && mesInit === mesEnd) {\n value = `${diaInit} de ${this.mesString(mesInit)}, ${anoInit}`;\n } else if (diaInit !== diaEnd && mesInit === mesEnd) {\n value = `${diaInit} a ${diaEnd} de ${this.mesString(\n mesInit,\n )}, ${anoInit}`;\n } else {\n value = `${diaInit} de ${this.mesString(mesInit)} a ${this.mesString(\n mesEnd,\n )} de ${this.mesString(mesInit)}, ${anoInit}`;\n }\n return value;\n }", "title": "" }, { "docid": "13c61868220335d9cd8db1b4723e43b1", "score": "0.49223644", "text": "function getAmazonDateValueRange(dateValue, timeZoneName) {\n var dateSlotRange = {\n startDateTime: null, // starting dateTime as a moment object\n endDateTime: null, // moment Ending date time. will be null if only a startDateTime\n friendlyName: null, // set to week, weekend, etc. to help with dialog returned back to user.\n errorMessage: null // set if an error occured parsing the dateValue.\n };\n\n var rawDate = dateValue;\n\n // check if no dateValue then use the current time.\n if (!rawDate) {\n // if no time of day specified then startDateTime as \"now\". \n dateSlotRange.startDateTime = new moment.tz(timeZoneName);\n return dateSlotRange;\n }\n\n // if have a dateValue then see if can parse the normal YYYY-MM-DD.\n // Ideally could use moment for this but moment is trating the weekend type dates as valid\n // so use date.parse to determine but then need to use moment for the proper time zone.\n if (Date.parse(rawDate)) {\n dateSlotRange.startDateTime = new moment.tz(rawDate, \"YYYY-MM-DD\", timeZoneName)\n return dateSlotRange;\n }\n\n // check if this could be a weekend or weekday item.\n var res = rawDate.split(\"-\");\n\n // if we have 2 bits that include a 'W' week number\n if (res.length === 2 && res[1].indexOf('W') > -1) {\n dateSlotRange.startDateTime = new moment.tz(rawDate, \"YYYY-[W]WW\", timeZoneName);\n dateSlotRange.endDateTime = dateSlotRange.startDateTime.clone().add(7, 'days');\n dateSlotRange.friendlyName = \"week\";\n } else if (res.length === 3) {\n // \"GGGG-[W]WW-WE\"\n dateSlotRange.startDateTime = new moment.tz(rawDate, \"YYYY-[W]WW[-WE]\", timeZoneName);\n dateSlotRange.startDateTime.add(5, 'days');\n dateSlotRange.endDateTime = dateSlotRange.startDateTime.clone().add(2, 'days');\n dateSlotRange.friendlyName = \"weekend\";\n }\n\n // Check the startDateTime if its null or invalid then return an error.\n if (null == dateSlotRange.startDateTime || !dateSlotRange.startDateTime.isValid()) {\n dateSlotRange.errorMessage = \"unable to parse Date:\" + rawDate;\n dateSlotRange.startDateTime = null;\n dateSlotRange.endDateTime = nuill;\n }\n\n return dateSlotRange;\n}", "title": "" }, { "docid": "a030076793294451a64d2199a8dca65d", "score": "0.49118677", "text": "function getRangeBetween(x, y) {\n\n}", "title": "" }, { "docid": "7082b71959d9ecba1dcd878243cf3904", "score": "0.48980537", "text": "function modDateRange(data){\n d3.select(\"#date-range\").text(data[0].Date + \" to \" + data[data.length-1].Date)\n}", "title": "" }, { "docid": "89a4b91fd149f12ca0f9d8df3fe7d19b", "score": "0.48964268", "text": "function getDateRange(weekNo, y=2020){ //set to 2020 for testing\n var d1, numOfdaysPastSinceLastMonday, rangeIsFrom, rangeIsTo;\n d1 = new Date(''+y+'');\n numOfdaysPastSinceLastMonday = d1.getDay() - 1;\n d1.setDate(d1.getDate() - numOfdaysPastSinceLastMonday);\n d1.setDate(d1.getDate() + (7 * (weekNo - d1.getWeek())));\n rangeIsFrom = (d1.getMonth() + 1) + \"-\" + d1.getDate() + \"-\" + d1.getFullYear();\n d1.setDate(d1.getDate() + 6);\n rangeIsTo = (d1.getMonth() + 1) + \"-\" + d1.getDate() + \"-\" + d1.getFullYear() ;\n return rangeIsFrom + \" to \" + rangeIsTo;\n}", "title": "" }, { "docid": "debcf4817aa358318c719e88181c258c", "score": "0.4889228", "text": "rangeSelector() {\n\t\t// console.log('this.range_out_of_bounds', this.state.range_out_of_bounds);\n\t\treturn <div className='station-name-date'>\n\t\t\t<div className='head station-title hellip'>{this.state.details && this.state.details.name ? this.state.details.name : (this.state.station_name_list && Object.keys(this.state.station_name_list).length ? this.state.station_name_list[this.props.match.params.station_id] : '')}</div>\n\t\t\t<div className='date-range-container'>\n\t\t\t\t<div className=\"range-warning\">{/*this.state.range_out_of_bounds ? \n\t\t\t\t\t'Date Range cannot exceed 7 days!' : ''\n\t\t\t\t*/}\n\t\t\t\t</div>\n\t\t\t\t<div className=\"from-time-picker\">\n\t\t\t\t\t<RangePicker\n\t\t\t\t\t\tclassName=\"calendar-icon\"\n\t\t\t\t\t\tallowClear={false}\n\t\t\t\t\t\tformat=\"DD-MM-YYYY HH:mm\"\n\t\t\t\t\t\tshowTime={{ \n\t\t\t\t\t\t\tformat: 'HH:mm',\n\t\t\t\t\t\t\t// defaultValue: [moment('00:00:00', 'HH:mm'), moment('23:59:59', 'HH:mm')],\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tplaceholder={['From', 'To']}\n\t\t\t\t\t\tdisabledDate={disabledDate}\n\t\t\t\t\t\tvalue= {[this.state.from_time ? moment(this.state.from_time, \"DD-MM-YYYY HH:mm\").tz('Asia/Kolkata') : '', this.state.upto_time ? moment(this.state.upto_time, \"DD-MM-YYYY HH:mm\").tz('Asia/Kolkata') : '']}\n\t\t\t\t\t\tonChange={(a,b) => this.dateTimeChange(a,b)}\n\t\t\t\t\t\tonOk={(a,b,c) => this.callAPI(a,b,c)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t}", "title": "" }, { "docid": "51263b1e6a47b59620ff710e49f3e84c", "score": "0.48890278", "text": "function rebuild_date_range_view_information() {\n\t\n\t// get the start epoch datetime\n\tvar start_date_selection_menu = gebi(\n\t\t\t\t\t\t\t\t\"date_range_view_start_date_dropdown_menu\");\n\tvar start_epoch_datetime = parseInt(start_date_selection_menu.value);\n\t\n\t// get the end epoch datetime\n\tvar end_date_selection_menu = gebi(\n\t\t\t\t\t\t\t\t\"date_range_view_end_date_dropdown_menu\");\n\tvar end_epoch_datetime = parseInt(end_date_selection_menu.value);\n\t\n\t// if the end epoch datetime isn't after the start epoch datetime:\n\t// 1. alert the user to this\n\t// 2. return without doing anything else\n\tif (end_epoch_datetime <= start_epoch_datetime) {\n\t\talert(\"Please select an END DATE that comes after the START DATE.\");\n\t\treturn;\n\t}\n\n\t// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\t// if we've fallen through, we've got an end epoch datetime that comes after\n\t// the start epoch datetime. Rebuild the two graphs and the information\n\t// below them.\n\t// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\t\n\t// adjust start epoch datetime to 00:01 on the same day\n\tvar start_epoch_datetime = adjust_epoch_datetime_to_time_on_same_day(\n\t\t\t\t\t\t\t\t\t\t\t\tstart_epoch_datetime, \"00:01\");\n\t\n\t// adjust end epoch datetime to 23:59 on the same day\n\tvar end_epoch_datetime = adjust_epoch_datetime_to_time_on_same_day(\n\t\t\t\t\t\t\t\t\t\t\t\tend_epoch_datetime, \"23:59\");\n\t\n\t// build an array containing all marked entries (not indexed by username)\n\tvar all_marked_entries = [];\n\tvar entry_keys = Object.keys(marked_entries);\n\tfor (var i = 0; i < entry_keys.length; ++i) {\n\t\tvar username = entry_keys[i];\n\t\tvar entries_for_single_user = marked_entries[username];\n\t\tfor (var j = 0; j < entries_for_single_user.length; ++j) {\n\t\t\tvar entry = entries_for_single_user[j];\n\t\t\tall_marked_entries.push(JSON.parse(\n\t\t\t\t\t\t\t\t\tJSON.stringify(entry)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t}\n\t}\n\n\t// find all the marked entries for fixtures that take place between\n\t// start_epoch_datetime and end_epoch_datetime\n\tvar marked_entries_in_date_range = [];\n\tfor (var i = 0; i < all_marked_entries.length; ++i) {\n\t\tmarked_entry = all_marked_entries[i];\n\t\t// var fixture = indexed_karl_marked_fixtures\n\t\tvar fixture_id = marked_entry[\"fixture_id\"];\n\t\tvar fixture = indexed_karl_marked_fixtures[fixture_id];\n\t\t// get the epoch datetime for the fixture\n\t\t// build_epoch_datetime_from_karl_marked_fixture(fixture)\n\t\tvar epoch_datetime = build_epoch_datetime_from_karl_marked_fixture(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfixture);\n\t\t\n\t\t// if the epoch datetime for the fixture lies between\n\t\t// start_epoch_datetime and end_epoch_datetime, push the marked_entry\n\t\t// onto the array marked_entries_in_date_range\n\t\tif ((epoch_datetime >= start_epoch_datetime)\n\t\t\t\t&& (epoch_datetime <= end_epoch_datetime)) {\n\t\t\tmarked_entries_in_date_range.push(marked_entry);\n\t\t}\n\t}\n\t\n\t// build a list of users with entries in the date range\n\tvar users = [];\n\tfor (var i = 0; i < marked_entries_in_date_range.length; ++i) {\n\t\tvar marked_entry = marked_entries_in_date_range[i];\n\t\tvar entry_id = marked_entry[\"entry_id\"];\n\t\tvar entry = indexed_entries[entry_id];\n\t\tvar user = entry[\"username\"];\n\t\tif (users.indexOf(user) == -1) {\n\t\t\tusers.push(user);\n\t\t}\n\t}\n\n\t// work out how many points each user won for the fixtures that took place\n\t// between start_epoch_datetime and end_epoch_datetime\n\tvar users_and_points = {};\n\t// set initial points for all users to zero\n\tfor (var i = 0; i < users.length; ++i) {\n\t\tvar username = users[i];\n\t\tusers_and_points[username] = 0;\n\t}\n\t// loop through all marked_entries_in_date_range and add up all the points\n\t// for all users\n\tfor (var i = 0; i < marked_entries_in_date_range.length; ++i) {\n\t\tvar marked_entry = marked_entries_in_date_range[i];\n\t\tvar total_points_from_entry = parseFloat(marked_entry[\"match_points_won\"]);\n\t\ttotal_points_from_entry += parseFloat(\n\t\t\t\t\t\t\tmarked_entry[\"correct_score_points_won\"]);\n\t\t// get user\n\t\tvar entry_id = marked_entry[\"entry_id\"];\n\t\tvar entry = indexed_entries[entry_id];\n\t\tvar user = entry[\"username\"];\n\t\t// add the points to the users's total in users_and_points\n\t\tusers_and_points[user] += total_points_from_entry;\n\t}\n\t// round the points for all users to 2 decimal places\n\tfor (var i = 0; i < users.length; ++i) {\n\t\tvar user = users[i];\n\t\tusers_and_points[user] = round_to_two_decimal_places(\n\t\t\t\t\t\t\t\t\t\t\t\t\tusers_and_points[user]);\n\t}\n\t\n\t// work out the total number of points won in the selected time period\n\tvar total_points_for_all_users = 0;\n\tfor (var i = 0; i < users.length; ++i) {\n\t\tvar user = users[i];\n\t\ttotal_points_for_all_users += users_and_points[user];\n\t}\n\ttotal_points_for_all_users = round_to_two_decimal_places(\n\t\t\t\t\t\t\t\t\t\t\t\ttotal_points_for_all_users);\n\t\n\t// work out what percentage of total points each user won in the selected\n\t// time period\n\tvar one_percent_of_total_points = total_points_for_all_users / 100;\n\tvar users_and_percentages = {};\n\tfor (var i = 0; i < users.length; ++i) {\n\t\tvar user = users[i];\n\t\tvar user_points = users_and_points[user];\n\t\tvar user_percentage = user_points / one_percent_of_total_points;\n\t\tusers_and_percentages[user] = round_to_two_decimal_places(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tuser_percentage);\n\t}\n\n\t// build a bar chart displaying total points won by each user\n\t// (vertical or horizontal?)\n\tbuild_total_points_per_user_bar_chart_for_date_range_view(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tusers_and_points);\n\t\n\t// build the pie chart containing the percentage of total points won in\n\t// the timed period for each user\n\tbuild_percentage_of_total_points_per_user_pie_chart_for_date_range_view(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tusers_and_percentages);\n\n\t// build the table below the TOTAL POINTS PER USER bar chart, containing a\n\t// list of users and the total points they won, in order, from greatest\n\t// number of users to least\n\tbuild_total_points_per_user_table(users_and_points);\n\n\t// build the table below the % OF TOTAL POINTS PER USER, containing a list\n\t// of users and the percentage of total points they won, from greatest\n\t// percentage of total points to least\n\tbuild_percentage_of_total_points_per_user_table(users_and_percentages);\n\n\treturn;\n}", "title": "" }, { "docid": "1d11f50b98506845589702743bfb7098", "score": "0.48883", "text": "function getDateRange() {\n var today = new Date();\n var month = twoDigit(today.getMonth() + 1);\n var day = twoDigit(today.getDate());\n\n var currentDate = '-' + month + '%2F' + day + '%2F' + today.getFullYear();\n dateRange = initialDate + currentDate;\n}", "title": "" }, { "docid": "37f6a83f1c1c5559a432a5614eab3aad", "score": "0.48832506", "text": "ranges() {\n let items = []\n if (this.props.List) {\n items = this.props.List() || []\n } else {\n console.warn('No List() function was provided for Summary Progress')\n }\n\n const julianMax = julian(daysAgo(today, 365 * this.total()))\n\n return items.sort(rangeSorter).map((dates) => {\n let left = 0\n let width = 0\n const dfrom = extractDate(dates.from)\n const dto = dates.present === true ? new Date() : extractDate(dates.to)\n\n if (dfrom && dto) {\n const from = julian(dfrom)\n const to = julian(dto)\n\n if (from >= julianMax || to >= julianMax) {\n // Meat of the calculations into percentages\n const right = findPercentage(julianNow, julianMax, to)\n left = findPercentage(julianNow, julianMax, from)\n\n if (right >= 0) {\n width = right - left\n }\n\n // Check boundaries\n if (width < 0) {\n width = 0\n }\n\n if (width > 100) {\n width -= Math.abs(left)\n }\n\n if (left < 0) {\n left = 0\n }\n }\n }\n\n // Add the range to the collection\n return {\n left,\n width: decimalAdjust('round', width, -2),\n dates,\n }\n })\n }", "title": "" }, { "docid": "d7fdd5d410163395f43dcdbb08d8317b", "score": "0.48799598", "text": "function fromDayName(fn) {\n return function(match) {\n var dayname = fn(match),\n wday = ($a = ($b = $scope.get('DAYNAMES')).$map, $a.$$p = \"downcase\".$to_proc(), $a).call($b).indexOf((dayname).$downcase());\n\n return current_day - current_wday + wday;\n }\n }", "title": "" }, { "docid": "5cb60b168ee9c6bf8a08f984c994e455", "score": "0.48790243", "text": "function addMatchesToPastMatchesArray(matches) {\n\n //only for matches that ended at 90 mins\n past_matches = [];\n\n $.each(matches, function (index, match) {\n let single_match = {};\n single_match['Id'] = match.Id;\n single_match['HomeTeamName'] = match.HomeTeam.ShortName;\n single_match['HomeTeamFlag'] = match.HomeTeam.Area.Name.toLowerCase() + \"/\" + match.HomeTeam.Flag;\n single_match['AwayTeamName'] = match.AwayTeam.ShortName;\n single_match['AwayTeamFlag'] = match.AwayTeam.Area.Name.toLowerCase() + \"/\" + match.AwayTeam.Flag;;\n single_match['Competition'] = match.Competition.Name;\n single_match['ScoreHome'] = match.Score.FullTime.HomeTeam;\n single_match['ScoreAway'] = match.Score.FullTime.AwayTeam;\n single_match['Date'] = match.UtcDate;\n\n past_matches.push(single_match);\n });\n\n}", "title": "" }, { "docid": "80173e1f9de7d8f9e3eb00405e7ad875", "score": "0.48771313", "text": "getRange () {\n const range = Object.create(null)\n range.start = this.range.start\n range.end = this.range.end\n range.padFront = this.range.padFront\n range.padBehind = this.range.padBehind\n return range\n }", "title": "" }, { "docid": "727273774fecec7caeab9ea073f0f956", "score": "0.48762357", "text": "function setRangeTimeArray(){\n\n var s = new Date($scope.start);\n var e = new Date($scope.end);\n var nbDay = dateDiff(s, e);\n\n if(nbDay.day==0){\n $scope.BenefitByDate[moment(new Date(s)).format('HH:mm:ss')] = 0;\n\n while( s.getHours() < e.getHours() ) {\n s.setHours(s.getHours() + 1);\n $scope.BenefitByDate[moment(new Date(s)).format('HH:mm:ss')] = 0;\n }\n return 'hour';\n }\n else{\n $scope.BenefitByDate[moment(new Date(s)).format('YYYY-MM-DD')] = 0;\n while( s < e ){\n s.setDate(s.getDate() + 1);\n $scope.BenefitByDate[moment(new Date(s)).format('YYYY-MM-DD')] = 0;\n }\n return 'day';\n }\n }", "title": "" }, { "docid": "116672c9da2e58a47b29730d039f9f98", "score": "0.48683998", "text": "dataRanges(historyTimePeriod, key, fromDate, toDate, label, strokeWidth) {\n let chartData = [];\n let historyName = Stack.historyNames(historyTimePeriod);\n\n for (const stack of this.stacks) {\n if (stack[historyName][key] !== false) {\n let historyChartData = stack[historyName].chartDataRange(key, fromDate, toDate, stack[label], false, strokeWidth);\n if (historyChartData !== false) {\n chartData.push(stack[historyName].chartDataRange(key, fromDate, toDate, stack[label], false, strokeWidth));\n }\n }\n }\n return chartData;\n }", "title": "" }, { "docid": "740cd2e3156f32a94c07bc8cfefa4af3", "score": "0.48650888", "text": "prevMatchInRange(doc, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - 10000 /* ChunkSize */ - this.unquoted.length);\n let cursor = this.cursor(doc, start, pos), range = null;\n while (!cursor.nextOverlapping().done)\n range = cursor.value;\n if (range)\n return range;\n if (start == from)\n return null;\n pos -= 10000 /* ChunkSize */;\n }\n }", "title": "" }, { "docid": "6a685023b33411a9220a8cf52d463ecd", "score": "0.4860487", "text": "formatRangeToParts(start, end) {\n // @ts-ignore\n if (typeof this.numberFormatter.formatRangeToParts === \"function\") // @ts-ignore\n return this.numberFormatter.formatRangeToParts(start, end);\n if (end < start) throw new RangeError(\"End date must be >= start date\");\n let startParts = this.numberFormatter.formatToParts(start);\n let endParts = this.numberFormatter.formatToParts(end);\n return [\n ...startParts.map((p)=>({\n ...p,\n source: \"startRange\"\n })),\n {\n type: \"literal\",\n value: \" – \",\n source: \"shared\"\n },\n ...endParts.map((p)=>({\n ...p,\n source: \"endRange\"\n }))\n ];\n }", "title": "" }, { "docid": "5818856eb81e810ff2bc005cc1d1b52f", "score": "0.48408717", "text": "function computeDateFilterDisplay() {\n\t\tif (that.startDate == null && that.endDate == null) { return \"\"; }\n\t\telse if (that.startDate != null && that.endDate == null) { return \"<br>after \" + (new Date(that.startDate)).toISOString(); }\n\t\telse if (that.startDate == null && that.endDate != null) { return \"<br>before \" + (new Date(that.endDate)).toISOString(); }\n\t\telse {\t\t\t\n\t\t\treturn \"<br>\"+ (new Date(that.startDate)).toISOString() + \" to \" + (new Date(that.endDate)).toISOString();\n\t\t}\n\t}", "title": "" }, { "docid": "ee6c63308d5b8c9ecacf662d59acd033", "score": "0.48348376", "text": "getPreviousRange() {\n var date = new Date(), y = date.getFullYear(), m = date.getMonth() - 1;\n var firstDay = new Date(y, m, 1);\n var lastDay = new Date(y, m + 1, 0);\n\n return (\n { firstDay: moment(firstDay).format(\"DD/MM/YYYY\"), lastDay: moment(lastDay).format(\"DD/MM/YYYY\") }\n )\n }", "title": "" }, { "docid": "0c368803e3d39c450141d779fdcbf8e4", "score": "0.48286965", "text": "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n var rangeArr = [];\n if (start < end) {\n for (var i = start; i <= end; i++) {\n rangeArr.push(i);\n } return rangeArr;\n } else if (end < start) {\n for (var i = start; i >= end; i--) {\n rangeArr.push(i);\n } return rangeArr;\n }\n \n // YOUR CODE GOES ABOVE HERE //\n}", "title": "" }, { "docid": "44b4e027f78cb986eaacd3e4e37c7cf5", "score": "0.4823301", "text": "function getDateRangeOfWeek(weekNo, y) {\n var d1, numOfdaysPastSinceLastMonday, rangeIsFrom, rangeIsTo;\n d1 = new Date(''+y+'');\n numOfdaysPastSinceLastMonday = d1.getDay() - 1;\n d1.setDate(d1.getDate() - numOfdaysPastSinceLastMonday);\n d1.setDate(d1.getDate() + (7 * (weekNo - d1.getWeek())));\n rangeIsFrom = d1.getFullYear() + \"-\" + (d1.getMonth() + 1) + \"-\" + d1.getDate();\n d1.setDate(d1.getDate() + 7);\n rangeIsTo = d1.getFullYear() + \"-\" + (d1.getMonth() + 1) + \"-\" + d1.getDate();\n return [rangeIsFrom, rangeIsTo];\n}", "title": "" }, { "docid": "b98f52d5f665ca1c9b5461a8dac0c589", "score": "0.48124227", "text": "function avrgMinMaxRange(data,minDate,maxDate) {\n\t\n\tminDate = Math.round(minDate);\n\tmaxDate = Math.round(maxDate);\n\t\n\tvar rangeData = data.filter(function(d) {\n\t\treturn d[0] >= minDate && d[0] <= maxDate;\n\t});\n\t\n\tvar min = d3.min(data,function(d) { return d[2]; });\n\tvar max = d3.max(data,function(d) { return d[2]; });\n\n\tg_avrg = [min,max];\n\t\n\tmin = Math.floor(min);\n\tmax = Math.floor(max) + 5;\n\t\n\tmin -= min % 5;\n\tmax -= max % 5;\n\t\n\treturn [min,max];\t\n}", "title": "" }, { "docid": "7a723c16d89571a472760209bc9b1289", "score": "0.48117456", "text": "function getSBIDates(year = (new Date()).getFullYear()) {\n const first = new Date(year, 10, 1);\n const dayOfWeek = first.getDay();\n const thanksgiving = 22 + (11 - dayOfWeek) % 7;\n const startDate = new Date(year, 10, thanksgiving + 1);\n const endDate = new Date(startDate.getFullYear(), startDate.getMonth(), thanksgiving + 3);\n const dateRange = [startDate, endDate].map(it => `${it.getMonth() + 1}/${it.getDate()}/${it.getFullYear()}`);\n console.log('Date Range:', dateRange);\n return dateRange;\n}", "title": "" }, { "docid": "430531a333c9b4c8977c827bc7645f3b", "score": "0.48110405", "text": "function filterdate() {\n\t\tif (datetoggle) {\n\t\t\tvar min = $(\"#time_slide\").dateRangeSlider(\"min\");\n\t\t\tvar max = $(\"#time_slide\").dateRangeSlider(\"max\");\n\n\t\t\td3.selectAll(\"circle\")\n\t\t\t\t.filter(function(d) { return this.style.display != \"none\"; })\n\t\t\t\t.style(\"display\", function(d) { \n\t\t\t\t\t return (parseDate(d.lastdate) >= min &&\n\t\t\t\t\t \t parseDate(d.lastdate) <= max) ? null : \"none\"; });\n\t\t\tif (edgetoggle) {\n\t\t\t\td3.selectAll(\"line\")\n\t\t\t\t\t.filter(function(d) { return this.style.display != \"none\"; })\n\t\t\t\t\t.style(\"display\", function(d) {\n\t\t\t\t\t\t return ((parseDate(vis.ndata[d.source.index].lastdate) >= min &&\n\t\t\t\t\t\t \t parseDate(vis.ndata[d.source.index].lastdate) <= max) &&\n\t\t\t\t\t\t \t (parseDate(vis.ndata[d.target.index].lastdate) >= min &&\n\t\t\t\t\t\t \t parseDate(vis.ndata[d.target.index].lastdate) <= max)) ? null : \"none\"; });\n\t\t\t}\t\n\t\t\td3.selectAll(\"#slidetxt\")\n\t\t\t\t.html(\"Last seeded between \" + formatdate(min) + \" and \" + formatdate(max));\n\t\t}\n\t}", "title": "" }, { "docid": "be482732387d5c9fdebd7883e51af581", "score": "0.48108995", "text": "function get_last_date(all_matches){\n\tvar last_date = all_matches[0].start;\n\tvar temp_date = \"\";\n\tfor (var i = 0; i < all_matches.length; i++) {\n\t\ttemp_date = all_matches[i].start;\n\t\ttemp_date = temp_date.split('T')[0];\n\t\tif( temp_date > last_date){\n\t\t\tlast_date = temp_date;\n\t\t}\n\t}\n\treturn last_date;\n}", "title": "" }, { "docid": "972327d4f1e7056e8f901d781def520e", "score": "0.48104128", "text": "timeline () {\n // Loop through the collected ranges and output as elements\n //\n // Example: 10 years ago |----- Gap -----|----- Filled -----|----- Gap -----| Today\n // Imagine 10 years ago is 0% and today is 100%\n return this.ranges().map((range) => {\n const styles = {\n left: '' + range.left + '%',\n width: '' + range.width + '%'\n }\n return <div className=\"filled\" style={styles}></div>\n })\n }", "title": "" }, { "docid": "db6a38343b4bc237b842b90b60908426", "score": "0.48091587", "text": "function createfilterfordates() {\n var filter = \"\";\n\n //filter = \"Type:Radio\";\n\n if (datebegin() != null && dateend() == null) {\n // [1995-12-31T23:59:59.999Z TO *]\n //Substract 1 millisecond from date before converting to string.\n filter += \"PubStartDate:[\" + format.getSolrDateStr(new Date(datebegin()), -1) + \" TO *]\";\n } else if (datebegin() == null && dateend() != null) {\n // [* TO 2007-03-06T00:00:00Z]\n //Add 1 millisecond from date before converting to string.\n filter += \"PubStartDate:[* TO \" + format.getSolrDateStr(new Date(dateend()), 1) + \"]\";\n //filter += \"PubStartDate:[1900-01-01T00:00:00.000Z TO \" + format.getSolrDateStr(new Date(dateend())) + \"]\";\n } else if (datebegin() != null && dateend() != null) {\n // [1995-12-31T23:59:59.999Z TO 2007-03-06T00:00:00Z]\n //Substract and add 1 millisecond from/to dates before converting to string.\n filter += \"PubStartDate:[\" + format.getSolrDateStr(new Date(datebegin()), -1) + \" TO \" + format.getSolrDateStr(new Date(dateend()), 1) + \"]\";\n }\n\n return filter;\n }", "title": "" }, { "docid": "b07812a56fe6a7cc6d5c050d32d4c5ca", "score": "0.48011553", "text": "function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(marker_1.diffDays(timedRange.start, timedRange.end)) || 1;\n var start = marker_1.startOfDay(timedRange.start);\n var end = marker_1.addDays(start, dayCnt);\n return { start: start, end: end };\n}", "title": "" }, { "docid": "782033e32b1eb210b359f9351b9da905", "score": "0.4795113", "text": "computeTimeBoundaries() {\n const allJourneyPatterns = [\n this.journeyPatternMix.referenceJP,\n ...this.journeyPatternMix.otherJPs.map(({ journeyPattern }) => journeyPattern),\n ];\n\n let minTime = allJourneyPatterns[0].firstAndLastTimes.first;\n let maxTime = allJourneyPatterns[0].firstAndLastTimes.last;\n\n for (const journeyPattern of allJourneyPatterns) {\n const { firstAndLastTimes: { first, last } } = journeyPattern;\n if (first < minTime) minTime = first;\n if (last > maxTime) maxTime = last;\n }\n\n this.minTime = minTime;\n this.maxTime = maxTime;\n }", "title": "" }, { "docid": "c0bf02cce5fd5c6cdaad5f1b133da830", "score": "0.4791354", "text": "function validate_range () {\n var range = [$('#_seq_from').val(),$('#_seq_to').val()].map (function (d) { return parseInt (d); });\n \n if (range[0] < 1) {\n range[0] = 1;\n }\n if (range[1] > _alignment_length) {\n range[1] = _alignment_length;\n }\n \n $('#_seq_from').val(range[0]);\n $('#_seq_to').val(range[1]);\n \n return range;\n }", "title": "" }, { "docid": "99008d3f49c9acfc3e3c3e1c265fc5c9", "score": "0.47907424", "text": "function fromDayName(fn) {\n return function(match) {\n var dayname = fn(match),\n wday = $send(Opal.const_get_relative($nesting, 'DAYNAMES'), 'map', [], \"downcase\".$to_proc()).indexOf((dayname).$downcase());\n\n return current_day - current_wday + wday;\n }\n }", "title": "" }, { "docid": "c42c17122ce3df4a2517a7ee90c0e738", "score": "0.47881696", "text": "function cbb(start, end) {\n reportrange_startDate = start;\n reportrange_endDate = end;\n jQuery(\"#reportrange span\").html(start.format(\"MMMM D, YYYY\") + \" - \" + end.format(\"MMMM D, YYYY\"));\n }", "title": "" }, { "docid": "ce9254aae16706629aba5c211eb75618", "score": "0.47836053", "text": "function ConvertAgentDatesToStrings() {\r\n //console.log(\"ConvertAgentDatesToString()\");\r\n for (var i = 0; i < _searchAgents.length; i++)\r\n {\r\n var startDate = new Date(_searchAgents[i].DateFrom);\r\n var endDate = new Date(_searchAgents[i].DateTo);\r\n //console.log(\"BEFORE agent \" + _searchAgents[i].ID + \" start \" + startDate.toISOString() + \" end \" + endDate.toISOString());\r\n _searchAgents[i].DateFrom = startDate.toISOString().substr(0, 10);\r\n _searchAgents[i].DateTo = endDate.toISOString().substr(0, 10);\r\n //console.log(\"AFTER agent \" + _searchAgents[i].ID + \" start \" + _searchAgents[i].DateFrom + \" end \" + _searchAgents[i].DateTo);\r\n }\r\n}", "title": "" }, { "docid": "e721eb068cf3b1f35cc19332f1a42e8c", "score": "0.4782348", "text": "function RangeDate(startDate,endDate){\n\tvar condition = \" >= '\" + startDate.getFullYear() + \"-\" + ('0'+ (startDate.getMonth() + 1 )).substr(-2) + \"-\" + ('0' + startDate.getDate()).substr(-2) \n\t\t\t\t\t\t\t + \"T00:00:00.000+08:00' and timestamp <= '\" + endDate.getFullYear() + \"-\" + ('0'+ (endDate.getMonth() + 1 )).substr(-2) + \"-\" + ('0' \n\t\t\t\t\t\t\t + endDate.getDate()).substr(-2) + \"T23:59:59.999+08:00'\";\n\treturn condition;\n}", "title": "" }, { "docid": "3c94d75c18d82223e8df1752570ea508", "score": "0.47754163", "text": "function getForMatch()\n {\n return new RegExp('(\\\\'+_start.split('').join('\\\\')+')(.*?)(for)(.*?)(loop)(.*?)(\\\\'+_end.split('').join('\\\\')+')','g');\n }", "title": "" }, { "docid": "96c58131d1c8e11055e3aff542ed8bac", "score": "0.47718877", "text": "getRecordStartEndTimes() {\n let _dur = this.audio.sound.duration\n let _s = this.state.range.sliderValue[0]\n let _e = this.state.range.sliderValue[1]\n let _diff = _e - _s\n return [_dur * _s, _diff * _dur]\n }", "title": "" }, { "docid": "fc1dfff1a3a8d026dd85d7f390c725d7", "score": "0.47675425", "text": "function getDateSchedRestriction(start, end, ctype) \n{\n var strDateRangeStatement = \" AND (\";\n var sTable = \"activity_log\";\n var sDateField1 = \"date_scheduled\";\n var sDateField2 = \"date_scheduled_end\";\n\n if (ctype==\"timeframe2\") {\n \tsTable = \"project\";\n }\n\n var dstr1 = '#Date%'+start+'%';\n var dstr2 = '#Date%'+end+'%';\n var conj = \" AND \";\n var endp = \"\";\n if (start == \"\") conj = \"(\"; // if no start, just place parens for end\n if (end == \"\") endp = \")\"; // if no end, place paren at start\n\n if (start!=\"\") strDateRangeStatement += '(' + sTable + '.' + sDateField1 + '&gt;=' + dstr1 + endp;\n if (end!=\"\") strDateRangeStatement += conj + sTable + '.' + sDateField1 + '&lt;=' + dstr2 + ')';\n\n if (sDateField2 != \"\") {\n\n if (start!=\"\") strDateRangeStatement += ' OR (' + sTable + '.' + sDateField2 + '&gt;=' + dstr1 + endp;\n if (end!=\"\") strDateRangeStatement += conj + sTable + '.' + sDateField2 + '&lt;=' + dstr2 + ')';\n\n if (start!=\"\" && end!=\"\") {\n strDateRangeStatement += ' OR (' + sTable + '.' + sDateField1 + '&lt;=' + dstr1 + endp;\n strDateRangeStatement += conj + sTable + '.' + sDateField2 + '&gt;=' + dstr2 + ')';\n }\n }\n strDateRangeStatement += ')';\n return strDateRangeStatement;\n}", "title": "" }, { "docid": "d99ba925214d79a750eb78f257775617", "score": "0.47564974", "text": "static dayQuery (filter) {\n let err = new Error('Invalid time range.')\n err.status = 422\n\n let matches = filter.value.match(/\\(([^)]+)\\)/)\n if (!matches) {\n return { $ne: filter.operator !== '!' }\n }\n\n let range = matches[1]\n\n // TODO: combine these two using a single regexp\n if (!range.match(/\\|/)) {\n if (range.match(/[<>]=?/)) {\n range = range[1] === '=' ? range.slice(2) : range.slice(1)\n }\n range = QueryParser.timeToNumber(range.indexOf(':') > -1 ? range : parseFloat(range))\n range = [range, range]\n } else if (!range.match(/[<>]=?/)) {\n range = range.split('|').map(r => {\n return QueryParser.timeToNumber(r.indexOf(':') > -1 ? r : parseFloat(r))\n })\n } else {\n throw err\n }\n\n return [\n { '$lte': range[0] || 0 },\n { '$gte': range[1] || 0 }\n ]\n }", "title": "" }, { "docid": "c80a077c740589cfcff618ec240d5daa", "score": "0.47520795", "text": "function provideHover(document, position) {\n // const fileName = document.fileName;\n // const workDir = path.dirname(fileName);\n var word = document.getText(document.getWordRangeAtPosition(position));\n var time;\n\n if (/^\\d{13}$/.test(word)) {\n time = word;\n } else if (/^\\d{10}$/.test(word)) {\n console.log(10);\n }\n\n if (time) {\n try {\n var dateObj = new Date(+time);\n var dateString = \"\".concat(dateObj.getFullYear(), \"\\u5E74\").concat(dateObj.getMonth() + 1, \"\\u6708\").concat(dateObj.getDate(), \"\\u65E5 \").concat(dateObj.getHours(), \":\").concat(dateObj.getMinutes(), \":\").concat(dateObj.getSeconds());\n return new vscode.Hover(dateString);\n } catch (error) {\n console.error(error);\n }\n }\n}", "title": "" }, { "docid": "d58ea6f36fdf2d329ebc0f7786aa92d7", "score": "0.47510597", "text": "between (key, reg) {\n const args = this.extractArg(key, reg, 2, 'between(first, last)');\n if (!args) { return null; }\n return `nth-child(n+${args[0]}):nth-child(-n+${args[1]})`;\n }", "title": "" }, { "docid": "e2d5377b5ec8d4e4dc71b05974799215", "score": "0.4745889", "text": "function determine_date_range(quarter){\n if(quarter == \"Q1\"){\n return q1_ranges\n }\n else if(quarter == \"Q2\"){\n return q2_ranges\n\n }\n else if(quarter == \"Q3\"){\n return q3_ranges\n\n }\n else if(quarter == \"Q4\"){\n return q4_ranges\n\n }\n}", "title": "" }, { "docid": "3f4650459699e3f8f57ad87a103801b7", "score": "0.4739945", "text": "setMatches(state, payload) {\n for (let i = 0; i < payload.matches.length; i++) {\n let match = payload.matches[i]\n\n // Replace \"-\" by \"/\" to avoid issue on Safari\n let match_time = match.date.replace(/-/g, \"/\") + ' ' + match.time + ' ' + (match.timezone ? match.timezone : '')\n let d = new Date(match_time)\n match['local_match_time'] = d.toLocaleString()\n }\n state.matches = payload.matches\n }", "title": "" }, { "docid": "4e47d3a33357bd07b236161d42b902a9", "score": "0.47308448", "text": "async function getCompleteTimesForSimilarDatesInParking(listOfDates, parkingName){\n var datesRanges=[];\n for(let date of listOfDates.values()){\n var dateS=dateFormat(date, \"yyyy-mm-dd\");\n //datesRanges=datesRanges+\"\\n{\\\"range\\\": {\\\"postDate\\\": {\\\"gte\\\": \\\"\"+dateS+\"\\\",\\\"lte\\\": \\\"\"+dateS+\"\\\",\\\"format\\\": \\\"yyyy-MM-dd\\\"}}},\";\n datesRanges.push({\n \"range\": {\n \"postDate\": {\n \"gte\": dateS,\n \"lte\": dateS,\n \"format\": \"yyyy-MM-dd\"\n }\n }\n }); \n }\n\n return await client.search({\n \"index\": index,\n \"body\": {\n \"size\": 1000,\n \"query\": { \n \"bool\": {\n \"must\": [\n {\n \"range\": {\n \"message.actuel\": {\n \"lt\": 3\n }\n }\n }\n ],\n \"filter\": {\n \"bool\": {\n \"must\":[\n {\n \"term\": {\n \"parkingName\": {\n \"value\": parkingName\n }\n }\n }\n , \n {\n \"range\":{\n \"message.ouvert\":{\n \"gte\": 1\n }\n } \n } \n ], \n \"should\": datesRanges,\n \"minimum_should_match\" : 1\n }\n }\n }\n }\n}\n}); \n}", "title": "" }, { "docid": "0708879d4c32b169ec8ad284e9d15274", "score": "0.47268257", "text": "function rangeDate(y) {\n // y = Number(y)\n // var y = dateParse(lastUpdated,4).getFullYear();\n var rng = [new Date(y, 0, 1), new Date(y + 1, 0, 31)];\n\n return rng;\n}", "title": "" }, { "docid": "ecf74a5a708781cb4c8150bc46172499", "score": "0.4724364", "text": "getInnerX(date) {\n return this.innerPositionX((date - this.props.dateMin) / (this.props.dateMax - this.props.dateMin));\n }", "title": "" }, { "docid": "b41f3a77ca1aef5dd7ed9d3a57e5451f", "score": "0.47231263", "text": "function getSuggestedDate(actualDate,ahead){\n //\tactualDate = new Date(actualDateTxt);\n var end_final = new Date();\n sign = \"+\";\n if(!ahead) sign = \"-\";\n\n if(max_time_range ===\"week\")\n end_final = new Date(actualDate.getFullYear(), actualDate.getMonth(), eval(actualDate.getDate()+sign+ \"7\")); \n else if (max_time_range ===\"month\")\n end_final = new Date(actualDate.getFullYear(), eval(actualDate.getMonth() + sign + \"1\"), actualDate.getDate()); \n else if (max_time_range ===\"bimonth\")\n end_final = new Date(actualDate.getFullYear(), eval(actualDate.getMonth() + sign + \"2\"), actualDate.getDate());\n else \n end_final = getYearEnd(startSel);\n //Validate that we are not pass the limits\n if(ahead){\n if(end_final > maxValidDate)\n return maxValidDate;\n }else{\n if(end_final < minValidDate)\n return minValidDate;\n }\n // If we are within the limits return the computed date. \n return end_final;\n}", "title": "" }, { "docid": "8255a382e9f9d6a6417eb7e87c58546e", "score": "0.47186583", "text": "function leap_year_range(st_year, end_year) {\n var year_range = [];\n\n}", "title": "" }, { "docid": "845af3a0d3d44e9bb13bf65f3d0e8db5", "score": "0.47182038", "text": "static get _getEventList() {\n // get data about check exist\n let getEventList = function () {\n let listElement = document.querySelectorAll('.eventList');\n console.log(listElement);\n let commonDateStor = new Map();\n listElement.forEach(function (element) {\n let day = element.querySelector('.eventList_date').innerHTML;\n day = day.split('.');\n day = day.reverse();\n day = day.join(',');\n day = new Date(day).getTime();\n\n let eventRow = element.querySelectorAll('.eventRow');\n let storageEvents = new Map();\n eventRow.forEach(function (line) {\n let startEvent = line.querySelector('.eventRow_start').innerHTML;\n startEvent = startEvent.split(':');\n startEvent = startEvent[0] * 60 + +startEvent[1];\n startEvent = startEvent + day;\n\n let finishEvent = line.querySelector('.eventRow_finish').innerHTML;\n finishEvent = finishEvent.split(':');\n finishEvent = finishEvent[0] * 60 + +finishEvent[1];\n finishEvent = finishEvent + day;\n storageEvents.set(startEvent, finishEvent);\n });\n commonDateStor = new Map([...commonDateStor, ...storageEvents]);\n });\n\n return commonDateStor\n }\n let eventList = getEventList();\n\n for(let entry of eventList){\n console.log(entry[0], entry[1]);\n // console.log( entry[0]);\n }\n // a.start < b.end AND a.end > b.start\n return eventList;\n\n\n\n\n }", "title": "" }, { "docid": "417f62cf7fbba174e5126a36305af009", "score": "0.47172385", "text": "ranges () {\n const now = new Date()\n const tenYears = new Date(now - (1000 * 60 * 60 * 24 * 365 * 10))\n let items = []\n if (this.props.List) {\n items = this.props.List() || []\n } else {\n console.warn('No List() function was provided for Summary Progress')\n }\n return items.map((dates) => {\n let from = dates.from\n let to = dates.to\n let left = 0\n let width = 0\n\n if (from && to && (from >= tenYears || to >= tenYears)) {\n // Precheck boundaries\n if (to > now) {\n to = now\n }\n\n if (from < tenYears) {\n from = tenYears\n }\n\n // Meat of the calculations into percentages\n let right = ((to.getFullYear() - tenYears.getFullYear()) / 10) * 100\n left = ((from.getFullYear() - tenYears.getFullYear()) / 10) * 100\n width = right - left\n\n // Check boundaries\n if (left < 0) {\n left = 0\n }\n\n if (width < 0) {\n width = 0\n }\n\n if (width > 100) {\n width = 100\n }\n }\n\n // Add the range to the collection\n return {\n left: this.decimalAdjust('round', left, -2),\n width: this.decimalAdjust('round', width, -2)\n }\n })\n }", "title": "" }, { "docid": "06d8b6f13e81cd586cdb8444b5d1bbaa", "score": "0.4710097", "text": "function handleDateRangeValidation() {\n var container = document.getElementById(\"date-range-input-row\");\n var errorSpan = document.getElementById(\"date-error-span\");\n var dateRange = [];\n var inputFields = container.getElementsByTagName(\"input\");\n var anyFieldEmpty = false;\n for (var i = 0; i < inputFields.length; i++) {\n if (inputFields[i].value.trim() == \"\") {\n anyFieldEmpty = true;\n break;\n }\n else {\n dateRange.push(inputFields[i].value);\n }\n }\n // Required field validation.\n if (anyFieldEmpty) {\n errorSpan.setAttribute(\"data-valid\", \"false\");\n errorSpan.innerText = \"One of required fields is empty.\";\n return null;\n }\n // Proper data range validation.\n var fromDate = new Date(dateRange[0]);\n var toDate = new Date(dateRange[1]);\n var today = new Date();\n fromDate.setHours(0, 0, 0, 0);\n toDate.setHours(0, 0, 0, 0);\n today.setHours(0, 0, 0, 0);\n if (fromDate.getTime() > toDate.getTime() || // From cannot be after to.\n toDate.getTime() <= today.getTime() || // To cannot be today or before.\n fromDate.getTime() < (new Date(\"01-01-2000\")).getTime() // From cannot be before 01-01-2000\n ) {\n errorSpan.setAttribute(\"data-valid\", \"false\");\n errorSpan.innerText = \"Invalid date range.\";\n return null;\n }\n errorSpan.setAttribute(\"data-valid\", \"false\");\n errorSpan.innerText = \"\";\n return [fromDate, toDate];\n}", "title": "" } ]
93ae0685c31315167c0c61fc0d7a5f12
Funcion inserta reportes al servidor Entrada debe ser user passsword c_insert lista_insert c_insert_act lista_insert_act lista_insert: asesorclientediamesanioh_inih_finh_factdesc lista_insert_act asesorclientediamesaniodesc
[ { "docid": "3aacd365a1007f44986231df785041e4", "score": "0.6133108", "text": "function actualizarServidorInsertar(respuesta,data) {\r\n console.log(\"Manipulador de petición 'actualizarServidor Insertar' ha sido llamado.\");\r\n var usuario = querystring.parse(data)[\"user\"];\r\n var clave = querystring.parse(data)[\"password\"];\r\n var sqlite3 = require('sqlite3').verbose();\r\n var db = new sqlite3.Database(file);\r\n try {\r\n db.get(\"SELECT user,password FROM Asesores WHERE user =?\",\r\n [usuario], \r\n function(error, row) {\r\n if (error || row == undefined){ // Vemos si usuario existe\r\n console.log(error);\r\n console.log(\"Error en Login\");\r\n respuesta.end(\"Error usuario no existe\"+ \"\\n\");\r\n db.close();\r\n }\r\n else { // Si existe revisamos que su clave este correcta\r\n if (row.user == usuario) {\r\n // Comprobamos con la clave encriptada\r\n bcrypt.compare(clave, row.password, function(err, res) {\r\n if (res == true) {\r\n console.log(\"Login Exitoso\");\r\n //Login exitoso buscamos reportes a insertar\r\n var lista_insert = querystring.parse(data)[\"lista_insert\"];\r\n var c_insert = parseInt(querystring.parse(data)[\"c_insert\"],10);\r\n var datos_insert = lista_insert.split(\"\\n\");\r\n var contador = 0;\r\n var l_insert = [];\r\n while (c_insert > contador) { // Dividimos datos y guardamos\r\n var d_insert = datos_insert[contador].split(\"|\");\r\n var asesor_insert = d_insert[0];\r\n var cliente_insert = d_insert[1];\r\n var dia_insert = parseInt(d_insert[2],10);\r\n var mes_insert = parseInt(d_insert[3],10);\r\n var anio_insert = parseInt(d_insert[4],10);\r\n var h_ini = parseFloat(d_insert[5],10);\r\n var h_fin= parseFloat(d_insert[6],10);\r\n var h_fact= parseFloat(d_insert[7],10);\r\n var desc = d_insert[8];\r\n var reporte_insert = [asesor_insert, cliente_insert,\r\n dia_insert, mes_insert, anio_insert,\r\n h_ini, h_fin, h_fact, desc];\r\n l_insert.push(reporte_insert);\r\n contador = contador + 1;\r\n }\r\n console.log(\"ESTE ES ARREGLO DE REPORTES A AGREGAR\");\r\n console.log(l_insert);\r\n // insertamos reportes con async\r\n \r\n // Funcion async\r\n async.eachSeries(l_insert,\r\n // Funcion donde cada elemento de l_insert es pasado\r\n function(r_insert, callback){\r\n // Vemos si reporte existe\r\n db.get(\"SELECT asesor FROM Reportes WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\",\r\n [r_insert[0],r_insert[1],r_insert[2],r_insert[3],r_insert[4]], \r\n function(error, row) { // Vemos si existe reporte\r\n if (error || row == undefined){ // Si no existe lo insertamos\r\n // Insertamos nuevo reporte\r\n var insertar = \"INSERT INTO Reportes VALUES (?,?,?,?,?,?,?,?,?,?)\";\r\n db.run(insertar,[null,\r\n r_insert[0],r_insert[1],r_insert[2],r_insert[3],r_insert[4],\r\n r_insert[5],r_insert[6],r_insert[8],r_insert[7]],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error registro transferencia\");\r\n callback(\"Error: Problemas con el reporte\"+ \"\\n\");\r\n }\r\n else {\r\n // Si es exitoso editamos reporte\r\n console.log(\"Exito Reporte Insertado\");\r\n callback();\r\n }\r\n }); \r\n }\r\n else {\r\n // Si ya existe lo actualizamos\r\n var actualizar = \"UPDATE Reportes SET \"+\r\n \"hora_inicio = ?,hora_fin = ?, h_fact = ? ,descripcion = ? WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\";\r\n db.run(actualizar,\r\n [ \r\n r_insert[5],r_insert[6],r_insert[7],r_insert[8],\r\n r_insert[0],r_insert[1],r_insert[2],r_insert[3],\r\n r_insert[4]\r\n ],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error actualizando reporte\");\r\n callback(\"Error: actualizando reporte\"+ \"\\n\");\r\n }\r\n else {\r\n console.log(\"Reporte actualizado\");\r\n callback();\r\n }\r\n });\r\n }\r\n }); // Termino Insertar\r\n },\r\n // Cuando terminaron todos los insertar reportes\r\n function(err){\r\n if (err){ // Si hubo error terminamos\r\n console.log(err);\r\n console.log(\"Error: Problemas en insertar\");\r\n respuesta.end(\"Error: Problemas en insertar\"+ \"\\n\");\r\n db.close();\r\n }\r\n else{ // Si no hubo error buscamos actividades\r\n console.log(\"Exito operacion insertarReporte\");\r\n // Insertamos actividades\r\n //Buscamos actividades a insertar\r\n var lista_insert_act = querystring.parse(data)[\"lista_insert_act\"];\r\n var c_insert_act = parseInt(querystring.parse(data)[\"c_insert_act\"],10);\r\n var datos_insert_act = lista_insert_act.split(\"\\n\");\r\n var contador_act = 0;\r\n var l_insert_act = [];\r\n while (c_insert_act > contador_act) { // Dividimos datos y guardamos\r\n var d_insert_act = datos_insert_act[contador_act].split(\"|\");\r\n var asesor_insert_act = d_insert_act[0];\r\n var cliente_insert_act = d_insert_act[1];\r\n var dia_insert_act = parseInt(d_insert_act[2],10);\r\n var mes_insert_act = parseInt(d_insert_act[3],10);\r\n var anio_insert_act = parseInt(d_insert_act[4],10);\r\n var desc_insert_act = d_insert_act[5];\r\n var reporte_insert_act = [asesor_insert_act,cliente_insert_act,\r\n dia_insert_act,mes_insert_act,\r\n anio_insert_act,desc_insert_act];\r\n l_insert_act.push(reporte_insert_act);\r\n contador_act = contador_act + 1;\r\n }\r\n console.log(\"ESTE ES ARREGLO DE ACTIVIDADES A INSERTAR\");\r\n console.log(l_insert_act);\r\n \r\n async.eachSeries(l_insert_act,\r\n // Funcion donde cada elemento de l_insert es pasado\r\n function(r, callback){\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n // Vemos si actividad existe\r\n db.get(\"SELECT asesor FROM Actividades WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ? \" +\r\n \"AND descripcion = ?\",\r\n [ r[0],r[1],r[2],\r\n r[3],r[4],r[5]\r\n ], \r\n function(error, row) { // Vemos si existe reporte\r\n if (error || row == undefined){ // Si no existe lo insertamos\r\n // Insertamos nuevo reporte\r\n var insertar = \"INSERT INTO Actividades VALUES (?,?,?,?,?,?,?)\";\r\n db.run(insertar,\r\n [\r\n null,r[0],r[1],r[2],\r\n r[3],r[4],r[5]\r\n ],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error registro actividad\");\r\n callback(\"Error: Problemas registro actividad\"+ \"\\n\");\r\n }\r\n else {\r\n // Si es exitoso creamos actividad\r\n console.log(\"Actividad insertada\");\r\n callback();\r\n }\r\n });\r\n }\r\n else {\r\n // Si ya existe no hacemos nada\r\n callback()\r\n }\r\n }); // Termino Insertar\r\n },\r\n // Cuando terminaron todos los eliminar actividades\r\n function(err){\r\n if (err){\r\n console.log(err);\r\n respuesta.end(\"Error: Problemas en actividades\"+ \"\\n\");\r\n db.close();\r\n }\r\n else{\r\n console.log(\"Exito operacion insertar\"); \r\n respuesta.end(\"Exito actualizar servidor\"+ \"\\n\");\r\n db.close(); \r\n }\r\n \r\n }); // Termino async actividades \r\n }\r\n }\r\n ); // Termino async insertar\r\n \r\n \r\n } // Caso Fallo Login\r\n else{\r\n respuesta.end(\"Error en Login\"+ \"\\n\"); \r\n console.log(\"Error en Login\");\r\n db.close();\r\n }\r\n });\r\n }\r\n // No existe usuario\r\n else{\r\n respuesta.end(\"Error en Login\"+ \"\\n\"); \r\n console.log(\"Error en Login\");\r\n db.close();\r\n }\r\n }\r\n }); // termina get login\r\n } catch (err) {\r\n // manejamos error\r\n console.log(err); \r\n db.close();\r\n }\r\n}", "title": "" } ]
[ { "docid": "ab87166ba88844275a2328a825400cfd", "score": "0.6532497", "text": "function User_Insert_Sujets_Sujets_3(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 35;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 36;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"sujet\";\n var CleMaitre = TAB_COMPO_PPTES[33].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n /* COMPOSANT LISTE AVEC JOINTURE SIMPLE */\n var zs_libelle=GetValAt(35);\n if (!ValiderChampsObligatoire(Table,\"zs_libelle\",TAB_GLOBAL_COMPO[35],zs_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"zs_libelle\",TAB_GLOBAL_COMPO[35],zs_libelle))\n \treturn -1;\n var zs_notes=GetValAt(36);\n if (!ValiderChampsObligatoire(Table,\"zs_notes\",TAB_GLOBAL_COMPO[36],zs_notes,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"zs_notes\",TAB_GLOBAL_COMPO[36],zs_notes))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",zu_numero,zs_libelle,zs_notes\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+TAB_COMPO_PPTES[29].NewCle+\",\"+(zs_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(zs_libelle)+\"'\" )+\",\"+(zs_notes==\"\" ? \"null\" : \"'\"+ValiderChaine(zs_notes)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "7f1c8b287af0c8ee1af1360e396a48b9", "score": "0.6265789", "text": "function insert_in_baseTete(convention_cife_tete,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n var user = id_user;\n if (NouvelItemTete ==false)\n {\n getId = vm.selectedItemTete.id;\n user = vm.selectedItemTete.user.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n id_region: convention_cife_tete.id_region,\n id_cisco: convention_cife_tete.id_cisco,\n id_feffi: convention_cife_tete.id_feffi,\n id_site: convention_cife_tete.id_site,\n type_convention: convention_cife_tete.type_convention,\n objet: convention_cife_tete.objet,\n ref_financement: convention_cife_tete.ref_financement,\n ref_convention: convention_cife_tete.ref_convention,\n montant_total: convention_cife_tete.montant_total,\n //avancement: convention_cife_tete.avancement,\n id_user: user,\n validation: 0 \n });\n //console.log(convention.pays_id);\n console.log(datas);\n //factory\n apiFactory.add(\"convention_cisco_feffi_entete/index\",datas, config).success(function (data)\n {\n var reg = vm.regions.filter(function(obj)\n {\n return obj.id == convention_cife_tete.id_region;\n });\n var cis = vm.allcisco.filter(function(obj)\n {\n return obj.id == convention_cife_tete.id_cisco;\n });\n\n var fef = vm.allfeffi.filter(function(obj)\n {\n return obj.id == convention_cife_tete.id_feffi;\n });\n var sit = vm.allsite.filter(function(obj)\n {\n return obj.id == convention_cife_tete.id_site;\n });\n\n if (NouvelItemTete == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n vm.selectedItemTete.region = reg[0];\n vm.selectedItemTete.cisco = cis[0];\n vm.selectedItemTete.feffi = fef[0];\n vm.selectedItemTete.site = sit[0];\n vm.selectedItemTete.$selected = false;\n vm.selectedItemTete.$edit = false;\n //vm.selectedItemTete ={};\n \n if (convention_cife_tete.id_site!=currentItemTete.site.id)\n {currentItemTete.site.ecole = {id: currentItemTete.site.id_ecole}\n\n console.log(fef[0].ecole);\n //maj_site_in_base(currentItemTete.site,0,0,fef[0].ecole.id); //site talou avadika validation 0\n // maj_site_in_base(sit[0],0,1,fef[0].ecole.id); //site vao2 validation 1\n maj_site_in_base(currentItemTete.site,0,0); //site talou avadika validation 0\n maj_site_in_base(sit[0],0,1); //site vao2 validation 1\n \n \n }\n }\n else \n { \n vm.allconvention_cife_tete = vm.allconvention_cife_tete.filter(function(obj)\n {\n return obj.id !== vm.selectedItemTete.id;\n });\n \n //maj_site_in_base(vm.selectedItemTete.site,0,0,vm.selectedItemTete.ecole.id);\n maj_site_in_base(vm.selectedItemTete.site,0,0);\n }\n }\n else\n {\n \n convention_cife_tete.region = reg[0];\n convention_cife_tete.cisco = cis[0];\n convention_cife_tete.user = vm.user;\n convention_cife_tete.feffi = fef[0];\n convention_cife_tete.ecole = fef[0].ecole;\n convention_cife_tete.site = sit[0];\n convention_cife_tete.id = String(data.response);\n NouvelItemTete = false;\n console.log(convention_cife_tete.ecole);\n // maj_site_in_base(sit[0],0,1,fef[0].ecole.id);\n maj_site_in_base(sit[0],0,1);\n if (convention_cife_tete.type_convention == 1)\n {\n insert_initial_Batiment_construction(vm.subvention_initial[0],0,String(data.response));\n insert_initial_Latrine_construction(vm.subvention_initial[0],0,String(data.response));\n insert_initial_Mobilier_construction(vm.subvention_initial[0],0,String(data.response));\n insert_initial_Cout_maitrise_construction(vm.subvention_initial[0],0,String(data.response));\n insert_initial_Cout_sousprojet_construction(vm.subvention_initial[0],0,String(data.response));\n convention_cife_tete.montant_total =parseInt(vm.subvention_initial[0].type_batiment.cout_batiment)+\n parseInt(vm.subvention_initial[0].type_latrine.cout_latrine)+\n parseInt(vm.subvention_initial[0].type_mobilier.cout_mobilier)+\n parseInt(vm.subvention_initial[0].type_cout_maitrise.cout_maitrise)+\n parseInt(vm.subvention_initial[0].type_cout_sousprojet.cout_sousprojet);\n }\n \n }\n convention_cife_tete.$selected = false;\n convention_cife_tete.$edit = false;\n vm.selectedItemTete = {};\n vm.afficherboutonValider = false;\n vm.stepOne = false;\n vm.stepTwo = false;\n vm.stepThree = false;\n vm.stepFor = false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "title": "" }, { "docid": "702bbceb971d335abe053cda0882ffcd", "score": "0.6241509", "text": "function User_Insert_Sujets_Liste_des_types_de_sujets0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 3\n\nId dans le tab: 31;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 32;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 33;\ncomplexe\nNbr Jointure: 1;\n Joint n° 0 = sujet,zu_numero,zu_numero\n\n******************\n*/\n\n var Table=\"typesujet\";\n var CleMaitre = TAB_COMPO_PPTES[29].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var zu_libelle=GetValAt(31);\n if (!ValiderChampsObligatoire(Table,\"zu_libelle\",TAB_GLOBAL_COMPO[31],zu_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"zu_libelle\",TAB_GLOBAL_COMPO[31],zu_libelle))\n \treturn -1;\n var zu_notes=GetValAt(32);\n if (!ValiderChampsObligatoire(Table,\"zu_notes\",TAB_GLOBAL_COMPO[32],zu_notes,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"zu_notes\",TAB_GLOBAL_COMPO[32],zu_notes))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",zu_libelle,zu_notes\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(zu_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(zu_libelle)+\"'\" )+\",\"+(zu_notes==\"\" ? \"null\" : \"'\"+ValiderChaine(zu_notes)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "5d7416f7a1bcc2ca82874b68604dc349", "score": "0.61216784", "text": "function User_Insert_Lieu_Liste_des_lieus0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 27;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 28;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"lieu\";\n var CleMaitre = TAB_COMPO_PPTES[25].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var zl_libelle=GetValAt(27);\n if (!ValiderChampsObligatoire(Table,\"zl_libelle\",TAB_GLOBAL_COMPO[27],zl_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"zl_libelle\",TAB_GLOBAL_COMPO[27],zl_libelle))\n \treturn -1;\n var zl_notes=GetValAt(28);\n if (!ValiderChampsObligatoire(Table,\"zl_notes\",TAB_GLOBAL_COMPO[28],zl_notes,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"zl_notes\",TAB_GLOBAL_COMPO[28],zl_notes))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",zl_libelle,zl_notes\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(zl_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(zl_libelle)+\"'\" )+\",\"+(zl_notes==\"\" ? \"null\" : \"'\"+ValiderChaine(zl_notes)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "a9a7ff5ba572ae462368cccb9f30bf85", "score": "0.6088844", "text": "insertColaborador(req, res) {\n const erros= [];\n\n if(!this.nome || !this.senha) {\n erros.push({ mensagem : \"Por favor preencha todos os campos\"})\n\n }\n\n if (this.nome.length < 6) {\n erros.push({ mensagem: \"Nome de usuário deve ter, pelo menos, 6 dígitos\" })\n }\n\n if (this.senha.length <6) {\n erros.push({ mensagem: \"Senha deve ter, pelo menos, 6 dígitos\" })\n }\n \n\n if(erros.length > 0){\n res.status(400).json(erros)\n } \n else {\n db.query(\n `SELECT * FROM colaborador WHERE nome = '${this.nome}'`,\n (error, result) => {\n if(error){\n res.send({error: error})\n }\n //console.log(result.length)\n if(result.length > 0){\n erros.push({ mensagem: \"Usuário já cadastrado\" })\n res.send(erros)\n } else {\n db.query(\n `INSERT INTO colaborador (nome, senha) VALUES ('${this.nome}', '${this.senha}')`,\n (error, result) => {\n error ? res.send(error) : res.json('Novo colaborador cadastrado com sucesso!');\n }\n );\n }\n }\n\n )\n }\n }", "title": "" }, { "docid": "22540f1600e1ebe96be42810d0942197", "score": "0.60665125", "text": "function controlloInserimentoTrattativa(){\r\n\t\t\r\n\t \tvar espressione = /^(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.](19|20)\\d\\d$/;\r\n\t \tvar controlloLettere = /^[A-Za-z ']+$/;\r\n\t \t\r\n\t\t/* \r\n\t\t * variabili della trattativa\r\n\t\t */\r\n\t\tvar cliente = \"\";\r\n\t\tvar risorsa = \"\";\r\n\t\tvar data = \"\";\r\n\t\tvar oggetto = \"\";\r\n\t\t\r\n\t\t/*\r\n\t\t * variabile della commessa\r\n\t\t */\r\n\t\t\r\n\t\tvar dataOfferta = \"\";\r\n\t\tvar oggettoOfferta = \"\";\r\n\t\tvar descrizione = \"\";\r\n\t\tvar dataInizio = \"\";\r\n\t\tvar dataFine = \"\";\r\n\t\tvar importo = \"\";\r\n\t\tvar ore = \"\";\r\n\t\t\r\n\t\t/*\r\n\t\t * qua inizia la trattattiva singola\r\n\t\t */\r\n\t\t\r\n\t\tif(tipologiaTrattativa == \"trattattivaSingola\"){\r\n\t\t\tif(document.inserisciTrattative.trattattivaSingola_codice != undefined){\r\n\t\t\t\tcliente = document.inserisciTrattative.trattattivaSingola_codice.value;\r\n\t\t\t\tif(cliente == null || cliente == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Cliente\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.inserisciTrattative.trattattivaSingola_risorsa != undefined){\r\n\t\t\t\trisorsa = document.inserisciTrattative.trattattivaSingola_risorsa.value;\r\n\t\t\t\tif(risorsa == null || risorsa == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Risorsa\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.inserisciTrattative.trattattivaSingola_data != undefined){\r\n\t\t\t\tdata = document.inserisciTrattative.trattattivaSingola_data.value;\r\n\t\t\t\tif(data == null || data == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Data\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(data.length < 10 || data.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(data))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\t\treturn false;\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\t\r\n\t\t\tif(document.inserisciTrattative.trattattivaSingola_oggetto != undefined){\r\n\t\t\t\toggetto = document.inserisciTrattative.trattattivaSingola_oggetto.value;\r\n\t\t\t\tif(oggetto == null || oggetto == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Oggetto\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * qua inizia la trattativa multipla\r\n\t\t */\r\n\t\t\r\n\t\tif(tipologiaTrattativa == \"trattattivaMultipla\"){\r\n\t\t\tif(document.inserisciTrattative.codice != undefined){\r\n\t\t\t\tcliente = document.inserisciTrattative.codice.value;\r\n\t\t\t\tif(cliente == null || cliente == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Cliente\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.inserisciTrattative.data != undefined){\r\n\t\t\t\tdata = document.inserisciTrattative.data.value;\r\n\t\t\t\tif(data == null || data == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Data\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(data.length < 10 || data.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(data))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\t\treturn false;\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\t\r\n\t\t\tif(document.inserisciTrattative.oggetto != undefined){\r\n\t\t\t\toggetto = document.inserisciTrattative.oggetto.value;\r\n\t\t\t\tif(oggetto == null || oggetto == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Oggetto\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n\t\t//sezione commessa\r\n\t\t\r\n\t\tif(inserimentoCommessaTrattativa){\r\n\t\t\tif(document.inserisciTrattative.dataOfferta != undefined){\r\n\t\t\t\tdataOfferta = document.inserisciTrattative.dataOfferta.value;\r\n\t\t\t\tif(dataOfferta == null || dataOfferta == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Data Offerta\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataOfferta.length < 10 || dataOfferta.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(dataOfferta))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Offerta\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\t\treturn false;\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\t\r\n\t\t\tif(document.inserisciTrattative.oggettoOfferta != undefined){\r\n\t\t\t\toggettoOfferta = document.inserisciTrattative.oggettoOfferta.value;\r\n\t\t\t\tif(oggettoOfferta == null || oggettoOfferta == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Oggetto Offerta\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.inserisciTrattative.descrizione != undefined){\r\n\t\t\t\tdescrizione = document.inserisciTrattative.descrizione.value;\r\n\t\t\t\tif(descrizione == null || descrizione == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Descrizione\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.inserisciTrattative.dataInizio != undefined){\r\n\t\t\t\tdataInizio = document.inserisciTrattative.dataInizio.value;\r\n\t\t\t\tif(dataInizio == null || dataInizio == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Data Inizio\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataInizio.length < 10 || dataInizio.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(dataInizio))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Inizio\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\t\treturn false;\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\t\r\n\t\t\tif(document.inserisciTrattative.dataFine != undefined){\r\n\t\t\t\tdataFine = document.inserisciTrattative.dataFine.value;\r\n\t\t\t\tif(dataFine == null || dataFine == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Data Fine\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataFine.length < 10 || dataFine.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(dataFine))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Fine\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\t\treturn false;\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\t\r\n\t\t\tif(document.inserisciTrattative.importo != undefined){\r\n\t\t\t\timporto = document.inserisciTrattative.importo.value;\r\n\t\t\t\tif(importo == null || importo == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Importo\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var y = 0; y < importo.length; y++){\r\n\t\t\t\t\t\tvar singleChar = importo.substring(y,(y+1));\r\n\t\t\t\t\t\tif(controlloLettere.test(singleChar)){\r\n\t\t\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar num = importo.split(\".\");\r\n\t\t\t\t\tif(num.length > 2){\r\n\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(importo.indexOf(\",\") != -1){\r\n\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(importo.indexOf(\".\") != -1){\r\n\t\t\t\t\t\t\t\tif((importo.length-1) - importo.indexOf(\".\") > 2){\r\n\t\t\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.00\");\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.inserisciTrattative.ore != undefined){\r\n\t\t\t\t\tore = document.inserisciTrattative.ore.value;\r\n\t\t\t\t\tif(isNaN(ore)){\r\n\t\t\t\t\t\talert(\"Formato del campo \\\"Ore\\\" errato. Inserire solo valori numerici.\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\treturn true;\r\n\t\r\n}", "title": "" }, { "docid": "fd0481ec1abbafe4f9ce51f5f8dc0f1e", "score": "0.60590214", "text": "function pruebaActualizarInsertar(respuesta,data) {\r\n console.log(\"Manipulador de petición 'prueba Actualizar' ha sido llamado.\");\r\n var body = \"<head>\"+\r\n '<meta charset=\"UTF-8\">'+\r\n \"<title>PRUEBA ACTUALIZAR SERVIDOR</title>\"+\r\n \"</head>\"+\r\n \"<body>\"+\r\n \"<html>\"+\r\n \"<head>\"+\r\n '<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />'+\r\n \"</head>\"+\r\n \"<body>\"+\r\n '<form action=\"/actualizarServidorInsertar\" method=\"post\">'+\r\n '<input type=\"TEXT\" name=\"user\" placeholder=\"Asesor\" size=\"40\">'+\r\n \"<br>\"+\r\n '<input type=\"password\" placeholder=\"Clave\" name=\"password\" size=\"40\">'+\r\n \"<br>\"+\r\n '<input type=\"TEXT\" placeholder=\"Cantidad insertar\" name=\"c_insert\" size=\"40\">'+\r\n \"<br>\"+\r\n '<textarea name=\"lista_insert\" rows=\"10\" cols=\"40\" placeholder=\"Lista insertar\"></textarea>'+\r\n \"<br>\"+\r\n '<input type=\"TEXT\" placeholder=\"Cantidad Actividades insertar\" name=\"c_insert_act\" size=\"40\">'+\r\n \"<br>\"+\r\n '<textarea name=\"lista_insert_act\" rows=\"10\" cols=\"40\" placeholder=\"Actividades\"></textarea>'+\r\n \"<br>\"+\r\n '<input type=\"submit\" value=\"ENVIAR\"/>'+\r\n \"</form>\"+\r\n \"</body>\"+\r\n \"</html>\"+\r\n \"</body>\"+\r\n '</html>';\r\n respuesta.writeHead(200, {\"Content-Type\": \"text/html\"});\r\n respuesta.write(body);\r\n respuesta.end(); \r\n}", "title": "" }, { "docid": "7705f9e681fbe473cc4acad75c09f2c4", "score": "0.6036486", "text": "function addItemsPuertasValoresCliente(k_codcliente,v_consecutivocliente,k_codusuario,n_cliente,n_contacto,v_nit,o_direccion,o_telefono,o_correo) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO cliente (k_codcliente,v_consecutivocliente,k_codusuario,n_cliente,n_contacto,v_nit,o_direccion,o_telefono,o_correo) VALUES (?,?,?,?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codcliente,v_consecutivocliente,k_codusuario,n_cliente,n_contacto,v_nit,o_direccion,o_telefono,o_correo], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de cliente...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "e93f8986d3a7796e60dc5cf49ca0eab6", "score": "0.6019803", "text": "static add(klient) {\n //wywołuje polecenie sql i zwraca promesę (Promise)\n return db.execute(\n 'insert into klienci(imie, nazwisko, data_urodzenia, numer_dowodu) VALUES (?,?,?,?)',\n [klient.imie, klient.nazwisko, klient.dataUrodzenia, klient.numerDowodu]\n );\n }", "title": "" }, { "docid": "2e839d1db8bd94fa9fd5ecd8d0c57344", "score": "0.58921045", "text": "function guardarInformacionCliente() {\n\n let myData = {\n id: $(\"#id\").val(),\n name: $(\"#name\").val(),\n email: $(\"#email\").val(),\n age: $(\"#age\").val(),\n };\n\n //Validamos que no entren datos vacios \n if ($(\"#name\").val() == \"\" || $(\"#email\").val() == \"\" || $(\"#age\").val() == \"\") {\n alert(\"Eres muy chistoso jaja :v \\n Por favor llena todos los campos \\n O selecciona un cliente \");\n } else {\n let dataToSend = JSON.stringify(myData);\n $.ajax({\n url: \"https://g39b406ee3fdd9f-bbddhoteleria.adb.sa-santiago-1.oraclecloudapps.com/ords/admin/client/client\",\n type: \"POST\",\n data: myData,\n datatype: \"JSON\",\n success: function (respuesta) {\n\n // limpiamos los campos \n $(\"#resultado\").empty();\n $(\"#id\").val(\"\");\n $(\"#name\").val(\"\");\n $(\"#email\").val(\"\");\n $(\"#age\").val(\"\");\n },\n error: function (xhr, status) {\n alert('Ups! Ocurrio un gran error ' + xhr.status);\n },\n complete: function (xhr, status) {\n\n console.log('Ingresado correctamente un registro nuevo ' + xhr.status);\n //actualizamos la tabla cliente\n traerInformacionCliente();\n\n //mostramos que se hizo efectivo \n alert('SE HA GUARDADO.');\n }\n })\n }\n}", "title": "" }, { "docid": "f9851ede7cd7b4c57196c3684ecc3ddd", "score": "0.5889647", "text": "function getClientes(total, puntoVenta, clave ,request,respond){\n\n controller.insertarBolsa(total,puntoVenta,clave).then((resultado) => {\n respond.status(200).send(resultado);\n\n //SI OBTENEMOS UN ERROR\n }).catch((error) => {\n let elemento = {'mensaje': error.mensaje, 'error': error.error};\n respond.status(error.codigo).send(JSON.stringify(elemento));\n\n });\n}", "title": "" }, { "docid": "94547dafa6f761050bcb5c17544f0b68", "score": "0.58764046", "text": "inserirEspecialidade(connection, especialidade,req, res){\n let prepareQuery = new PrepareQuery();\n let queryMontada = prepareQuery.inserirEspecialidade( especialidade);\n let modelDesbravador = new ModelDesbravador(connection);\n \n \n modelDesbravador.salvar(queryMontada, (error, result) => {\n if(result){\n res.send('[{\"resultado\": 1}]');\n }else{\n res.send('[{\"resultado\": 0}]');\n }\n }); \n }", "title": "" }, { "docid": "eaa02ec5ac37ac0f3f628776e1f70db0", "score": "0.58436173", "text": "function addClient (strEmail, strName, strFirstName, strPassphrase, send_response){\n var strQuery = \"\";\n var added_User = null;\n //connection to the database\n var connection = db.createConnection(connectparam);\n connection.connect();\n \n //creating the valid query \n var time = \"select now() into @a;\"\n var hashpass = \"select md5('\"+strPassphrase+\"') into @b;\";\n var hashadtime = \"select concat(@a, @b) into @c; \";\n var prepquery = \"insert into User (email, name, first_name, passphrase, date_created)\";\n var values = \"values ('\"+strEmail+\"','\"+strName+\"','\"+strFirstName+\"',md5(@c), @a);\"; \n var id = \"select id, date_created from user where email='\"+strEmail+\"';\" \n strQuery = time+hashpass+hashadtime+prepquery+values+id;\n \n connection.query(\n strQuery,\n function ( objError, objRows, objFields ){\n if( objError ){\n console.log(\"cound not add user\");\n send_response(objError, null)\n }else{ \n //sending the response \n if(objRows[4][0]){\n added_User = new users.Client(strEmail,objRows[4][0].id,strName,strFirstName,objRows[4][0].date_created); \n } \n send_response(null, added_User);\n }\n });\n //ending the connection with the database\n connection.end(); \n}", "title": "" }, { "docid": "999695083f8bc3b98820ed539f92138c", "score": "0.58413476", "text": "function User_Insert_Groupe_Liste_des_groupes0(Compo_Maitre)\n{\n\n/*\n***** INFOS ******\n\nNbr d'esclaves = 2\n\nId dans le tab: 39;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\nId dans le tab: 40;\nsimple\nNbr Jointure: PAS DE JOINTURE;\n\n******************\n*/\n\n var Table=\"groupe\";\n var CleMaitre = TAB_COMPO_PPTES[37].NewCle;\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var zg_libelle=GetValAt(39);\n if (!ValiderChampsObligatoire(Table,\"zg_libelle\",TAB_GLOBAL_COMPO[39],zg_libelle,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"zg_libelle\",TAB_GLOBAL_COMPO[39],zg_libelle))\n \treturn -1;\n var zg_notes=GetValAt(40);\n if (!ValiderChampsObligatoire(Table,\"zg_notes\",TAB_GLOBAL_COMPO[40],zg_notes,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"zg_notes\",TAB_GLOBAL_COMPO[40],zg_notes))\n \treturn -1;\n var Req=\"insert into \"+Table+\" \";\nvar TabInsertionEnPlus=new Array();\n Req+=\"(\"+NomCleMaitre+\",zg_libelle,zg_notes\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[0]:\"\")+\")\";\n Req+=\" values (\"+CleMaitre+\",\"+(zg_libelle==\"\" ? \"null\" : \"'\"+ValiderChaine(zg_libelle)+\"'\" )+\",\"+(zg_notes==\"\" ? \"null\" : \"'\"+ValiderChaine(zg_notes)+\"'\" )+\"\"+(TabInsertionEnPlus.length!=0?\",\"+TabInsertionEnPlus[1]:\"\")+\")\";\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de l'insertion\");\nreturn CleMaitre;\n\n}", "title": "" }, { "docid": "7dd80cf00ebd4a9637348f979d4f3aa4", "score": "0.5725083", "text": "function controlloInserisciCommessa(tipologia){\r\n\t\r\n\tvar espressione = /^(0[1-9]|[12][0-9]|3[01])[- \\/.](0[1-9]|1[012])[- \\/.](19|20)\\d\\d$/;\r\n\tvar controlloLettere = /^([a-zA-Z '])+$/;\r\n\t\r\n\tif(tipologia == \"1\"){\r\n\t\t\r\n\t\t/*\r\n\t\t * commessa esterna singola\r\n\t\t * \r\n\t\t * commessaEsternaSingola_codice\r\n\t\t * commessaEsternaSingola_idRisorsa\r\n\t\t * commessaEsternaSingola_dataOfferta\r\n\t\t * commessaEsternaSingola_oggettoOfferta\r\n\t\t * commessaEsternaSingola_descrizione\r\n\t\t * commessaEsternaSingola_dataInizio\r\n\t\t * commessaEsternaSingola_dataFine\r\n\t\t * commessaEsternaSingola_importo\r\n\t\t * commessaEsternaSingola_ore\r\n\t\t*/\r\n\t\t\r\n\t\tvar codice_CommessaSingola = \"\";\r\n\t\tvar risorsa_CommessaSingola = \"\";\r\n\t\tvar dataOfferta_CommessaSingola = \"\";\r\n\t\tvar oggettoOfferta_CommessaSingola = \"\";\r\n\t\tvar descrizione_CommessaSingola = \"\";\r\n\t\tvar dataInizio_CommessaSingola = \"\";\r\n\t\tvar dataFine_CommessaSingola = \"\";\r\n\t\tvar importo_CommessaSingola = \"\";\r\n\t\tvar ore_CommessaSingola = \"\";\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_codice != undefined){\r\n\t\t\tcodice_CommessaSingola = document.commessa.commessaEsternaSingola_codice.value;\r\n\t\t\tif(codice_CommessaSingola == null || codice_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Cliente\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_idRisorsa != undefined){\r\n\t\t\trisorsa_CommessaSingola = document.commessa.commessaEsternaSingola_idRisorsa.value;\r\n\t\t\tif(risorsa_CommessaSingola == null || risorsa_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Risorsa\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_dataOfferta != undefined){\r\n\t\t\tdataOfferta_CommessaSingola = document.commessa.commessaEsternaSingola_dataOfferta.value;\r\n\t\t\tif(dataOfferta_CommessaSingola == null || dataOfferta_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Offerta\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataOfferta_CommessaSingola.length < 10 || dataOfferta_CommessaSingola.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataOfferta_CommessaSingola))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Offerta\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_oggettoOfferta != undefined){\r\n\t\t\toggettoOfferta_CommessaSingola = document.commessa.commessaEsternaSingola_oggettoOfferta.value;\r\n\t\t\tif(oggettoOfferta_CommessaSingola == null || oggettoOfferta_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Oggetto Offerta\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_descrizione != undefined){\r\n\t\t\tdescrizione_CommessaSingola = document.commessa.commessaEsternaSingola_descrizione.value;\r\n\t\t\tif(descrizione_CommessaSingola == null || descrizione_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Descrizione\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_dataInizio != undefined){\r\n\t\t\tdataInizio_CommessaSingola = document.commessa.commessaEsternaSingola_dataInizio.value;\r\n\t\t\tif(dataInizio_CommessaSingola == null || dataInizio_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Inizio\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataInizio_CommessaSingola.length < 10 || dataInizio_CommessaSingola.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataInizio_CommessaSingola))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Inizio\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_dataFine != undefined){\r\n\t\t\tdataFine_CommessaSingola = document.commessa.commessaEsternaSingola_dataFine.value;\r\n\t\t\tif(dataFine_CommessaSingola == null || dataFine_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Fine\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataFine_CommessaSingola.length < 10 || dataFine_CommessaSingola.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataFine_CommessaSingola))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Fine\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar split_DataInizio_CommessaSingola = dataInizio_CommessaSingola.split(\"-\");\r\n\t\tvar split_DataFine_CommessaSingola = dataFine_CommessaSingola.split(\"-\");\r\n\r\n\t\tvar dateInizio_CommessaSingola = new Date(split_DataInizio_CommessaSingola[2],split_DataInizio_CommessaSingola[1],split_DataInizio_CommessaSingola[0]).getTime();\r\n\t\tvar dateFine_CommessaSingola = new Date(split_DataFine_CommessaSingola[2],split_DataFine_CommessaSingola[1],split_DataFine_CommessaSingola[0]).getTime();\r\n\t\t\r\n\t\tif(dateInizio_CommessaSingola > dateFine_CommessaSingola){\r\n\t\t\talert(\"Data Inizio maggiore della Data Fine\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_importo != undefined){\r\n\t\t\timporto_CommessaSingola = document.commessa.commessaEsternaSingola_importo.value;\r\n\t\t\tif(importo_CommessaSingola == null || importo_CommessaSingola == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Importo\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tfor(var x = 0; x < importo_CommessaSingola.length; x++){\r\n\t\t\t\t\tvar singleChar = importo_CommessaSingola.substring(x,(x+1));\r\n\t\t\t\t\tif(controlloLettere.test(singleChar)){\r\n\t\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar num = importo_CommessaSingola.split(\".\");\r\n\t\t\t\tif(num.length > 2){\r\n\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(importo_CommessaSingola.indexOf(\",\") != -1){\r\n\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(importo_CommessaSingola.indexOf(\".\") != -1){\r\n\t\t\t\t\t\t\tif((importo_CommessaSingola.length-1) - importo_CommessaSingola.indexOf(\".\") > 2){\r\n\t\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.00\");\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.commessaEsternaSingola_ore != undefined){\r\n\t\t\tore_CommessaSingola = document.commessa.commessaEsternaSingola_ore.value;\r\n\t\t\tif(isNaN(ore_CommessaSingola)){\r\n\t\t\t\talert(\"Valorizzare il campo \\\"Ore\\\" solo con valori numerici\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}else if(tipologia == \"2\"){\r\n\t\r\n\t\t/*\r\n\t\t * commessa esterna multipla\r\n\t\t * \r\n\t\t * codice\r\n\t\t * dataOfferta\r\n\t\t * Offerta\r\n\t\t * dataInizio\r\n\t\t * dataFine\r\n\t\t * importo\r\n\t\t * ore\r\n\t\t*/\r\n\t\t\r\n\t\tvar codice = \"\";\r\n\t\tvar dataOfferta = \"\";\r\n\t\tvar oggettoOfferta = \"\";\r\n\t\tvar descrizione = \"\";\r\n\t\tvar dataInizio = \"\";\r\n\t\tvar dataFine = \"\";\r\n\t\tvar importo = \"\";\r\n\t\tvar ore = \"\";\r\n\t\t\r\n\t\tif(document.commessa.codice != undefined){\r\n\t\t\tcodice = document.commessa.codice.value;\r\n\t\t\tif(codice == null || codice == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Cliente\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.dataOfferta != undefined){\r\n\t\t\tdataOfferta = document.commessa.dataOfferta.value;\r\n\t\t\tif(dataOfferta == null || dataOfferta == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Offerta\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataOfferta.length < 10 || dataOfferta.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataOfferta))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Offerta\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.oggettoOfferta != undefined){\r\n\t\t\toggettoOfferta = document.commessa.oggettoOfferta.value;\r\n\t\t\tif(oggettoOfferta == null || oggettoOfferta == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Oggetto Offerta\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.descrizione != undefined){\r\n\t\t\tdescrizione = document.commessa.descrizione.value;\r\n\t\t\tif(descrizione == null || descrizione == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Descrizione\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.dataInizio != undefined){\r\n\t\t\tdataInizio = document.commessa.dataInizio.value;\r\n\t\t\tif(dataInizio == null || dataInizio == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Inizio\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataInizio.length < 10 || dataInizio.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataInizio))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Inizio\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.dataFine != undefined){\r\n\t\t\tdataFine = document.commessa.dataFine.value;\r\n\t\t\tif(dataFine == null || dataFine == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Fine\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(dataFine.length < 10 || dataFine.length > 10){\r\n\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif (!espressione.test(dataFine))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Formato della \\\"Data Fine\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tvar split_DataInizio = dataInizio.split(\"-\");\r\n\t\tvar split_DataFine = dataFine.split(\"-\");\r\n\r\n\t\tvar dateInizio = new Date(split_DataInizio[2],split_DataInizio[1],split_DataInizio[0]).getTime();\r\n\t\tvar dateFine = new Date(split_DataFine[2],split_DataFine[1],split_DataFine[0]).getTime();\r\n\t\t\r\n\t\tif(dateInizio > dateFine){\r\n\t\t\talert(\"Data Inizio maggiore della Data Fine\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif(document.commessa.importo != undefined){\r\n\t\t\timporto = document.commessa.importo.value;\r\n\t\t\tif(importo == null || importo == \"\"){\r\n\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Importo\\\"\");\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tif(controlloLettere.test(importo)){\r\n\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var y = 0; y < importo.length; y++){\r\n\t\t\t\t\t\tvar char = importo.substring(y,(y+1));\r\n\t\t\t\t\t\tif(controlloLettere.test(char)){\r\n\t\t\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar num1 = importo.split(\".\");\r\n\t\t\t\t\tif(num1.length > 2){\r\n\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(importo.indexOf(\",\") != -1){\r\n\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(importo.indexOf(\".\") != -1){\r\n\t\t\t\t\t\t\t\tif((importo.length-1) - importo.indexOf(\".\") > 2){\r\n\t\t\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.00\");\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(document.commessa.ore != undefined){\r\n\t\t\tore = document.commessa.ore.value;\r\n\t\t\tif(isNaN(ore)){\r\n\t\t\t\talert(\"Valorizzare il campo \\\"Ore\\\" solo con valori numerici\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}else if(tipologia == \"3\"){\r\n\t\t\r\n\t\t\t/*\r\n\t\t\t * * commessa interna\r\n\t\t\t * \r\n\t\t\t * commessaInterna_dataOfferta\r\n\t\t\t * commessaInterna_oggettoOfferta\r\n\t\t\t * commessaInterna_dataInizio\r\n\t\t\t * commessaInterna_dataFine\r\n\t\t\t * commessaInterna_importo\r\n\t\t\t * commessaInterna_ore\r\n\t\t\t */\r\n\t\t\t\r\n\t\t\tvar dataOfferta_CommessaInterna = \"\";\r\n\t\t\tvar oggettoOfferta_CommessaInterna = \"\";\r\n\t\t\tvar descrizione_CommessaInterna = \"\";\r\n\t\t\tvar dataInizio_CommessaInterna = \"\";\r\n\t\t\tvar dataFine_CommessaInterna = \"\";\r\n\t\t\tvar importo_CommessaInterna = \"\";\r\n\t\t\tvar ore_CommessaInterna = \"\";\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_dataOfferta != undefined){\r\n\t\t\t\tdataOfferta_CommessaInterna = document.commessa.commessaInterna_dataOfferta.value;\r\n\t\t\t\tif(dataOfferta_CommessaInterna == null || dataOfferta_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Offerta\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataOfferta_CommessaInterna.length < 10 || dataOfferta_CommessaInterna.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(dataOfferta_CommessaInterna))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Offerta\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\t\treturn false;\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\t\r\n\t\t\tif(document.commessa.commessaInterna_oggettoOfferta != undefined){\r\n\t\t\t\toggettoOfferta_CommessaInterna = document.commessa.commessaInterna_oggettoOfferta.value;\r\n\t\t\t\tif(oggettoOfferta_CommessaInterna == null || oggettoOfferta_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Oggetto Offerta\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_descrizione != undefined){\r\n\t\t\t\tdescrizione_CommessaInterna = document.commessa.commessaInterna_descrizione.value;\r\n\t\t\t\tif(descrizione_CommessaInterna == null || descrizione_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Descrizione\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_dataInizio != undefined){\r\n\t\t\t\tdataInizio_CommessaInterna = document.commessa.commessaInterna_dataInizio.value;\r\n\t\t\t\tif(dataInizio_CommessaInterna == null || dataInizio_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Inizio\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataInizio_CommessaInterna.length < 10 || dataInizio_CommessaInterna.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (!espressione.test(dataInizio_CommessaInterna))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Inizio\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\t\treturn false;\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\t\r\n\t\t\tif(document.commessa.commessaInterna_dataFine != undefined){\r\n\t\t\t\tdataFine_CommessaInterna = document.commessa.commessaInterna_dataFine.value;\r\n\t\t\t\tif(dataFine_CommessaInterna == null || dataFine_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Data Fine\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(dataFine_CommessaInterna.length < 10 || dataFine_CommessaInterna.length > 10){\r\n\t\t\t\t\t\talert(\"La lunghezza della data è errata. La lunghezza predefinita è di 10 caratteri\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!espressione.test(dataFine_CommessaInterna))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\talert(\"Formato della \\\"Data Fine\\\" è errato. Il formato corretto è gg-mm-yyyy\");\r\n\t\t\t\t\t\t\treturn false;\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\t\r\n\t\t\tvar split_DataInizio_CommessaInterna = dataInizio_CommessaInterna.split(\"-\");\r\n\t\t\tvar split_DataFine_CommessaInterna = dataFine_CommessaInterna.split(\"-\");\r\n\r\n\t\t\tvar dateInizio_CommessaInterna = new Date(split_DataInizio_CommessaInterna[2],split_DataInizio_CommessaInterna[1],split_DataInizio_CommessaInterna[0]).getTime();\r\n\t\t\tvar dateFine_CommessaInterna = new Date(split_DataFine_CommessaInterna[2],split_DataFine_CommessaInterna[1],split_DataFine_CommessaInterna[0]).getTime();\r\n\t\t\t\r\n\t\t\tif(dateInizio_CommessaInterna > dateFine_CommessaInterna){\r\n\t\t\t\talert(\"Data Inizio maggiore della Data Fine\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_importo != undefined){\r\n\t\t\t\timporto_CommessaInterna = document.commessa.commessaInterna_importo.value;\r\n\t\t\t\tif(importo_CommessaInterna == null || importo_CommessaInterna == \"\"){\r\n\t\t\t\t\talert(\"Valorizzare correttamente il campo \\\"Importo\\\"\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var z = 0; z < importo_CommessaInterna.length; z++){\r\n\t\t\t\t\t\tvar singoloChar = importo_CommessaInterna.substring(z,(z+1));\r\n\t\t\t\t\t\tif(controlloLettere.test(singoloChar)){\r\n\t\t\t\t\t\t\talert(\"Attenzione! I caratteri dell'importo non validi.\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar num2 = importo_CommessaInterna.split(\".\");\r\n\t\t\t\t\tif(num2.length > 2){\r\n\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(importo_CommessaInterna.indexOf(\",\") != -1){\r\n\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.0\");\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(importo_CommessaInterna.indexOf(\".\") != -1){\r\n\t\t\t\t\t\t\t\tif((importo_CommessaInterna.length-1) - importo_CommessaInterna.indexOf(\".\") > 2){\r\n\t\t\t\t\t\t\t\t\talert(\"Attenzione! Il formato dell'importo non è valido. Formato corretto 0.00\");\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(document.commessa.commessaInterna_ore != undefined){\r\n\t\t\t\tore_CommessaInterna = document.commessa.commessaInterna_ore.value;\r\n\t\t\t\tif(isNaN(ore_CommessaInterna)){\r\n\t\t\t\t\talert(\"Valorizzare il campo \\\"Ore\\\" solo con valori numerici\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t}else if(tipologia == 4){\r\n\t\t\r\n\t\t/*\r\n\t\t * altro\r\n\t\t * \r\n\t\t * altro_descrizione\r\n\t\t */\r\n\t if(document.commessa.altro_descrizione.value == \"\"){\r\n\t\t alert(\"Valorizzare la descrizione della commessa\");\r\n\t\t return false;\r\n\t }\r\n\t \r\n\t if(!(document.commessa.ferie.checked) && !(document.commessa.permessi.checked) &&\r\n\t\t !(document.commessa.mutua.checked) && !(document.commessa.ferieNonRetribuite.checked) &&\r\n\t\t !(document.commessa.permessiNonRetribuiti.checked) && !(document.commessa.mutuaNonRetribuiti.checked)){\r\n\t\t \talert(\"Selezionare una \\\"Tipologia Commessa\\\"\");\r\n\t\t \treturn false;\r\n\t }\r\n\t \r\n\t}\r\n\t\r\n\treturn true;\r\n}", "title": "" }, { "docid": "a2d1a87cdcede365d016cc3792270b61", "score": "0.57233894", "text": "function nuevaCuenta(){\r\n\r\n //datos de registro\r\n let datos_personales = {\r\n nombres: value(\"CPNnombres\").trim(),\r\n apellidos: value(\"CPNapellidos\").trim(),\r\n tipo_documento: value(\"CPNtipo_documento\"),\r\n numero_documento: value(\"CPNnumero_documento\").trim(),\r\n \r\n celular: value(\"CPNtelefono\"),\r\n \r\n celular2:value(\"CPNcelular\"),\r\n ciudad: value(\"CPNciudad\"),\r\n direccion: value(\"CPNdireccion\"),\r\n barrio: value(\"CPNbarrio\"),\r\n \r\n nombre: value(\"CPNnombre_empresa\").trim(),\r\n correo: value(\"CPNcorreo\"),\r\n con: value(\"CPNcontraseña\").replace(/\\/|\\s/g, \"\"),\r\n objetos_envio: value(\"CPNobjetos_envio\").split(\",\").map(s => s.trim()),\r\n }\r\n\r\n \r\n let datos_relevantes = {\r\n nombres: value(\"CPNnombres\").trim(),\r\n apellidos: value(\"CPNapellidos\").trim(),\r\n contacto: value(\"CPNtelefono\"),\r\n direccion: `${value(\"CPNdireccion\")}, ${value(\"CPNbarrio\")}, ${value(\"CPNciudad\")}`,\r\n objetos_envio: value(\"CPNobjetos_envio\").split(\",\").map(s => s.trim()),\r\n }\r\n \r\n if(administracion){\r\n datos_personales.centro_de_costo = value(\"CPNcentro_costo\").trim().replace(/[^A-Za-z1-9\\-]/g, \"\");\r\n \r\n datos_relevantes.ingreso = value(\"CPNnumero_documento\").replace(/\\/|\\s/g, \"\");\r\n datos_relevantes.centro_de_costo = value(\"CPNcentro_costo\").trim().replace(/[^A-Za-z1-9\\-]/g, \"\");\r\n datos_personales.usuario_corporativo = document.getElementById(\"CPNusuario_corporativo\").checked;\r\n datos_relevantes.usuario_corporativo = datos_personales.usuario_corporativo;\r\n }else {\r\n datos_personales.centro_de_costo = \"Seller\"+value(\"CPNnombre_empresa\").trim().replace(/[^A-Za-z1-9\\-]/g, \"\");\r\n\r\n datos_relevantes.ingreso = value(\"CPNcontraseña\").replace(/\\/|\\s/g, \"\");\r\n datos_relevantes.centro_de_costo = \"Seller\"+value(\"CPNnombre_empresa\").trim().replace(/[^A-Za-z1-9\\-]/g, \"\");\r\n }\r\n\r\n let datos_bancarios = {\r\n banco: value(\"CPNbanco\"),\r\n nombre_banco: value(\"CPNnombre_representante\"),\r\n tipo_de_cuenta: value(\"CPNtipo_de_cuenta\"),\r\n numero_cuenta: value(\"CPNnumero_cuenta\"),\r\n tipo_documento_banco: value(\"CPNtipo_documento_banco\"),\r\n numero_iden_banco: value(\"CPNnumero_identificacion_banco\")\r\n }\r\n\r\n ///div datos bancarios\r\n var mostrar_ocultar_registro_bancario= document.getElementById('mostrar-ocultar-registro-bancario').style.display;\r\n //datos bancarios\r\n console.log(datos_relevantes.centro_de_costo);\r\n //retornar si check está activado o desactivado\r\n var CPNcheck=document.getElementById('CPNdiv_terminos_condiciones').style.display;\r\n verificarExistencia(administracion).then(()=> {\r\n if(value(\"CPNnombres\")==\"\" | value(\"CPNapellidos\")==\"\" | value(\"CPNnumero_documento\")==\"\" | \r\n value(\"CPNtelefono\")==\"\" | value(\"CPNcelular\")==\"\" | value(\"CPNciudad\")==\"\" | \r\n value(\"CPNdireccion\")==\"\" | value(\"CPNbarrio\")==\"\" | value(\"CPNnombre_empresa\")==\"\" | \r\n value(\"CPNcorreo\")==\"\" | value(\"CPNcontraseña\")==\"\" | value(\"CPNrepetir_contraseña\")==\"\" |\r\n !value(\"CPNobjetos_envio\") | datos_relevantes.centro_de_costo == \"\"){\r\n //si todos los datos estan vacios \r\n let id_centro_costo = administracion ? \"CPNcentro_costo\" : \"CPNobjetos_envio\";\r\n inHTML('error_crear_cuenta','<h6 class=\"text-danger\">Error: Ningún campo debe estar vacío</h6>');\r\n verificador([\"CPNnombres\", \"CPNapellidos\", \"CPNnumero_documento\", \r\n \"CPNtelefono\", \"CPNcelular\", \"CPNciudad\", \"CPNdireccion\", \"CPNbarrio\", \r\n \"CPNnombre_empresa\", \"CPNcorreo\", \"CPNcontraseña\", \"CPNrepetir_contraseña\", \r\n \"CPNobjetos_envio\", id_centro_costo], false, \"Este campo no debería estar vacío.\");\r\n }else{\r\n //si todos los datos estan llenos\r\n let puede_continuar = true;\r\n if(document.getElementById(\"registrar-nueva-cuenta\").disabled == true){\r\n inHTML('error_crear_cuenta','<h6 class=\"text-danger\">Error en registro: el usuario ya existe, o la contraseña es muy débil</h6>');\r\n } else if (value(\"CPNcontraseña\")!=value(\"CPNrepetir_contraseña\")){\r\n verificador([\"CPNcontraseña\", \"CPNrepetir_contraseña\"], \"no-scroll\")\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">Error: Las contraseñas no coinciden</h6>`);\r\n } else if (CPNcheck!=\"block\"){\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">Error: Debes aceptar los términos y condiciones para poder seguir</h6>`);\r\n } else {\r\n if(mostrar_ocultar_registro_bancario == \"block\"){\r\n if(value(\"CPNbanco\")==\"\" | value(\"CPNnombre_representante\")==\"\" | value(\"CPNtipo_de_cuenta\")==\"\" | value(\"CPNnumero_cuenta\")==\"\" | value(\"CPNconfirmar_numero_cuenta\")==\"\" |\r\n value(\"CPNtipo_documento_banco\")==\"\" | value(\"CPNnumero_identificacion_banco\")==\"\" | value(\"CPNconfirmar_numero_identificacion_banco\")==\"\"){\r\n puede_continuar = false;\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">Error: Ningún dato bancario puede estar vacio</h6>`);\r\n verificador([\"CPNbanco\", \"CPNnombre_representante\", \"CPNtipo_de_cuenta\", \"CPNnumero_cuenta\", \r\n \"CPNconfirmar_numero_cuenta\", \"CPNtipo_documento_banco\", \"CPNnumero_identificacion_banco\", \r\n \"CPNconfirmar_numero_identificacion_banco\"], false, \"Este campo no debe estar vacío.\")\r\n } else if (value(\"CPNnumero_cuenta\") != value(\"CPNconfirmar_numero_cuenta\")) {\r\n puede_continuar = false;\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">Error: Los números de cuenta no coinciden</h6>`);\r\n verificador([\"CPNnumero_cuenta\", \"CPNconfirmar_numero_cuenta\"], \"no-scroll\")\r\n } else if (value(\"CPNnumero_identificacion_banco\") != value(\"CPNconfirmar_numero_identificacion_banco\")) {\r\n puede_continuar = false;\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">Error: Los número de indentificación en los datos bancarios no coinciden</h6>`);\r\n verificador([\"CPNnumero_identificacion_banco\", \"CPNconfirmar_numero_identificacion_banco\"], \"no-scroll\")\r\n }\r\n }\r\n\r\n if(puede_continuar){\r\n let boton_crear_usuario = document.getElementById(\"registrar-nueva-cuenta\");\r\n boton_crear_usuario.setAttribute(\"onclick\", \"\");\r\n boton_crear_usuario.disabled = true;\r\n boton_crear_usuario.textContent = \"Cargando...\";\r\n\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\"> DATOS BANCARIOS: \"${value(\"CPNbanco\")}\" | \"${value(\"CPNnombre_representante\")}\" | \"${value(\"CPNtipo_de_cuenta\")}\" | \"${value(\"CPNnumero_cuenta\")}\" | \"${value(\"CPNconfirmar_numero_cuenta\")}\" | \r\n \"${value(\"CPNtipo_documento_banco\")}\" | \"${value(\"CPNnumero_identificacion_banco\")}\" | \"${value(\"CPNconfirmar_numero_identificacion_banco\")}</\"h6>`);\r\n \r\n let user = value(\"CPNnumero_documento\").toString().trim();\r\n \r\n firebase.firestore().collection(\"usuarios\").doc(user).get()\r\n .then((doc) => {\r\n console.log(datos_bancarios);\r\n console.log(datos_personales);\r\n console.log(datos_relevantes);\r\n if(!doc.exists) {\r\n firebase.firestore().collection(\"usuarios\").doc(user)\r\n .collection(\"informacion\").doc(\"personal\").set(datos_personales)\r\n .then(() => {\r\n firebase.firestore().collection(\"usuarios\").doc(user).set(datos_relevantes)\r\n .catch((err) => {\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">${err} \\n\r\n No se pudo crear el identificador de ingreso</h6>`);\r\n })\r\n }).then(() => {\r\n firebase.firestore().collection('usuarios').doc(user)\r\n .collection(\"informacion\").doc(\"bancaria\").set(datos_bancarios)\r\n .catch(function(error){\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">Problemas al agregar Datos bancarios</h6>`);\r\n });\r\n }).then(() => {\r\n if(datos_relevantes.usuario_corporativo){\r\n firebase.firestore().collection('usuarios').doc(user)\r\n .collection(\"informacion\").doc(\"heka\").set({\r\n activar_saldo: true,\r\n fecha: genFecha(),\r\n saldo: 0\r\n })\r\n }\r\n }).then(function(){\r\n if(administracion) {\r\n avisar(\"¡Cuenta creada con éxito!\", \r\n \"User_id = \"+ user + \"\\n Puede ingresar con: \" + value(\"CPNnumero_documento\"), \"\", \"admin.html\");\r\n } else {\r\n firebase.firestore().collection(\"usuarios\").where(\"ingreso\", \"==\", datos_relevantes.ingreso.toString()).get()\r\n .then((querySnapshot) => {\r\n localStorage.setItem(\"user_id\", \"\");\r\n querySnapshot.forEach((doc) => {\r\n localStorage.setItem(\"user_id\", doc.id);\r\n localStorage.setItem(\"user_login\", doc.data().ingreso);\r\n console.log(localStorage);\r\n \r\n location.href = \"plataforma2.html\";\r\n })\r\n }).then((d) => {\r\n if(localStorage.user_id == \"\"){\r\n alert(\"Usuario no encontrado\");\r\n }\r\n }).catch((error) => {\r\n console.log(\"Error getting documents: \", error);\r\n });\r\n }\r\n })\r\n .catch(function(error){\r\n boton_crear_usuario.setAttribute(\"onclick\", \"nuevaCuenta()\");\r\n boton_crear_usuario.disabled = false;\r\n boton_crear_usuario.textContent = \"Registrar Cuenta\";\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">${error}</h6>`);\r\n });\r\n } else {\r\n inHTML('error_crear_cuenta',`<h6 class=\"text-danger\">No podemos procesar tu solicitud, ya existe un usuario con ese documento de identificación</h6>`);\r\n verificador(\"CPNnumero_documento\", \"no-scroll\");\r\n boton_crear_usuario.addEventListener(\"click\", () => {\r\n nuevaCuenta(administracion);\r\n })\r\n boton_crear_usuario.disabled = false;\r\n boton_crear_usuario.textContent = \"Crear Cuenta\";\r\n }\r\n })\r\n \r\n }\r\n }\r\n } \r\n })\r\n}", "title": "" }, { "docid": "9ab392bfbcaaa6998d79dae49d0b1670", "score": "0.57206804", "text": "function insert_initial_Cout_maitrise_construction(cout_maitrise_construction,suppression,id_convention_entete)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n }; \n \n var datas = $.param({\n supprimer: suppression,\n id: 0,\n id_type_cout_maitrise: cout_maitrise_construction.type_cout_maitrise.id,\n cout: cout_maitrise_construction.type_cout_maitrise.cout_maitrise,\n id_convention_entete: id_convention_entete\n\n });\n console.log(cout_maitrise_construction);\n console.log(datas);\n //factory\n apiFactory.add(\"cout_maitrise_construction/index\",datas, config).success(function (data)\n {\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée initial cout maitrise d\\'oeuvre');});\n\n\n }", "title": "" }, { "docid": "79b9b5f1c5de5a0634b368d20ab4d17e", "score": "0.57145536", "text": "function insert_initial_Cout_sousprojet_construction(cout_sousprojet_construction,suppression,id_convention_entete)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n }; \n \n var datas = $.param({\n supprimer: suppression,\n id: 0,\n id_type_cout_sousprojet: cout_sousprojet_construction.type_cout_sousprojet.id,\n cout: cout_sousprojet_construction.type_cout_sousprojet.cout_sousprojet,\n id_convention_entete: id_convention_entete\n\n });\n console.log(cout_sousprojet_construction);\n console.log(datas);\n //factory\n apiFactory.add(\"cout_sousprojet_construction/index\",datas, config).success(function (data)\n {\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée initial cout sous projet');});\n\n\n }", "title": "" }, { "docid": "0d79d3b6212354d68c4ec590c210d757", "score": "0.5695595", "text": "function addItemsPuertasValoresInforme(k_codinforme,v_consecutivoinforme,k_codusuario,f_informe) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO informe (k_codinforme,v_consecutivoinforme,k_codusuario,f_informe) VALUES (?,?,?,?)\";\n tx.executeSql(query, [k_codinforme,v_consecutivoinforme,k_codusuario,f_informe], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de informes...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "01427cd8ded297fe44b033c9921d1e99", "score": "0.56863904", "text": "function insere(){\n\t//SE EU ALTEREI ALGUM REGISTRO\n\tif(!Verifica_Alteracao(DIV_TABELA)){\n\t\tselecionaLinha(DIV_TABELA,$('#position-apl').val(),1);\n\t\treturn;\n\t}\n\n\tif(empty(objTabelaApl)){\n\t\tobjTabelaApl = {};\n\t\tobjTabelaApl.registros = [];\n\t\tobjTabelaApl.total = 0;\n\t}\n\n\tvar novaPosicao = {};\n\tnovaPosicao.ap_number = '';\n\tnovaPosicao.ap_code = '';\n\tnovaPosicao.ap_marca = '';\n\n\tobjTabelaApl.registros.push(novaPosicao);\n\tobjTabelaApl.total += 1;\n\n\tvar actpos = objTabelaApl.total > 0 ? (objTabelaApl.total - 1) : 0;\n\n\tpagination((Math.ceil(objTabelaApl.total / LIMITE_REGISTROS)),function(){\n\t\tpintaLinha($(DIV_TABELA + \" tr[posicao=\"+actpos+\"]\"));\n\t\tsetStatus(actpos,'+',DIV_TABELA);\n\t\tBloqueia_Linhas(actpos,DIV_TABELA);\n\t\t$('#record-apl').val(objTabelaApl.total);\n\t\tselecionaLinha(DIV_TABELA,actpos,2);\n\t});\n}", "title": "" }, { "docid": "8ed7fefaf784d58e468422e12ee0ba02", "score": "0.5659895", "text": "function addItemsPuertasValoresElectrica(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_valores_electrica (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de electrica...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "a75c246707c5f386663fa1449b8e303a", "score": "0.56514037", "text": "function subirReportesCliente(respuesta,data) {\r\n console.log(\"Manipulador de petición 'reportesCliente' ha sido llamado.\");\r\n // Respuesta Web\r\n // respuesta.writeHead(200, {\"Content-Type\": \"text/html\"});\r\n var sqlite3 = require('sqlite3').verbose();\r\n var db = new sqlite3.Database(file);\r\n var lista = \"\";\r\n var cliente = querystring.parse(data)[\"cliente\"];\r\n try {\r\n db.each(\"SELECT * FROM Reportes WHERE cliente =? ORDER BY anio, mes, dia\",[cliente],\r\n function(err, row) {\r\n if (err){\r\n console.log(err);\r\n respuesta.write(\"Error obteniendo reportes\"+\"\\n\");\r\n throw err;\r\n }\r\n else {\r\n if (row.h_fact != null && row.h_fact != undefined) {\r\n lista = lista + row._id + \"|\" +\r\n row.asesor + \"|\" + \r\n row.dia + \"|\" +\r\n row.mes + \"|\" +\r\n row.anio + \"|\" +\r\n row.hora_inicio + \"|\" +\r\n row.hora_fin + \"|\" +\r\n row.descripcion + \"|\" + \r\n + row.h_fact + \"|\" + \r\n \"\\n\";\r\n }\r\n else {\r\n lista = lista + row._id + \"|\" +\r\n row.asesor + \"|\" + \r\n row.dia + \"|\" +\r\n row.mes + \"|\" +\r\n row.anio + \"|\" +\r\n row.hora_inicio + \"|\" +\r\n row.hora_fin + \"|\" +\r\n row.descripcion + \"|\" + \r\n \"0.0\" + \"|\" +\r\n \"\\n\";\r\n }\r\n }\r\n },function(err, num){\r\n if (err){\r\n console.log(err);\r\n respuesta.write(\"Error obteniendo reportes\"+\"\\n\"); \r\n respuesta.end();\r\n throw err;\r\n } \r\n console.log(\"Cantidad de Reportes \"+ num);\r\n console.log(lista);\r\n respuesta.writeHead(200, {\"Content-Type\": \"text/plain; charset=utf-8\"});\r\n respuesta.write(\"Cantidad de Reportes|\"+ num.toString() \r\n +\"\\n\");\r\n respuesta.write(lista); \r\n respuesta.end();\r\n });\r\n } catch (err) {\r\n // manejamos error\r\n console.log(err);\r\n }\r\n}", "title": "" }, { "docid": "10e21474d3979e082000210f4ffbb3b1", "score": "0.5644398", "text": "function insertCompanyAccount(obj) {\n client.getSession().then(session => {\n session.sql(\"INSERT INTO company_account (`client_name`,`client_id`,`receivable_account`,`receivable_date`,`unreceivable_account`) VALUES (?,?,?,?,?)\").bind([obj.client_name, obj.client_id, obj.receivable_account, obj.receivable_date, obj.unreceivable_account]).execute().then(function (result) {\n console.log(result.fetchAll());\n }).catch(console.error);\n return session.close();\n }).catch(console.error);\n}", "title": "" }, { "docid": "6e1db1e01d2bf08e5de143eabf16f3af", "score": "0.5641564", "text": "insertSaber(data, res) {\n const sql = 'insert into LightSaber set ?';\n conexao.query(sql, data, (erro, resultados) => {\n if (erro) {\n res.status(400).json(erro);\n }\n else {\n res.status(201).json(resultados);\n }\n });\n }", "title": "" }, { "docid": "5bbb332054b7cf7b4a6fba6391030318", "score": "0.5635004", "text": "function addItemsPuertasValoresProteccion(k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de protección...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "2a31c6d6934484831e921200c2a18be8", "score": "0.56150305", "text": "function insert_contacts(data)\r\n{\r\n table_contacs();//crea la tabla de contactos\r\n var client = JSON.parse(data);//pasa los datos a un array\r\n\r\n for(i=0; i < client.length; i++)\r\n {\r\n /* Fraccione esto en una varible unificatoria para poder ver los datos mejor :D\r\n\tademas de que me permite ver los datos en correspondiente del array dado por los datos */\r\n var x = \"<tr id='cols'><td>\"+client[i].name+\"</td><td>\";\r\n x = x+ client[i].identification+\"</td><td>\";\r\n x = x+client[i].phonePrimary+\"</td><td>\";\r\n if(client[i].observations.length > 20)\r\n {\r\n x = x+client[i].observations.substr(0,20)+\"...</td>\";\r\n }\r\n else\r\n {\r\n x = x+client[i].observations+\"</td>\";\r\n }\r\n x = x+\"<td><a href=javascript:load_contacs(\"+client[i].id+\")>Ver</a></td></tr>\";\r\n\r\n\t//agregue hijos a la tabla de id \"client\"\r\n $(\"#client\").append(x);\r\n }\r\n $(\"#content-document\").append(\"</table><div onclick=new_client(); id='new_contact'><label> Crear un nuevo contacto </label></div>\");\r\n\r\n}", "title": "" }, { "docid": "9e7cd8a8ad98c7cd3e1bd7a90e64b353", "score": "0.56041765", "text": "function caricoDatiServerSalvoInDb ()\n{\n // alert(\"Si\");\n var connessione = checkInternet();\n if (connessione==true) {\n // Prima bisonga cancellare un db se già essitente è crearlo se non esiste\n db = window.openDatabase(\"DatabaseSqlliteApp\", \"1.0\", \"Database prova\", 200000);\n db.transaction(\n // Metodo di chiamata asincrona\n function(tx) {\n tx.executeSql(\"DROP TABLE IF EXISTS clienti\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS clienti (id INTEGER PRIMARY KEY AUTOINCREMENT,identificativo, nome, cognome, email,foto)\");\n },\n function () {\n // alert(\"Errore\");\n },\n function(){\n // alert(\"Cancellazione effettuata\");\n }\n )\n // Prelevo dati dal server\n $.getJSON(\"http://www.trovoperte.com/admin/CS_Sync.aspx\", function (dati) {\n var li_dati = \"\";\n $.each(dati, function (i, name) {\n // Inserisco dati nel db sqllite dell' App\n db = window.openDatabase(\"DatabaseSqlliteApp\", \"1.0\", \"Database prova\", 200000);\n db.transaction(\n // Metodo di chiamata asincrona\n function(tx) {\n tx.executeSql(\"INSERT INTO clienti (identificativo,nome,cognome,email,foto) VALUES (?,?,?,?,?)\",[name.ID,name.nome,name.cognome,name.email,name.foto]);\n },\n onDbError,\n function(){\n // alert(\"Inserimento effettuato\");\n }\n )\n });\n selezionoDati ();\n });\n \n } else {\n // Carico i dati dal db se è stato creato almeno una volta\n selezionoDati ();\n\n }\n \n}", "title": "" }, { "docid": "6466779e55f4c11996d4e61cc6566cee", "score": "0.55768454", "text": "function insert_in_baseContrat_partenaire_relai(contrat_partenaire_relai,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemContrat_partenaire_relai==false)\n {\n getId = vm.selectedItemContrat_partenaire_relai.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n intitule: contrat_partenaire_relai.intitule,\n ref_contrat: contrat_partenaire_relai.ref_contrat,\n montant_contrat: contrat_partenaire_relai.montant_contrat,\n date_signature:convertionDate(contrat_partenaire_relai.date_signature),\n id_partenaire_relai:contrat_partenaire_relai.id_partenaire_relai,\n id_convention_entete: vm.selectedItemConvention_entete.id,\n validation : 0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"contrat_partenaire_relai/index\",datas, config).success(function (data)\n { \n var pres= vm.allpartenaire_relai.filter(function(obj)\n {\n return obj.id == contrat_partenaire_relai.id_partenaire_relai;\n });\n\n /*var conv= vm.allconvention_entete.filter(function(obj)\n {\n return obj.id == contrat_partenaire_relai.id_convention_entete;\n });*/\n\n if (NouvelItemContrat_partenaire_relai == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n //vm.selectedItemContrat_partenaire_relai.convention_entete= conv[0];\n vm.selectedItemContrat_partenaire_relai.partenaire_relai = pres[0];\n \n vm.selectedItemContrat_partenaire_relai.$selected = false;\n vm.selectedItemContrat_partenaire_relai.$edit = false;\n vm.selectedItemContrat_partenaire_relai ={};\n vm.showbuttonNouvcontrat_pr= false;\n }\n else \n { \n vm.allcontrat_partenaire_relai = vm.allcontrat_partenaire_relai.filter(function(obj)\n {\n return obj.id !== vm.selectedItemContrat_partenaire_relai.id;\n });\n vm.showbuttonNouvcontrat_pr= true;\n }\n \n }\n else\n {\n //contrat_partenaire_relai.convention_entete= conv[0];\n contrat_partenaire_relai.partenaire_relai = pres[0];\n contrat_partenaire_relai.validation = 0;\n contrat_partenaire_relai.id = String(data.response); \n NouvelItemContrat_partenaire_relai=false;\n vm.showbuttonNouvcontrat_pr = false;\n } \n vm.showbuttonValidation = false;\n vm.showbuttonNouvContrat_partenaire_relai = 1;\n contrat_partenaire_relai.$selected = false;\n contrat_partenaire_relai.$edit = false;\n vm.selectedItemContrat_partenaire_relai = {};\n vm.showbuttonValidationcontrat_pr = false;\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "title": "" }, { "docid": "e7df3a200e160d6fd708156aef469d62", "score": "0.55648994", "text": "function addItemsPuertasValoresMotorizacion(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_valores_motorizacion (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de motorizacion...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "6c74661bd7f17535ea697cef26606700", "score": "0.5556548", "text": "function insert_in_basePassation_marches_pr(passation_marches_pr,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemPassation_marches_pr==false)\n {\n getId = vm.selectedItemPassation_marches_pr.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n date_lancement_dp: convertionDate(passation_marches_pr.date_lancement_dp),\n date_os: convertionDate(passation_marches_pr.date_os),\n date_remise: convertionDate(passation_marches_pr.date_remise),\n nbr_offre_recu: passation_marches_pr.nbr_offre_recu, \n id_partenaire_relai: passation_marches_pr.id_partenaire_relai,\n date_manifestation: convertionDate(passation_marches_pr.date_manifestation),\n date_signature_contrat: convertionDate(passation_marches_pr.date_signature_contrat),\n id_convention_entete: vm.selectedItemConvention_entete.id,\n validation:0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"passation_marches_pr/index\",datas, config).success(function (data)\n { \n\n if (NouvelItemPassation_marches_pr == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n { \n //vm.selectedItemPassation_marches_pr.convention_entete = vm.selectedItemConvention_entete;\n //vm.selectedItemPassation_marches_pr.partenaire_relai = partenaire_relai[0];\n vm.selectedItemPassation_marches_pr.$selected = false;\n vm.selectedItemPassation_marches_pr.$edit = false;\n vm.selectedItemPassation_marches_pr ={};\n vm.showbuttonNouvPassation_pr= false;\n }\n else \n { \n vm.allpassation_marches_pr = vm.allpassation_marches_pr.filter(function(obj)\n {\n return obj.id !== vm.selectedItemPassation_marches_pr.id;\n });\n vm.showbuttonNouvPassation_pr= true;\n }\n \n }\n else\n {\n passation_marches_pr.validation=0;\n //passation_marches_pr.partenaire_relai = partenaire_relai[0];\n //passation_marches_pr.convention_entete = vm.selectedItemConvention_entete;\n passation_marches_pr.id = String(data.response); \n NouvelItemPassation_marches_pr=false;\n vm.showbuttonNouvPassation_pr= false;\n }\n\n passation_marches_pr.$selected = false;\n passation_marches_pr.$edit = false;\n vm.selectedItemPassation_marches_pr = {};\n vm.showbuttonValidationpassation_pr = false;\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "title": "" }, { "docid": "a060d4007e53c2db07fcb079046e95a6", "score": "0.55470556", "text": "function pass_insert() {}", "title": "" }, { "docid": "f106d262b2db45ba6687a39bdf07a537", "score": "0.55447173", "text": "function crearCuenta(name, mail, lastname, password) { // VALIDACION EN EL SERVIDOR LDAP\n let username = \"uid=\" + process.env.USERNAME + \",\" + CONFIG.ldap.dn;\n // CREACION DE CONEXION A LDAP CON LOS PARAMETROS PASADOS POR LA VISTA LOGIN\n client.bind(username, process.env.PASSN, function (err) {\n if (err) { // AUTENTICACION FALLIDA\n console.log(\"Error in new connetion \" + err)\n\n\n } else { // AUTENTICACION EXITOSA\n console.log(\" Connection success\");\n\n\n let FQDN;\n let concat;\n let posicion = mail.indexOf(\"yuca\");\n if (posicion !== -1) {\n concat = CONFIG.ldap.dn2;\n FQDN = \"yuca\"\n } else {\n concat = CONFIG.ldap.dn3;\n FQDN = \"eloteloco\"\n }\n\n const entry = {\n cn: name,\n homeDirectory: \"/home/vmail/\" + FQDN + \"/\" + name + \".\" + lastname,\n mail: mail,\n ObjectClass: [\n 'inetOrgPerson',\n 'organizationalPerson',\n 'CourierMailAccount',\n 'person',\n 'top'\n ],\n sn: lastname,\n mailbox: FQDN + \"/\" + name + \".\" + lastname,\n userPassword: md5(password)\n };\n client.add(('uid=' + name + \".\" + lastname + \",\" + concat), entry, (err) => {\n if (err) {\n console.log(\"err in new user \" + err);\n } else {\n console.log(\"added user\")\n }\n });\n }\n });\n}", "title": "" }, { "docid": "c4e9c13becde3834b53464ce88a62c62", "score": "0.55409336", "text": "function consultar_client() {\n $.ajax (\n {\n url : 'https://g290244b9fbd428-db202110032029.adb.sa-santiago-1.oraclecloudapps.com/ords/admin/client/client',\n type : 'GET',\n dataType : 'json',\n success : function(json){ \n $(\"#idDivConsulta_client\").empty();\n $(\"#idDivConsulta_client\").append(\"<table>\");\n $(\"#idDivConsulta_client\").append(\"<caption>Tabla de Clientes</caption>\");\n $(\"#idDivConsulta_client\").append(\"<tr><th>Codigo</th><th>Nombre</th><th>Correo</th><th>Edad</th></tr>\");\n for (i=0; i<json.items.length; i++){\n $(\"#idDivConsulta_client\").append(\"<tr>\");\n $(\"#idDivConsulta_client\").append(\"<td>\" + json.items[i].id) + \"</td>\";\n $(\"#idDivConsulta_client\").append(\"<td>\" + json.items[i].name) + \"</td>\";\n $(\"#idDivConsulta_client\").append(\"<td>\" + json.items[i].email) + \"</td>\";\n $(\"#idDivConsulta_client\").append(\"<td>\" + json.items[i].age) + \"</td>\"; \n // $(\"#idDivConsulta_client\").append(json.items[i].codigo + json.items[i].nombre + \" \")\n $(\"#idDivConsulta_client\").append(\"</tr>\");\n } \n console.log(json) \n },\n error : function(xhr,status){\n console.log(xhr);\n }\n } \n );\n}", "title": "" }, { "docid": "acdd407c1fb51c9d298015cf1b875bc6", "score": "0.5537354", "text": "function subirReporte(respuesta,data) {\r\n console.log(\"Manipulador de petición 'subirReporte' ha sido llamado.\");\r\n var asesor = querystring.parse(data)[\"asesor\"];\r\n var cliente = querystring.parse(data)[\"cliente\"];\r\n var dia = parseInt(querystring.parse(data)[\"dia\"],10);\r\n var mes = parseInt(querystring.parse(data)[\"mes\"],10);\r\n var anio = parseInt(querystring.parse(data)[\"anio\"],10);\r\n var clave = querystring.parse(data)[\"password\"];\r\n var hora_inicio = \"\" + querystring.parse(data)[\"hora_inicio\"]\r\n var h_ini = parseFloat(hora_inicio.replace(\":\",\".\"),10);\r\n var hora_fin = \"\" + querystring.parse(data)[\"hora_fin\"];\r\n var h_fin= parseFloat(hora_fin.replace(\":\",\".\"),10);\r\n var hora_fact = \"\" + querystring.parse(data)[\"hora_fact\"];\r\n var h_fact= parseFloat(hora_fact.replace(\":\",\".\"),10);\r\n var descripcion = querystring.parse(data)[\"descripcion\"];\r\n if (dia <= 0 || mes <= 0 || anio <= 0 || dia > 31 || mes > 12 || anio < 2016 ) { // Revisamos fecha negativa\r\n respuesta.write(\"Error: Fecha no es correcta\");\r\n respuesta.end(); \r\n console.log(\"ERROR FECHA\");\r\n console.log(dia+ \"/\"+ mes + \"/\" + anio);\r\n }\r\n else { // Si es valida seguimos\r\n if (h_ini < 0 || h_fin < 0 || h_ini >= 24 || h_fin >= 24) { // Revisamos fecha negativa\r\n respuesta.write(\"Error: Hora incorrecta, deben estar formato 24 horas (13:51)\");\r\n respuesta.end(); \r\n }\r\n else {\r\n var sqlite3 = require('sqlite3').verbose();\r\n var db = new sqlite3.Database(file);\r\n try {\r\n db.get(\"SELECT user,password FROM Asesores WHERE user =?\",\r\n [asesor], \r\n function(error, row) { // Vemos si usuario fuente existe\r\n if (error || row == undefined){ // Si no existe damos error\r\n console.log(error);\r\n console.log(\"Error en Login undefined\");\r\n respuesta.write(\"Error: Problema en datos del usuario\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else { \r\n if (row.user == asesor) {\r\n // Comprobamos con la clave encriptada\r\n bcrypt.compare(clave, row.password, function(err, res) {\r\n if (res == true) {\r\n console.log(\"Login Exitoso\");\r\n var insertar = \"INSERT INTO Reportes VALUES (?,?,?,?,?,?,?,?,?,?)\";\r\n db.run(insertar,[null,asesor,cliente,dia,mes,anio,h_ini,h_fin,descripcion,h_fact],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error registro transferencia\");\r\n respuesta.write(\"Error: Problemas con el reporte\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else {\r\n // Vemos _id de reporte\r\n db.get(\"SELECT _id FROM Reportes WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\",\r\n [asesor,cliente,dia,mes,anio], \r\n function(error, row) { // Vemos si existe reporte\r\n if (error || row == undefined){ // Si no existe damos error\r\n console.log(error);\r\n console.log(\"Error reporte no creado\");\r\n respuesta.write(\"Error: Reporte no creado\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else {\r\n // Si es exitoso editamos reporte\r\n console.log(\"Reporte Exitoso\");\r\n console.log(\"ID DEL REPORTE|\" + row._id);\r\n respuesta.write(\"Reporte Exitoso\\n\");\r\n respuesta.write(\"ID DEL REPORTE|\" + row._id);\r\n respuesta.end();\r\n }\r\n }); \r\n }\r\n });\r\n }\r\n else{\r\n console.log(\"Error en Login\");\r\n respuesta.write(\"Error: Error en Login\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n });\r\n }\r\n else{\r\n console.log(\"Error en Login\");\r\n respuesta.write(\"Error: Error en Login\"+ \"\\n\");\r\n respuesta.end();\r\n } \r\n }\r\n });\r\n } catch (err) {\r\n // manejamos error\r\n console.log(err);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6b98b66c22ae51fd3e6857249df117e7", "score": "0.5534094", "text": "function addItemsPuertasValoresIniciales(k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_desc_puerta,o_tipo_puerta,o_motorizacion,o_acceso,o_accionamiento,o_operador,o_hoja,o_transmision,o_identificacion,f_fecha,v_ancho,v_alto,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos iniciales...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "7c99049cd2db8af6313d2a819ae53508", "score": "0.5531714", "text": "function execute(user, msg) {\n \n //SAVE INFO IN DATABASE HERE\n \n const numero = banco.db[user].numero\n const nome = banco.db[user].nome\n const preco = banco.db[user].preco\n const endereco = banco.db[user].endereco\n const valor_troco = banco.db[user].valor_troco\n const VALUES = [numero, nome, preco, endereco, valor_troco]\n \n console.log(VALUES)\n \n let sql = \"INSERT INTO pedidos (numero,nome,preco,endereco,valor_troco) VALUES (?,?,?,?,?)\"\n \n db.query(sql, VALUES, function (err, result) {\n if (err) throw err;\n console.log(\"Number of records inserted: \" + result.affectedRows);\n })\n\n //POSTGRESQL \n\n // let query = `INSERT INTO pedidos (\"numero\",\t\"nome\",\t\"preco\",\t\"endereco\",\t\n // \"valor_troco\") \n // VALUES ($1, $2, $3, $4, $5)`\n \n // db.query(query, VALUES, function(err){\n // if (err) console.log(err)\n // })\n \n banco.db[user] = {\n stage: 0,\n itens: [],\n numero: 0,\n preco: 0.0,\n endereco: \"\",\n valor_troco: 0.0,\n nome: ''\n };\n\n return [\n \"Obrigado pela preferencia.\",\n \"Aguarde, seu pedido chegará em breve\",\n \"Mais informações ligue para 33333-3311\",\n `Valor do Pedido: ${banco.db[user].preco}`,\n `Valor Troco: ${banco.db[user].valor_troco}`,\n `Lista: ${banco.db[user].itens.descricao}`\n ];\n}", "title": "" }, { "docid": "ba58c4876529b5d355ddfcde81fec084", "score": "0.5526792", "text": "function muestraClientes(tx){\n tx.executeSql('SELECT * FROM Cliente',[],muestraClientesSql,errorClientes);\n }", "title": "" }, { "docid": "c0afe6d00172ee0553a45b3fe779881e", "score": "0.55130833", "text": "function subirEditarReporte(respuesta,data) {\r\n console.log(\"Manipulador de petición 'subirEditarReporte' ha sido llamado.\");\r\n var asesor = querystring.parse(data)[\"asesor\"];\r\n var cliente = querystring.parse(data)[\"cliente\"];\r\n var dia = parseInt(querystring.parse(data)[\"dia\"],10);\r\n var mes = parseInt(querystring.parse(data)[\"mes\"],10);\r\n var anio = parseInt(querystring.parse(data)[\"anio\"],10);\r\n var diaN = parseInt(querystring.parse(data)[\"diaN\"],10);\r\n var mesN = parseInt(querystring.parse(data)[\"mesN\"],10);\r\n var anioN = parseInt(querystring.parse(data)[\"anioN\"],10);\r\n var clave = querystring.parse(data)[\"password\"];\r\n var hora_inicio = \"\" + querystring.parse(data)[\"hora_inicio\"];\r\n var h_ini = parseFloat(hora_inicio.replace(\":\",\".\"),10);\r\n var hora_fin = \"\" + querystring.parse(data)[\"hora_fin\"];\r\n var h_fin= parseFloat(hora_fin.replace(\":\",\".\"),10);\r\n var hora_fact = \"\" + querystring.parse(data)[\"hora_fact\"];\r\n var h_fact= parseFloat(hora_fact.replace(\":\",\".\"),10);var descripcion = querystring.parse(data)[\"descripcion\"];\r\n if (dia <= 0 || mes <= 0 || anio <= 0 || dia > 31 || mes > 12 || anio < 2016 ||\r\n diaN <= 0 || mesN <= 0 || anioN <= 0 || diaN > 31 || mesN > 12 || anioN < 2016 ) { // Revisamos fecha negativa\r\n respuesta.write(\"Error: Fecha no es correcta\");\r\n respuesta.end(); \r\n }\r\n else { // Si es valida seguimos\r\n if (h_ini < 0 || h_fin < 0 || h_ini >= 24 || h_fin >= 24) { // Revisamos fecha negativa\r\n respuesta.write(\"Error: Hora incorrecta, deben estar formato 24 horas (13:51)\");\r\n respuesta.end(); \r\n }\r\n else {\r\n var sqlite3 = require('sqlite3').verbose();\r\n var db = new sqlite3.Database(file);\r\n try {\r\n db.get(\"SELECT user,password FROM Asesores WHERE user =?\",\r\n [asesor], \r\n function(error, row) { // Vemos si usuario fuente existe\r\n if (error || row == undefined){ // Si no existe damos error\r\n console.log(error);\r\n console.log(\"Error en Login undefined\");\r\n respuesta.write(\"Error: Problema en datos del usuario\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else { \r\n if (row.user == asesor) {\r\n // Comprobamos con la clave encriptada\r\n bcrypt.compare(clave, row.password, function(err, res) {\r\n if (res == true) {\r\n console.log(\"Login Exitoso\");\r\n // Vemos si reporte existe\r\n db.get(\"SELECT asesor FROM Reportes WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\",\r\n [asesor,cliente,dia,mes,anio], \r\n function(error, row) { // Vemos si existe reporte\r\n if (error || row == undefined){ // Si no existe damos error\r\n console.log(error);\r\n console.log(\"Error reporte no existe\");\r\n respuesta.write(\"Error: Reporte no existe\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else {\r\n // Si es exitoso editamos reporte\r\n var actualizar = \"UPDATE Reportes SET dia = ?,mes = ?,anio = ?,\"+\r\n \"hora_inicio = ?,hora_fin = ?,descripcion = ?, h_fact = ? WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\";\r\n db.run(actualizar,[diaN,mesN,anioN,h_ini,h_fin,descripcion,h_fact,asesor,cliente,dia,mes,anio],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error actualizando reporte\");\r\n respuesta.write(\"Error: Problemas con el reporte\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else {\r\n console.log(\"Reporte Actualizado Faltan actividades\");\r\n var actualizar2 = \"UPDATE Actividades SET dia = ?,mes = ?,anio = ?\"+\r\n \" WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\";\r\n db.run(actualizar2,[diaN,mesN,anioN,asesor,cliente,dia,mes,anio],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error registro actividad\");\r\n respuesta.write(\"Error: Problemas registro actividad\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else {\r\n // Si es exitoso editamos reporte\r\n console.log(\"Reporte Actualizado\");\r\n respuesta.write(\"Reporte Actualizado\\n\");\r\n respuesta.end();\r\n }\r\n });\r\n }});\r\n }\r\n });\r\n }\r\n else{\r\n console.log(\"Error en Login\");\r\n respuesta.write(\"Error: Error en Login\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n });\r\n }\r\n else{\r\n console.log(\"Error en Login\");\r\n respuesta.write(\"Error: Error en Login\"+ \"\\n\");\r\n respuesta.end();\r\n } \r\n }\r\n });\r\n } catch (err) {\r\n // manejamos error\r\n console.log(err);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6f677c1f7d5e241970987eafbd4227a3", "score": "0.549418", "text": "function storedClient(req,res){\n\n models.User.findOne( {\n where: { correo: req.userCorreo }}).then(enter_id => { \n\n var code = \"\";\n var lon = 4;\n var chars = \"1234567890\";\n\n for (x=0; x < lon; x++)\n {\n rand = Math.floor(Math.random()*chars.length);\n code += chars.substr(rand, 1);\n }\n\n code = code+'-'+enter_id.id;\n \n req.body.numero_ticket = code;\n req.body.tipo_id = 1;\n req.body.user_id = enter_id.id;\n req.body.enterprise_id = enter_id.enterprise_id;\n req.body.statu_id = 3;\n req.body.visto = false;\n\n models.Ticket.create(req.body).then(stored => {\n\n res.status(200).send({ message: \"Su Ticket fue enviado #\"+code+'-'+stored.id});\n\n }).error(err => res.status(500).json({ message: \"error al guardar el registro\"}))\n \n }).error(err => res.status(500).json({ message: \"error al buscar el usuario del token. Verifiqué y comuníquese con soporte\"}) )\n\n}", "title": "" }, { "docid": "ec33cb39483386a8ff31303087d76561", "score": "0.54896265", "text": "function cargaLista(){\n\t var arr = new Array();\n\n\t\tarr[arr.length] = new Array(\"oid\", get(\"frmInsertarCartera.oid\")+\"\");\n\t\tarr[arr.length] = new Array(\"oidPais\", get(\"frmInsertarCartera.hPais\")+\"\");\n\t\tarr[arr.length] = new Array(\"oidIdioma\", get(\"frmInsertarCartera.hIdioma\")+\"\");\n \n\t configurarPaginado(mipgndo,\"CARBuscarAsignacionesCodigoConf\",\"ConectorBuscarAsignacionesCodigoConf\",\n\t\t\"es.indra.sicc.util.DTOOID\",arr); \n\n /*var asignaciones = get('frmInsertarCartera.hidAsignaciones');\n var arra = asignaciones.split('|');\n\n for (var i=0;i<arra.length-1 ;i++) {\n var asign = arra[i].split('@');\n var newRow = new Array();\n\n oidAsignacion = asign[0];\n strCodConf = asign[1];\n strNivelRiesgo = asign[2];\n strGrupoSolicitud = asign[3];\n strMarca = asign[4];\n strCanal = asign[5];\n strSubgerenciasVentas = asign[6];\n strRegion = asign[7];\n strZona = asign[8];\n strLinCreIni = asign[9];\n strNiveRiesIni = asign[10];\n oidCodConf = asign[11];\n oidNieRies = asign[12];\n oidGrupoSolicitud = asign[13];\n oidMarca = asign[14];\n oidCanal = asign[15];\n oidSGV = asign[16];\n oidRegion = asign[17];\n oidZona = asign[18];\n oidNiveRiesIni = asign[19];\n \n newRow[newRow.length] = oidAsignacion;\n agregarALlistado(newRow);\n }*/ \n }", "title": "" }, { "docid": "363d40bfde0f1525f09419fa237599e0", "score": "0.5480566", "text": "function guardarInspeccion(){\n /* ============================\n * REDIRECCIONAMOS AL INICIO DE LA PAGINA DE INSPECCION Y ABRIMOS LA VENTANA DE CARGA\n * LA CUAL SE CIERRA EN LA FUNCION addItemConsecutivoAscensores\n * ============================= */\n location.href = \"#arriba\";\n ocultarDivs();\n abrirVentanaCarga();\n var hora = mostrarhora();\n\n var codigo_inspeccion = getQueryVariable('id_inspeccion');\n var cod_usuario = getQueryVariable('cod_usuario');\n var consecutivo_inspeccion = $(\"#text_consecutivo\").val();\n\n var textCliente = $(\"#text_cliente\").val();\n var textEquipo = $(\"#text_equipo\").val();\n var textEmpresaMantenimiento = $(\"#text_empresaMantenimiento\").val();\n var textTipoAccionamiento = $(\"#text_tipoAccionamiento\").val();\n var textCapacidadPersonas = $(\"#text_capacidadPersonas\").val();\n var textCapacidadPeso = $(\"#text_capacidadPeso\").val();\n var textNumeroParadas = $(\"#text_numeroParadas\").val();\n var textFecha = $(\"#text_fecha\").val();\n var textCodigo = $(\"#text_codigo\").val();\n var textUltimoMto = $(\"#text_ultimo_mto\").val();\n var textInicioServicio = $(\"#text_inicio_servicio\").val();\n var textUltimaInspec = $(\"#text_ultima_inspec\").val();\n\n if (textFecha.length < 1) {\n textFecha = \"------\";\n }\n if (textUltimoMto.length < 1) {\n textUltimoMto = \"------\";\n }\n if (textInicioServicio.length < 1) {\n textInicioServicio = \"------\";\n }\n if (textUltimaInspec.length < 1) {\n textUltimaInspec = \"------\";\n }\n\n var textObserFinal = $(\"#text_observacion_final\").val();\n\n /* ============================\n * Actualizar valores en las tablas\n * ============================= */\n /* Actualizar valores en la tabla ascensor_valores_iniciales */\n updateItemsAscensorValoresIniciales(textCliente,textEquipo,textEmpresaMantenimiento,textTipoAccionamiento,textCapacidadPersonas,textCapacidadPeso,textNumeroParadas,textFecha,textUltimoMto,textInicioServicio,textUltimaInspec,hora,'Revisión', cod_usuario,codigo_inspeccion);\n /* Actualizar valores en la tabla ascensor_valores_preliminar */\n var cantidadItemsTAIPRE = window.sessionStorage.getItem(\"cantidadItemsTablaAIPRE\");\n for (var i = 1; i <= cantidadItemsTAIPRE; i++) {\n updateItemsAscensorValoresPreliminar(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_preliminar'+i).val(),\n $('input:radio[name=seleval'+i+']:checked').val(),\n $('#text_obser_item'+i+'_eval_prel').val());\n }\n /* Actualizar valores en la tabla ascensor_valores_proteccion */\n var cantidadItemsTAIPP = window.sessionStorage.getItem(\"cantidadItemsTablaAIPP\");\n for (var i = 1; i <= cantidadItemsTAIPP; i++) {\n updateItemsAscensorValoresProteccion(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_proteccion'+i).val(),\n $('input:radio[name=sele_protec_person'+i+']:checked').val(),\n $('input:radio[name=sele_protec_person'+i+'_'+i+']:checked').val(),\n $('#text_obser_protec_person'+i).val());\n }\n /* Actualizar valores en la tabla ascensor_valores_elementos */\n var cantidadItemsTAIE = window.sessionStorage.getItem(\"cantidadItemsTablaAIE\");\n for (var i = 1; i <= cantidadItemsTAIE; i++) {\n updateItemsAscensorValoresElementos(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_element_inspec'+i).val(),\n $('#descrip_item_element_inspec'+i).val(),\n $('input:radio[name=sele_element_inspec'+i+']:checked').val());\n }\n /* Actualizar valores en la tabla ascensor_valores_cabina */\n var cantidadItemsTAIC = window.sessionStorage.getItem(\"cantidadItemsTablaAIC\");\n for (var i = 1; i <= cantidadItemsTAIC; i++) {\n if ($('input:radio[name=sele_cabina'+i+']:checked').val() == \"No Cumple\") {\n contador_items_nocumple += 1;\n }\n updateItemsAscensorValoresCabina(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_cabina'+i).val(),\n $('#cal_item_cabina'+i).val(),\n $('input:radio[name=sele_cabina'+i+']:checked').val(),\n $('#text_lv_valor_observacion_'+i).val());\n }\n /* Actualizar valores en la tabla ascensor_valores_maquinas */\n var cantidadItemsTAIM = window.sessionStorage.getItem(\"cantidadItemsTablaAIM\");\n var numero_final_item = 36 + parseInt(cantidadItemsTAIM);\n for (var i = 36; i < numero_final_item; i++) {\n if ($('input:radio[name=sele_maquinas'+i+']:checked').val() == \"No Cumple\") {\n contador_items_nocumple += 1;\n }\n updateItemsAscensorValoresMaquinas(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_maquinas'+i).val(),\n $('#cal_item_maquinas'+i).val(),\n $('input:radio[name=sele_maquinas'+i+']:checked').val(),\n $('#text_maquinas_observacion_'+i).val());\n }\n /* Actualizar valores en la tabla ascensor_valores_pozo */\n var cantidadItemsTAIP = window.sessionStorage.getItem(\"cantidadItemsTablaAIP\");\n var numero_final_item = 83 + parseInt(cantidadItemsTAIP);\n for (var i = 83; i < numero_final_item; i++) {\n if ($('input:radio[name=sele_pozo'+i+']:checked').val() == \"No Cumple\") {\n contador_items_nocumple += 1;\n }\n updateItemsAscensorValoresPozo(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_pozo'+i).val(),\n $('#cal_item_pozo'+i).val(),\n $('input:radio[name=sele_pozo'+i+']:checked').val(),\n $('#text_pozo_observacion_'+i).val());\n }\n /* Actualizar valores en la tabla ascensor_valores_foso */\n var cantidadItemsTAIF = window.sessionStorage.getItem(\"cantidadItemsTablaAIF\");\n var numero_final_item = 148 + parseInt(cantidadItemsTAIF);\n for (var i = 148; i < numero_final_item; i++) {\n if ($('input:radio[name=sele_foso'+i+']:checked').val() == \"No Cumple\") {\n contador_items_nocumple += 1;\n }\n updateItemsAscensorValoresFoso(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_foso'+i).val(),\n $('#cal_item_foso'+i).val(),\n $('input:radio[name=sele_foso'+i+']:checked').val(),\n $('#text_foso_observacion_'+i).val());\n }\n /* Actualizar valores en la tabla ascensor_valores_finales */\n updateItemsAscensorValoresObservacionFinal(cod_usuario,codigo_inspeccion,textObserFinal);\n\n /* Se actualizan la tabla de auditoria */\n updateItemsAuditoriaInspeccionesAscensores(cod_usuario,codigo_inspeccion,consecutivo_inspeccion,contador_items_nocumple,'Pendiente','No');\n}", "title": "" }, { "docid": "9979e9dbc615e0a8d7b712c1ad6b8093", "score": "0.54736066", "text": "function datosServidor () {\n\n var exp = $(\"#explotacion\").val();\n var pwd = $(\"#password\").val();\n var direccion = $('#idurl').val() + 'conf.php';\n \n // comprobar que no estan vacios.\n if (exp == \"\" || pwd ==\"\" ){\n app.dialog.alert (\"rellene los campos explotacion y password\");\n return;\n }\n\n $.ajax ({\n data: {\n \"explotacion\" : exp,\n \"password\" : pwd\n },\n url: direccion,\n type: 'get',\n beforeSend: function () { $(\"#peticion\").html('Procesando ...'); app.dialog.preloader();},\n success: function (response) {\n setTimeout(function () {\n app.dialog.close();\n }, 300);\n var obj = JSON.parse(response)\n if (obj.msg != 'ok'){\n $(\"#peticion\").html('-- Fallo en los credenciales -- ');\n app.dialog.alert(\"Fallo en los credenciales\");\n return;\n }\n\n // $(\"#peticion\").html(response);\n\n //llenar el select dinamicamente.\n var cnt = obj.instalacion.length;\n var cad = \"\";\n for (var i = 0; i < cnt; i++) {\n cad = \"<option value = '\" + obj.instalacion[i][0] + \"'>\"+ obj.instalacion[i][1] + \"</option>\";\n //$(\"#peticion\").append(cad);\n $(\"#instalacion\").append(cad);\n\n }\n //vamos a intentar llenar el select dinamicamente.\n var cnt = obj.operario.length;\n var cad = \"\";\n for (var i = 0; i < cnt; i++) {\n cad = \"<option value = '\" + obj.operario[i][0] + \"'>\"+ obj.operario[i][1] + \"</option>\";\n //$(\"#peticion\").append(cad);\n $(\"#operario2\").append(cad);\n\n }\n $(\"#peticion\").html(\"\");\n\n }\n })\n }", "title": "" }, { "docid": "09ee03bc0ba830807ae71aa74315ded8", "score": "0.5461039", "text": "function guardarDocumentoInterno(form) { \r\n\tvar organismo = document.getElementById(\"organismo\").value;\r\n\tvar dep_interna = document.getElementById(\"dep_interna\").value;\r\n\tvar n_documento = document.getElementById(\"n_documento\").value;\r\n\tvar t_documento = document.getElementById(\"t_documento\").value;\r\n\tvar asunto = document.getElementById(\"asunto\").value;\r\n\tvar descrip = document.getElementById(\"descrip\").value;\r\n\tvar destinatario_int = document.getElementById(\"destinatario_int\").value;\r\n\tvar codigo_interno = document.getElementById(\"codigo_interno\").value;\r\n\tvar codigo_persona = document.getElementById(\"codigo_persona\").value;\r\n\tvar codigo_cargo = document.getElementById(\"codigo_cargo\").value;\r\n\tvar plazo = document.getElementById(\"plazo\").value;\r\n\tvar anexsi1 = document.getElementById(\"anexsi1\").value; //alert(anexsi1);\r\n\tvar anexsi2 = document.getElementById(\"anexsi2\").value; //alert(anexsi2);\r\n\tvar anexDescp = document.getElementById(\"anexDescp\").value; //alert(anexDescp);\r\n\tvar cc = document.getElementById(\"cc\").value;\r\n\t\r\n\tvar detalles = \"\";\r\n\tvar error_detalles = \"\";\t\r\n\t// obtengo los valores de las lineas insertadas\r\n\tvar frmdetalles = document.getElementById(\"frmdetalles\");\r\n\tfor(i=0; n=frmdetalles.elements[i]; i++) {\r\n\t\tif (n.name == \"codpersona\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"cod_dependencia\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"cargo\") detalles += n.value + \"|\";\r\n\t\tif (n.name == \"cc\") detalles += n.value + \";\";\r\n\t}\r\n\tvar len = detalles.length; len--;\r\n\tdetalles = detalles.substr(0, len);\r\n\t\r\n\tif (error_detalles != \"\") alert(error_detalles);\r\n\telse {\r\n\t\t//\tCREO UN OBJETO AJAX PARA VERIFICAR QUE EL NUEVO REGISTRO NO EXISTA EN LA BASE DE DATOS\r\n\t\tvar ajax=nuevoAjax();\r\n\t\tajax.open(\"POST\", \"gmcorrespondencia.php\", true);\r\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\tajax.send(\"accion=guardarDocumentoInterno&detalles=\"+detalles+\"&organismo=\"+organismo+\"&dep_interna=\"+dep_interna+\"&t_documento=\"+t_documento+\"&n_documento=\"+n_documento+\"&asunto=\"+asunto+\"&descrip=\"+descrip+\"&destinatario_int=\"+destinatario_int+\"&codigo_interno=\"+codigo_interno+\"&codigo_persona=\"+codigo_persona+\"&codigo_cargo=\"+codigo_cargo+\"&plazo=\"+plazo+\"&anexsi1=\"+anexsi1+\"&anexsi2=\"+anexsi2+\"&anexDescp=\"+anexDescp);\r\n\t\tajax.onreadystatechange=function() {\r\n\t\t\tif (ajax.readyState==4)\t{\r\n\t\t\t\tvar resp = ajax.responseText;\r\n\t\t\t\tif (resp != \"\") alert(resp.trim());\r\n\t\t\t\tform.submit();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "c65aa1e84abe50687f4bdada0d015696", "score": "0.54558223", "text": "function rowInsert(_,clienteJSON) {\n\t\tvar cliArr = $.extend(true, [], ClientesCollection.getPage(HBtableData.pageSize,HBtableData.currentPage));\n\t\tvar is_same = (cliArr.length == HBtableData.clientsArray.length) && cliArr.every(function(element, index) {\n\t\t\treturn element.id == HBtableData.clientsArray[index].id &&\n\t\t\telement.nombres == HBtableData.clientsArray[index].nombres &&\n\t\t\telement.ciudad == HBtableData.clientsArray[index].ciudad &&\n\t\t\telement.sexo == HBtableData.clientsArray[index].sexo &&\n\t\t\telement.telefono == HBtableData.clientsArray[index].telefono; \n\t\t});\n\t\tif (!is_same) {\n\t\t\tappendTable(HBTableCreator(HBtableData.pageSize,HBtableData.currentPage));\n\t\t}\n\t\tshowTable();\n\t\tshowAlert(alert.added);\n\t}", "title": "" }, { "docid": "6b66103f4d7a2c7282d8a030d7f14b03", "score": "0.5454477", "text": "insertJedi(jedi, res) {\n const sql = 'insert into Jedi set ?';\n conexao.query(sql, jedi, (erro, resultados) => {\n if (erro) {\n res.status(400).json(erro);\n }\n else {\n res.status(201).json(resultados);\n }\n });\n }", "title": "" }, { "docid": "90f8e5a4ab0aa13be99e5ce1ecb3657d", "score": "0.5442986", "text": "function addUserInfo() {\n var sql = 'INSERT into User (Email, Password, Type) VALUE(?, ?, ?);';\n var value = [email, pwd, 'Driver'];\n conn.query(sql, value, function (err, result) {\n if (err) { console.log(\"Inserting to User Failed\"); }\n else { addDriver(result.insertId); }\n })\n }", "title": "" }, { "docid": "00ab2559e043d749d5b0bf48849cb0b8", "score": "0.5442771", "text": "function addItemsPuertasValoresFinales(k_codusuario,k_codinspeccion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_valores_finales (k_codusuario,k_codinspeccion,o_observacion) VALUES (?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de observación...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "8775bcbce63603428fdbee3996644748", "score": "0.5441084", "text": "function subirRegistroCliente(respuesta,data) {\r\n console.log(\"Manipulador de petición 'subir Registro Cliente' ha sido llamado.\");\r\n var nombre = querystring.parse(data)[\"nombre\"];\r\n // Respuesta Web\r\n // respuesta.writeHead(200, {\"Content-Type\": \"text/html\"});\r\n var sqlite3 = require('sqlite3').verbose();\r\n var db = new sqlite3.Database(file);\r\n var insertar = \"INSERT INTO Clientes VALUES (?,?)\";\r\n try {\r\n db.run(insertar,[null,nombre],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error en Registro\");\r\n var msjError = \"SQLITE_CONSTRAINT: UNIQUE constraint failed: Clientes.user\";\r\n if (error.message == msjError) {\r\n respuesta.write(\"Error: El Cliente ingresado ya existe\" + \"\\n\"); \r\n }\r\n else {\r\n respuesta.write(\"Error en Registro\"+ \"\\n\");\r\n }\r\n respuesta.end();\r\n db.close();\r\n }\r\n else{\r\n console.log(\"Registro Exitoso\");\r\n respuesta.write(\"Registro Exitoso\" + \"\\n\");\r\n console.log(\"Insertado nuevo cliente \" + nombre);\r\n db.each(\"SELECT nombre FROM Clientes\", \r\n function(err, row) {\r\n if (err){\r\n console.log(err);\r\n throw err;\r\n }\r\n console.log(\"Nombre Cliente: \" + row.nombre);\r\n respuesta.end();\r\n db.close();\r\n });\r\n }\r\n });\r\n } catch (err) {\r\n // manejamos error\r\n console.log(err); \r\n db.close();\r\n }\r\n}", "title": "" }, { "docid": "c7e876bb688d74712c904901f1b2271d", "score": "0.54267985", "text": "function preciosMaestro(){\n divi=\"capa_tabla\";\n parametros='dat1='+document.getElementById('linea').value+'&dat2='+document.getElementById('cliente').value+'&opc=4';\n\tvar inser = document.getElementById(divi);\n\tinser.innerHTML='<tr><td align=\"center\" colspan=\"3\"><h1>Cargando</h1><br><img src=\"../images/ajax-loader.gif\"></td></tr>';\n general1(parametros,'../lib/class/ClaseGeneral.php');\n}", "title": "" }, { "docid": "548392efb4cc76fe366c68f427e8e429", "score": "0.5421787", "text": "function db_conectE(url, datos, f, e){\n\tnew Request.JSON({\n\t\tmethod:'post',\n\t\turl:url,\n\t\tsecure:false,\n\t\tonError:function(er){\n\t\t\tif(typeOf(e) === 'function'){ e(er); }\n\t\t\tconsole.warn(er);\n\t\t\talert(\"Ocurrio un problema al guardar su informacion, intentelo mas tarde\");\n\t\t\t\n\t\t},\n\t\tonFailure:function(xhr){\n\t\t\tif(typeOf(e) === 'function'){ f(xhr); }\n\t\t\tconsole.warn(xhr);\n\t\t\talert(\"Ocurrio un problema al guardar su informacion, intentelo mas tarde\");\n\t\t\t\n\t\t},\n\t\tonSuccess:function(j){\n\t\t\tif(j){\n\t\t\t\tif(j.status == 'ok'){\n\t\t\t\t\tif(typeOf(f) === 'function'){ f(j); }\n\t\t\t\t} else{\n\t\t\t\t\tif(typeOf(e) === 'function'){ e(j); }\n\t\t\t\t\tconsole.warn(j);\n\t\t\t\t\talert(\"Ocurrio un problema al guardar su informacion, intentelo mas tarde\");\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\tif(typeOf(e) === 'function'){ e(j); }\n\t\t\t\tconsole.warn(j);\n\t\t\t\talert(\"Ocurrio un problema con su consulta, intentelo mas tarde\");\n\t\t\t}\n\t\t}\n\t}).post('datos='+ JSON.encode(datos));\n}", "title": "" }, { "docid": "20fbc1bd9c37d9498abf52be8cf1a2fa", "score": "0.5417357", "text": "function clicksendinsert()\n{ \n\t_values = \"\";\n\t_cols = \"\";\n\t\n\t//sacamos los set del formulario, solo input y textarea\n\t$(\"#insertreg form input,#insertreg form textarea\").each(function(){\n\t\t//console.log($(this).attr(\"name\")+\" > \"+$(this).val());//buscamos los input del form\n\t\tif(_values != \"\")\n\t\t_values += \",\";\n\t\t\n\t\t_values += \"'\"+$(this).val()+\"'\";\n\t\t\n\t\tif(_cols != \"\")\n\t\t_cols += \",\";\n\t\t\n\t\t_cols += \"`\"+$(this).attr(\"name\")+\"`\";\n\t});\n\t \n\t_sql = \"INSERT INTO `\"+ $(\"#insertable\").data(\"tablename\") +\"` (\"+ _cols +\") VALUES(\"+ _values+\")\";\n\t//alert(_sql); \n\t$(\"#insertreg\").modal(\"hide\");\n\tquery(_sql);\n}", "title": "" }, { "docid": "b36cad92ae2a164e976ada0dc86074d1", "score": "0.54102343", "text": "function addItemsPuertasValoresOtras(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_valores_otras (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected addItemsPuertasValoresOtras: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Finalizando...Espere\");\n setTimeout('cerrar_Ventana_Carga()',20000);\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "7fce7b79fb11214334241bf337957c6a", "score": "0.54097146", "text": "function guardaCliente(nombre, apellidoP, apellidoM, edad, sexo, tel, calle, nuInt, nuExt, col, cp, clave, llave, alergia, servicio, presupuesto){\n\tvar ruta = \"php/ingresar_cliente.php?\";\n\tvar datos = ruta+\"nombre=\"+nombre+\"&apellidoP=\"+apellidoP+\"&apellidoM=\"+apellidoM+\"&edad=\"+edad+\"&sexo=\"+sexo+\"&tel=\"+tel+\"&calle=\"+calle+\"&numInt=\"+nuInt+\"&numExt=\"+nuExt+\"&col=\"+col+\"&cp=\"+cp+\"&clave=\"+clave+\"&contra=\"+llave+\"&alergia=\"+alergia+\"&servicio=\"+servicio+\"&presupuesto=\"+presupuesto;\n\tguardarDatos(datos);\n}", "title": "" }, { "docid": "e3fd3b7b99b437d9735eee0a0f586a5e", "score": "0.53780526", "text": "function pesquisaInstituicao(filtro){\n\t\n\tvar tabela = '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"ui-grid-content ui-widget-content\" id=\"paginacao_instituicao\">';\n\t\ttabela += '<thead>';\n\t\ttabela += '<tr align=\"left\">';\n\t\ttabela += '<th class=\"ui-state-default\" align=\"center\">INSTITUI&Ccedil;&Atilde;O</th>';\n\t\ttabela += '</tr>';\n\t\ttabela += '</thead>';\n\t\ttabela += '<tbody>';\n\t\t\n\t\t\n\t\tvar linha = '<tr><td>A instituição deverá entrar em contato no e-mail <u>[email protected]</u> solicitando cadastro no MS</td></tr>';\n\t\n\t$.ajax({\n\t\t url: sistemaUrl+'inscricao/pesquisainstituicao',\n\t\t type: \"POST\",\n\t\t data: {\n\t\t instiuicao : filtro\n\t\t },\n\t\t dataType: \"json\",\n\t\t success: function(data){\n\t\t\t if(data && data.length > 0){\n\t\t\t\t linha = '';\n\t\t\t\t for(var i = 0; i<data.length; i++){\n\t\t\t\t\t linha += ' <tr> <td onclick=\"add_instiuicao($(this))\" style=\"cursor:pointer\" title=\"Selecionar Instiuição\"> '+data[i].NO_RAZAO_SOCIAL_ENTIDADE;\n\t\t\t\t\t\tlinha += ' <input type=\"hidden\" name=\"id_entidade\" id=\"id_entidade\" value=\"'+data[i].CO_SEQ_ENTIDADE+'\" /> ';\n\t\t\t\t\t\tlinha += ' <input type=\"hidden\" name=\"entidade\" id=\"entidade\" value=\"'+data[i].NO_RAZAO_SOCIAL_ENTIDADE+'\" /> ';\n\t\t\t\t\t\tlinha += ' </td> </tr> ';\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t var rodape = '</tbody></table>';\n\t\t\t //alert(linha);\n\t\t\t //return;\n\t\t\t //alert(linha);\n\t\t\t $('#div_paginacao_instituicao').html(tabela+linha+rodape);\n\t\t\t $('#paginacao_instituicao').dataTable( {\n\t\t\t \"bJQueryUI\": true,\n\t\t\t \"bLengthChange\": true,\n\t\t\t \"bAutoWidth\": false,\n\t\t\t \"sPaginationType\": \"full_numbers\",\n\t\t\t \"aoColumns\": [\n\t\t\t {\"bSearchable\": true, \"bVisible\": true}\n\t\t\t ],\n\t\t\t \"aaSorting\": [\n\t\t\t [0, 'asc']\n\t\t\t ]\n\t\t\t });\n\t\t\t \n\t\t\t $('#div_paginacao_instituicao').show()\n\t\t }\n\t\t \n\t\t});\n\t\n\t\n}", "title": "" }, { "docid": "a3b9c86b41fa9d247c0a41c56124db94", "score": "0.53757656", "text": "function insereProd(){\n\tif(!Verifica_Alteracao(DIV_TABELA) || !Verifica_Alteracao(DIV_TABELA_PROD)){\n\t\tswal({\n\t\t\t\ttitle:'Erro ao inserir novo produto',\n\t\t\t\ttext: 'Grave alterações feitas na aplicação/produto antes',\n\t\t\t\ttype: 'error'\n\t\t\t},\n\t\t\tfunction(){\n\t\t\t\tselecionaLinha(DIV_TABELA,$('#position-apl').val(),1);\n\t\t\t}\n\t\t);\n\t\treturn;\n\t}\n\n\tvar pt_code = $(\"#codProd\").val();\n\tif (pt_code === \"\") return;\n\n\tvar ap_number = objTabelaApl.registros[$('#position-apl').val()].ap_number;\n\tvar message = \"\";\n\tif (ap_number === \"\"){\n\t\tmessage +='Aplicação não selecionada\\n';\n\t}\n\n\tvar pa_codeorig = $(\"#codOEM\").val();\n\tif (pa_codeorig === \"\"){\n\t\tmessage +='O codigo OEM não pode ser nulo!\\n';\n\t}\n\tif (message === \"\" ){\n\n\t\tvar funcao = \"ap_number=\" + ap_number +\n\t\t\t\t\t\"&pt_code=\"+pt_code+\n\t\t\t\t\t\"&pa_codeorig=\"+pa_codeorig +\n\t\t\t\t\t\"&funcao=insereProd\";\n\n\t\tswal.loading('Gravando dados...');\n\n\t\tajax(funcao,EXEC,function(retorno){\n\t\t\tretorno = json(retorno);\n\t\t\tif(!retorno){\n\t\t\t\tvar erro = \"Houve um erro interno de servidor.\\nEntre em contato com o suporte da pennacorp!\";\n\t\t\t\t//EVITA QUE SCROLL SE PERCA SEMPRE QUE A TABELA É LIMPA\n\t\t\t\tLimpaTabela(DIV_TABELA_PROD);\n\t\t\t\t$(DIV_TABELA_PROD).html(erro);\n\t\t\t\tswal('Erro ao inserir novo produto',erro,'error');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!empty(retorno.error)){\n\t\t\t\tswal({\n\t\t\t\t\t\ttitle:'Erro ao inserir novo produto',\n\t\t\t\t\t\ttext: retorno.mensagem,\n\t\t\t\t\t\ttype: 'error'\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tselecionaLinha(DIV_TABELA,$('#position-apl').val(),1);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//SE O CÓDIGO DO PRODUTO FOR INVAIDO EXIBE A MENSAGEM\n\t\t\tif(retorno.tipo === 'X'){\n\t\t\t\tswal({\n\t\t\t\t\t\ttitle:'Erro ao inserir novo produto',\n\t\t\t\t\t\ttext: \"Códgido do produto é invalido\",\n\t\t\t\t\t\ttype: 'error'\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tselecionaLinha(DIV_TABELA,$('#position-apl').val(),1);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//VOU ATUALIZAR O MEU OBJETO JSON\n\t\t\tinsere_prod();\n\t\t\tobjTabelaProd.registros[$(\"#position-prod\").val()].pt_code = pt_code;\n\t\t\tobjTabelaProd.registros[$(\"#position-prod\").val()].pa_codeorig = pa_codeorig;\n\t\t\tobjTabelaProd.registros[$(\"#position-prod\").val()].pt_descr = retorno.tipo.substring(1);\n\n\n\t\t\tvar status = getStatus($(\"#position-prod\").val(),DIV_TABELA_PROD);\n\n\t\t\tif(status === '+'){\n\t\t\t\tsetStatus($(\"#position-prod\").val(),'a',DIV_TABELA_PROD);\n\t\t\t}\n\n\t\t\t$('#record-prod').val(objTabelaProd.total);\n\t\t\tcancela_prod(1);\n\t\t\tswal.close();\n\t\t});\n\t}else{\n\t\tswal({\n\t\t\t\ttitle:'Erro ao inserir novo produto',\n\t\t\t\ttext: message,\n\t\t\t\ttype: 'error'\n\t\t\t},\n\t\t\tfunction(){\n\t\t\t\t\tselecionaLinha(DIV_TABELA,$('#position-apl').val(),2);\n\t\t\t}\n\t\t);\n\t}\n\n}", "title": "" }, { "docid": "d63181d61df8d71529087f5c632e4691", "score": "0.53535926", "text": "function mail_insere() {\n\t//SE EU ALTEREI ALGUM REGISTRO\n\tif(!Verifica_Alteracao(DIV_TABELA_EMAIL)){\n\t\tselecionaLinha(DIV_TABELA_EMAIL,$('#position_mail').val(),1);\n\t\treturn;\n\t}\n\n\tif(empty(objTabelaMail)){\n\t\tobjTabelaMail = {};\n\t\tobjTabelaMail.registros = [];\n\t\tobjTabelaMail.total = 0;\n\t}\n\n\tvar novaPosicao = {};\n\tnovaPosicao.el_seq = objTabelaMail.total > 0 ? (Number(objTabelaMail.registros[objTabelaMail.total - 1].el_seq) + 1) : 1;\n\tnovaPosicao.el_depto = \"\";\n\tnovaPosicao.el_contato = \"\";\n\tnovaPosicao.el_email = \"\";\n\tnovaPosicao.el_fone = \"\";\n\n\tobjTabelaMail.registros.push(novaPosicao);\n\tobjTabelaMail.total += 1;\n\n\tvar actpos = objTabelaMail.total > 0 ? (objTabelaMail.total - 1) : 0;\n\n\tmail_pagination(1, function(){\n\t\tmail_pintaLinha($(DIV_TABELA_EMAIL + \" tr[posicao=\"+actpos+\"]\"));\n\t\tsetStatus(actpos, '+', DIV_TABELA_EMAIL);\n\t\tBloqueia_Linhas(actpos, DIV_TABELA_EMAIL);\n\t\t$(\"#record_mail\").val(objTabelaMail.total);\n\t\tselecionaLinha(DIV_TABELA_EMAIL, actpos, 2);\n\t});\n}", "title": "" }, { "docid": "bef339613b6bb0e281c9e4e3390933e5", "score": "0.5353507", "text": "function Register(user,appat, apmat, rut, mail, fechanac, contrasenia, callback) {\n\n var db = require(\"../BD_connection\");\n var username = user + '.' + appat + '.' + rut.split('.')[1];\n\n while (repeat = true) {\n db.query('select * from Usuario where nombre_usuario =' + username,\n function (err, rows, fields) {\n if (err) {\n console.log(\"ERROR EN LA BASE DE DATOS\");\n } else {\n if (rows.length() == 0) {\n repeat = false;\n db.query('insert into Usuario (' +\n 'nombre_usuario,' +\n ' password_usuario,' +\n ' tipo_usuario) values ('\n + username + ',' + password + ',0)',\n function (err, rows, fields) {\n if (err) {\n console.log(\"ERROR EN LA BASE DE DATOS\");\n } else {\n console.log(\"Registro exitoso\");\n }\n });\n db.query('insert into Alumno (' +\n 'nombre_alumno,' +\n 'apellido_p_alumno, ' +\n 'apellido_m_alumno,' +\n 'rut_alumno,' +\n 'nac_alumno' +\n 'categoria' +\n 'nombre_usuario) values ('\n + user + ',' + appat + ',' + apmat + ',' + rut + ',' + fechanac + ', 0' + username + ')',\n function (err, rows, fields) {\n if (err) {\n console.log(\"ERROR EN LA BASE DE DATOS\");\n } else {\n console.log(\"Ok\");\n return callback(1);\n }\n return callback(0);\n });\n\n } else {\n rutint = rut.split('.')[1];\n username = user + '.' + appat + '.' + toString((parseInt(rutint) + 1));\n }\n\n }\n });\n }\n}", "title": "" }, { "docid": "f7218e4a4842dd0b59cab17e801d220a", "score": "0.5344159", "text": "function registrar(){\n var campos = [\n {campo:'nombre',valido:false},\n {campo:'apellido',valido:false},\n {campo:'email',valido:false},\n {campo:'usuario',valido:false},\n {campo:'password',valido:false}\n ];\n \n for (var i=0;i<campos.length;i++){\n campos[i].valido = validarCampoVacio(campos[i].campo);\n }\n\n for(var i=0;i<campos.length;i++){\n if (!campos[i].valido)\n return;\n }\n \n //Todo esta bien, todo saldra bien,... OK?\n document.getElementById('div-mensaje-exito').style.display = 'block';\n\n var transaccion = db.transaction([\"usuarios\"],\"readwrite\");///readwrite: Escritura/lectura, readonly: Solo lectura\n var objectStoreUsuarios = transaccion.objectStore(\"usuarios\");\n var solicitud = objectStoreUsuarios.add({\n nombre:document.getElementById('nombre').value,\n apellido:document.getElementById('apellido').value,\n email:document.getElementById('email').value,\n usuario:document.getElementById('usuario').value,\n password:document.getElementById('password').value\n });\n solicitud.onsuccess = function(evento){\n console.log(\"Se agrego el registro con éxito, Actualizar tabla\");\n actualizarTabla();\n }\n \n \n \n}", "title": "" }, { "docid": "8ef820eba8d22b9c58f7cf1a5e0e1e0f", "score": "0.53437215", "text": "function inserirAlimentosRefeicao(i){\n var id_refeicao = ClassRefeicao.id_refeicao;\n var id_alimento = ClassRefeicao.id_alimento[i];\n var nome_alimento = ClassRefeicao.nome_alimento[i];\n var quantidade_alimento = ClassRefeicao.quantidade_alimento[i];\n var calculo_calorias = ClassRefeicao.calculo_calorias[i];\n var calculo_proteinas = ClassRefeicao.calculo_proteinas[i];\n var calculo_carboidratos = ClassRefeicao.calculo_carboidratos[i];\n var calculo_lipideos = ClassRefeicao.calculo_lipideos[i];\n \n var insertStatement = \"INSERT INTO Alimentos_Refeicao (id_refeicao, id_alimento, nome_alimento, quantidade_g, calorias_parcial, proteinas_parcial, carboidratos_parcial, lipideos_parcial) VALUES (?, ?, ?, ?, ?, ?, ?, ?)\";\n db.transaction(function (tx) { tx.executeSql(insertStatement, [id_refeicao, id_alimento, nome_alimento, quantidade_alimento, calculo_calorias, calculo_proteinas, calculo_carboidratos, calculo_lipideos]); });\n}", "title": "" }, { "docid": "30b9635b8f155c17b9fd9184795257a1", "score": "0.53431416", "text": "function addUserInfo() {\n sql = 'INSERT into User (Email, Password, Type) VALUE(?, ?, ?);';\n value = [email, pwd, 'Restaurant'];\n conn.query(sql, value, function (err, result) {\n if (err) { console.log('Inserting to User Failed'); }\n else { addLocation(result.insertId); }\n })\n }", "title": "" }, { "docid": "d0b177f348f58916a1a66efd00de2481", "score": "0.53385854", "text": "function reporte(respuesta,data) {\r\n console.log(\"Manipulador de petición 'reporte' ha sido llamado.\");\r\n var body = \"<head>\"+\r\n '<meta charset=\"UTF-8\">'+\r\n \"<title>CREAR REPORTE</title>\"+\r\n \"</head>\"+\r\n \"<body>\"+\r\n \"<html>\"+\r\n \"<head>\"+\r\n '<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />'+\r\n \"</head>\"+\r\n \"<body>\"+\r\n '<form action=\"/subirReporte\" method=\"post\">'+\r\n '<input type=\"TEXT\" name=\"asesor\" placeholder=\"Asesor\" size=\"40\">'+\r\n \"<br>\"+\r\n '<input type=\"TEXT\" name=\"cliente\" placeholder=\"Cliente\" size=\"40\">'+\r\n \"<br>\"+ \r\n '<input type=\"TEXT\" name=\"dia\" placeholder=\"Dia\" size=\"2\">'+\r\n \"<br>\"+\r\n '<input type=\"TEXT\" name=\"mes\" placeholder=\"Mes\" size=\"2\">'+\r\n \"<br>\"+\r\n '<input type=\"TEXT\" name=\"anio\" placeholder=\"Año\" size=\"4\">'+\r\n \"<br>\"+\r\n '<input type=\"password\" placeholder=\"Clave\" name=\"password\" size=\"40\">'+\r\n \"<br>\"+\r\n '<input type=\"TEXT\" name=\"hora_inicio\" placeholder=\"Hora Inicio\" maxlength=\"5\">'+\r\n \"<br>\"+\r\n '<input type=\"TEXT\" name=\"hora_fin\" placeholder=\"Hora Fin\" maxlength=\"5\">'+\r\n \"<br>\"+\r\n '<input type=\"TEXT\" name=\"hora_fact\" placeholder=\"Hora Fact\" maxlength=\"5\">'+\r\n \"<br>\"+\r\n '<textarea name=descripcion rows=\"4\" cols=\"40\" placeholder=\"Descripcion\"></textarea>'+\r\n \"<br>\"+\r\n '<input type=\"submit\" value=\"ENVIAR\"/>'+\r\n \"</form>\"+\r\n \"</body>\"+\r\n \"</html>\"+\r\n \"</body>\"+\r\n '</html>';\r\n respuesta.writeHead(200, {\"Content-Type\": \"text/html\"});\r\n respuesta.write(body);\r\n respuesta.end(); \r\n}", "title": "" }, { "docid": "c5d4d94acee18b3409d7c0b4c582566d", "score": "0.53360784", "text": "function addItemsPuertasValoresManiobras(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_valores_maniobras (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected addItemsPuertasValoresManiobras: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Finalizando...Espere\");\n setTimeout('cerrar_Ventana_Carga()',20000);\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "01231a962730d74e9521902b9d89b356", "score": "0.53310615", "text": "insertSith(sith, res) {\n const sql = 'insert into Sith set ?';\n conexao.query(sql, sith, (erro, resultados) => {\n if (erro) {\n res.status(400).json(erro);\n }\n else {\n res.status(201).json(resultados);\n }\n });\n }", "title": "" }, { "docid": "038f117d98753fec67a9e7ce67742f30", "score": "0.5329672", "text": "insert (table, fields, values) {\n let fieldStr = \"\"\n let valueStr = \"\"\n for (let i = 0; i < fields.length ; i++) {\n fieldStr += \"`\" + fields[i] + \"`,\"\n valueStr += \"?,\"\n }\n fieldStr = fieldStr.substring(0, fieldStr.length-1)\n valueStr = valueStr.substring(0, valueStr.length-1)\n return this.query (\"INSERT INTO `\" + this.configuration.databaseName + \"`.`\" + table + \"` (\" + fieldStr + \") values(\" + valueStr + \")\", values)\n }", "title": "" }, { "docid": "187d2059484a4e5bd50debe08367cb8e", "score": "0.5314759", "text": "'usuarios.insert'(usuario) {\n //Ejecutar la accion en la base de datos sobre la colleccion.\n console.log(usuario);\n Usuarios.insert(usuario);\n }", "title": "" }, { "docid": "8d9e4a2832d8267894b2f429304b304f", "score": "0.5308632", "text": "function enviar(page)\n{\n\tdeshabilitarBotonIniciarSesion(page);\n\n var codigo = page.querySelector(\"#codigoEstudiante\").value;\n var nip = page.querySelector(\"#nip\").value;\n\n // comprobar que los campos no esten vacíos\n if(codigo === \"\" || nip === \"\")\n {\n \tons.notification.alert(\"Error: debes llenar todos los campos\");\n \thabilitarBotonIniciarSesion(page);\n }\n else\n {\n\t // enviamos las variables al servidor y recojemos la respuesta\n\t var xhttp = new XMLHttpRequest();\n\t xhttp.onreadystatechange = function()\n\t {\n\t if(this.readyState == 4)\n\t {\n\t \tif(this.status == 200)\n\t \t{\n\t\t \tvar tipoUsuario; // tipo udg o normal\n\n\t\t if(parseInt(this.responseText) == 0){\n\t\t \ttipoUsuario = \"no udg\";\n\t\t }\n\t\t else\n\t\t {\n\t\t \tvar datos = this.responseText.split(\",\");\n\t\t \tcodigoAlumno = datos[1];\n\t\t \tnombreAlumno = datos[2];\n\t\t \ttipoUsuario = \"udg\";\n\t\t }\n\n\t\t \tvar xhttp2 = new XMLHttpRequest();\n\t\t\t\t xhttp.onreadystatechange = function()\n\t\t\t\t {\n\t\t\t\t if(this.readyState == 4)\n\t\t\t\t {\n\t\t\t\t \tif(this.status == 200)\n\t\t\t\t \t{\n\t\t console.log(\"Respuesta: \" + this.responseText);\n\t\t\t\t\t \t// el script devuelve el tipo de usuario, codigo y nombre\n\t\t\t\t\t \tvar respuesta = this.responseText.split(\",\");\n\t\t\t\t\t \tvar res = respuesta[0];\n\t\t\t\t\t \tvar nombreRes = respuesta[1];\n\t\t\t\t\t \tvar placas = respuesta[2];\n\n\t\t\t\t\t \t//ons.notification.alert(\"placas: \" + placas);\n\n\t\t\t\t\t \t// usuario udg registrado\n\t\t\t\t\t \tif(res === \"usuario udg registrado\"){\n\t\t\t\t\t \t\thabilitarBotonIniciarSesion(page);\n\t\t guardarEnLocalStorage(codigo, nombreRes, placas)\n\t\t\t\t\t \t\tiniciarPaginaMapaEstacionamiento();\n\t\t\t\t\t \t}\n\t\t\t\t\t \t// usuario udg no registrado\n\t\t\t\t\t \telse if(res === \"usuario udg no registrado\"){\n\t\t\t\t\t \t\thabilitarBotonIniciarSesion(page);\n\t\t\t\t\t \t\tiniciarDialogUsuarioUdg();\n\t\t\t\t\t \t}\n\t\t\t\t\t \t// usuario normal registrado\n\t\t\t\t\t \telse if(res === \"usuario registrado\"){\n\t\t\t\t\t \t\thabilitarBotonIniciarSesion(page);\n\t\t\t\t\t \t\tguardarEnLocalStorage(codigo, nombreRes, placas)\n\t\t\t\t\t \t\tiniciarPaginaMapaEstacionamiento();\n\t\t\t\t\t \t}\n\t\t\t\t\t \t// usuario no registrado\n\t\t\t\t\t \telse if(res === \"usuario no registrado\"){\n\t\t\t\t\t \t\thabilitarBotonIniciarSesion(page);\n\t\t\t\t\t \t\tnuevoUsuario();\n\t\t\t\t\t \t}\n\t\t\t\t\t \telse // ocurrió un error\n\t\t\t\t\t \t{\n\t\t\t\t\t \t\tons.notification.alert(\"Ocurrió un error\");\n\t\t\t\t\t \t\thabilitarBotonIniciarSesion(page);\n\t\t\t\t\t \t}\n\t\t\t\t\t }\n\t\t\t\t\t else\n\t\t\t\t\t {\n\t\t\t\t\t \tons.notification.alert(\"Ocurrió un error. Vuelve a intentarlo\");\n\t\t\t\t\t \thabilitarBotonIniciarSesion(page);\n\t\t\t\t\t }\n\n\t\t\t\t }\n\t\t\t\t };\n\n\t\t\t\t xhttp.open(\"GET\", \"https://adrianpl.000webhostapp.com/avance3.php?codigo=\" + codigo + \"&contrasenia=\" + nip + \"&tipoUsuario=\" + tipoUsuario, true);\n\t\t \t\txhttp.send();\n\t\t \t}\n\t\t \telse\n\t \t{\n\t \t\tons.notification.alert(\"Ocurrió un error. Vuelve a intentarlo\");\n\t \t\thabilitarBotonIniciarSesion(page);\n\t \t}\n\t \t\n\t }\n\t };\n\n\t xhttp.open(\"GET\", \"https://dcc.000webhostapp.com/2018/datosudeg.php?codigo=\"+codigo+\"&nip=\"+nip, true);\n\t xhttp.send();\n\t}\n}", "title": "" }, { "docid": "456605c213095fb4688d5a8b38977bbc", "score": "0.5306018", "text": "function buscarEmail()\n{\n alert('buscando el email');\n var emailABuscar = document.getElementById(\"correo\").value;\n var contraseñaABuscar = document.getElementById(\"contraseña\").value;\n\n //----------- CONECTAR A LA BD ---------------- \n var active = database.result;\n var transaccion = active.transaction([\"cliente\"], \"readonly\");\n var almacen = transaccion.objectStore(\"cliente\");\n var puntero = almacen.openCursor();\n var elementos = [];\n\n puntero.onsuccess = function (e) {\n var result = e.target.result;\n if (result === null) {\n return;\n }\n elementos.push(result.value);\n result.continue();\n };\n\n transaccion.oncomplete = function ()\n {\n var encontrado = false;\n var i = 0;\n while (i < elementos.length && !encontrado)\n {\n if (elementos[i].email === emailABuscar && elementos[i].contraseña === contraseñaABuscar)\n {\n alert(\"Contraseña verificada\");\n encontrado = true;\n\n var clave = elementos[i].email;\n var contraseña = elementos[i].contraseña;\n\n var datos = new Array();//Creamos un nuevo array vacío\n datos[0] = elementos[i].nombre;\n datos[1] = clave;\n datos[2] = contraseña;\n\n //en sessionStorage cuando cierras la pestaña no se guarda la info\n window.sessionStorage[ window.sessionStorage.length ] = JSON.stringify(datos);\n //en localStorage cuando cierras la pestaña si se guarda la info\n window.localStorage[ window.localStorage.length ] = JSON.stringify(datos);\n\n usuario = elementos[i].nombre;\n\n holaU = document.getElementById(\"correo\").innerHTML = 'Hola, ' + usuario;\n\n //CAMBIA DE PAGINA SEGUN SEA CLIENTE O DIETISTA\n if (clave === \"[email protected]\") {\n alert('diet');\n location.href = \"Dietista.html\";\n } else {\n alert('hola, '+usuario);\n location.href = \"Cliente.html\";\n }\n\n } else if (elementos[i].email === emailABuscar && elementos[i].contraseña !== contraseñaABuscar)\n {\n alert(\"Contraseña incorrecta!!!!\");\n encontrado = true;\n } else\n {\n i++;\n }\n }\n if (!encontrado)\n alert(\"El email no esta en la BD\");\n };\n}", "title": "" }, { "docid": "eab691799ba91bfcbf56183b383c3902", "score": "0.5305739", "text": "async function insertIncidentLog(req, technicianName){\r\n let ATMID = req.body.result.parameters.atmId.atmId;\r\n let ISSUE = req.body.result.parameters.issues;\r\n let CUSTOMERNAME = req.body.result.parameters.customerName.customerName;\r\n let CONTACT = req.body.result.parameters.contact.contact;\r\n let TECHNICIAN = technicianName;\r\n try{\r\n let pool = await getConnectionPool();\r\n let con = await pool.getConnection();\r\n let sql = \"INSERT INTO incidentlog (incid, atmid, issue, status,username, usercontact, inctime, restime,technician) VALUES\"+\r\n \" (DEFAULT, \"+ATMID+\", '\"+ISSUE+\"','In-progress','\"+CUSTOMERNAME+\"','\"+CONTACT+\"',NOW(), NOW(), '\"+TECHNICIAN+\"');\";\r\n let result = await con.query(sql);\r\n await con.query(\"commit;\");\r\n con.release();\r\n console.log(`SUCCESSFULL insertIncidentLog`);\r\n }\r\n catch (err){\r\n console.log(`ERROR in insertIncidentLog ...`)\r\n }\r\n \r\n //return TECHNICIAN;\r\n}", "title": "" }, { "docid": "4cab5df9e13edc51dc9358420d4f4c99", "score": "0.53053576", "text": "function ajouter(){\n //récupération des valeurs dans les champs de formulaire\n let name = document.querySelector(\"#name\").value;\n let firstName = document.querySelector(\"#firstName\").value;\n let login = document.querySelector(\"#login\").value;\n let mdp = document.querySelector(\"#mdp\").value;\n //test si les 4 champs (name, firstName, login et mdp sont complétés)\n if(name != \"\" && firstName != \"\" && login != \"\" && mdp != \"\"){\n //insertion des données des champs de formulaire à la suite du tableau (à la fin du tableau)\n tab.push([name, firstName, login, mdp]);\n //affichage des comptes utilisateurs ajoutés (incrémentation de la liste resultat (chaîne string resutat)) \n resultat.innerHTML += \"<p>Nom : \" + tab[cpt][0] + \" Prénom : \" + tab[cpt][1] + \" Login : \" + tab[cpt][2] + \" Mot de passe : \" + tab[cpt][3]+\"</p>\";\n //incrémentation du compteur index du tableau\n cpt++;\n //test affichage du nombre de comptes utilisateurs créés\n //si le compteur est égal à 1\n if(cpt == 1){\n nbrCompte.innerHTML = \"Il y à : \"+ (cpt)+ \" compte utilisateur\";\n }\n //si le compteur est supérieur à 1\n else{\n nbrCompte.innerHTML = \"Il y à : \"+ (cpt)+ \" comptes utilisateurs\";\n }\n //suppression du message d'erreur\n error.innerHTML = \"\";\n }\n //si les 4 champs ne sont pas remplis affichage d'un message d'erreur\n else{\n error.innerHTML = \"Veuillez compléter tous les champs de formulaires !!!\";\n } \n}", "title": "" }, { "docid": "be95cd14a821fdfc39fc5a98888d76ba", "score": "0.5304122", "text": "function registrarnuevocliente(servicio_id){\r\n var nombremodal = \"myModal\";\r\n var base_url = document.getElementById('base_url').value;\r\n var cliente_nombre = document.getElementById('cliente_nombre').value;\r\n var cliente_codigo = document.getElementById('cliente_codigo').value;\r\n var cliente_ci = document.getElementById('cliente_ci').value;\r\n var cliente_nit = document.getElementById('cliente_nit').value;\r\n var cliente_telefono = document.getElementById('cliente_telefono').value;\r\n var cliente_celular = document.getElementById('cliente_celular').value;\r\n //var codigo_seg = getgenerarsegservicio(servicio_id, cliente_nombre);\r\n var controlador = base_url+'cliente/add_new/';\r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{servicio_id:servicio_id, cliente_nombre:cliente_nombre, cliente_codigo:cliente_codigo,\r\n cliente_telefono:cliente_telefono, cliente_celular:cliente_celular,\r\n cliente_ci:cliente_ci, cliente_nit:cliente_nit},\r\n success:function(respuesta){\r\n \r\n var registros = JSON.parse(respuesta);\r\n if (registros != null){\r\n if(registros == \"faltadatos\"){\r\n $('#mensajenew_cliente').html(\"<br>Debe llenar los campos: Nombre, Código y Teléfono\");\r\n }else if(registros[0] == \"sonduplicados\"){\r\n $('#mensajenew_cliente').html(\"<br>El Cliente \"+registros[1]+\" ya se encuentra registrado, por favor revise sus datos\");\r\n }else{\r\n var mires = \"\";\r\n var mirestel = \"\";\r\n var mirescod = \"\";\r\n var cliente_id = registros[\"cliente_id\"];\r\n var cliente_nombre = registros[\"cliente_nombre\"];\r\n var cliente_telefono = registros[\"cliente_telefono\"];\r\n var cliente_celular = registros[\"cliente_celular\"];\r\n var cliente_codigo = registros[\"cliente_codigo\"];\r\n \r\n if(cliente_id == null || cliente_id == 0){\r\n mires += \"NO DEFINIDO\";\r\n }else{\r\n $('#concliente').val(cliente_id);\r\n mires += cliente_nombre;\r\n mirestel += cliente_telefono;\r\n }\r\n /*if(tiposerv_id == 2){\r\n mires += \"<br><b>Dirección: </b>\"+servicio_direccion;\r\n }*/\r\n if(cliente_codigo == null){\r\n mirescod += \"NO DEFINIDO\";\r\n }else{\r\n mirescod += cliente_codigo;\r\n }\r\n $('#cliente-nombre').html(mires);\r\n $('#cliente-telefono').html(mirestel+\" - \"+cliente_celular);\r\n $('#cliente-codigo').html(mirescod);\r\n $('#'+nombremodal).modal('hide');\r\n resetearcamposdeinputcliente();\r\n }\r\n }\r\n }\r\n \r\n });\r\n}", "title": "" }, { "docid": "3e02273011366d95b10bf4c16c1c95c3", "score": "0.5299547", "text": "function insertarProducto() {\n\tvar queryInsert = [ {\n\t\t\"SQL\" : \"INSERT_PRODUCTO\",\n\t\t\"N\" : 4,\n\t\t\"DATOS\" : [ {\n\t\t\t\"P1\" : $(\"#nombre\").val(),\n\t\t\t\"P2\" : $(\"#ControlSelectCat\").val(),\n\t\t\t\"P3\" : $(\"#precio\").val(),\n\t\t\t\"P4\" : $(\"#cantidad\").val(),\n\t\t} ]\n\t} ];\n\n\tguardarDatos(queryInsert, function(str_rs) {\n\t\ttry {\n\t\t\tif (str_rs == 'Ok') {\n\t\t\t\t$(\"#ModalForm\").dialog('close');\n\t\t\t\tbuscarGrid();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tmsgError(parent.consultaMensaje(\"ErrorConsultaParse\"), e.message);\n\t\t\tconsole.log(queryInsert);\n\t\t}\n\n\t}, function(xhr) {\n\t\tmsgAdvertencia(parent.consultaMensaje(\"ErrorGuardarNoticia\"));\n\t}, false);\n}", "title": "" }, { "docid": "842a24bb9d37f77b05fa72bd433d86d1", "score": "0.52991813", "text": "function insert_in_baseAvenant_partenaire(avenant_partenaire,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemAvenant_partenaire==false)\n {\n getId = vm.selectedItemAvenant_partenaire.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId,\n description: avenant_partenaire.description,\n montant: avenant_partenaire.montant,\n ref_avenant: avenant_partenaire.ref_avenant,\n date_signature:convertionDate(avenant_partenaire.date_signature),\n id_contrat_partenaire_relai: vm.selectedItemContrat_partenaire_relai.id,\n validation:0 \n });\n console.log(datas);\n //factory\n apiFactory.add(\"avenant_partenaire_relai/index\",datas, config).success(function (data)\n { \n /*var conve= vm.allcontrat_partenaire_relai.filter(function(obj)\n {\n return obj.id == avenant_partenaire.id_contrat_partenaire_relai;\n });*/\n\n if (NouvelItemAvenant_partenaire == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n { \n //vm.selectedItemAvenant_partenaire.contrat_partenaire_relai = conve[0];\n \n vm.selectedItemAvenant_partenaire.$selected = false;\n vm.selectedItemAvenant_partenaire.$edit = false;\n vm.selectedItemAvenant_partenaire ={};\n }\n else \n { \n vm.allavenant_partenaire = vm.allavenant_partenaire.filter(function(obj)\n {\n return obj.id !== vm.selectedItemAvenant_partenaire.id;\n });\n vm.showbuttonNouvavenant_partenaire = true;\n \n }\n }\n else\n {\n //avenant_partenaire.partenaire = conve[0];\n avenant_partenaire.validation =0\n avenant_partenaire.id = String(data.response); \n NouvelItemAvenant_partenaire=false;\n vm.showbuttonNouvavenant_partenaire = false;\n }\n vm.showbuttonValidation_avenant_partenaire = false;\n vm.validation_avenant_partenaire = 0\n avenant_partenaire.$selected = false;\n avenant_partenaire.$edit = false;\n vm.selectedItemAvenant_partenaire = {};\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n }", "title": "" }, { "docid": "8f482321c0e3727fcef5daf14e2ac448", "score": "0.52956337", "text": "function addservsolics_servsolic(){\n if(tipOpSerSoli===1){\n $( \"#tbody_servsolic\" ).empty();\n tipOpSerSoli=0;\n }\n\n conta_filas_servsolic=$('table #tbody_servsolic tr').length;\n\n ++conta_filas_servsolic;\n\n let rowCloneservsolic=$(dollyRowservsolicHTML).clone().prop({id:'row-servsolic-' + conta_filas_servsolic});\n rowCloneservsolic.find('p').html(conta_filas_servsolic);\n $('table #tbody_servsolic').append(rowCloneservsolic);\n\n $('table #tbody_servsolic').find('button').each(function () {\n $(this).on('click', function () {\n let rRowPro = 1;\n $(this).closest('tr').remove();\n var obj = $('table #tbody_servsolic tr');\n\n $(obj).each(function () {\n $(this).attr(\"id\",\"row-servsolic-\"+rRowPro);\n $(this).find('p[id=p_servsolic_num]').html(rRowPro);\n ++rRowPro;\n });\n });\n });\n}", "title": "" }, { "docid": "c269fdcbfa581a9a7b3c094c98f92d73", "score": "0.5290598", "text": "function reportesCliente(respuesta,data) {\r\n console.log(\"Manipulador de petición 'reportes Cliente' ha sido llamado.\");\r\n var body = \"<head>\"+\r\n '<meta charset=\"UTF-8\">'+\r\n \"<title>REPORTES</title>\"+\r\n \"</head>\"+\r\n \"<body>\"+\r\n \"<html>\"+\r\n \"<head>\"+\r\n '<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />'+\r\n \"</head>\"+\r\n '<img src=\"/logo.png\" alt=\"Logo\" style=\"width:218px;height:125px;\">'+\r\n \"<body>\"+\r\n '<form action=\"/subirReportesCliente\" method=\"post\">'+\r\n '<input type=\"TEXT\" name=\"cliente\" placeholder=\"Nombre Cliente\" size=\"40\">'+\r\n '<input type=\"submit\" value=\"ENVIAR\" />'+\r\n \"</body>\"+\r\n \"</html>\"+\r\n \"</body>\"+\r\n '</html>';\r\n respuesta.writeHead(200, {\"Content-Type\": \"text/html\"});\r\n respuesta.write(body);\r\n respuesta.end(); \r\n}", "title": "" }, { "docid": "6db44209e9a49d0ff06f7609c62ef24d", "score": "0.528496", "text": "function insere_pf(){\r\n\tif(!Verifica_Alteracao(DIV_TABELA_PRODFORNEC)){\r\n\t\tselecionaLinha(DIV_TABELA_PRODFORNEC,$('#position_pf').val(),2);\r\n\t\treturn;\r\n\t}\r\n\tvar actpos = $(\"#position_fo\").val();\r\n\tif(actpos === 'null'){\r\n\r\n\t\tswal('Erro ao inserir','É necessário selecionar uma linha','error');\r\n\t\treturn;\r\n\t}\r\n\r\n\tif($(\"#fo_desc\").val() === ''){\r\n\r\n\t\tswal('Erro ao inserir','Campo Desconto deve ser Preenchido','error');\r\n\t\treturn;\r\n\t}\r\n\r\n\tif(empty(objTabelaProdFornec)){\r\n\t\tobjTabelaProdFornec = {};\r\n\t\tobjTabelaProdFornec.registros = [];\r\n\t\tobjTabelaProdFornec.total = 0;\r\n\t}\r\n\r\n\r\n\tvar novaPosicao = {};\r\n\r\n\tnovaPosicao.pt_code = '';\r\n\tnovaPosicao.fo_number = objTabela.registros[actpos].fo_number;\r\n\tnovaPosicao.fp_code = '';\r\n\tnovaPosicao.fp_dtcotacao = $(\"#DATA_US\").val();\r\n\tnovaPosicao.fp_valcotacao = \"0,00\";\r\n\tnovaPosicao.fp_dtcompra = \"\";\r\n\tnovaPosicao.fp_valcompra = \"0,00\";\r\n\tnovaPosicao.fp_condicao = '';\r\n\tnovaPosicao.fp_valcotdolar = \"0,00\";\r\n\tnovaPosicao.pt_descr = '';\r\n\tnovaPosicao.fo_desc = \"0,00\";\r\n\r\n\tobjTabelaProdFornec.registros.push(novaPosicao);\r\n\tobjTabelaProdFornec.total += 1;\r\n\r\n\tactpos = objTabelaProdFornec.total > 0 ? (objTabelaProdFornec.total - 1) : 0;\r\n\r\n\tpagination_pf((Math.ceil(objTabelaProdFornec.total / LIMITE_REGISTROS)),function(){\r\n\t\tpintaLinha_pf($(DIV_TABELA_PRODFORNEC + \" tr[posicao=\"+actpos+\"]\"));\r\n\r\n\t\tsetStatus(actpos,'+',DIV_TABELA_PRODFORNEC);\r\n\r\n\t\tselecionaLinha(DIV_TABELA_PRODFORNEC,actpos,1);\r\n\t\tBloqueia_Linhas(actpos,DIV_TABELA_PRODFORNEC);\r\n\r\n\t\t$('#record_pf').val(objTabelaProdFornec.total);\r\n\r\n\t\t$(DIV_TABELA_PRODFORNEC + \" tr[posicao=\"+actpos+\"] td:not(.inativo) input:not([name=pt_code])\").prop('readonly',true);\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "c679be877fe24199ea94baa4be33261d", "score": "0.52844524", "text": "function insertAll(lista) {\n\n\t\t\tvar url = dominio + 'aula/insertAll/';\n\t\t\t\n\t\t\treturn $http.post(url, angular.toJson( lista ), config).then(function(res) {\n\t\t\t\t\n\t\t\t\tif(res.data.success){\n\t\t\n\t\t\t\t}else{\n\t\t\t\t\tconsole.error('Erro ao inserir os objetos. lista:');\n\t\t\t\t\tconsole.info( res.data.message );\n\t\t\t\t};\n\n\t\t\t\treturn res.data;\n\t\t\t});\n\n\n }", "title": "" }, { "docid": "74bd5608b20665dd557a49da5da22f45", "score": "0.52783036", "text": "function insert_in_baseDetail(convention_cife_detail,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemDetail ==false)\n {\n getId = vm.selectedItemDetail.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId, \n //montant_total: convention_cife_detail.montant_total,\n //avancement: convention_cife_detail.avancement,\n intitule: convention_cife_detail.intitule,\n prev_beneficiaire: convention_cife_detail.prev_beneficiaire,\n prev_nbr_ecole: convention_cife_detail.prev_nbr_ecole, \n id_convention_entete: vm.selectedItemTete.id ,\n delai: convention_cife_detail.delai,\n date_signature: convertionDate(new Date(convention_cife_detail.date_signature)),\n //id_compte_feffi: convention_cife_detail.id_compte_feffi,\n observation: convention_cife_detail.observation, \n });\n console.log(datas);\n //factory\n apiFactory.add(\"convention_cisco_feffi_detail/index\",datas, config).success(function (data)\n {\n var comp_fef = vm.allcompte_feffi.filter(function(obj)\n {\n return obj.id == convention_cife_detail.id_compte_feffi;\n });\n\n if (NouvelItemDetail == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n /* vm.selectedItemDetail.intitule = convention_cife_detail.intitule;\n vm.selectedItemDetail.delai = convention_cife_detail.delai;\n vm.selectedItemDetail.date_signature = convention_cife_detail.date_signature;*/\n vm.selectedItemDetail.compte_feffi = comp_fef[0];\n // vm.selectedItemDetail.observation = convention_cife_detail.observation;\n\n vm.selectedItemDetail.$selected = false;\n vm.selectedItemDetail.$edit = false;\n vm.selectedItemDetail ={};\n vm.showbuttonNouvDetail = false;\n }\n else \n { \n vm.allconvention_cife_detail = vm.allconvention_cife_detail.filter(function(obj)\n {\n return obj.id !== vm.selectedItemDetail.id;\n });\n vm.showbuttonNouvDetail = true;\n }\n }\n else\n {\n \n /* convention_cife_detail.intitule= convention_cife_detail.intitule;\n convention_cife_detail.delai = convention_cife_detail.delai;\n convention_cife_detail.date_signature = convention_cife_detail.date_signature;*/\n convention_cife_detail.compte_feffi = comp_fef[0];\n //convention_cife_detail.observation = convention_cife_detail.observation;\n convention_cife_detail.id = String(data.response); \n NouvelItemDetail = false;\n\n vm.showbuttonNouvDetail = false;\n }\n convention_cife_detail.$selected = false;\n convention_cife_detail.$edit = false;\n vm.selectedItemDetail = {};\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n\n }", "title": "" }, { "docid": "933755f871ac6f2b047de64a92274c08", "score": "0.52773744", "text": "function Enregistrement_commande(traitement){\r\r\n\t\r\r\n\t\tvar destination_traitement=base64_decode(traitement); \r\r\n\t var token=$(\"#token\").val();\r\r\n\t\tvar data_to_send=\"token=\"+token; \r\r\n\r\r\n\t\tAfficher_loader('loader2'); \r\r\n\t\t$.ajax({\r\r\n\t\t\turl : destination_traitement,\r\r\n\t\t type : 'POST', // Le type de la requête HTTP, ici devenu POST\r\r\n\t\t data : data_to_send, \r\r\n\t\t success : function(data, statut){ // success est toujours en place, bien sûr !\r\r\n\t\t\t //alert(data);\r\r\n\t\t\t var reponse = eval('(' + data + ')'); \r\r\n\t\t\t if(reponse.erreur==\"oui\"){\r\r\n\t\t\t\t var message=\"Votre jeton de session semble invalide.\";\r\r\n\t\t\t\t AfficherNotification(\"INFORMATION\",\"loader2\",message,\"OK\",\"javascript:location.reload()\",\"\",\"\",\"0\");\r\r\n\t\t\t }else{\r\r\n\t\t\t\t self.location=reponse.next;\r\r\n\t\t\t }\r\r\n\t\t\t},\r\r\n\r\r\n\t\t\terror : function(resultat, statut, erreur){\r\r\n\t\t\t\talert(erreur);\r\r\n\t\t\t}\r\r\n\t\t});\r\r\n\t\t\r\r\n\t\r\r\n}", "title": "" }, { "docid": "aa627f0c06c97bf719fa1cbc71905c05", "score": "0.52695644", "text": "async function createCliente(res, cliente){\n try{\n var clienteData = cliente;\n var cliente = new Cliente();\n cliente.email = clienteData.email;\n cliente.cep = clienteData.cep;\n cliente.logradouro = clienteData.logradouro;\n cliente.numero = clienteData.numero;\n cliente.bairro = clienteData.bairro;\n cliente.complemento = clienteData.complemento;\n cliente.id_estado = clienteData.id_estado;\n cliente.id_municipio = clienteData.id_municipio;\n var clienteSave = await cliente.save();\n if(clienteData.tipo_cadastro == \"pf\"){\n var pessoaFisica = new PessoaFisica();\n pessoaFisica.id_cliente = clienteSave.id;\n pessoaFisica.nome = clienteData.nome;\n pessoaFisica.cpf = clienteData.cpf;\n pessoaFisica.rg = clienteData.rg;\n pessoaFisica.data_nascimento = clienteData.data_nascimento;\n pessoaFisica.sexo = clienteData.sexo;\n await pessoaFisica.save();\n }\n else if(clienteData.tipo_cadastro == \"pj\"){\n var pessoaJuridica = new PessoaJuridica();\n pessoaJuridica.id_cliente = clienteSave.id;\n pessoaJuridica.nome_fantasia = clienteData.nome_fantasia;\n pessoaJuridica.razao_social = clienteData.razao_social;\n pessoaJuridica.cnpj = clienteData.cnpj;\n pessoaJuridica.inscricao_estadual = clienteData.inscricao_estadual;\n await pessoaJuridica.save();\n }\n\n for (let i = 0; i < clienteData.telefones.length; i++) {\n var telefone = new Telefone();\n const telefoneData = clienteData.telefones[i];\n telefone.id_cliente = clienteSave.id;\n telefone.id_tipo = telefoneData.id_tipo;\n telefone.ddd = telefoneData.ddd;\n telefone.numero_tel = telefoneData.numero_tel;\n await telefone.save();\n }\n res.status(201)\n res.json({'msg':\"Cliente criado com sucesso\"});\n }\n catch (error) {\n res.status(404);\n res.json({'msg':\"Falha na requisição\", 'error': error});\n }\n}", "title": "" }, { "docid": "8d28244c9e409297b0d9fb79a5d603d9", "score": "0.5267656", "text": "create(req, res) {\n return __awaiter(this, void 0, void 0, function* () {\n var that = this;\n //Obtenemos la password\n const { email, name, lastname } = req.body;\n var user = {\n name: name,\n lastname: lastname,\n email: email\n };\n //convertimos nuestro objeto en una query\n var queryuser = database_1.connection.escape(user);\n var result;\n //Y hacemos nuestra query tipo pool\n database_1.default.query('INSERT INTO t_clients SET ' + queryuser, function (error, results, fields) {\n //En caso de tener un error, mandamos el error\n if (error) {\n res.json('No client was added ' + error);\n throw error;\n }\n //Ya que en un insert no nos interesa el dato, solamente preguntamos por las filas afectadas\n //En caso de ser mas de una, devolvemos que nuestra consulta fue verdadera\n if (results.affectedRows > 0) {\n result = { result: true };\n }\n else {\n //caso contrario, regresamos falso \n result = { result: false };\n }\n return res.json(result);\n })\n //En caso de haber otro tipo de error\n .catch(function (err) {\n res.json({\n result: false,\n data: {\n code: err.code,\n error: err.errno,\n state: err.sqlState\n }\n });\n });\n });\n }", "title": "" }, { "docid": "28786eeef4ac394c8d2334beabf968f0", "score": "0.5267468", "text": "function traerInformacionCliente() {\n $.ajax({\n url: \"https://g39b406ee3fdd9f-bbddhoteleria.adb.sa-santiago-1.oraclecloudapps.com/ords/admin/client/client\",\n type: \"GET\",\n datatype: \"JSON\",\n success: function (respuesta) {\n\n if (respuesta.items == 0) {\n alert(\" No hay Registros que mostrar \\n Por favor ingrese uno --Gracias.\");\n } else {\n $(\"#resultado\").empty();\n console.log(respuesta);\n //Envio el parametro por la funcion\n pintarRespuestaCliente(respuesta.items);\n }\n },\n complete: function (xhr, status) {\n console.log('Petición realizada(Consultar Cliente), ' + xhr.status);\n },\n error: function (xhr, status) {\n alert('Ups Ocurrio un problema con el Registro, ' + xhr.status);\n }\n })\n}", "title": "" }, { "docid": "5ce54a9e818fc5c2d3883937ce12f985", "score": "0.5265974", "text": "function insert_initial_Latrine_construction(latrine_construction,suppression,id_convention_entete)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n }; \n \n var datas = $.param({\n supprimer: suppression,\n id: 0,\n id_type_latrine: latrine_construction.type_latrine.id,\n cout_unitaire: latrine_construction.type_latrine.cout_latrine,\n id_convention_entete: id_convention_entete\n\n });\n console.log(latrine_construction);\n console.log(datas);\n //factory\n apiFactory.add(\"latrine_construction/index\",datas, config).success(function (data)\n {\n \n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée initial latrine');});\n\n\n }", "title": "" }, { "docid": "71ca8aed2a9e1422429462e31f52779e", "score": "0.5265622", "text": "function loaddatabasebandau_xuatexcel() {\n try {\n var userInfo = JSON.parse(localStorage.getItem(\"userinfo\"));\n var config = { namesql: \"TB_Export_LstLoadBanDau\", callback: \"f_result_loaddulieu_xuatexcel\", connstr: \"ConnectEMS\" };\n var para = { Type: 'Basic', UserId: userInfo.userid };\n ExecuteServiceSyns(config, para, false);\n } catch (e) {\n console.log(e);\n }\n}", "title": "" }, { "docid": "39b6d2862cd8dda6be971fada3840606", "score": "0.5261731", "text": "function llenarTablaPuertasValoresCliente(){\n var cod_inspector = window.localStorage.getItem(\"codigo_inspector\");\n var parametros = {\"inspector\" : cod_inspector};\n $.ajax({\n async: true,\n url: \"http://www.montajesyprocesos.com/inspeccion/servidor/php/json_app_puertas_valores_cliente.php\",\n data: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n success: function(response){\n $.each(response, function(i,item){\n var k_codcliente = item.k_codcliente;\n var v_consecutivocliente = item.v_consecutivocliente;\n var k_codusuario = item.k_codusuario;\n var n_cliente = item.n_cliente;\n var n_contacto = item.n_contacto;\n var v_nit = item.v_nit;\n var o_direccion = item.o_direccion;\n var o_telefono = item.o_telefono;\n var o_correo = item.o_correo;\n\n db.transaction(function (tx) {\n var query = \"SELECT * FROM cliente WHERE k_codusuario = ? AND k_codcliente = ?\";\n tx.executeSql(query, [k_codusuario,k_codcliente], function (tx, resultSet) {\n if (resultSet.rows.length == 0) {\n addItemsPuertasValoresCliente(k_codcliente,v_consecutivocliente,k_codusuario,n_cliente,n_contacto,v_nit,o_direccion,o_telefono,o_correo);\n }else{\n updateItemsPuertasValoresCliente(k_codcliente,v_consecutivocliente,k_codusuario,n_cliente,n_contacto,v_nit,o_direccion,o_telefono,o_correo);\n }\n },\n function (tx, error) {\n console.log('SELECT error: ' + error.message);\n });\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction ok');\n });\n\n });\n }\n });\n}", "title": "" }, { "docid": "37c5de0ec68fe3412444e8f5392599fd", "score": "0.52604216", "text": "function validacaoLogin(){\n try{\n var usuario = \"usuario=\"+$(\"#inputUsuario\").val();\n //cria um json para a requisicao post\n var data = usuario+\"&senha=\"+$(\"#inputSenha\").val();\n\n $.post(\"http://\"+window.ipServidor+\"/Projeto_BioID-war/servico/pessoa/validacao\", data, function(dados){\n //teste da requisicao no banco esta correta\n if(dados.sucesso){\n //guarda dados do usuario no local storge\n var logSession = JSON.stringify({\n idpessoa: dados.idpessoa,\n idSession: dados.idSession,\n logTempo: dados.logTempo,\n papel: dados.papel,\n idunidade: dados.idunidade\n });\n window.localStorage.setItem(\"logSession\", logSession);\n\n\n window.papel = dados.papel;\n //limpa o campo senha\n $(\"#inputSenha\").val(\"\");\n //verifica o tipo de funcionario\n if(window.papel === \"a\"){\n //rest popular propriedades\n //chama o metodo que busca dados no servidor e armazena no localStorage\n //para outro metodo acessar e criar a lista de cultivares recebidos\n window.iniciarAgricultor();\n window.servArmazenarCulRecebdo(dados.idpessoa);\n activate_page(\"#page_3\");\n }else{\n window.listarEstoque(dados.idunidade);\n //c(dados.idunidade);\n window.iniciarGerEntrev();\n activate_page(\"#page_4\");\n $('.uib_w_154').hide();\n $('.uib_w_154').fadeIn();\n\n }\n\n\n\n\n //informa se o usuario ou senha esta incorreta\n }else if($(\"#inputUsuario\").val()=== \"\"){\n navigator.notification.confirm(\n 'O campo usuário não pode ser vazio!', // message\n function(){\n $(\"#inputUsuario\").focus();\n }, // callback to invoke with index of button pressed\n 'Erro', // title\n ['Sair'] // buttonLabels\n );\n\n\n }else if($(\"#inputSenha\").val()=== \"\"){\n navigator.notification.confirm(\n 'O campo senha não pode ser vazio!', // message\n function(){\n $(\"#inputSenha\").focus();\n }, // callback to invoke with index of button pressed\n 'Erro', // title\n ['Sair'] // buttonLabels\n );\n }else{\n navigator.notification.confirm(\n 'Usuário ou Senha incorretos!', // message\n function(){\n $(\"#inputUsuario\").focus();\n }, // callback to invoke with index of button pressed\n 'Erro', // title\n ['Sair'] // buttonLabels\n );\n }\n\n },\"json\")\n //Tratamento de erro da requisicao servico RESt login\n .fail(function(){\n navigator.notification.confirm(\n 'Sem conexão com o servidor!',\n function() {\n //limpa o campo senha\n $(\"#inputSenha\").val('');\n //limpa a tela e vai para a pagina inicial\n window.clearGoMainPage();\n },\n 'Erro',\n ['OK']\n );\n\n\n });\n\n\n }catch(e){\n window.alert(\"Erro validacaoLogin: \"+ e.message);\n window.clearGoMainPage();\n }\n\n }", "title": "" }, { "docid": "40173f6f78e2cfc4b00a91ba876bc8ab", "score": "0.52582085", "text": "function addItemsPuertasValoresMecanicos(k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_valores_mecanicos (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion) VALUES (?,?,?,?,?,?)\";\n tx.executeSql(query, [k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n $('#texto_carga').text(\"Añadiendo datos de mecanicos...Espere\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n });\n}", "title": "" }, { "docid": "307464085294a298c8d291adc8d95d8e", "score": "0.5248816", "text": "function guardarPeticion(request, contador, path){\n var f = new Date();\n var fecha = f.getDate() + \"-\" + (f.getMonth() + 1) + \"-\" + f.getFullYear()+\"-\"+f.getHours()+f.getMinutes()+f.getSeconds()+f.getMilliseconds();\n var nomb = \"./\"+path + \"/archivoSqli-\" + contador + \"-\" + fecha + \".txt\";\n //var nomb = \"./\"+path +\"/normal-\" + contador + \"-\" + fecha + \".txt\";\n\n var cabeceras = request.method + \" \" + request.url;\n //var body = \"\\n\";\n for(var h in request.headers){\n cabeceras += \" \" + h + \": \" + request.headers[h];\n }\n fs.writeFile(nomb, cabeceras, 'utf8',function(error) {\n console.log(\"Cabeceras: Se ha escrito correctamente\");\n generarDocNormal(cabeceras + \" \");\n //generarDocSQLi(cabeceras + \" \");\n });\n //console.log(norm.get_tokens(cabeceras));\n}", "title": "" }, { "docid": "3cfd6ba4b90559bc2b16ef366c42851b", "score": "0.52404594", "text": "function guardarInspeccion(){\n /* ============================\n * REDIRECCIONAMOS AL INICIO DE LA PAGINA DE INSPECCION Y ABRIMOS LA VENTANA DE CARGA\n * LA CUAL SE CIERRA EN LA FUNCION addItemConsecutivoEscaleras\n * ============================= */\n $('#texto_carga').text('Verificando items...Espere');\n location.href = \"#arriba\";\n /* Funcion creada en el script de mostrar consecutivo - se llama para ocultar de nuevo todos los div´s de los items */\n ocultarDivs();\n abrirVentanaCarga();\n var hora = mostrarhora();\n\n var codigo_inspeccion = getQueryVariable('cod_inspeccion');\n var cod_usuario = getQueryVariable('id_inspector');\n var consecutivo_inspeccion = $(\"#text_consecutivo\").val();\n\n var textCliente = $(\"#text_cliente\").val();\n var textDireccioncliente = $(\"#text_dir_cliente\").val();\n var textEquipo = $(\"#text_equipo\").val();\n var textEmpresaMantenimiento = $(\"#text_empresaMantenimiento\").val();\n var text_velocidad = $(\"#text_velocidad\").val();\n var text_tipoEquipo = $(\"#text_tipoEquipo\").val();\n var text_inclinacion = $(\"#text_inclinacion\").val();\n var text_ancho_paso = $(\"#text_ancho_paso\").val();\n var textFecha = $(\"#text_fecha\").val();\n var text_ultimo_mto = $(\"#text_ultimo_mto\").val();\n var text_inicio_servicio = $(\"#text_inicio_servicio\").val();\n var text_ultima_inspec = $(\"#text_ultima_inspec\").val();\n var text_codigo = $(\"#text_codigo\").val();\n \n\n /* ============================\n * Si los campos de fecha quedan vacios se les coloca una linea ya que estos no son obligatorios\n * ============================= */\n if (textFecha.length < 1) {\n textFecha = \"------\";\n }\n if (text_ultimo_mto.length < 1) {\n text_ultimo_mto = \"------\";\n }\n if (text_inicio_servicio.length < 1) {\n text_inicio_servicio = \"------\";\n }\n if (text_ultima_inspec.length < 1) {\n text_ultima_inspec = \"------\";\n }\n\n var textObserFinal = $(\"#text_observacion_final\").val();\n\n /* ============================\n * Actualizar valores en las tablas\n * ============================= */\n /* Actualizar valores en la tabla escaleras_valores_iniciales */\n updateItemsEscalerasValoresIniciales(textCliente,\n textDireccioncliente,\n textEquipo,\n textEmpresaMantenimiento,\n text_velocidad,\n text_tipoEquipo,\n text_inclinacion,\n text_ancho_paso,\n textFecha,\n text_ultimo_mto,\n text_inicio_servicio,\n text_ultima_inspec,\n text_codigo,\n consecutivo_inspeccion,\n hora,\n \"Inicial\",\n cod_usuario,\n codigo_inspeccion);\n /* Actualizar valores en la tabla escaleras_valores_preliminar */\n for (var i = 1; i <= 3; i++) {\n updateItemsEscalerasValoresPreliminar(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_preliminar'+i).val(),\n $('input:radio[name=seleval'+i+']:checked').val(),\n $('#text_obser_item'+i+'_eval_prel').val());\n }\n /* Actualizar valores en la tabla escaleras_valores_proteccion */\n for (var i = 1; i <= 7; i++) {\n updateItemsEscalerasValoresProteccion(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_proteccion'+i).val(),\n $('input:radio[name=sele_protec_person'+i+']:checked').val(),\n $('input:radio[name=sele_protec_person'+i+'_'+i+']:checked').val(),\n $('#text_obser_protec_person'+i).val());\n }\n /* Actualizar valores en la tabla escaleras_valores_elementos */\n for (var i = 1; i <= 6; i++) {\n updateItemsEscalerasValoresElementos(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_element_inspec'+i).val(),\n $('#descrip_item_element_inspec'+i).val(),\n $('input:radio[name=sele_element_inspec'+i+']:checked').val());\n }\n /* Actualizar valores en la tabla escaleras_valores_defectos */\n for (var i = 1; i <= 93; i++) {\n if ($('input:radio[name=sele_defectos'+i+']:checked').val() == \"No Cumple\") {\n contador_items_nocumple += 1;\n var calificacion = $('#cal_item_defectos'+i).val();\n if (calificacion == \"L\") {\n contador_items_leve += 1;\n }\n if (calificacion == \"G\") {\n contador_items_grave += 1;\n }\n if (calificacion == \"MG\") {\n contador_items_muygrave += 1;\n }\n }\n updateItemsEscalerasValoresDefectos(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_defectos'+i).val(),\n $('#cal_item_defectos'+i).val(),\n $('input:radio[name=sele_defectos'+i+']:checked').val(),\n $('#text_lv_valor_observacion_'+i).val());\n }\n /* Actualizar valores en la tabla escaleras_valores_finales */\n updateItemsEscalerasValoresObservacionFinal(cod_usuario,codigo_inspeccion,textObserFinal);\n\n /* Se actualizan las respectiva tabla de auditoria */\n updateItemsAuditoriaInspeccionesEscaleras(cod_usuario,codigo_inspeccion,consecutivo_inspeccion,contador_items_nocumple,contador_items_leve,contador_items_grave,contador_items_muygrave,'Si');\n}", "title": "" }, { "docid": "bc08acf1918061492fb9b5e1e3d89e6b", "score": "0.52379245", "text": "function testInsert() {\n var res = exports.createAccounts({\n \"username\": \"Chutro1\",\n \"password\": \"123456\",\n \"fullname\": \"Đồng Văn Hiệp\",\n \"birthday\": \"2021-01-20\",\n \"address\": \"số 1 Đại Cồ Việt\",\n \"phone\": \"0123456789\",\n \"email\": \"[email protected]\",\n \"job\": \"Sinh viên\",\n \"introduction\": \"Cần tìm phòng trọ\",\n \"acctype\": \"Người thuê trọ\",\n });\n res.then((res) => {\n console.log(\"Insert ok: \" + res.ok);\n });\n}", "title": "" }, { "docid": "6753de4da81e36a025e23b21980d37a0", "score": "0.5237623", "text": "inserirParada(){\n\t\tvar x = document.getElementById(\"formDadosParada\");\n\t\tvar img = x.elements[0].value\n\n\t\tvar percurso = this.state.percurso\n\t\tvar cod = this.state.codigo\n\t\tvar nome = x.elements[2].value\n\t\tvar desc = x.elements[3].value\n\t\tvar engm = x.elements[4].value\n\t\tvar resp = x.elements[5].value\n\n\t\tconsole.log(cod)\n\n\t\tClient.addParada(percurso, cod, nome, desc, engm, resp, img, res => {\n\t\t\tconsole.log(res.sucess)\n\t\t\tif(res.sucess === 'True'){\n\t\t\t\tconsole.log(\"Adicionou parada\")\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Erro ao tentar inserir parada\")\n\t\t\t}\n\t\t})\n\n\t\t/*\n\t\tVou deixar anotado aqui\n\t\tCaso precise manipular as variáveis para a interface\n\t\t*/\n\t}", "title": "" }, { "docid": "0afc3a0dd94f38fc0051c42bfbf18127", "score": "0.5229942", "text": "function traitementReponseInscription(rep) {\n\t\tif (rep.erreur != undefined) {\n//\t\t\tfunc_erreur(rep.message);\n\t\t\tchangeErrorMessage(rep.message);\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"je passe dans erreur\");\n\t\t\tchangeSuccessMessage(rep.message);\n\t\t\t/* redirection vers la page de connexion */\n\t\t\twindow.location.href = \"connexion.html\"; \n\t\t\treturn;\n\t\t}\n\t}", "title": "" }, { "docid": "b87a4bd9ca3f14084fcf51fd9ecf4365", "score": "0.5224333", "text": "function subirEliminarReporte(respuesta,data) {\r\n console.log(\"Manipulador de petición 'subirEliminarReporte' ha sido llamado.\");\r\n var asesor = querystring.parse(data)[\"asesor\"];\r\n var cliente = querystring.parse(data)[\"cliente\"];\r\n var dia = parseInt(querystring.parse(data)[\"dia\"],10);\r\n var mes = parseInt(querystring.parse(data)[\"mes\"],10);\r\n var anio = parseInt(querystring.parse(data)[\"anio\"],10);\r\n var clave = querystring.parse(data)[\"password\"];\r\n if (dia <= 0 || mes <= 0 || anio <= 0 || dia > 31 || mes > 12 || anio < 2016 ) { // Revisamos fecha negativa\r\n respuesta.write(\"Error: Fecha no es correcta\");\r\n respuesta.end(); \r\n }\r\n else {\r\n var sqlite3 = require('sqlite3').verbose();\r\n var db = new sqlite3.Database(file);\r\n db.serialize\r\n try {\r\n db.get(\"SELECT user,password FROM Asesores WHERE user =?\",\r\n [asesor], \r\n function(error, row) { // Vemos si usuario fuente existe\r\n if (error || row == undefined){ // Si no existe damos error\r\n console.log(error);\r\n console.log(\"Error en Login undefined\");\r\n respuesta.write(\"Error: Problema en datos del usuario\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else { \r\n if (row.user == asesor) {\r\n // Comprobamos con la clave encriptada\r\n bcrypt.compare(clave, row.password, function(err, res) {\r\n if (res == true) {\r\n console.log(\"Login Exitoso\");\r\n // Vemos si reporte existe\r\n db.get(\"SELECT asesor FROM Reportes WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\",\r\n [asesor,cliente,dia,mes,anio], \r\n function(error, row) { // Vemos si existe reporte\r\n if (error || row == undefined){ // Si no existe damos error\r\n console.log(error);\r\n console.log(\"Error reporte no existe\");\r\n respuesta.write(\"Error: Reporte no existe\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else {\r\n // Si es exitoso eliminamos reporte\r\n var eliminar = \"DELETE FROM Reportes WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\";\r\n db.run(eliminar,[asesor,cliente,dia,mes,anio],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error eliminando reporte\");\r\n respuesta.write(\"Error: eliminando el reporte\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else {\r\n console.log(\"Reporte Eliminado\");\r\n respuesta.write(\"Reporte Eliminado\\n\"); \r\n var eliminar2 = \"DELETE FROM Actividades WHERE asesor = ? \" +\r\n \"AND cliente = ? AND dia = ? AND mes = ? AND anio = ?\";\r\n db.run(eliminar2,[asesor,cliente,dia,mes,anio],\r\n function(error){\r\n if (error){\r\n console.log(error);\r\n console.log(\"Error registro actividad\");\r\n respuesta.write(\"Error: Problemas registro actividad\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n else {\r\n // Si es exitoso editamos reporte\r\n console.log(\"Reporte Exitoso\");\r\n respuesta.write(\"Reporte Exitoso\\n\");\r\n respuesta.end();\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n else{\r\n console.log(\"Error en Login\");\r\n respuesta.write(\"Error: Error en Login\"+ \"\\n\");\r\n respuesta.end();\r\n }\r\n });\r\n }\r\n else{\r\n console.log(\"Error en Login\");\r\n respuesta.write(\"Error: Error en Login\"+ \"\\n\");\r\n respuesta.end();\r\n } \r\n }\r\n });\r\n } catch (err) {\r\n // manejamos error\r\n console.log(err);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "dc78b0a84834e012cf413e056b5fb9f5", "score": "0.52237916", "text": "function guardarInspeccion(){\n /* ============================\n * REDIRECCIONAMOS AL INICIO DE LA PAGINA DE INSPECCION Y ABRIMOS LA VENTANA DE CARGA\n * LA CUAL SE CIERRA EN LA FUNCION addItemConsecutivoEscaleras\n * ============================= */\n $('#texto_carga').text('Verificando items...Espere');\n location.href = \"#arriba\";\n /* Funcion creada en el script de mostrar consecutivo - se llama para ocultar de nuevo todos los div´s de los items */\n ocultarDivs();\n abrirVentanaCarga();\n var hora = mostrarhora();\n\n var codigo_inspeccion = getQueryVariable('id_inspeccion');\n var cod_usuario = getQueryVariable('cod_usuario');\n var consecutivo_inspeccion = $(\"#text_consecutivo\").val();\n\n var textCliente = $(\"#text_cliente\").val();\n var textEquipo = $(\"#text_equipo\").val();\n var textEmpresaMantenimiento = $(\"#text_empresaMantenimiento\").val();\n var text_velocidad = $(\"#text_velocidad\").val();\n var text_tipoEquipo = $(\"#text_tipoEquipo\").val();\n var text_inclinacion = $(\"#text_inclinacion\").val();\n var text_ancho_paso = $(\"#text_ancho_paso\").val();\n var textFecha = $(\"#text_fecha\").val();\n var text_ultimo_mto = $(\"#text_ultimo_mto\").val();\n var text_inicio_servicio = $(\"#text_inicio_servicio\").val();\n var text_ultima_inspec = $(\"#text_ultima_inspec\").val();\n var text_codigo = $(\"#text_codigo\").val();\n \n\n /* ============================\n * Si los campos de fecha quedan vacios se les coloca una linea ya que estos no son obligatorios\n * ============================= */\n if (textFecha.length < 1) {\n textFecha = \"------\";\n }\n if (text_ultimo_mto.length < 1) {\n text_ultimo_mto = \"------\";\n }\n if (text_inicio_servicio.length < 1) {\n text_inicio_servicio = \"------\";\n }\n if (text_ultima_inspec.length < 1) {\n text_ultima_inspec = \"------\";\n }\n\n var textObserFinal = $(\"#text_observacion_final\").val();\n\n /* ============================\n * Actualizar valores en las tablas\n * ============================= */\n /* Actualizar valores en la tabla escaleras_valores_iniciales */\n updateItemsEscalerasValoresIniciales(textCliente,\n textEquipo,\n textEmpresaMantenimiento,\n text_velocidad,\n text_tipoEquipo,\n text_inclinacion,\n text_ancho_paso,\n textFecha,\n text_ultimo_mto,\n text_inicio_servicio,\n text_ultima_inspec,\n text_codigo,\n consecutivo_inspeccion,\n hora,\n cod_usuario,\n codigo_inspeccion);\n /* Actualizar valores en la tabla escaleras_valores_preliminar */\n for (var i = 1; i <= 3; i++) {\n updateItemsEscalerasValoresPreliminar(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_preliminar'+i).val(),\n $('input:radio[name=seleval'+i+']:checked').val(),\n $('#text_obser_item'+i+'_eval_prel').val());\n }\n /* Actualizar valores en la tabla escaleras_valores_proteccion */\n for (var i = 1; i <= 7; i++) {\n updateItemsEscalerasValoresProteccion(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_proteccion'+i).val(),\n $('input:radio[name=sele_protec_person'+i+']:checked').val(),\n $('input:radio[name=sele_protec_person'+i+'_'+i+']:checked').val(),\n $('#text_obser_protec_person'+i).val());\n }\n /* Actualizar valores en la tabla escaleras_valores_elementos */\n for (var i = 1; i <= 6; i++) {\n updateItemsEscalerasValoresElementos(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_element_inspec'+i).val(),\n $('#descrip_item_element_inspec'+i).val(),\n $('input:radio[name=sele_element_inspec'+i+']:checked').val());\n }\n /* Actualizar valores en la tabla escaleras_valores_defectos */\n for (var i = 1; i <= 93; i++) {\n if ($('input:radio[name=sele_defectos'+i+']:checked').val() == \"No Cumple\") {\n contador_items_nocumple += 1;\n }\n updateItemsEscalerasValoresDefectos(cod_usuario,\n codigo_inspeccion,\n $('#numero_item_defectos'+i).val(),\n $('#cal_item_defectos'+i).val(),\n $('input:radio[name=sele_defectos'+i+']:checked').val(),\n $('#text_lv_valor_observacion_'+i).val());\n }\n /* Actualizar valores en la tabla escaleras_valores_finales */\n updateItemsEscalerasValoresObservacionFinal(cod_usuario,codigo_inspeccion,textObserFinal);\n\n /* Se actualizan las respectiva tabla de auditoria */\n updateItemsAuditoriaInspeccionesEscaleras(cod_usuario,codigo_inspeccion,consecutivo_inspeccion,contador_items_nocumple);\n}", "title": "" }, { "docid": "478899e06dbc213958356cae8c7d861c", "score": "0.52195114", "text": "function fornecerInformacoes (nome, idade, nerd){\nconsole.log(nome, idade, nerd)\nsetNome(nome)\nsetIdade(idade)\nsetNerd(nerd)\n}", "title": "" }, { "docid": "1ecc490b5a058283688009c370c6727a", "score": "0.5215333", "text": "function inserir(req, res, next) {\n\tres.setHeader('content-type','application/json');\n\tres.charSet('UTF-8');\n\tlet aluno = {\n\t\t\"id\": ++contador,\n\t\t\"nome\": req.body.nome,\n\t\t\"curso\": req.body.curso,\n\t\t\"nascimento\": req.body.nascimento\n\t};\n\talunos.push(aluno);\n\tres.send(aluno);\n\tnext();\n}", "title": "" }, { "docid": "42f32d914f1bb65b169f90f8e774fd95", "score": "0.52084696", "text": "function saveData(allrows)\n{\n console.log(\"Resultent Data : \\n \"+JSON.stringify( allrows));\n /*db.representives.save(allrows, function(err, records) {\n if (err) throw err;\n console.log(\"record added\");\n });\n */\n \n //we can uncomment them when we want to put code in Firefly\n \n /*\n \n var attrs = allrow\n , company = req.subdomain;\n attrs.salt = '';\n Company.findOne({name: allArgs.companyName}, function(err, allArgs.companyName){\n attrs.company_id = company._id.toString();\n var rep = new Rep(attrs);\n rep.set('password.raw', allArgs.userPassword); // hash password as a virtual attribute\n rep.save(function(err){\n if (err){\n if (err.code === 11000){ // if mongodb returns a duplicate error\n //req.flash(\"error\", \"The email %s is already in use.\", attrs.email);\n console.log(\"The email %s is already in use.\", attrs.email);\n }\n } else {\n console.log(\"Saved all!!\");\n \n \n }\n }); // end rep.save\n }); // end Company.findOne\n */\n \n}", "title": "" }, { "docid": "8ae32ef0a6906db3bf5817a24a09534c", "score": "0.52078354", "text": "insertPadawan(padawan, res) {\n const sql = 'insert into Padawan set ?';\n conexao.query(sql, padawan, (erro, resultados) => {\n if (erro) {\n res.status(400).json(erro);\n }\n else {\n res.status(201).json(resultados);\n }\n });\n }", "title": "" }, { "docid": "94024a66dbcb276054888d353bd8774f", "score": "0.51956147", "text": "function buscarPesos() {\n var active = database.result;\n var data = active.transaction([\"pesoCliente\"], \"readonly\");\n var object = data.objectStore(\"pesoCliente\");\n var elements = [];\n var emailABuscar = document.getElementById(\"correo\").value;\n var fechaI = document.getElementById(\"fechaI\").value;\n var fechaF = document.getElementById(\"fechaF\").value;\n\n object.openCursor().onsuccess = function (e) {\n var result = e.target.result;\n if (result === null) {\n return;\n }\n elements.push(result.value);\n result.continue();\n };\n data.oncomplete = function () {\n var outerHTML = ''; \n for (var key in elements) { \n //Si el correo coincide y si está entre las fechas\n if(emailABuscar===elements[key].idUsuario && fechaI < elements[key].fecha < fechaF){\n //Incorporarle una FECHA Y ACTIVIDAD\n outerHTML += '\\n\\\n <tr>\\n\\\n <td>' + elements[key].fecha + '</td>\\n\\\n <td>' + elements[key].pesa + '</td>\\n\\\n </tr>';\n }\n }\n elements = [];\n document.querySelector('#elementsList').innerHTML = outerHTML;\n };\n}", "title": "" }, { "docid": "1c60819a72c2794c2fa886a064f32d7c", "score": "0.51867235", "text": "function insert_in_baseTransfert_daaf(transfert_daaf,suppression)\n {\n //add\n var config =\n {\n headers : {'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'}\n };\n \n var getId = 0;\n if (NouvelItemTransfert_daaf ==false)\n {\n getId = vm.selectedItemTransfert_daaf.id; \n } \n \n var datas = $.param({\n supprimer: suppression,\n id: getId, \n montant_transfert: transfert_daaf.montant_transfert,\n frais_bancaire: transfert_daaf.frais_bancaire,\n montant_total: transfert_daaf.montant_total,\n observation: transfert_daaf.observation,\n date: convertionDate(transfert_daaf.date), \n id_demande_rea_feffi: vm.selectedItemDemande_realimentation.id,\n validation:0 \n });\n //console.log(datas);\n //factory\n apiFactory.add(\"transfert_daaf/index\",datas, config).success(function (data)\n {\n\n if (NouvelItemTransfert_daaf == false)\n {\n // Update or delete: id exclu \n if(suppression==0)\n {\n \n vm.selectedItemTransfert_daaf.$selected = false;\n vm.selectedItemTransfert_daaf.$edit = false;\n vm.selectedItemTransfert_daaf ={};\n }\n else \n { \n vm.alltransfert_daaf = vm.alltransfert_daaf.filter(function(obj)\n {\n return obj.id !== vm.selectedItemTransfert_daaf.id;\n });\n vm.showbuttonNouvtransfert_daaf = true;\n }\n }\n else\n {\n transfert_daaf.validation = 0;\n transfert_daaf.id = String(data.response); \n NouvelItemTransfert_daaf = false;\n\n vm.showbuttonNouvtransfert_daaf = false;\n } \n transfert_daaf.$selected = false;\n transfert_daaf.$edit = false;\n vm.selectedItemTransfert_daaf = {};\n vm.showbuttonValidation_trans_daaf = false;\n }).error(function (data){vm.showAlert('Error','Erreur lors de l\\'insertion de donnée');});\n\n\n }", "title": "" }, { "docid": "5b2762b1300667531aa22c1b76b24ca9", "score": "0.5179528", "text": "function InsertarSQL(tx){\t \n \tnombuser=document.getElementById('nomb').value;\t \n \tpass=document.getElementById('pass').value;\t\t\t \n tx.executeSql('INSERT INTO sesion (nombuser, pass) VALUES (\"'+nombuser+'\", \"'+pass+'\")');\t\t\t\t\t \n alert('Registro añadido');\t\t\t\n\n}", "title": "" } ]
7bd10feb3bcb17469af1a888f10839d5
Value Ref for binned fields
[ { "docid": "0b41d7bf0f95e70fc929c57c23142e1a", "score": "0.5593342", "text": "function rectBinRef({\n channel,\n fieldDef,\n scaleName,\n markDef,\n band,\n offset,\n config\n }) {\n const r = interpolatedSignalRef({\n scaleName,\n fieldOrDatumDef: fieldDef,\n band,\n offset\n });\n return wrapPositionInvalidTest({\n fieldDef,\n channel,\n markDef,\n ref: r,\n config\n });\n }", "title": "" } ]
[ { "docid": "4c36ba40ff38d6e9197f2fa791042958", "score": "0.69799674", "text": "function bin(fieldDef, scaleName, side, offset) {\n return fieldRef(fieldDef, scaleName, { binSuffix: side }, offset ? { offset: offset } : {});\n}", "title": "" }, { "docid": "6e9fef27b2561a969af9d8b1b9d38afa", "score": "0.65859425", "text": "function bin(fieldDef, scaleName, side, offset) {\n var binSuffix = side === 'start' ? undefined : 'end';\n return fieldRef(fieldDef, scaleName, { binSuffix: binSuffix }, offset ? { offset: offset } : {});\n}", "title": "" }, { "docid": "f7ed9409248457efd61f82135bb9fd1b", "score": "0.613698", "text": "function b2BoundValues() {\n}", "title": "" }, { "docid": "31ad7e4fe73e12eb2ee3074084ecbb0f", "score": "0.6098366", "text": "get referenceValue() {\r\n return this.i.b;\r\n }", "title": "" }, { "docid": "f7d85303007eac0ccc4880d629d4cfee", "score": "0.60563666", "text": "function valueRef(ref) {\n if (ref == null) return null;\n\n if (ref.c) {\n return colorRef(\"hcl\", ref.h, ref.c, ref.l);\n } else if (ref.h || ref.s) {\n return colorRef(\"hsl\", ref.h, ref.s, ref.l);\n } else if (ref.l || ref.a) {\n return colorRef(\"lab\", ref.l, ref.a, ref.b);\n } else if (ref.r || ref.g || ref.b) {\n return colorRef(\"rgb\", ref.r, ref.g, ref.b);\n }\n\n var val = ref.value !== undefined\n ? vg.str(ref.value)\n : \"item.datum.data\";\n\n // get value from enclosing group\n if (ref.group !== undefined) {\n val = \"group.\" + ref.group;\n }\n\n // get data field value\n if (ref.field !== undefined) {\n val = \"item.datum[\"\n + vg.field(ref.field).map(vg.str).join(\"][\")\n + \"]\";\n }\n \n // run through scale function\n if (ref.scale !== undefined) {\n var scale = \"group.scales['\"+ref.scale+\"']\";\n if (ref.band) {\n val = scale + \".rangeBand()\";\n } else {\n val = scale + \"(\" + val + \")\";\n }\n }\n \n // multiply, offset, return value\n return \"(\" + (ref.mult ? (ref.mult+\" * \") : \"\") + val + \")\"\n + (ref.offset ? \" + \"+ref.offset : \"\");\n }", "title": "" }, { "docid": "008ea528486e166aff8bb1226d54f4a9", "score": "0.59838206", "text": "function valueRef(ref) {\n if (ref == null) return null;\n\n var val = ref.value !== undefined\n ? vg.str(ref.value)\n : \"item.datum.data\";\n\n // get value from enclosing group\n if (ref.group !== undefined) {\n val = \"group.\" + ref.group;\n }\n\n // get data field value\n if (ref.field !== undefined) {\n val = \"item.datum[\"\n + vg.field(ref.field).map(vg.str).join(\"][\")\n + \"]\";\n }\n \n // run through scale function\n if (ref.scale !== undefined) {\n var scale = \"group.scales['\"+ref.scale+\"']\";\n if (ref.band) {\n val = scale + \".rangeBand()\";\n } else {\n val = scale + \"(\" + val + \")\";\n }\n }\n \n // multiply, offset, return value\n return \"(\" + (ref.mult ? (ref.mult+\" * \") : \"\") + val + \")\"\n + (ref.offset ? \" + \"+ref.offset : \"\");\n }", "title": "" }, { "docid": "e87137949749c9bcc8bdde799758d85e", "score": "0.5865254", "text": "function getRefVals() {\n\n return {\n\n bicarb: {\n low: (bicarb < 22),\n normal: (bicarb >= 22 && bicarb <= 26),\n high: (bicarb > 26)\n },\n\n ph: {\n low: (ph < 7.35),\n normal: (ph >= 7.35 && ph <= 7.45),\n high: (ph > 7.45)\n },\n\n co2: {\n low: (co2 < 35),\n normal: (co2 >= 35 && co2 <= 45),\n high: (co2 > 45)\n }\n\n };\n\n }", "title": "" }, { "docid": "d6cc944fc2c2afc4e5d463573cf92f06", "score": "0.58623093", "text": "get value() {\r\n return this.i.bn;\r\n }", "title": "" }, { "docid": "465934e4a77d4c07c3ab8b768a781dac", "score": "0.56055117", "text": "getBinary(){\n return this.PAD(Array.from(this.value.toString(2)).reverse().map(x=>Number(x)),this.padSize);\n }", "title": "" }, { "docid": "6075b24d8733fe7c4ec4c5e8f70672e0", "score": "0.5534782", "text": "function RangedValue() {}", "title": "" }, { "docid": "6c119cefb0d7d2baaacd3a96c5330a19", "score": "0.55069274", "text": "function Binary($$targs$$,binary$){set_type_args(binary$,$$targs$$,Binary);binary$.set$defs$bit=function($bx,$by){return true;};}", "title": "" }, { "docid": "b98ee0978d65a38aa224458eabd91fcd", "score": "0.54699445", "text": "get value() {\n return [this._low, this._high];\n }", "title": "" }, { "docid": "9522e5b60850239ccd110eaf41696931", "score": "0.53829867", "text": "get value() {\n return [this.filter.low, this.filter.high];\n }", "title": "" }, { "docid": "717cc3b4d6b5fd88bad8832e5168861c", "score": "0.53266317", "text": "function Bin() {\n this.list = [];\n this.permutate = true;\n this.include = false;\n}", "title": "" }, { "docid": "24770601904235aef0280c3d989046fc", "score": "0.52717984", "text": "calculateBin(binIndex) {\n return 1.0;\n }", "title": "" }, { "docid": "01cc24b3811b799f59af7ddd1cc23509", "score": "0.52370054", "text": "getDataOutletRef(field) {\n return this.rendererService.getDataOutletRef(this.type, field);\n }", "title": "" }, { "docid": "5f980f7208f041690188e2b23875edb9", "score": "0.52018404", "text": "deriveBins() {\n const { bins } = this;\n if (!this.data) {\n return [];\n }\n const xData = this.data.map((datum) => datum[this.xKey]);\n const xDomain = this.fixNumericExtent(extent(xData));\n if (this.binCount === undefined) {\n if (bins) {\n return bins;\n }\n const binStarts = ticks(xDomain[0], xDomain[1], defaultBinCount);\n const binSize = tickStep(xDomain[0], xDomain[1], defaultBinCount);\n const firstBinEnd = binStarts[0];\n const expandStartToBin = (n) => [n, n + binSize];\n return [[firstBinEnd - binSize, firstBinEnd], ...binStarts.map(expandStartToBin)];\n }\n else {\n return this.calculateNiceBins(xDomain, this.binCount);\n }\n }", "title": "" }, { "docid": "6922d5a7cb6b975b890d8d3581530977", "score": "0.5166348", "text": "get valueRange() {\n\t\treturn this.__valueRange;\n\t}", "title": "" }, { "docid": "b49c9915f81d0035b37fe25aa6543507", "score": "0.51363444", "text": "get rawValue() {\n return this._rawValue;\n }", "title": "" }, { "docid": "22490db079a0ad42351b90db552787e6", "score": "0.5130255", "text": "function display_bin() {\n let input = new Q9_6( parseFloat( Num_In.value ) );\n Bin_Out.innerHTML = num_to_bin( input );\n}", "title": "" }, { "docid": "e3bfd53bddd9dc290b2e87877ec9e793", "score": "0.511937", "text": "function Fay$$readRef(ref,x){\n return ref.value;\n}", "title": "" }, { "docid": "e3bfd53bddd9dc290b2e87877ec9e793", "score": "0.511937", "text": "function Fay$$readRef(ref,x){\n return ref.value;\n}", "title": "" }, { "docid": "e3bfd53bddd9dc290b2e87877ec9e793", "score": "0.511937", "text": "function Fay$$readRef(ref,x){\n return ref.value;\n}", "title": "" }, { "docid": "70c613c0c148a0f8bd441c69197f23ff", "score": "0.5111297", "text": "function binRequiresRange(fieldDef, channel) {\n if (!fieldDef.bin) {\n console.warn('Only use this method with binned field defs');\n return false;\n }\n // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n return channel_1.isScaleChannel(channel) && util_1.contains(['ordinal', 'nominal'], fieldDef.type);\n}", "title": "" }, { "docid": "57ca79c6a4e1795c71f64bd535575759", "score": "0.5076733", "text": "function widthHeightValueOrSignalRef(channel, value) {\n if (contains(['x', 'x2'], channel) && value === 'width') {\n return {\n field: {\n group: 'width'\n }\n };\n } else if (contains(['y', 'y2'], channel) && value === 'height') {\n return {\n field: {\n group: 'height'\n }\n };\n }\n\n return signalOrValueRef(value);\n }", "title": "" }, { "docid": "bf7ed7d787185a96705ba9c855417e66", "score": "0.50722086", "text": "onFnaFieldValueChanged(val) {\n if (this.__fieldNode.__childNodes.length === 0) {\n // assuming a scalar\n this.value = { id: val, display_name: val };\n this._FBPTriggerWire('--displayValue', val);\n } else {\n this._FBPTriggerWire('--displayValue', val.display_name);\n this.value = val;\n }\n\n // set the service by wire, because collection-agent can not handle empty service entries\n if (typeof val.link === 'object' && val.link.service !== '') {\n this._FBPTriggerWire('--detectedService', val.link.service);\n this._FBPTriggerWire('--hts', val.link);\n } else {\n // todo: check if the defaults from the field itself (not the defaults from the used type) are given\n // try the defaults from the ref type\n this._FBPTriggerWire('--detectedService', Env.api.specs[this.__fieldNode._spec.type].fields.link.meta.default.service);\n this._FBPTriggerWire('--hts', Env.api.specs[this.__fieldNode._spec.type].fields.link.meta.default);\n\n }\n }", "title": "" }, { "docid": "2a01e6bf1235f926f8933352ad6ee39a", "score": "0.5065288", "text": "static binaryAndNumerical(binArray, x, y, colour) {\n fill(0);\n textSize(25);\n noStroke();\n var value = binArray.slice().reverse().reduce((acc, val, idx) => acc + val * (2 ** idx));\n text(String(value), x, y);\n Draw.binary(binArray, x + 5, y + 10, colour);\n }", "title": "" }, { "docid": "c2bfbdaa15812035855fdf9fe719c0db", "score": "0.5046469", "text": "function binb(x, len) {\n\t var j, i, l,\n\t W = new Array(80),\n\t hash = new Array(16),\n\t //Initial hash values\n\t H = [\n\t new int64(0x6a09e667, -205731576),\n\t new int64(-1150833019, -2067093701),\n\t new int64(0x3c6ef372, -23791573),\n\t new int64(-1521486534, 0x5f1d36f1),\n\t new int64(0x510e527f, -1377402159),\n\t new int64(-1694144372, 0x2b3e6c1f),\n\t new int64(0x1f83d9ab, -79577749),\n\t new int64(0x5be0cd19, 0x137e2179)\n\t ],\n\t T1 = new int64(0, 0),\n\t T2 = new int64(0, 0),\n\t a = new int64(0, 0),\n\t b = new int64(0, 0),\n\t c = new int64(0, 0),\n\t d = new int64(0, 0),\n\t e = new int64(0, 0),\n\t f = new int64(0, 0),\n\t g = new int64(0, 0),\n\t h = new int64(0, 0),\n\t //Temporary variables not specified by the document\n\t s0 = new int64(0, 0),\n\t s1 = new int64(0, 0),\n\t Ch = new int64(0, 0),\n\t Maj = new int64(0, 0),\n\t r1 = new int64(0, 0),\n\t r2 = new int64(0, 0),\n\t r3 = new int64(0, 0);\n\n\t if (sha512_k === undefined) {\n\t //SHA512 constants\n\t sha512_k = [\n\t new int64(0x428a2f98, -685199838), new int64(0x71374491, 0x23ef65cd),\n\t new int64(-1245643825, -330482897), new int64(-373957723, -2121671748),\n\t new int64(0x3956c25b, -213338824), new int64(0x59f111f1, -1241133031),\n\t new int64(-1841331548, -1357295717), new int64(-1424204075, -630357736),\n\t new int64(-670586216, -1560083902), new int64(0x12835b01, 0x45706fbe),\n\t new int64(0x243185be, 0x4ee4b28c), new int64(0x550c7dc3, -704662302),\n\t new int64(0x72be5d74, -226784913), new int64(-2132889090, 0x3b1696b1),\n\t new int64(-1680079193, 0x25c71235), new int64(-1046744716, -815192428),\n\t new int64(-459576895, -1628353838), new int64(-272742522, 0x384f25e3),\n\t new int64(0xfc19dc6, -1953704523), new int64(0x240ca1cc, 0x77ac9c65),\n\t new int64(0x2de92c6f, 0x592b0275), new int64(0x4a7484aa, 0x6ea6e483),\n\t new int64(0x5cb0a9dc, -1119749164), new int64(0x76f988da, -2096016459),\n\t new int64(-1740746414, -295247957), new int64(-1473132947, 0x2db43210),\n\t new int64(-1341970488, -1728372417), new int64(-1084653625, -1091629340),\n\t new int64(-958395405, 0x3da88fc2), new int64(-710438585, -1828018395),\n\t new int64(0x6ca6351, -536640913), new int64(0x14292967, 0xa0e6e70),\n\t new int64(0x27b70a85, 0x46d22ffc), new int64(0x2e1b2138, 0x5c26c926),\n\t new int64(0x4d2c6dfc, 0x5ac42aed), new int64(0x53380d13, -1651133473),\n\t new int64(0x650a7354, -1951439906), new int64(0x766a0abb, 0x3c77b2a8),\n\t new int64(-2117940946, 0x47edaee6), new int64(-1838011259, 0x1482353b),\n\t new int64(-1564481375, 0x4cf10364), new int64(-1474664885, -1136513023),\n\t new int64(-1035236496, -789014639), new int64(-949202525, 0x654be30),\n\t new int64(-778901479, -688958952), new int64(-694614492, 0x5565a910),\n\t new int64(-200395387, 0x5771202a), new int64(0x106aa070, 0x32bbd1b8),\n\t new int64(0x19a4c116, -1194143544), new int64(0x1e376c08, 0x5141ab53),\n\t new int64(0x2748774c, -544281703), new int64(0x34b0bcb5, -509917016),\n\t new int64(0x391c0cb3, -976659869), new int64(0x4ed8aa4a, -482243893),\n\t new int64(0x5b9cca4f, 0x7763e373), new int64(0x682e6ff3, -692930397),\n\t new int64(0x748f82ee, 0x5defb2fc), new int64(0x78a5636f, 0x43172f60),\n\t new int64(-2067236844, -1578062990), new int64(-1933114872, 0x1a6439ec),\n\t new int64(-1866530822, 0x23631e28), new int64(-1538233109, -561857047),\n\t new int64(-1090935817, -1295615723), new int64(-965641998, -479046869),\n\t new int64(-903397682, -366583396), new int64(-779700025, 0x21c0c207),\n\t new int64(-354779690, -840897762), new int64(-176337025, -294727304),\n\t new int64(0x6f067aa, 0x72176fba), new int64(0xa637dc5, -1563912026),\n\t new int64(0x113f9804, -1090974290), new int64(0x1b710b35, 0x131c471b),\n\t new int64(0x28db77f5, 0x23047d84), new int64(0x32caab7b, 0x40c72493),\n\t new int64(0x3c9ebe0a, 0x15c9bebc), new int64(0x431d67c4, -1676669620),\n\t new int64(0x4cc5d4be, -885112138), new int64(0x597f299c, -60457430),\n\t new int64(0x5fcb6fab, 0x3ad6faec), new int64(0x6c44198c, 0x4a475817)\n\t ];\n\t }\n\n\t for (i = 0; i < 80; i += 1) {\n\t W[i] = new int64(0, 0);\n\t }\n\n\t // append padding to the source string. The format is described in the FIPS.\n\t x[len >> 5] |= 0x80 << (24 - (len & 0x1f));\n\t x[((len + 128 >> 10) << 5) + 31] = len;\n\t l = x.length;\n\t for (i = 0; i < l; i += 32) { //32 dwords is the block size\n\t int64copy(a, H[0]);\n\t int64copy(b, H[1]);\n\t int64copy(c, H[2]);\n\t int64copy(d, H[3]);\n\t int64copy(e, H[4]);\n\t int64copy(f, H[5]);\n\t int64copy(g, H[6]);\n\t int64copy(h, H[7]);\n\n\t for (j = 0; j < 16; j += 1) {\n\t W[j].h = x[i + 2 * j];\n\t W[j].l = x[i + 2 * j + 1];\n\t }\n\n\t for (j = 16; j < 80; j += 1) {\n\t //sigma1\n\t int64rrot(r1, W[j - 2], 19);\n\t int64revrrot(r2, W[j - 2], 29);\n\t int64shr(r3, W[j - 2], 6);\n\t s1.l = r1.l ^ r2.l ^ r3.l;\n\t s1.h = r1.h ^ r2.h ^ r3.h;\n\t //sigma0\n\t int64rrot(r1, W[j - 15], 1);\n\t int64rrot(r2, W[j - 15], 8);\n\t int64shr(r3, W[j - 15], 7);\n\t s0.l = r1.l ^ r2.l ^ r3.l;\n\t s0.h = r1.h ^ r2.h ^ r3.h;\n\n\t int64add4(W[j], s1, W[j - 7], s0, W[j - 16]);\n\t }\n\n\t for (j = 0; j < 80; j += 1) {\n\t //Ch\n\t Ch.l = (e.l & f.l) ^ (~e.l & g.l);\n\t Ch.h = (e.h & f.h) ^ (~e.h & g.h);\n\n\t //Sigma1\n\t int64rrot(r1, e, 14);\n\t int64rrot(r2, e, 18);\n\t int64revrrot(r3, e, 9);\n\t s1.l = r1.l ^ r2.l ^ r3.l;\n\t s1.h = r1.h ^ r2.h ^ r3.h;\n\n\t //Sigma0\n\t int64rrot(r1, a, 28);\n\t int64revrrot(r2, a, 2);\n\t int64revrrot(r3, a, 7);\n\t s0.l = r1.l ^ r2.l ^ r3.l;\n\t s0.h = r1.h ^ r2.h ^ r3.h;\n\n\t //Maj\n\t Maj.l = (a.l & b.l) ^ (a.l & c.l) ^ (b.l & c.l);\n\t Maj.h = (a.h & b.h) ^ (a.h & c.h) ^ (b.h & c.h);\n\n\t int64add5(T1, h, s1, Ch, sha512_k[j], W[j]);\n\t int64add(T2, s0, Maj);\n\n\t int64copy(h, g);\n\t int64copy(g, f);\n\t int64copy(f, e);\n\t int64add(e, d, T1);\n\t int64copy(d, c);\n\t int64copy(c, b);\n\t int64copy(b, a);\n\t int64add(a, T1, T2);\n\t }\n\t int64add(H[0], H[0], a);\n\t int64add(H[1], H[1], b);\n\t int64add(H[2], H[2], c);\n\t int64add(H[3], H[3], d);\n\t int64add(H[4], H[4], e);\n\t int64add(H[5], H[5], f);\n\t int64add(H[6], H[6], g);\n\t int64add(H[7], H[7], h);\n\t }\n\n\t //represent the hash as an array of 32-bit dwords\n\t for (i = 0; i < 8; i += 1) {\n\t hash[2 * i] = H[i].h;\n\t hash[2 * i + 1] = H[i].l;\n\t }\n\t return hash;\n\t }", "title": "" }, { "docid": "cb77cc71fd98be616d6c5c3e11d67889", "score": "0.50333184", "text": "get value() {\n return this.getNumberAttribute('value');\n }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "11da146e026f9add219bfb0debba9d22", "score": "0.50192577", "text": "function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }", "title": "" }, { "docid": "02f4fa9cfe7bdf14206a60f9acf31c91", "score": "0.50047946", "text": "getB() {\n\t\treturn this.b;\n\t}", "title": "" }, { "docid": "162a67ba373204fff413e2181011d71d", "score": "0.49880874", "text": "function binb(x, len) {\n var j, i, l,\n W = new Array(80),\n hash = new Array(16),\n //Initial hash values\n H = [\n new int64(0x6a09e667, -205731576),\n new int64(-1150833019, -2067093701),\n new int64(0x3c6ef372, -23791573),\n new int64(-1521486534, 0x5f1d36f1),\n new int64(0x510e527f, -1377402159),\n new int64(-1694144372, 0x2b3e6c1f),\n new int64(0x1f83d9ab, -79577749),\n new int64(0x5be0cd19, 0x137e2179)\n ],\n T1 = new int64(0, 0),\n T2 = new int64(0, 0),\n a = new int64(0, 0),\n b = new int64(0, 0),\n c = new int64(0, 0),\n d = new int64(0, 0),\n e = new int64(0, 0),\n f = new int64(0, 0),\n g = new int64(0, 0),\n h = new int64(0, 0),\n //Temporary variables not specified by the document\n s0 = new int64(0, 0),\n s1 = new int64(0, 0),\n Ch = new int64(0, 0),\n Maj = new int64(0, 0),\n r1 = new int64(0, 0),\n r2 = new int64(0, 0),\n r3 = new int64(0, 0);\n\n if (sha512_k === undefined) {\n //SHA512 constants\n sha512_k = [\n new int64(0x428a2f98, -685199838), new int64(0x71374491, 0x23ef65cd),\n new int64(-1245643825, -330482897), new int64(-373957723, -2121671748),\n new int64(0x3956c25b, -213338824), new int64(0x59f111f1, -1241133031),\n new int64(-1841331548, -1357295717), new int64(-1424204075, -630357736),\n new int64(-670586216, -1560083902), new int64(0x12835b01, 0x45706fbe),\n new int64(0x243185be, 0x4ee4b28c), new int64(0x550c7dc3, -704662302),\n new int64(0x72be5d74, -226784913), new int64(-2132889090, 0x3b1696b1),\n new int64(-1680079193, 0x25c71235), new int64(-1046744716, -815192428),\n new int64(-459576895, -1628353838), new int64(-272742522, 0x384f25e3),\n new int64(0xfc19dc6, -1953704523), new int64(0x240ca1cc, 0x77ac9c65),\n new int64(0x2de92c6f, 0x592b0275), new int64(0x4a7484aa, 0x6ea6e483),\n new int64(0x5cb0a9dc, -1119749164), new int64(0x76f988da, -2096016459),\n new int64(-1740746414, -295247957), new int64(-1473132947, 0x2db43210),\n new int64(-1341970488, -1728372417), new int64(-1084653625, -1091629340),\n new int64(-958395405, 0x3da88fc2), new int64(-710438585, -1828018395),\n new int64(0x6ca6351, -536640913), new int64(0x14292967, 0xa0e6e70),\n new int64(0x27b70a85, 0x46d22ffc), new int64(0x2e1b2138, 0x5c26c926),\n new int64(0x4d2c6dfc, 0x5ac42aed), new int64(0x53380d13, -1651133473),\n new int64(0x650a7354, -1951439906), new int64(0x766a0abb, 0x3c77b2a8),\n new int64(-2117940946, 0x47edaee6), new int64(-1838011259, 0x1482353b),\n new int64(-1564481375, 0x4cf10364), new int64(-1474664885, -1136513023),\n new int64(-1035236496, -789014639), new int64(-949202525, 0x654be30),\n new int64(-778901479, -688958952), new int64(-694614492, 0x5565a910),\n new int64(-200395387, 0x5771202a), new int64(0x106aa070, 0x32bbd1b8),\n new int64(0x19a4c116, -1194143544), new int64(0x1e376c08, 0x5141ab53),\n new int64(0x2748774c, -544281703), new int64(0x34b0bcb5, -509917016),\n new int64(0x391c0cb3, -976659869), new int64(0x4ed8aa4a, -482243893),\n new int64(0x5b9cca4f, 0x7763e373), new int64(0x682e6ff3, -692930397),\n new int64(0x748f82ee, 0x5defb2fc), new int64(0x78a5636f, 0x43172f60),\n new int64(-2067236844, -1578062990), new int64(-1933114872, 0x1a6439ec),\n new int64(-1866530822, 0x23631e28), new int64(-1538233109, -561857047),\n new int64(-1090935817, -1295615723), new int64(-965641998, -479046869),\n new int64(-903397682, -366583396), new int64(-779700025, 0x21c0c207),\n new int64(-354779690, -840897762), new int64(-176337025, -294727304),\n new int64(0x6f067aa, 0x72176fba), new int64(0xa637dc5, -1563912026),\n new int64(0x113f9804, -1090974290), new int64(0x1b710b35, 0x131c471b),\n new int64(0x28db77f5, 0x23047d84), new int64(0x32caab7b, 0x40c72493),\n new int64(0x3c9ebe0a, 0x15c9bebc), new int64(0x431d67c4, -1676669620),\n new int64(0x4cc5d4be, -885112138), new int64(0x597f299c, -60457430),\n new int64(0x5fcb6fab, 0x3ad6faec), new int64(0x6c44198c, 0x4a475817)\n ];\n }\n\n for (i = 0; i < 80; i += 1) {\n W[i] = new int64(0, 0);\n }\n\n // append padding to the source string. The format is described in the FIPS.\n x[len >> 5] |= 0x80 << (24 - (len & 0x1f));\n x[((len + 128 >> 10) << 5) + 31] = len;\n l = x.length;\n for (i = 0; i < l; i += 32) { //32 dwords is the block size\n int64copy(a, H[0]);\n int64copy(b, H[1]);\n int64copy(c, H[2]);\n int64copy(d, H[3]);\n int64copy(e, H[4]);\n int64copy(f, H[5]);\n int64copy(g, H[6]);\n int64copy(h, H[7]);\n\n for (j = 0; j < 16; j += 1) {\n W[j].h = x[i + 2 * j];\n W[j].l = x[i + 2 * j + 1];\n }\n\n for (j = 16; j < 80; j += 1) {\n //sigma1\n int64rrot(r1, W[j - 2], 19);\n int64revrrot(r2, W[j - 2], 29);\n int64shr(r3, W[j - 2], 6);\n s1.l = r1.l ^ r2.l ^ r3.l;\n s1.h = r1.h ^ r2.h ^ r3.h;\n //sigma0\n int64rrot(r1, W[j - 15], 1);\n int64rrot(r2, W[j - 15], 8);\n int64shr(r3, W[j - 15], 7);\n s0.l = r1.l ^ r2.l ^ r3.l;\n s0.h = r1.h ^ r2.h ^ r3.h;\n\n int64add4(W[j], s1, W[j - 7], s0, W[j - 16]);\n }\n\n for (j = 0; j < 80; j += 1) {\n //Ch\n Ch.l = (e.l & f.l) ^ (~e.l & g.l);\n Ch.h = (e.h & f.h) ^ (~e.h & g.h);\n\n //Sigma1\n int64rrot(r1, e, 14);\n int64rrot(r2, e, 18);\n int64revrrot(r3, e, 9);\n s1.l = r1.l ^ r2.l ^ r3.l;\n s1.h = r1.h ^ r2.h ^ r3.h;\n\n //Sigma0\n int64rrot(r1, a, 28);\n int64revrrot(r2, a, 2);\n int64revrrot(r3, a, 7);\n s0.l = r1.l ^ r2.l ^ r3.l;\n s0.h = r1.h ^ r2.h ^ r3.h;\n\n //Maj\n Maj.l = (a.l & b.l) ^ (a.l & c.l) ^ (b.l & c.l);\n Maj.h = (a.h & b.h) ^ (a.h & c.h) ^ (b.h & c.h);\n\n int64add5(T1, h, s1, Ch, sha512_k[j], W[j]);\n int64add(T2, s0, Maj);\n\n int64copy(h, g);\n int64copy(g, f);\n int64copy(f, e);\n int64add(e, d, T1);\n int64copy(d, c);\n int64copy(c, b);\n int64copy(b, a);\n int64add(a, T1, T2);\n }\n int64add(H[0], H[0], a);\n int64add(H[1], H[1], b);\n int64add(H[2], H[2], c);\n int64add(H[3], H[3], d);\n int64add(H[4], H[4], e);\n int64add(H[5], H[5], f);\n int64add(H[6], H[6], g);\n int64add(H[7], H[7], h);\n }\n\n //represent the hash as an array of 32-bit dwords\n for (i = 0; i < 8; i += 1) {\n hash[2 * i] = H[i].h;\n hash[2 * i + 1] = H[i].l;\n }\n return hash;\n }", "title": "" }, { "docid": "8804123264bb6a99ce2bb91ab041d3c8", "score": "0.49806288", "text": "function correctBinEdges(bindata) {\n\tvar incr = bindata[1].x1 - bindata[1].x0;\n\tbindata[0].x0 = bindata[0].x1 - incr;\n\treturn bindata;\n}", "title": "" }, { "docid": "82bcb071c3ca8ae93df0196f075ae50e", "score": "0.4977069", "text": "function processValue(_ref, value) {\n\t var type = _ref.type,\n\t items = _ref.items;\n\n\t if (type === \"array\" && items && [\"number\", \"integer\"].includes(items.type)) {\n\t return value.map(_utils.asNumber);\n\t } else if (type === \"boolean\") {\n\t return value === \"true\";\n\t } else if (type === \"number\") {\n\t return (0, _utils.asNumber)(value);\n\t }\n\t return value;\n\t}", "title": "" }, { "docid": "f3310dcc86fd199580a883bbfaa39535", "score": "0.49695283", "text": "get backingValue(){\n return this.element.value;\n }", "title": "" }, { "docid": "64f869976ad77b144eaaebfaa192b049", "score": "0.49667245", "text": "function binTheDataWithFunction (bin, curLevel, key, func, range_to_rebin) {\n var bDat = [];\n if (!bin[key].levels[curLevel]) {\n return bDat;\n }\n\n // Combine all data which is within range_to_rebin\n var combo = combineFilteredBinContainerInformation(bin, curLevel, key, range_to_rebin);\n var combo2 = [];\n\n // if we're calculating for quartiles, then we need the other quartile as well\n if (key === 'q1') {\n combo2 = combineFilteredBinContainerInformation(bin, curLevel, 'q3', range_to_rebin);\n } else if (key === 'q3'){\n combo2 = combineFilteredBinContainerInformation(bin, curLevel, 'q1', range_to_rebin);\n }\n\n // Use this new combined data instead of bin[key].levels[curLevel].length\n for(var i = 0; i < combo.length; i = i + 2){\n // If we are at a bad spot to begin a bin, decrement i by 1 and continue;\n var sampleIsAtModularLocation = atModularLocation(combo[i].ms, curLevel+1);\n var nextSampleExists = combo.length > i + 1;\n var nextSampleIsRightDistanceAway = nextSampleExists ?\n combo[i+1].ms - combo[i].ms === sampleSize(curLevel) :\n true;\n\n if (!sampleIsAtModularLocation || !nextSampleExists || !nextSampleIsRightDistanceAway) {\n // This is here so that both the server and client's bins start and end at the same place\n // no matter what range of data they have to work with.\n // we skip over values which are not at the beginning of a bin\n i = i - 1;\n continue;\n }\n\n if (combo[i+1]){\n var newdate = combo[i/*+1*/].ms;\n\n if (key === 'q1' || key === 'q3') {\n bDat.push({ val: func(\n combo[i].val,\n combo[i+1].val,\n combo2[i].val,\n combo2[i+1].val),\n ms: newdate }); // This is messy and depends on a lot of things\n }else{\n bDat.push( { val: func( combo[i].val,\n combo[i+1].val),\n ms: newdate });\n }\n }\n }\n return bDat;\n }", "title": "" }, { "docid": "ca6bef53016f2671aa069769f2db554f", "score": "0.49648818", "text": "function bnByteValue() {\n var this_array = this.array;\n return (this.t==0)?this.s:(this_array[0]<<24)>>24;\n}", "title": "" }, { "docid": "84803448168afc6d58fc2474edcb1baa", "score": "0.49622276", "text": "@sync(PRIMITIVE)\n get numval() { return this._numval }", "title": "" }, { "docid": "10923cecee4774ddb4fee661e40c0320", "score": "0.49599683", "text": "transform(fn) {\n\t\treturn this.#handleRef(new ReadOnlyBinding(fn(this.#value)), (n, v) => n.#set(fn(v)), n => n.#refs > 0);\n\t}", "title": "" }, { "docid": "e6867b7ddfc338942cffbbac4e708a87", "score": "0.4958109", "text": "function bnByteValue() {\n\t return (this.t == 0) ? this.s : (this[0] << 24) >> 24;\n\t}", "title": "" }, { "docid": "a9330508685453cc1890cc6596019b32", "score": "0.4956277", "text": "function binRequiresRange(fieldDef, channel) {\n if (!isBinning(fieldDef.bin)) {\n console.warn('Only call this method for binned field defs.');\n return false;\n } // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n\n\n return isScaleChannel(channel) && contains(['ordinal', 'nominal'], fieldDef.type);\n }", "title": "" }, { "docid": "33a86f8624f94f2eb97ece44a43098d9", "score": "0.49364096", "text": "function bnByteValue()\n{\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24;\n}", "title": "" }, { "docid": "8d8c477ceae6043efda393aed58bbe4e", "score": "0.49339774", "text": "get binary() {\n\t\treturn this.__binary;\n\t}", "title": "" }, { "docid": "e43736baf3816325352c35e012569f6a", "score": "0.49317992", "text": "function Fay$$writeRef(ref,x){\n ref.value = x;\n}", "title": "" }, { "docid": "e43736baf3816325352c35e012569f6a", "score": "0.49317992", "text": "function Fay$$writeRef(ref,x){\n ref.value = x;\n}", "title": "" }, { "docid": "e43736baf3816325352c35e012569f6a", "score": "0.49317992", "text": "function Fay$$writeRef(ref,x){\n ref.value = x;\n}", "title": "" }, { "docid": "49c369d86bcd1b5409320b395b576061", "score": "0.49258628", "text": "function bnByteValue() {\n return this.t == 0 ? this.s : this[0] << 24 >> 24;\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" }, { "docid": "301d7eb384944d6f793f00abffedbc0d", "score": "0.49257144", "text": "function bnByteValue() {\n return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}", "title": "" } ]
6636eed7a46db5e4189d2ea3330e8281
Function to Download Data
[ { "docid": "8eacf6e019ab367d40ff8b0e5af8fe42", "score": "0.5903552", "text": "function downloadData() {\n let notes = localStorage.getItem(\"notes\")\n var tempDownData = \"data:json;charset=utf-8,\" + encodeURIComponent(notes)\n let downData = document.createElement(\"a\")\n downData.href = tempDownData\n downData.download = \"notes.json\"\n downData.click()\n downData.remove()\n }", "title": "" } ]
[ { "docid": "990caba7025ab9e7f6a19cf63edac753", "score": "0.75878", "text": "function download(){}", "title": "" }, { "docid": "9c9cdfb6c585a3c63575d6fb7b3b84bc", "score": "0.74388033", "text": "async download() { }", "title": "" }, { "docid": "be4e8f6fcdee36c0180652912a924a04", "score": "0.7336147", "text": "function downloadData() {\n\n\t\t// Promise construstor takes two params: resolve, reject\n\t\treturn new Promise((resolve, reject) => {\n\t\t\trequest(options, (error, res, movieData) => {\n\t\t\t\tif(error) {\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(movieData);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "6afcfa5b7d22aeba3fea98eaf927ad5e", "score": "0.70819193", "text": "function receiveData(){\n return $http.get('/download');\n }", "title": "" }, { "docid": "ae1d035eb92c491f3dfabd6a9d6f3aa1", "score": "0.70522296", "text": "download (action, queryData/*, progressCallback*/) {\n return this.do(action, 'GET', queryData, false, true, false/*, progressCallback*/);\n }", "title": "" }, { "docid": "9ca2173f43b6695fb549d1d4a5615cdb", "score": "0.69862425", "text": "function downloadUrlData(str ,callback) {\n var request = window.ActiveXObject ?\n new ActiveXObject('Microsoft.XMLHTTP') :\n new XMLHttpRequest;\n\n request.onreadystatechange = function() {\n if (request.readyState == 4) {\n request.onreadystatechange = doNothing;\n callback(request, request.status);\n }\n };\n\n request.open('GET',str, true);\n request.send(null);\n }", "title": "" }, { "docid": "d41c0b6bf0e0b3feb6c5d2c516fb1f5d", "score": "0.68842083", "text": "function dataDownload(indata){\r\n\r\n\tvar varArray = domValues();\r\n//Building FileName\r\n\tvar FileName = \"Net Migration by Year \"\r\n\tif(varArray[0].length == 1) {\r\n\tFileName = FileName + varArray[0][0];\r\n } else { \r\n\t for (i = 1; i <= varArray[0].length; i++){\r\n\t\t\t FileName = FileName + \" \" + varArray[0][i-1];\r\n\t\t }\r\n };\r\n\t FileName = FileName + \".csv\";\r\n//Filtering data and output\r\n\tvar dataOut = indata.filter(d => varArray[1].includes(d.fips));\r\n\r\n \texportToCsv(FileName, dataOut);\r\n}", "title": "" }, { "docid": "7dfd334c6b2a5e741d09397fcb3ba4c0", "score": "0.68469536", "text": "function dataDownload(URL){\n \n Ti.API.info('Downloading new data in the background.');\n \n //Download new Data\n xhr = Titanium.Network.createHTTPClient();\n\n xhr.onload = function(){\n \n //Write data to local dataStore (Images are still stored as URLs)\n dataStore.write(this.responseText);\n \n //Parse data into dataArr Array (data is now in memory, ready to be refreshed onto page)\n dataParse(dataStore.read());\n \n xhr = null;\n \tdownloadImage(status='start');\n\n\t}\n xhr.open('GET', URL);\n xhr.send();\n}", "title": "" }, { "docid": "2c71cdb4ff0af5d5d0778506c70d2796", "score": "0.6802191", "text": "function download(url) {\n // ...\n}", "title": "" }, { "docid": "549a2aaf9ea3cc51edba97b43bf7b39e", "score": "0.6780323", "text": "onDownload () {\n const udgst = encodeURIComponent(this.digest)\n const uname = encodeURIComponent(this.parameterName)\n let u = this.isFromRun\n ? this.omsUrl +\n '/api/model/' + udgst + '/run/' + encodeURIComponent(this.runDigest) + '/parameter/' + uname\n : this.omsUrl +\n '/api/model/' + udgst + '/workset/' + encodeURIComponent(this.worksetName) + '/parameter/' + uname\n u += (this.$q.platform.is.win) ? '/csv-bom' : '/csv'\n\n openURL(u)\n }", "title": "" }, { "docid": "7b8aa0b5b594ceb85c86360925e30394", "score": "0.6694731", "text": "function download_file(data, filetype) {\n\nswitch (filetype) {\n case 'tsv':\n dwnld_data = to_tsv(data);\n break;\n case 'json':\n dwnld_data = to_json(data);\n break;\n default: null;\n}\n\n\n var hiddenElement = document.createElement('a');\n hiddenElement.href = 'data:text/tsv;charset=utf-8,' + encodeURI(dwnld_data);\n hiddenElement.target = '_blank';\n hiddenElement.download = assay_title.replace(/\\s/g, '') + 'data.' + filetype;\n hiddenElement.click();\n}", "title": "" }, { "docid": "44c439d9bbffb1120bc1cb009c01a6ef", "score": "0.6692222", "text": "function getData() {\r\n\t\r\n\tvar requestUrl;\r\n\r\n\t//Get the url path\r\n\trequestUrl = CONST_URL_PATH;\r\n\trequestUrl += CONST_QUERY_PARAM + CONST_QUERY_PARAM_GETDATA;\r\n\trequestUrl += '&' + CONST_QUERY_READ_FROM + getValue('ReadFrom');\r\n\r\n\txmlHttp = GetXmlHttpObject(getDataHandler);\r\n\r\n\txmlHttp_Send_Request(CONST_METHOD_POST, xmlHttp, requestUrl);\r\n\r\n}//End of setData", "title": "" }, { "docid": "422395b1b11691d913649c95a961c835", "score": "0.6623184", "text": "function downloadData(){\n\tconst snv = scenario_num.value();\n\tcreateStringDict(\n\t{\n\t\t\"scenario\": {\n\t\t\t[snv]: {\n\t\t\t\tquestion\n\t\t\t}\n\t\t}\n\t}).saveJSON(file_name.value());\n}", "title": "" }, { "docid": "d009a5fb382ab08365d5c45af7e6f574", "score": "0.6585418", "text": "async downloadAllData() {\n let returnValue = '';\n await axios({\n method: 'get',\n url: this.backendUrl\n })\n .then(response => {\n this._logger.debug('Got the response from the get: ' + JSON.stringify(response.data));\n if (response.status === 200) {\n this._logger.debug('successfully got the data');\n returnValue = response.data;\n }\n else {\n this._logger.error('Failed to get data with response code: ' + response.status);\n }\n })\n .catch(err => {\n this._logger.error('Got the error when attempting to get the export data: ' + err);\n })\n\n return returnValue;\n }", "title": "" }, { "docid": "f69c7be35ff5adefbb1fde0489782143", "score": "0.6556807", "text": "function download_data() {\n $('#download_csv').attr('href', 'https://docs.google.com/a/developmentseed.org/spreadsheet/pub?key=' + data_id + '&output=csv');\n $('#download_josn').attr('href', 'https://spreadsheets.google.com/feeds/list/' + data_id + '/1/public/values?alt=json-in-script');\n}", "title": "" }, { "docid": "2f3fca3e4a592bac8b17c3e84b0016b1", "score": "0.65527904", "text": "function downloadData() {\n let csvContent = \"data:text/csv;charset=utf-8,\"\n csvContent += \"Code,Status,time\" + \"\\r\\n\";\n allData.forEach(function(rowArray) {\n let row = rowArray;\n csvContent += row + \"\\r\\n\";\n });\n\n var encodedUri = encodeURI(csvContent);\n var link = document.createElement(\"a\");\n link.setAttribute(\"href\", encodedUri);\n link.setAttribute(\"download\", \"APIData.csv\");\n link.click();\n}", "title": "" }, { "docid": "640ac2c9054201429b613aa0e9701dcb", "score": "0.6491652", "text": "async downloadFile() {\n const dish = this.getOutputDish(this.manager.tabs.getActiveTab(\"output\"));\n if (dish === null) {\n this.app.alert(\"Could not find any output data to download. Has this output been baked?\", 3000);\n return;\n }\n\n const data = await dish.get(Dish.ARRAY_BUFFER);\n let ext = \".dat\";\n\n // Detect file type automatically\n const types = detectFileType(data);\n if (types.length) {\n ext = `.${types[0].extension.split(\",\", 1)[0]}`;\n }\n\n const fileName = window.prompt(\"Please enter a filename: \", `download${ext}`);\n\n // Assume if the user clicks cancel they don't want to download\n if (fileName === null) return;\n\n const file = new File([data], fileName);\n FileSaver.saveAs(file, fileName, {autoBom: false});\n }", "title": "" }, { "docid": "9614e0b8b03bbb0ef4b1af72d95b1365", "score": "0.64911175", "text": "static download(data, filename) {\n const blob = new Blob([data], {type: 'text/plain'});\n const elem = window.document.createElement('a');\n elem.href = window.URL.createObjectURL(blob);\n elem.download = filename || \"LogicGateSimulator\";\n elem.click();\n }", "title": "" }, { "docid": "9fc592e1281c55c2e1257877aa392b01", "score": "0.64398944", "text": "function download() {\n\n function save(data) {\n const replacer = (key, value) => value === null ? '' : value // specify how you want to handle null values here\n const header = Object.keys(data[0])\n let csv = data.map(row => header.map(fieldName => JSON.stringify(row[fieldName], replacer)).join(','))\n csv.unshift(header.join(','))\n\n var blob = new Blob([csv.join('\\r\\n')], {type: \"text/plain;charset=utf-8\"});\n saveAs(blob, \"Eventdata_Subset.csv\");\n }\n\n let variableQuery = buildVariables();\n let subsetQuery = buildSubset(subsetData);\n query = {\n 'subsets': JSON.stringify(subsetQuery),\n 'variables': JSON.stringify(variableQuery),\n 'dataset': dataset,\n 'datasource': datasource,\n 'type': 'raw'\n };\n\n makeCorsRequest(subsetURL, query, save);\n}", "title": "" }, { "docid": "0b219e8ce3e6b02048ba6475e60bc200", "score": "0.64346063", "text": "static download_data(data, filename, mime=\"application/octet-stream\")\n\t{\n\t\tlet link = document.createElement(\"a\");\n\t\tlet blob = new Blob([data], {type: mime});\n\t\tlet ourl = window.URL.createObjectURL(blob);\n\t\tlink.href = ourl;\n\t\tlink.download = filename;\n\t\tlink.click();\n\t\twindow.URL.revokeObjectURL(ourl);\n\t}", "title": "" }, { "docid": "c3459d65aea886d744c6170f41dea9e0", "score": "0.6351387", "text": "function downloadReport() {\n\texportToCsvFile(apiData);\n}", "title": "" }, { "docid": "13672ec9d964db76326e16fd878a6068", "score": "0.63482463", "text": "function $b(a) {\n k.info('Downloading data from \"' + a + '\"');\n return new Promise(function(b, d) {\n var f = new XMLHttpRequest;\n f.open('GET', a, !0);\n f.responseType = 'arraybuffer';\n f.onload = function() {\n 200 === f.status ? b(f.response) : 0 === f.status ? d(Error('Failed to connect to the server')) : d(Error('Failed to download data (' + f.status + ' ' + f.statusText + ')'));\n };\n f.onerror = function() {\n d(Error('Failed to connect to the server'));\n };\n f.send();\n });\n}", "title": "" }, { "docid": "a78f9d88046f011f523030c9a0815a36", "score": "0.6335908", "text": "function fetch(res,url){\n\tserver.download(url, function(data) { \n\t\tif (data) { \n\t\t\t//console.log(data); \n\t\t\tvar $ = cheerio.load(data); \n\n\t\t\tvar _title = $(\"h3.period-title\").html();\n\t\t\tres.write(_title);\n\n\t\t\t\n\t\t\t$(\".mag ol\").each(function(i,e){\n\t\t\t\t/*$(e).find(\"a.title\").each(function(n,m){\n\t\t\t\t\tres.write($(m).html());\t\n\t\t\t\t})*/\n\t\t\t\tres.write($(e).html());\n\t\t\t\t\n\t\t\t})\n\n\n\t\t\tconsole.log(\"done\"); \n\t\t} else { \n\t\t\tconsole.log(\"error\"); \n\t\t} \n\t});\n}", "title": "" }, { "docid": "e4b017b4d3c41957e1c6a4cbefec7816", "score": "0.63199794", "text": "function fetchData(url) {\n var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var compression = model.compression,\n progressCallback = model.progressCallback;\n\n return model.dataAccessHelper.fetchText(publicAPI, url, {\n compression: compression,\n progressCallback: progressCallback\n });\n }", "title": "" }, { "docid": "185851baa5206193ece35b2cbc4ba946", "score": "0.6299746", "text": "download() {\n return this._listing.download();\n }", "title": "" }, { "docid": "7ce8f89cf08ba7cc735be5f7e47f1560", "score": "0.62789375", "text": "downloadFile(){\n this.get('fileDownloader').downloadFile(this.get('urlPath'), this.get('fileName'));\n }", "title": "" }, { "docid": "7b2ed7586211250916250deefd70d6c5", "score": "0.62609476", "text": "function getDownloadList(){\n\t$(\"#wait3\").fadeIn(\"slow\");\n\tDajaxice.dropcloud.getDownloadList(downCallBack,{'tokenID': vars['t']});\n}", "title": "" }, { "docid": "7ae1131195edf02fcd83341a0af660b6", "score": "0.62598264", "text": "function fetchFromUrl() {\n request(redashUrl, (err, response, body) => {\n var data = JSON.parse(body),\n rows = data.query_result.data.rows;\n\n fs.writeFile(fileIn, body, 'utf-8');\n processAndSave(rows);\n\n // data.query_result.data.rows.forEach(saveToFile);\n });\n}", "title": "" }, { "docid": "d1a823ce8d8982ec0b4b799b974d4149", "score": "0.6248723", "text": "download(fileName, url, ...params) {\n const resourceUrl = this.buildUrl(url, ...params);\n let downloadLink = fileName;\n // extract file name\n params.forEach(p => {\n let arr = p.split('=');\n if (arr.length > 1) {\n if (arr[0].toLowerCase() === 'filename') {\n downloadLink = arr[1];\n }\n }\n });\n // return this.http.get(resourceUrl, {responseType: 'blob'}).subscribe((data) => {\n // const downloadURL = window.URL.createObjectURL(data);\n // const link = document.createElement('a');\n // link.href = downloadURL;\n // link.download = downloadLink;\n //\n // link.click();\n // });\n // Set content type for: json / csv / xml / pdf\n let contentType = 'application/json';\n if (downloadLink.toLowerCase().endsWith('csv')) {\n contentType = 'text/csv';\n }\n else if (downloadLink.toLowerCase().endsWith('xml')) {\n contentType = 'text/xml';\n }\n else if (downloadLink.toLowerCase().endsWith('pdf')) {\n contentType = 'application/pdf';\n }\n return this.http.get(resourceUrl, {\n responseType: 'blob',\n reportProgress: true,\n observe: 'events',\n headers: new HttpHeaders({ 'Content-Type': contentType })\n });\n }", "title": "" }, { "docid": "7d4910264643c6e1979653cb2b488b28", "score": "0.6235616", "text": "function getJson(dest){\n\nvar data = \"\";\nvar options = {\n host: 'localhost',\n port: '80',\n path: dest\n};\n\nhttp.get(options, function(res) {\n res.on(\"data\", function(chunk) {\n data += chunk;\n convertToRdf(data);\n });\n}).on('error', function(e) {\n console.log(\"Got error: \" + e.message);\n});\n}", "title": "" }, { "docid": "f0c9a5d2ea523aaf5077d1de81930c97", "score": "0.62195265", "text": "function createDownload(data, filetype){\n var today = new Date();\n var currentDate = today.toUTCString();\n var filename = \"results\"+currentDate;\n switch(filetype){\n case \"text/csv\": filename+=\".csv\";\n break;\n case \"text/xml\": filename+=\".xml\";\n break;\n case \"text/json\": filename+=\".json\";\n break;\n }\n var file = new Blob([data], {type: filetype});\n var downloadLink=document.createElement(\"a\");\n downloadLink.download=filename;\n downloadLink.href=window.URL.createObjectURL(file);\n downloadLink.style.display=\"none\";\n document.body.appendChild(downloadLink);\n downloadLink.click();\n}", "title": "" }, { "docid": "949492315686d5c38c79e0d3e52ef6b4", "score": "0.6209362", "text": "fetchData() {}", "title": "" }, { "docid": "b8d7086479d90cfc108b470f9ad7da69", "score": "0.62074924", "text": "function pull_n_send(server_URL, qumport, user_name, filename='1Dfresp.csv') {\n $.ajax({\n url: 'http://' + server_URL + ':' + qumport + '/mach/uploads/' + filename.split('.')[0] + '[' + user_name + '].' + filename.split('.')[1],\n method: 'GET',\n xhrFields: {\n responseType: 'blob'\n },\n success: function (data) {\n var a = document.createElement('a');\n var url = window.URL.createObjectURL(data);\n a.href = url;\n a.download = filename;\n document.body.append(a);\n a.click();\n a.remove();\n window.URL.revokeObjectURL(url);\n $('button.char#fresp-save' + filename.split('.')[1]).hide();\n $('div#char-fresp-announcement').empty().append($('<h4 style=\"color: red;\"></h4>').text(a.download + ' has been downloaded'));\n }\n });\n return false;\n}", "title": "" }, { "docid": "60d521c0a3e7cffb99e327a465c33781", "score": "0.6198382", "text": "function download(filename, firstname, middlename, lastname, gender, birthday, province, yearlevel) {\r\n\tvar text = \"[USER DATA]\\n\\nFirst Name: \" + firstname + \"\\nMiddle Name: \"+ middlename + \"\\nLast Name: \" + lastname + \"\\nGender: \" + gender + \"\\nBirthday: \" + birthday + \"\\nProvince: \" + province + \"\\nYear Level: \" + yearlevel;\r\n\tvar element = document.createElement('a');\r\n\telement.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));\r\n\telement.setAttribute('download', filename);\r\n\r\n\telement.style.display = 'none';\r\n\tdocument.body.appendChild(element);\r\n\r\n\telement.click();\r\n\r\n\tdocument.body.removeChild(element);\r\n}", "title": "" }, { "docid": "8be188d09316e01cd8d3abc4cbf4af59", "score": "0.61879206", "text": "function getData(link, callback) {\n http.get(link, function(res) {\n var data = '';\n res.on('data', function(part) {\n data += part;\n });\n res.on('end', function(end) {\n callback(data);\n });\n });\n }", "title": "" }, { "docid": "2d3d88cf26e97904118c01f74d9ac244", "score": "0.6184068", "text": "async function downloadLatestData(force) {\n const result = await fetch(`${ROOT_URL}/daily-summary.aspx`, {\n agent: httpsAgent,\n });\n const body = await result.text();\n const $ = cheerio.load(body);\n const itemText = $(\n 'strong:contains(\"Overall counts and rates by city, health reporting area, and zip code\")',\n );\n logger.log(itemText.html());\n const anchor = itemText.parent();\n const datafile = anchor.attr('href');\n return await scrapeDataFile(datafile, force);\n}", "title": "" }, { "docid": "117636ba8290a145b2ae13ecea9e17c2", "score": "0.6182872", "text": "function downloadDataFile() {\n $('#results').after('<a id=\"download-link\" hidden target=\"_blank\" download href=' + location.protocol + '//' + location.host + '/api/download/?data=' + encodeURI($('#results').text()) +'><span></span></a>')\n $('#download-link span').trigger('click')\n $('#download-link').remove()\n}", "title": "" }, { "docid": "778d3d48f64a2e1df9a5534339c72fce", "score": "0.615916", "text": "async function downloadData({ results }) {\n setIsLoading(true);\n\n const fileStream = streamSaver.createWriteStream(\n `data-${moment().format('YYYY-MM-DD--HH:mm')}.csv`,\n {\n writableStrategy: undefined, // (optional)\n readableStrategy: undefined, // (optional)\n }\n );\n\n const writer = fileStream.getWriter();\n\n for (const result of results) {\n if (result?.fullData?.id) {\n const res = await findData({\n variables: {\n id: result?.fullData?.id,\n },\n });\n load({\n result,\n content: res?.data?.data?.content,\n writer,\n type: 'full',\n });\n } else if (result?.incrementalData?.length) {\n for (const incResult of result?.incrementalData) {\n const res = await findData({\n variables: {\n id: incResult?.id,\n },\n });\n load({\n result,\n content: res?.data?.data?.content,\n writer,\n type: 'partial',\n });\n }\n }\n }\n\n writer.close();\n setIsLoading(false);\n }", "title": "" }, { "docid": "560315e569647776ca510917f9834192", "score": "0.61587113", "text": "function getDataFromServer(requestUrl) {\r\n var client = new HttpClient();\r\n console.log('Get data from server.');\r\n client.get(requestUrl, function(response) {\r\n if (response && response.length > 0) {\r\n packageList = JSON.parse(response);\r\n convertImages();\r\n displayList(\"fromServer\");\r\n console.log('Server response: ', packageList);\r\n } else {\r\n console.log('There was no response from the server, it will search the local storage.')\r\n getDataFromLocalStorage();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "0ffe0cab250834866fa949b61f326122", "score": "0.6145493", "text": "downloadSubscriptionData (type, county) {\n return service.get(\"/subscription/download\", {\n params: {\n type: type,\n county: county\n }\n }).then(response => response);\n }", "title": "" }, { "docid": "a61c0ddf29c489da64d210a0de38bbf7", "score": "0.6144245", "text": "function downloadJSON() {\n\tdebugLog(\"JSON Download Started\");\n\tdownloadString(editedLottie, 'application/json', 'sticker')\n}", "title": "" }, { "docid": "14cb81412bac1e505e815e0fd295b093", "score": "0.6142383", "text": "function download(url, callback) {\n request(url, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n callback(body);\n }\n else{\n console.log('error in download function');\n callback(null);\n }\n });\n}", "title": "" }, { "docid": "eea34db7cfd932fd389a1fa2f35195b2", "score": "0.6141051", "text": "function downloadPoints(){\n \n \n $.ajax({\n url: \"js/autoAlign.txt\", // path to file\n type: \"GET\",\n dataType: 'text', // type of file (text, json, xml, etc)\n success: function(d) { // callback for successful completion\n distances = d;\n setDistanceData();\n \n }\n });\n console.log(\"downloading\");\n $.ajax({\n url: \"js/transformed_points.txt\", // path to file\n type: \"GET\",\n dataType: 'text', // type of file (text, json, xml, etc)\n success: function(p) { // callback for successful completion\n points = p;\n setPointData();\n loadAllPoints();\n }\n });\n }", "title": "" }, { "docid": "2274b683a7eaacf4faea68f0bd007e19", "score": "0.6121081", "text": "function createAndDownloadBlob(fName,data){\n let a = document.createElement('a');\n a.href = \"data:application/octet-stream,\"+encodeURIComponent(JSON.stringify(data));\n a.download = fName;\n a.click();\n }", "title": "" }, { "docid": "ea9b6847f924d7cd896f2d9581592370", "score": "0.6119173", "text": "function download(data, filename, type) {\n var blobData = new Blob([data], {type: type + \";charset=utf-8\"})\n saveAs(blobData, filename);\n}", "title": "" }, { "docid": "ae8e8e2dd95252e39f5a519009adc2ba", "score": "0.61129713", "text": "function doDownload(req, res, format) {\n const request = api1.getRequest(req, 'download-request');\n const errs = new errors.Collector();\n\n let wantData = true;\n let wantSamples = false;\n let data = api1.getElement(request, \"data\");\n if (data != null && data !== 'file') {\n if (data === 'samples') {\n wantData = false;\n wantSamples = true;\n } else if (data === 'both') {\n wantData = true;\n wantSamples = true;\n } else {\n errs.error(errors.INVALID_QUERY, 'Invalid data value \"{1}\".', data);\n }\n }\n\n const maxResults = api1.getMaxResults(request, errs, -1);\n\n metadata.get(req, function(cache) {\n let query = api1.downloadQuery(request, cache, errs);\n\n format.root('download-response', (req.isLegacy ? '2014' : '2020') + '/DownloadResponse');\n\n function send(results) {\n format.elementListFull('results', results.map(simfile => {\n let result = {\n \"motor-id\": simfile.externalMotorId,\n \"simfile-id\": simfile.externalId,\n format: simfile.format,\n source: simfile.dataSource,\n license: simfile.license || '',\n };\n if (wantData)\n result.data = Buffer.from(simfile.data).toString('base64');\n if (wantSamples) {\n let parsed = parsers.parseData(simfile.format, simfile.data, errors.ignore);\n if (parsed != null) {\n result.samples = parsed.points.map(pt => {\n return {\n time: pt.time,\n thrust: pt.thrust,\n };\n });\n }\n }\n result[\"info-url\"] = req.helpers.simfileLink(simfile);\n result[\"data-url\"] = req.helpers.simfileDownloadLink(simfile);\n return result;\n }));\n format.error(errs);\n format.send(res, errs.hasErrors());\n }\n\n if (errs.errorCount() > 0) {\n send([]);\n return;\n }\n\n function run() {\n req.db.SimFile.find(query)\n .sort({ updatedAt: -1 })\n .populate('_motor')\n .exec(success(req, res, function(simfiles) {\n // have raw simfile results\n if (simfiles.length < 1)\n return send(simfiles);\n if (maxResults > 0 && simfiles.length > maxResults)\n simfiles.splice(maxResults, simfiles.length - maxResults);\n\n // map output motor and simfile IDs\n if (req.isLegacy) {\n async.parallel([\n function(cb) {\n let motors = simfiles.map(s => s._motor);\n req.db.IntIdMap.map(motors, cb);\n },\n function(cb) {\n req.db.IntIdMap.map(simfiles, cb);\n },\n ], success(req, res, maps => {\n simfiles.forEach((s, i) => {\n s.externalId = maps[1][i];\n s.externalMotorId = maps[0][i];\n });\n send(simfiles);\n }));\n } else {\n simfiles.forEach(s => {\n s.externalId = s._id.toString();\n s.externalMotorId = s._motor._id.toString();\n });\n send(simfiles);\n }\n }));\n }\n\n // map input motor IDs\n if (req.isLegacy) {\n let ints = [];\n if (query._motor.$in) {\n query._motor.$in.forEach(id => {\n id = api1.intValue(id);\n if (id > 0)\n ints.push(id);\n });\n }\n if (ints.length > 0) {\n req.db.IntIdMap.lookup(req.db.Motor, ints, success(req, res, function(motors) {\n if (motors.length > 0) {\n query._motor = { $in: motors.map(m => m._id) };\n run();\n } else\n send([]);\n }));\n } else\n send([]);\n } else {\n let ids = [];\n if (query._motor.$in) {\n query._motor.$in.forEach(id => {\n try {\n ids.push(mongoose.Types.ObjectId(id));\n } catch (e) {\n // invalid ID; drop from query\n }\n });\n }\n if (ids.length > 0) {\n query._motor = { $in: ids };\n run();\n } else {\n send([]);\n }\n }\n });\n}", "title": "" }, { "docid": "d0ec0ef409b45dcfbb0fa4b31fad7478", "score": "0.6109589", "text": "function downloadDocumentFile(myfile)\r\n{\r\n \r\n}", "title": "" }, { "docid": "c6fdf296b7770f656ee1663fc832d9f2", "score": "0.6101338", "text": "function getData(lat,lon, distance, fuelType, sortBy){\n\t\t// build up our URL string\n\t\t// /stations/radius/(Latitude)/(Longitude)/(distance)/(fuel type)/(sort by)/apikey.json?callback=?\n\t\tvar url = MYGASFEED_JSONP_URL;\n\t\turl += \"stations/radius/\"; // searches for stations within 'distance'\n\t\turl += lat + \"/\" + lon + \"/\";\n\t\turl += distance + \"/\" + fuelType + \"/\" + sortBy + \"/\";\n\t\turl += MYGASFEED_API_KEY;\n\t\turl += \".json?callback=?\";\n\t\t\n\t\t// call the web service, and download the file\n\t\tconsole.log(\"loading \" + url);\n\t\t$.getJSON(url).done(function(data){jsonLoaded(data);});\n\t}", "title": "" }, { "docid": "6c9c5fe22e7e6f2d7d095739f558f9d6", "score": "0.60974807", "text": "downloadData(name) {\n return JSON.parse( localStorage.getItem(name) );\n }", "title": "" }, { "docid": "6da4c81cca99ee3eaacbf2a9b32b6c91", "score": "0.6096533", "text": "function downloadJson() {\n if ($(\"#downloadPath\")[0].value) {\n $.ajax({\n url: $(\"#downloadPath\")[0].value,\n dataType: \"jsonp\",\n success: function(data) {\n global.globalJsonData = data;\n changePath(\"/\");\n }\n });\n }\n}", "title": "" }, { "docid": "4c1b8e108fa69ca774dfbbbcd6976394", "score": "0.60959536", "text": "async load_data() {\n const request = async () => {\n const response = await fetch(this.filename);\n const content = await response.text();\n return readString(content).data;\n }\n return request();\n }", "title": "" }, { "docid": "0696338f5b28b54b9ae8768517b8fd09", "score": "0.60917264", "text": "function downloadDataUri(options) {\n\t\tif (!options.url)\n\t\t\toptions.url = \"http://download-data-uri.appspot.com/\";\n\t\t$('<form method=\"post\" action=\"' + options.url\n\t\t\t+ '\" style=\"display:none\"><input type=\"hidden\" name=\"filename\" value=\"'\n\t\t\t+ options.filename + '\"/><input type=\"hidden\" name=\"data\" value=\"'\n\t\t\t+ options.data + '\"/></form>').appendTo('body').submit().remove();\n\t}", "title": "" }, { "docid": "0696338f5b28b54b9ae8768517b8fd09", "score": "0.60917264", "text": "function downloadDataUri(options) {\n\t\tif (!options.url)\n\t\t\toptions.url = \"http://download-data-uri.appspot.com/\";\n\t\t$('<form method=\"post\" action=\"' + options.url\n\t\t\t+ '\" style=\"display:none\"><input type=\"hidden\" name=\"filename\" value=\"'\n\t\t\t+ options.filename + '\"/><input type=\"hidden\" name=\"data\" value=\"'\n\t\t\t+ options.data + '\"/></form>').appendTo('body').submit().remove();\n\t}", "title": "" }, { "docid": "6de55e19af9021e07d5ceca7ab60be1f", "score": "0.6087197", "text": "function wrapDownload(){\n\tDajaxice.dropcloud.downloadWrapper(wrapperCallBack,{'tokenID': vars['t']});\n}", "title": "" }, { "docid": "6d21db37233f9dc716d9fac637ab8aa3", "score": "0.6080588", "text": "function download(url, callback) {\r\n http.get(url, function(res) {\r\n var data = \"\";\r\n res.on('data', function (chunk) {\r\n data += chunk;\r\n });\r\n res.on(\"end\", function() {\r\n callback(data);\r\n });\r\n }).on(\"error\", function() {\r\n callback(null);\r\n });\r\n}", "title": "" }, { "docid": "72f0bcbd19329f0faa94c6849e241cf2", "score": "0.6080424", "text": "function downloadData(name) {\n return JSON.parse( localStorage.getItem(name) );\n}", "title": "" }, { "docid": "d3f4bb606ae6a94c30e51b85a5b903c8", "score": "0.6076194", "text": "function getData(website) {\n var http = require('http');\n var request = require('request');\n var fs = require('fs');\n\n var baseURL = website;\n var options = {\n uri: baseURL,\n path: 'index.js',\n method: 'GET',\n followRedirect: true,\n maxRedirects: 20\n };\n\n\n request(options, function (error, response, body){\n if(error) {\n console.log(error.toString());\n }\n console.log(body);\n }).pipe(fs.createWriteStream('urbandictionary.htm'));\n\n\n}", "title": "" }, { "docid": "9041ca703f6861ffda85439a8a7454b2", "score": "0.6068072", "text": "static requestDownload() {\n // Download for the currently selected world\n if (window.dataManager.selectedWorld != null) {\n if (window.dataManager.selectedWorld.downloadArray.length > 0) {\n // Make request to download chunks\n window.dataManager.selectedServer.webSocketClient.webSocket.send(JSON.stringify({\n cmd : \"getChunksForPositions\",\n worldId : window.dataManager.selectedWorld.uuid,\n dataType: \"chunkPosition\",\n data : window.dataManager.selectedWorld.downloadArray\n }));\n // Clear request array\n window.dataManager.selectedWorld.downloadArray = [];\n }\n }\n }", "title": "" }, { "docid": "085ce113095a0d4f6dc53f3b2bbd9f5a", "score": "0.6058181", "text": "function downloadDataset(datasetInfo, callback){\n var datasetId = datasetInfo.dataset_ref;\n var download_url = datasetInfo.data_url;\n var dataset_dir = \"paca/datasets/\"+datasetInfo.format;\n var dataset_file = dataset_dir +\"/\"+datasetId;\n if(!fs.existsSync(dataset_dir)){\n fs.mkdirSync(dataset_dir);\n }\n datasetInfo.data_url = download_url;\n datasetInfo.filepath = dataset_file;\n // don't download if already downloaded.\n if(checkLocalDir && fs.existsSync(dataset_file)) {\n // console.log(\"getting dataset from local folder:\", datasetId);\n if(callback)\n callback(null, dataset_file);\n return;\n }\n // console.log(\"donwloading DataSet:\",datasetId);\n request(download_url,\n function(error, response, body){\n if(error){\n console.log(\">! DOWNLOAD ERROR\",error);\n if(callback)\n callback(error);\n return;\n }\n //console.log(datasetId, \"downloaded\");\n if(callback)\n callback(null, dataset_file);\n }\n ).pipe(fs.createWriteStream(dataset_file));\n}", "title": "" }, { "docid": "1193ed4ba3ab05ffce83ac8630ab897c", "score": "0.6057474", "text": "function getData() {\n var u = 'https://portal.opendata.dk/api/3/action/datastore_search?resource_id=5c458799-6926-456f-8629-158f0bf86927&sort=_id%20desc&limit=840'\n var xhr = new XMLHttpRequest();\n xhr.open('GET', u);\n xhr.send(null);\n\n xhr.addEventListener(\"load\", function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n var data = JSON.parse(xhr.response)\n if (data.result.records && data.result.records.length > 0) {\n _records = data.result.records;\n done()\n } else {\n err(\"Error loading data\")\n }\n } else {\n err(\"Error loading data\")\n }\n })\n\n xhr.addEventListener(\"error\", function (err) {\n error(err)\n })\n\n xhr.addEventListener(\"abort\", function (err) {\n error(err)\n })\n }", "title": "" }, { "docid": "3a5de6fce7679aebf63ef19216b2aee3", "score": "0.60523635", "text": "handleDownload(e,index,value){\n e.preventDefault();\n fetch('http://152.2.133.31:443/api/getCSV/'+this.state.sessionNo, {\n method: 'POST',\n headers: new Headers(\n {\"Content-Type\": \"application/json\"}\n ),\n body: JSON.stringify(this.state),\n }).then((result) =>{\n // csvReady=true;\n this.setState({'csvReady':true});\n return result.text();\n }).then((text) =>{\n download(text,this.state.currentFileName,\"text/csv\");\n });\n }", "title": "" }, { "docid": "6ad82f40f7380e6051754370401a8c91", "score": "0.6045568", "text": "function downloadFile(data, filename, type) {\n data = typeof (data) === 'object' ? data : [data];\n var file = new Blob(data, {\n type: type\n });\n if (window.navigator.msSaveOrOpenBlob) // IE10+\n window.navigator.msSaveOrOpenBlob(file, filename);\n else { // Others\n var a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n alert(\"下載成功\");\n }", "title": "" }, { "docid": "289200ee11dd3a2fb2dad43e59d2b59d", "score": "0.6042237", "text": "function getData() {\n dataCounter++;\n console.log(Date() + '- Getting data');\n var req = http.get('http://www.tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml', function (res) {\n // save the data\n var xml = '';\n res.on('data', function (chunk) {\n xml += chunk;\n });\n\n res.on('end', function () {\n console.log(Date() + '- Converting data to JSON');\n parseString(xml, function (err, result) {\n if (lastCallTimeStamp != result.stations['$'].lastUpdate) {\n lastCallTimeStamp = result.stations['$'].lastUpdate;\n stationsRealTime = result.stations['station'];\n saveData(result.stations['station']);\n } else {\n console.log(Date() + '- No new updates since last run');\n }\n });\n\n console.log(Date() + '- Finished data capture run: ' + dataCounter);\n });\n\n });\n\n req.on('error', function (err) {\n // debug error\n });\n}", "title": "" }, { "docid": "7b148f43d29f5793d86c165b706d8c7f", "score": "0.6041342", "text": "function getData(url) {\n return fetch(url); //fetches data from API url\n}", "title": "" }, { "docid": "59933b5357706e7bbe8b87d07efcaffd", "score": "0.6040585", "text": "async function export_plain_data()\n {\n const data = await bookmarks.get_front_node();\n const uri = encodeURIComponent(JSON.stringify(data));\n\n offer_download(uri, \"private_bookmarks.json\");\n }", "title": "" }, { "docid": "bbbb51247ef1a5fafd72851895946b36", "score": "0.60356593", "text": "function getData()\n{\n console.log(\"Connecting to PG-API\")\n // Set the headers\n var headers = {\n 'Content-Type': 'application/json'\n }\n\n // Configure the request\n var options = {\n url: 'http://chashuhotpot.sensorup.com/OGCSensorThings/v1.0/Datastreams(1701382)/Observations',\n method: 'GET',\n headers: headers,\n //qs: {'key1': 'xxx', 'key2': 'yyy'}\n }\n\n // Start the request\n request(options, function (error, response, body) {\n if (!error && response.statusCode == 200)\n {\n dlData();\n }\n else\n {\n console.log(\"error Connecting to server, not updating, server possibly dead\");\n }\n })\n}", "title": "" }, { "docid": "4dad90e3c87907e777f4c520efa2207d", "score": "0.60347533", "text": "downLoadData(){\n const data = this.outputJson(this.state);\n\n const element = document.createElement(\"a\");\n const file = new Blob([data], {type: 'text/plain'});\n element.href = URL.createObjectURL(file);\n element.download = \"block.json\";\n document.body.appendChild(element); // Required for this to work in FireFox\n element.click();\n }", "title": "" }, { "docid": "b5598ddd9dd3f0ba406c02d36bda44d7", "score": "0.6029902", "text": "function download(url, callback) {\n http.get(options, function(res) {\n var data = \"\";\n\tres.pipe(process.stdout); \n res.on('data', function (chunk) {\n data += chunk;\n });\n res.on(\"end\", function() {\n callback(data);\n });\n }).on(\"error\", function() {\n callback(null);\n }\n);\n}", "title": "" }, { "docid": "ea81e71eeb45590493f524ecbe967502", "score": "0.60176665", "text": "function downloadData(name) {\n return JSON.parse( (localStorage.getItem(name)) ? localStorage.getItem(name) : 0 );\n}", "title": "" }, { "docid": "c1afdb8fe90804ef97568a7feffaf8b6", "score": "0.601169", "text": "function download(url, callback) {\n http.get(url, function(res) {\n var data = \"\";\n res.on('data', function (chunk) {\n data += chunk;\n });\n res.on(\"end\", function() {\n callback(data);\n });\n }).on(\"error\", function() {\n callback(null);\n });\n}", "title": "" }, { "docid": "1f17058a043005796b691fbe8f729fc7", "score": "0.60109806", "text": "function fetchPublishedData () {\n request(DATA_URL, function (error, response, body) {\n if (error) console.error(error)\n var data = JSON.parse(body)\n var rowsUpdatedAt = new Date(data['rowsUpdatedAt'] * 1000)\n var filename = rowsUpdatedAt.toISOString().replace(/-/g, '').slice(0, 8)\n request(`${DATA_URL}/rows.csv`).pipe(fs.createWriteStream(`./input/${filename}.csv`))\n })\n}", "title": "" }, { "docid": "86fb5b836591d64dc3e73110b1267c54", "score": "0.6009934", "text": "function getData () {\n return fetch('http://example.com/movies.json');\n}", "title": "" }, { "docid": "98fe5052362a1f75d49792ef7532d166", "score": "0.60075945", "text": "function getDownloadParams(){\n var data = {};\n \n var particleTypes = document.getElementsByClassName(\"download-pm-type\");\n for(var i = 0; i < particleTypes.length; i++){\n if(particleTypes[i].checked){\n data[particleTypes[i].name] = true;\n }\n }\n \n var operations = document.getElementsByName(\"download-operation\");\n for(var i = 0; i < operations.length;i++)\n {\n if(operations[i].checked){\n data[\"operation\"] = operations[i].value;\n break;\n }\n }\n \n data[\"from-date\"] = document.getElementById(\"download-from-date\").value;\n data[\"from-time\"] = document.getElementById(\"download-from-time\").value;\n data[\"to-date\"] = document.getElementById(\"download-to-date\").value;\n data[\"to-time\"] = document.getElementById(\"download-to-time\").value;\n \n var box = document.getElementById(\"query-limit-value\");\n if(box.value != \"\"){\n data[\"limit\"] = box.value;\n }\n else{\n data[\"limit\"] = null;\n }\n \n data[\"ids\"] = cartLogic.listWorkingSet();\n data[\"filename\"] = document.querySelector(\"#query-filename-value\").value\n return data;\n }", "title": "" }, { "docid": "0104b09968d8b430d6b12091b61da855", "score": "0.6007096", "text": "function getJsonData(){\nurl1 = \"data/converted_2000_2016.json\";\nurl2 =\"data/converted_1999_1980.json\";\nurl3 =\"data/converted_1979_1966.json\";\n xhReq.open(\"GET\", url1, false);\n xhReq.send(null);\n reportOne = JSON.parse(xhReq.responseText);\n xhReq.open(\"GET\", url2, false);\n xhReq.send(null);\n reportTwo = JSON.parse(xhReq.responseText);\n xhReq.open(\"GET\", url3, false);\n xhReq.send(null);\n reportThree = JSON.parse(xhReq.responseText);\n}", "title": "" }, { "docid": "272b230a25a8caf1cfdbf4eeeaf7f7ed", "score": "0.6005589", "text": "function downloadFile(){\n chrome.storage.local.get(null, function(items) {\n var result = JSON.stringify(items);\n var url_result = 'data:application/json;base64,' + btoa(result);\n chrome.downloads.download({\n url: url_result,\n filename: 'hunt-urls.json'\n });\n // clear storage\n chrome.storage.local.clear()\n });\n}", "title": "" }, { "docid": "26516a5d13d3c18ceccdfd70cc8f6860", "score": "0.60013014", "text": "function getData() {\n if (app.offline) {\n globalEvents.trigger(\"data:ready\");\n return;\n }\n var oReq = new XMLHttpRequest();\n oReq.onerror = function (oEvent) { \n if(app.debug) { console.log(oEvent.toString()) };\n };\n oReq.onload = function (oEvent) {/*getdataCallback(elementId, statusId);*/\n if(app.debug) { console.log(oEvent.toString()) };\n };\n oReq.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n app.myData = JSON.parse(this.responseText);\n app.offline = false;\n globalEvents.trigger(\"data:ready\");\n } else if (this.readyState == 4 && this.status == 0) {\n app.offline = true;\n globalEvents.trigger(\"data:get-error\");\n }\n };\n //hValue = 'Basic ';\n //hValue += key;\n //alert('sending with header '+ hValue);\n oReq.open(\"get\", app.resourcesUrl, true);\n //oReq.withCredentials = true;\n //oReq.setRequestHeader(\"Authentication\", hValue);\n oReq.send(null);\n return false;\n}", "title": "" }, { "docid": "c7b8d5da539acd349778f484eaddc7a4", "score": "0.59991306", "text": "function downloadData(filename, text) {\n var element = document.createElement('a')\n element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(text))\n element.setAttribute('download', filename)\n\n element.style.display = 'none'\n document.body.appendChild(element)\n element.click()\n document.body.removeChild(element)\n}", "title": "" }, { "docid": "89d9b9ea2bd03f142d66f0cd68fa6fba", "score": "0.59985447", "text": "function download(data, filename, type) {\n var file = new Blob([data], {\n type: type\n });\n if (window.navigator.msSaveOrOpenBlob)\n // IE10+\n window.navigator.msSaveOrOpenBlob(file, filename);\n else {\n // Others\n var a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n }", "title": "" }, { "docid": "a66b6ea368fe434577caa3ba51b22015", "score": "0.59964776", "text": "function downloadData()\n{\n\tvar xTempScaleStart = linechart.xAxisRange()[0];\n\tvar xTempScaleEnd = linechart.xAxisRange()[1];\n\n\t//startElementIndex is the first chosen element index\n\tvar startElementIndex = Math.ceil(linechart.numRows()*(xTempScaleStart - xScaleStart)/xScale);\n\tvar endElementIndex = Math.floor(linechart.numRows()*(xTempScaleEnd - xScaleStart)/xScale);\n\n\td3.select(\".confirmButton\").append(\"p\")\n\t.text('the first element index is ' + startElementIndex + ', the last element index is ' + endElementIndex);\n\n\t//this is used to change data into csv file and download it\n\t//var data = [[\"Minsk\",100000,123], [\"Riga\",200000,321]];\n\tvar data = [];\n\tvar tempTuple = [];\n\n\t//push the lable into csv\n\tdata.push(['date','fish']);\t\n\n\t//double loop, out loop for rows, inner loop for columns\n\tfor(var rowNum = startElementIndex ; rowNum < endElementIndex ; rowNum = rowNum + 1)\n\t{\n\t\tfor(var colNum = 0 ; colNum < linechart.numColumns() ; colNum = colNum + 1)\n\t\t{\n\t\t\t//this means if the input value is not date\n\t\t\tif(colNum != 0)\n\t\t\t\ttempTuple.push(linechart.getValue(rowNum,colNum));\n\t\t\telse\n\t\t\t\ttempTuple.push(xAxisValue[rowNum]);\n\t\t}\n\t\tdata.push(tempTuple);\n\t\ttempTuple = [];\n\t}\n\n\talasql(\"SELECT * INTO CSV('modelOutput.csv') FROM ?\",[data]);\n}", "title": "" }, { "docid": "e579eec63a24f8ea6c2a68963fdf3e58", "score": "0.5991078", "text": "downloadData(event) {\n event.preventDefault();\n\n // turn it into a CSV string\n let file_contents = Papa.unparse({\n fields: this.state.allFields,\n data: this.state.enhancedData\n });\n \n // sent the file to the user to download\n // @TODO: work out better filename \n file_download(file_contents, 'test.csv', 'text/csv');\n\n }", "title": "" }, { "docid": "0cfa36c67e840e9952a13a2cfd760e27", "score": "0.59767896", "text": "function download(url, callback) {\n\tconsole.log('http request: ' + url);\n\n\trequest(\n\t\turl,\n\t\tfunction (err, res, body) {\n\t\tif (err) {\n\t\t\tconsole.log('err code: ' + err.code);\n\t\t\tconsole.log('err msg: ' + err.message);\n\t\t\tcallback(null);\n\t\t} else {\n\t\t\tcallback(body);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ac9ecb901829c0a639a2f263b6af7e4a", "score": "0.59739953", "text": "download(data, filename, type) {\n var file = new Blob([data], { type: type });\n if (window.navigator.msSaveOrOpenBlob) // IE10+\n window.navigator.msSaveOrOpenBlob(file, filename);\n else { // Others\n var a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n }", "title": "" }, { "docid": "f091ec6b653cfced6daf03c3393d0136", "score": "0.596918", "text": "function download(data, filename) {\n var file = new Blob([data], { type: 'text/plain' });\n\n // Create a download link for the file.\n var a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n\n // Apend it to the DOM.\n document.body.appendChild(a);\n // Click it to trigger a download.\n a.click();\n\n // Remove the created link.\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n}", "title": "" }, { "docid": "b45e0350c7f95eae1ee349385b2eac6d", "score": "0.5968369", "text": "function download(data, filename, type) {\r\n var file = new Blob([data], {type: type});\r\n if (window.navigator.msSaveOrOpenBlob) // IE10+\r\n window.navigator.msSaveOrOpenBlob(file, filename);\r\n else { // Others\r\n var a = document.createElement(\"a\"),\r\n url = URL.createObjectURL(file);\r\n a.href = url;\r\n a.download = filename;\r\n document.body.appendChild(a);\r\n a.click();\r\n setTimeout(function() {\r\n document.body.removeChild(a);\r\n window.URL.revokeObjectURL(url); \r\n }, 0); \r\n }\r\n}", "title": "" }, { "docid": "af9ebdfd13e16ae620faa324d35a11ea", "score": "0.5965839", "text": "function getData(url) {\n return fetch(url)\n }", "title": "" }, { "docid": "f4ced8d27d04e0ebf68196c084787734", "score": "0.596369", "text": "function download(data, filename, type) {\n var a = document.createElement(\"a\"),\n file = new Blob([data], {type: type});\n if (window.navigator.msSaveOrOpenBlob) // IE10+\n window.navigator.msSaveOrOpenBlob(file, filename);\n else { // Others\n var url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function() {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url); \n }, 0); \n }\n}", "title": "" }, { "docid": "8b69c264475709d84b8aaff7c36c834b", "score": "0.59620607", "text": "function getData() {\n return esriRequest(aedurl).then(function(response) {\n //console.log(response);\n return response;\n }).otherwise(function(error) {\n console.log('request failed, grabbing local feed');\n return esriRequest(\"scripts/aedfeed.json\", {responseType: \"json\"});\n });\n }", "title": "" }, { "docid": "e47803684696c51f72bdd33736e0fe64", "score": "0.5944091", "text": "function download1() {\r\n //JSON FIle\r\n //var jsonFile = getJSON();\r\n\r\n var a = document.getElementById('downloadFile1');\r\n //var file = new Blob([text], { type: type });\r\n a.href = URL.createObjectURL(outputFile);\r\n //a.href = URL.createObjectURL(jsonFile);\r\n a.download = fileName;\r\n}", "title": "" }, { "docid": "ea5e15e21962269a08b7bfec4e62bdff", "score": "0.5938727", "text": "function getGameDownloads(gameId) {\n var url = \"https://www.thegamecrafter.com/api/game/\" + gameId + \"/downloads\";\n\n $.ajax(url)\n .done(function (data) {\n if (data.result.items.length > 0) {\n var h = \"<p><div><b>Game Downloads</b></div><ul>\";\n\n $.each(data.result.items, function (index, item) {\n h += \"<li><a href='\" + item.file.file_uri + \"' target='_blank'>\" + item.file.name + \"</a></li>\";\n });\n\n h += \"</ul></p>\";\n\n $('.js-project-desc').append(h);\n }\n })\n .fail(function (err) {\n try {\n console.log(err);\n } catch (ex) { };\n });\n }", "title": "" }, { "docid": "91c5c1dfa448da0ba4dfe9278d9c2801", "score": "0.59332514", "text": "function download_pedidos_pd(){\n\t\t\t\n\t\t\tif(window.json_pd_dw){\n\t\t\t\tvar json_pd_dw_sl = window.json_pd_dw;\n\t\t\t} else if(window.json_pd_dw2){\n\t\t\t\tvar json_pd_dw_sl = window.json_pd_dw2;\n\t\t\t} else if(window.json_pd_dw3){\n\t\t\t\tvar json_pd_dw_sl = window.json_pd_dw3;\n\t\t\t} else if(window.json_pd_dw4){\n\t\t\t\tvar json_pd_dw_sl = window.json_pd_dw4;\n\t\t\t}\n\t\t\t\n\t\t\tif(json_pd_dw_sl){\n\t\t\t\t\n\t\t\t\tconect_bd_ep.transaction(function(sql){\n\t\t\t\t\t\n\t\t\t\t\tvar json_pd = json_pd_dw_sl;\n\t\t\t\t\tvar time_query_pd = json_pd.time_query_pd;\n\t\t\t\t\tvar total_pd = json_pd.total_pd;\n\t\t\t\t\t\n\t\t\t\t\t/* CHECAR ELEMENTOS == */\n\t\t\t\t\tif(json_pd.loop_pd){\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar loop_pd = json_pd.loop_pd;\n\t\t\t\t\t\tvar qnt_loop_pd = loop_pd.length;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar qnt_loop_pd = 0;\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(qnt_loop_pd);\n\t\t\t\t\t/* ATUALIZAR TIME DE CONSULTA == */\n\t\t\t\t\tif(time_query_pd.length > 0){\n\t\t\t\t\t\tlocalStorage.setItem('time_query_pd', time_query_pd);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(qnt_loop_pd > 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(var i=0;i<1;i++){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar id_pd = loop_pd[i].id_pd;\n\t\t\t\t\t\t\tvar cod_pd = loop_pd[i].cod_pd;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* CHECAR VISITAS == */\n\t\t\t\t\t\t\tsql.executeSql(\"SELECT * FROM pedidos_pd WHERE cod_pd='\"+cod_pd+\"'\", [], function (sql, resultados){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar total_pd_bd = resultados.rows.length;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar json_pd_post = '';\n\t\t\t\t\t\t\t\tvar pos_cod_pd_loop_pd = -1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor(var b=0;b<json_pd_post;b++){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* RETORNANDO DADOS DO BANCO DE DADOS == */\n\t\t\t\t\t\t\t\t\tvar cod_pd_bd = resultados.rows.item(b)[['cod_pd']];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* REFAZ O LOOP DE DADOS == */\n\t\t\t\t\t\t\t\t\tfor(var v=0;v<qnt_loop_pd;v++){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tvar loop_pd_lp = loop_pd[v];\n\t\t\t\t\t\t\t\t\t\tvar cod_pd = loop_pd[v].cod_pd;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif(cod_pd == cod_pd_bd){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tjson_pd_post = loop_pd_lp;\n\t\t\t\t\t\t\t\t\t\t\tpos_cod_pd_loop_pd = v;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\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\t\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\t/* REMOVE O ITEM DO LOOP_VI == */\n\t\t\t\t\t\t\t\tif(pos_cod_pd_loop_pd >= 0){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tloop_pd.splice(pos_cod_pd_loop_pd, 1);\n\t\t\t\t\t\t\t\t\tjson_vi.loop_vi = loop_pd;\n\t\t\t\t\t\t\t\t\tjson_vi_dw = json_pd;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* CHAMA A FUN��O NOVAMENTE PARA INSERIR OU ATUALIZAR == */\n\t\t\t\t\t\t\t\t\tdownload_pedidos_pd();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tjson_pd_post = loop_pd[0];\n\t\t\t\t\t\t\t\t\tloop_pd.splice(0, 1);\n\t\t\t\t\t\t\t\t\tjson_pd.loop_pd = loop_pd;\n\t\t\t\t\t\t\t\t\tjson_pd_dw = json_pd;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* CHAMA A FUN��O NOVAMENTE PARA INSERIR OU ATUALIZAR == */\n\t\t\t\t\t\t\t\t\tdownload_pedidos_pd();\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\t\n\t\t\t\t\t\t\t\t/* DADOS DO CLIENTE == */\n\t\t\t\t\t\t\t\tvar id_pd = json_pd_post.id_pd;\n\t\t\t\t\t\t\t\tvar cod_pd = json_pd_post.cod_pd;\n\t\t\t\t\t\t\t\tvar cod_pd_pd = json_pd_post.cod_pd_pd;\n\t\t\t\t\t\t\t\tvar vs_pd = json_pd_post.vs_pd;\n\t\t\t\t\t\t\t\tvar ordem_pd = 0;\n\t\t\t\t\t\t\t\tvar pg_pedido_pd = json_pd_post.pg_pedido_pd;\n\t\t\t\t\t\t\t\tvar prot_site_pd = json_pd_post.prot_site_pd;\n\t\t\t\t\t\t\t\tvar prot_usu_pd = json_pd_post.prot_usu_pd;\n\t\t\t\t\t\t\t\tvar prot_usu_rg_pd = json_pd_post.prot_usu_rg_pd;\n\t\t\t\t\t\t\t\tvar prot_usu_ent_pd = json_pd_post.prot_usu_ent_pd;\n\t\t\t\t\t\t\t\tvar prot_cliente_pd = json_pd_post.prot_cliente_pd;\n\t\t\t\t\t\t\t\tvar cod_ca_pd = json_pd_post.cod_ca_pd;\n\t\t\t\t\t\t\t\tvar tp_pessoa_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.tp_pessoa_pd);\n\t\t\t\t\t\t\t\tvar razao_social_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.razao_social_pd);\n\t\t\t\t\t\t\t\tvar nome_fantasia_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.nome_fantasia_pd);\n\t\t\t\t\t\t\t\tvar cnpj_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.cnpj_pd);\n\t\t\t\t\t\t\t\tvar insc_estadual_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.insc_estadual_pd);\n\t\t\t\t\t\t\t\tvar insc_municipal_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.insc_municipal_pd);\n\t\t\t\t\t\t\t\tvar nome_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.nome_pd);\n\t\t\t\t\t\t\t\tvar cpf_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.cpf_pd);\n\t\t\t\t\t\t\t\tvar email_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.email_pd);\n\t\t\t\t\t\t\t\tvar email_nf_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.email_nf_pd);\n\t\t\t\t\t\t\t\tvar telefone1_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.telefone1_pd);\n\t\t\t\t\t\t\t\tvar telefone2_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.telefone2_pd);\n\t\t\t\t\t\t\t\tvar celular1_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.celular1_pd);\n\t\t\t\t\t\t\t\tvar celular2_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.celular2_pd);\n\t\t\t\t\t\t\t\tvar endereco_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.endereco_pd);\n\t\t\t\t\t\t\t\tvar n_endereco_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.n_endereco_pd);\n\t\t\t\t\t\t\t\tvar complemento_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.complemento_pd);\n\t\t\t\t\t\t\t\tvar bairro_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.bairro_pd);\n\t\t\t\t\t\t\t\tvar cep_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.cep_pd);\n\t\t\t\t\t\t\t\tvar cidade_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.cidade_pd);\n\t\t\t\t\t\t\t\tvar estado_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.estado_pd);\n\t\t\t\t\t\t\t\tvar titulos_pr_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.titulos_pr_pd);\n\t\t\t\t\t\t\t\tvar data_prev_entrega_pd = json_pd_post.data_prev_entrega_pd;\n\t\t\t\t\t\t\t\tvar data_entrega_pd = json_pd_post.data_entrega_pd;\n\t\t\t\t\t\t\t\tvar sts_pd = json_pd_post.sts_pd;\n\t\t\t\t\t\t\t\tvar data_nf_pd = json_pd_post.data_nf_pd;\n\t\t\t\t\t\t\t\tvar n_nf_pd = json_pd_post.n_nf_pd;\n\t\t\t\t\t\t\t\tvar nf_pd = json_pd_post.nf_pd;\n\t\t\t\t\t\t\t\tvar time_pd = json_pd_post.time_pd;\n\t\t\t\t\t\t\t\tvar time_sts_pd = json_pd_post.time_sts_pd;\n\t\t\t\t\t\t\t\tvar time_cm_pd = json_pd_post.time_cm_pd;\n\t\t\t\t\t\t\t\tvar time_atualizado_pd = json_pd_post.time_atualizado_pd;\n\t\t\t\t\t\t\t\tvar time_update_pd = json_pd_post.time_update_pd;\n\t\t\t\t\t\t\t\tvar excluido_pd = json_pd_post.excluido_pd;\n\t\t\t\t\t\t\t\tvar sync_pd = 1;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* PROCESSAR IMPRESSÃO DE PEDIDO == */\n\t\t\t\t\t\t\t\tvar pd_impresso_pd = json_pd_post.pd_impresso_pd;\n\t\t\t\t\t\t\t\tvar prot_usu_pd_impresso_pd = json_pd_post.prot_usu_pd_impresso_pd;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* CONDIÇOES DO PEDIDO == */\n\t\t\t\t\t\t\t\t/* FORMAS DO PAGAMENTO == */\n\t\t\t\t\t\t\t\tvar cod_forma_pagamento_pd = json_pd_post.cod_forma_pagamento_pd;\n\t\t\t\t\t\t\t\tvar titulo_forma_pagamento_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.titulo_forma_pagamento_pd);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* CONDIÇAO DE PAGAMENTO == */\n\t\t\t\t\t\t\t\tvar cod_cond_pagamento_pd = json_pd_post.cod_cond_pagamento_pd;\n\t\t\t\t\t\t\t\tvar titulo_cond_pagamento_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.titulo_cond_pagamento_pd);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* FRETE == */\n\t\t\t\t\t\t\t\tvar cod_frete_pd = json_pd_post.cod_frete_pd;\n\t\t\t\t\t\t\t\tvar titulo_frete_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.titulo_frete_pd);\n\t\t\t\t\t\t\t\tvar valor_frete_pd = json_pd_post.valor_frete_pd;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* TRANSPORTADOR == */\n\t\t\t\t\t\t\t\tvar cod_transportador_pd = json_pd_post.cod_transportador_pd;\n\t\t\t\t\t\t\t\tvar titulo_transportador_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.titulo_transportador_pd);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* OBSERVAÇÃO == */\n\t\t\t\t\t\t\t\tvar observacao_pd = classApi.escapa_caracteres_sqlite_ep(json_pd_post.observacao_pd);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* PRODUTOS ADICIONADOS AO PEDIDO == */\n\t\t\t\t\t\t\t\tvar valor_pd = json_pd_post.valor_pd;\n\t\t\t\t\t\t\t\tvar total_pr_pd = json_pd_post.total_pr_pd;\n\t\t\t\t\t\t\t\tvar valor_total_pr_pd = json_pd_post.valor_total_pr_pd;\n\t\t\t\t\t\t\t\tvar loop_pr_pd = json_pd_post.loop_pr_pd;\n\t\t\n\t\t\t\t\t\t\t\tvar qnt_loop_pr_pd = loop_pr_pd.length;\n\t\t\t\t\t\t\t\tvar loop_pr_pd_temp = Array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor(var p=0;p<qnt_loop_pr_pd;p++){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar cod_pr = loop_pr_pd[p].cod_pr;\n\t\t\t\t\t\t\t\t\tvar cod_pr_pr = loop_pr_pd[p].cod_pr_pr;\n\t\t\t\t\t\t\t\t\tvar cod_pr_pr_pr = loop_pr_pd[p].cod_pr_pr_pr;\n\t\t\t\t\t\t\t\t\tvar cod_ca_pr = loop_pr_pd[p].cod_ca_pr;\n\t\t\t\t\t\t\t\t\tvar cod_ma_pr = loop_pr_pd[p].cod_ma_pr;\n\t\t\t\t\t\t\t\t\tvar foto_pr = loop_pr_pd[p].foto_pr;\n\t\t\t\t\t\t\t\t\tvar titulo_pr = loop_pr_pd[p].titulo_pr;\n\t\t\t\t\t\t\t\t\tvar texto_pr = loop_pr_pd[p].texto_pr;\n\t\t\t\t\t\t\t\t\tvar valor_pr = loop_pr_pd[p].valor_pr;\n\t\t\t\t\t\t\t\t\tvar quantidade_pr = loop_pr_pd[p].quantidade_pr;\n\t\t\t\t\t\t\t\t\tvar valor_total_pr = loop_pr_pd[p].valor_total_pr;\n\t\t\t\t\t\t\t\t\tvar excluido_pr = 0;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar array_pr_lp = {cod_pr:cod_pr, cod_pr_pr:cod_pr_pr, cod_pr_pr_pr:cod_pr_pr_pr, cod_ca_pr:cod_ca_pr, cod_ma_pr:cod_ma_pr, foto_pr:foto_pr, titulo_pr:titulo_pr, texto_pr:texto_pr, valor_pr:valor_pr, quantidade_pr:quantidade_pr, valor_total_pr:valor_total_pr, excluido_pr:excluido_pr};\n\t\t\t\t\t\t\t\t\tloop_pr_pd_temp.push(array_pr_lp);\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\t\n\t\t\t\t\t\t\t\tvar loop_pr_pd_post = JSON.stringify(loop_pr_pd_temp);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* LOOP DE COMENTÁRIOS == */\n\t\t\t\t\t\t\t\tvar loop_cm_pd = json_pd_post.loop_cm_pd;\n\t\t\t\t\t\t\t\tvar qnt_loop_cm_pd = loop_cm_pd.length;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor(var c=0;c<qnt_loop_cm_pd;c++){\n\n\t\t\t\t\t\t\t\t\tvar json_cm = loop_cm_pd[c];\n\t\t\t\t\t\t\t\t\tdownload_pedidos_pd_cm(sql, json_cm);\n\t\t\t\t\t\t\t\t\t\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\t\n\t\t\t\t\t\t\t\tif(total_pd_bd == 0){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* SALVAR DADOS == */\n\t\t\t\t\t\t\t\t\tsql.executeSql(\"INSERT INTO pedidos_pd (id_pd, cod_pd, cod_pd_pd, vs_pd, ordem_pd, pg_pedido_pd, prot_usu_pd, prot_usu_rg_pd, prot_usu_ent_pd, prot_cliente_pd, cod_ca_pd, tp_pessoa_pd, razao_social_pd, nome_fantasia_pd, cnpj_pd, insc_estadual_pd, insc_municipal_pd, nome_pd, cpf_pd, email_pd, email_nf_pd, telefone1_pd, telefone2_pd, celular1_pd, celular2_pd, endereco_pd, n_endereco_pd, complemento_pd, bairro_pd, cep_pd, cidade_pd, estado_pd, data_prev_entrega_pd, data_entrega_pd, time_pd, time_sts_pd, time_cm_pd, time_atualizado_pd, time_update_pd, cod_forma_pagamento_pd, titulo_forma_pagamento_pd, cod_cond_pagamento_pd, titulo_cond_pagamento_pd, cod_frete_pd, titulo_frete_pd, valor_frete_pd, cod_transportador_pd, titulo_transportador_pd, observacao_pd, valor_pd, total_pr_pd, valor_total_pr_pd, loop_pr_pd, titulos_pr_pd, sts_pd, data_nf_pd, n_nf_pd, nf_pd, pd_impresso_pd, prot_usu_pd_impresso_pd, excluido_pd, sync_pd) VALUES('\"+id_pd+\"', '\"+cod_pd+\"', '\"+cod_pd_pd+\"', '\"+vs_pd+\"', '\"+ordem_pd+\"', '\"+pg_pedido_pd+\"', '\"+prot_usu_pd+\"', '\"+prot_usu_rg_pd+\"', '\"+prot_usu_ent_pd+\"', '\"+prot_cliente_pd+\"', '\"+cod_ca_pd+\"', '\"+tp_pessoa_pd+\"', '\"+razao_social_pd+\"', '\"+nome_fantasia_pd+\"', '\"+cnpj_pd+\"', '\"+insc_estadual_pd+\"', '\"+insc_municipal_pd+\"', '\"+nome_pd+\"', '\"+cpf_pd+\"', '\"+email_pd+\"', '\"+email_nf_pd+\"', '\"+telefone1_pd+\"', '\"+telefone2_pd+\"', '\"+celular1_pd+\"', '\"+celular2_pd+\"', '\"+endereco_pd+\"', '\"+n_endereco_pd+\"', '\"+complemento_pd+\"', '\"+bairro_pd+\"', '\"+cep_pd+\"', '\"+cidade_pd+\"', '\"+estado_pd+\"', '\"+data_prev_entrega_pd+\"', '\"+data_entrega_pd+\"', '\"+time_pd+\"', '\"+time_sts_pd+\"', '\"+time_cm_pd+\"', '\"+time_atualizado_pd+\"', '\"+time_update_pd+\"', '\"+cod_forma_pagamento_pd+\"', '\"+titulo_forma_pagamento_pd+\"', '\"+cod_cond_pagamento_pd+\"', '\"+titulo_cond_pagamento_pd+\"', '\"+cod_frete_pd+\"', '\"+titulo_frete_pd+\"', '\"+valor_frete_pd+\"', '\"+cod_transportador_pd+\"', '\"+titulo_transportador_pd+\"', '\"+observacao_pd+\"', '\"+valor_pd+\"', '\"+total_pr_pd+\"', '\"+valor_total_pr_pd+\"', '\"+loop_pr_pd_post+\"', '\"+titulos_pr_pd+\"', '\"+sts_pd+\"', '\"+data_nf_pd+\"', '\"+n_nf_pd+\"', '\"+nf_pd+\"', '\"+pd_impresso_pd+\"', '\"+prot_usu_pd_impresso_pd+\"', '\"+excluido_pd+\"', '\"+sync_pd+\"')\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* ATUALIZAR DADOS == */\n\t\t\t\t\t\t\t\t\tsql.executeSql(\"UPDATE pedidos_pd SET prot_usu_ent_pd='\"+prot_usu_ent_pd+\"', prot_cliente_pd='\"+prot_cliente_pd+\"', ordem_pd='\"+ordem_pd+\"', cod_ca_pd='\"+cod_ca_pd+\"', razao_social_pd='\"+razao_social_pd+\"', nome_fantasia_pd='\"+nome_fantasia_pd+\"', cnpj_pd='\"+cnpj_pd+\"', insc_estadual_pd='\"+insc_estadual_pd+\"', insc_municipal_pd='\"+insc_municipal_pd+\"', nome_pd='\"+nome_pd+\"', cpf_pd='\"+cpf_pd+\"', email_pd='\"+email_pd+\"', email_nf_pd='\"+email_nf_pd+\"', telefone1_pd='\"+telefone1_pd+\"', telefone2_pd='\"+telefone2_pd+\"', celular1_pd='\"+celular1_pd+\"', celular2_pd='\"+celular2_pd+\"', endereco_pd='\"+endereco_pd+\"', n_endereco_pd='\"+n_endereco_pd+\"', complemento_pd='\"+complemento_pd+\"', bairro_pd='\"+bairro_pd+\"', cep_pd='\"+cep_pd+\"', cidade_pd='\"+cidade_pd+\"', estado_pd='\"+estado_pd+\"', data_prev_entrega_pd='\"+data_prev_entrega_pd+\"', data_entrega_pd='\"+data_entrega_pd+\"', cod_forma_pagamento_pd='\"+cod_forma_pagamento_pd+\"', titulo_forma_pagamento_pd='\"+titulo_forma_pagamento_pd+\"', cod_cond_pagamento_pd='\"+cod_cond_pagamento_pd+\"', titulo_cond_pagamento_pd='\"+titulo_cond_pagamento_pd+\"', cod_frete_pd='\"+cod_frete_pd+\"', titulo_frete_pd='\"+titulo_frete_pd+\"', valor_frete_pd='\"+valor_frete_pd+\"', cod_transportador_pd='\"+cod_transportador_pd+\"', titulo_transportador_pd='\"+titulo_transportador_pd+\"', titulos_pr_pd='\"+titulos_pr_pd+\"', total_pr_pd='\"+total_pr_pd+\"', valor_total_pr_pd='\"+valor_total_pr_pd+\"', loop_pr_pd='\"+loop_pr_pd_post+\"', valor_pd='\"+valor_pd+\"', sts_pd='\"+sts_pd+\"', data_nf_pd='\"+data_nf_pd+\"', n_nf_pd='\"+n_nf_pd+\"', nf_pd='\"+nf_pd+\"', pd_impresso_pd='\"+pd_impresso_pd+\"', prot_usu_pd_impresso_pd='\"+prot_usu_pd_impresso_pd+\"', time_pd='\"+time_pd+\"', time_sts_pd='\"+time_sts_pd+\"', time_cm_pd='\"+time_cm_pd+\"', time_atualizado_pd='\"+time_atualizado_pd+\"', time_update_pd='\"+time_update_pd+\"', excluido_pd='\"+excluido_pd+\"', sync_pd='\"+sync_pd+\"' WHERE cod_pd='\"+cod_pd+\"' AND sync_pd=1\");\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\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} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* EXECUTAR FUN��ES DE ERRO == */\n\t\t\t\t\t\tif(funcao_ep){\n\t\t\t\t\t\t\tnew funcao_ep;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* DELETAR VARI�VEL == */\n\t\t\t\t\t\tif(window.json_pd_dw){\n\t\t\t\t\t\t\tdelete json_pd_dw;\n\t\t\t\t\t\t} else if(window.json_pd_dw2){\n\t\t\t\t\t\t\tdelete json_pd_dw2;\n\t\t\t\t\t\t} else if(window.json_pd_dw3){\n\t\t\t\t\t\t\tdelete json_pd_dw3;\n\t\t\t\t\t\t} else if(window.json_pd_dw4){\n\t\t\t\t\t\t\tdelete json_pd_dw4;\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\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t/* CONECTAR A API == */\n\t\t\t\tvar tp_api_ep = 'pedidos_pd_ep';\n\t\t\t\tvar time_query_pd = localStorage.getItem('time_query_pd');\n\t\t\t\t\n\t\t\t\t$.post('http://api.empredi.com.br/pedidos', {tp_api_ep:tp_api_ep, prot_site_ep:prot_site_ep, time_update_ep:time_query_pd}, function(json){\n\t\t\t\t\n\t\t\t\t\t/* CRIAR VARI�VEL == */\n\t\t\t\t\tif(!window.json_pd_dw){\n\t\t\t\t\t\tjson_pd_dw = json;\t\n\t\t\t\t\t} else if(!window.json_pd_dw2){\n\t\t\t\t\t\tjson_pd_dw2 = json;\n\t\t\t\t\t} else if(!window.json_pd_dw3){\n\t\t\t\t\t\tjson_pd_dw3 = json;\n\t\t\t\t\t} else if(!window.json_pd_dw4){\n\t\t\t\t\t\tjson_pd_dw4 = json;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* CHAMAR NOVAMENTE A FUN��O DE DOWNLOAD == */\n\t\t\t\t\tdownload_pedidos_pd();\n\t\t\t\t\t\n\t\t\t\t}).fail(function(){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t/* EXECUTAR FUN��ES DE ERRO == */\n\t\t\t\t\tif(funcao_erro_ep){\n\t\t\t\t\t\tnew funcao_erro_ep;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "title": "" }, { "docid": "f7920a2000c38a98944a32910001c3d5", "score": "0.59171754", "text": "function downloadr(dat, filename, type) {\n var data = dat.map(itm => {\n return itm.toString().replace(/$/, '\\r');\n }).toString().replace(/\\r,/g, '\\r');\n var file = new Blob([data], {\n type: type\n });\n if (window.navigator.msSaveOrOpenBlob) {\n window.navigator.msSaveOrOpenBlob(file, filename);\n } else {\n var a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(() => {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 10);\n }\n}", "title": "" }, { "docid": "e0578fdba92cd045318fa80099aa43ba", "score": "0.591475", "text": "_handleRequestResourceListDownload(options)\n {\n //var mimetype = options.resource.get('resource_type_full').mimetype;\n //var ext = options.resource.get('resource_type_full').extension;\n// var filename = options.resource.get('name') + '.zip';\n // Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__TRANSFERMANAGER_DOWNLOAD, {url: options.resource.get('download'), filename: filename, mimetype: mimetype});\n }", "title": "" }, { "docid": "532ee0c4a5d1875b154267c6c0f94468", "score": "0.5914661", "text": "function download(data, filename = 'download.json', type = 'text/json') {\n if (!data) {\n console.error('No data provided to download()')\n return;\n }\n\n let blob = new Blob([data], {\n type: type\n })\n let e = document.createEvent('MouseEvents')\n let a = document.createElement('a')\n\n a.download = filename\n a.href = window.URL.createObjectURL(blob)\n a.dataset.downloadurl = [type, a.download, a.href].join(':')\n e.initMouseEvent('click', true, false, unsafeWindow, 0, 0, 0, 0, 0, false, false, false, false, 0, null)\n a.dispatchEvent(e)\n }", "title": "" }, { "docid": "79946eb5f33774738de296d876ebe227", "score": "0.59113336", "text": "function getData(url) {\n return fetch(url)\n}", "title": "" }, { "docid": "99f4e0b99dbb7bd66dbab36cbe23ad3f", "score": "0.59111065", "text": "function downloadResource(){\n\t$('.links p').click(function(){\n\t\tlet uniqueID = $(this).parent().find('input').val();\n\t\t// Calls Controller function\n\t\tdownloadFile(uniqueID);\n\t});\n}", "title": "" }, { "docid": "2a83fe1b129a8de99ceebd5eebf61d37", "score": "0.5899489", "text": "function downloadSyllabus ( url, student_id ) {\nvar syllabus_id, syllabus_name;\n\n\n // Load the syllabus page\n $.get(\"http://families.motherofdivinegrace.org\" + url, function ( data ) {\n // Extract the syllabus ID\n syllabus_id = /syllabi\\/(.+?)\\/assignments/g.exec(url)[1];\n // Write syllabus HTML to new file with syllabus ID as the name\n fs.writeFileSync('users/' + student_id + '/' + syllabus_id + '.html', data);\n });\n \n}", "title": "" }, { "docid": "9a8da71105610a112421731d8deec198", "score": "0.58890504", "text": "downloadReport() {\n\t\tlet that = this;\n\t\tlet data_to_be_posted = that.validateData();\n\t\tconsole.log('data_to_be_posted', data_to_be_posted);\n\t\tif(data_to_be_posted) {\n\t\t\tlet data_to_be_sent = {\n\t\t\t\tsub_category: data_to_be_posted['sub_category'],\n\t\t\t\tstations: data_to_be_posted['stations'],\n\t\t\t\tfrom_time: data_to_be_posted['from_time'],\n\t\t\t\tupto_time: data_to_be_posted['upto_time'],\n\t\t\t\tdata_type: data_to_be_posted['data_type'],\n\t\t\t\t//avg_data_time: data_to_be_posted['avg_data_time'],\n\t\t\t\tview_data_format: data_to_be_posted['view_data_format']\n\t\t\t};\n\t\t\tif (data_to_be_posted.avg_data_time) {\n\t\t\t\tif (!data_to_be_sent.avg_data_time) {\n\t\t\t\t\tdata_to_be_sent.avg_data_time = data_to_be_posted['avg_data_time'];\n\t\t\t\t} else {\n\t\t\t\t\tdata_to_be_sent.avg_data_time = data_to_be_posted['avg_data_time'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// console.log('data_to_be_posted', data_to_be_posted);\n\t\t\t// window.location = '##PR_STRING_REPLACE_API_BASE_PATH##' + 'download_archive_data.php?d='+ JSON.stringify(data_to_be_sent);\n\t\t\tlet download_str = that.serialize(data_to_be_sent);\n\t\t\tconsole.log('final query: ', download_str);\n\t\t\tthat.setState({download_file: true});\n\t\t\tlet download_window = window.open('##PR_STRING_REPLACE_API_BASE_PATH##/stations/download_report?' + download_str, '_blank');\n\t\t\tlet timer = setInterval(function() {\n\t\t\t\tif(download_window.closed) {\n\t\t\t\t\tclearInterval(timer);\n\t\t\t\t\tthat.setState({download_file: false});\n\t\t\t\t}\n\t\t\t}, 500);\n\t\t}\n\t}", "title": "" }, { "docid": "a5a564c7127fc4453d57b030875706cc", "score": "0.5887264", "text": "async function getData(params) {\n const hash = `${params.near.replace(' ', '')}-${params.cat}`\n const fileName = `./__mocks__/explore${hash}.html`\n\n if (fs.existsSync(fileName)) {\n return fs.readFileSync(fileName, \"utf-8\")\n\t}\n\n const { data } = await https.get(\"/explore\", { params });\n\tfs.writeFile(`./__mocks__/${hash}.html`, data, () => {})\n\n\treturn data;\n}", "title": "" }, { "docid": "9a9744201ac628a132a0f8626ec3d354", "score": "0.5880336", "text": "function download(data, filename, type) {\n var file = new Blob([data], {type: type});\n if (window.navigator.msSaveOrOpenBlob) // IE10+\n window.navigator.msSaveOrOpenBlob(file, filename);\n else { // Others\n var a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function() {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url); \n }, 0); \n }\n}", "title": "" }, { "docid": "59aa5338c8a335ea22c9fd1087bff703", "score": "0.5880128", "text": "function download(){\n console.log(\"Downloading\");\n $.ajax({\n url: \"https://www.prospectave.io:1738/status\",\n type: 'GET', \n contentType: 'json', \n success: function(res) {\n downloadSuccess(res);\n },\n error: function (xhr, status, error) {\n console.log(xhr);\n }\n }); \n}", "title": "" } ]
2722d1c1833d04558e49920b00501e05
Generates each answer with checkbox etc.
[ { "docid": "4f8cef5446ef623d708e077a79e2140d", "score": "0.0", "text": "renderAnswers() {\n let jsx: [] = [];\n\n let i = 1;\n this.answers.forEach((answer) => {\n jsx.push(\n <Row>\n <Column width={2}>\n <Form.Checkbox\n checked={answer.correct}\n onChange={(event) => {\n answer.correct = event.target.checked;\n this.updateParentState();\n }}\n ></Form.Checkbox>\n </Column>\n <Column>\n <Form.Input\n placeholder={`answer ${i}`}\n value={answer.answerText}\n onChange={(event) => {\n answer.answerText = event.currentTarget.value;\n this.updateParentState();\n }}\n ></Form.Input>\n </Column>\n </Row>\n );\n i++;\n });\n\n return jsx;\n }", "title": "" } ]
[ { "docid": "da8a4176df1c4695a0ac0f8d707430a0", "score": "0.76597065", "text": "function generateAnswers() {\n let currQuestion = store.questions[store.questionNumber].answers;\n let answersChoices = '';\n currQuestion.forEach(element => {\n answersChoices +=`\n <div class=\"answerList\">\n <input type=\"radio\" name=\"answer\" id=\"${element}\" value=\"${element}\" required>\n <label for=\"${element}\">${element}</label>\n </div>`\n });\n return answersChoices;\n}", "title": "" }, { "docid": "1b065922d89b7945b5d9157cbf79529a", "score": "0.7254142", "text": "function buildQuiz(){\n let output = [];\n\n //loop through myQuestions\n myQuestions.forEach(\n (currentQuestion, questionNumber) => {\n\n //store list of multiple choice answers\n let answers = [];\n\n // store each available answer\n for(letter in currentQuestion.answers){\n\n // add HTML binary button\n answers.push(\n `<label>\n <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n ${letter} :\n ${currentQuestion.answers[letter]}\n </label>`\n );\n }\n\n //add current question and its answers to HTML output\n output.push(\n `<div class=\"question\"> ${currentQuestion.question} </div>\n <div class=\"answers\"> ${answers.join('')} </div>`\n );\n }\n);\n\n quiz.innerHTML = output.join('');\n\n}", "title": "" }, { "docid": "f32830c2af58d036be458e52475e25ea", "score": "0.71228844", "text": "function generateAnswersHtml() {\n const answersArray = STORE.questions[STORE.currentQuestionNumber].answers\n let answersHtml = '';\n let i = 0;\n \n answersArray.forEach(answer => {\n answersHtml += `\n <div id=\"option-container-${i}\">\n <input type=\"radio\" name=\"options\" id=\"option${i + 1}\" value= \"${answer}\" tabindex =\"${i + 1}\" required> \n <label for=\"option${i + 1}\"> ${answer}</label>\n </div>\n `;\n i++;\n });\n return answersHtml;\n}", "title": "" }, { "docid": "1062f4dcbe61ae271b7bc8e90a834b71", "score": "0.7045313", "text": "function buildQuiz() {\r\n const output = [];\r\n\r\n myQuestions.forEach(\r\n (currentQuestion, questionNumber) => {\r\n\r\n const answers = [];\r\n // for each available answer\r\n for (letter in currentQuestion.answers) {\r\n\r\n // add an HTML radio button\r\n answers.push(\r\n `<label>\r\n <ul>\r\n <li class=\"answer\"><input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\r\n ${letter} :\r\n ${currentQuestion.answers[letter]}</li>\r\n </ul>\r\n </label>`\r\n );\r\n }\r\n // add this question and its answers to the output\r\n output.push(\r\n `<div class=\"question\"> ${currentQuestion.question} </div>\r\n <div class=\"answers\"> ${answers.join('<br>')}`\r\n );\r\n }\r\n );\r\n // put output on the page\r\n quizContainer.innerHTML = output.join('');\r\n}", "title": "" }, { "docid": "19e822d71f789f06c80b1157ebafa081", "score": "0.7012859", "text": "function generateAnswersHtml() {\n const answersArray = store.questions[store.currentQuestion].answers;\n let answersHtml = '';\n let index = 0;\n answersArray.forEach(answer => {\n answersHtml += `\n <div class=\"options\">\n <div class=\"answers\">\n <div id=\"option-container-${index}\">\n <input type=\"radio\" name=\"option\" id=\"option${index + 1}\" value=\"${answer}\" required>\n <label for=\"option${index +1}\">${answer}</label>\n </div>\n </div>\n </div>\n `;\n index++;\n });\n return answersHtml;\n}", "title": "" }, { "docid": "d65bf3beafdde48dcf2ed196c64fb091", "score": "0.69968975", "text": "function buildQuiz() {\n \n var output = [];\n \n myQuestions.forEach(function(currentQuestion, questionNumber) {\n \n var answers = [];\n \n for (letter in currentQuestion.answers) {\n answers.push(\n `<label>\n <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n ${letter} :\n ${currentQuestion.answers[letter]}\n </label>`\n );\n }\n \n output.push(\n `<div class=\"question\"> ${currentQuestion.question} </div>\n <div class=\"answers\"> ${answers.join(\"\")} </div>`\n );\n });\n \n quizContainer.innerHTML = output.join(\"\");\n }", "title": "" }, { "docid": "e1d875e240e2893ac65d20f068854f67", "score": "0.6891081", "text": "function generateQuestion(){\n updateQuestion();\n if (questionNum > 10) {\n return gameOver(); \n } else {\n let formTemplate = $(`<form class=\"question-form\">\n <fieldset class=\"answer-choice\">\n <legend id=\"current-question\">${STORE[questionNum-1].question}</legend>\n <div class=\"answer-box\"></div>\n <div class=\"answer-btn\"> \n <input class=\"btn\" type=\"submit\" value=\"Submit\">\n </div>\n </fieldset> \n </form>`);\n let answerBox = $(formTemplate).find('.answer-box')\n \n STORE[questionNum-1].answers.forEach(function (answer, index) {\n $(answerBox).append(`<label for=\"${index}\">\n <input type=\"radio\" id=\"${index}\" class=\"answer-text\" \n value=\"${answer}\" name=\"answer\" required>${answer}</label><br>`)\n }) \n\n return formTemplate;\n }\n}", "title": "" }, { "docid": "d02139e49a5da7d76a52f5b6b760f3b6", "score": "0.6880636", "text": "function generateAnswerTemplate(){\n const i = STORE.currentQuestion;\n return `\n <div class=\"group\">\n <p class=\"large-text\">${results}</p>\n <p><span class=\"correct-text\">correct answer:</span> ${STORE.questions[i].correctAnswer}</p>\n <div class=\"group\">\n <p class=\"correct-text\">correct <span class=\"text-yellow\">${score} / 6</span></p>\n </div>\n <div class=\"group\">\n <div class=\"explanation\" id=\"explanation-box\"> \n <p class=\"explanation-text\">${STORE.questions[i].explainMore}</p>\n </div>\n </div>\n <div-class=\"group\">\n <form action=\"/action_page.php\" method=\"get\">\n <div class=\"button-group\">\n <button id=\"next-button\" class=\"button\" type=\"submit\" value=\"next\">next.</button>\n </div>\n </form>\n </div>\n <footer>\n <h2 class=\"footer-copy\">© Copyright Devon Reihl and Trevor J Alt. All Rights Reserved.</h2>\n </footer>`;\n}", "title": "" }, { "docid": "beeac219bc1e03e49fc1ba464aab55ae", "score": "0.6865991", "text": "function buildQuiz() {\n // we'll need a place to store the HTML output\n const output = [];\n\n\n myQuestions.forEach((currentQuestion, questionNumber) => {\n // for each question...\n // set store for answers\n const answers = [];\n\n\n for (letter in currentQuestion.answers) {\n // and for each available answer...\n // add an HTML radio button\n answers.push(\n `<label>\n\t\t\t <!--(${letter})-->\n\t\t\t <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n ${currentQuestion.answers[letter]}\n </label>`\n );\n }\n\n // add this question and its answers to the output\n output.push(\n `<div class=\"slide\">\n <div class=\"question\"> ${currentQuestion.question} </div>\n <div class=\"answers\"> ${answers.join(\"\")} </div>\n </div>`\n );\n });\n\n // finally combine our output list into one string of HTML and put it on the page\n quizContainer.innerHTML = output.join(\" \");\n }", "title": "" }, { "docid": "c0aaeb9caa90d26a73798773081fe204", "score": "0.6827135", "text": "function generateQuestions (index) {\r\n //Select each question by passing it a particular index\r\n const question = questions[index];\r\n const option1Total = questions[index].answer1Total;\r\n const option2Total = questions[index].answer2Total;\r\n const option3Total = questions[index].answer3Total;\r\n const option4Total = questions[index].answer4Total;\r\n const option5Total = questions[index].answer5Total;\r\n //Populate html elements \r\n questionEl.innerHTML = `${index + 1}. ${question.question}`\r\n option1.setAttribute('data-total', `${option1Total}`);\r\n option2.setAttribute('data-total', `${option2Total}`);\r\n option3.setAttribute('data-total', `${option3Total}`);\r\n option4.setAttribute('data-total', `${option4Total}`);\r\n option4.setAttribute('data-total', `${option5Total}`);\r\n option1.innerHTML = `${question.answer1}`\r\n option2.innerHTML = `${question.answer2}`\r\n option3.innerHTML = `${question.answer3}`\r\n option4.innerHTML = `${question.answer4}`\r\n option5.innerHTML = `${question.answer5}`\r\n }", "title": "" }, { "docid": "109fd5ac53dcf94b6a5bcbbcebf53244", "score": "0.6819992", "text": "function generateQuizAnswers(questionNumber) {\n let answers = '';\n for (i = 0; i < store.questions[questionNumber].answers.length; i++) {\n answers += `\n <div class=\"answer-container\">\n <input type=\"radio\" id=\"answer-rad${i}\" name=\"answer-rad\" value=\"${store.questions[questionNumber].answers[i]}\" required=\"required\">\n <label for=\"answer-rad${i}\">${store.questions[questionNumber].answers[i]}</label>\n <br>\n </div>`;\n } \n return answers;\n}", "title": "" }, { "docid": "a8ce2b5002d52dc1106fcd62a1d845ba", "score": "0.6810895", "text": "function generateQuestion() {\n let html =\n renderQuestionHtml() + renderOptionsHtml() + '<button type=\"submit\">Submit</button></form></div>';\n $('.main').html(html);\n}", "title": "" }, { "docid": "d95ec8f99268bf8d3307c27150b8bdfa", "score": "0.6797546", "text": "function buildQuiz() {\n const output = [];\n // for each question...\n myQuestions.forEach((currentQuestion, questionNumber) => {\n // we'll want to store the list of answer choices\n const answers = [];\n // and for each available answer...\n for (letter in currentQuestion.answers) {\n // ...add an HTML radio button\n answers.push(\n `<label>\n <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n ${letter} :\n ${currentQuestion.answers[letter]}\n </label>`\n );\n }\n // add this question and its answers to the output\n output.push(\n `<div class=\"slide\">\n <div class=\"question\"> ${currentQuestion.question} </div>\n <div class=\"answers\"> ${answers.join(\"\")} </div>\n </div>`\n );\n });\n\n // finally combine our output list into one string of HTML and put it on the page\n quizContainer.innerHTML = output.join(\"\");\n }", "title": "" }, { "docid": "dafdd6279f0bd8d2efa29916ec6a8781", "score": "0.6790904", "text": "function buildQuiz(){\n\n const output = [];\n \n // loop through all the questions (objects)\n myQuestions.forEach(myFunction);\n\nfunction myFunction(item, index) {\n\n // this array stores all the answers in html format\n const answers = [];\n\n // Loop through all the answers in the current question\n for (x in item.answers) {\n\n \t// add an HTML radio button\n answers.push(\n `<label>\n <input type=\"radio\" name=\"question${index}\" value=\"${x}\">\n ${x} :\n ${item.answers[x]}\n </label>`\n );\n }\n\n// add this question and its answers to the output\n output.push(\n `<div class=\"question\"> ${item.question} </div>\n <div class=\"answers\"> ${answers.join('')} </div>`\n );\n\nquizContainer.innerHTML = output.join('');\n\n //document.getElementById(\"demo\").innerHTML += index + \":\" + item + \"<br>\"; \n}\n\n\n}", "title": "" }, { "docid": "d0ab0bbc5c998f877c3cacd9383d1573", "score": "0.67841846", "text": "generateAnswers(question, key){\n switch(question.type){\n case \"input\":\n return (\n <div className=\"answer\">\n <input type=\"text\" name={\"question_\" + key}/>\n </div>\n );\n case \"radio\":\n return (\n question.answer.map(answer =>\n <div className=\"answer\" key={answer.answerId}>\n <input type=\"radio\" id={\"question_\" + key + \"_answer_\" + answer.answerId} name={\"question_\" + key} value={answer.value}/>\n <label htmlFor={\"question_\" + key + \"_answer_\" + answer.answerId}>{answer.value}</label>\n </div>\n )\n );\n case \"checkbox\":\n return (\n question.answer.map(answer => \n <div className=\"answer\" key={answer.answerId}>\n <input type=\"checkbox\" id={\"question_\" + key + \"_answer_\" + answer.answerId} name={\"question_\" + key} value={answer.value}/>\n <label htmlFor={\"question_\" + key + \"_answer_\" + answer.answerId}>{answer.value}</label>\n </div>\n )\n );\n default: return null;\n }\n }", "title": "" }, { "docid": "8bd8dba897f1c8d48a581daef52afce2", "score": "0.6760131", "text": "function showQuestion(questions){\n questionElement.text(questions.question);\n correctAnswer = questions.answer;\n\n questions.choices.forEach(function(choice,choiceindex){\n // need to create new dom elements to append questions to. \n $('.answer-form').append(`\n <fieldset id=\"${choiceindex}\">\n <label for=\"${choiceindex}\"><input type=\"radio\" class=\"radio\" name=\"answer\" value=\"${choiceindex}\">\n ${choice}</label>\n </fieldset>\n `);\n });\n \n \n}", "title": "" }, { "docid": "30bc82f05bc2e5f64b4bebc57eed9e8c", "score": "0.6727936", "text": "function answers(){\n testAllQuestions(form);\n}", "title": "" }, { "docid": "2fd41b7b859d4343a1f42c7522461e11", "score": "0.67180127", "text": "function answerGen(count, answers) {\n if (qAndA.questCount === count) {\n ansBtn.forEach((button) => {\n button.textContent = answers[qAndA.counter];\n qAndA.counter++;\n // console.log(qAndA.counter);\n });\n qAndA.counter = 0;\n }\n}", "title": "" }, { "docid": "84aad41c4ffd846cbb45104d9aaaa95a", "score": "0.6709209", "text": "function generateQuestionView() { \n let questions = STORE.questions;\n let questionNumber = STORE.questionNumber;\n let answers = STORE.questions[questionNumber].answers;\n return `\n <p>Question: ${questionNumber + 1} of ${questions.length}</p>\n <p>Score: ${STORE.score}</p>\n \n <form class=\"question-form js-question-form\">\n <fieldset>\n <legend class=\"question\">${questions[questionNumber].title}</legend>\n <div class=\"answers\">\n <label for=\"answer-0\">\n <input type=\"radio\" id=\"answer-0\" name=\"answer\" value=\"0\" checked>\n ${answers[0]}\n </label>\n \n \n <label for=\"answer-1\">\n <input type=\"radio\" id=\"answer-1\" name=\"answer\" value=\"1\">\n ${answers[1]}\n </label>\n \n \n <label for=\"answer-2\">\n <input type=\"radio\" id=\"answer-2\" name=\"answer\" value=\"2\">\n ${answers[2]}\n </label>\n \n \n <label for=\"answer-3\">\n <input type=\"radio\" id=\"answer-3\" name=\"answer\" value=\"3\">\n ${answers[3]}</label>\n </div>\n </fieldset>\n <button class=\"submit-answer-button\"type=\"submit\">Submit</button>\n</form>\n`\n}", "title": "" }, { "docid": "ca5aec35d8458da6a9b7cf1d54726807", "score": "0.6683206", "text": "function generateQuestions (index) {\n console.log(index);\n // Select each question by giving it an index\n const fireOptionTotal = questions[index].fireAnswerTotal;\n const waterOptionTotal = questions[index].waterAnswerTotal;\n const earthOptionTotal = questions[index].earthAnswerTotal;\n const airOptionTotal = questions[index].airAnswerTotal;\n // Push questions to HTML\n questionText.innerHTML = questions[index].question;\n // Gives the total variables a data type so they can be stored as numbers\n fire_option.setAttribute('data-total', `${fireOptionTotal}`);\n water_option.setAttribute('data-total', `${waterOptionTotal}`);\n earth_option.setAttribute('data-total', `${earthOptionTotal}`);\n air_option.setAttribute('data-total', `${airOptionTotal}`);\n // Pushes possible answers to HTML\n fire_option.innerHTML = questions[index].fireAnswer;\n water_option.innerHTML = questions[index].waterAnswer;\n earth_option.innerHTML = questions[index].earthAnswer;\n air_option.innerHTML = questions[index].airAnswer;\n}", "title": "" }, { "docid": "3ba4b9c1aa8984978c4c9ad0dce1fe51", "score": "0.66775227", "text": "function generateQuestions (index) {\r\n //Select each question by passing it a particular index\r\n const question = questions[index];\r\n const option1Total = questions[index].answer1Total;\r\n const option2Total = questions[index].answer2Total;\r\n const option3Total = questions[index].answer3Total;\r\n const option4Total = questions[index].answer4Total;\r\n const option5Total = questions[index].answer5Total;\r\n //Populate html elements \r\n questionElNum.innerHTML = `${index + 1}.`\r\n questionEl.innerHTML = `${question.question}`\r\n option1.setAttribute('data-total', `${option1Total}`);\r\n option2.setAttribute('data-total', `${option2Total}`);\r\n option3.setAttribute('data-total', `${option3Total}`);\r\n option4.setAttribute('data-total', `${option4Total}`);\r\n option5.setAttribute('data-total', `${option5Total}`);\r\n option1.innerHTML = `${question.answer1}`\r\n option2.innerHTML = `${question.answer2}`\r\n option3.innerHTML = `${question.answer3}`\r\n option4.innerHTML = `${question.answer4}`\r\n option5.innerHTML = `${question.answer5}`\r\n}", "title": "" }, { "docid": "469d906751fd48bfa2d661131c46a1f1", "score": "0.6666425", "text": "function createAnswer() {\n // hide the start button\n $(\"#startButton\").hide();\n \n check()\n createQuestion();\n countDown();\n // create the answers div and add it to the questins\n $(\".trivia\").html('<div class=answers/></div>');\n\n // variable data\n var answers = questions[currentQ].answers;\n \n for (i = 0; i < answers.length; i++) {\n var choice = answers[i];\n $(\".answers\").append(\"<br>\" + '<button class= buttons id=' + i + '>' + choice + '</button>');\n }\n buttonClick();\n \n }// =========== end createAnswer ===========", "title": "" }, { "docid": "f50df3c7d1ac0c86148f01d216d25fbc", "score": "0.66427374", "text": "function generateQuestion () {\n if (questionNumber < STORE.length) {\n return `<div class=\"question-${questionNumber}\">\n <h2>${STORE[questionNumber].question}</h2>\n <form>\n <fieldset>\n <label class=\"answerOption\">\n <input type=\"radio\" value=\"${STORE[questionNumber].answers[0]}\" name=\"answer\" required>\n <span>${STORE[questionNumber].answers[0]}</span>\n </label>\n <label class=\"answerOption\">\n <input type=\"radio\" value=\"${STORE[questionNumber].answers[1]}\" name=\"answer\" required>\n <span>${STORE[questionNumber].answers[1]}</span>\n </label>\n <label class=\"answerOption\">\n <input type=\"radio\" value=\"${STORE[questionNumber].answers[2]}\" name=\"answer\" required>\n <span>${STORE[questionNumber].answers[2]}</span>\n </label>\n <label class=\"answerOption\">\n <input type=\"radio\" value=\"${STORE[questionNumber].answers[3]}\" name=\"answer\" required>\n <span>${STORE[questionNumber].answers[3]}</span>\n </label>\n <button type=\"submit\" class=\"submitButton\">Submit</button>\n </fieldset>\n </form>\n </div>`;\n /*if all questions have been answered\n render the results and option to restart\n the quiz*/\n} else {\n renderResults();\n restartQuiz();\n $('.questionNumber').text(10)\n }\n}", "title": "" }, { "docid": "99af35bdc5ae77fbfda9fe2a616893e9", "score": "0.6598011", "text": "function generateAnswerResults(answer) {\n let correctAnswer = store.questions[store.questionNumber].correctAnswer;\n\n\n if ($('input[name=\"answer-rad\"]:checked', '#mainForm').val() === correctAnswer) {\n \n $('main').html(`\n <div class=\"correct-screen\">\n <form>\n <p>You Were Correct!</p>\n <div class=\"next-btn\">\n <button id=\"next-question\" class=\"next-question\">Next</button> \n </div>\n </form>\n `);\n \n }\n else if ($('input[name=\"radios\"]:checked', '#mainForm').val() != correctAnswer){\n \n $('main').html(`\n <div class=\"incorrect-screen\">\n <form>\n <p>Wrong Answer!</p> \n <p>The correct answer is ${correctAnswer}.</p>\n <div class=\"next-btn\">\n <button id=\"next-question\" class=\"next-question\">Next</button> \n </div>\n </form>\n `);\n \n }\n }", "title": "" }, { "docid": "eee1fb68484fdd77babf4096b32244d6", "score": "0.65975845", "text": "function showAllAnswer() {\n _this.showAnswer = true;\n for (var i = 0; i <= _this.data.length; i++) {\n _this.queState[i] = true;\n document.getElementById(i + _this.ans[i]).checked = true;\n\n\n }\n\n }", "title": "" }, { "docid": "7cf472260c896cf4d3393bead274a0b1", "score": "0.65974164", "text": "function buildAnswers() {\n var questionInfo = test[testIndex];\n var possibleAnswers = questionInfo.answers;\n var correctAnswer = questionInfo.correct;\n\n for (var x = 0; x < possibleAnswers.length; x++) {\n var listEl = document.createElement(\"li\");\n var buttonEl =document.createElement(\"button\");\n\n buttonEl.textContent = possibleAnswers[x];\n\n if (possibleAnswers[x] == correctAnswer) {\n buttonEl.dataset.correct = \"true\";\n } else {\n buttonEl.dataset.correct = \"false\";\n }\n\n if (testIndex != 0) {\n buttonEl.addEventListener(\"click\", checkAnswer)\n }\n listEl.append(buttonEl);\n answerList.append(listEl);\n }\n}", "title": "" }, { "docid": "9aad3dd0d51c7821bd09dbedb8f2bb56", "score": "0.6580145", "text": "function createAnswers () {\n let a = questionCounter;\n for (let i = 0; i < questions[a].choices.length; i++) {\n let $answer = $('<li>', {id: `answer${i}`}).text(questions[a].choices[i]);\n $answer.appendTo('ol');\n }\n }", "title": "" }, { "docid": "1ef42f3942a1a2201e8705732ac7089e", "score": "0.6576171", "text": "function generateEachChoice(curQue,i){\n return `\n <input type=\"radio\", name=\"choice\", value=\"${i}\", id=\"${i}\", required=\"required\">\n <label for=\"${i}\", class=\"radioStyle\">${curQue.choices[i]}</label>\n <br>\n` ;\n}", "title": "" }, { "docid": "4c342efe44966fd94e1d978d222c8bc7", "score": "0.6574698", "text": "function renderAnswers() {\n let eachChoice = questions[currentQuestionIndex].choices;\n choices = document.querySelector(\".choices\");\n for (let q = 0; q < 4; q++) {\n choice = document.createElement(\"button\");\n choice.className = \"choice\";\n choice.innerHTML = eachChoice[q];\n choices.appendChild(choice);\n choice.addEventListener(\"click\", checkAnswer);\n }\n}", "title": "" }, { "docid": "47de461641b0a64e29f3b321e82f0520", "score": "0.6573519", "text": "function generateQuestions() {\n if(questionNumber < STORE.length) {\n return `<img class=\"questions-background\" src=\"./img/castle.jpg\" alt=\"portrait of castle\">\n <div class=\"numbers\">Question: ${questionNumber + 1} of 9</div>\n <form>\n <fieldset>\n <legend class=\"question-title\">${STORE[questionNumber].question}</legend>\n <div class=\"form-wrapper\">\n <label>\n <input\n type=\"radio\"\n name=\"answers\"\n value=\"${STORE[questionNumber].answers[0]}\"\n required>\n ${STORE[questionNumber].answers[0]}\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"answers\"\n value=\"${STORE[questionNumber].answers[1]}\"\n required>\n ${STORE[questionNumber].answers[1]}\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"answers\"\n value=\"${STORE[questionNumber].answers[2]}\"\n required>\n ${STORE[questionNumber].answers[2]}\n </label>\n <label>\n <input\n type=\"radio\"\n name=\"answers\" value=\"${STORE[questionNumber].answers[3]}\"\n required>\n ${STORE[questionNumber].answers[3]}\n </label>\n </div>\n <button type=\"button\" class=\"submit\">Submit</button>\n </fieldset>\n </form>\n <div class=\"tally numbers\">Score: <span class=\"score\">${tally}</span></div>`;\n } else {\n overallScore();\n }\n}", "title": "" }, { "docid": "3f3340e61be26a644b652d5fd99ef662", "score": "0.65712225", "text": "function answerDis() {\n\t$('#q1').append(\"<input type='radio' name='a1' value='1'/>\" + questions[0].a1[0]);\n\t$('#q2').append(\"<input type='radio' name='a2' value='1'/>\" + questions[1].a2[0]);\n\tfor (var i = 1; i < 4; i++) {\n\t\t// $('#q1').append(\"<button>\" + questions[0].a1[i]);\n\t\t// $('#q2').append(\"<button>\" + questions[1].a2[i]);\n\t\t$('#q1').append(\"<input type='radio' name='a1' value ='2'/>\" + questions[0].a1[i]);\n\t\t$('#q2').append(\"<input type='radio' name='a2' value ='2'/>\" + questions[1].a2[i]);\n\t}\n\n\t// register button clicks.\n\t// $(\"button\").on('click', function () {\n\t// \tconsole.log(this.innerText);\n\t// })\n}", "title": "" }, { "docid": "f004824aededecfdc383238376b1bdbf", "score": "0.6546139", "text": "function renderQandA() {\n\n var div = $(\"<div>\")\n for (var i = 0; i < questionsArr.length; i++) {\n var h3 = $(\"<h3>\").text(questionsArr[i].question)\n div.append(h3)\n\n for (var j = 0; j < questionsArr[i].possibleAnswers.length; j++) {\n var input = $(\"<input>\").attr(\"type\", \"radio\")\n .attr(\"value\", questionsArr[i].possibleAnswers[j])\n .attr(\"name\", \"q\" + (i + 1))\n .attr(\"class\", \"listOfAnswers\")\n .attr(\"data-index\", i)\n var label = $(\"<label>\").text(questionsArr[i].possibleAnswers[j])\n div.append(input, label)\n }\n $(\"#questionaire\").append(div)\n }\n\n }", "title": "" }, { "docid": "0a2ede7b70acf353188d365bd9db4d48", "score": "0.6542936", "text": "function generateQuestion() {\n let question = `<p class = 'question' >\n Question: ${store.questionNumber + 1} / 5 </p>\n <p>${store.questions[store.questionNumber].question}</p><p>SCORE:${\n store.score\n }/5</p>\n <form class = 'check-submited-answer'>`;\n for (\n let i = 0;\n i < store.questions[store.questionNumber].answers.length;\n i++\n ) {\n let newAnswers = store.questions[store.questionNumber].answers[i];\n question += ` <label>\n <input class = 'js-checkAnswer' type=\"radio\" name = 'radAnswer' value = '${newAnswers}'>\n <span id = 'focus' tabindex = '0'>${newAnswers}</span>\n </label>\n `;\n }\n question += `\n \n <div class = 'a-button-submit'>\n <button id = 'submit-button' tabindex = '0' class=\"next-button\" type=\"button\" value=\"submit\" hidden = 'true'> SUBMIT </button>\n </div>\n <div id = \"answer\" hidden> </div>\n </form>`;\n $('.Start').html('');\n $('.Start').html(question);\n}", "title": "" }, { "docid": "b4e6609ab47b986bd0e4abf058c93ba3", "score": "0.65277326", "text": "function generateQuestionsHTML(questions, inExam) {\n var html = '';\n var optionLetters = ['A', 'B', 'C', 'D'];\n for (var i = 0; i < questions.length; i++) {\n html += generateQuestionHTML(questions[i], inExam, i)\n }\n return html;\n}", "title": "" }, { "docid": "79820ff24abd77aff0b0989cf712b5c7", "score": "0.6527596", "text": "function generate(){\n\tq.innerHTML= data.questions[qIndex].question;\n\topt1.value= data.questions[qIndex].options[0];\n\topt2.value= data.questions[qIndex].options[1];\n\topt3.value= data.questions[qIndex].options[2];\n\topt4.value= data.questions[qIndex].options[3];\n}", "title": "" }, { "docid": "c84b9dd7fedf2bae598fbf4a8778b8cb", "score": "0.6493663", "text": "function generateQuestions() {\n finalEl.style.display = \"none\";\n if (currentQuestionIndex === finalQuestionIndex) {\n return displayScore();\n }\n var currentQuestion = questions[currentQuestionIndex];\n questionEl.innerHTML = \"<p>\" + currentQuestion.question + \"</p>\";\n button1.innerHTML = currentQuestion.choice1;\n button2.innerHTML = currentQuestion.choice2;\n button3.innerHTML = currentQuestion.choice3;\n button4.innerHTML = currentQuestion.choice4;\n}", "title": "" }, { "docid": "00dccefa8b82ee8002ae021c73965fa7", "score": "0.64868546", "text": "function constructAnswers(questionAnswers)\n{\n return questionAnswers.reduce(function(html,answer){\n return html += `<span class=\"question-row\"><input type=\"radio\" name=\"quiz-question\" value=\"${answer}\"/>\n <label>${answer}</label><br></span>`;\n },``);\n}", "title": "" }, { "docid": "02f8345a743373c99229704a8e8b4356", "score": "0.648663", "text": "function reflectAnswerOptions() {\r\n let checkbox = document.createElement(\"input\")\r\n checkbox.type = \"checkbox\"\r\n checkbox.id = `${i}${j}`\r\n checkbox.value = j + 1\r\n checkbox.onclick = receiveUsersAnswers\r\n let questionAnswerOptions = document.createElement(\"label\")\r\n questionAnswerOptions.textContent = quiz[i].answersOptions[j]\r\n questionAnswerOptions.style.fontFamily = \"Brush Script MT, Brush Script Std, cursive\"\r\n questionAnswerOptions.style.fontSize = \"120%\"\r\n let br = document.createElement(\"br\")\r\n document.getElementById(\"main\").append(checkbox, questionAnswerOptions, br)\r\n}", "title": "" }, { "docid": "073a95b39b07bba96b2e867bdfc52cde", "score": "0.64854586", "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": "e1554acc57e7e70de70b99fd380d8005", "score": "0.64838344", "text": "function testAllQuestions(answers){\n for(var i = 0; i < rightAnswers.length; i++){\n var buttons = i * 4;\n //The inner for loop will be checking through each answer choice to ensure that we have the correct answer\n //for(var it = 0; it < 4; it++){\n \n if(answers[i].value === rightAnswers[i]){\n correctAnswers++;\n }\n else if(answers[i].value !== rightAnswers[i]){\n incorrectAnswers++;\n }\n else{\n notAnswered++;\n }\n\n \n //}\n }\n\n finalResults();\n}", "title": "" }, { "docid": "1364f5ec98680c1e53e09d8fc17e8558", "score": "0.647352", "text": "function multipleChoice() {\n $(\"#fill-in-blank\").hide();\n $(\"#choices\").show();\n $(\"#hint\").hide();\n \n var questionType = parseInt(Math.random() * 2);\n var answerType = \"\";\n if (questionType == 0) {\n questionType = \"fr\";\n answerType = \"en\";\n } else {\n questionType = \"en\";\n answerType = \"fr\";\n }\n correct = randomQuestionGenerator(dataSet, answerType);\n var questionText = document.getElementById(\"problem-description\");\n var question = dataSet[correct.btnsInDataset[correct.posInBtn]][questionType]\n questionText.innerHTML = question;\n if (questionType == 'fr') {\n responsiveVoice.speak(question, 'French Female');\n }\n btnSubmit();\n}", "title": "" }, { "docid": "3eb83189a81c96f7fa21daee5ea1adc9", "score": "0.6470091", "text": "function getAnswers(question) {\n var returnValue = '';\n\n for(var letterKey in question.answers) {\n var answer = question.answers[letterKey];\n\n returnValue += generateButtons(letterKey, answer);\n\n }\n return returnValue;\n}", "title": "" }, { "docid": "71c29ec20ed3010d5aa9ee3f91a0fda4", "score": "0.6469699", "text": "function generateQuestions() {\n\n //If user has completed last question then exit\n if(questionNo === questionsObj.length )\n return;\n\n // Create div to hold question\n var $question = $(\"<div>\").addClass(\"form-group mt-3 pt-3 pl-5\");\n\n //Adding question to div\n $(\"<h4>\")\n .text(questionsObj[questionNo].question)\n .appendTo($question); \n\n //Adding question - image\n $(\"<img>\")\n .addClass('m-3')\n .attr(\"src\", questionsObj[questionNo].image)\n .attr(\"width\", 250)\n .appendTo($question);\n \n\n // Shuffle options\n questionsObj[questionNo].options = questionsObj[questionNo].options.sort(function() {\n return .5 - Math.random();\n });\n console.log(\"Shuffle options: \" + questionsObj[questionNo].options);\n\n // Create a loop to iterate through question's options and create radio buttons for each one\n for(var j=0 ; j<questionsObj[questionNo].options.length ; j++) {\n\n // Create a div for options and add bootstrap classes\n var $choice = $('<div>');\n $choice.addClass('form-check form-check-inline ml-3');\n\n \n // Create an input tag for the radio button\n var $radioInput = $('<input>');\n\n // Add attributes to provide the answer choice\n // the \"name\" attribute is super important, all radio buttons per question need to have the same \"name\" so they know which question it applies to\n $radioInput\n .attr({\n type: \"radio\",\n value: questionsObj[questionNo].options[j],\n name: questionNo,\n class: \"form-check-input pl-3\"\n })\n .appendTo($choice);\n\n\n // Create label to actually print the choice to the page\n var $choiceLabel = $('<label>');\n\n $choiceLabel\n .text(questionsObj[questionNo].options[j])\n .addClass('form-check-label pl-3')\n .appendTo($choice);\n\n // Add radio button choice to question\n $choice.appendTo($question);\n\n }\n\n //Appending all elements of the question to the respective div\n $(\"#question\").append($question);\n\n //Create a border between question and 'Submit button'\n $(\"#question\").css('border-bottom', 'solid 3px grey');\n\n\n //Create \"Submit\" button\n $(\"<button>\")\n .attr(\"type\", \"button\")\n .addClass(\"btn btn-info\")\n .append(`<h3>Submit</h3>`)\n .appendTo($(\"#submit\"));\n\n\n }//End of generateQuestions()", "title": "" }, { "docid": "daf58493001fcc279c551ebf74ed0212", "score": "0.64632386", "text": "function generate(){\n\t//get form values\n\tdifficulty = document.getElementById('difficulty').value;\n\tnumquestions = document.getElementById('numQuestions').value;\n\tif(difficulty == \"chapter\"){\n\t\tnumquestions = 50;\n\t}\n\t//check if # of questions is too large\n\tif(difficulty == \"beginner\" && numquestions > beginner.length){\n\t\tnumquestions = beginner.length;\n\t\twindow.alert(\"Test size too large. Lowering number of questions.\");\n\t}\n\tif(difficulty == \"simple\" && numquestions > simple.length){\n\t\tnumquestions = simple.length;\n\t\twindow.alert(\"Test size too large. Lowering number of questions.\");\n\t}\n\tif(difficulty == \"average\" && numquestions > average.length){\n\t\tnumquestions = average.length;\n\t\twindow.alert(\"Test size too large. Lowering number of questions.\");\n\t}\n\tif(difficulty == \"challenging\" && numquestions > challenging.length){\n\t\tnumquestions = challenging.length;\n\t\twindow.alert(\"Test size too large. Lowering number of questions.\");\n\t}\n\t//create an array of questions\n\tquestions = [];\n\t//try to prevent duplicate questions\n\tvar used = new Array();\n\tvar max;\n\tif(difficulty == \"beginner\"){\n\t\tmax = beginner.length;\n\t}\n\tif(difficulty == \"simple\"){\n\t\tmax = simple.length;\n\t}\n\tif(difficulty == \"average\"){\n\t\tmax = average.length;\n\t}\n\tif(difficulty == \"challenging\"){\n\t\tmax = challenging.length;\n\t}\n\tfor(var i = 0; i < max; i ++){\n\t\tused[i] = false;\n\t}\n\t//loop to fill questions array\n\tfor(var i = 0; i < numquestions; i ++){\n\t\tvar rand;\n\t\tif(difficulty == \"beginner\"){\n\t\t\tdo{ \n\t\t\t\trand = Math.floor(Math.random() * beginner.length);\n\t\t\t}\n\t\t\twhile(used[rand]);\n\t\t\tused[rand] = true;\n\t\t\tvar thisquestion = beginner[rand];\n\t\t}\n\t\telse if(difficulty == \"simple\"){\n\t\t\tdo{ \n\t\t\t\trand = Math.floor(Math.random() * simple.length);\n\t\t\t}\n\t\t\twhile(used[rand]);\n\t\t\tused[rand] = true;\n\t\t\tvar thisquestion = simple[rand];\n\t\t}\n\t\telse if(difficulty == \"average\"){\n\t\t\tdo{ \n\t\t\t\trand = Math.floor(Math.random() * average.length);\n\t\t\t}\n\t\t\twhile(used[rand]);\n\t\t\tused[rand] = true;\n\t\t\tvar thisquestion = average[rand];\n\t\t}\n\t\telse if(difficulty == \"challenging\"){\n\t\t\tdo{ \n\t\t\t\trand = Math.floor(Math.random() * challenging.length);\n\t\t\t}\n\t\t\twhile(used[rand]);\n\t\t\tused[rand] = true;\n\t\t\tvar thisquestion = challenging[rand];\n\t\t}\n\t\telse if(difficulty == \"chapter\"){\n\t\t\tif(i < 11){ // 10 beginner\n\t\t\t\trand = Math.floor(Math.random() * beginner.length);\n\t\t\t\tvar thisquestion = beginner[rand];\n\t\t\t}\n\t\t\telse if(i >= 11 && i < 26){ // 15 simple\n\t\t\t\trand = Math.floor(Math.random() * simple.length);\n\t\t\t\tvar thisquestion = simple[rand];\n\t\t\t}\n\t\t\telse if(i >= 26 && i < 46){ // 20 average\n\t\t\t\trand = Math.floor(Math.random() * average.length);\n\t\t\t\tvar thisquestion = average[rand];\n\t\t\t}\n\t\t\telse if(i >= 46 && i < 50){ // 5 challenging\n\t\t\t\trand = Math.floor(Math.random() * challenging.length);\n\t\t\t\tvar thisquestion = challenging[rand];\n\t\t\t}\n\t\t}\n\t\tquestions.push(thisquestion);\n\t}\n\t//output\n\tvar out = '<div class=\"adminDataSection nohover\" style=\"width:97.5%; padding-left:5%; padding-right:5%; padding-top:2.5%; padding-bottom: 2.5%\">';\n\tfor(var i = 0; i < numquestions; i ++){\n\t\tout = out + \"<form id='question\" + (i+1) + \"'><div class='form-group'><label>\" + (i+1) + \". \" + questions[i][0] + \"</label><br>\";\n\t\tout = out + \"<label><input type='radio' name='answer\" + (i+1) + \"' value='1'>\" + questions[i][1] + \"</label><br>\";\n\t\tout = out + \"<label><input type='radio' name='answer\" + (i+1) + \"' value='2'>\" + questions[i][2] + \"</label><br>\";\n\t\tout = out + \"<label><input type='radio' name='answer\" + (i+1) + \"' value='3'>\" + questions[i][3] + \"</label><br>\";\n\t\tout = out + \"<label><input type='radio' name='answer\" + (i+1) + \"' value='4'>\" + questions[i][4] + \"</label><br>\";\t\t \n\t\tout = out + \"</div></form>\";\n\t}\n\tout = out + \"<button id='submitButton' class='btn btn-primary' onclick='submitAnswers()'>Score</button><form target='hideframe' id='scoreForm' style='display:none;' method='post'><input type='number' id='scoreValue' name='scoreValue'><input type='number' id='testNumber' name='testNumber'></form></div>\";\n\tcontent.innerHTML = out;\n}", "title": "" }, { "docid": "363ab17943fec19754ed205e0dc3eed7", "score": "0.6461116", "text": "function generateSampleAnswer()\n {\n var newClue = new Array();\n newClue.attribute = parameterSelect.value;\n newClue.comparator = conditionSelect.value;\n newClue.quantity = conditionalArgument.value;\n if(!isInArray(newClue, questionGenerated.q1)) {\n questionGenerated.q1.push(newClue);\n }\n var correctImageSrc = \"\";\n var isValid = false;\n var fitCount = 0;\n var j =0;\n while(!isValid){\n shape = shapes.data[j];\n fitCount = 0;\n for(var clue in questionGenerated.q1){\n //Straight Sides\n if (questionGenerated.q1[clue].quantity == shape[questionGenerated.q1[clue].attribute] && questionGenerated.q1[clue].comparator == \"=\") {\n fitCount++;\n }\n else if (questionGenerated.q1[clue].quantity < shape[questionGenerated.q1[clue].attribute] && questionGenerated.q1[clue].comparator == \">\") {\n fitCount++;\n }\n else if (questionGenerated.q1[clue].quantity > shape[questionGenerated.q1[clue].attribute] && questionGenerated.q1[clue].comparator == \"<\") {\n fitCount++;\n }\n else\n break;\n }\n if(fitCount == questionGenerated.q1.length)\n {\n correctImageSrc=\"../Modules/Generators/version3/\"+shape.id;\n isValid = true;\n j=0;\n }\n if(j < shapes.data.length-1)\n j++;\n else {\n alert(\"No shape matching the given parameters were found.\");\n j=0;\n clearClues();\n break;\n }\n }\n if(isValid){\n document.getElementById(\"SampleCorrectAnswer\").style.opacity=\"100\";\n correctImage.src=correctImageSrc;\n output.innerHTML = \"{\\n\";\n for(var clue in questionGenerated.q1){\n for(var atr in questionGenerated.q1[clue]){\n output.innerHTML += (\"'\"+atr+\"' : '\"+questionGenerated.q1[clue][atr]+\"',\\n\");\n }\n }\n output.innerHTML +=\"}\";\n }\n \n }", "title": "" }, { "docid": "f51327423a8b2ce94ae688e49629c943", "score": "0.6441773", "text": "function makeAnswers(qradio) {\n // Hash the question text to get a unique name\n let qid = hashCode(qradio.getElementsByTagName(\"p\")[0].innerHTML)\n\n // Beautify each answer\n for (var label of qradio.getElementsByTagName(\"label\")) {\n let aid = hashCode(label.innerHTML + qid)\n\n label.setAttribute(\"for\", aid)\n\n let button = document.createElement(\"input\")\n button.setAttribute(\"type\", \"radio\")\n button.setAttribute(\"name\", qid)\n button.setAttribute(\"id\", aid)\n button.setAttribute(\"class\", label.getAttribute(\"class\"))\n\n qradio.insertBefore(button, label)\n }\n }", "title": "" }, { "docid": "9b34fea86e4c8f101fc9fe1243af8cac", "score": "0.64392567", "text": "function createQuiz() {\n const quiz = document.querySelector(\".quiz\");\n let quizText = \"\";\n for (let [index, question] of questions.entries()) {\n quizText += `<h2>${question.question}</h2>`;\n for (const property in question.answers) {\n quizText += `<p>\n <input type=\"radio\" name=\"Q${index}\" id=\"choice_${property}\" value=\"${property}\">\n <label for=\"choice_${property}\">${question.answers[property]}</label>\n </p>`;\n }\n }\n quiz.insertAdjacentHTML(\"afterbegin\", quizText);\n}", "title": "" }, { "docid": "480f18c743706b48057678c39d104d9c", "score": "0.6437728", "text": "function createPromptItems() {\n for (var i = 0; i < prompts.length; i++) {\n var inputlVal = prompts[i].prompt;\n var promptsVals = prompts[0].prompt_values;\n var promptsDiv = $(`<div class=\"questionCon\" id=\"div${i}\"></div>`)\n promptsDiv.append(`<p>${inputlVal}</p>`);\n $(\"#quiz\").append(promptsDiv);\n //for each option create a radio button that groups questions together\n for (var x = 0; x < promptsVals.length; x++) {\n var radioVal = prompts[i].prompt_values[x].value;\n var radioWeight = prompts[i].prompt_values[x].weight;\n var inputGroup = i;\n promptsDiv.append(\n `\n <label>\n <input class=\"form-check-input\" name=\"${inputGroup}\" type=\"radio\" value=\"${radioWeight}\">\n <span value=\"${radioVal}\" name=\"${inputGroup}\">${radioVal}</span>\n </label>\n \n `\n );\n \n }\n }\n}", "title": "" }, { "docid": "737ee54f63bde82b3564bd7670f34bb2", "score": "0.6413919", "text": "function generateQuestions() {\n questionArray.push(new question(\"What card has the following flavor text? <br><br> <em>'A blade that has never known sheath, a hilt that has never known hand.'</em>\", [\"Dancing Scimitar\", \"Sword of the Ages\", \"Whirling Dervish\", \"Blade Sentinel\"], \"dancing-scimitar.jpg\"));\n questionArray.push(new question(\"First printed in Alpha, is the only card with art painted by Faye Jones. It pictures a clown and a blindfolded humanoid fox balanced on a scale.\", [\"Stasis\", \"Jackal Pup\", \"Atog\", \"Noetic Scales\"], \"stasis.jpg\"));\n questionArray.push(new question(\"Which of these is NOT a creature type on the card Coiling Oracle?\", [\"Merfolk\", \"Snake\", \"Elf\", \"Druid\"], \"coiling_oracle.jpg\"));\n questionArray.push(new question(\"Which of these lands is both a Swamp and and Island\", [\"Underground Sea\", \"Overgrown Tomb\", \"Lonely Sandbar\", \"Bloodstained Mire\"], \"underground_sea.jpg\"));\n questionArray.push(new question(\"What card has the following flavor text? <br><br> <em>'I want a banana this big!'</em>\", [\"Gorilla Titan\", \"Tasigur, the Golden Fang\", \"Uktabi Orangutan\", \"Hyalopterous Lemure\"], \"gorilla_titan.jpg\"));\n questionArray.push(new question(\"What is the converted mana cost of the card Enlisted Wurm?\", [6, 5, 7, 8], \"enlisted_wurm.jpg\"));\n questionArray.push(new question(\"Besides Shaman, what creature type does Thundercloud Shaman have?\", [\"Giant\", \"Elf\", \"Elemental\", \"Goblin\"], \"thundercloud_shaman.jpg\"));\n questionArray.push(new question(\"How much damage does the card Pyroclasm do to each creature?\", [2, 3, 4, 1], \"pyroclasm.jpg\"));\n questionArray.push(new question(\"What is Lord of the Pit's power and toughness?\", [\"7/7\", \"6/6\", \"5/5\", \"8/8\"], \"lord_of_the_pit.jpg\"));\n questionArray.push(new question(\"What color is the card Volcanic Erruption\", [\"Blue\", \"Red\", \"Black\", \"Green\"], \"volcanic_erruption.jpg\"));\n}", "title": "" }, { "docid": "69020325a22c90c3fd18f3838a25e6e8", "score": "0.6411509", "text": "function createAnswers(answers){\n var length = answers.length\n for (i = 0; i < length; i++) {\n var answerButton = document.createElement(\"input\")\n answersSection.appendChild(answerButton)\n answerButton.setAttribute(\"data-correct\", answers[i].correct)\n answerButton.setAttribute(\"class\", \"answer\")\n answerButton.setAttribute(\"style\", \"margin: 5px;\")\n answerButton.setAttribute(\"type\", \"button\")\n answerButton.setAttribute(\"style\", \"margin: 5px; padding: 5px; background-color: rgb(168, 104, 241); width: 80%;\")\n \n answerButton.value = i+1+\". \"+answers[i].answer\n }\n}", "title": "" }, { "docid": "312e16ca25bb79d7d770564d0321d8f9", "score": "0.63967794", "text": "function updateAnswers () {\n let a = questionCounter;\n for (let i = 0; i < questions[a].choices.length; i++) {\n $(`#answer${i}`).text(questions[a].choices[i]);\n\n }\n }", "title": "" }, { "docid": "aba099c4c9514628c8aa3a14700f5e0e", "score": "0.63917565", "text": "function initialize() {\n \n for (var i = 0; i < questionArray.length; i++) {\n var question = document.createElement(\"p\")\n $(\"fieldset\").append(question);\n $(question).text(questionArray[i]);\n\n\n var fill1 = document.createElement(\"label\");\n var fill2 = document.createElement(\"label\");\n $(\"fieldset\").append(fill1, fill2);\n\n var data1 = document.createElement(\"input\");\n data1.setAttribute(\"type\", \"radio\");\n data1.setAttribute(\"id\", \"inputTrue\" + i);\n data1.setAttribute(\"name\", \"question\" + i);\n data1.setAttribute(\"value\", \"True\");\n $(fill1).text(\"True\");\n\n var data2 = document.createElement(\"input\");\n data2.setAttribute(\"type\", \"radio\");\n data2.setAttribute(\"id\", \"inputFalse\" + i);\n data2.setAttribute(\"name\", \"question\" + i);\n data2.setAttribute(\"value\", \"False\");\n $(fill2).text(\"False\");\n\n \n\n $(\"fieldset\").append(data1, data2)\n \n $(fill1).append(data1);\n $(fill2).append(data2);\n }\n\n}", "title": "" }, { "docid": "e776ce5e52f8de64e6c33852b47d7b84", "score": "0.63869303", "text": "generateChoices() {\n answerDiv.empty();\n let choicesArr = Object.values(this.questions[counter].choices);\n for (let i = 0; i < 4; i++) {\n let choiceButton = '<div class=\"row text-center\"> <a class=\"btn btn-primary answer-choice btn-lg mx-auto my-3\" href=\"#\" role=\"button\">' + choicesArr[i] + '</a> </div>';\n answerDiv.append(choiceButton);\n }\n }", "title": "" }, { "docid": "f4b1544275a274ce06ae50d13823a368", "score": "0.63780755", "text": "function renderQuestions() {\n\n chosenQ = questionArray.shift();\n questionElmnt.textContent = chosenQ.problem;\n\n answerArray = [chosenQ.solution, chosenQ.wrong1, chosenQ.wrong2, chosenQ.wrong3];\n shuffle(answerArray);\n\n for (j = 0; j < answerArray.length; j++) {\n answerboxArray[j].textContent = answerArray[j];\n }\n}", "title": "" }, { "docid": "6ee6d918a08c1205c5909ce54582ea1f", "score": "0.6375197", "text": "function choicesGenerator(choices) {\n\n var possibleAnswers = '';\n\n for (i = 0; i < choices.length; i++) {\n possibleAnswers += `<p class= \"choice\" data-answer=\"${choices[i]}\">${choices[i]}</p>`;\n }\n\n return possibleAnswers;\n\n}", "title": "" }, { "docid": "50e29cbdd3d9c11dbc2cddf03c30b89d", "score": "0.63639754", "text": "function setAnswerChoices(data){\n for (let i = 0; i < 4; i++){\n document.getElementById(\"answer\" + i).innerHTML = data['question'][\"shuffledAnswers\"][i];\n }\n}", "title": "" }, { "docid": "ea402b52185937374eaca846c9cf3ee3", "score": "0.63610405", "text": "function generateQuestion(){\r\n\r\n //Create container for question and answers\r\n container2 = document.createElement(\"div\");\r\n container2.style.display = \"block\";\r\n\r\n //Pick a random question from the array\r\n randomQuestionNum = Math.round(Math.random() * questionsArray.length - 1);\r\n if(randomQuestionNum < 0){\r\n randomQuestionNum++;\r\n }\r\n\r\n //Display random question\r\n var displayQuestion = document.createElement(\"h1\");\r\n displayQuestion.style.display = \"block\";\r\n displayQuestion.style.color = \"red\";\r\n displayQuestion.style.marginTop = \"0px\";\r\n displayQuestion.style.marginBottom = \"20px\";\r\n displayQuestion.setAttribute(\"id\",\"questionText\");\r\n displayQuestion.innerHTML = questionsArray[randomQuestionNum];\r\n container2.appendChild(displayQuestion);\r\n\r\n //Get answers associated with random question\r\n var loopObject = Object.values(answersArray[randomQuestionNum]);\r\n var available = loopObject.length;\r\n\r\n //Display all answers randomly \r\n for(var i = 0; i < available; i++){\r\n var randomAnswerNum = Math.round(Math.random() * loopObject.length - 1);\r\n if(randomAnswerNum < 0){\r\n randomAnswerNum++;\r\n }\r\n var displayAnswers = document.createElement(\"button\");\r\n displayAnswers.style.display = \"block\";\r\n displayAnswers.style.marginBottom = \"10px\";\r\n displayAnswers.style.border = \"none\";\r\n displayAnswers.style.padding = \"5px\";\r\n displayAnswers.style.marginLeft = \"auto\";\r\n displayAnswers.style.marginRight = \"auto\";\r\n displayAnswers.style.backgroundColor = \"#02FF36\";\r\n displayAnswers.style.fontWeight = \"bold\";\r\n displayAnswers.setAttribute(\"class\",\"response\")\r\n displayAnswers.innerHTML = loopObject[randomAnswerNum];\r\n loopObject.splice(randomAnswerNum,1);\r\n container2.appendChild(displayAnswers);\r\n }\r\n\r\n //Display question and answers\r\n questionContainer.appendChild(container2);\r\n\r\n //Check for correct answer\r\n handleInput();\r\n}", "title": "" }, { "docid": "ec206c319be5372273f2e6d143cfee78", "score": "0.634616", "text": "function generateQuestion() {\n if (questionNumber < quizQuestions.length) {\n return `<form role=\"form\" id=\"stark-quiz\" class=\"main-container\">\n <div class=\"main-box-1\">${quizQuestions[questionNumber].question}</div>\n <label class=\"main-box-2\">${quizQuestions[questionNumber].answers[0]}\n <input type=\"radio\" name=\"answer\" value=\"${quizQuestions[questionNumber].answers[0]}\" checked>\n <span class=\"checkmark\"></span>\n </label>\n <label class=\"main-box-2\">${quizQuestions[questionNumber].answers[1]}\n <input type=\"radio\" name=\"answer\" value=\"${quizQuestions[questionNumber].answers[1]}\">\n <span class=\"checkmark\"></span>\n </label>\n <label class=\"main-box-2\">${quizQuestions[questionNumber].answers[2]}\n <input type=\"radio\" name=\"answer\" value=\"${quizQuestions[questionNumber].answers[2]}\">\n <span class=\"checkmark\"></span>\n </label>\n <label class=\"main-box-2\">${quizQuestions[questionNumber].answers[3]}\n <input type=\"radio\" name=\"answer\" value=\"${quizQuestions[questionNumber].answers[3]}\">\n <span class=\"checkmark\"></span>\n </label>\n <button type=\"button\" class=\"submit-button\">Submit</button>\n </form>`;\n } else {\n renderResults();\n }\n}", "title": "" }, { "docid": "3d88bd16f5ea96972bb649916cb1c5e7", "score": "0.6337396", "text": "function generateQuiz() {\n\n // function showQuestions(questions, quizContainer) {\n // // we'll need a place to store the output and the answer choices\n // var output = [];\n // var answers;\n\n // // for each question...\n // for (var i = 0; i < questions.length; i++) {\n\n // // first reset the list of answers\n // answers = [];\n\n // // for each available answer...\n // for (letter in questions[i].answers) {\n\n // // ...add an html radio button\n // answers.push(\n // '<label>'\n // + '<input type=\"radio\" name=\"question' + i + '\" value=\"' + letter + '\">'\n // + letter + ': '\n // + questions[i].answers[letter]\n // + '</label>'\n // );\n // }\n\n // // add this question and its answers to the output\n // output.push(\n // '<div class=\"question\">' + questions[i].question + '</div>'\n // + '<div class=\"answers\">' + answers.join('') + '</div>'\n // );\n // }\n // // finally combine our output list into one string of html and put it on the page\n // .innerHTML = output.join('');\n // }\n // show questions right away\n // showQuestions(questions, quizContainer);\n // on submit, show results\n var startSection=document.getElementById('startScreen')\n startSection.classList.add(\"hidden\")\n var questionSection=document.getElementById('questions')\n questionSection.classList.remove(\"hidden\")\n document.getElementById('timer').innerHTML = time\n\n timer=setInterval(startTimer, 1000); \n showQuestions()\n}", "title": "" }, { "docid": "f14ffe7080a1dd96b8c2416fa7090d94", "score": "0.6336493", "text": "function generateAnswers(){\n\tfor(i=0; i<cant_respuestas; i++){\n\t\tvar aux = {};\n\t\taux.vel = velocidades[getRandNumber(velocidades.length)];\n\t\taux.vertangl = angulos[getRandNumber(angulos.length)];\n\t\taux.horangl = angulos_h[getRandNumber(angulos_h.length)];\n\t\trespuestas.push(aux);\n\t}\n}", "title": "" }, { "docid": "92dae6c61b9f14acbc597c704f3518e8", "score": "0.63275754", "text": "function Checkbox(){\n increment++;\n output[increment] = <Fragment><br />\n \n <label className=\"questions\">{j==0 ? exam[i].question:\"\"}</label><br />\n \n <label>{exam[i].answer.options[j].text}</label>\n <input type=\"checkbox\" name={exam[i].answer.name} value={exam[i].answer.options[j].name} />\n </Fragment>\n }", "title": "" }, { "docid": "82e60985efe0a997ef72e052367406da", "score": "0.63040555", "text": "function displayAnswers(){\n\n\t\t\t\t// Goes through the array of questions and\n\t\t\t\tfor(i = 0; i < array.length; i++){\n\t\t\t\t\t\n\t\t\t\t\t// puts each of questions object in the answerChecker function\n\t\t\t\t\tanswerChecker(array[i]);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "eafcd74053cdd7eb40f6784f052fbf0d", "score": "0.6302791", "text": "function next() {\n\n for (var i = 0; i < questions.length; i++) {\n var form = $(\"<div class='questform'></div>\")\n var question = $(\"<div class='question'>\" + questions[i] + \"</div>\");\n var answersChoice = $(\"<form class='answerChoice'></form>\");\n var firstAnswer = $(\"<span class='ans first'><input class='inans firstAnswer' type='radio' name='answer\" + i + \"' value='\" + answers[i][0] + \"' >\" + answers[i][0] + \"</span>\");\n var secondAnswer = $(\"<span class='ans second'><input class='inans secondAnswer' type='radio' name='answer\" + i + \"' value='\" + answers[i][1] + \"' >\" + answers[i][1] + \"</span>\");\n var thirdAnswer = $(\"<span class='ans third'><input class='inans thirdAnswer' type='radio' name='answer\" + i + \"' value='\" + answers[i][2] + \"' >\" + answers[i][2] + \"</span>\");\n var fourthAnswer = $(\"<span class='ans fourth'><input class='inans fourthAnswer' type='radio' name='answer\" + i + \"' value='\" + answers[i][3] + \"' >\" + answers[i][3] + \"</span>\");\n\n\n box.append(form);\n form.append(question).append(answersChoice);\n answersChoice.append(firstAnswer).append(secondAnswer).append(thirdAnswer).append(fourthAnswer);\n\n //end for loop\n }\n //END next()\n }", "title": "" }, { "docid": "6d8952c7cd542da9feff49ae32f1743f", "score": "0.62998676", "text": "function testIt (answers) {\n answers.forEach(item => {\n var answer = item.answer\n var search = item.search\n\n // ============================================================\n // Search/Answer fields checking\n // ============================================================\n if (!search || !answer) return\n\n if (typeof search !== 'string') return\n if (item.type === 'checkbox') {\n if (!(item.answer instanceof Array)) return\n } else {\n if (typeof search !== 'string') return\n }\n\n // ============================================================\n // Fill base on item type\n // ============================================================\n switch (item.type) {\n case 'radio':\n fillRadio(search, answer)\n break;\n case 'checkbox':\n fillCheckbox(search, answer)\n break;\n case 'input':\n fillInput(search, answer)\n break;\n case 'select':\n fillSelect(search, answer)\n break;\n }\n })\n\n console.log('Success. You passed', passedCount, 'tests.')\n }", "title": "" }, { "docid": "32e61149010332408b9b0144b2da36f7", "score": "0.6294833", "text": "function generateQuestion() {\n if (questionNumber < STORE.length) {\n return createForm(questionNumber);\n } else {\n $('.question-box').hide();\n results();\n }\n}", "title": "" }, { "docid": "d6bda90ca06ab7e3ca735e3a52bb96d5", "score": "0.62918234", "text": "function generateHTMLQuestion() {\n\n const question = STORE[questionNumber].question;\n const inputs = STORE[questionNumber].options.map(option => {\n console.log(option);\n return (`<input type='radio' name='question-input' id='${option}' value=\"${option}\" required />\n <label class='question-label' for='${option}'>${option}</label>`)\n }).join('')\n\n let questionHTML = $(`<form class='question-form'>\n <fieldset>\n <legend class= \"question-string\" required>${STORE[questionNumber].question}</legend>\n ${inputs}\n <input type='submit' />\n </form>`)\n\n return questionHTML;\n}", "title": "" }, { "docid": "1b08d5caffc93597ee5d44f855b2bfc9", "score": "0.6290488", "text": "function generateCorrectFeedback() {\n $('#container').html(correctFeedback);\n iterateCorrectAnswers();\n}", "title": "" }, { "docid": "2b6f46fa0f3e3017fab0c4d7e29436e8", "score": "0.6275375", "text": "function generateNextQuestions()\r\n{\r\n if(defaultQuestions[counter])\r\n {\r\n\t\tFirstQuestion.innerText = (counter+1) +\". \"+ defaultQuestions[counter].QuestionText; \r\n\t\tfirstAnswer.style.visibility = \"visible\";\r\n }\r\n else\r\n {\r\n FirstQuestion.innerText = \"\";\r\n firstAnswer.style.visibility = \"hidden\";\r\n }\r\n if(defaultQuestions[counter+1])\r\n {\r\n\t\tSecondQuestion.innerText = (counter+2) +\". \"+ defaultQuestions[counter+1].QuestionText;\r\n\t\tsecondAnswer.style.visibility = \"visible\";\r\n }\r\n else\r\n {\r\n SecondQuestion.innerText = \"\";\r\n secondAnswer.style.visibility = \"hidden\";\r\n }\r\n firstAnswer.value = \"\"; \r\n secondAnswer.value = \"\";\r\n \r\n }", "title": "" }, { "docid": "46d16e6996275f97b921a5682b1e93c2", "score": "0.6274011", "text": "function createOptions() {\n for (var j = 0; j < 4 ; j++) {\n\t\t$(\"#a\" + j).text(allQuestions[questionNum].choices[j]);\n }\n}", "title": "" }, { "docid": "fbbeba16bc3d38e9ca299b7359ae9af8", "score": "0.6272405", "text": "function generateHTMLQuestion(){\n if (questionNumber < STORE.length) {\n return `<div class=\"question-${questionNumber}\" id=${questionNumber}>\n <h2>${STORE[questionNumber].question}</h2>\n <form class=\"quiz-form\">\n <fieldset>\n <label class=\"answer-option\">\n <input type=\"radio\" value=\"${STORE[questionNumber].answers[0]}\" id=0 name=\"answer\" required>\n <span>${STORE[questionNumber].answers[0]}</span>\n </label>\n <label class=\"answer-option\">\n <input type=\"radio\" value=\"${STORE[questionNumber].answers[1]}\" id=1 name=\"answer\" required>\n <span>${STORE[questionNumber].answers[1]}</span>\n </label>\n <label class=\"answer-option\">\n <input type=\"radio\" value=\"${STORE[questionNumber].answers[2]}\" id=2 name=\"answer\" required>\n <span>${STORE[questionNumber].answers[2]}</span>\n </label>\n <label class=\"answer-option\">\n <input type=\"radio\" value=\"${STORE[questionNumber].answers[3]}\" id=3 name=\"answer\" required>\n <span>${STORE[questionNumber].answers[3]}</span>\n </label>\n <button type=\"submit\" class=\"submit-button\">Submit</button>\n </fieldset>\n </form>\n </div>`;\n }else{\n handleFinalQuizResults();\n handleQuizRestart();\n }\n }", "title": "" }, { "docid": "c9354b7346479b0f1b4edeebcee6bfd3", "score": "0.62638485", "text": "function CreateExam(Array_Of_Objects) {\r\n var numbers = [];\r\n var randomIQ = [];\r\n for (var i = 0; i < Array_Of_Objects.length; i++) {\r\n randomindex = Math.floor(Math.random() * Array_Of_Objects.length);\r\n var check = numbers.includes(randomindex);\r\n\r\n if (check === false) {\r\n numbers.push(randomindex);\r\n randomIQ.push(Array_Of_Objects[randomindex]);\r\n } else {\r\n while (check === true) {\r\n randomindex = Math.floor(Math.random() * Array_Of_Objects.length);\r\n check = numbers.includes(randomindex);\r\n if (check === false) {\r\n numbers.push(randomindex);\r\n randomIQ.push(Array_Of_Objects[randomindex]);\r\n }\r\n }\r\n }\r\n }\r\n RandomQuestions = randomIQ;\r\n CorrectQuestions = 0;\r\n WrongQuestions = 0;\r\n// Create Elements of All Questions Start\r\n if ($('.Question-area').has('div.choice').length == 0) {\r\n for (let x = 0; x < randomIQ.length; x++) {\r\n $('.Question').append('<span style=\"display: none\" class=\"Question Question_' + x + '\"></span>');\r\n\r\n }\r\n for (let y = 0; y < randomIQ.length; y++) {\r\n $('.answers-box').append(\r\n '<div style=\"display: none\" class=\"answer answer_' + y + '\"></div>'\r\n )\r\n $('.answer_' + y).append(\r\n '<div class=\"choice choice_1\">' +\r\n '<input id=\"q' + y + '-c0-input\" name=\"choose_' + y + '\" type=\"radio\">' +\r\n '<label for=\"q' + y + '-c0-input\" id=\"q' + y + '-c0-label\"></label>' +\r\n '</div>',\r\n '<div class=\"choice choice_2\">' +\r\n '<input id=\"q' + y + '-c1-input\" name=\"choose_' + y + '\" type=\"radio\">' +\r\n '<label for=\"q' + y + '-c1-input\" id=\"q' + y + '-c1-label\"></label>' +\r\n '</div>',\r\n '<div class=\"choice choice_3\">' +\r\n '<input id=\"q' + y + '-c2-input\" name=\"choose_' + y + '\" type=\"radio\">' +\r\n '<label for=\"q' + y + '-c2-input\" id=\"q' + y + '-c2-label\"></label>' +\r\n '</div>',\r\n '<div class=\"choice choice_4\">' +\r\n '<input id=\"q' + y + '-c3-input\" name=\"choose_' + y + '\" type=\"radio\">' +\r\n '<label for=\"q' + y + '-c3-input\" id=\"q' + y + '-c3-label\"></label>' +\r\n '</div>'\r\n )\r\n }\r\n }\r\n //Fill Questions\r\n\r\n for (let d = 0; d < randomIQ.length; d++) {\r\n $('.Question_' + d).append(randomIQ[d].QuestionText)\r\n if (randomIQ[d].QuestionType == 2) {\r\n $('#q' + d + '-c0-input').attr(\"type\", \"checkbox\");\r\n $('#q' + d + '-c1-input').attr(\"type\", \"checkbox\");\r\n $('#q' + d + '-c2-input').attr(\"type\", \"checkbox\");\r\n $('#q' + d + '-c3-input').attr(\"type\", \"checkbox\");\r\n $('#q' + d + '-c0-input').attr(\"value\", randomIQ[d].Answers[0]);\r\n $('#q' + d + '-c1-input').attr(\"value\", randomIQ[d].Answers[1]);\r\n $('#q' + d + '-c2-input').attr(\"value\", randomIQ[d].Answers[2]);\r\n $('#q' + d + '-c3-input').attr(\"value\", randomIQ[d].Answers[3]);\r\n $('#q' + d + '-c0-label').text(randomIQ[d].Answers[0]);\r\n $('#q' + d + '-c1-label').text(randomIQ[d].Answers[1]);\r\n $('#q' + d + '-c2-label').text(randomIQ[d].Answers[2]);\r\n $('#q' + d + '-c3-label').text(randomIQ[d].Answers[3]);\r\n } else {\r\n $('#q' + d + '-c0-input').attr(\"type\", \"radio\");\r\n $('#q' + d + '-c1-input').attr(\"type\", \"radio\");\r\n $('#q' + d + '-c2-input').attr(\"type\", \"radio\");\r\n $('#q' + d + '-c3-input').attr(\"type\", \"radio\");\r\n $('#q' + d + '-c0-input').attr(\"value\", randomIQ[d].Answers[0]);\r\n $('#q' + d + '-c1-input').attr(\"value\", randomIQ[d].Answers[1]);\r\n $('#q' + d + '-c2-input').attr(\"value\", randomIQ[d].Answers[2]);\r\n $('#q' + d + '-c3-input').attr(\"value\", randomIQ[d].Answers[3]);\r\n $('#q' + d + '-c0-label').text(randomIQ[d].Answers[0]);\r\n $('#q' + d + '-c1-label').text(randomIQ[d].Answers[1]);\r\n $('#q' + d + '-c2-label').text(randomIQ[d].Answers[2]);\r\n $('#q' + d + '-c3-label').text(randomIQ[d].Answers[3]);\r\n }\r\n }\r\n DisplayQuestions(QuestionIndex);\r\n}", "title": "" }, { "docid": "f8645303f474486adc0ac19986150ff5", "score": "0.6261052", "text": "function createQuestions() {\n\t $('#fade').fadeIn('slow');\n\t// unselect all radiobuttons at the start\n\tfor (var i = 0; i<4; i++) {\n\t\t$(\"#answer\" + i).prop('checked', false);\n\t}\n\t$(\"#questions\").text(allQuestions[questionNum].question);\n\tcreateOptions();\n}", "title": "" }, { "docid": "5eb0edc308d8e2d44ed6a6d0821fb488", "score": "0.6260293", "text": "function renderOptions(questionNumber) {\n questions[questionNumber].answers.forEach(answer => {\n var button = document.createElement(\"button\")\n button.textContent = answer.text\n button.classList.add('btn')\n button.addEventListener(\"click\", checkAnswer)\n answerSpot.appendChild(button)\n\n })\n}", "title": "" }, { "docid": "6f29e4e0478b158dc2d6ccc07c6819b7", "score": "0.6256909", "text": "function generateQuestion() {\r\n firstNumber = getRandomNumber();\r\n secondNumber = getRandomNumber();\r\n questionBox.textContent = firstNumber + \" x \" + secondNumber;\r\n generateOptions(firstNumber, secondNumber);\r\n}", "title": "" }, { "docid": "9a3c0ef2042246759ee1279342bccf0b", "score": "0.62546813", "text": "function buildQuiz() {\n questionElement.innerHTML = question;\n let answerHTML = ``;\n for (let answer of answers) {\n let rowHTML = `<button class = \"btn\" onclick=\"nextQuestion(this)\">${answer}</button>`;\n answerHTML += rowHTML;\n }\n document.getElementById(\"answer-container\").innerHTML = answerHTML;\n}", "title": "" }, { "docid": "ba67cef78fdc2d6bef04d59d7f698612", "score": "0.624618", "text": "async function uniformData() {\n\n // iterate over all question data sets\n await $.asyncForEach( self.questions, async ( question, i ) => {\n\n // each question knows her original number and HTML ID\n question.nr = i + 1; question.id = 'question-' + question.nr;\n\n // consider default values for question data from instance config\n self.questions[ i ] = question = await $.integrate( $.filterProperties( self, 'text', 'description', 'answers', 'input', 'attributes', 'swap', 'escape', 'random', 'solution' ), question, true );\n\n // default input type is checkbox\n if ( !question.input ) question.input = 'checkbox';\n\n // set default information about correct answers\n if ( !question.solution && question.input !== 'radio' ) question.solution = [];\n\n // answer data sets could be given as single string (answer text) instead of object\n for ( i = 0; i < question.answers.length; i++ )\n if ( !$.isObject( question.answers[ i ] ) )\n question.answers[ i ] = { text: question.answers[ i ] };\n\n // information about correct answers of a multiple choice question could be given as integer array instead of boolean array\n if ( question.input === 'checkbox' && typeof question.solution[ 0 ] === 'number' ) {\n const solution = [];\n for ( i = 0; i < question.answers.length; i++ )\n solution.push( question.solution.indexOf( i ) >= 0 );\n question.solution = solution;\n }\n\n // fill up array of information about correct answers with default values (checkbox -> false, otherwise empty string)\n if ( Array.isArray( question.solution ) )\n for ( i = 0; i < question.answers.length; i++ )\n if ( question.solution[ i ] === undefined )\n question.solution[ i ] = question.input === 'checkbox' ? false : '';\n\n // iterate over all answers\n await $.asyncForEach( question.answers, async ( answer, i ) => {\n\n // each answer knows her original number, HTML class and HTML ID\n answer.nr = i + 1; answer.class = 'answer-' + answer.nr; answer.id = question.id + '-' + answer.class;\n\n // information about correct answers of a question could be given via answer data\n if ( answer.correct !== undefined )\n if ( question.input === 'radio' ) {\n if ( answer.correct === true ) question.solution = i;\n }\n else\n question.solution[ i ] = question.input === 'number' ? parseInt( answer.correct ) : answer.correct;\n\n // consider default values for answer data from question data\n question.answers[ i ] = await $.integrate( $.filterProperties( question, 'attributes', 'swap', 'escape' ), answer, true );\n\n } );\n\n // remove no more needed properties in question data\n delete question.attributes; delete question.swap;\n\n } );\n\n // remove no more needed properties in config\n delete self.text; delete self.description; delete self.answers; delete self.input; delete self.attributes; delete self.swap; delete self.escape; delete self.random; delete self.solution;\n\n }", "title": "" }, { "docid": "30696eefe94d9f585eae94e1c97c738c", "score": "0.62398916", "text": "function genQuestion(qn) {\n if (qn == 1) {\n addQuest(q1)\n addAns.apply(a1)\n ans1.addEventListener('click', checkAnswer)\n ans2.addEventListener('click', checkAnswer)\n ans3.addEventListener('click', checkAnswer)\n ans4.addEventListener('click', checkAnswer)\n } else if (qn == 2) {\n addQuest(q2)\n addAns.apply(a2)\n ans1.addEventListener('click', checkAnswer)\n ans2.addEventListener('click', checkAnswer)\n ans3.addEventListener('click', checkAnswer)\n ans4.addEventListener('click', checkAnswer)\n } \n }", "title": "" }, { "docid": "1a84e88765ab0e2663697142b10ce411", "score": "0.62360305", "text": "function buildQuestion() {\n var questionEl = document.getElementById(\"question\");\n var answerbox = document.getElementById(\"answers\");\n\n questionEl.textContent = questionArray[Q].question;\n\n answerbox.innerHTML = \"\";\n\n questionArray[Q].choices.forEach(function (choice) {\n var button = document.createElement(\"button\");\n button.setAttribute(\"value\", choice);\n\n button.textContent = choice;\n button.setAttribute(\"class\", \"btn\");\n\n button.onclick = selectAnswer;\n\n answerbox.appendChild(button);\n });\n}", "title": "" }, { "docid": "6ae0f8fca6ef27ba107c0eec0e03c928", "score": "0.62301505", "text": "function renderAnswers() {\n for (let i = 0; i < 10; i++) {\n let $yourAnswer = document.getElementById('answer_value' + (i + 1));\n let $correctAnswer = document.getElementById('correct-value' + (i + 1));\n if (arrValues[i]) {\n $yourAnswer.innerHTML += arrValues[i];\n $correctAnswer.innerHTML += ' ' + correctAnswers[i];\n } else {\n $yourAnswer.innerHTML += 'Not Answer';\n }\n }\n}", "title": "" }, { "docid": "275beb36f951c03e6fcbbbb0a6d1ca47", "score": "0.6225551", "text": "function assembleExam(){\n\t//let l = Object.keys(exam['questions']);\n\tfor (let i = 0; i<Object.keys(exam['questions']).length;i++){\n\t\t//console.log(\"working on:\");\n\t\tlet key = Object.keys(exam['questions'])[i];\n\t\tlet curr = exam['questions'][key];\n\t\t//console.log(curr);\n\t\tlet require=`<br><div style=\"margin-left:20px\"><strong>NOTE:</strong> ${enumConstraints(curr['constraint'])} required.</div>`;\n\t\tlet newItem=`<div class=\"questionWritten\">\n\t\t<div>\n\t\t <div style=\"font-size:1.5em; font-weight:bold;${i==0?'margin-top:20px;':''}\" class=\"questionTitle\">Question ${i+1}:</div>\n\t\t</div>\n\t\t<div class=\"questionText\">\n\t\tCreate a function called \\\"${curr['func_name']}\\\" that takes ${curr['inputs'][0].length} arguments that can do the following:<br> ${curr['description']}\n\t\t</div>\n\t\t${require}\n\t\t<div class=\"ans\">Answer:</div>\n\t\t<textarea id=\"${i}\" onkeydown=\"return stopTab(event);\"></textarea>\n\t\t<div style=\"float:right; padding-top:220px;padding-right:50px; text-align:right\">Value: ${curr['points']} Pts</div>\n\t\t<hr>\n\t </div>`\n\t\tdocument.getElementById('examTake').innerHTML+=newItem;\n\t\t//console.log(newItem);\n\t}\n}", "title": "" }, { "docid": "4f7a32cc93fba18b79d82b4d1ec02af5", "score": "0.6224739", "text": "function writeQuestion() {\n for(i=0; i< questions.length; i++) {\n var questionDiv = $(\"<div>\"); //this is the container\n var questionP = $(\"<br><p>\") // p tag created\n questionP.text(questions[i]); // copying question to p tag\n questionDiv.append(questionP); // now we append to the the p tag (questionP) to the div containter in the DOM\n\n // inside our for loop create a class for questions, so we can add a style/attribute to the class. state name of variable first.\n questionDiv.addClass(\"questionStyle\");\n \n //now we add an attribute and that is going to be the correct answer to the question\n questionDiv.attr(\"data-question-value\", answerKey[i]);\n\n //then at some point, we're going to compare user answer with the actual answer (data-question-value variable which will be holding the correct answer). If correc the wins counter will go up.\n\n //making another container to radio buttons/answers. Ensure this is not in for loop only need one container created per question not every radio button\n // var answerChoicesDiv = $(\"<div>\");\n\n //loop over each answer choice before appending to the question id (list of questions in browser)\n for (var j = 0; j < answerChoices[i].length; j++) {\n var radButton = $('<br><input>'); //when creating elements for DOM they're inside < >; only use these for elements!!!\n radButton.attr('type', 'radio');//set the attribute of type to radio\n radButton.attr('name', 'answer-choice-' + i);//set the attribute of type to radio\n //and index will lose it's type once the value goes the html, so it will be reflected as a sting, even though you're trying trying assign indeces of j to a value.\n radButton.attr('value', j);//set the value for the radio input button; value is assigned to j value\n radButton.text(answerChoices[i][j]); //this will write the questions at index and the answers at index\n questionDiv.append(radButton);\n questionDiv.append(answerChoices[i][j]);\n console.log(radButton);\n }\n \n\n //now we going to append our question to the questions id onthe html page (make it render). Every time we write a questions, we append (one at a time). If we used write, it wold be replaced each time. Append will add to the list each time the for loop runs.\n //use jquery to add \n $('#questionID').append(questionDiv); //at first the write Question only had a p tag and line break tag; then I added a class. Then I added an attr. Now I'll appending all those details to the DOM: One will be rendered visually; the others will be stored.\n\n // append answer choices\n // writeAnswerChoicesForQuestion(i);\n }\n \n $('#submit').on('click', function() {\n $('#correctAnswers').show();\n $('#incorrectAnswers').show();\n $('#unanswered').show();\n $('#timer').show();\n $(questionDiv).hide(); //Trying to hide all questions answers, so only results will populate\n var questionDivs = $('.questionStyle'); // this gives us an array of all the question divs\n // $.each(elementsToLoopOver, cb);\n // questionDivs.each(cb);\n $.each(questionDivs, function (index) { //look more on jquery .each.\n var userSelectedAnswerChoiceInput = $(this).find('input:checked'); //this is the question div and .find is looking in the question div and trying to find which user input option is checked (which answer selected)\n var userSelectedAnswerChoiceIndex = userSelectedAnswerChoiceInput.val();\n console.log(\"the user selected\" + userSelectedAnswerChoiceIndex);\n\n console.log(answerKey[index], userSelectedAnswerChoiceIndex);\n\n //////Below is a sample if statement that compares the value of the user input with the corresonding answerChoice[i] for that question. Need to put together this logic for each question.\n // if ($(this).val() === answerChoices[indexpositionofthequestionhere].correctAnswer). \n if (userSelectedAnswerChoiceIndex === answerKey[i]) {\n console.log('got question ' + index + ' correct!')\n $('#correctAnswers').append(userSelectedAnswerChoiceIndex);\n CorrectAnswers++;\n } else {\n console.log('got question ' + index + ' incorrect!')\n $('#incorrectAnswers').append(userSelectedAnswerChoiceIndex);\n IncorrectAnswers++;\n } if \n (userSelectedAnswerChoiceIndex === \" \") { \n $('#unanswered').append(userSelectedAnswerChoiceIndex);\n Unanswered++;\n }\n\n $('#correctAnswers').append(CorrectAnswers);\n // console.log();\n })\n });\n}", "title": "" }, { "docid": "73d1465ecd406e030736d6a8eb0bbbcc", "score": "0.62200755", "text": "function generateQuiz(questions, quizContainer, resultsContainer, submitButton){\n\n var quizContainer = document.getElementById('quiz');\n var resultsContainer = document.getElementById('results');\n var submitButton = document.getElementById('submit');\n\n function showQuestions(questions, quizContainer){\n \t// we'll need a place to store the output and the answer choices\n \tvar output = [];\n \tvar answers;\n\n \t// for each question...\n \tfor(var i=0; i<questions.length; i++){\n\n \t\t// first reset the list of answers\n \t\tanswers = [];\n\n \t\t// for each available answer to this question...\n \t\tfor(letter in questions[i].answers){\n\n \t\t\t// ...add an html radio button\n \t\t\tanswers.push(\n \t\t\t\t'<label>'\n \t\t\t\t\t+ '<input type=\"radio\" name=\"question'+i+'\" value=\"'+letter+'\">'\n \t\t\t\t\t+ letter + ': '\n \t\t\t\t\t+ questions[i].answers[letter]\n \t\t\t\t+ '</label>'\n \t\t\t);\n \t\t}\n\n \t\t// add this question and its answers to the output\n \t\toutput.push(\n \t\t\t'<div class=\"question\">' + questions[i].question + '</div>'\n \t\t\t+ '<div class=\"answers\">' + answers.join('') + '</div>'\n \t\t);\n \t}\n\n \t// finally combine our output list into one string of html and put it on the page\n \tquizContainer.innerHTML = output.join('');\n }\n // end showQuestions function\n\n showQuestions(questions, quizContainer);\n\n function showResults(questions, quizContainer, resultsContainer){\n\n \t// gather answer containers from our quiz\n \tvar answerContainers = quizContainer.querySelectorAll('.answers');\n\n \t// keep track of user's answers\n \tvar userAnswer = '';\n \tvar numCorrect = 0;\n\n \t// for each question...\n \tfor(var i=0; i<questions.length; i++){\n\n \t\t// find selected answer\n \t\tuserAnswer = (answerContainers[i].querySelector('input[name=question'+i+']:checked')||{}).value;\n\n \t\t// if answer is correct\n \t\tif(userAnswer===questions[i].correctAnswer){\n \t\t\t// add to the number of correct answers\n \t\t\tnumCorrect++;\n\n \t\t\t// color the answers green\n \t\t\tanswerContainers[i].style.color = 'lightgreen';\n \t\t}\n \t\t// if answer is wrong or blank\n \t\telse{\n \t\t\t// color the answers red\n \t\t\tanswerContainers[i].style.color = 'red';\n \t\t}\n \t}\n\n \t// show number of correct answers out of total\n \tresultsContainer.innerHTML = numCorrect + ' out of ' + questions.length;\n }\n // end showResults function\n\n // show the questions\n showQuestions(questions, quizContainer);\n\n //on submit, show results\n submitButton.onclick = function() {\n showResults(questions, quizContainer, resultsContainer);\n }\n\n\n}", "title": "" }, { "docid": "e0db8f6576fd418713504e546624c30d", "score": "0.6213258", "text": "function generateQuestion(inputObject) { \n var randomizedArray;\n while(pageContent.firstChild) {\n pageContent.removeChild(pageContent.firstChild);\n }\n \n questionText.textContent = inputObject.question;\n pageContent.appendChild(questionText);\n\n var answers = document.createElement(\"div\");\n answers.setAttribute(\"id\", \"answer-selection\");\n var answer1 = document.createElement(\"button\");\n var answer2 = document.createElement(\"button\");\n var answer3 = document.createElement(\"button\");\n var answer4 = document.createElement(\"button\");\n\n answer1.textContent = inputObject.correct;\n answer2.textContent = inputObject.incorrect1;\n answer3.textContent = inputObject.incorrect2;\n answer4.textContent = inputObject.incorrect3;\n\n answer1.addEventListener(\"click\", function(event) {\n event.preventDefault();\n rightAnswer();\n });\n answer2.addEventListener(\"click\", function(event) {\n event.preventDefault();\n wrongAnswer();\n });\n answer3.addEventListener(\"click\", function(event) {\n event.preventDefault();\n wrongAnswer();\n });\n answer4.addEventListener(\"click\", function(event) {\n event.preventDefault();\n wrongAnswer();\n });\n\n randomizedArray = [answer1, answer2, answer3, answer4];\n randomizedArray = randomizeOrder(randomizedArray);\n\n answers.appendChild(randomizedArray[0]);\n answers.appendChild(randomizedArray[1]);\n answers.appendChild(randomizedArray[2]);\n answers.appendChild(randomizedArray[3]);\n pageContent.appendChild(answers);\n}", "title": "" }, { "docid": "e517ebb28c657d0530118b8e35555250", "score": "0.6208528", "text": "function generateCorrectAnswerFeedback(){\n $('.quiz-container').html(correctTemplate())\n updateTestScore();\n }", "title": "" }, { "docid": "8c5f909bbb9df316154ba918d0701a80", "score": "0.61972076", "text": "function buildQuestions(){\n var questionHTML = ''\n for (var i = 0; i<game.questions.length; i++) {\n questionHTML = questionHTML + formTemplate(game.questions[i]);\n }\n $('#questions-container').append(questionHTML);\n \n }", "title": "" }, { "docid": "73c5a8094bfadf46aecbc5f58fcac1bf", "score": "0.619507", "text": "function nextQuestion() {\n if (sizeQuestion >= questions.length ) {\nendGame();\nreturn;\n}\n\nvar bodyContent = \"<h2>\" + questions[sizeQuestion].question + \"</h2>\" \n\n//Loop for the three answers in the button\nfor (var i = 0; i < questions[sizeQuestion].answers.length; i++) {\n\n //CheckAnswer it will tagret correct and incorrect function to do its job.\n //PickAnswer it put the [answers] inside the button.\n var btn = \"<button onclick=\\\"[checkAnswer]\\\">[pickAnswer]</button>\"; \n btn = btn.replace(\"[pickAnswer]\", questions[sizeQuestion].answers[i]);\n\n //Checking users answers.\n if (questions[sizeQuestion].answers[i] == questions[sizeQuestion].correct) {\n btn = btn.replace(\"[checkAnswer]\", \"correct()\");// go to correct fuction.\n } else {\n btn = btn.replace(\"[checkAnswer]\", \"incorrect()\");// go to incorrect function.\n }\n //Add the pickAnswers [answers] button to the question and send it to the html at the end of the function.\n bodyContent += btn\n}\n //Move from one question to another.\n sizeQuestion++;\n\n document.querySelector(\"#content\").innerHTML = bodyContent;\n}", "title": "" }, { "docid": "94b87e69e2276d54f95fdc9aee09f517", "score": "0.61947864", "text": "function generateQuestionTemplate(){\n const i = STORE.currentQuestion;\n return `\n <div class=\"group\">\n <p class=\"large-text\">question <span class=\"text-yellow\">${STORE.currentQuestion + 1} of 6</span></p>\n <p>${STORE.questions[i].question}</p>\n </div>\n <div>\n <form action=\"/action_page.php\" method=\"get\">\n <div class=\"flex-inline\">\n <div class=\"choice-group question\">\n <input type=\"radio\" name=\"choice\" id=\"answer1\" value=\"${STORE.questions[i].answers[0]}\" required=\"\">\n <label for=\"answer1\">${STORE.questions[i].answers[0]}</label>\n </div>\n <div class=\"choice-group question\">\n <input type=\"radio\" name=\"choice\" id=\"answer2\" value=\"${STORE.questions[i].answers[1]}\">\n <label for=\"answer2\">${STORE.questions[i].answers[1]}</label>\n </div>\n <div class=\"choice-group question\">\n <input type=\"radio\" name=\"choice\" id=\"answer3\" value=\"${STORE.questions[i].answers[2]}\">\n <label for=\"answer3\">${STORE.questions[i].answers[2]}</label>\n </div>\n <div class=\"choice-group question\">\n <input type=\"radio\" name=\"choice\" id=\"answer4\" value=\"${STORE.questions[i].answers[3]}\">\n <label for=\"answer4\">${STORE.questions[i].answers[3]}</label>\n </div>\n </div>\n\n <div class=\"button-group\">\n <button id=\"submit-button\" class=\"button\" type=\"submit\" value=\"submit\">submit.</button>\n <button id=\"restart-button\" class=\"button\" type=\"submit\" value=\"restart\">restart.</button>\n </div>\n </form>\n </div>\n <div class=\"group\">\n <p class=\"large-text\">correct <span class=\"text-yellow\">${score} / 6</span></p>\n </div>\n <footer>\n <h2 class=\"footer-copy\">© Copyright Devon Reihl and Trevor J Alt. All Rights Reserved.</h2>\n </footer>`;\n}", "title": "" }, { "docid": "ce4d44f35ca134c5e738ae762e2e5933", "score": "0.6190759", "text": "function generateQuestionAndAnswers(questionNumber){\n $('main').html(`<div class=\"question-number-score\">\n <form id=\"mainForm\">\n <p>${store.questions[questionNumber].question}</p>\n <div class=\"flex-container\">\n <div>\n <ol>\n ${generateQuizAnswers(questionNumber)}\n </ol>\n </div>\n </div>\n \n <div class=\"submit-btn\">\n <button id=\"submit\" class=\"submit\">Submit</button>\n </div>\n\n </form> \n <div class=\"tracker-flex\"> \n <div class=\"tracker\"> \n <div>\n <p>Question ${store.questionNumber}/${store.questions.length} \n </div>\n <div>Score: ${store.score}/${store.questions.length}</p></div>\n </div>\n </div>\n `);\n //console.log(store.questionNumber);\n}", "title": "" }, { "docid": "9bc1bad7408b7851c2f4d9f7eece1d75", "score": "0.6187663", "text": "function makeQuestions(){\n if (questionNumber < STORE.length) {\n if (STORE[questionNumber].type === 'text'){\n console.log(\"Text question form is generated\");\n return textQuestion();\n }\n else {\n console.log(\"Image question form is generated\");\n return imageQuestion();\n }\n } else {\n alert(\"fin!\");\n console.log(\"Sending to results page...\");\n questionNumber = STORE.length;\n questionUpdate(questionNumber);\n resultsPage();\n }\n}", "title": "" }, { "docid": "4aa7ae5c8a9ec8f84fc2001783cd8be4", "score": "0.6177401", "text": "function generateQA(){\n\t//Math.random function return 0 to .99, so we multiply by 9 and add to 1 so that there should not be a 0\n\tvar x = 1 + Math.round(9 * Math.random()); //number between 1 to 10\n\tvar y = 1 + Math.round(9 * Math.random());\n\t//console.log(x);\n\t//console.log(y);\n\tcorrectAnswer = x * y;\n\t//console.log(correctAnswer);\n\n\t//set the x and y value in question div block\n\tdocument.getElementById('question').innerHTML = x + \"x\" + y;\t\n\n\t//set the correct answer in the one box among 4\n\tvar correctPosition = 1 + Math.round(3 * Math.random());\n\t//console.log('correct position '+correctPosition);\n\tdocument.getElementById(\"box\"+correctPosition).innerHTML = correctAnswer; //fill one box with the correct answer\n\n\n\t//fill other boxes with wrong answers\n\tvar answers = [correctAnswer];\n\n\tfor(i=1; i<5; i++){\n\t\tif (i != correctPosition){\n\t\t\tvar worngAnswer;\n\t\t\tdo{\n\t\t\t\tworngAnswer = 1 + Math.round(9 * Math.random()) * 1 + Math.round(9 * Math.random());//wrong answer\t\n\t\t\t}while(answers.indexOf(worngAnswer) > -1)\n\t\t\t\n\t\t\tdocument.getElementById(\"box\"+i).innerHTML = worngAnswer; //fill one box with the correct answer\n\t\t\t\tanswers.push(worngAnswer);\n\n\t\t}\n\t}\n}", "title": "" }, { "docid": "541ff50edde69763a90d28bc990b820d", "score": "0.6175558", "text": "function generateQuestions(counter) {\n if (counter < 8) {\n let currentQuestion = QUIZ[counter];\n let quizHTML = `\n <form>\n <h1 class=\"question-one\">${currentQuestion.question}</h1>\n <fieldset class=\"options\">\n <input type=\"radio\" name=\"question-option\" id=\"question-option-one\" value=\"${currentQuestion.answers[0]}\">\n <label for=\"question-option-one\">${currentQuestion.answers[0]}</label>\n <br><br>\n <input type=\"radio\" name=\"question-option\" id=\"question-option-two\" value=\"${currentQuestion.answers[1]}\">\n <label for=\"question-option-two\">${currentQuestion.answers[1]}</label>\n <br><br>\n <input type=\"radio\" name=\"question-option\" id=\"question-option-three\" value=\"${currentQuestion.answers[2]}\">\n <label for=\"question-option-three\">${currentQuestion.answers[2]}</label>\n <br><br>\n <input type=\"radio\" name=\"question-option\" id=\"question-option-four\" value=\"${currentQuestion.answers[3]}\">\n <label for=\"question-option-four\">${currentQuestion.answers[3]}</label>\n </fieldset>\n </form> \n <p>Question: ${counter + 1}/8</p>\n <p>Score: ${scoreCount}/8</p>`;\n $('#quiz-questions').html(quizHTML);\n };\n}", "title": "" }, { "docid": "530bac849eb0de1e1546f7d96f715d8e", "score": "0.6169559", "text": "function renderOptionsHtml() {\n const optionsText = STORE.questions[STORE.questionNumber].answers;\n let optionsHtml = '';\n let ans = 1;\n optionsText.forEach(element => {\n optionsHtml += `\n <label aria-live= \"polite\" class=\"answerContainer ans${ans}\" for=\"ans${ans}\"><input name=\"ansGroup\" id=\"ans${ans}\" type=\"radio\" value =\"${element}\" required>\n <span>${element}</span></input></label>\n `;\n ans++;\n });\n return optionsHtml;\n}", "title": "" }, { "docid": "e653e32169af9c3b6af48040dbe695dc", "score": "0.6151635", "text": "function displayQuestion() {\n\n \n\n for (var i = 0; i < triviaQuestions.length; i++) {\n var choiceOne = triviaQuestions[i].choices[0];\n var choiceTwo = triviaQuestions[i].choices[1];\n var choiceThree = triviaQuestions[i].choices[2];\n var choiceFour = triviaQuestions[i].choices[3];\n \n var questionBox = $(\"#question-box\");\n \n questionBox.append(\"<h4>\" + triviaQuestions[i].question + \"</h4> <br>\");\n\n $(\"#question-box\").append('<div class=\"form-check\"><input class=\"form-check-input\" type=\"radio\" name=\"radio-group'+i+'\" id=\"radio'+i+'\"><label class=\"form-check-label\" id=\"radio'+i+'label\" for=\"radio'+i+'\">' + choiceOne + '</label></div> <br>');\n $(\"#question-box\").append('<div class=\"form-check\"><input class=\"form-check-input\" type=\"radio\" name=\"radio-group'+i+'\" id=\"radio'+i+'\"><label class=\"form-check-label\" id=\"radio'+i+'label\" for=\"radio'+i+'\">' + choiceTwo + '</label></div> <br>');\n $(\"#question-box\").append('<div class=\"form-check\"><input class=\"form-check-input\" type=\"radio\" name=\"radio-group'+i+'\" id=\"radio'+i+'\"><label class=\"form-check-label\" id=\"radio'+i+'label\" for=\"radio'+i+'\">' + choiceThree + '</label></div> <br>');\n $(\"#question-box\").append('<div class=\"form-check\"><input class=\"form-check-input\" type=\"radio\" name=\"radio-group'+i+'\" id=\"radio'+i+'\"><label class=\"form-check-label\" id=\"radio'+i+'label\" for=\"radio'+i+'\">' + choiceFour + '</label></div> <br>');\n }\n\n}", "title": "" }, { "docid": "d943e8d398f0aef2e486744a5f7f7ec7", "score": "0.61456436", "text": "function getAllAnswer(results) {\r\n var innerhtml = \"\";\r\n for (var i = 0; i < results.length; i++) {\r\n\r\n var _class = ((results[i].iscorrect) ? \"item-correct\" : \"item-incorrect\");\r\n var _classH = ((results[i].iscorrect) ? \"h-correct\" : \"h-incorrect\");\r\n\r\n\r\n var _html = '<div class=\"_resultboard ' + _class + '\">' +\r\n '<div class=\"_header\">' + results[i].question + '</div>' +\r\n '<div class=\"_yourans ' + _classH + '\">' + results[i].clicked + '</div>';\r\n\r\n var html = \"\";\r\n if (!results[i].iscorrect)\r\n html = '<div class=\"_correct\">' + results[i].answer + '</div>';\r\n _html = (_html + html) + '</div>';\r\n innerhtml += _html;\r\n }\r\n\r\n $(\".allAnswerBox\").html('').append(innerhtml);\r\n}", "title": "" }, { "docid": "85ab7010dfa6a4e630eda43fe8eed9a7", "score": "0.6145335", "text": "function displayQuestions(){\n\t\t\tfor(i = 0; i < array.length; i++){\n\t\t\t\tQuestions(array[i]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "08b9173b4c08f39215b71000a49ce5fb", "score": "0.6141918", "text": "function generateQuestions() {\n gameoverDiv.style.display = \"none\";\n if (currentQuestionIndex === finalQuestionIndex) {\n return displayScore();\n }\n var currentQuestion = questionsArray[currentQuestionIndex];\n questionsDiv.innerHTML = \"<p>\" + currentQuestion.question + \"</p>\";\n buttonOne.innerHTML = currentQuestion.answerOne;\n buttonTwo.innerHTML = currentQuestion.answerTwo;\n buttonThree.innerHTML = currentQuestion.answerThree;\n buttonFour.innerHTML = currentQuestion.answerFour;\n}", "title": "" }, { "docid": "9f7ce7a415d4ba560d30a138de340f2c", "score": "0.6141253", "text": "function generateQuestionHtml() {\n let questionNumber = STORE.questions[STORE.currentQuestionNumber];\n return `\n <form id=\"question-form\" class=\"question-form\">\n <fieldset>\n <div class=\"question\">\n <legend> ${questionNumber.question}</legend>\n </div>\n <div class=\"options\">\n <div class=\"answers\">\n ${generateAnswersHtml()}\n </div>\n </div>\n <button type=\"submit\" id=\"submit-answer-btn\" tabindex=\"5\">Submit</button>\n <button type=\"button\" id=\"next-question-btn\" tabindex=\"6\"> Next &gt;></button>\n </fieldset>\n </form >\n `;\n }", "title": "" }, { "docid": "cf0f7f46fa8e8359abd71262d150b4ba", "score": "0.61371976", "text": "function displayQA(){\n var solutions = \n $(\"#q1\").text(Quiz[0].question)\n for( var i = 0; i < Quiz[0].choices.length;i++){\n console.log(Quiz[0].choices[i]);\n var a = $(\"<button class = 'button'>\");\n a.attr(Quiz[0].Choices[i]);\n a.text( Quiz[0].answerChoices[i]);\n $(\".button\").append(a);\n // console.log(a);\n\n\n }\n}", "title": "" }, { "docid": "98e0a578ef944d03dd5b2ececb290ce9", "score": "0.61355484", "text": "function generateQuestionHtml() {\n currentQuestion = store.currentQuestion;\n return `\n <form action=\"#\" id=\"question-form\">\n <fieldset>\n <div class=\"question-area\"\n <div class=\"question\">\n </div>\n <div class=\"options\">\n <div class=\"answers\">\n <legend>${store.questions[currentQuestion].question}\n </legend>\n </div>\n ${generateAnswersHtml()}\n </div>\n <div class=\"submit-answer-btn\">\n <button type=\"submit\" id=\"js-submit-answer-btn\">Submit Answer</button>\n </div>\n </div>\n <div class=\"result-area\" style=\"display:none\">\n <div class=\"next-question-btn\">\n <button type=\"button\" id=\"js-next-question-btn\">Next Question</button>\n </div>\n </div>\n </fieldset>\n </form>\n `;\n}", "title": "" }, { "docid": "0358696880f623fcd4af29dfe5b1772a", "score": "0.6125818", "text": "function buildHtml() {\n //Create my variables for reference\n var questionsListDiv = $(\"#questions\");\n var questionDiv;\n var newQuestion;\n var newChoice;\n\n for (var i = 0; i < questions.length; i++) {\n //Getting my 4 questions to display\n newQuestion = questions[i].question;\n\n //putting my 4 questions to the HTML\n questionDiv = $(\"<div class='question'>\").text(newQuestion);\n console.log(`On outter loop pass #${i} the question was :${questions[i].question}`);\n //start inner loop to extract choices for each question\n\n for (var j = 0; j < 4; j++) {\n //THIS TOOK FOREVER 5+ HOURS TO GET WORKING AFTER LOTS OF HELP!!! ALMOST QUIT LIFE!!!\n //extracting choicess array from obj and looping through each choic\n newChoice = questions[i].choices[j];\n //instructor helped me to assign 1-4 at end of name for each answer choice for each questions. This allows me to only click 1 answer at a time.\n questionDiv.append(\"<input type='radio' name='question\" + i + \"' value='\" + newChoice + \"'><label>\" + newChoice + \"</label>\");\n } //end choices loop\n\n //append new virtual question div to DOM\n questionsListDiv.append(questionDiv);\n\n // $(\"#divResult2\").append(incorrectAnswerTotal);\n\n }//end outer loop to extract each question\n\n}//end buildHTML()", "title": "" }, { "docid": "3deec5471f7e55586c062472966e5925", "score": "0.6124626", "text": "function generateNewQuestion() {\n // increasing question tracker by 1 with each new question generated and updating text\n questionTracker++;\n questionTrackerText.innerText = questionTracker + \"/\" + totalQuestions;\n\n // variable for question index to generate random question from available questions array\n var questionIndex = Math.floor(Math.random(availableQuestions.length));\n // setting current question to a random index within the availabe questions array\n currentQuestion = availableQuestions[questionIndex];\n quizQuestion.innerText = currentQuestion.question;\n\n // following same principle for answer selections usinf forEach method\n answerSelections.forEach(answerSelection => {\n // variable to reference data-set in html \n var number = answerSelection.dataset[\"number\"];\n // printing selections to the screen that match with corresponding text \n answerSelection.innerText = currentQuestion[\"answerSelection\" + number];\n });\n // splicing out question that was used so it doesn't repeat\n availableQuestions.splice(questionIndex, 1);\n}", "title": "" } ]
2aae3107808e77e475f3e7be00055b80
sabes si la respuesta es xml o string
[ { "docid": "19f15bf5d85e0600bfa78314c2a23875", "score": "0.0", "text": "function doCallback(callback,item){\n eval(callback+'(item)');\n}", "title": "" } ]
[ { "docid": "035d9d2ce8fea655f56d503f9d818512", "score": "0.6579574", "text": "function getResponseXML(rv) {\n if (rv.responseXML) return rv.responseXML;\n else return loadXML(rv.responseText);\n}", "title": "" }, { "docid": "7680acef76f3bfbd95f25774d83abe8c", "score": "0.58400095", "text": "function supply_xml_response(result) {\n $(\"#xml-response\").text(result);\n }", "title": "" }, { "docid": "957cc77875da40f85a3af914c39ce8ac", "score": "0.58165234", "text": "function xmlToString(xmlData) { // this functions waits jQuery XML \n\n var xmlString = undefined;\n\n if (window.ActiveXObject){\n xmlString = xmlData[0].xml;\n }\n\n if (xmlString === undefined)\n {\n var oSerializer = new XMLSerializer();\n xmlString = oSerializer.serializeToString(xmlData[0]);\n }\n\n return xmlString;\n}", "title": "" }, { "docid": "7305ce9ec50c98ee67be8685fe76935b", "score": "0.57226354", "text": "function isResponse(node) {\n\t return node.kind() == \"Response\" && node.RAMLVersion() == \"RAML08\";\n\t}", "title": "" }, { "docid": "3f4694622bdd0d1aaf7ee7c7f2a47948", "score": "0.56999487", "text": "function goodStatus(doc) {\n var reply = doc.getElementsByTagName('reply')[0];\n if(reply.getElementsByTagName('status')) {\n var status = reply.getElementsByTagName('status')[0].firstChild.nodeValue;\n return status == \"success\";\n }\n}", "title": "" }, { "docid": "1bdd51a37c6e2f30162775057b98ef33", "score": "0.5635286", "text": "function isResponse(node) {\n\t return node.kind() == \"Response\" && node.RAMLVersion() == \"RAML10\";\n\t}", "title": "" }, { "docid": "5080eda2ae416e3804eed309b64ca35d", "score": "0.56084394", "text": "GetXML() {}", "title": "" }, { "docid": "415675b3be72e878aab338bd6c66f61b", "score": "0.5564359", "text": "convertXMLtoJson(uploadedData){\n if( !uploadedData ){\n return;\n }\n let json = [];\n let parser = new DOMParser();\n let xmlData = parser.parseFromString(uploadedData, \"text/xml\");\n let length = xmlData.getElementsByTagName(\"result\").length;\n for( let i = 0; i < length; i++ ){\n try{\n let obj = {\n title : xmlData.getElementsByTagName(\"title\")[i].childNodes[0].nodeValue,\n link : xmlData.getElementsByTagName(\"url\")[i].childNodes[0].nodeValue,\n snippet : xmlData.getElementsByTagName(\"description\")[i].childNodes[0].nodeValue,\n }\n json.push(obj); \n }catch(error){\n return null;\n }\n }\n return JSON.stringify(json);\n }", "title": "" }, { "docid": "0638a1b7d3622cdb6313f0624190947d", "score": "0.5536794", "text": "function xmlDomFromString(_xml) {\r\n\t\t//var Util = require('core/Util'),\r\n\t\tvar xmlDoc;\r\n\t\ttry {\r\n\t\t\txmlDoc = Titanium.XML.parseString(_xml);\r\n\t\t} catch (e) {\r\n\t\t\tAlloy.Globals.Logger.logException(e);\r\n\t\t\tAlloy.Globals.aIndicator.hide();\r\n\t\t\t// Alloy.Globals.Util.showAlert('Invalid server response received from ALCRM. Please retry!');\r\n\r\n\t\t\tAlloy.Globals.Logger.log('Invalid server response received from ALCRM. Please retry! LOG -' + e, 'info');\r\n\t\t\tAlloy.Globals.Logger.logException(e);\r\n\r\n\t\t\t//return;\r\n\t\t}\r\n\t\tif (xmlDoc) {\r\n\t\t\treturn xmlDoc;\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "a1bb45590f6c437b4d7f80748e607494", "score": "0.5508279", "text": "queryRawXml() {\n const mythis = this;\n if (!this.isSomeParameterSet()) {\n throw new Error(\n \"Must set some parameter to avoid asking for everything.\"\n );\n }\n const url = this.formURL();\n const fetchInit = defaultFetchInitObj(XML_MIME);\n return doFetchWithTimeout(url, fetchInit, this._timeoutSec * 1e3).then((response) => {\n if (response.status === 200) {\n return response.text();\n } else if (response.status === 204 || isDef(mythis._nodata) && response.status === mythis._nodata) {\n return FAKE_EMPTY_XML;\n } else {\n throw new Error(`Status not successful: ${response.status}`);\n }\n }).then(function(rawXmlText) {\n return new DOMParser().parseFromString(rawXmlText, XML_MIME);\n });\n }", "title": "" }, { "docid": "125d2160620b860124042172bd270f44", "score": "0.54901844", "text": "function XMCResult(strXML)\r\n{\r\n\tvar ob = {};\r\n\tob.success=true;\r\n\tob.message=\"\";\r\n\r\n\t//-- get success\r\n\tvar intStartPosRes = strXML.indexOf(\"<result>\") + 8;\r\n\tvar intEndPosRes = strXML.indexOf(\"</result>\");\r\n\tvar strResult = strXML.substring(intStartPosRes,intEndPosRes);\r\n\tob.success = (strResult!=\"false\");\r\n\r\n\t//-- get message\r\n\tvar intStartMsgRes = strXML.indexOf(\"<message>\") + 9;\r\n\tvar intEndMsgRes = strXML.indexOf(\"</message>\");\r\n\tvar strMsg = strXML.substring(intStartMsgRes,intEndMsgRes);\r\n\tob.message = strMsg;\r\n\r\n\treturn ob;\r\n}", "title": "" }, { "docid": "300b4d9b6ed70ca82e394014666a3633", "score": "0.5471725", "text": "function toJson(str) { // Convert the XML output into JSON\n\t\tvar output = xt.xmlToJson(str);\n\t\tif(output[0].success)\n\t\t\trtValue = true;\n\t\telse\n\t\t\trtValue = false;\n\t\tstop = 1;\n\t}", "title": "" }, { "docid": "300b4d9b6ed70ca82e394014666a3633", "score": "0.5471725", "text": "function toJson(str) { // Convert the XML output into JSON\n\t\tvar output = xt.xmlToJson(str);\n\t\tif(output[0].success)\n\t\t\trtValue = true;\n\t\telse\n\t\t\trtValue = false;\n\t\tstop = 1;\n\t}", "title": "" }, { "docid": "300b4d9b6ed70ca82e394014666a3633", "score": "0.5471725", "text": "function toJson(str) { // Convert the XML output into JSON\n\t\tvar output = xt.xmlToJson(str);\n\t\tif(output[0].success)\n\t\t\trtValue = true;\n\t\telse\n\t\t\trtValue = false;\n\t\tstop = 1;\n\t}", "title": "" }, { "docid": "bb2cd65cf334d990db0cf2218f5a511b", "score": "0.5462588", "text": "function handleResponse(output) {\n\tif(request.readyState==4) {\t\n\t\tif(request.status==200) {\n\t\t\tif(output == \"text\") {\n\t\t\t\tdoc=request.responseText;\n\t\t\t} else\t{\n\t\t\t\tdoc=request.responseXML;\n\t\t\t}\n\t\t\treturn doc;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "438601670edbe9178ef4266501eaaef6", "score": "0.543613", "text": "function string(data) {\n return typeof data === 'string';\n }", "title": "" }, { "docid": "1b6bb7508773ac2750d0d83540883732", "score": "0.5420517", "text": "function handleResponse() {\n // var xmlResponse = xm\n}", "title": "" }, { "docid": "c02aaec3e621b943fcc0bfadf90fd8cd", "score": "0.5419201", "text": "function str(res) {\n\n if (res === 'string') {\n if (res.length !== 0) {\n c = \"false\";\n }\n else {\n c = \"true\";\n }\n } else {\n c = \"not string\";\n }\n return c;\n}", "title": "" }, { "docid": "afa2c245ead2514092329c8a619ce9d5", "score": "0.5406169", "text": "function showTranslatedResponse(){\n if(req.responseText.search('Timed Out') > -1){\n //alert(\"Your session has timed out. Please re-login.\");\n return \"Your session has timed out. Please re-login by clicking the home button above.\";\n }\n if(req.responseXML){\n var root = req.responseXML.documentElement;\n if(root.getElementsByTagName('smsg')[0]){\n return \"<span class='ok-msg'>\" +root.getElementsByTagName('smsg')[0].firstChild.data+ \"</span>\";\n }\n if(root.getElementsByTagName('ErrorString')[0]){\n return \"<span class='error-msg'>\"+ root.getElementsByTagName('ErrorString')[0].firstChild.data+\"</span>\" ;\n }\n //NOT USING XSLT processing\n /*using sarissa : cross-browser xslt processing\n // get a serializer object which will be used later to convert from xml to text\n var xmlSerializer = new XMLSerializer();\n // create an instance of XSLTProcessor\n var processor = new XSLTProcessor();\n // create a DOM Document containing an XSLT stylesheet\n var xslDoc = loadFromUrl(\"xsl_gen.xsl\");\n\n // make the stylesheet reusable by importing it in the\n // XSLTProcessor\n processor.importStylesheet(xslDoc);\n\n //alert(\"got xsl\"+xmlSerializer.serializeToString(xslDoc));\n //processor.setParameter(null, \"XML_CONTENT\", '<b>Hello</b>');\n\n // transform the response\n var newDocument = Sarissa.getDomDocument();\n newDocument = processor.transformToDocument(req.responseXML);\n //alert(\"xml is\"+xmlSerializer.serializeToString(req.responseXML));\n return xmlSerializer.serializeToString(newDocument);\n */\n }\n}", "title": "" }, { "docid": "c9ca40f5e7def2d6cc6bd906b6e84d22", "score": "0.53935194", "text": "function serialize(xml){\n var text = xml.xml;\n if (text) {\n return text;\n }\n if (typeof XMLSerializer != 'undefined') {\n return new XMLSerializer().serializeToString(xml);\n }\n throw Error('Your browser does not support serializing XML documents');\n }", "title": "" }, { "docid": "311d8837218aaadbba49770c37d1292d", "score": "0.5390371", "text": "function isHtmlSvgContent(res) {\n return res.headers && /^(?:text\\/html|image\\/svg)/i.test(res.headers['content-type']);\n}", "title": "" }, { "docid": "6cd3d48bce4248268755c1d771255177", "score": "0.5383159", "text": "function getXML(connection){\n\tif(connection.xmlConnection.readyState == 4 || connection.xmlConnection.readyState == 200){\n\t\tconnection.XML = connection.xmlConnection.responseXML;\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "4c6a460a0322ad07231347c29231517f", "score": "0.53564847", "text": "function string (data) {\n return typeof data === 'string';\n }", "title": "" }, { "docid": "059e8f3984216491524ad03fb8de5fc3", "score": "0.5354929", "text": "queryRawXmlText(level) {\n const mythis = this;\n if (!this.isSomeParameterSet()) {\n throw new Error(\n \"Must set some parameter to avoid asking for everything.\"\n );\n }\n const url = this.formURL(level);\n const fetchInit = defaultFetchInitObj(XML_MIME);\n return doFetchWithTimeout(url, fetchInit, this._timeoutSec * 1e3).then((response) => {\n if (response.status === 200) {\n return response.text();\n } else if (response.status === 204 || isDef(mythis._nodata) && response.status === mythis._nodata) {\n return FAKE_EMPTY_XML2;\n } else {\n throw new Error(`Status not successful: ${response.status}`);\n }\n });\n }", "title": "" }, { "docid": "0057b7e2ee04c28517185d9dc2a6ef1d", "score": "0.53024715", "text": "function XMLResult(out) {\n if (out instanceof javax.xml.transform.Result) {\n return out;\n } else if (out instanceof Packages.org.w3c.dom.Document) {\n return new javax.xml.transform.dom.DOMResult(out);\n } else {\n out = new BufferedOutputStream(outStream(out));\n return new javax.xml.transform.stream.StreamResult(out);\n }\n}", "title": "" }, { "docid": "e67143b0b6ab151518435bd57a5fa9ad", "score": "0.5297621", "text": "function getReturnedData(responseText, o) {\n var theTotalJSONString = '';\n\n var xmlDoc;\n if (true) {\n// if (window.DOMParser) {\n parser = new DOMParser();\n xmlDoc = parser.parseFromString(responseText, \"application/xml\");\n xmlDoc.getElementsByTagName(o.theMethod + 'Return');\n\n var theRoot = xmlDoc.getElementsByTagName(o.theMethod + 'Return')[0];\n var theQuote = '';\n theTotalJSONString = '{';\n for (n = 0; n < theRoot.childNodes.length; n++) {\n var theCurrentNode = theRoot.childNodes[n];\n if (n > 0) { theTotalJSONString += ', '; }\n if (theCurrentNode.attributes.getNamedItem('xsi:type').value == \"soapenc:Array\") {\n\n theTotalJSONString += '\"' + theCurrentNode.nodeName + '\"' + ': ' + '[';\n\n for (g = 0; g < theCurrentNode.childNodes.length; g++) {\n if (g > 0) { theTotalJSONString += ', '; }\n for (k = 0; k < theCurrentNode.childNodes[0].childNodes.length; k++) {\n if (k > 0) { theTotalJSONString += ', '; }\n if (k == 0) { theTotalJSONString += '{'; }\n \n var theCurrentArrayNode = theCurrentNode.childNodes[0].childNodes[k];\n\n var theText = '';\n\n if (theCurrentArrayNode.attributes.getNamedItem('xsi:type').value == \"soapenc:Array\") {\n theTotalJSONString += '\"' + theCurrentArrayNode.nodeName + '\"' + ': ' + '[]';\n }\n else {\n\n switch (theCurrentArrayNode.attributes.getNamedItem('xsi:type').value) {\n case 'xsd:string':\n theQuote = '\"';\n if (theCurrentArrayNode.textContent != null) {\n theText = theCurrentArrayNode.textContent;\n } \n break;\n case 'xsd:int':\n case 'xsd:float':\n case 'xsd:long':\n theQuote = '';\n if (theCurrentArrayNode.textContent != '') {\n theText = theCurrentArrayNode.textContent;\n }\n else {\n theText = 'null';\n }\n break;\n }\n\n theTotalJSONString += '\"' + theCurrentArrayNode.nodeName + '\"' + ': ' + theQuote + theText + theQuote;\n }\n\n if (theCurrentNode.childNodes[0].childNodes.length == k + 1) { theTotalJSONString += '}'; }\n\n }\n }\n theTotalJSONString += ']';\n }\n else {\n\n switch (theCurrentNode.attributes.getNamedItem('xsi:type').value) {\n case 'xsd:string':\n theQuote = '\"';\n break;\n case 'xsd:int':\n theQuote = '';\n break;\n }\n var theText = '';\n if (theCurrentNode.textContent != null) {\n theText = theCurrentNode.textContent;\n }\n theTotalJSONString += '\"' + theCurrentNode.nodeName + '\"' + ': ' + theQuote + theText + theQuote;\n }\n }\n theTotalJSONString += '}';\n }\n\n// else // Internet Explorer\n// {\n// xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n// xmlDoc.async = false;\n// xmlDoc.loadXML(responseText);\n// \n// var ns = '';\n// ns += 'xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ';\n// ns += 'xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" ';\n// ns += 'xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" ';\n// ns += 'xmlns:ns1=\"http://www.dyadem.com/stature/ws\" ';\n// xmlDoc.setProperty('SelectionNamespaces', ns); \n\n\n// var theTotalJSONString = '{';\n\n// var theReturnNode = xmlDoc.selectSingleNode('//' + o.theMethod + 'Return');\n// for (n = 0; n < theReturnNode.childNodes.length; n++) {\n// var theType = '';\n// for (a = 0; a < theReturnNode.childNodes[n].attributes.length; a++) {\n// if (theReturnNode.childNodes[n].attributes[a].baseName === 'type') {\n// theType = theReturnNode.childNodes[n].attributes[a].text;\n// }\n// }\n// if (theType != 'soapenc:Array') {\n// if (n > 0) {\n// theJSONString += ', ';\n// }\n// var theQuote = '';\n// if (theType === 'xsd:string') {\n// theQuote = '\"';\n// }\n\n// var theText = '';\n// if (theReturnNode.childNodes[n].text === null) {\n// theText = '';\n// }\n// else {\n// theText = theReturnNode.childNodes[n].text;\n// }\n\n// theTotalJSONString += '\"' + theReturnNode.childNodes[n].baseName + '\"' + ': ' + theQuote + theText + theQuote;\n// theTotalJSONString += ', ';\n// }\n// }\n\n// theTotalJSONString += ' \"' + o.theElement + '\"' + ': [';\n// var theItems = xmlDoc.selectNodes('//' + o.theElement + o.theAttribute);\n// for (i = 0; i < theItems.length; i++) {\n// var theJSONString = '{';\n// for (f = 0; f < o.theFields.length; f++) {\n// if (f > 0) {\n// theJSONString += ', ';\n// }\n// if (o.theFields[f].type != 'array') {\n// var theQuote = '';\n// if (o.theFields[f].type === 'string') {\n// theQuote = '\"';\n// }\n// var theNode = theItems[i].selectSingleNode(o.theFields[f].name);\n// var theNodeText = theNode.text;\n// if (theNodeText === '') {\n// if (o.theFields[f].type === 'string') {\n// theNodeText = ''\n// }\n// else {\n// theNodeText = 'null'\n// }\n// }\n// theJSONString += '\"' + theNode.baseName + '\"' + ': ' + theQuote + theNodeText + theQuote;\n// }\n// else {\n// //var theNode = theItems[i].selectSingleNode(o.theFields[f].name);\n// //theJSONString += '\"' + theNode.baseName + '\"' + ': ' + '[]';\n// if (theItems[i].attributes[0].value === 'xsd:string') {\n// theQuote = '';\n// theJSONString += '\"' + theItems[i].baseName + '\"' + ': ' + theQuote + theItems[i].text + theQuote;\n// }\n// else {\n// var theIndexItems = theItems[i].selectNodes(o.theFields[f].name + '/*');\n// var allItems = '\"' + o.theFields[f].name + '\": [';\n// if (theIndexItems != null) {\n// for (j = 0; j < theIndexItems.length; j++) {\n// if (j > 0) {\n// allItems += ', ';\n// }\n// allItems += '{'\n// for (k = 0; k < theIndexItems[j].childNodes.length; k++) {\n// if (k > 0) {\n// allItems += ', ';\n// }\n// var theNode = theIndexItems[j].childNodes[k];\n// var theNodeText = theNode.text;\n// if (theNodeText == '') {\n// theQuote = '\"';\n// }\n// else {\n// if (isNaN(theNodeText)) {\n// theQuote = '\"';\n// }\n// else {\n// theQuote = '';\n// }\n// }\n\n// allItems += '\"' + theNode.baseName + '\"' + ': ' + theQuote + theNodeText + theQuote;\n// }\n// allItems += '}'\n// }\n// allItems += ']';\n// }\n// theJSONString += allItems;\n// }\n// }\n// }\n\n// theJSONString += '}';\n// if (i > 0) {\n// theTotalJSONString += ', ';\n// }\n// theTotalJSONString += theJSONString;\n// }\n// theTotalJSONString += ']}';\n\n// }\n\n debugger;\n var theTotalJSONObject = Ext.decode(theTotalJSONString);\n return theTotalJSONObject;\n}", "title": "" }, { "docid": "2a0e46f9711c0f6e1000862fbf4b881d", "score": "0.5289914", "text": "function pb_local_xml2object($xml)\n{\n var obj = {};\n if ($xml.find('response').size() > 0)\n {\n var _response = pb_local_recursiveXml2Object($xml.find('response'));\n obj.type = 'response';\n obj.response = _response;\n }\n else if ($xml.find('error').size() > 0)\n {\n var _code = $xml.find('code').text();\n var _message = $xml.find('message').text();\n log.warn('MAIN : error code = ' + _code);\n log.warn('MAIN : error msg = ' + _message);\n obj.type = 'error';\n obj.error = {\n code: _code,\n message: _message\n };\n }\n else\n {\n obj.type = 'unknown';\n }\n return obj;\n}", "title": "" }, { "docid": "f9afe741864af6fda1ef36d32590c287", "score": "0.5253441", "text": "function string2xml_(doc, input) {\n return helperXmlRpc.createNode(doc, 'string', input);\n }", "title": "" }, { "docid": "786f04cec4815e3f6b143e5415710dd1", "score": "0.52528936", "text": "function isXMLDoc(doc, lazy) {\n lazy = typeof lazy === \"undefined\" ? true : lazy;\n\n if (typeof doc === \"string\" && lazy) {\n doc = doc.trim();\n return doc.indexOf(\"<\") == 0;\n } else {\n var documentElement = (doc ? doc.ownerDocument || doc : 0).documentElement;\n return documentElement ? documentElement.nodeName !== \"HTML\" : false;\n }\n }", "title": "" }, { "docid": "cd60ea6a9abc5b410c5cf707344d0a1c", "score": "0.52521735", "text": "function xmlToString(xmlData) {\n\n var xmlString;\n //IE\n if (window.ActiveXObject) {\n xmlString = xmlData.xml;\n }\n // code for Mozilla, Firefox, Opera, etc.\n else {\n xmlString = (new XMLSerializer()).serializeToString(xmlData);\n }\n return xmlString;\n}", "title": "" }, { "docid": "ce723c135a87bcd4e6d9783cf2dbdc3d", "score": "0.52491", "text": "standardXML(tag, inner, stringMe) {\n\n if(typeof(inner)=='object'){\n console.error(\"Inner Data as been idenitfied as an Object!\\nMake sure to use JSON.Stringify!\");\n }\n\n var tmpXMLString = [];\n tmpXMLString[0] = '<' + tag + '>';\n tmpXMLString[1] = inner;\n tmpXMLString[2] = '</' + tag + '>';\n if (stringMe == 'string') {\n console.log('Now a String');\n return tmpXMLString.join('');\n }\n if (stringMe == 'array') {\n console.log('Already Array')\n return tmpXMLString;\n }\n console.error('No last argument. Didn\\'t know how to format');\n }", "title": "" }, { "docid": "3f9c45257e8f0d1deca75500c2daced3", "score": "0.5243316", "text": "function parseResponse (respXml, respTxt) {\n var xmlDoc = respXml;\n\n /*\n\t * if responseXML is not valid, try to create the XML document from the\n\t * responseText property\n\t */\n if (!xmlDoc || !xmlDoc.documentElement) {\n if (window.DOMParser) {\n var parser = new DOMParser();\n try {\n xmlDoc = parser.parseFromString (respTxt, \"text/xml\");\n } catch (e) {\n alert (\"XML parsing error\");\n return null;\n };\n }\n else {\n xmlDoc = createMsXmlDoc ();\n if (!xmlDoc) {\n return null;\n }\n xmlDoc.loadXML (respTxt);\n\n }\n }\n return xmlDoc;\n}", "title": "" }, { "docid": "ba06c490deb5e235680d5ae718dd3184", "score": "0.5217248", "text": "function process_xml(obj) {\n xml = $.parseXML(obj);\n return $(xml);\n }", "title": "" }, { "docid": "0a26d12077ef53fbea8ab244b4cfc0e5", "score": "0.5205028", "text": "function xml2Str(xmlNodeObject) {\n\t\t\tif (xmlNodeObject == null)\n\t\t\t\treturn;\n\t\t\tvar xmlNode = (xmlNodeObject instanceof jQuery? xmlNodeObject[0]: xmlNodeObject);\n\t\t\tvar xmlStr = \"\";\n\t\t\ttry {\n\t\t\t\t// Gecko-based browsers, Safari, Opera.\n\t\t\t\txmlStr = (new XMLSerializer()).serializeToString(xmlNode);\n\t\t\t} catch (e) {\n\t\t\t\ttry {\n\t\t\t\t\t// Internet Explorer.\n\t\t\t\t\txmlStr = xmlNode.xml;\n\t\t\t\t} catch (e) {\n\t\t\t\t\taddProblem('Xmlserializer not supported', e);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\txmlStr = vkbeautify.xml(xmlStr);\n\t\t\treturn xmlStr;\n\t\t}", "title": "" }, { "docid": "d7948d6016cd9458605ba5f688fb06c7", "score": "0.51900244", "text": "function xml2json(e){return e=cleanXML(e),xml2jsonRecurse(e,0)}", "title": "" }, { "docid": "bb9d4018d85651644e955ba5a266f192", "score": "0.51898277", "text": "function ProcessableXML() {\n \n}", "title": "" }, { "docid": "4b3a7b63b5ee310960801d25c9c9dca8", "score": "0.5154849", "text": "function xmlToString(xml) {\r\n\tif (window.ActiveXObject) { return xml.xml; }\r\n\treturn new XMLSerializer().serializeToString(xml);\r\n}", "title": "" }, { "docid": "e051ffd7c5c50b34698c010c26c19111", "score": "0.5137123", "text": "function handleResponse() {\r\n //var xmlResponse = xml.Http.responseXML;\r\n\txmlHttp\r\n\tvar xmlResponse = xmlHttp.responseXML;\r\n root = xmlResponse.documentElement;\r\n names = root.getElementsByTagName(\"name\");\r\n ssns = root.getElementsByTagName(\"ssn\");\r\n \r\n var stuff = \"\";\r\n for (var i=0; i<names.length; i++) {\r\n stuff = names.item(i).firstChild.data + \" - \" + ssns.item(i).firstChild.data + \"<br/>\";\r\n }\r\n theD =document.getElementById (\"theD\");\r\n theD.innerHTML = stuff;\r\n}", "title": "" }, { "docid": "50b9f2ca28338802d63f73cfaa330482", "score": "0.51289195", "text": "function isRaw(res) {\n return res.mine !== undefined;\n }", "title": "" }, { "docid": "4a09fa493504a39a1a47f10da2c67eb0", "score": "0.5124969", "text": "function httpData(r,type) {\n // Get the content-type header\n var ct = r.getResponseHeader(\"content-type\");\n\n // If no default type was provided, determine if some\n // form of XML was returned from the server\n var data = !type && ct && ct.indexOf(\"xml\") >= 0;\n\n // Get the XML Document object if XML was returned from\n // the server, otherwise return the text contents returned by the server\n data = type == \"xml\" || data ? r.responseXML : r.responseText;\n\n // If the specified type is \"script\", execute the returned text\n // response as if it was JavaScript\n if ( type == \"script\" )\n eval.call( window, data );\n\n // Return the response data (either an XML Document or a text string)\n return data;\n }", "title": "" }, { "docid": "684b73ce10bd6b403993f8a190d2abf5", "score": "0.5110783", "text": "function LASReq_getXMLText() {\n return this.DOM.getUnderlyingXMLText();\n}", "title": "" }, { "docid": "3e3c9b977e6ea90daf2c63d5bd895747", "score": "0.5107792", "text": "function ws(r){return Object.prototype.toString.call(r)===\"[object Object]\"}", "title": "" }, { "docid": "b9d0caff2c1831eb2d7585fcf7455c1b", "score": "0.5102866", "text": "function _determineContent(response, requestData, payload) {\n var ret = payload;\n var error;\n\n if (!response.ok) {\n return payload;\n }\n\n try {\n ret = JSON.parse(payload);\n } catch (e) {\n if (!(e instanceof SyntaxError)) {\n return e;\n }\n\n e.payload = payload;\n error = e;\n }\n\n var status = response.status;\n\n if (response.ok && (status === 204 || status === 205 || requestData.method === 'HEAD')) {\n return;\n }\n\n {\n var message = `The server returned an empty string for ${requestData.method} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n\n if (payload === '') {\n ( Ember.warn(message, true, {\n id: 'ds.adapter.returned-empty-string-as-JSON'\n }));\n }\n }\n\n if (error) {\n {\n // eslint-disable-next-line no-console\n console.warn('This response was unable to be parsed as json.', payload);\n }\n\n return error;\n }\n\n return ret;\n }", "title": "" }, { "docid": "acd67340e4b860c9fa2b805d4a0ad8f6", "score": "0.50886863", "text": "function isXMLSchemaString(node) {\n\t return node.kind() == \"XMLSchemaString\" && node.RAMLVersion() == \"RAML08\";\n\t}", "title": "" }, { "docid": "d00ee8619d7e53c175058995315f6fa0", "score": "0.5074822", "text": "function xmlToString(xmlData) {\n\t\t\t\tvar xmlString;\n\n\t\t\t\t// IE\n\t\t\t\tif (window.ActiveXObject) {\n\t\t\t\t\txmlString = xmlData.xml;\n\t\t\t\t}\n\t\t\t\t// Code for Mozilla, Firefox, Opera, etc.\n\t\t\t\telse {\n\t\t\t\t\txmlString = (new XMLSerializer())\n\t\t\t\t\t\t\t.serializeToString(xmlData[0]);\n\t\t\t\t}\n\n\t\t\t\treturn xmlString;\n\t\t\t}", "title": "" }, { "docid": "7cbfd095ba6a6a15a5f5a53e0ad199de", "score": "0.5047434", "text": "function xmltoJson(data) {\n x2js = new X2JS();\n jsonObj = x2js.xml_str2json(data);\n $log.debug(jsonObj);\n obj = angular.fromJson(jsonObj);\n return jsonObj\n }", "title": "" }, { "docid": "23515a498c3bc988f81531f601e7cac6", "score": "0.5040962", "text": "function xrxStringToDom( thedoc )\r\n{\r\n\treturn( new DOMParser().parseFromString( thedoc, \"text/xml\" ) );\r\n}", "title": "" }, { "docid": "f006d5b4d1ce524d7d6fed905f2fc32a", "score": "0.5039123", "text": "function getXmlAsString(xmlDom){\n return (typeof XMLSerializer!==\"undefined\") ? \n (new window.XMLSerializer()).serializeToString(xmlDom) : \n xmlDom.xml;\n}", "title": "" }, { "docid": "f17fd196e6514d7eb19220c617220aa2", "score": "0.5031646", "text": "function XMLToString(oXML)\n{\n/* BROWSER VERSION\n\tif (window.ActiveXObject)\n\t\tvar out = oXML.xml;\n\telse\n\t\tvar out = (new XMLSerializer()).serializeToString(oXML);\n*/\n\t// NODE version\n\tvar out = (new xmldom.XMLSerializer()).serializeToString(oXML);\n\n\t// Remove any extra wrappers\n\tout = out.replace(/<\\/?wrapper(^>)*\\/?>/g, \"\");\n\tout = restoreEntities(out);\n\tout = out.replace(/> </g, '><');\t\t// Remove whitespace between tags\n\treturn out;\n}", "title": "" }, { "docid": "c4ca6554f7e914eb166a5ae3ff119b52", "score": "0.5016214", "text": "function isStatusCodeString(node) {\n\t return node.kind() == \"StatusCodeString\" && node.RAMLVersion() == \"RAML10\";\n\t}", "title": "" }, { "docid": "c465bee0925f5017aacdd6ca5cc999bd", "score": "0.50126475", "text": "function handleServerResponse()\n{\n\t\n // Lees de boodschap van de server\n var xmlResponse = xmlHttp.responseXML;\n // Het opvangen van mogelijke IE en opera fouten\n if (!xmlResponse || !xmlResponse.documentElement)\n throw(\"Invalid XML structure:\\n\" + xmlHttp.responseText);\n // Het opvangen van mogelijke Firefox fouten\n var rootNodeName = xmlResponse.documentElement.nodeName;\n if (rootNodeName == \"parsererror\") throw(\"Invalid XML structure\");\n // Het XML's document element verkrijgen\n xmlRoot = xmlResponse.documentElement; \n // Arrays met data ophalen\n titleArray = xmlRoot.getElementsByTagName(\"title\");\n datumArray = xmlRoot.getElementsByTagName(\"datum\");\n // HTML output genereren\n var html = \"\"; \n // Door de arrays heen lopen en de HTML structuur bouwen\n for (var i=0; i<titleArray.length; i++)\n html += titleArray.item(i).firstChild.data + \n \", \" + datumArray.item(i).firstChild.data + '\\r\\n';\n \n setTekst(html);\n \n}", "title": "" }, { "docid": "26a584e5d3fbd23d12776c658473e4b9", "score": "0.500857", "text": "function handlerServerResponse() {\n // move forward only if the transaction has completed\n if ( xmlHttpRequest.readyState == 4 ) {\n // status of 200 indicates the transaction completed successfully\n if ( xmlHttpRequest.status == 200 ) {\n/*\n // extract the XML retrieved from the server\n // xmlResponse = xmlHttpRequest.responseXML;\n\n // obtain the document element (the root element) of the XML structure\n // xmlDocumentElement = xmlResponse.documentElement;\n\n var resultadoArray = xmlDocumentElement.getElementsByTagName(\"resultado\");\n var html = \"\";\n for (var i=0; i<resultadoArray.length; i++)\n html += \"<p><i>\" + resultadoArray.item(i).firstChild.data +\"</i></p><br/>\";\n*/\n\n textResponse = xmlHttpRequest.responseText;\n\n textDocument = textResponse.toString();\n var resultadoArray = textDocument.split(' ');\n var html = \"\";\n for (var i=0; i<resultadoArray.length; i++)\n html += \"<p><i>\" + resultadoArray[i] +\"</i></p>\";\n\n\n // display the data received from the server\n document.getElementById(\"divResultados\").innerHTML = html;\n\n // restart sequence\n setTimeout('procesar()', 1000);\n } else { // a HTTP status different than 200 signals an error\n alert(\"Existen problemas de acceso al servidor: \" + xmlHttpRequest.statusText);\n }\n }\n}", "title": "" }, { "docid": "7752119643856116b8e4cbcdb4878d13", "score": "0.50075185", "text": "function handleResponse(callback,xmlhttp){\r\n // if xml file\r\n if(xmlhttp.responseXML)\r\n {\r\n try\r\n {\r\n ajaxResponse = xmlhttp.responseXML; // store callback global\r\n window[callback](); // execute callback from string\r\n }\r\n catch(err)\r\n {\r\n ajaxResponse=null;\r\n window[callback]();\r\n console.log(\"Error parsing XML file!\");\r\n }\r\n }\r\n\r\n //if plaintext -> probably json\r\n else if(xmlhttp.responseText)\r\n {\r\n // parse plain text to json.\r\n try{\r\n // handle as xml if plain text to\r\n //ajaxResponse = JSON.parse(xmlhttp.responseText);\r\n var parser = new DOMParser();\r\n var xmlDoc = parser.parseFromString(xmlhttp.responseText, \"application/xml\");\r\n ajaxResponse = xmlDoc;\r\n window[callback]();\r\n }\r\n catch(err){\r\n ajaxResponse=null;\r\n window[callback]();\r\n console.log(\"retrieving plain text!\");\r\n }\r\n }\r\n else{\r\n ajaxResponse=null;\r\n window[callback]();\r\n console.log(\"received null!\");\r\n }\r\n }", "title": "" }, { "docid": "0a274425240c1b88241369d148c936a5", "score": "0.5000741", "text": "function xmlToString(xmlData) {\n\n\tvar xmlString;\n\t// IE\n\tif (window.ActiveXObject) {\n\t\txmlString = xmlData.xml;\n\t}\n\t// code for Mozilla, Firefox, Opera, etc.\n\telse {\n\t\txmlString = (new XMLSerializer()).serializeToString(xmlData);\n\t}\n\treturn xmlString;\n}", "title": "" }, { "docid": "60bcd33f93a37cc2417310bbf94deb54", "score": "0.49963516", "text": "function toJson(str) { // Convert the XML output into JSON\n\t\tvar output = xt.xmlToJson(str);\n\t\tif(output[0].success)\n\t\t\trtValue = output[0].data[4].value;\n\t\telse\n\t\t\trtValue = false;\n\t\tif(async)\t// If it is in asynchronized mode.\n\t\t\tcb(rtValue); // Run the call back function against the returned value.\n\t\tstop = 1;\n\t}", "title": "" }, { "docid": "5b2274a70ad85a09f3d7093fc2973be6", "score": "0.49941704", "text": "function stringToXML(str)\n{\n\tif (typeof str === \"undefined\")\n\t\tstr = '';\n\n\t// Wrap raw strings\n\tstr = addWrapper(str+'');\n\n\t// Replace entities that aren't supported in XML\n\tstr = replaceEntities(str);\n\n\t// XML requires unclosed tags to have a slash before the closing angle bracket.\n\tstr = HTMLtoXHTML(str);\n\n\ttry {\n\t\tvar doc = new xmldom.DOMParser().parseFromString(str, \"text/xml\");\n\t}\n\tcatch(e) {\n\t\treturn 'fail';\n\t}\n\n\treturn doc;\n}", "title": "" }, { "docid": "48ffd4de0c0f5f7b78d837cdcf6ab7a8", "score": "0.49934092", "text": "function encodeXml(s) {\n var holder = document.createElement('div');\n holder.textContent = s;\n return holder.innerHTML;\n }", "title": "" }, { "docid": "7df8287f08b93bb5380abfd620735cbe", "score": "0.49848592", "text": "function funcAjax(data)//tractament de la cadena de text que retorna el servidor\n{\n if(data.substring(0, \"<!DOCTYPE\".length)==\"<!DOCTYPE\")//en aquet cas el loguin es correcte y entra al joc\n return true;\n else\n {\n var str = data.substring(data.indexOf(':')+3, data.indexOf('@\"'))\n\n //aqui es comprova el json rebut, aquesta part donava problemes si es feia directament data.resp per aixo s'ha tractat com si fosin cadenes normals y corrents\n if(data.substring(data.indexOf(':')-5,data.indexOf(':')-1) == \"resp\")\n apprise(str, location.href=\"index\");//aquest es el cas de registre, en cas d'anar be es mostra un missatge a l'usuari y carrega l'index\n else//en cas d'error tant en el loggin com el registre es mostra el missatge d'error\n apprise(str);\n return false\n //apprise es una llibreria de javascript que permet mostrar alerts dins de la web y no com a missatges del navegador, també permet personalitzarlos amb diferents opcions(confirm, verify, input, YesNo...)\n }\n}", "title": "" }, { "docid": "7df0b0f8057327d571ed55220588d48d", "score": "0.49786597", "text": "function XmlHttp() {}", "title": "" }, { "docid": "0979058f77737e3ab575495120bb58fe", "score": "0.4977438", "text": "function isStatusCodeString(node) {\n\t return node.kind() == \"StatusCodeString\" && node.RAMLVersion() == \"RAML08\";\n\t}", "title": "" }, { "docid": "329dcc435adcc85800c57f4bb2d41955", "score": "0.49719483", "text": "function xrxDomToString( doc )\r\n{\r\n\treturn new XMLSerializer().serializeToString( doc );\r\n}", "title": "" }, { "docid": "7fd916236a2904a7348a1cc11148e084", "score": "0.49703872", "text": "function parseResponse(response){\n var doc = helperXmlRpc.loadXml(response);\n var rootNode = doc.firstChild;\n if (!rootNode)\n return undefined;\n //else\n var node = helperXmlRpc.selectSingleNode(rootNode, '//fault');\n var isFault = (node != undefined);\n node = helperXmlRpc.selectSingleNode(rootNode, '//value');\n var value = xml2js.xml2js(node);\n if (isFault) {\n throw value;\n }\n //else\n return value;\n }", "title": "" }, { "docid": "c9d0d2a86fff52e3e04e9d14029d5409", "score": "0.49696067", "text": "function getErrorString(response) {\n var message;\n if (response === undefined || response === \"\") {\n message = \"Error not defined\";\n } else if (response.includes(\"DOCTYPE html\")) {\n message = response;\n } else if (response.includes(\"</ODM>\")) {\n var xml = $.parseXML(response);\n console.log(xml);\n message = $(xml).find('ODM').attr('mdsol:ErrorDescription');\n } else if (response.includes(\"</Response>\")) {\n message = response.split(\"ErrorClientResponseMessage=\")[1].split(\">\")[0];\n } else {\n message = response.split(\"mdsol:ErrorDescription=\")[1].split(\"xmlns=\")[0];\n }\n console.log(message);\n return message;\n}", "title": "" }, { "docid": "0c7bc78a42ac8aebc6fdc28ca343daf1", "score": "0.4962898", "text": "function parseAndSetXml(body) {\n var xml = null;\n var outputMsg = document.getElementById('outputMsg-xml');\n\n try {\n xml = pd.xml(body, true);\n } catch (ignoreIt) {\n console.warn('exception', ignoreIt);\n }\n\n if (xml != body) {\n outputMsg.value = xml;\n } else {\n outputMsg.value = 'Invalid XML';\n }\n}", "title": "" }, { "docid": "c7f7049f3d2e7319645fbf5883ec4a1a", "score": "0.49379084", "text": "function loadXMLString(txt)\n{\n var xmlDoc;\n try //Internet Explorer\n {\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\n xmlDoc.async = \"false\";\n xmlDoc.loadXML(txt);\n return(xmlDoc); \n }\n catch(e){\n try //Firefox, Mozilla, Opera, etc.\n {\n parser = new DOMParser();\n xmlDoc = parser.parseFromString(txt,\"text/xml\");\n return(xmlDoc);\n }\n catch(e){\n alert(e.message)\n }\n }\n return(null);\n}", "title": "" }, { "docid": "6c1e694366cb633ce8cc2a00ef4ee6e5", "score": "0.49213064", "text": "function outerHTML(node){\r\n\t\tif(XMLSerializer){\r\n\t\t\treturn node.outerHTML || new XMLSerializer().serializeToString(node);\r\n\t\t}else{\r\n\t\t\ttry {\r\n\t\t\t // Internet Explorer.\r\n\t\t\t return node.xml;\r\n\t\t\t }\r\n\t\t\t catch (e)\r\n\t\t\t {//Strange Browser ??\r\n\t\t\t alert('Xmlserializer not supported');\r\n\t\t\t }\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "11a914b260354460bd46090669767121", "score": "0.49181244", "text": "serialiseXMLVal (val){\n val = val.replace(/'/g, \"&#39;\");\n val = val.replace(/’/g, \"&#39;\");\n val = val.replace(/</g, \"&lt;\");\n val = val.replace(/>/g, \"&gt;\");\n return val;\n }", "title": "" }, { "docid": "6712dacd14b98f033ffb51a8770b6872", "score": "0.49170065", "text": "function getStrNodeValues(/* xml Element */elmnt) {\r\n\tvar returnValue = \"\";\r\n\ttry {\r\n\t\tif (elmnt.length > 0)\r\n\t\t\tif (elmnt[0].childNodes.length > 0)\r\n\t\t\t\treturnValue = elmnt[0].childNodes[0].nodeValue;\r\n\t} catch (ex) {\r\n\t\terrMessage = errMessage + \"\\n getStrNodeValues() : \" + ex;\r\n\t}\r\n\treturn returnValue;\r\n}", "title": "" }, { "docid": "547f7dc4dbc984f2f59f24756bef924a", "score": "0.49162063", "text": "function checkConnectionStatus() {\n\tif (HttpReq.readyState == 4 && HttpReq.status == 200) {\n\t\tvar xml = HttpReq.responseXML;\n\t\talert(HttpReq.responseText);\n\t}\n}", "title": "" }, { "docid": "2c8108a363f04202ede592a8fb3196cb", "score": "0.49140587", "text": "parseToObject (htmlMarkup) {\n check(htmlMarkup, String);\n }", "title": "" }, { "docid": "eef57f68c3ba91014c6acf441c8f6c0a", "score": "0.49074215", "text": "function xml2boolean_(input) {\n var value = helperXmlRpc.getTextContent(input, []).toLowerCase();\n return isTrue_[value] || false;\n }", "title": "" }, { "docid": "9a2997c6569640541666912104ef7630", "score": "0.49060133", "text": "function hc_domimplementationfeaturexml() {\n var success;\n var doc;\n var domImpl;\n var state;\n doc = load(\"hc_staff\");\n domImpl = doc.implementation;\n\n\tif(\n\t\n\t(builder.contentType == \"text/html\")\n\n\t) {\n\tstate = domImpl.hasFeature(\"html\",\"1.0\");\nassertTrue(\"supports_html_1.0\",state);\n\n\t}\n\t\n\t\telse {\n\t\t\tstate = domImpl.hasFeature(\"xml\",\"1.0\");\nassertTrue(\"supports_xml_1.0\",state);\n\n\t\t}\n\t\n}", "title": "" }, { "docid": "abe088469273ea0ef4d8af9ed82afbef", "score": "0.48916554", "text": "function procesarXML(xml) {\n var result = $(xml).find(\"CodigoProceso\").text();\n if (result != null) {\n\n if (result == 0) {\n $('#lblResumen').text(\"Complemento conectado.\");\n this._validaPluging = true;\n $('#btnCargaImagen').attr('disabled', false);\n }\n\n //result = 5, significa que se presento un error en el servidor local o se cancelo la carga de la imagen.\n if (result == 5) { $('#lblResumen').text($(xml).find(\"CadenaError\").text()); console.log($(xml).find(\"CadenaError\").text()); $('#btnCargaImagen').attr('disabled', false); }\n\n //result = 2, Significa que el programa informa cuanta cantidad de imagenes escaneadas va a enviar.\n if (result == 2) {\n $('#lblResumen').text(\"Procesando \" + $(xml).find(\"partes\").text() + \" imagenes.\"); this._Imagen = \"\";\n document.getElementById('btnCargaImagen').enabled = true;\n $('#btnCargaImagen').attr('disabled', true);\n this._nuevoImagenesAProcesar = $(xml).find(\"partes\").text();\n this._conteoImagenes = 0;\n }\n\n //result = 3, Significa que la imagen se escaneo y se empezara a enviar al socket de la pagina.\n if (result == 3) { this._conteoImagenes = this._conteoImagenes + 1; this._Imagen = \"\"; document.getElementById('btnCargaImagen').enabled = true; $('#btnCargaImagen').attr('disabled', true); }\n\n //result = 6, Significa que se envia una parte de la imagen del servidor local al socket web.\n if (result == 6) { $('#lblResumen').text(\"Recibiendo imagen \" + this._conteoImagenes + \" de \" + this._nuevoImagenesAProcesar + \".\"); console.log(\"Recibiendo paquete\"); this._Imagen += $(xml).find(\"Imagen\").text(); $('#btnCargaImagen').attr('disabled', true);; }\n\n //result = 7, Significa que el envio por partes finalizo y se debe procesar la imagen.\n if (result == 7) {\n // se evalua la matriz donde se almacenan las imagenes para determinar en que lugar de la matriz quedara \n // la nueva imagen\n evaluaMatriz();\n if (_ConteoMatrizImagen != -1) {\n console.log(\"Procesando paquetes recibidos\");\n\n $('#lblResumen').text($('#lblResumen').text() + \" (Procesando imagen...)\");\n var _width = $(xml).find(\"width\").text();\n var _height = $(xml).find(\"height\").text();\n var _nombreArchivo = $(xml).find(\"NombreArchivo\").text();\n\n const objItemImagen = new ItemImagen(this._Imagen, _width, _height, _nombreArchivo);\n _MatrizImagenes[_ConteoMatrizImagen] = objItemImagen;\n document.getElementById(\"CuerpoConteImagen\").innerHTML += cargarItemImagen(objItemImagen, _ConteoMatrizImagen);\n if (this._nuevoImagenesAProcesar == this._conteoImagenes || this._nuevoImagenesAProcesar == 0) {\n contarDetalles();\n this._nuevoImagenesAProcesar = 0;\n this._nuevoImagenesAProcesar = 0;\n }\n this._Imagen = \"\";\n $('#btnCargaImagen').attr('disabled', false);\n\n } else {\n $('#lblResumen').text(\"Solo puede cargar 40 imagenes.\")\n console.log(\"Solo puede cargar 20 imagenes.\");\n }\n }\n\n //result = 38, Significa que se empieza a enviar texto OCR\n if (result == 38) { this._textOCR = \"\"; }\n\n //result = 39, Recepción de cadena OCR\n if (result == 39) { this._textOCR += $(xml).find(\"NombreArchivo\").text(); }\n\n //result = 40, Finalización de cadena OCR\n if (result == 40) { mostrarMensaje(1, this._textOCR); }\n\n\n //result = 33, Significa que la imagen se escaneo y se empezara a enviar al socket de la pagina.\n if (result == 33) { $('#lblResumen').text(\"Inicia generación PDF.\"); console.log(\"Inicia nueva carga de pdf\"); this._Imagen = \"\"; document.getElementById('btnCargaImagen').enabled = true; $('#btnCargaImagen').attr('disabled', true); }\n\n //result = 36, Significa que se envia una parte de la imagen del servidor local al socket web.\n if (result == 36) { $('#lblResumen').text(\"Recibiendo PDF...\"); console.log(\"Recibiendo paquete PDF\"); this._Imagen += $(xml).find(\"Imagen\").text(); $('#btnCargaImagen').attr('disabled', true);; }\n\n //result = 7, Significa que el envio por partes finalizo y se debe procesar la imagen.\n if (result == 37) {\n // se evalua la matriz donde se almacenan las imagenes para determinar en que lugar de la matriz quedara \n // la nueva imagen\n _ConteoMatrizImagen[0] = null;\n console.log(\"Subiendo...\");\n $('#lblResumen').text(\"Subiendo...\");\n const objItemImagen = new ItemImagen(this._Imagen, 0, 0);\n _MatrizImagenes[0] = objItemImagen;\n this._Imagen = \"\";\n\n var fd = new FormData();\n var Imagen = convertirStrinMatriz(this._MatrizImagenes[0].getBitsImagen(), 'image/pdf');\n //Imagen.filename = \"Imagen\" + i;\n fd.append(\"ImagenEscanner\", Imagen);\n\n sleep(1000);\n $.ajax({\n url: \"../Radicacion/subirArchivos?xIDSession=0\",\n data: fd,\n secureuri: false,\n type: 'POST',\n processData: false,\n contentType: false,\n dataType: 'JSON',\n success: function (data, status) {\n if (data.ResultadoProceso) {\n var objResultado = data;\n if (objResultado.ResultadoProceso) {\n for (var i = 0; i < objResultado.objResultado.length; i++) {\n lstSoportes.push(objResultado.objResultado[i]);\n }\n cargarListadoSoportes();\n } else {\n mostrarMensaje(2, objResultado.MensajeProceso);\n }\n setTimeout(function () {\n $('#fileAbjunto').fileinput('reset');\n $('#fileAbjunto').fileinput('refresh');\n }, 300);\n $('#lblResumen').text(\"Imagen(es) subida(s).\");\n } else {\n mostrarMensaje(2, data.MensajeProceso);\n }\n },\n error: function (data, status, e) {\n console.log(\"error al ejecutar proceso final.\" + e.message);\n $('#btnCargaImagen').attr('disabled', false);\n }\n });\n }\n }\n}", "title": "" }, { "docid": "2738ec31c6b23d833551c62e07173a7b", "score": "0.48831844", "text": "function cleanXmlResponse(xmlDom) {\n const xmlString = getXmlAsString(xmlDom) || '';\n return xmlString.replace('\\ufeff', '');\n}", "title": "" }, { "docid": "7c1c844827e66249d13676a5ce4a6be9", "score": "0.48804572", "text": "function istext(value) {\n return 'string' === typeof(value);\n }", "title": "" }, { "docid": "61df00d8bc297610ce61f4ae1a302f19", "score": "0.48791197", "text": "function parseFromString(xmlString, outputType) {\n var\n doc;\n \n // Firefox/Opera/IE throw errors on unsupported types\n try {\n doc = (new DOMParser()).parseFromString(xmlString, outputType);\n if (doc) {\n // Output type is natively supported\n return doc;\n }\n } catch (ex) {\n }\n \n // HTML-Extension\n if (/^\\s*text\\/html\\s*(?:;|$)/i.test(outputType)) {\n doc = document.implementation.createHTMLDocument(\"\");\n if (markup.toLowerCase().indexOf('<!doctype') > -1) {\n doc.documentElement.innerHTML = markup;\n }\n else {\n doc.body.innerHTML = markup;\n }\n return doc;\n }\n \n // Unsupported output type\n return null;\n }", "title": "" }, { "docid": "bd2b323ce0a205ea2328bd212c06799b", "score": "0.48785365", "text": "function _determineContent(response, requestData, payload) {\n var ret = payload;\n var error;\n\n if (!response.ok) {\n return payload;\n }\n\n var status = response.status;\n var payloadIsEmpty = payload === '' || payload === null;\n var statusIndicatesEmptyResponse = status === 204 || status === 205 || requestData.method === 'HEAD';\n\n {\n if (payloadIsEmpty && !statusIndicatesEmptyResponse) {\n var message = `The server returned an empty string for ${requestData.method} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n\n if (payload === '') {\n ( Ember.warn(message, {\n id: 'ds.adapter.returned-empty-string-as-JSON'\n }));\n }\n }\n }\n\n if (response.ok && (statusIndicatesEmptyResponse || payloadIsEmpty)) {\n return;\n }\n\n try {\n ret = JSON.parse(payload);\n } catch (e) {\n if (!(e instanceof SyntaxError)) {\n return e;\n }\n\n e.payload = payload;\n error = e;\n }\n\n if (error) {\n {\n // eslint-disable-next-line no-console\n console.warn('This response was unable to be parsed as json.', payload);\n }\n\n return error;\n }\n\n return ret;\n }", "title": "" }, { "docid": "21e2b0a3d0a72f63783967116c1853a6", "score": "0.48783076", "text": "function gotAdd(xmlDoc)\n{\n var\troot\t= xmlDoc.documentElement;\n if (root)\n { // valid XML\n var statusElt = document.getElementById('status');\n var p = document.createElement(\"p\");\n p.innerHTML = new XMLSerializer().serializeToString(root).replace(/\\&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');\n statusElt.appendChild(p);\n } // valid XML\n else\n alert(\"uploadGedcom: gotAdd: \" + new XMLSerializer().serializeToString(xmlDoc));\n\n if (next < lines.length)\n getNextTag(); // process next tag\n}", "title": "" }, { "docid": "aee9a073b731075d66c8988cd9e21e8a", "score": "0.4867603", "text": "function isResponseMessage(message) {\n var candidate = message;\n return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);\n}", "title": "" }, { "docid": "d4bde5e6af5a92f353ee225e1448cbc1", "score": "0.48657724", "text": "function StXMLContent(nd)\n{\n\tvar i;\n\tvar st = \"\";\n\n\tif (!nd)\n\t\treturn st;\n\n\tfor (i = 0; i < nd.childNodes.length; i++)\n\t\t{\n\t\tst += nd.childNodes.item(i).xml;\n\t\t}\n\treturn st;\n}", "title": "" }, { "docid": "8df2d39ad41cb03a995c5f554f5db6c0", "score": "0.48642805", "text": "function isResponseMessage(message) {\r\n let candidate = message;\r\n return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);\r\n}", "title": "" }, { "docid": "7a04917ccc01053aa1f06be9b21113b7", "score": "0.48596168", "text": "function ParseXML() {\n this.supportedContentTypes = [\n 'text/xml', 'application/xml'\n ];\n}", "title": "" }, { "docid": "1b225c0f0f0517b13a0d26e28d203012", "score": "0.48587832", "text": "function parseXML(data) {\n let xml;\n\n if (!data || typeof data !== 'string') {\n return null;\n } // Support: IE 9 - 11 only\n // IE throws on parseFromString with invalid input.\n\n\n try {\n xml = new window.DOMParser().parseFromString(data, 'text/xml');\n } catch (e) {\n xml = undefined;\n }\n\n if (true\n /* DEBUG */\n ) {\n if (!xml || xml.getElementsByTagName('parsererror').length) {\n (true && !(false) && Ember.assert(\"Invalid XML: \".concat(data)));\n }\n }\n\n return xml;\n }", "title": "" }, { "docid": "dca735db0f21008b4585a83f758872b4", "score": "0.4857556", "text": "function getResponseJSONBuscadorTienda(respHtml) {\n var type = typeof respHtml;\n var dataJSON = null;\n if (type == 'string') {\n dataJSON = jQuery.parseJSON(respHtml);\n } else {\n dataJSON = respHtml;\n }\n return dataJSON;\n}", "title": "" }, { "docid": "dca735db0f21008b4585a83f758872b4", "score": "0.4857556", "text": "function getResponseJSONBuscadorTienda(respHtml) {\n var type = typeof respHtml;\n var dataJSON = null;\n if (type == 'string') {\n dataJSON = jQuery.parseJSON(respHtml);\n } else {\n dataJSON = respHtml;\n }\n return dataJSON;\n}", "title": "" }, { "docid": "52f800325addd8c022955a22ad00bd4d", "score": "0.48517478", "text": "function expectStringResponse(func) {\n return /* Expect */[\n /* TextResponseType */5,\n (function (param) {\n var body = param[/* body */3];\n if (typeof body === \"number\") {\n return /* Error */__(1, [\"Non-text response returned\"]);\n } else if (body.tag === 5) {\n return _1(func, body[0]);\n } else {\n return /* Error */__(1, [\"Non-text response returned\"]);\n }\n })\n ];\n}", "title": "" }, { "docid": "90f17fb4f42f2632ee1defa588039202", "score": "0.48494342", "text": "function handleResponse() {\n\tvar xmlResponse = xmlHttp.responseXML;\n\t// in root I have this what I have in response section xml root is simply a response\n\troot = xmlResponse.documentElement;\n\t// in names I store what is in tag name \"name\" collected.\n\tnames = root.getElementsByTagName('name')\n\tssns = root.getElementsByTagName('ssn')\n\n\t// loop through \n// names does not matter because both names and ssns have the sane long\n\tvar stuff = \"\" ;\n\tfor (var i=0; i<names.length; i++) {\n\t\t// first child is a first element placed inside the other (parent)\n\t\t\tstuff += names.item(i).firstChild.data + \"-\" + ssns.item(i).firstChild.data + \"</br>\";\n\t}\n\n\ttheD = document.getElementById('theD')\n\ttheD.innerHTML = stuff;\n}", "title": "" }, { "docid": "1c144ecdb030eea4dcc91cf0a809dba0", "score": "0.4846751", "text": "function ser(r){\n return ( instance ( r ) || typeof r === 'string' || r === false );\n }", "title": "" }, { "docid": "58c7b1d0afeeef49d10970c6ef3b9b29", "score": "0.48453", "text": "function createXmlObj(){\r\n var httprequest = false;\r\n if (window.XMLHttpRequest) { // if Mozilla, Safari etc\r\n httprequest = new XMLHttpRequest();\r\n if (httprequest.overrideMimeType)\r\n httprequest.overrideMimeType('text/xml');\r\n }\r\n else if (window.ActiveXObject){ // if IE\r\n try {\r\n httprequest=new ActiveXObject(\"Msxml2.XMLHTTP\");\r\n } \r\n catch (e){\r\n try{\r\n httprequest=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n }\r\n catch (e){}\r\n }\r\n }\r\n return httprequest;\r\n}", "title": "" }, { "docid": "e1b6f9208dcb0d44311d702973fb991c", "score": "0.4837683", "text": "function handleServerResponseEscrutinioTXT()\n{\n\t// retrieve the server's response packaged as an XML DOM object\n\t//var xmlResponse = xmlHttpEscrutinio.responseXML;\n\t\n\t// catching potential errors with IE and Opera\n\t//if (!xmlResponse || !xmlResponse.documentElement)\n\t//throw(\"Invalid XML structure:\\n\" + xmlHttpEscrutinio.responseText);\n\t//alert(\"Entro 1\");\n\t// catching potential errors with Firefox\n\t//var rootNodeName = xmlResponse.documentElement.nodeName;\n\t//if (rootNodeName == \"parsererror\")\n\t//throw(\"Invalid XML structure:\\n\" + xmlHttpEscrutinio.responseText);\n\t\t//alert(\"Entro 2\");\n\t// getting the root element (the document element)\n\t//xmlRoot = xmlResponse.documentElement;\n\t// testing that we received the XML document we expect\n\t//if (rootNodeName != \"response\" || !xmlRoot.firstChild)\n\t//throw(\"Invalid XML structure:\\n\" + xmlHttpEscrutinio.responseText);\n\t\t//alert(\"Entro 3\");\n\t// the value we need to display is the child of the root <response> element\n\t//responseText = xmlRoot.firstChild.data;\n\t// display the user message\n\t//myDiv = document.getElementById(\"myDivElement\");\n\t//myDiv.innerHTML = \"Server says the answer is: \" + responseText;\n}", "title": "" }, { "docid": "64ef851a0b49305d4784939f035737db", "score": "0.48324838", "text": "function parseRegResponse(responseXML){\t\r\n\t var boolResult = (responseXML.getElementsByTagName(\"result\")[0]).childNodes[0].nodeValue;\r\n\t var strMsg = (responseXML.getElementsByTagName(\"message\")[0]).childNodes[0].nodeValue;\r\n\t // if registration sucessful, then update button text and function\r\n\t if(boolResult == \"true\"){\r\n\t\t $(\"input\").attr(\"disabled\", true);\r\n\t\t $(\"select\").attr(\"disabled\", true);\r\n\t\t $(\"textarea\").attr(\"disabled\", true);\r\n\t\t $(\"button\").attr(\"disabled\", true);\r\n\t\t $(\"#lbImg\", \"#lightBox\").removeClass(\"load\").addClass(\"good\");\r\n\t\t\t$.fn.smartLightBox.closeLightBox(4000);\r\n\t\t setTimeout(\"window.location = '../index.html'\",4500);\r\n\t }\r\n\t else{\r\n\t\t $(\"#lbImg\", \"#lightBox\").removeClass(\"load\").addClass(\"alert\");\r\n\t\t $.fn.smartLightBox.closeLightBox(2000);\r\n\t\t}\r\n\t return strMsg;\r\n}", "title": "" }, { "docid": "902d11b33ebe93fd5f1ae6b3dc9b1ace", "score": "0.4829536", "text": "function exportToXML(res,establecimientos,productoId){\n\n var xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?> \\n';\n xml = xml +' <bodega>\\n'\n\n var test;\n\n for(i= 0; i < establecimientos.length;i++){\n\n xml = xml + ' <establecimiento establecimientoId=\\''+ establecimientos[i].establecimientoId+'\\'>' +establecimientos[i].name+'</establecimiento>\\n';\n xml = xml + ' \t<productos>\\n';\n for(j=0; j< establecimientos[i].bodega.length;j++){\n\n if(productoId == -1 || establecimientos[i].bodega[j].productoId.productoId ==productoId){\n xml = xml + ' \t<producto productoID=\\''+ establecimientos[i].bodega[j].productoId.productoId+'\\' name=\\''+establecimientos[i].bodega[j].productoId.name+'\\'>\\n';\n xml = xml + ' \t <stock>'+establecimientos[i].bodega[j].stock +'</stock>\\n';\n xml = xml + ' \t <price>\\n';\n xml = xml + ' \t <value>'+establecimientos[i].bodega[j].price.value+'</value>\\n';\n xml = xml + ' \t <currency>'+establecimientos[i].bodega[j].price.currency+'</currency>\\n';\n xml = xml + ' \t </price>\\n';\n xml = xml + ' \t</producto>\\n';\n }\n }\n xml = xml + ' \t</productos>\\n';\n\n\n }\n xml = xml+' </bodega>'\n console.log(xml);\n res.status(200)\n .set('Content-Type','text/xml')\n .send(xml);\n}", "title": "" }, { "docid": "c2e8ec66d04a80db2da5bee9b8a581e5", "score": "0.4822011", "text": "function gestionarXml(dadesXml){\n var xmlDoc = dadesXml.responseXML; //Parse XML to xmlDoc\n \n //Pregunta TEXT\n //Recuperamos el título y la respuesta correcta de Input, guardamos el número secreto\n \n var tituloInput=xmlDoc.getElementsByTagName(\"title\")[0].innerHTML;\n ponerDatosInputHtml(tituloInput);\n respuestaText=xmlDoc.getElementsByTagName(\"answer\")[0].innerHTML;\n \n //Pregunta SELECT\n //Recuperamos el título y las opciones, guardamos la respuesta correcta\n \n var tituloSelect=xmlDoc.getElementsByTagName(\"title\")[1].innerHTML;\n var opcionesSelect = [];\n var nopt2 = xmlDoc.getElementById(\"p002\").getElementsByTagName('option').length;\n for (i = 0; i < nopt2; i++) { \n opcionesSelect[i] = xmlDoc.getElementById(\"p002\").getElementsByTagName('option')[i].innerHTML;\n }\n ponerDatosSelectHtml(tituloSelect,opcionesSelect);\n respuestaSelect=parseInt(xmlDoc.getElementsByTagName(\"answer\")[1].innerHTML);\n\n //Pregunta CHECKBOX\n //Recuperamos el título y las opciones, guardamos las respuestas correctas\n \n var tituloCheckbox = xmlDoc.getElementsByTagName(\"title\")[2].innerHTML;\n var opcionesCheckbox = [];\n var nopt3 = xmlDoc.getElementById(\"p003\").getElementsByTagName('option').length;\n for (i = 0; i < nopt3; i++) { \n opcionesCheckbox[i]=xmlDoc.getElementById(\"p003\").getElementsByTagName('option')[i].innerHTML;\n } \n ponerDatosCheckboxHtml(tituloCheckbox,opcionesCheckbox);\n var nres = xmlDoc.getElementById(\"p003\").getElementsByTagName('answer').length;\n for (i = 0; i < nres; i++) { \n respuestasCheckbox[i]=xmlDoc.getElementById(\"p003\").getElementsByTagName(\"answer\")[i].innerHTML;\n }\n \n //Pregunta MULTIPLE\n //Recuperamos el título y las opciones, guardamos las respuestas correctas\n \n var tituloMultiple = xmlDoc.getElementsByTagName(\"title\")[3].innerHTML;\n var opcionesMultiple = [];\n var nopt4 = xmlDoc.getElementById(\"p004\").getElementsByTagName('option').length;\n for (i = 0; i < nopt4; i++) { \n opcionesMultiple[i] = xmlDoc.getElementById(\"p004\").getElementsByTagName('option')[i].innerHTML;\n }\n ponerDatosMultipleHtml(tituloMultiple,opcionesMultiple);\n var nresMS = xmlDoc.getElementById(\"p004\").getElementsByTagName('answer').length;\n for (i = 0; i < nresMS; i++) { \n respuestasMultiple[i]=xmlDoc.getElementById(\"p004\").getElementsByTagName(\"answer\")[i].innerHTML;\n }\n \n //Pregunta RADIO\n //Recuperamos el título y las opciones, guardamos las respuestas correctas\n \n var tituloRadio = xmlDoc.getElementsByTagName(\"title\")[4].innerHTML;\n var opcionesRadio = [];\n var nopt = xmlDoc.getElementById(\"p005\").getElementsByTagName('option').length;\n for (i = 0; i < nopt; i++) { \n opcionesRadio[i]=xmlDoc.getElementById(\"p005\").getElementsByTagName('option')[i].childNodes[0].nodeValue;\n } \n ponerDatosradio(tituloRadio,opcionesRadio);\n var nres = xmlDoc.getElementById(\"p005\").getElementsByTagName('answer').length;\n for (i = 0; i < nres; i++) { \n respuestasRadio[i]=xmlDoc.getElementById(\"p005\").getElementsByTagName(\"answer\")[i].innerHTML;\n }\n \n //Pregunta TEXT 2\n //Recuperamos el título y la respuesta correcta de Input, guardamos el número secreto\n var tituloInput2 = xmlDoc.getElementsByTagName(\"title\")[5].innerHTML;\n ponerDatosInputHtml2(tituloInput2);\n respuestaText2=xmlDoc.getElementsByTagName(\"answer\")[5].innerHTML;\n \n //Pregunta SELECT 2\n //Recuperamos el título y las opciones, guardamos la respuesta correcta\n var tituloSelect2 = xmlDoc.getElementsByTagName(\"title\")[6].innerHTML;\n var opcionesSelect2 = [];\n var nopt7 = xmlDoc.getElementById(\"p007\").getElementsByTagName('option').length;\n for (i = 0; i < nopt7; i++) { \n opcionesSelect2[i] = xmlDoc.getElementById(\"p007\").getElementsByTagName('option')[i].innerHTML;\n }\n ponerDatosSelectHtml2(tituloSelect2,opcionesSelect2);\n respuestaSelect2 = parseInt(xmlDoc.getElementsByTagName(\"answer\")[0].innerHTML);\n \n // Pregunta CHECKBOX 2\n //Recuperamos el título y las opciones, guardamos las respuestas correctas\n var tituloCheckbox2 = xmlDoc.getElementsByTagName(\"title\")[7].innerHTML;\n var opcionesCheckbox2 = [];\n var nopt8 = xmlDoc.getElementById(\"p008\").getElementsByTagName('option').length;\n for (i = 0; i < nopt8; i++) { \n opcionesCheckbox2[i]=xmlDoc.getElementById(\"p008\").getElementsByTagName('option')[i].innerHTML;\n } \n ponerDatosCheckboxHtml2(tituloCheckbox2,opcionesCheckbox2);\n var nres = xmlDoc.getElementById(\"p008\").getElementsByTagName('answer').length;\n for (i = 0; i < nres; i++) { \n respuestasCheckbox2[i]=xmlDoc.getElementById(\"p008\").getElementsByTagName(\"answer\")[i].innerHTML;\n }\n \n //Pregunta MULTIPLE 2\n //Recuperamos el título y las opciones, guardamos las respuestas correctas\n \n var tituloMultiple2 = xmlDoc.getElementsByTagName(\"title\")[8].innerHTML;\n var opcionesMultiple2 = [];\n var nopt9 = xmlDoc.getElementById(\"p009\").getElementsByTagName('option').length;\n for (i = 0; i < nopt9; i++) { \n opcionesMultiple2[i] = xmlDoc.getElementById(\"p009\").getElementsByTagName('option')[i].innerHTML;\n }\n ponerDatosMultipleHtml2(tituloMultiple2,opcionesMultiple2);\n var nresMS2 = xmlDoc.getElementById(\"p009\").getElementsByTagName('answer').length;\n for (i = 0; i < nresMS2; i++) { \n respuestasMultiple2[i]=xmlDoc.getElementById(\"p009\").getElementsByTagName(\"answer\")[i].innerHTML;\n }\n\n //Pregunta RADIO 2\n //Recuperamos el título y las opciones, guardamos las respuestas correctas\n \n var tituloRadio2 = xmlDoc.getElementsByTagName(\"title\")[9].innerHTML;\n var opcionesRadio2 = [];\n var nopt = xmlDoc.getElementById(\"p010\").getElementsByTagName('option').length;\n for (i = 0; i < nopt; i++) { \n opcionesRadio2[i]=xmlDoc.getElementById(\"p010\").getElementsByTagName('option')[i].childNodes[0].nodeValue;\n } \n ponerDatosradio2(tituloRadio2,opcionesRadio2);\n var nres = xmlDoc.getElementById(\"p010\").getElementsByTagName('answer').length;\n for (i = 0; i < nres; i++) { \n respuestasRadio2[i]=xmlDoc.getElementById(\"p010\").getElementsByTagName(\"answer\")[i].innerHTML;\n }\n}", "title": "" }, { "docid": "45837d04734db4e5a4e3b5069743a0e9", "score": "0.48220047", "text": "function serialize(node) // {{{\n {\n if (XMLSerializer != 'undefined')\n return new XMLSerializer().serializeToString(node);\n else if (node.xml)\n return node.xml;\n\n throw \"XML serialization not supported by browser!\";\n }", "title": "" }, { "docid": "e7e445b9db7b21deeb87fec424f82857", "score": "0.48219493", "text": "function isXMLBody(node) {\n\t return node.kind() == \"XMLBody\" && node.RAMLVersion() == \"RAML08\";\n\t}", "title": "" }, { "docid": "e674dac355728d7ce2041d4907330d73", "score": "0.48208985", "text": "function isRawContent(node) {\nreturn 'XMP' === node.tagName;\n}", "title": "" }, { "docid": "1f3336c55a181bf8758621bd4102e32f", "score": "0.4817819", "text": "function get_xml_response(username, class_id, group_id, xml, toolbar){\n if(xml == undefined){\n xml = '{}';\n }\n appletSetExtXML(xml, toolbar, null, group_id);\n}", "title": "" }, { "docid": "840cbad3ab7b5de7b64bed5e5ab39da2", "score": "0.48104063", "text": "function handleResponse(){\n\t\n\tvar xmlResponse = xmlHttp.responseXML; \t\t// grab the entire xml file.\n\troot = xmlResponse.documentElement; \t\t// gets the root element of file\n\tnames = root.getElementsByTagName(\"name\"); // gets all the information of the tag 'name';\n\tssns = root.getElementsByTagName(\"ssn\"); \t// gets all the information of the tag 'ssn';\n\tvar stuff = \"\";\n\tfor(var i=0; i < names.length; i++){\t\t// can also have ssns.length \n\t\tstuff += names.item(i).firstChild.data + \" - \" + ssns.item(i).firstChild.data + \"<br/>\" ;\n\t}\n\t\n\ttheD = document.getElementById(\"theD\");\n\ttheD.innerHTML = stuff;\n}", "title": "" }, { "docid": "21cf29d2f61ca7feb72bd325f5cab66b", "score": "0.4809204", "text": "function c(a){var b;return typeof a.namespaceURI==F||null===(b=a.namespaceURI)||\"http://www.w3.org/1999/xhtml\"==b}", "title": "" }, { "docid": "a5ea298621dd06754256a05134fde5ad", "score": "0.4795737", "text": "function verificarApertura_paraRecarga() {\n aperturaDatos = {\n 'opcion': 2\n };\n $.ajax({\n url: \"/syscontrol/aperturaSERVLETXML\",\n type: 'POST',\n data: aperturaDatos,\n cache: false,\n success: function (resp) {\n var v_estadoabierto;\n var v_estadocerrado;\n// if (JSON.stringify(resp) != '[]') {\n $.each(resp, function (indice, valor) {\n if (valor.estado === 'ABIERTA') {\n v_estadoabierto = 1;\n\n } else {\n v_estadocerrado = 2;\n\n }\n\n });\n// }else{\n// \n// }\n\n if (v_estadoabierto === 1) {\n $('#btnguardarecarga').show();\n $('#btnguardargiro').show();\n\n } else {\n\n }\n\n }\n\n });\n}", "title": "" }, { "docid": "d9e74a3e04d3a6e5ccaa551bf057de72", "score": "0.47895083", "text": "function gestionarXml(dadesXml) {\r\n var xmlDoc = dadesXml.responseXML; /*Parse XML to xmlDoc*/\r\n\r\n /*SELECT*/\r\n /*Recuperamos el título y las opciones, guardamos la respuesta correcta*/\r\n for (numPregunta = 0; numPregunta < 2; numPregunta++) {\r\n var tituloSelect = xmlDoc.getElementsByTagName(\"title\")[numPregunta].innerHTML;\r\n var opcionesSelect = [];\r\n var nopt = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('option').length;\r\n for (i = 0; i < nopt; i++) {\r\n opcionesSelect[i] = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('option')[i].innerHTML;\r\n }\r\n ponerDatosSelectHtml(tituloSelect, opcionesSelect, numPregunta);\r\n respuestaSelect[numPregunta] = parseInt(xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName(\"answer\")[0].innerHTML);\r\n }\r\n\r\n /*SELECT MULTIPLE*/\r\n /*Recuperamos el título y las opciones, guardamos las respuestas correctas*/\r\n for (numPregunta = 2; numPregunta < 4; numPregunta++) {\r\n var tituloMultiple = xmlDoc.getElementsByTagName(\"title\")[numPregunta].innerHTML;\r\n var opcionesMultiple = [];\r\n var nopt = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('option').length;\r\n for (i = 0; i < nopt; i++) {\r\n opcionesMultiple[i] = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('option')[i].innerHTML;\r\n }\r\n ponerDatosMultipleHtml(tituloMultiple, opcionesMultiple, numPregunta);\r\n var nres = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('answer').length;\r\n respuestasMultiple[numPregunta] = [];\r\n for (i = 0; i < nres; i++) {\r\n respuestasMultiple[numPregunta][i] = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName(\"answer\")[i].innerHTML;\r\n }\r\n }\r\n\r\n /*TEXT*/\r\n /*Recuperamos el título y la respuesta correcta del input text*/\r\n for (numPregunta = 4; numPregunta < 6; numPregunta++) {\r\n var tituloInput = xmlDoc.getElementsByTagName(\"title\")[numPregunta].innerHTML;\r\n ponerDatosInputHtml(tituloInput, numPregunta);\r\n respuestaText[numPregunta] = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName(\"answer\")[0].innerHTML;\r\n }\r\n\r\n /*RADIO*/\r\n /*Recuperamos el título y las opciones, guardamos la respuesta correcta*/\r\n for (numPregunta = 6; numPregunta < 8; numPregunta++) {\r\n var tituloRadio = xmlDoc.getElementsByTagName(\"title\")[numPregunta].innerHTML;\r\n var opcionesRadio = [];\r\n var nopt = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('option').length;\r\n for (i = 0; i < nopt; i++) {\r\n opcionesRadio[i] = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('option')[i].innerHTML;\r\n }\r\n ponerDatosRadioHtml(tituloRadio, opcionesRadio, numPregunta);\r\n respuestaRadio[numPregunta] = parseInt(xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName(\"answer\")[0].innerHTML);\r\n }\r\n\r\n /*CHECKBOX*/\r\n /*Recuperamos el título y las opciones, guardamos las respuestas correctas*/\r\n for (numPregunta = 8; numPregunta < 10; numPregunta++) {\r\n var tituloCheckbox = xmlDoc.getElementsByTagName(\"title\")[numPregunta].innerHTML;\r\n var opcionesCheckbox = [];\r\n var nopt = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('option').length;\r\n for (i = 0; i < nopt; i++) {\r\n opcionesCheckbox[i] = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('option')[i].innerHTML;\r\n }\r\n ponerDatosCheckboxHtml(tituloCheckbox, opcionesCheckbox, numPregunta);\r\n var nres = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName('answer').length;\r\n respuestasCheckbox[numPregunta] = [];\r\n for (i = 0; i < nres; i++) {\r\n respuestasCheckbox[numPregunta][i] = xmlDoc.getElementsByTagName(\"question\")[numPregunta].getElementsByTagName(\"answer\")[i].innerHTML;\r\n }\r\n }\r\n}", "title": "" } ]
1e471a6ee47902bafa7a9ccfe8dbd8ec
interpolates values between two values, takes in the two boundary values and the number of interpolated values
[ { "docid": "2c93becde1b82cb84601aae754310895", "score": "0.6302916", "text": "function interpolate(x1, x2, divs) {\n\tvar interpolatedX = [];\n\tvar bufferDivX = (x2 - x1) / divs;\n\tvar bufferValX = x1;\n\tfor (var i = 0; i < divs - 1; i++) {\n\t\tbufferValX += bufferDivX;\n\t\tinterpolatedX.push((Math.round(bufferValX * 1000)) / 1000);\n\t}\n\treturn interpolatedX;\n}", "title": "" } ]
[ { "docid": "4e4202e099dc5ddf6327d94318429d6a", "score": "0.7243723", "text": "function interpolate(x, xmin, xmax, ymin, ymax) {\n return ymin + ((x - xmin) * ((ymax - ymin) / (xmax - xmin)));\n }", "title": "" }, { "docid": "c84f409816dacabf6e2d289168524ea1", "score": "0.69778126", "text": "function _interpolate(a, b, t) {\n\t return ((1 - t) * a) + (t * b);\n\t }", "title": "" }, { "docid": "c84f409816dacabf6e2d289168524ea1", "score": "0.69778126", "text": "function _interpolate(a, b, t) {\n\t return ((1 - t) * a) + (t * b);\n\t }", "title": "" }, { "docid": "85928da76babf27a315636db1d0855ef", "score": "0.68971354", "text": "function _interpolate(a, b, t) {\n return ((1 - t) * a) + (t * b);\n }", "title": "" }, { "docid": "15673455b2def3b3de2a9a34c5e77e4b", "score": "0.6889606", "text": "function interpolateLinear(a, b, x) {\n return a * (1 - x) + b * x;\n}", "title": "" }, { "docid": "0fd1ea2f3f456ce6f96cebd2bc7ee48c", "score": "0.67771363", "text": "function interpolateX(y, y0, y1) {\n return (y - y0) / (y1 - y0);\n}", "title": "" }, { "docid": "9744005368a6619ac2e3ab72ac51d4dd", "score": "0.670931", "text": "static interpolate(ptA, ptB, u, v) {\n\t if (v == null) { v = 0; }\n\t if ((arguments.length) > 4) {\n\t this.halt(`Wrong arguments (${arguments.length}) in 'interpolate' ${arguments}`);\n\t }\n\t\n\t let dx = ptB.y - ptA.y;\n\t let dy = ptA.x - ptB.x;\n\t v /= Math.sqrt((dx*dx) + (dy*dy));\n\t\n\t let interpX = Math.round(((1-u)*ptA.x) + (u*ptB.x) + (v*dx));\n\t let interpY = Math.round(((1-u)*ptA.y) + (u*ptB.y) + (v*dy));\n\t\n\t return new Point(interpX, interpY);\n\t }", "title": "" }, { "docid": "f9ba0356587231a1157ed38b24a276c1", "score": "0.66718745", "text": "function interpolate(val, rgb1, rgb2) {\n var rgb = [0,0,0];\n var i;\n for (i = 0; i < 3; i++) {\n rgb[i] = rgb1[i] * (1.0 - val) + rgb2[i] * val;\n }\n return rgb;\n}", "title": "" }, { "docid": "97881f46b5b65f07d57d765b31cefc69", "score": "0.66157", "text": "function linearInterpolate(x1, y1, x2, y2, x) {\n if (x1 == x2) {\n return y1;\n }\n const w = (x - x1) / (x2 - x1);\n\n if (Array.isArray(y1)) {\n return y1.map((y1, i) => y1 * (1 - w) + y2[i] * w);\n }\n return y1 * (1 - w) + y2 * w;\n}", "title": "" }, { "docid": "524677c7486e968ef1c1882b1a2e99fa", "score": "0.65802234", "text": "function vInterpolate(a, b, fraction) { \n var rval = { x: a.x + (b.x - a.x) * fraction, y: a.y + (b.y - a.y) * fraction, z: a.z + (b.z - a.z) * fraction };\n return rval;\n}", "title": "" }, { "docid": "1a3c5bab4f3182e53572d282d542a4c4", "score": "0.6566758", "text": "function interpolate(xdata,ydata,x) {\n for (var i = 0; i < xdata.length; i += 1) {\n if (x < xdata[i]) {\n // t falls between times[i-1] and times[i]\n var t1 = (i === 0) ? xdata[0] : xdata[i - 1];\n var t2 = xdata[i];\n\n if (t2 === undefined) return undefined;\n\n var v1 = (i === 0) ? ydata[0] : ydata[i - 1];\n var v2 = ydata[i];\n var v = v1;\n if (x != t1) v += (x - t1) * (v2 - v1) / (t2 - t1);\n return v;\n }\n }\n }", "title": "" }, { "docid": "2d69f0a5e444f2f892186c16b98a5035", "score": "0.6497596", "text": "set Interpolate(value) {}", "title": "" }, { "docid": "393ed1749d1168766d2ac09149c8e7df", "score": "0.641794", "text": "static Interpolate(t, x1, y1, x2, y2) {\n // Extract X (which is equal to time here)\n const f0 = 1 - 3 * x2 + 3 * x1;\n const f1 = 3 * x2 - 6 * x1;\n const f2 = 3 * x1;\n let refinedT = t;\n for (let i = 0; i < 5; i++) {\n const refinedT2 = refinedT * refinedT;\n const refinedT3 = refinedT2 * refinedT;\n const x = f0 * refinedT3 + f1 * refinedT2 + f2 * refinedT;\n const slope = 1.0 / (3.0 * f0 * refinedT2 + 2.0 * f1 * refinedT + f2);\n refinedT -= (x - t) * slope;\n refinedT = Math.min(1, Math.max(0, refinedT));\n }\n // Resolve cubic bezier for the given x\n return 3 * Math.pow(1 - refinedT, 2) * refinedT * y1 +\n 3 * (1 - refinedT) * Math.pow(refinedT, 2) * y2 +\n Math.pow(refinedT, 3);\n }", "title": "" }, { "docid": "9960413171eda338fe11519e704bd58e", "score": "0.6402948", "text": "function linearInterp(x, x1, x2, y1, y2) {\n\treturn y1 + (y2 - y1) * (x - x1) / (x2 - x1);\n}", "title": "" }, { "docid": "c4d0950eaddfb76dd6d0273a516c3d28", "score": "0.6397075", "text": "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "title": "" }, { "docid": "c4d0950eaddfb76dd6d0273a516c3d28", "score": "0.6397075", "text": "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "title": "" }, { "docid": "c23d5c899bd8152cba8c5afe4ba49d92", "score": "0.6370607", "text": "function interpolatePoint(point1, point2, w) {\n\tif(almostEqual(w, 0)) return _.clone(point1)\n\tif(almostEqual(w, 1)) return _.clone(point2)\n\n\tvar interp = {}\n\tvar keys = Object.keys(point1)\n\tkeys.forEach(key => {\n\t\tinterp[key] = (1 - w) * point1[key] + w * point2[key]\n\t})\n\n\treturn interp\n}", "title": "" }, { "docid": "b3d8a0371cb5b2439dc5978412ac0cd1", "score": "0.6344858", "text": "function interpolateValues(values, year) {\n var i = bisect.left(values, year, 0, values.length - 1),\n a = values[i];\n if (i > 0) {\n var b = values[i - 1],\n t = (year - a[0]) / (b[0] - a[0]);\n return a[1] * (1 - t) + b[1] * t;\n }\n return a[1];\n }", "title": "" }, { "docid": "6dff922770cffacc793023486dc7bda0", "score": "0.63250685", "text": "function interpolate$1(table,skey,sval,tkey){var range=lookup(table,skey,sval);// Note: the lookup table ALWAYS contains at least 2 items (min and max)\nvar prev=!range.lo?table[0]:!range.hi?table[table.length-2]:range.lo;var next=!range.lo?table[1]:!range.hi?table[table.length-1]:range.hi;var span=next[skey]-prev[skey];var ratio=span?(sval-prev[skey])/span:0;var offset=(next[tkey]-prev[tkey])*ratio;return prev[tkey]+offset;}", "title": "" }, { "docid": "0e3d20d9e5cc1c8108ec2fbe84911961", "score": "0.6220229", "text": "function transition_interpolate(a, b) {\n var c;\n return (typeof b === \"number\" ? src_number\n : b instanceof color ? rgb\n : (c = color(b)) ? (b = c, rgb)\n : string)(a, b);\n}", "title": "" }, { "docid": "35c9c284b8aaa3e9553a706eb6751889", "score": "0.6214811", "text": "function interpolate$1(table, skey, sval, tkey) {\n var range = lookup(table, skey, sval);\n\n // Note: the lookup table ALWAYS contains at least 2 items (min and max)\n var prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n var next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n var span = next[skey] - prev[skey];\n var ratio = span ? (sval - prev[skey]) / span : 0;\n var offset = (next[tkey] - prev[tkey]) * ratio;\n return prev[tkey] + offset;\n }", "title": "" }, { "docid": "48284e7cfb16ccc78781c83defcc10b0", "score": "0.6179498", "text": "function interpolatePoint(point1, point2, w) {\n if (almostEqual(w, 0)) {\n return _.clone(point1);\n }\n if (almostEqual(w, 1)) {\n return _.clone(point2);\n }\n\n const interp = {};\n const keys = Object.keys(point1);\n keys.forEach(key => {\n interp[key] = (1 - w) * point1[key] + w * point2[key];\n });\n\n return interp;\n}", "title": "" }, { "docid": "b05337e7b58deba0f78143921fae2a80", "score": "0.6146735", "text": "function interpolateValues(values, year) {\n\t /*use bisect function to determine the position of given year in the year list in ascending order*/\n\t var i = d3.bisectLeft(yearList,year);\n\t /*extract the data value at current position i*/\n\t var b = values[i];\n\t /*when given year is not the first year in the year list, interpolate the values between a and b*/\n\t if (i > 0) {\n\t /*extract the data value before position i*/\n\t var a = values[i - 1];\n\t /*if given year is a whole year number, return 1, otherwise return the delta(fraction)*/\n\t var t = (year == Math.floor(year)? 1 : year - Math.floor(year));\n\t return a + (b - a) * t;\n\t }\n\t /*when given year is the first year in the year list, extract the first year's data*/\n\t return b;\n\t }", "title": "" }, { "docid": "a1817984e184b1a8f825d5c6b7702354", "score": "0.6132397", "text": "function interp( from, to, fraction )\t\r\n{\t\r\n\treturn ( to - from ) * fraction;\t\r\n}", "title": "" }, { "docid": "dc82788ce3dc6b7f400cfebb8c197073", "score": "0.61243963", "text": "function interpolate(a,x,f)\n{\n // l is outgoing y values\n var l = []\n var aux = 0;\n var temp = 1;\n for(var k = 0; k < a.length; k++)\n {\n for(var i = 0; i < x.length; i++)\n {\n for(var j = 0; j < x.length; j++)\n {\n if(i != j)\n {\n temp *= (k-x[j])/(x[i]-x[j])\n console.log(temp)\n }\n }\n aux += f[i]*temp;\n temp = 1;\n }\n l.push(aux);\n aux = 0;\n }\n return l;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "a1637213d17497aae203a2d37dded500", "score": "0.60962427", "text": "function interpolate$1(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "818eed540238458c3b82095e7e55031f", "score": "0.60946155", "text": "function interpolate(table, skey, sval, tkey) {\n var range = lookup(table, skey, sval);\n \n // Note: the lookup table ALWAYS contains at least 2 items (min and max)\n var prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n var next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n \n var span = next[skey] - prev[skey];\n var ratio = span ? (sval - prev[skey]) / span : 0;\n var offset = (next[tkey] - prev[tkey]) * ratio;\n \n return prev[tkey] + offset;\n }", "title": "" }, { "docid": "db5c49a25d77e0b177d096926cd3d873", "score": "0.6066045", "text": "function lerp(a, b, t) { return a + (b - a) * t }", "title": "" }, { "docid": "2ffdadf4786335e6bef2a944f5dd3989", "score": "0.6052932", "text": "function interpolateZoom(p0, p1) {\n\t var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n\t ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n\t dx = ux1 - ux0,\n\t dy = uy1 - uy0,\n\t d2 = dx * dx + dy * dy,\n\t i,\n\t S;\n\t\n\t // Special case for u0 ≅ u1.\n\t if (d2 < epsilon2) {\n\t S = Math.log(w1 / w0) / rho;\n\t i = function(t) {\n\t return [\n\t ux0 + t * dx,\n\t uy0 + t * dy,\n\t w0 * Math.exp(rho * t * S)\n\t ];\n\t }\n\t }\n\t\n\t // General case.\n\t else {\n\t var d1 = Math.sqrt(d2),\n\t b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n\t b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n\t r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n\t r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n\t S = (r1 - r0) / rho;\n\t i = function(t) {\n\t var s = t * S,\n\t coshr0 = cosh(r0),\n\t u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n\t return [\n\t ux0 + u * dx,\n\t uy0 + u * dy,\n\t w0 * coshr0 / cosh(rho * s + r0)\n\t ];\n\t }\n\t }\n\t\n\t i.duration = S * 1000;\n\t\n\t return i;\n\t }", "title": "" }, { "docid": "27729edd70c283a21a1128e8b536614f", "score": "0.60513633", "text": "function interpolate( percentage, start, end ) {\n\n var rVal = [];\n\n start.forEach( function( startValue, i ) {\n\n var endValue = end[ i ];\n\n rVal[ i ] = ( endValue - startValue ) * percentage + startValue;\n });\n\n return rVal;\n}", "title": "" }, { "docid": "b34ebe85142b95c46f1a6b735fc95c18", "score": "0.6034015", "text": "function linearInterpolate(x1, y1, x2, y2, targetX) {\n var targetY;\n targetY = ((targetX - x1) * (y2 - y1) / (x2 - x1)) + y1;\n return targetY;\n }", "title": "" }, { "docid": "2ce13a9f5f42b079af044c831842ec74", "score": "0.6021189", "text": "function bimap (domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1]\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0)\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1)\n return function (x) { return r0(d0(x)) }\n }", "title": "" }, { "docid": "8d4625ebebfcf13fc4efe340dcdb1535", "score": "0.60188437", "text": "function interpolateZoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000;\n\n return i;\n }", "title": "" }, { "docid": "8d4625ebebfcf13fc4efe340dcdb1535", "score": "0.60188437", "text": "function interpolateZoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000;\n\n return i;\n }", "title": "" }, { "docid": "09ae754842da01db9db31013ba7ff15e", "score": "0.6013906", "text": "interpolate_()\n\t\t/* i1, t0, t, t1 */\n\t\t{\n\t\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t\t}", "title": "" }, { "docid": "52c599ea77452581e4e50cf7f10cfc44", "score": "0.601156", "text": "function interpolateZoom(p0, p1) {\n\t var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n\t ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n\t dx = ux1 - ux0,\n\t dy = uy1 - uy0,\n\t d2 = dx * dx + dy * dy,\n\t i,\n\t S;\n\n\t // Special case for u0 ≅ u1.\n\t if (d2 < epsilon2) {\n\t S = Math.log(w1 / w0) / rho;\n\t i = function(t) {\n\t return [\n\t ux0 + t * dx,\n\t uy0 + t * dy,\n\t w0 * Math.exp(rho * t * S)\n\t ];\n\t };\n\t }\n\n\t // General case.\n\t else {\n\t var d1 = Math.sqrt(d2),\n\t b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n\t b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n\t r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n\t r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n\t S = (r1 - r0) / rho;\n\t i = function(t) {\n\t var s = t * S,\n\t coshr0 = cosh(r0),\n\t u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n\t return [\n\t ux0 + u * dx,\n\t uy0 + u * dy,\n\t w0 * coshr0 / cosh(rho * s + r0)\n\t ];\n\t };\n\t }\n\n\t i.duration = S * 1000;\n\n\t return i;\n\t}", "title": "" }, { "docid": "ac71043c63ed041c0da8cb54c889bc1d", "score": "0.6008959", "text": "function interpolateZoom(p0, p1) {\n\t var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n\t ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n\t dx = ux1 - ux0,\n\t dy = uy1 - uy0,\n\t d2 = dx * dx + dy * dy,\n\t i,\n\t S;\n\n\t // Special case for u0 ≅ u1.\n\t if (d2 < epsilon2) {\n\t S = Math.log(w1 / w0) / rho;\n\t i = function(t) {\n\t return [\n\t ux0 + t * dx,\n\t uy0 + t * dy,\n\t w0 * Math.exp(rho * t * S)\n\t ];\n\t }\n\t }\n\n\t // General case.\n\t else {\n\t var d1 = Math.sqrt(d2),\n\t b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n\t b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n\t r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n\t r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n\t S = (r1 - r0) / rho;\n\t i = function(t) {\n\t var s = t * S,\n\t coshr0 = cosh(r0),\n\t u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n\t return [\n\t ux0 + u * dx,\n\t uy0 + u * dy,\n\t w0 * coshr0 / cosh(rho * s + r0)\n\t ];\n\t }\n\t }\n\n\t i.duration = S * 1000;\n\n\t return i;\n\t }", "title": "" }, { "docid": "6fd974a38f74614f64afcc575d824d4a", "score": "0.6003062", "text": "function continuous$2(deinterpolate,reinterpolate){var domain=unit$2,range$$1=unit$2,interpolate$$1=interpolateValue$1,clamp=false,piecewise,output,input;function rescale(){piecewise=Math.min(domain.length,range$$1.length)>2?polymap$2:bimap$2;output=input=null;return scale;}function scale(x){return(output||(output=piecewise(domain,range$$1,clamp?deinterpolateClamp$2(deinterpolate):deinterpolate,interpolate$$1)))(+x);}scale.invert=function(y){return(input||(input=piecewise(range$$1,domain,deinterpolateLinear$2,clamp?reinterpolateClamp$2(reinterpolate):reinterpolate)))(+y);};scale.domain=function(_){return arguments.length?(domain=map$7.call(_,number$7),rescale()):domain.slice();};scale.range=function(_){return arguments.length?(range$$1=slice$10.call(_),rescale()):range$$1.slice();};scale.rangeRound=function(_){return range$$1=slice$10.call(_),interpolate$$1=interpolateRound$1,rescale();};scale.clamp=function(_){return arguments.length?(clamp=!!_,rescale()):clamp;};scale.interpolate=function(_){return arguments.length?(interpolate$$1=_,rescale()):interpolate$$1;};return rescale();}", "title": "" }, { "docid": "0f2ccccafd6847b7cd659fb50efc0e4d", "score": "0.60009986", "text": "function interpolateZoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n };\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n };\n }\n\n i.duration = S * 1000;\n\n return i;\n}", "title": "" }, { "docid": "2db0634bbfbf10b1f2c04c708e00833a", "score": "0.59989864", "text": "function interpolateXYZ(position, left, right) {\n if (isNaN(position) || position <= 0) {\n return left;\n } else if (position >= 1) {\n return right;\n }\n\n return new ColorXYZ(lerp(position, left.x, right.x), lerp(position, left.y, right.y), lerp(position, left.z, right.z));\n}", "title": "" }, { "docid": "bda3e8735f605b8a7e6fa2e19c03211e", "score": "0.5997182", "text": "interpolate(t) {\n t = Num_1.Num.clamp(t, 0, 1);\n let chunk = this.length - 1;\n let tc = 1 / (this.length - 1);\n let idx = Math.floor(t / tc);\n return Num_1.Geom.interpolate(this[idx], this[Math.min(this.length - 1, idx + 1)], (t - idx * tc) * chunk);\n }", "title": "" }, { "docid": "9666a80c20fc74e257e72d17ef60469f", "score": "0.59943235", "text": "function interpolate(source,target,pos){\n\t\treturn (source+(target-source)*pos).toFixed(3);\n\t}", "title": "" }, { "docid": "72b0fb858f94d0095ec50f6caecf4768", "score": "0.5979274", "text": "function interpolationV(values) {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');\n var different = false;\n for (var i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n bindingUpdated(values[i]) && (different = true);\n }\n if (!different) {\n return NO_CHANGE;\n }\n // Build the updated content\n var content = values[0];\n for (var i = 1; i < values.length; i += 2) {\n content += stringify$1(values[i]) + values[i + 1];\n }\n return content;\n}", "title": "" }, { "docid": "16c8938bbaea7b342bcb247239dc64de", "score": "0.5966878", "text": "function bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n }", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "28d96b2738a6150f2f702474bee4858b", "score": "0.5963522", "text": "function interpolate(table, skey, sval, tkey) {\n\tvar range = lookup(table, skey, sval);\n\n\t// Note: the lookup table ALWAYS contains at least 2 items (min and max)\n\tvar prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n\tvar next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n\tvar span = next[skey] - prev[skey];\n\tvar ratio = span ? (sval - prev[skey]) / span : 0;\n\tvar offset = (next[tkey] - prev[tkey]) * ratio;\n\n\treturn prev[tkey] + offset;\n}", "title": "" }, { "docid": "64bb84562cf275466d63b6e94a2e6b6a", "score": "0.59624964", "text": "interpValue2(x, y) {\n let N = Matrix.zeros(4);\n \n N.set(0, 0, 1/4 * (1 - x) * (1 - y));\n N.set(1, 0, 1/4 * (1 + x) * (1 - y));\n N.set(2, 0, 1/4 * (1 + x) * (1 + y));\n N.set(3, 0, 1/4 * (1 - x) * (1 + y));\n \n return N;\n }", "title": "" }, { "docid": "db07d45fd785d5ba531e837d63775d5e", "score": "0.59623986", "text": "get Interpolate() {}", "title": "" }, { "docid": "5ff981f3dfe174b20f3c9e416e4a3935", "score": "0.59557444", "text": "function interpolateColor(color1, color2, factor) {\r\n if (arguments.length < 3) {\r\n factor = 0.5;\r\n }\r\n var result = color1.slice();\r\n for (var i = 0; i < 3; i++) {\r\n result[i] = Math.round(result[i] + factor * (color2[i] - color1[i]));\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "193e0dae53897c28e5b6ba4b3442552e", "score": "0.5953015", "text": "function bimap(domain,range,interpolate){var d0=domain[0],d1=domain[1],r0=range[0],r1=range[1];if(d1<d0)d0=normalize(d1,d0),r0=interpolate(r1,r0);else d0=normalize(d0,d1),r0=interpolate(r0,r1);return function(x){return r0(d0(x));};}", "title": "" }, { "docid": "12b9dd54b13b4e6f87370ab8192fa687", "score": "0.595089", "text": "function interpolateValues(values, time, repeat = false) {\n // find min and max time\n let tmin = null;\n let tmax = null;\n for (let sx in values) {\n let x = parseFloat(sx);\n if (tmin === null || x < tmin) { tmin = x; }\n if (tmax === null || x > tmax) { tmax = x; }\n }\n // clamp or modulo\n if (repeat) {\n time = tmin + ((time - tmin) % (tmax - tmin));\n }\n else {\n if (time < tmin) {\n time = tmin;\n }\n else if (time > tmax) {\n time = tmax;\n }\n }\n // find prior and next times\n let tprior = tmin;\n let tnext = tmax;\n for (let sx in values) {\n let x = parseFloat(sx);\n if (x > tprior && x <= time) tprior = x;\n if (x < tnext && x >= time) tnext = x;\n }\n // interpolate between both\n let dt = tnext - tprior;\n if (dt < 1.0e-12) {\n return (values[tprior.toString()] + values[tnext.toString()]) * 0.5;\n }\n let r = (time - tprior) / dt;\n return values[tprior.toString()] + (values[tnext.toString()] - values[tprior.toString()]) * r;\n}", "title": "" }, { "docid": "f1300f9819a13207c6f066fadf6dc849", "score": "0.59468776", "text": "function bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n }", "title": "" }, { "docid": "f1300f9819a13207c6f066fadf6dc849", "score": "0.59468776", "text": "function bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n }", "title": "" }, { "docid": "aa46e0489318d6e2a5d434974901ade8", "score": "0.59417933", "text": "function interpolateColor(color1, color2, factor) {\n if (arguments.length < 3) {\n factor = 0.5;\n }\n var result = color1.slice();\n for (var i = 0; i < 3; i++) {\n result[i] = Math.round(result[i] + factor * (color2[i] - color1[i]));\n }\n return result;\n}", "title": "" }, { "docid": "1e5be5fb3530787a584ff1484d59327d", "score": "0.593372", "text": "function interpolateColor(color1, color2, factor) {\n if (arguments.length < 3) {\n factor = 0.5;\n }\n let result = color1.slice();\n for (let i = 0; i < 3; i++) {\n result[i] = Math.round(result[i] + factor * (color2[i] - color1[i]));\n }\n return result;\n}", "title": "" }, { "docid": "9f753ce2e7e14776fc050f8204ef9935", "score": "0.5931568", "text": "function lerp( a, b, mu = 0.5 ) {\n\n\tif ( isNaN( a ) ) return b;\n\tif ( isNaN( b ) ) return a;\n\treturn ( 1 - mu ) * a + mu * b;\n\n}", "title": "" }, { "docid": "cd12a0c789dbed911f0036282837e7cc", "score": "0.5927102", "text": "function lerp(a, b, t) {\n return a + (b - a) * t\n}", "title": "" }, { "docid": "3a0205eb51352edcad4be2b0a4b0074f", "score": "0.59238625", "text": "function InterpolNumber(start, end){\n\t\tthis.start = start, this.end = end;\n\t}", "title": "" }, { "docid": "f53f4c234060867be6c29df71a8b4a61", "score": "0.5907762", "text": "function interpolateColor(color1, color2, factor) {\n if (arguments.length < 3) {\n factor = 0.5;\n }\n var result = color1.slice();\n for (var i = 0; i < 3; i++) {\n result[i] = Math.round(result[i] + factor * (color2[i] - color1[i]));\n }\n return result;\n }", "title": "" }, { "docid": "5c978927d567562a3b0ff7e8681b8529", "score": "0.59053504", "text": "function bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}", "title": "" }, { "docid": "5c978927d567562a3b0ff7e8681b8529", "score": "0.59053504", "text": "function bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}", "title": "" }, { "docid": "5c978927d567562a3b0ff7e8681b8529", "score": "0.59053504", "text": "function bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}", "title": "" }, { "docid": "5c978927d567562a3b0ff7e8681b8529", "score": "0.59053504", "text": "function bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}", "title": "" }, { "docid": "5c978927d567562a3b0ff7e8681b8529", "score": "0.59053504", "text": "function bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}", "title": "" } ]
9a5ed156eea27cb2f76cbe3e97dfa0dd
objective: Buy at lowest point and sell at greater price. 714721 = buy at 2nd day with $1 and sell it on 4th day with $7 [7,1,5,3,6,4] = Buy on day 2 (price = 1) and sell on day 3 (price = 5), profit = 51 = 4. Then buy on day 4 (price = 3) and sell on day 5 (price = 6), profit = 63 = 3.
[ { "docid": "a70d8c40371c932b9d8cd9199dcbb388", "score": "0.0", "text": "function findMax(arr) {\n const highs = []; // store all the highs\n const lows = []; // store all the lows\n\n // find the low and high\n for(let i = 0; i < arr.length; i += 1) {\n while(i < arr.length && arr[i] >= arr[i + 1]) i++;\n lows.push(i);\n while(i < arr.length && arr[i] <= arr[i + 1]) i++;\n highs.push(i);\n }\n\n // calculate the result\n let result = 0\n for(let i = 0; i < highs.length && i < lows.length; i += 1) {\n result += arr[highs[i]] - arr[lows[i]];\n }\n console.log(lows);\n console.log(highs);\n\n return result;\n}", "title": "" } ]
[ { "docid": "a78f46f67d7baf0079711edb46512a4b", "score": "0.74465394", "text": "function stockBuySell(priceArray) {\n\tvar listLength = priceArray.length;\n\tif(listLength<2) {\n \tthrow new error('Getting a profit requires at least 2 prices') \n\t}\n\tvar solutionPairCount = 0\n\tvar solution = [];\n\tvar i=0;\n\twhile(i<listLength-1) {\n\t\t// find local minima. note that limit is (listLength-2) as we are comparing present element to the next element.\n\t\twhile((i<listLength-1) && (priceArray[i+1]<=priceArray[i])) {\n\t\t\ti++;\n }\n\t\t// if we reached the end break as no further solution possible\n\t\tif (i == listLength-1) break;\n\t\t\n\t\t// store the index of minima\n\t\tsolution[solutionPairCount] = {};\n\t\tsolution[solutionPairCount].buy = i++;\n\n\t\t// Find local maxima. Note that the limit is (listLength-1) as we are comparing to previoud element\n\t\twhile((i<listLength) && (priceArray[i]>= priceArray[i-1])) {\n\t\t\ti++;\n }\n\t\t//store the index of maxima\n\t\tsolution[solutionPairCount].sell = i-1;\n\t\t// Increment count of buy/sell pairs\n\t\tsolutionPairCount++;\n }\n\tif(solutionPairCount==0) {\n \tconsole.log(\"there is no day when buying the stock will make profitn\")\n\t} else {\n\t\tfor(var i = 0; i<solutionPairCount; i++) {\n \tconsole.log('Buy on day ' + solution[i].buy +' at '+ priceArray[solution[i].buy]+ ' and Sell on day ' + solution[i].sell +' at '+ priceArray[solution[i].sell]);\n\t\t}\n }\n\t\n}", "title": "" }, { "docid": "17ff466c05391f3746d3f645fe0ddb2c", "score": "0.72373074", "text": "function tradeDynamicProgramming(prices) {\n // If zero or one day, profit is zero\n if (prices.length <= 1) {\n return 0;\n }\n\n // Keep track of best profit and cheapest buy day\n maxProfit = 0;\n cheapest = prices[0];\n\n for (i = 1; i < prices.length; i++) {\n // Update cheapest buy day\n cheapest = Math.min(cheapest, prices[i]);\n\n // Update best profit\n maxProfit = Math.max(maxProfit, prices[i] - cheapest);\n }\n return maxProfit;\n}", "title": "" }, { "docid": "c5b2c7d0e48d5b772e54d3e1d39b6bcf", "score": "0.6981311", "text": "function maxProfit(prices) {\n const buys = new Array(3).fill(-Infinity);\n const sells = new Array(3).fill(0);\n for (let i=0; i<prices.length; i++) {\n for (let j=1; j<3; j++) {\n buys[j] = sells[j - 1] - prices[i] > buys[j] ? sells[j - 1] - prices[i] : buys[j];\n sells[j] = buys[j] + prices[i] > sells[j] ? buys[j] + prices[i] : sells[j];\n }\n }\n return sells[2];\n}", "title": "" }, { "docid": "560ab1c8f62918683e2928d0becc2b9c", "score": "0.69626325", "text": "function handleProfit (buy, sell) {\n return sell - buy \n}", "title": "" }, { "docid": "b9c2fcb05fa0e7ddf607357a0f87d8dc", "score": "0.6892625", "text": "function getMaxProfit_o(stockPrices) {\n\n\tif (stockPrices.length < 2) {\n\t\tconsole.log('the array have to have at least 2 elements');\n\t}\n\tlet buy = stockPrices[0];\n\tlet profit = stockPrices[1] - buy;\n\t\n\tfor (let i= 1; i < stockPrices.length - 1; i++) {\n\t\tconst currentPrice = stockPrices[i];\n\t\tconst tmpProfit = currentPrice - buy;\n\t\t\n\t\tprofit = tmpProfit > profit ? tmpProfit : profit;\n\t\t\n\t\tbuy = currentPrice < buy ? currentPrice : buy;\n\t}\n\t\n\treturn profit;\n}", "title": "" }, { "docid": "9c33ddd93d911a406242bb39d932f3d8", "score": "0.6858816", "text": "function maxProfit(stockPrices){\n\n let tracker = {\n highValue: null,\n lowValue: null,\n bestProfit: 0,\n low: null,\n high: null,\n computeBestCount: 0,\n }\n\n // -------- Helper functions -----------\n\n // This helps to trim off values that cannot be possible.\n function findStartingPoint(idxStart){\n for(let i = idxStart; i < stockPrices.length; i++){\n if(stockPrices[i] < stockPrices[i + 1]){\n\n tracker.low = i\n if( stockPrices[i + 1] !== undefined) tracker.high = i + 1\n\n break\n }\n }\n }\n\n // This is called anytime we need to check if a possible solution is best.\n function computeBest(){\n let total = stockPrices[tracker.high] - stockPrices[tracker.low]\n if( total > tracker.bestProfit ){\n tracker.bestProfit = total \n // Optional -----\n tracker.lowValue = stockPrices[tracker.low]\n tracker.highValue = stockPrices[tracker.high]\n tracker.computeBestCount++\n }\n }\n\n // ------- Main Function Begin! ------\n\n // First, find the lowest starting spot.\n findStartingPoint(0)\n\n if(tracker.low === null) return 0 // In case the numbers only go down.\n\n // Find the next lowest number..\n for( let i = tracker.low + 1; i < stockPrices.length; i++){\n\n // .. While keeping track of the highest along the way.\n if(stockPrices[i] > stockPrices[tracker.high]) tracker.high = i\n \n if(stockPrices[i + 1] < stockPrices[tracker.low]){\n // When a new low is found, compute best\n computeBest()\n\n // Then find a new low again. Also trims again if needed.\n // IE [5,6,4,3,10] would trim off 4 in the following function.\n findStartingPoint(i + 1)\n }\n }\n\n //Final check\n if(tracker.high) computeBest()\n \n return tracker\n}", "title": "" }, { "docid": "93baf0ddba5a58d18f25b43a7b743a1a", "score": "0.6835754", "text": "function maxProfit(prices) {\n if (!prices.length) return 0;\n let buy = prices[0];\n let sell = prices[0];\n let profit = 0;\n // Sell price should be higher than buy price\n // Set buy as index[0], sell as index[1]\n // If sell is less than buy, set buy as the new sell price\n // If the profit of those new buy/sell prices are higher than the current profit, record the new profit\n // Return profit when the array runs out\n for (let i = 1; i < prices.length; i++) {\n sell = prices[i];\n if (sell < buy) {\n buy = sell\n };\n if (sell - buy > profit) {\n profit = sell - buy\n };\n }\n return profit;\n}", "title": "" }, { "docid": "e1d5127585b7fd9727d34b14ad88d0f3", "score": "0.67360127", "text": "function getBestProfit(prices) {\n let low = high = profit = 0;\n\n prices.forEach(price => {\n if (low === 0 && high === 0) {\n low = high = price\n }\n\n if (price > high) high = price\n\n if (price < low) {\n let tmpProfit = high - low;\n if (tmpProfit > profit) profit = tmpProfit;\n low = high = price\n }\n });\n\n return profit;\n}", "title": "" }, { "docid": "610c52ff6a65d3417280389eab1ef1d2", "score": "0.6726662", "text": "function profit(info) {\n return Math.round(info.sellPrice - info.costPrice) * info.inventory;\n}", "title": "" }, { "docid": "3a50d471c7d10eed23457e160d378d6e", "score": "0.66674703", "text": "function doGreedyPrice() {\n\t// make a copy\n\tvar p2 = dataPrices.slice(0,dataPrices.length)\n\t// reverse sort the copy inplace. get the indices\n\tvar pidx = sortWithIndices(p2).sortIndices.reverse()\n\t// use the indices to get weights & prices\n\tfor(i=0;i<pidx.length;i++) {\n\t\tvar idx = pidx[i]\n\t\tif ((totalWeightGp + dataWeights[idx]) < maxweight) {\n\t\t\t\ttotalWeightGp += dataWeights[idx]\n\t\t\t\ttotalEarningGp += dataPrices[idx]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d015bbc5bde2f43401dec232903fe1fa", "score": "0.66350204", "text": "function profit(a){\n let maxProfit = 0;\n let minmumPrice = a[0];\n for(let i =1; i < a.length; i++){\n if(minmumPrice > a[i])\n minmumPrice = a[i];\n if((a[i] - minmumPrice) > maxProfit)\n maxProfit = a[i] - minmumPrice;\n }\n return maxProfit;\n}", "title": "" }, { "docid": "b468e8eec2d87802ca7ac36bf35b0827", "score": "0.6621445", "text": "function maxStockProfit2 (pricesArr) {\n var maxProfit = -1;\n var buyPrice = 0;\n var sellPrice = 0;\n\n var changeBuyPrice = true;\n\n for (var i = 0; i < pricesArr.length-1; i++) {\n if (changeBuyPrice) buyPrice = pricesArr[i];\n sellPrice = pricesArr[i + 1];\n console.log(sellPrice);\n\n if (sellPrice < buyPrice) {\n changeBuyPrice = true;\n }\n else {\n var tempProfit = sellPrice - buyPrice;\n if (tempProfit > maxProfit) maxProfit = tempProfit;\n changeBuyPrice = false;\n }\n }\n\n return maxProfit;\n}", "title": "" }, { "docid": "f39ca31fe6b584e8cd25ad5447bc9ec9", "score": "0.6616572", "text": "function maxProfit(arr) {\n let profit = 0;\n let buyDay = 0;\n let sellDay = 0;\n for(let i=0; i<arr.length; i++){\n for(let j=1; j<arr.length; j++){\n let diff = arr[i] - arr[j];\n if(diff < profit){\n profit=diff;\n buyDay=i;\n sellDay=j\n }\n }\n }\n return `Day to purchase: ${buyDay} Day to sell: ${sellDay}`\n}", "title": "" }, { "docid": "b4f0be940723ddfd57fc58735a80743f", "score": "0.66051435", "text": "function buyAndSellOnce(costs) {\n let minCostIdx = 0;\n let maxProfit = 0;\n for (let i = 1; i < costs.length; i++) {\n let profit = costs[i] - costs[minCostIdx];\n if (profit > maxProfit) {\n maxProfit = profit;\n }\n if (costs[i] < costs[minCostIdx]) {\n minCostIdx = i;\n }\n }\n return maxProfit;\n}", "title": "" }, { "docid": "0af1e54b4e58a93886feca1444570986", "score": "0.6596657", "text": "function getMaxProfit(prices) {\n if (prices.length < 1) {\n return 0;\n }\n var maxProfit = 0;\n for (var i = 0; i < prices.length; i++) {\n var startPrice = prices[i];\n for (var j = i + 1; j < prices.length; j++) {\n var netProfit = prices[j] - prices[i]\n if( netProfit > maxProfit){\n maxProfit = netProfit\n }\n }\n }\n return maxProfit;\n}", "title": "" }, { "docid": "21438e8ab981a8eb72394c7e0efe8339", "score": "0.65833664", "text": "function myFunction(arg) {\n let maxProfit = arg[1]-arg[0];\n let minPrice=arg[0];\n for(let i=2;i<arg.length;i++){\n let currentProfit = arg[i] - minPrice\n maxProfit = Math.max(maxProfit,currentProfit)\n minPrice = Math.min(minPrice,arg[i]);\n }\n return maxProfit\n}", "title": "" }, { "docid": "ee961d167016afcdacaac61eec923d3b", "score": "0.6566006", "text": "function BestTimeStock(prices){\n var maxProfit = 0\n var currentProfit = 0\n var left = 0\n var right = 1\n while(left<prices.length && right<prices.length){\n currentProfit =prices[right] -prices[left]\n maxProfit = Math.max(maxProfit,currentProfit)\n if(prices[left]>= prices[right]){\n left=right\n right++\n } \n else{\n right++\n }\n }\n return maxProfit\n}", "title": "" }, { "docid": "43ca8184cc92706d60ec84d459da7651", "score": "0.6556016", "text": "function solution(A) {\n let len = A.length;\n let maxProfit = 0;\n let lowestPrice = A[0];\n\n // Solution\n // so the idea is you want to get the biggest profit you need to buy it at the lowest price\n // lowestPrice = the lowest price so far\n // currentProfit = current price - lowestPrice\n // all we have to do is make sure lowestPrice is the smallest price\n \n // e.g [2, 4, 5, 3, 10]\n // loop 1: lowestPrice = 2, currentProfit = 2, maxProfit = 2\n // loop 2: lowestPrice = 2, currentProfit = 3, maxProfit = 3\n // loop 3: lowestPrice = 2, currentProfit = 1, maxProfit = 3\n // loop 4: lowestPrice = 2, currentProfit = 8, maxProfit = 8\n // return maxProfit = 8\n\n for (let i = 1; i < len; i++) {\n if (lowestPrice > A[i]) {\n lowestPrice = A[i];\n } else {\n let currentProfit = A[i] - lowestPrice;\n if (currentProfit > maxProfit) maxProfit = currentProfit;\n }\n }\n\n return maxProfit;\n}", "title": "" }, { "docid": "154c6a0f7c16a39450f2a91d21f647b8", "score": "0.6528062", "text": "function calculateMaximumProfit(cost, x) {\n // Write your code here\n //console.log(cost, x);\n\n // 10 20 14 40 50 , 70\n // 10\n\n // 3 4 1, 8\n // 3 4\n // 1 4 = 5\n\n // 3 4 1\n // 1 2 4 = 7\n\n var ret = [];\n for (let i = 0; i < cost.length; ++i) {\n var c = cost[i];\n var cos = 0;\n for (let j = i + 1; j < cost.length; ++j) {\n c += cost[j];\n\n if (c > x) break;\n else {\n cos = 0;\n cos += Math.pow(2, j) + Math.pow(2, i);\n\n ret.push(cos);\n }\n }\n }\n\n return Math.floor(Math.max(...ret)) % (Math.pow(10, 9) + 7);\n}", "title": "" }, { "docid": "f061ddf3b924fefd1250ee90cdd1d1d5", "score": "0.6514498", "text": "function tradeBruteForce(prices) {\n maxProfit = 0;\n\n // Do not consider same day pairs, as profit is zero anyway\n for (let i = 0; i < prices.length; i++) {\n // Possible future days starts at least one day after current day\n for (let j = i + 1; j < prices.length; j++) {\n maxProfit = Math.max(maxProfit, prices[j] - prices[i]);\n }\n }\n return maxProfit;\n}", "title": "" }, { "docid": "e6dfefeda513ecd771f1811c7423e1f7", "score": "0.65142405", "text": "function maximumToys(prices, budget) {\n const sortedToyPrices = prices.sort((a,b) => a - b)\n let moneyLeft = budget \n let toysPurchased = 0\n sortedToyPrices.forEach(toyPrice => {\n if (moneyLeft >= toyPrice) {\n moneyLeft -= toyPrice\n toysPurchased++\n }\n })\n return toysPurchased\n}", "title": "" }, { "docid": "7eead384c6a048724c25b99bfedf3847", "score": "0.65090746", "text": "function maxProfit(prices) {\r\n var minPrice = prices[0];\r\n var maxProfit = prices[1]-prices[0];\r\n\r\n for(var i=1; i<prices.length; i++) {\r\n var currentPrice = prices[i];\r\n var potentialProfit = currentPrice-minPrice;\r\n maxProfit = maxProfit>potentialProfit ? maxProfit : potentialProfit;\r\n minPrice = minPrice<currentPrice ? minPrice : currentPrice;\r\n }\r\n\r\n return maxProfit;\r\n}", "title": "" }, { "docid": "a24da4b60df6561e670147b4f1ae57e0", "score": "0.64324576", "text": "function computeBest(){\n let total = stockPrices[tracker.high] - stockPrices[tracker.low]\n if( total > tracker.bestProfit ){\n tracker.bestProfit = total \n // Optional -----\n tracker.lowValue = stockPrices[tracker.low]\n tracker.highValue = stockPrices[tracker.high]\n tracker.computeBestCount++\n }\n }", "title": "" }, { "docid": "006603dc1f9114bf555ed212fb9025e2", "score": "0.64292127", "text": "function calcProfit(buyPrice, sellPrice) {\n let takeProfit = (sellPrice - (sellPrice * TFEE)) - (buyPrice- (buyPrice * TFEE));\n let makeProfit = (sellPrice - (sellPrice * MFEE)) - (buyPrice- (buyPrice * MFEE));\n // let makeProfit = (sellPrice - buyPrice) - (sellPrice * MFEE) - (buyPrice * MFEE);\n document.querySelector('#takeprofit').innerHTML = takeProfit;\n document.querySelector('#makeprofit').innerHTML = makeProfit;\n}", "title": "" }, { "docid": "28de22f096bad482915ce5e8d466c9dc", "score": "0.6417105", "text": "function maxProfit(prices) {\n let profit = 0,\n i = 0;\n \n while (i < prices.length - 1) {\n // Find next valley\n while (prices[i + 1] !== undefined && prices[i + 1] <= prices[i]) {\n i++;\n }\n let valley = prices[i];\n \n // Find next peak\n while (prices[i + 1] !== undefined && prices[i + 1] >= prices[i]) {\n i++;\n }\n let peak = prices[i];\n \n profit += peak - valley;\n }\n \n return profit;\n}", "title": "" }, { "docid": "db8f4251a27e5567d2d625225c739006", "score": "0.6347666", "text": "function maxProfit(prices) {\n\tvar profit = 0;\n\tfor (var x = 0; x < prices.length - 1; x++) {\n\t\tfor (var y = x+1; y < prices.length; y++) {\n\t\t\tvar diff = prices[y] - prices[x];\n\t\t\tif (diff > profit) \n\t\t\t\t{profit = diff}\n\t\t}\n\t}\n\tif (profit > 0) return profit\n\telse return -1\n}", "title": "" }, { "docid": "36a088f0f883072d3796a15481ac2890", "score": "0.6339958", "text": "function maxProfit(prices) {\n\tlet profit = 0;\n\tlet min = prices[0];\n\tfor(let i = 1; i < prices.length; i++){\n\t\tmin = Math.min(prices[i], min);\n\t\tprofit = Math.max(profit, prices[i] - min); \n\t}\n\treturn profit;\n}", "title": "" }, { "docid": "ca3a845aad3af22f9ffce8dc2f0d505d", "score": "0.633552", "text": "function getMaxProfit(prices) {\n let bestProfit = -Infinity;\n let min = prices[0];\n let currentProfit = -Infinity;\n\n for (let i = 1; i < prices.length; i += 1) {\n min = prices[i] < min ? prices[i] : min;\n currentProfit = prices[i] - min;\n\n bestProfit = currentProfit > bestProfit ? currentProfit : bestProfit;\n }\n\n return bestProfit;\n}", "title": "" }, { "docid": "8ec40cd29c997258632ebe7f178e1760", "score": "0.6315483", "text": "getBestSum()\n {\n let result = 0;\n for (let [key, val] of this.getBestPrices())\n result += val.price;\n return result;\n }", "title": "" }, { "docid": "6cd042587eb36759033d8f626c439071", "score": "0.6270566", "text": "function getMaxProfit(array){\n let minPrice = array[0];\n let maxProfit = array[1] - array[0];\n\n for(let i = 1; i < array.length; i++){\n let currentPrice = array[i];\n let potentialPrice = currentPrice - minPrice;\n minPrice = Math.min(minPrice, currentPrice);\n maxProfit = Math.max(potentialPrice, maxProfit);\n }\n return maxProfit;\n}", "title": "" }, { "docid": "a9d4d89da1f64890f0e0af1ea3e3953c", "score": "0.6261304", "text": "function maximiseMoney(trips){\n\tvar begin = new Date().getTime();\n\t\t\n\tvar plannings = new Array(),\n\ttmpPlanning, bestP, refP, nextTrip, bestPGain, emptyPlanning = new Planning(), lastMin = 0;\n\t//create first planning \n\tplannings.push(new Planning(trips.shift()));\n\t\n\t//define a reference planning (first one by default)\n\trefP = plannings[0];\n\t\t\n\tfor (var t = 0; t < trips.length; t++){\n\t\tnextTrip = trips[t+1] || {};\n\t\t//if next trip ends before current \n\t\t//and next trip's price is bigger,\n\t\t// it is not necessary to process current trip. Go to next one directly !\n\t\tif (nextTrip.price >= trips[t].price && nextTrip.end <= trips[t].end ) {continue} \n\t\t\n\t\t//filter planning to get rid of worst candidates\n\t\tplannings = plannings.filter(optimizeFilter(refP, trips[t].departure, lastMin)).sort(planningCompare);\n\t\t//try to get the best planning candidate to add the new current trip\n\t\tbestP = null;\n\t\tbestPGain = trips[t].price;\n\t\tfor (var p = 0; p < plannings.length; p++){\n\t\t\tif (plannings[p].end > trips[t].departure){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (plannings[p].gain + trips[t].price > bestPGain) {\n\t\t\t\tbestP = plannings[p];\n\t\t\t\tbestPGain = plannings[p].gain + trips[t].price;\n\t\t\t}\n\t\t}\n\n\n\t\tif (trips[t].end < refP.end || bestPGain > refP.gain){\n\t\t\tif (bestP == null){\n\t\t\t\tbestP = emptyPlanning.addTrip(trips[t]);\n\t\t\t}else {\n\t\t\t\ttrips[t].departure = bestP.end;\n\t\t\t\tbestP = bestP.addTrip(trips[t]);\n\t\t\t\tif (trips[t].departure > lastMin) lastMin = trips[t].departure;\t\n\t\t\t}\n\t\t\tplannings.push(bestP);\n\t\t\tif (bestPGain >= refP.gain){\n\t\t\t\trefP = bestP;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\tvar end = new Date().getTime();\t\n\tconsole.log(\"mytime = \", end - begin);\n\t\n\t\t\n\t//At the end, the reference planning is da best one !\n\treturn {\"gain\": refP.gain, \"path\": refP.path.replace(/;$/, '').split(';')};\n}", "title": "" }, { "docid": "ebff686d7618d445ec135f7d29f31afa", "score": "0.6230404", "text": "function maxProfit(prices) {\n let max = 0;\n let min = Number.MAX_VALUE;\n for (const price of prices) {\n if (price < min) {\n min = price;\n } else if (price - min > max) {\n max = price - min;\n }\n }\n return max;\n }", "title": "" }, { "docid": "755136a7947b72be923a68b572cf14ad", "score": "0.6229403", "text": "function maxProfit(prices) {\n let maxProfit = 0;\n for (let i = 0; i < prices.length; i++) {\n for (let j = i+1; j < prices.length; j++) {\n let profit = prices[j] - prices[i];\n if (profit > maxProfit) {\n maxProfit = profit;\n }\n }\n }\n\n return maxProfit;\n}", "title": "" }, { "docid": "c22e49628537cbf6039d7450905039aa", "score": "0.6225314", "text": "function createPackage(small, big, goal) { // 4, 1, 10\n let bigWeight = 5;\n let leftOver = goal; // 10\n\n let bigCount = big; // 1\n while (leftOver > 0 || bigCount > 0) {\n if (leftOver - bigWeight < 0) break;\n leftOver = leftOver - bigWeight\n bigCount--;\n }\n\n // Figure out how much total weight I have in big goal\n // Subtract that weight from the leftOver, if it ends up using it all up return 0\n\n // If leftOver weight has weight left, subtract small weight from it.\n // Cases:\n // Small weight is equal to leftOver, return small\n // Small weight is bigger than left Over\n // Small weight is less than left Over, return -1\n if (leftOver )\n if (leftOver - small === 0) return small;\n else if (leftOver > small) return -1;\n else return leftOver;\n}", "title": "" }, { "docid": "de9a1dbbd68c40fcf94588687bffb284", "score": "0.62188166", "text": "function getMaxProfit(stockPrices) {\n let maxProfit = 0;\n // Go through every time\n for (let outerTime = 0; outerTime < stockPrices.length; outerTime++) {\n // For each time, go through every other time\n for (let innerTime = 0; innerTime < stockPrices.length; innerTime++) {\n // For each pair, find the earlier and later times\n const earlierTime = Math.min(outerTime, innerTime);\n const laterTime = Math.max(outerTime, innerTime);\n // And use those to find the earlier and later prices\n const earlierPrice = stockPrices[earlierTime];\n const laterPrice = stockPrices[laterTime];\n // See what our profit would be if we bought at the\n // min price and sold at the current price\n const potentialProfit = laterPrice - earlierPrice\n // Update maxProfit if we can do better\n maxProfit = Math.max(maxProfit, potentialProfit);\n }\n }\n return maxProfit;\n}", "title": "" }, { "docid": "647556f90b0a7a9e08f98ba10fbeca18", "score": "0.62072015", "text": "function maxProfit(buyDate, prices) {\n const buyPrice = prices[buyDate];\n let profit = 0;\n for (let i = buyDate; i < prices.length; i++) {\n if(buyPrice < prices[i] && prices[i] - buyPrice > profit) {\n profit = prices[i] - buyPrice;\n }\n }\n if(profit > 0) {\n return profit;\n }\n else {\n return 'oof!';\n }\n}", "title": "" }, { "docid": "246b2f26431a7f880870b083f76e6258", "score": "0.61586", "text": "function maxProfitFast(prices) {\n let minProfit = Infinity;\n let maxProfit = 0;\n for (let i = 0; i < prices.length; i++) {\n if (prices[i] < minProfit) {\n minProfit = prices[i];\n } else if (prices[i] - minProfit > maxProfit) {\n maxProfit = prices[i] - minProfit;\n }\n }\n return maxProfit;\n}", "title": "" }, { "docid": "0d0784eff55ec50088b80440e874f64e", "score": "0.61461467", "text": "function maxProfit(prices) {\n let max = 0;\n let min = Number.MAX_VALUE;\n for (const price of prices) {\n min = Math.min(min, price);\n max = Math.max(max, price - min);\n }\n return max;\n }", "title": "" }, { "docid": "68ed0eb6999644535a68ee541b1d7582", "score": "0.60992044", "text": "function maxProfit(prices) {\n let max = 0;\n for (let i = 0; i < prices.length; i++) {\n for (let j = i + 1; j < prices.length; j++) {\n const profit = prices[j] - prices[i];\n if (profit > max) {\n max = profit;\n }\n }\n }\n return max;\n }", "title": "" }, { "docid": "8f024b24c93271c047d528a36c76eda1", "score": "0.6085321", "text": "function finalPrice(prices) {\n let s = []\n let i = prices.length - 1\n let p, d\n\n while(i >= 0) {\n p = prices[i]\n\n while(s.length) {\n d = s[s.length - 1]\n\n if (d <= p) {\n prices[i] -= d\n break\n }else{\n s.pop()\n }\n }\n s.push(p)\n i -= 1\n }\n return prices\n}", "title": "" }, { "docid": "8bc05dc98df9384b883436aebd2aa1bf", "score": "0.60301125", "text": "function deliveryCost(product) {\n\n //error for string type input\n if (typeof product != 'number') {\n return 'Order as a number please.';\n }\n\n // error for less than 0 \n else if (product <= 0) {\n return 'Order at least 1 product please.';\n }\n\n // theory area starts from here\n\n const priceFor100 = 100;\n const priceFor200 = 80;\n const priceUpto200 = 50;\n\n if(product <= 100) {\n const under100 = product * priceFor100;\n\n return under100;\n }\n\n // Conditionals\n\n else if(product <= 200) {\n\n const first100 = 100 * priceFor100;\n const restProduct = product - 100;\n const under200 = restProduct * priceFor200;\n const totalPrice = first100 + under200;\n\n return totalPrice;\n }\n \n else{\n\n const first100 = 100 * priceFor100;\n const first200 = 100 * priceFor200;\n const restProduct = product - 200;\n const upto200 = restProduct * priceUpto200;\n const totalPrice = first100 + first200 + upto200;\n\n return totalPrice;\n }\n\n}", "title": "" }, { "docid": "3bef8c9f750077ab0d0605157c191021", "score": "0.60295373", "text": "function doOrders(){\n let hour = date.getHours();\n if(marketTime.opened > hour && marketTime.closed < hour && marketTime.forceOpen == false){\n console.log(\"Market is closed\");\n return;\n }\n if(marketTime.opened > hour || marketTime.closed < hour && marketTime.forceOpen == false){\n console.log(\"Market is closed\");\n return;\n }\n\n for(i = 0; i < users.length; i++){\n console.log(\"First for loop\");\n if(users[i].buying.length <= 0){\n console.log(\"buying length is 0\");\n continue;\n }\n for(j = 0; j < users[i].buying.length;j++){\n let stockFind = users[i].buying[j].id;\n if(stocksArray[stockFind].Selling.length <= 0){\n console.log(\"stocks selling is 0\");\n continue;\n }\n let bestPriceIndex = -1;\n let bestPriceDif = 1000;\n for(k = 0; k < stocksArray[stockFind].Selling.length; k++){\n console.log(\"now in selling loop\");\n if(stocksArray[stockFind].Selling[k].user == users[i].username){\n console.log(\"same person\");\n continue;\n }\n if(stocksArray[stockFind].Selling[k].pricing <= users[i].buying[j].maxPrice){\n console.log(\"doing max price\");\n if(bestPriceDif >= users[i].buying[j].maxPrice - stocksArray[stockFind].Selling[k].pricing){\n bestPriceIndex = k;\n bestPriceDif = users[i].buying[j].maxPrice - stocksArray[stockFind].Selling[k].pricing;\n }\n }\n }\n console.log(bestPriceIndex);\n if(bestPriceIndex == -1){\n console.log(\"nothing here\");\n continue;\n }\n let amountToBuy = 0;\n for(k = stocksArray[stockFind].Selling[bestPriceIndex].amount; k > 0; k--){\n if(stocksArray[stockFind].Selling[bestPriceIndex].pricing * k < users[i].accountBalance){\n console.log(\"changing amount to buy\");\n amountToBuy = k;\n break;\n }\n }\n if(amountToBuy >= users[i].buying[j].sharesBuying){\n console.log(\"editing the orders\");\n amountToBuy = users[i].buying[j].sharesBuying;\n users[i].buying.splice(j, 1);\n j--;\n }else if(amountToBuy > 0 && amountToBuy < users[i].buying[j].sharesBuying){\n console.log(\"editing the orders\");\n users[i].buying[j].sharesBuying -= amountToBuy;\n }\n if(amountToBuy == 0){\n continue;\n }else{\n let check = purchaseStock(i, bestPriceIndex, amountToBuy, stockFind, stocksArray[stockFind].Selling[bestPriceIndex].uid);\n \n if(check){\n console.log(\"good\");\n }else{\n console.log(\"error occurred\");\n }\n }\n }\n }\n}", "title": "" }, { "docid": "26afabca9ffbb30c18339e50dc093a76", "score": "0.6014754", "text": "function vending(price, payment){\n let payment2 = 0\n let price2 = price*100\n let arr = [0,0,0,0]\n let change = 0\n \n for(let i = 0; i<payment.length;i++){\n payment2+=payment[i]*100\n }\n \n if(payment2 > price2){\n change = payment2 - price2\n }else{\n change = payment2\n }\n \n if(change>=25){\n arr[3] = Math.floor(change/25),\n change = change-25*arr[3]\n }\n \n if(change>=10){\n arr[2] = Math.floor(change/10),\n change = change-10*arr[2]\n }\n \n if(change>=5){\n arr[1] = Math.floor(change/5),\n change = change - 5*arr[1]\n }\n \n arr[0] = change\n \n return arr\n }", "title": "" }, { "docid": "9f7d93e0e5f83d0e0f79f8b443d00aee", "score": "0.60059583", "text": "function buy_sell(data){\n\tlet buy = 0;\n\tlet sell = 0;\n\tlet RSI = data[7][data[7].length - 1];\n\tlet allRSI = data[7];\n\tlet macdDiff = data[13];\n\tlet n = macdDiff.length\n\tif (RSI >= 70){\n\t\treturn \"This stock is overbought\"\n\t}\n\telse if (RSI <= 30){\n\t\treturn \"This stock is oversold\"\n\t}\n\telse if (RSI >= 65){\n\t\treturn \"recommend to sell\"\n\t}\n\telse if(RSI <= 35){\n\t\treturn \"recommend to buy\"\n\t}\n\telse{\n\t\tlet a = \"\";\n\t\tlet count = 0;\n\t\tfor(i=1; i < 11;i++){\n\t\t\tif (macdDiff[n - i] < 0 && macdDiff[n - i - 1] > 0){\n\t\t\t\ta = \"Bearish,\";\n\t\t\t\tbreak\n\t\t\t}\n\t\t\telse if(macdDiff[n - i] > 0 && macdDiff[n - i-1] < 0){\n\t\t\t\ta = \"Bullish,\"\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tfor(i=1; i < 11;i++){\n\t\t\tif (macdDiff[n - i] < 0 && macdDiff[n - i - 1] > 0){\n\t\t\t\tcount = count + 1;\n\t\t\t}\n\t\t\tif(macdDiff[n - i] > 0 && macdDiff[n - i] < 0){\n\t\t\t\tcount = count + 1;\n\t\t\t}\n\t\t\tif (count > 2){\n\t\t\t a = ''\n\t\t\t}\n\t\t}\n\n\t\tfor(i = 1; i < 6; i ++){\n\t\t\tif (allRSI[n - i] > allRSI[n - i - 1]){\n\t\t\t\tsell += 1;\n\t\t\t}\n\t\t\telse if (allRSI[n - i] < allRSI[n - i - 1]){\n\t\t\t\tbuy += 1\n\t\t\t}\n\t\t\telse if (Math.min(allRSI.splice(n-20,n-1)) == RSI){\n\t\t\t\tsell = 0\n\t\t\t}\n\t\t\telse if (Math.max(allRSI.slice(n-20,n-1)) == RSI){\n\t\t\t\tbuy = 0\n\t\t\t}\n\t\t}\n\t\tlet suggest = buy - sell;\n\t\tif (suggest >= 3){\n\t\t\treturn a + \"recommend to buy\";\n\t\t}else if(suggest < 3){\n\t\t\treturn a + \"recommend to sell\"\n\t\t}else if (suggest > 0){\n\t\t\treturn a + \"consider to buy\"\n\t\t}else if (suggest < 0){\n\t\t\treturn a + \"consider to sell\"\n\t\t}\n\t}\n}", "title": "" }, { "docid": "33d829005abd3f86a49aeb577241bf84", "score": "0.60010976", "text": "function analyzePoloBTCPrices(exchangePrices, baseStableCoin, coins, timeStamp) {\n var timeStampStr = timeStamp.getTime();\n console.log(\"priceCheckCount:\".concat(numberOfChecks, \"|\").concat(baseStableCoin, \"|maxBuyArb:\").concat(maxBuyArb, \"|maxSellArb:\").concat(maxSellArb)); // Check if buying the coin will be profitable.\n\n coins.forEach(function (curCoin) {\n var lowestAskBTC = exchangePrices[\"BTC_\" + curCoin].lowestAsk;\n var highestBidUSDC = exchangePrices[baseStableCoin + \"_\" + curCoin].highestBid;\n var USDC_BTClowestAsk = exchangePrices[baseStableCoin + \"_\" + \"BTC\"].lowestAsk;\n var ArbRatio = highestBidUSDC / (lowestAskBTC * USDC_BTClowestAsk);\n var showMax = \"\";\n\n if (ArbRatio > maxBuyArb) {\n maxBuyArb = ArbRatio;\n showMax = \"NewMax\";\n }\n\n if (ArbRatio > 1.0) console.log(\"REC|\".concat(timeStamp, \"|\").concat(timeStampStr, \"|Buy|\").concat(baseStableCoin, \"|\").concat(curCoin, \"|ArbRatio:\").concat(ArbRatio, \"|\").concat(showMax));\n\n if (ArbRatio > threshold) {\n console.log(\"Something dramatic needs to happen!\");\n }\n }); // Check if selling the coin will be profitable\n\n coins.forEach(function (curCoin) {\n var BTC_curCoinBid = exchangePrices[\"BTC_\" + curCoin].highestBid;\n var USDC_BTCBid = exchangePrices[baseStableCoin + \"_\" + \"BTC\"].highestBid;\n var USDC_curCoinAsk = exchangePrices[baseStableCoin + \"_\" + curCoin].lowestAsk;\n var AmtInit = 10000;\n var AmtFinal = AmtInit * BTC_curCoinBid * USDC_BTCBid / USDC_curCoinAsk;\n var ArbRatio = AmtFinal / AmtInit;\n var showMax = \"\";\n\n if (ArbRatio > maxSellArb) {\n maxSellArb = ArbRatio;\n showMax = \"NewMax\";\n }\n\n if (ArbRatio > 1.0) console.log(\"REC|\".concat(timeStamp, \"|\").concat(timeStampStr, \"|Sell|\").concat(baseStableCoin, \"|\").concat(curCoin, \"|ArbRatio:\").concat(ArbRatio, \"|\").concat(showMax));\n\n if (ArbRatio > threshold) {\n console.log(\"Something dramatic needs to happen!\");\n }\n });\n}", "title": "" }, { "docid": "5343e2e726b4434db602500a27e28934", "score": "0.5969253", "text": "function maximumToys(prices, k) {\n let sortedPrice = prices.sort((a, b) => a - b);\n let toys = 0;\n let cashLeft = k;\n for (let i = 0; i < prices.length - 1; i++) {\n if (prices[i] <= cashLeft) {\n cashLeft = cashLeft - prices[i];\n toys++;\n }\n }\n return toys;\n}", "title": "" }, { "docid": "1cc689ce7b4e3c892ee428c05b315447", "score": "0.5967778", "text": "function minimumLoss(price) {\n var n=price.length;\n var prices = price.map((v, i) => ({ v, i }));\n prices.sort((a, b) => a.v - b.v);\n var min = Number.MAX_VALUE;\n for (var i = 1; i < n; i++) {\n var prev = prices[i - 1];\n var curr = prices[i];\n if (curr.i < prev.i && (curr.v - prev.v) < min) {\n min = curr.v - prev.v;\n }\n }\n return min;\n}", "title": "" }, { "docid": "bcc8e9121f0f5d5303bae7caa7307be9", "score": "0.594569", "text": "function changeEnough([Quarters,Dimes,Nickels,Pennies],price) {\n\tif (Quarters*0.25+Dimes*0.10+Nickels*0.05+Pennies*0.01>=price) {\n\t\tconsole.log(\"You have enough change\")\n\t} else\n\tconsole.log (\"you dont have enough change.\")\n}", "title": "" }, { "docid": "d91cb1c928a6ead5a2f0369a24a603af", "score": "0.5942745", "text": "function getMaxProfit(stockPrices) {\n if (stockPrices.length < 2) {\n throw new Error();\n }\n\n let minPrice = stockPrices[0];\n let highestProfit = stockPrices[1] - stockPrices[0];\n\n for (let i = 1; i < stockPrices.length; i++) {\n const currentPrice = stockPrices[i];\n const profit = currentPrice - minPrice;\n\n highestProfit = Math.max(highestProfit, profit);\n minPrice = Math.min(minPrice, currentPrice);\n }\n return highestProfit;\n}", "title": "" }, { "docid": "0b12d87505a9f0eaad291f76c309157e", "score": "0.593994", "text": "function buy(sel) {\n\tswitch(sel) {\n\t\t//cost of \"chicks\"\n\t\tcase \"chicks\":\n\t\t\tif(eggs >= 10) {\n\t\t\t\teggs-=10;\n\t\t\t\tchicks++;\n\t\t\t}\n\t\t\tbreak;\n\t\t//cost of \"cartons\"\n\t\tcase \"cartons\":\n\t\t\tif(eggs >= 100) {\n\t\t\t\teggs-=100;\n\t\t\t\tcartons++;\n\t\t\t}\n\t\t\tbreak;\n\t\t//cost of \"trucks\"\n\t\tcase \"trucks\":\n\t\t\tif(eggs >= 500) {\n\t\t\t\teggs-=500;\n\t\t\t\ttrucks++;\n\t\t\t}\n\t\t\tbreak;\n\t\t//cost of \"farms\"\n\t\tcase \"farms\":\n\t\t\tif(eggs >= 1000) {\n\t\t\t\teggs-=1000;\n\t\t\t\tfarms++;\n\t\t\t}\n\t\t\tbreak;\n\t\t//cost of \"eggtopia\"\n\t\tcase \"eggtopia\":\n\t\t\tif(eggs >= 100000) {\n\t\t\t\teggs-=100000;\n\t\t\t\teggtopia++;\n\t\t\t}\n\t\t\tbreak;\n\t\t//cost of \"universe\"\n\t\tcase \"universe\":\n\t\t\tif(eggs >= 100000000) {\n\t\t\t\teggs-=100000000;\n\t\t\t\tuniversee++;\n\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\tupdate_values();\n}", "title": "" }, { "docid": "81370c628ae6134baacc690505f26745", "score": "0.59266424", "text": "function budgetCalculator(watch,phone,laptop){\n var timeKeeperPrice = watch * 50;\n var mobilePrice = phone * 100;\n var ComputerPrice = laptop * 500;\n var totalCostPrice = timeKeeperPrice + mobilePrice + ComputerPrice;\n return totalCostPrice;\n}", "title": "" }, { "docid": "91aa5daaa03e99d821d3915f3826a500", "score": "0.5913624", "text": "function maxProfit(arr) {\n //being by getting diff between first and second items in array\n let maximumProfit = 0;\n let bestDay = 0;\n \n //loop through the remaining items in array, comparing profit to the maximumProfit, and replacing it if it is greater and set bestDay\n for (let i = 1; i < arr.length; i++) {\n let profit = arr[i - 1] - arr[i];\n \n if (profit > maximumProfit) {\n console.log(i);\n maximumProfit = profit;\n bestDay = i - 1;\n }\n }\n return `Buy on day '${bestDay + 1}' for a profit of '${maximumProfit}'`;\n }", "title": "" }, { "docid": "9033f66e3554c15f4d3ffd6dfef5f0db", "score": "0.5905009", "text": "function budgetCalculator(watch, phone, laptop) {\n //Basic Price\n var watchPrice = 50;\n var phonePrice = 100;\n var laptopPrice = 500;\n //condition apply\n if (watch >= 0 && phone >= 0 && laptop >= 0) {\n watchPrice = 50 * watch;\n phonePrice = 100 * phone;\n laptopPrice = 500 * laptop;\n //total price all electronic products\n var totalPrice = watchPrice + phonePrice + laptopPrice;\n } else {\n //error message\n return \"Sorry! Do not due to Product price\";\n }\n\n return totalPrice;\n}", "title": "" }, { "docid": "0cfc2503a8634b3d46feefecad3f0d4d", "score": "0.5891854", "text": "function getMaxProfit(arr) {\n var minIdx = 0;\n var maxIdx = 1;\n var currMin = 0;\n var maxProfit = 0;\n\n if(arr.length < 2) {\n throw new Error(\"Need at least two time periods to be profitable!\");\n }\n for(var i = 1; i < arr.length; i++) {\n // new current min.\n if(arr[i] < arr[currMin]) {\n currMin = i;\n }\n // new best profit\n if(arr[maxIdx] - arr[minIdx] < arr[i] - arr[currMin]) {\n maxIdx = i;\n minIdx = currMin;\n }\n }\n\n maxProfit = arr[maxIdx] - arr[minIdx];\n return maxProfit;\n}", "title": "" }, { "docid": "1d6614dd9228ffb4e2b7cdedf5aca433", "score": "0.5891836", "text": "function budgetCalculator(watch,phone,laptop) { // function\n const watchProduct=watch*50; \n const phoneProduct=phone*100;\n const laptopProduct=laptop*500;\n const totalCost = (watchProduct+phoneProduct+laptopProduct); //sum value of total cost\n return totalCost;\n}", "title": "" }, { "docid": "3f356cac98a4cd76c7d6fe74dbd63085", "score": "0.587774", "text": "function maximumToys(prices, k) {\n prices.sort((a,b)=>a-b)\n let ans =0\n for(let i =0; i <prices.length; i++){\n let x = ans + prices[i]\n if(x > k){\n return i\n }else{\n ans= x;\n }\n }\n\n}", "title": "" }, { "docid": "c7246d5eb5b38dff51d2eec58d37efdd", "score": "0.5866397", "text": "function maxProfit(arr) {\n let possibleGain = [];\n for (let idx = 0; idx < arr.length; idx++) {\n for (let idx2 = idx + 1; idx2 < arr.length; idx2++) {\n if (arr[idx2] - arr[idx] > 0) {\n possibleGain.push(arr[idx2] - arr[idx]);\n }\n }\n }\n \n if (possibleGain.length === 0) {\n return 0;\n } else {\n return possibleGain.sort((a, b) => b - a)[0];\n }\n\n}", "title": "" }, { "docid": "bebb7c7f2d61a770dce6e660fc42dc1c", "score": "0.58486515", "text": "function find_SellingPrice(a, b) {\n var loss = (100 - b) / 100\n var sp = a * loss\n var selling_price = Math.round(sp);\n return selling_price\n}", "title": "" }, { "docid": "15a924d64bccd06c539aa8f5ecc619e8", "score": "0.5847161", "text": "function search(budget, prices) {\n return prices.sort((a,b) => a - b).filter(el => el <= budget).join()\n}", "title": "" }, { "docid": "4ed7a72b9686d8adb705513e3181b182", "score": "0.5837613", "text": "function bestSales(sales) {}", "title": "" }, { "docid": "fa0392ebba4cf2081a5a244ef6e8ae41", "score": "0.5826671", "text": "function budgetCalculator(watch, mobile, laptop){\n if(watch >= 0, mobile >= 0, laptop >= 0){\n var watchPrice = watch*50;\n var mobiblePrice = mobile*100;\n var laptopPrice = laptop*500;\n var totalPrice = watchPrice + mobiblePrice + laptopPrice;\n }\n return totalPrice;\n}", "title": "" }, { "docid": "2e4258f84596862e24b63e1685813755", "score": "0.58116186", "text": "function simpleFix() {\n for (i = 0; i < stockPrices.length; i++) {\n if (stockPrices[i] <= stockPrices[currentmin]) {\n currentmin = i; //set the currentmin to targeted item\n }\n if (\n stockPrices[maxindx] - stockPrices[minindx] < //if current max profit is less than\n stockPrices[i] - stockPrices[currentmin] // the current index minus the current minimum\n ) {\n maxindx = i; //becomes new max index\n minindx = currentmin; //new current min\n }\n }\n maxProf = stockPrices[maxindx] - stockPrices[minindx];\n console.log(\"this is the resultant maxprof \" + maxProf);\n return maxProf;\n}", "title": "" }, { "docid": "3df62442a49845cb18975b29156c5fdc", "score": "0.5794686", "text": "function budgetCalculator(numberOfwatch, numberOfphone, numberOflaptop) {\n var watchPerPerice = 50;\n var phonePerPerice = 100;\n var laptopPerPerice = 500;\n var totalCost = 0;\n if (numberOfwatch < 0 || numberOfphone < 0 || numberOflaptop < 0) {\n return \"Sorry ! Your product number can't be negative\";\n }\n else {\n var watchPrice = numberOfwatch * 50;\n var watchPrice = numberOfphone * 100;\n var laptopPrice = numberOflaptop * 500;\n var totalCost = watchPrice + watchPrice + laptopPrice;\n return totalCost;\n }\n}", "title": "" }, { "docid": "b870e111ab0fa5c9d914e34f0e97ae9a", "score": "0.5772984", "text": "function budgetCalculator(watch,phone,laptop){\n var watchPrice = watch *50;\n var phonePrice = phone *100;\n var laptopProce = laptop *500;\n var totalPrice = watchPrice + phonePrice + laptopProce;\n return totalPrice;\n }", "title": "" }, { "docid": "9bf2a29c006cf401c6ab1732178bd9c1", "score": "0.577152", "text": "function rightPrice(arr){\n\n let result = 0\n let min = arr[0]\n for (let i=1; i<arr.length; i++){\n min = Math.min(arr[i], min)\n result = Math.max(result, arr[i]-min)\n }\n return result\n}", "title": "" }, { "docid": "6f2e50de2b844e7c2339e8c632737c10", "score": "0.5770716", "text": "function budgetCalculator(watch, mobile, latptop) {\n\tconst watchPrice = 50;\n\tconst mobilePrice = 100;\n\tconst laptopPrice = 500;\n\tconst totalPrice =\n\t\twatch * watchPrice + mobile * mobilePrice + latptop * laptopPrice;\n\treturn totalPrice;\n}", "title": "" }, { "docid": "43599140b8173c2af30293f6a66d4ff1", "score": "0.576883", "text": "function findMaxProfit(arr) {\n let profit = 0\n for (let i = 0; i < arr.length; i++) {\n if(arr[i+1] - arr[i] > profit) {\n profit = arr[i+1] - arr[i]\n }\n }\n return profit\n}", "title": "" }, { "docid": "a9049876fa63cf7a8de29c3bb38cdcf2", "score": "0.5767731", "text": "buyPrice() {\n return lodash_1.sortBy(this.buy(), s => s.price * -1)[0];\n }", "title": "" }, { "docid": "2e0505b081379859cb34a7aa10fcb4ae", "score": "0.5751944", "text": "function budgetCalculator (watch, phone, laptop){\n var watchPrice = watch*50; \n var phonePrice = phone*100;\n var laptopPrice = laptop*500;\n \n var totalCost = watchPrice + phonePrice + laptopPrice;\n return totalCost;\n}", "title": "" }, { "docid": "73bea7a251e84d3e11e0c3f25cbc9b8d", "score": "0.5750476", "text": "function getMaxProfit(arr) {\n let profit = [];\n for(let i in arr) {\n for (let j in arr) {\n if (i == j) {\n continue;\n }\n profit.push(arr[i] - arr[j]);\n }\n }\n\n profit.sort((a, b) => a - b);\n console.log('最多进行一次交易的情况下可以获取的最大利润: ', profit, profit[0]);\n}", "title": "" }, { "docid": "1becf434d44dc2e47b229872ff6217b6", "score": "0.5747216", "text": "async action(candles, currentBitcoinPrice) {\n let stopped = this.takeProfit(0.005);\n if (stopped) return;\n\n stopped = this.stopLoss(0.0025);\n if (stopped) return;\n\n // calculate sma indicator\n try {\n // We want to trade in the direction of the market. Filter trades with 200 ema\n // check if we are currently in uptrend or downtrend\n let ema = await this.getEMA(candles);\n let firstEMA = _.first(ema);\n let prevEMA = ema[ema.length - 2];\n let lastEMA = _.last(ema);\n let priceOverEMA = currentBitcoinPrice > lastEMA;\n let trendGrowth = (lastEMA - firstEMA) / lastEMA;\n let trendUp = lastEMA > prevEMA;\n\n // estimate trend strength\n let adx = await this.getADX(candles);\n let lastADX = adx[adx.length - 1];\n let trendSeemsStrong = !isNaN(lastADX) && lastADX > 25;\n\n let buyCondition = trendUp && trendSeemsStrong && priceOverEMA && trendGrowth > 0.03;\n\n if (!this.isInTrade()) {\n if (buyCondition) {\n // BUY condition\n return this.buy();\n } else {\n return this.hold();\n }\n } else {\n return this.hold(); // sell on stoploss/takeprofit\n }\n } catch (e) {\n console.error(\"Err: \" + e.stack);\n process.exit(-1);\n }\n }", "title": "" }, { "docid": "9d5d1ff4c4f21e01398339e3ab51fba7", "score": "0.574402", "text": "function mine(findings){\n // 1 Bitcoin = 11949.16 lv.\n // 1 g of gold = 67.51 lv.\n let totalSum = 0\n let mined = findings.map(Number)\n let bitCoinsBought = 0;\n let firstDay = 0\n \n for (let i = 0; i < mined.length; i++) {\n if ((i + 1) % 3 === 0) {\n totalSum += 0.7 * mined[i] \n } else {\n totalSum += mined[i] \n }\n let budget = totalSum * 67.51 \n \n if (budget / 11949.16 >= 1) {\n if (firstDay === 0) {\n firstDay = i + 1\n }\n\n totalSum -= Math.floor(budget / 11949.16) * 11949.16 / 67.51\n bitCoinsBought += Math.floor(budget / 11949.16)\n }\n }\n\n console.log(`Bought bitcoins: ${bitCoinsBought}`)\n\n if (firstDay !== 0) {\n console.log(`Day of the first purchased bitcoin: ${firstDay}`) \n }\n\n console.log(`Left money: ${(totalSum * 67.51).toFixed(2)} lv.`) \n}", "title": "" }, { "docid": "63e379897fb8e7f965a8e75cf7a180ab", "score": "0.5742323", "text": "function budgetCalculator(x,y,z) {\n \n var watchCost = 50 * x ;\n\n var mobileCost = 100 * y ;\n\n var laptopCost = 500 * z ;\n\n var totalCost = watchCost + mobileCost + laptopCost ;\n\n return totalCost ;\n\n\n \n}", "title": "" }, { "docid": "67115f7dafdcb1b6a6adbfc797af30b1", "score": "0.5739413", "text": "function budgetCalculator(watch, phone, laptop){\n if(0 <= watch && 0 <= phone && 0 <= laptop && Number(watch) === watch && Number(phone) === phone && Number(laptop) === laptop && watch % 1 === 0 && phone % 1 === 0 && laptop % 1 === 0){ //if start\n const watchPrice = 50;\n const phonePrice = 100;\n const laptopPrice = 500;\n let result = (watchPrice * watch) + (phonePrice * phone) + (laptopPrice * laptop); //calculate total price\n return result; //output\n }else{\n return \"Invalid quantity\"; //output \n }\n}", "title": "" }, { "docid": "c9b7107741f69a046a39019847234900", "score": "0.57389534", "text": "function budgetCalculator(watch,phone,laptop){\n \n // to avoid negative value or zero conflict\n if(watch < 0 || phone < 0 || laptop < 0){\n return 'Product items number can not be negative.';\n }\n // total cost calculation\n else{\n // watch price = 50\n var watchCost = watch * 50;\n \n // phone price = 100\n var phoneCost = phone * 100;\n \n // laptop price = 300\n var laptopCost = laptop * 500;\n\n // total cost\n var totalItemsCost = (watchCost + phoneCost + laptopCost);\n \n return totalItemsCost; /* Total calculated Cost */\n }\n}", "title": "" }, { "docid": "1b29029bdc559665effce5e0bd4fd7f1", "score": "0.57383084", "text": "function budgetCalculator(watch, phone, laptop) {\n var watchPrice = watch * 50;\n var phonePrice = phone * 100;\n var laptopPrice = laptop * 500;\n var result = watchPrice + phonePrice + laptopPrice;\n if (result <= 0) {\n return \"If you don't want to buy this products, you don't have any cost.\";\n }\n else {\n return result;\n }\n}", "title": "" }, { "docid": "0324b8ad09eea685f616a6c1ac19a421", "score": "0.57245755", "text": "function store1(num, price) {\n let originPrice = num * price;\n if (num < 3) {\n if (originPrice < 50) {\n return originPrice+10;\n } else {\n return originPrice\n }\n } else {\n if (originPrice * 0.7 < 50) {\n return originPrice * 0.7+10\n } else {\n return originPrice * 0.7\n }\n }\n}", "title": "" }, { "docid": "b871a7c4a51c64ca92af72f3449833e0", "score": "0.5723659", "text": "function predict(open,priceData,trendData,previousTrend) {\n var trendNames = [\"Fluctuating\",\"Small Spike\",\"Large Spike\",\"Decreasing\"]\n var seg=0; //used to increment through day periods\n var range = []; //used for max/min display\n var scaleout = open/100; //used to scale prices\n var tDataBackup = trendData; //used to scale prices\n var probability = [] //array of base probabilites for each trend. previous trends dictate current probabilties.\n if (previousTrend == \"Fluctuating\") {\n probability = [0.20,0.35,0.30,0.15] \n } else if (previousTrend == \"Small Spike\") {\n probability = [0.45,0.15,0.25,0.15]\n } else if (previousTrend == \"Large Spike\") {\n probability = [0.50,0.25,0.05,0.20]\n } else if (previousTrend == \"Decreasing\") {\n probability = [0.25,0.25,0.45,0.05]\n } else {\n probability = [0.346,0.259,0.247,0.148] //if unknown, use an averaged probability\n } \n priceData=priceData.toString().split(\",\"); //store prices in array\n var originalPrices = Array.from(priceData) //make a copy of the original prices\n originalPrices.unshift(\"-1\") //i dont think this gets used anymore.\n for (var item in priceData) { \n priceData[item] = (Number(priceData[item])/open)*100; //scale prices to match trend data\n }\n var priceSeq = [] \n for (var index in priceData) {\n var item = priceData[index]; //for each price \n for (var row=0;row<trendData.length;row++) { //check each trend to see if the price matches it. if it doesnt, remove it from the list of possible trends\n if (Math.floor(Number(item)) == 0){break;} \n if (Math.floor(Number(item))<Math.floor(Number(trendData[row][seg].split(\",\")[0])) || Math.floor(Number(item))>Math.floor(Number(trendData[row][seg].split(\",\")[1]))){\n trendData.splice(row,1);\n row--;\n }\n }\n if (priceData[index]) {priceSeq.push([seg,priceData[index]])}\n range[seg] = [660,0]; //set up part of range\n seg++;\n }\n \n /*\n this part counts how many of each trend type you have\n this was because it originally only displayed how many of each trend your data matched to, \n but it was later repurposed to be used in calculating the percentages by virtue of telling us whether we match a type of trend or not.\n */\n var tCount =[0,0,0,0];\n for (var item in trendData) {\n if (trendData[item][12] == \"Fluctuating\") {\n tCount[0]++;\n }\n if (trendData[item][12] == \"Large Spike\") {\n tCount[2]++;\n }\n if (trendData[item][12] == \"Decreasing\") {\n tCount[3]++;\n }\n if (trendData[item][12] == \"Small Spike\") {\n tCount[1]++;\n }\n }\n \n if (trendData.length == 0){return \"No matching trend found. Please check your prices.\";} //Trend list should never end up empty. If trend list is empty, you fucked up your prices.\n for (var i in trendData){ //this part goes through the remaining trends and finds the minimum and maximum for each segment, then scales it to your price and saves it into range\n row=trendData[i];\n for (var j = 0;j<12;j++) {\n var piece = row[j];\n if (Number(range[j][0]) > Number(row[j].split(\",\")[0])){ //minimums\n range[j][0] = Math.floor(Number(row[j].split(\",\")[0])*scaleout);\n \n }\n if (Number(range[j][1]) < Number(row[j].split(\",\")[1])) { //maximums\n range[j][1] = Math.floor(Number(row[j].split(\",\")[1])*scaleout);\n }\n }\n }\n /*\n var lastPrice = 0 \n var priceIndex = 1\n for (var i in originalPrices) {\n if (i > 0) {\n if (tCount[0] == 0 && Number(originalPrices[i] > 0)) {\n lastPrice = Number(originalPrices[i])\n priceIndex = 1\n range[i][0] = Number(originalPrices[i]) - 5\n } else if (tCount[0] == 0 && i < 12) {\n //return lastPrice\n range[i][0] = lastPrice - (5*priceIndex)\n }\n priceIndex++\n }\n }\n */\n \n \n for (var c in range){ //this part just merges some data to display in the cells properly\n range[c] = range[c][0] + \"-\" + range[c][1];\n }\n\n \n //this mostly works but breaks in certain situations. but in general, if a price drops by 3 it cant be fluctating, if it drops by 6+ it has to be fluctuating\n for (item in priceSeq) { \n if (tCount[0] == 0 || tCount[1]+tCount[2]+tCount[3] == 0 ){break}\n if (item > 0) { //dont operate on the first one, dingus. theres no previous price\n var dif = priceSeq[item-1][1] - priceSeq[item][1] //find differences between previous price and current price\n var segs = priceSeq[item][0] - priceSeq[item-1][0]//find how many segs between prices\n if (dif < 4*segs && dif > 0) {\n //return tCount\n tCount[0] = 0 //cant be fluctuating\n }\n else if (dif > 5*segs && dif < 11*segs && tCount[1] > 0 ) {\n tCount[1] = tCount[2] = tCount[3] = 0 //cant be anything but fluctuating\n }\n } \n }\n \n //this part goes through the remaining trends and displays what types of trends you could have\n var pattern = \"\"\n var pArray = []\n for (item in tCount) {\n if (tCount[item] > 0) {\n pArray.push(trendNames[item])\n }\n }\n pattern = pArray.join(\"/\"); //mash it together for single cell display \n \n //this is the percentage calculation. it calcs the chance of a certain price showing up in your possible trends and then scales them to 100%\n var tRanges = [2380,400,35,5]\n if (trendData.length < 72) {\n for (item in tCount){\n probability[item] *= tCount[item]/tRanges[item]\n }\n var pTotal = probability[0]+probability[1]+probability[2]+probability[3]\n for (item in probability) {\n probability[item] /= pTotal\n }\n }\n for (item in probability) {\n probability[item] = Math.floor(probability[item].toFixed(2) *100) //round shit off otherwise you get big ass doubles.\n }\n //var matches = tCount.join(\"-\"); //mash it together for single cell display\n var probs = probability.join(\"-\")\n \n range.push(pattern) //add the pattern possibilites to the end of the range array\n range.unshift(probs) //add the pattern counts to the start of the range array \n \n //this shit is so it displays across in a row instead of down in a column\n var fin = []\n fin[0] = range;\n \n return fin;\n}", "title": "" }, { "docid": "97faac236dccb32c65bfa78c800edcde", "score": "0.5716619", "text": "function solve(meal_cost, tip_percent, tax_percent) {\n meal_cost + (meal_cost * tip_percent / 100) + (meal_cost * tax_percent / 100)\n}", "title": "" }, { "docid": "f2c078f7e7e8df75c007757d179f825d", "score": "0.57106835", "text": "function sale(price) {\n return {\n strike: price,\n amount: Math.floor(balance * aggression / (price * 100))\n };\n}", "title": "" }, { "docid": "4c42a1d76aa96075536deceb753ef78a", "score": "0.57053167", "text": "function doPriceThreshold() {\n\t// find half max price\n\tvar threshold = jStat.max(dataPrices)/3\n\tfor(i=0;i<dataPrices.length;i++) {\n\t\tif ((dataPrices[i] >= threshold) && \n\t\t\t(totalWeightPt + dataWeights[i]) < maxweight) {\n\t\t\t\ttotalWeightPt += dataWeights[i]\n\t\t\t\ttotalEarningPt += dataPrices[i]\n\t\t}\n\t}\n}", "title": "" }, { "docid": "72b9f75aa57d90d65300d7b012478562", "score": "0.56942016", "text": "function calculate(bidPrice, askPrice, buyingQuantityCoins, buyingForAmountInUSDT) {\r\n // PARAMETERS - assign basic CONSTANTS to basic VARIABLES\r\n let USDT_oriented = USDT_ORIENTED; // if nothing will be set\r\n let amountSpendWhenBuying = DEFAULT_AMOUNT_USDT_SPEND_WHEN_BUYING;\r\n let amountOfCoinsToBUYSELL = DEFAULT_AMOUNT_OF_COINS_TO_BUYSELL;\r\n // PARAMETERS - set VALUES to basic VARIABLES\r\n if (buyingForAmountInUSDT > 0) {\r\n amountSpendWhenBuying = parseFloat(buyingForAmountInUSDT);\r\n USDT_oriented = true;\r\n }\r\n else if (buyingQuantityCoins > 0) {\r\n amountOfCoinsToBUYSELL = parseFloat(buyingQuantityCoins);\r\n USDT_oriented = false;\r\n }\r\n else {\r\n // IF NEITHER OF THOSE THEN DEFAULTS WILL TELL THE VALUES\r\n }\r\n\r\n // ERROR HANDLING before shit happens\r\n if (typeof bidPrice != 'number' && typeof bidPrice != 'string' || typeof askPrice != 'number' && typeof askPrice != 'string') {\r\n console.log('ERROR: MSG: GO ... !');\r\n return;\r\n }\r\n \r\n // GET THE LENGTH/SIZE of DECIMALS [tailing after floating point]\r\n const PRECISSION = parseInt((bidPrice + \".\").split(\".\")[1].length); // 'PRICE TAIL' ZEROS AFTER 0.00.. [NOTE: this line/solution for getting decimals is from stakoverflow]\r\n \r\n // GET CURRENT DATA about state (price)\r\n const currentBidPrice = parseFloat(bidPrice).toFixed(PRECISSION); // price or value of COIN in USDT\r\n const currentAskPrice = parseFloat(askPrice).toFixed(PRECISSION); // price or value of COIN in USDT\r\n\r\n //// == TAX CALCULATING Section ============================================\r\n // COMMISSION stuff\r\n let quantityToBuy = parseFloat(amountSpendWhenBuying / currentBidPrice).toFixed(PRECISSION); // how much COINS can buy for A certain amounts of USDT\r\n let quantityToSell = parseFloat(amountOfCoinsToBUYSELL / currentAskPrice).toFixed(PRECISSION); // how much COINS can buy for A certain amounts of USDT\r\n let commissionForBuying = parseFloat(amountSpendWhenBuying * COMMISSION).toFixed(PRECISSION); // how much to pay commission when buying\r\n let commissionForSelling = parseFloat(amountOfCoinsToBUYSELL * COMMISSION).toFixed(PRECISSION); // how much to pay commission when buying\r\n \r\n // WHEN the amount of USDT is FIXED [for use/entrance]\r\n // lets calculate; to buy n1 COINS for n2 amount of USDT \r\n // how much of those COINS one can buy for that amount of USDT ?\r\n // and in the future, how much these new bought COINS will cost \r\n // \r\n // so, the amount of USDT is FIXED\r\n // but, the amount of COINS needs to DETERMINE\r\n // \r\n // thus,\r\n // let amountCoinsToBuySell = DEFAULT_AMOUNT_USDT_SPEND_WHEN_BUYING / currentBidPrice;\r\n // \r\n // let quantityToBuy = DEFAULT_AMOUNT_USDT_SPEND_WHEN_BUYING / currentBidPrice; // quantityToBuy === DEFAULT_AMOUNT_OF_COINS_TO_BUYSELL \r\n // let quantityToSell = quantityToBuy;\r\n // let commissionForBuying = DEFAULT_AMOUNT_USDT_SPEND_WHEN_BUYING * COMMISSION;\r\n // let commissionForSelling = quantityToSell * COMMISSION;\r\n // \r\n if (USDT_oriented) {\r\n amountCoinsToBuySell = parseFloat(amountSpendWhenBuying / currentBidPrice).toFixed(PRECISSION);\r\n \r\n quantityToBuy = parseFloat(amountSpendWhenBuying / currentBidPrice).toFixed(PRECISSION); // quantityToBuy === DEFAULT_AMOUNT_OF_COINS_TO_BUYSELL \r\n quantityToSell = quantityToBuy;\r\n commissionForBuying = parseFloat(amountSpendWhenBuying * COMMISSION).toFixed(PRECISSION);\r\n commissionForSelling = parseFloat(quantityToSell * COMMISSION); //.toFixed(PRECISSION); // WARNING: can cause issues\r\n }\r\n\r\n // WHEN the amount of COINS is FIXED [for use/entrance]\r\n // lets calculate; to buy n1 COINS for n2 amount of USDT \r\n // how much of USDT should spend to buy that amounts of COINS ?\r\n // and in the future, how much these new bought COINS will cost \r\n // \r\n // so, the amount of COINS is FIXED\r\n // but, the amount of USDT needs to DETERMINE\r\n // \r\n else {\r\n amountUSDTSpendWhenBuying = parseFloat(amountOfCoinsToBUYSELL * currentBidPrice).toFixed(PRECISSION);\r\n // so 'DEFAULT_AMOUNT_USDT_SPEND_WHEN_BUYING' == amountUSDTSpendWhenBuying [now]\r\n \r\n quantityToBuy = amountOfCoinsToBUYSELL;\r\n quantityToSell = amountOfCoinsToBUYSELL;\r\n commissionForBuying = parseFloat(amountUSDTSpendWhenBuying * COMMISSION).toFixed(PRECISSION);\r\n commissionForSelling = parseFloat(quantityToSell * COMMISSION); //.toFixed(PRECISSION); // WARNING: can cause issues\r\n }\r\n\r\n // conversion from coins into USDT\r\n let commissionInUSDTforBuying = parseFloat(commissionForBuying ).toFixed(PRECISSION); // REDUNDANT\r\n let commissionInUSDTforSelling = parseFloat(commissionForSelling * currentBidPrice).toFixed(PRECISSION); // additional calculation for convenience\r\n let buyOrderQuntityInUSDT = parseFloat(quantityToBuy * currentBidPrice).toFixed(PRECISSION); // howMuchSpendsForBuying\r\n let sellOrderQuntityInUSDT = parseFloat(quantityToSell * currentAskPrice).toFixed(PRECISSION); // howMuchReturnsFromSelling\r\n \r\n // return all calculated ...\r\n // NOTE: IT MAY LOWER or INCREASE THE INITIAL USDT AMOUNT TO BE SPEND WHEN BOUGHT QUANTITY IS TOO LOW\r\n return {\r\n PRECISSION,\r\n currentBidPrice, // for the current PRICE\r\n commissionInUSDTforBuying, // COMMISSION to pay BUYING\r\n commissionInUSDTforSelling, // COMMISSION to pay SELLING\r\n quantityToBuy, // how much COINS can BUY\r\n quantityToSell, // how much COINS can SELL\r\n buyOrderQuntityInUSDT, // how much USDT should pay for that amounts of COINS when BUYing\r\n sellOrderQuntityInUSDT, // how much USDT can gain/earn for that amounts of COINS when SELLing\r\n };\r\n}", "title": "" }, { "docid": "a8bfe3a4d600211c058e32784109ca21", "score": "0.56927955", "text": "function calculateProfitKomisi(n1, n2) {\n return (n1 * komisi1) + (n2 * komisi2);\n}", "title": "" }, { "docid": "033253f2138e3d241ef4d3c4753013e2", "score": "0.56915677", "text": "CalcOverduePrice(dateD, price, dateP) {\n let dateOverdue = new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate()).getTime();\n let dateDropOff = new Date(dateD).getTime();\n let days = Math.ceil((dateOverdue - dateDropOff) / (1000 * 60 * 60 * 24));\n if (dateDropOff >= dateOverdue) {\n return 0;\n }\n else {\n return days * price;\n }\n }", "title": "" }, { "docid": "b1c58f09be194150805969660cb70c09", "score": "0.56815743", "text": "function appleStocks(prices) {\n let min = prices[0],\n max = prices[1] - prices[0],\n temp;\n\n for (let i = 1; i < prices.length; i++) {\n temp = prices[i] - min;\n max = Math.max(max, temp);\n min = Math.min(min, prices[i]);\n }\n\n return max;\n}", "title": "" }, { "docid": "f58db136a4e07fb9f0bf0a3b9b3b9dba", "score": "0.5681315", "text": "function maxProfit(arr) {\n\tlet min = ;\n\tlet max = 0;\n\tfor(let i=0;i < arr.length;i++) {\n\t\tconst elmt = arr[i];\n\n\t}\n}", "title": "" }, { "docid": "66e6a965afdd9d0f3cb0b5068eb7467a", "score": "0.56794024", "text": "function budgetCalculator(watch, mobile, laptop) {\n \n if(watch < 0 || mobile < 0 || laptop < 0){\n console.log(\"Please provide the right quantity of product\")\n }\n\n else{\n var purchaseWatch = watch * 50;\n var purchaseMobile = mobile * 100;\n var purchaseLaptop = laptop * 500;\n \n var purchaseAllProduct = purchaseWatch + purchaseMobile + purchaseLaptop;\n\n }\n \n return purchaseAllProduct;\n}", "title": "" }, { "docid": "1afb682829002add732ff13d4d1d7d7f", "score": "0.56743425", "text": "function analyzePoloXMRPrices(exchangePrices, timeStamp) {\n var timeStampStr = timeStamp.getTime();\n console.log(\"priceCheckCount:\".concat(numberOfChecks, \"|XMR|maxBuyArb:N/A|maxSellArbXMR:\").concat(maxSellArbXMR));\n var coins = [\"LTC\", \"ZEC\", \"NXT\", \"DASH\", \"BCN\", \"MAID\"]; // Check if selling the coin will be profitable\n\n coins.forEach(function (curCoin) {\n var baseMarket = \"XMR\";\n var baseMarket_curCoinBid = exchangePrices[baseMarket + \"_\" + curCoin].highestBid;\n var BTC_baseMarketBid = exchangePrices[\"BTC\" + \"_\" + baseMarket].highestBid;\n var BTC_curCoinAsk = exchangePrices[\"BTC\" + \"_\" + curCoin].lowestAsk;\n var AmtInit = 1;\n var AmtFinal = AmtInit * BTC_baseMarketBid * baseMarket_curCoinBid / BTC_curCoinAsk;\n var ArbRatio = AmtFinal / AmtInit;\n var showMax = \"\";\n\n if (ArbRatio > maxSellArbXMR) {\n maxSellArbXMR = ArbRatio;\n showMax = \"NewMax\";\n }\n\n if (ArbRatio > 1.0) console.log(\"REC|\".concat(timeStamp, \"|\").concat(timeStampStr, \"|Sell|\").concat(curCoin, \"|XMR|ArbRatio:\").concat(ArbRatio, \"|\").concat(showMax));\n\n if (ArbRatio > threshold) {\n var instructions = \"ALERT: Sell \".concat(AmtInit, \" \").concat(curCoin, \" for \").concat(AmtInit * baseMarket_curCoinBid, \" XMR, \\n then sell those XMR for \").concat(AmtInit * BTC_baseMarketBid * baseMarket_curCoinBid, \" BTC,\\n then use those BTC to buy \").concat(AmtFinal, \" \").concat(curCoin);\n console.log(instructions);\n }\n });\n}", "title": "" }, { "docid": "9c24c3e666b474bee809bfe45afbbf94", "score": "0.56719464", "text": "function myBill () {\n let bill=0;\n for (item of shoppingList){\n // console.log('001 '+ item)\n // The item must be in stock.\n if (stock[item]>0) {\n // If the item is in stock find out the price in the prices object.\n bill += prices[item]\n stock[item]--;\n };\n }\n return bill;\n}", "title": "" }, { "docid": "fe5a73b13ccfd92bca3255da79623600", "score": "0.5670282", "text": "function profitableGamble(prob, prize, pay) {\n if (prob * prize > pay) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "21d1f505b073c92266bb1702857a6275", "score": "0.5670221", "text": "buyMaxClickers() {\n let workingPoints = parseInt(this.points.nodeValue);\n let workingCost = Math.ceil(this.price * (1 + 0.25) ** 10);\n console.log(\"avail:\", workingPoints);\n console.log(\"cost:\", workingCost);\n console.log(\"pays:\", this.payout);\n if (workingPoints >= workingCost) {\n this.points.nodeValue = workingPoints - workingCost;\n this.count += 10;\n this.price = Math.ceil(this.price * (1 + 0.25) ** 11);\n if (!this.running) {\n this.startClicker();\n }\n }\n }", "title": "" }, { "docid": "04fbdcecfae234d78426e5c1697641bd", "score": "0.56638056", "text": "function makeTenPercentPriceReductionOnAllProducts() {\n\n}", "title": "" }, { "docid": "654e2d055b5c18b47b2fc8b748566e9d", "score": "0.5661783", "text": "function find_SellingPrice(a,b)\n{\n var sp; \n var c = 100 -b;\n var cp = c *a;\n var sp= cp/100; \n\n return Math.round(sp);\n}", "title": "" }, { "docid": "6362795813c4edef92c7cbe9deb9f1b4", "score": "0.56604314", "text": "function hotelCost(day) {\n var consumption=0\n if (day<=10) {\n consumption = day*100\n \n } else if(day<=20) {\n var firstTenDays = 10*100\n var remainingDay = day-10\n var secondTenDays = remainingDay*80\n consumption =firstTenDays+secondTenDays\n \n \n }else{\n var firstTenDays = 10*100\n var secondTenDays = 10*80\n var remainingDay = day-20\n var lastDaysBill = remainingDay*50\n consumption = firstTenDays+secondTenDays+lastDaysBill\n \n \n }\n return consumption;\n \n }", "title": "" }, { "docid": "b91cae14ec2088c5a4a5c2133f38e45e", "score": "0.5653792", "text": "function profitableGamble(prob, prize, pay) {\n\tif (prob * prize > pay) {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "title": "" }, { "docid": "6107202bffb5e2d9b38505c5c49c6313", "score": "0.5650952", "text": "function holidayPotluck(dishes, capacity) {\n // sort qualities of dishes in descending order \n let sortedQualities = dishes.map(dish => dish[0]).sort((a, b) => b - a);\n let enjoyment = 0;\n let index = 0;\n \n for(let i = 0; i < sortedQualities.length; i++){\n while(sortedQualities[i] !== dishes[index][0]){\n index++;\n }\n // capacity < quantity so take servings that remaining capacity allows and exit\n if(dishes[index][1] >= capacity){\n enjoyment += capacity * dishes[index][0];\n return enjoyment;\n } \n // capacity > quantity so take all of the servings \n enjoyment += dishes[index][0] * dishes[index][1]; \n capacity -= dishes[index][1]; // update capacity\n // remove dish from dishes array to handle duplicate qualities and repeated indexing\n dishes.splice(index, 1);\n index = 0;\n }\n // capacity is greater than the combined quantities of all dishes\n return enjoyment;\n}", "title": "" }, { "docid": "9a09022523b70a3e835d77c158450b99", "score": "0.5648275", "text": "function calculateProfitAndLoss(costPrice,quantity,sellingPrice){\n\n if(sellingPrice<costPrice){\n var loss = (costPrice-sellingPrice)*quantity ;\n var lossPercentage = ((costPrice-sellingPrice)/costPrice)*100 ;\n output.style.display = \"block\";\n output.style.color = \"#f50a16\";\n output.innerText = \"Your loss is : \"+loss+\" and loss percentage is : \"+lossPercentage.toFixed(2)+\"%\";\n }else if(sellingPrice>costPrice){\n var profit = (sellingPrice-costPrice)*quantity ;\n var profitPercentage = ((sellingPrice-costPrice)/costPrice)*100 ;\n output.style.display = \"block\";\n output.style.color = \"#26c40e\";\n output.innerText = \"Your profit is : \"+profit+\" and profit percentage is : \"+profitPercentage.toFixed(2)+\"%\";\n }else{\n output.style.color =\"black\";\n output.innerText=\"No Pain-No Gain\";\n }\n errorHandler();\n}", "title": "" }, { "docid": "de5eb54892042dfefee4a24e0473fe53", "score": "0.5644283", "text": "function analyzePrices(arryOfPrices){\r\n \r\n //suggestions object for index to buy\r\n var suggestion ={\r\n buyIndex : null,\r\n sellIndex :null\r\n };\r\n //if array is empty return suggestions\r\n if(arryOfPrices.length === 0 || (!Array.isArray(arryOfPrices)))\r\n return suggestion;\r\n //find the max value\r\n var max = Math.max(arryOfPrices);\r\n //find the min value\r\n var min = Math.min(arryOfPrices);\r\n //store index of the max\r\n var indexOfMax = arryOfPrices.indexOf(max);\r\n //store index of the min\r\n var indexOfMin = arryOfPrices.indexOf(min);\r\n //are the indexes equal to each other if so then max and min are same return nulls\r\n if(indexOfMax === indexOfMin)\r\n {\r\n return suggestion;\r\n }\r\n //if the index of max is greater than index of min set the suggestions of buy and sell and return suggestions\r\n if( indexOfMax> indexOfMin)\r\n {\r\n suggestion.buyIndex = indexOfMax;\r\n suggestion.sellIndex = indexOfMin;\r\n return suggestion;\r\n }else{\r\n //if the max comes before the min then splice out the index of max and call function again\r\n arryOfPrices.splice(indexOfMax, 1);\r\n analyzePrices(arryOfPrices);\r\n }\r\n}", "title": "" }, { "docid": "19907a65e64a1bb278d19cc75add7505", "score": "0.5643897", "text": "function analyzePoloETHPrices(exchangePrices, timeStamp) {\n var timeStampStr = timeStamp.getTime();\n console.log(\"priceCheckCount:\".concat(numberOfChecks, \"|ETH|maxBuyArb:N/A|maxSellArbETH:\").concat(maxSellArbETH));\n var coins = [\"BAT\", \"BNT\", \"CVC\", \"EOS\", \"ETC\", \"GAS\", \"GNT\", \"KNC\", \"LOOM\", \"LSK\", \"MANA\", \"OMG\", \"QTUM\", \"REP\", \"SNT\", \"STEEM\", \"ZEC\", \"ZRX\"]; // Check if selling the coin will be profitable\n\n coins.forEach(function (curCoin) {\n var ETH_curCoinBid = exchangePrices[\"ETH_\" + curCoin].highestBid;\n var BTC_ETHBid = exchangePrices[\"BTC_ETH\"].highestBid;\n var BTC_curCoinAsk = exchangePrices[\"BTC_\" + curCoin].lowestAsk;\n var AmtInit = 1;\n var AmtFinal = AmtInit * BTC_ETHBid * ETH_curCoinBid / BTC_curCoinAsk;\n var ArbRatio = AmtFinal / AmtInit;\n var showMax = \"\";\n\n if (ArbRatio > maxSellArbETH) {\n maxSellArbETH = ArbRatio;\n showMax = \"NewMax\";\n }\n\n if (ArbRatio > 1.0) console.log(\"REC|\".concat(timeStamp, \"|\").concat(timeStampStr, \"|Sell|\").concat(curCoin, \"|ETH|ArbRatio:\").concat(ArbRatio, \"|\").concat(showMax));\n\n if (ArbRatio > threshold) {\n var instructions = \"ALERT: Sell \".concat(AmtInit, \" \").concat(curCoin, \" for \").concat(AmtInit * ETH_curCoinBid, \" ETH, \\n then sell those ETH for \").concat(AmtInit * ETH_curCoinBid * BTC_ETHBid, \" BTC,\\n then use those BTC to buy \").concat(AmtFinal, \" \").concat(curCoin);\n console.log(instructions);\n }\n });\n}", "title": "" }, { "docid": "a1f817e43b584534a1ef4d4b2f3e31f5", "score": "0.56392974", "text": "function countProfit(shoppers) {\n let listBarang = [\n ['Sepatu Stacattu', 1500000, 10],\n ['Baju Zoro', 500000, 2],\n ['Sweater Uniklooh', 175000, 1]\n ];\n var tampShop = shoppers\n if (tampShop.length === 0) {\n return tampShop\n } else {\n var arrResult = []\n for (var i = 0; i < listBarang.length; i++) {\n var tampName = []\n var result = {}\n var counter = 0\n var saldo = listBarang[i][2]\n for (var j = 0; j < shoppers.length; j++) {\n result.product = listBarang[i][0]\n if (shoppers[j].product === listBarang[i][0] && shoppers[j].amount <= saldo) {\n tampName.push(shoppers[j].name)\n saldo -= shoppers[j].amount\n counter += shoppers[j].amount\n }\n }\n result.shoppers = tampName\n result.leftOver = saldo\n result.totalProvit = counter * listBarang[i][1]\n arrResult.push(result)\n }\n\n }\n return arrResult\n}", "title": "" }, { "docid": "2b46836d90c0c959dba815d869f849c0", "score": "0.5633786", "text": "function countProfit1(shoppers) {\r\n let listBarang = [\r\n ['Sepatu Stacattu', 1500000, 10],\r\n ['Baju Zoro', 500000, 2],\r\n ['Sweater Uniklooh', 175000, 1]\r\n ];\r\n\r\n // you can only write your code here!\r\n var result = []\r\n\r\n if (shoppers.length != 0) {\r\n for (let i = 0; i < listBarang.length; i++) {\r\n var barang = {\r\n product: listBarang[i][0],\r\n shoppers: [],\r\n leftOver: listBarang[i][2],\r\n totalProfit: 0,\r\n price: listBarang[i][1]\r\n }\r\n for (let j = 0; j < shoppers.length; j++) {\r\n if (barang.product === shoppers[j].product && barang.leftOver >= shoppers[j].amount) {\r\n barang.shoppers.push(shoppers[j].name)\r\n barang.leftOver -= shoppers[j].amount\r\n barang.totalProfit += barang.price * shoppers[j].amount\r\n }\r\n }\r\n delete barang.price\r\n // console.log(barang)\r\n result.push(barang)\r\n }\r\n } else {\r\n return []\r\n }\r\n return result\r\n}", "title": "" } ]
b6c1a883cddf1682ff4b5fb873a80c00
third question: For the year 2016 plot the extra runs conceded per team.
[ { "docid": "2771926e4f3663ff0036b375022f59ca", "score": "0.0", "text": "function extraRuns(deliveriesFileName, match_ids) {\n\n return new Promise(function (resolve, reject) {\n let extraRunsPerTeam = {}\n fs.readFile(deliveriesFileName, function (err, data) {\n if (err) {\n reject(err)\n } else {\n data.toString().split(\"\\n\").forEach(function (line, index, arr) {\n if (index !== 0) {\n const delivery = line.split(\",\")\n if (match_ids.includes(parseInt(delivery[0]))) {\n const bowlingTeam = delivery[3]\n\n const extraRuns = delivery[16]\n if (extraRunsPerTeam.hasOwnProperty(bowlingTeam)) {\n extraRunsPerTeam[bowlingTeam] += Number(extraRuns)\n } else {\n extraRunsPerTeam[bowlingTeam] = Number(extraRuns)\n }\n }\n }\n })\n }\n resolve(extraRunsPerTeam)\n })\n })\n}", "title": "" } ]
[ { "docid": "7a66cf7556bcf69551821b3246f1bae7", "score": "0.6553641", "text": "function visualizeExtraRunsByTeam(extraRunsByTeam) {\n const seriesData = [];\n for (let team in extraRunsByTeam) {\n seriesData.push([team, extraRunsByTeam[team]]);\n }\n\n Highcharts.chart(\"extra-runs-by-team\", {\n chart: {\n type: 'column'\n },\n title: {\n text: 'Extra Runs By Teams In 2016'\n },\n subtitle: {\n text: 'Source: <a href=\"https://www.kaggle.com/nowke9/ipldata/data\">IPL Dataset</a>'\n },\n xAxis: {\n type: 'category',\n labels: {\n rotation: -45,\n style: {\n fontSize: '13px',\n fontFamily: 'Verdana, sans-serif'\n }\n }\n },\n yAxis: {\n min: 30,\n title: {\n text: \"Extra Runs\"\n }\n },\n legend: {\n enabled: false\n },\n tooltip: {\n pointFormat: '<tr><td style=\"padding:0\">Extra Runs: </td>' +\n '<td style=\"padding:0\"><b>{point.y:.1f}</b></td></tr>',\n },\n series: [{\n name: \"Teams\",\n data: seriesData,\n dataLabels: {\n enabled: true,\n rotation: 0,\n color: '#FFF',\n align: 'center',\n // format: '{point.y:.1f}', // one decimal\n y: 50, // 10 pixels down from the top\n style: {\n fontSize: '13px',\n fontFamily: 'Verdana, sans-serif',\n }\n }\n }]\n });\n}", "title": "" }, { "docid": "a28357a34460e5523fd2fc619ea738f9", "score": "0.64393675", "text": "function plotGoalsIncrement() {\n var teamArray = {};\n var dataArray = [];\n var teamCounter = 0;\n //For all the games played so far\n for (i = 0; i < score_by_games.length; i++) {\n //For all the data in the match\n for (x = 0; x < score_by_games[i].length; x++) {\n //Team A\n var teamA = score_by_games[i][x][\"Team A\"];\n //TEAM B\n var teamB = score_by_games[i][x][\"Team B\"];\n //Add Team A to the Team Array\n if (teamArray[teamA] == undefined) {\n teamArray[teamA] = teamCounter;\n dataArray.push({name: teamA, data: [], visible: (myTeam == teamA) ? true : false, color: teamColours[teamA]})\n teamCounter++;\n }\n //ADD Team B to the Team Array\n if (teamArray[teamB] == undefined) {\n teamArray[teamB] = teamCounter;\n dataArray.push({name: teamB, data: [], visible: (myTeam == teamB) ? true : false, color: teamColours[teamB]})\n teamCounter++;\n }\n //If the team already has a goal recorded \n if (dataArray[teamArray[teamA]].data.length > 0) {\n //Get the total from the last game\n var teamRunningTotal = dataArray[teamArray[teamA]].data[dataArray[teamArray[teamA]].data.length - 1][1];\n //Add it to this matchs score\n teamRunningTotal += parseInt(score_by_games[i][x][\"A\"]);\n //Store the new total for this week\n dataArray[teamArray[teamA]].data.push([Date.parse(score_by_games[i]['Date'] + ' UTC', \"yyyy/MM/dd HH:mm:ss\"), parseInt(teamRunningTotal)]);\n } else {\n //We are at Game 1 so store the Teams goal score\n dataArray[teamArray[teamA]].data.push([Date.parse(score_by_games[i]['Date'] + ' UTC', \"yyyy/MM/dd HH:mm:ss\"), parseInt(score_by_games[i][x][\"A\"])]);\n }\n //SAME as above for Team B instead of team A\n if (dataArray[teamArray[teamB]].data.length > 0) {\n var teamRunningTotal = dataArray[teamArray[teamB]].data[dataArray[teamArray[teamB]].data.length - 1][1];\n teamRunningTotal += parseInt(score_by_games[i][x][\"B\"]);\n dataArray[teamArray[teamB]].data.push([Date.parse(score_by_games[i]['Date'] + ' UTC', \"yyyy/MM/dd HH:mm:ss\"), parseInt(teamRunningTotal)]);\n } else {\n dataArray[teamArray[teamB]].data.push([Date.parse(score_by_games[i]['Date'] + ' UTC', \"yyyy/MM/dd HH:mm:ss\"), parseInt(score_by_games[i][x][\"B\"])]);\n }\n\n }\n }\n\n //Clean out the data in the graph\n cleanRemoveAllSeries();\n for (i = 0; i < dataArray.length; i++) {\n $('#graphs').highcharts().addSeries(dataArray[i]);\n }\n //Set the graphs Title\n $('#graphs').highcharts().setTitle({text: \"Running total of Goals Scored By Week\"});\n //Redraw the graph with the new data\n $('#graphs').highcharts().yAxis[0].setExtremes(0);\n $('#graphs').highcharts().redraw();\n}", "title": "" }, { "docid": "3e6522ef4f9530fc78051a8779237dd0", "score": "0.62670374", "text": "function visualizeMatchesWonByTeam(matchesWonByTeam) {\n const seriesData = [];\n let seasons = Object.keys(matchesWonByTeam);\n\n const teams = [];\n for (let year in matchesWonByTeam) {\n for (let team in matchesWonByTeam[year]) {\n !teams.includes(team) ? teams.push(team) : false;\n }\n }\n\n //Loop to get the data for each team separately\n for (let i = 0; i < teams.length; i++) {\n const data = [];\n const tempData = {};\n for (let j = 0; j < seasons.length; j++) {\n let teamExists = false;\n for (let year in matchesWonByTeam) {\n if (year === seasons[j]) {\n let teamName = Object.keys(matchesWonByTeam[year]);\n if (teamName.indexOf(teams[i]) >= 0) {\n teamExists = true;\n }\n }\n }\n teamExists ? data.push(matchesWonByTeam[seasons[j]][teams[i]]) : data.push(0);\n }\n tempData[\"name\"] = teams[i];\n tempData[\"data\"] = data;\n seriesData.push(tempData);\n }\n\n Highcharts.chart('matches-won-by-team', {\n chart: {\n type: 'column'\n },\n title: {\n text: 'Matches Won By Team Per Year'\n },\n subtitle: {\n text: 'Source: <a href=\"https://www.kaggle.com/nowke9/ipldata/data\">IPL Dataset</a>'\n },\n xAxis: {\n categories: seasons,\n crosshair: true\n },\n yAxis: {\n min: 0,\n title: {\n text: 'Matches Won'\n }\n },\n tooltip: {\n headerFormat: '<span style=\"font-size:10px\">{point.key}</span><table>',\n pointFormat: '<tr><td style=\"color:{series.color};padding:0\">{series.name}: </td>' +\n '<td style=\"padding:0\"><b>{point.y:.1f}</b></td></tr>',\n footerFormat: '</table>',\n shared: true,\n useHTML: true\n },\n plotOptions: {\n column: {\n pointPadding: 0.2,\n borderWidth: 0\n }\n },\n series: seriesData,\n });\n\n}", "title": "" }, { "docid": "779e1c6787c230a5223d545308efea3d", "score": "0.6100079", "text": "function buildPlot(bf_data) {\n\n for (i =0; i < bf_data.length; i++) {\n var activedate = bf_data[i].date;\n initialdates.push(activedate);\n var parts = initialdates[i].split('-');\n var mydate = new Date(parts[0], parts[1]-1, parts[2]);\n var mydatestring = mydate.toDateString();\n var mydatearray = mydatestring.split(' ');\n var myyear = mydatearray[3];\n myyeararray.push(myyear);\n }\n // console.log(myyeararray);\n\n // Create empty array to hold total sightings for each year\n var yeartotals = {};\n\n // Populate year totals with total sightings per year\n myyeararray.forEach(function(x) { yeartotals[x] = (yeartotals[x] || 0)+1; });\n // console.log(yeartotals);\n \n var years = Object.keys(yeartotals);\n // console.log(years);\n var sightings = Object.values(yeartotals);\n // console.log(sightings);\n \n // Build initial scatter trace\n var trace1 = {\n type: \"scatter\",\n mode: \"markers\",\n x: years,\n y: sightings,\n // text: text,\n marker: {\n size: sightings,\n color: years,\n colorscale: 'Picnic',\n sizeref: 0.15,\n sizemode: 'area'\n } \n };\n\n var data = [trace1];\n \n var layout = {\n title: `Sasquatch Sightings by Year`,\n hovermode: 'closest',\n showlegend: false,\n xaxis: {\n range: [1850, 2020],\n type: \"year\",\n },\n yaxis: {\n range: [0, 300],\n type: \"linear\"\n },\n annotations: [\n {\n x: 1951,\n y: 15,\n xref: 'x',\n yref: 'y',\n text: \"First Footprint<br>Photo<br>1951<br>\",\n showarrow: true,\n font: {\n size: 10\n },\n align: 'left',\n arrowhead: 3,\n ax: -30,\n ay: -40\n },\n {\n x: 1958,\n y: 90,\n xref: 'x',\n yref: 'y',\n text: \"Bigfoot 'Hunter'<br>culture emerges<br>1958<br>\",\n showarrow: true,\n font: {\n size: 10\n },\n align: \"center\",\n arrowhead: 3,\n ax: -30,\n ay: -40\n },\n {\n x: 1967,\n y: 50,\n xref: 'x',\n yref: 'y',\n text: \"The 'Patterson<br>Film'<br>1967<br>\",\n showarrow: true,\n font: {\n size: 10\n },\n align: \"center\",\n arrowhead: 3,\n ax: -30,\n ay: -40\n },\n {\n x: 1980,\n y: 100,\n xref: 'x',\n yref: 'y',\n text: \"The World Wide<br>Web Created<br>1980<br>\",\n showarrow: true,\n font: {\n size: 10\n },\n align: \"center\",\n arrowhead: 3,\n ax: -30,\n ay: -40\n },\n {\n x: 1994,\n y: 150,\n xref: 'x',\n yref: 'y',\n text: \"Widespread Internet<br>Use Starts<br>Increasing<br>1994<br>\",\n showarrow: true,\n font: {\n size: 10\n },\n align: \"center\",\n arrowhead: 3,\n ax: -30,\n ay: -40\n },\n {\n x: 2009,\n y: 275,\n xref: 'x',\n yref: 'y',\n text: \"Global Internet Use<br>at 1.853 Billion<br>2009\",\n showarrow: true,\n font: {\n size: 10\n },\n align: \"center\",\n arrowhead: 3,\n ax: -30,\n ay: -40\n }\n ]\n };\n\n Plotly.newPlot(\"bubblePlot\", data, layout, {responsive: true});\n\n }", "title": "" }, { "docid": "9375b3ac78baf30389d8b3498ba50faf", "score": "0.5854502", "text": "function nonprofitstime() {\n var data = google.visualization.arrayToDataTable([\n ['Year', 'Amount', {role: 'annotation'}, {role: 'style'}, 'Start'],\n [\"2005\", 1414343, \"1.41 Million\", \"color: #062635\", 1000000],\n [\"2010\", 1493407, \"1.49 Million\", \"color: #062635\", 1000000],\n [\"2015\", 1561616, \"1.56 Million\", \"color: #062635\", 1000000]\n]);\n\nvar options = {\n title:'Nonprofits Registered with the IRS',\n titlePosition: 'none',\n titleTextStyle: {fontSize: 20, color: '#062635'},\n legend: {position: \"none\"},\n chartArea:{left: 80, right: 0, width:\"100%\",height:\"80%\"},\n vAxis: {minValue: 1000000, maxValue: 1650000, format: \"short\", title: \"Number of Organizations\",\n gridlines: {\n color: 'transparent'\n }\n }, \n annotations: {alwaysOutside: true, stemColor: 'none'},\n backgroundColor: { fill:'transparent' },\n fontName: 'Karla', \n fontSize: '16',\n seriesType: 'bars',\n series: {1: {type: 'line', color: 'black', lineWidth: 1}}\n };\n \nvar chart = new google.visualization.ColumnChart(document.getElementById('two'));\nchart.draw(data, options);\n}", "title": "" }, { "docid": "a194b594f36ac976421ee7524d306c10", "score": "0.5827922", "text": "function show_teams_played(ndx2) {\n\n function teamByPlayers(dimension, team) {\n return dimension.group().reduce(\n function (p, v) {\n p.total++;\n\n if(v.Tm == team) {\n p.match++;\n }\n return p;\n },\n function (p, v) {\n p.total--;\n if(v.Tm == team) {\n p.match--;\n }\n return p;\n },\n function () {\n return {total: 0, match: 0};\n }\n );\n }\n\n var dim = ndx2.dimension(dc.pluck(\"Player\"));\n\n var chi = teamByPlayers(dim, \"CHI\");\n var cle = teamByPlayers(dim, \"CLE\");\n var lal = teamByPlayers(dim, \"LAL\");\n var mia = teamByPlayers(dim, \"MIA\");\n var was = teamByPlayers(dim, \"WAS\");\n\n dc.barChart(\"#show_teams_played\")\n .height(400)\n .width(500)\n .dimension(dim)\n .group(chi, \"CHI\")\n .stack(cle, \"CLE\")\n .stack(lal, \"LAL\")\n .stack(mia, \"MIA\")\n .stack(was, \"WAS\")\n .on(\"pretransition\", function(chart) {\n chart.selectAll(\"g.y text\")\n .style(\"font-size\", \"18px\");\n chart.selectAll(\"g.x text\")\n .style(\"font-size\", \"18px\");\n chart.select(\"svg\")\n .attr(\"height\", \"100%\")\n .attr(\"width\", \"100%\")\n chart.selectAll(\".dc-chart text\")\n .attr(\"fill\", \"#E5E5E5\");\n chart.selectAll(\".dc-legend-item text\")\n .attr(\"font-size\", \"18px\")\n .attr(\"fill\", \"white\");\n chart.selectAll(\"line\")\n .style(\"stroke\", \"#E5E5E5\");\n chart.selectAll(\".domain\")\n .style(\"stroke\", \"#E5E5E5\");\n chart.selectAll(\".line\")\n .style(\"stroke-width\", \"2.5\");\n \n\n \n }) \n .valueAccessor(function(d) {\n if(d.value.total > 0) {\n return parseFloat(parseFloat((d.value.match / d.value.total) * 100).toFixed(2));\n } else {\n return 0;\n }\n })\n .x(d3.scale.ordinal())\n .xUnits(dc.units.ordinal)\n .legend(dc.legend().x(450).y(10).itemHeight(25).gap(10))\n .margins({top: 10, right: 80, bottom: 20, left: 50})\n}", "title": "" }, { "docid": "8638cc05ae3d5f3adffee33cba9bfde7", "score": "0.5787492", "text": "function drawYearlyUsageChart(){\r\n\t\r\n\treplacePreviousBtnText(\"Y\");\r\n\tchangeColorsForViewButtons('Y');\r\n\tif((prevBtnClicked && avgHomeBtnClicked && effHomeBtnClicked) || \r\n\t\t\t(prevBtnClicked && (avgHomeBtnClicked || effHomeBtnClicked))){\r\n\t\tgetPrevAvgEffCurrYearDataAndPlot(currentYear);\r\n\t}else{\r\n\t\tif(isPreviousButtonOnlyClicked()){\r\n\t\t\tgetCompareTwoYearsUsage(currentYearWeekNumber);\r\n\t\t}else if(avgHomeBtnClicked || effHomeBtnClicked){\r\n\t\t\tgetAvgEffCurrYearDataAndPlot(currentYear);\r\n\t\t}else{\r\n\t\t\tgetYearlyUsageDataAndDraw(currentYear);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "02b43cae9250a8595eac286537996d9b", "score": "0.57406396", "text": "function buildPlot2(event, year) {\n var plotData = getPlotData(event).filter(d => d.year == year);\n // Add field for distance the non-winners got to when the winner finished\n var minResult = d3.min(plotData, d => d.result);\n plotData.forEach(d => {\n d.runDistance = d.speed * minResult;\n if (d.medal == \"G\") { d.place = 1 }\n else if (d.medal == \"S\") { d.place = 2 }\n else if (d.medal == \"B\") { d.place = 3 }\n else { d.place = 0 };\n });\n console.log(plotData)\n // Create scale functions\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(plotData, d => d.runDistance) * .999, d3.max(plotData, d => d.runDistance)])\n .range([0, width]);\n\n var yLinearScale = d3.scaleLinear()\n .domain([3.5, 0.5])\n .range([height, 0]);\n\n // Create axis functions\n var bottomAxis = d3.axisBottom(xLinearScale).tickFormat(d3.format(\"\"));\n var leftAxis = d3.axisLeft(yLinearScale).tickFormat(d3.format(\"d\")).ticks(plotData.length);\n\n // Update Axes in Chart\n chartGroup.selectAll(\".x_axis\")\n .call(bottomAxis);\n\n chartGroup.selectAll(\".y_axis\")\n .call(leftAxis);\n\n // Initialize tool tip\n toolTip.html(function (d) {\n var distance = d3.format('.3f')(d.distance - d.runDistance);\n return (`<strong>${d.name}</strong> (${d.nationality})<br>Result: ${d.originalResult}<br>Distance from Finishline:<br>${distance} m<br><a id=\"select_runner_link\" href=\"#\">Select Runner</a>`);\n });\n\n // Create Circles and Text\n var namesGroup = chartGroup.selectAll(\".plot3names\").remove();\n\n var circlesGroup = chartGroup.selectAll(\".symbol\")\n .data(plotData);\n circlesGroup\n .enter()\n .append(\"text\")\n .attr(\"class\", \"symbol fa\")\n .on(\"mouseover\", function (data) {\n console.log(this);\n toolTip.show(data, this);\n d3.selectAll(\"#select_runner_link\")\n .on(\"click\", function () {\n runnersList.push(Object.assign({}, data));\n updateSelRunners();\n console.log(runnersList)\n });\n })\n .on(\"click\", function (data) {\n toolTip.hide(data);\n })\n .merge(circlesGroup)\n\n .attr(\"x\", 0)\n .attr(\"y\", d => yLinearScale(d.place))\n .transition()\n .delay(200)\n .duration(1500)\n\n .text(\"\\uf70c\")\n .attr(\"x\", d => xLinearScale(d.runDistance))\n .attr(\"opacity\", d => {\n if (d.medal == \"G\") { return \"1\" };\n if (d.medal == \"S\") { return \"0.7\" };\n if (d.medal == \"B\") { return \"0.6\" };\n return \"1\"\n })\n .attr(\"fill\", d => {\n if (d.medal == \"G\") { return \"gold\" }\n else if (d.medal == \"S\") { return \"#A7A7AD\" }\n else if (d.medal == \"B\") { return \"#A77044\" }\n return \"black\"\n });\n\n circlesGroup\n .exit()\n .transition()\n .duration(200)\n .attr(\"x\", width)\n .remove();\n\n // Create axes labels\n chartGroup.selectAll(\"#y_text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left)\n .attr(\"x\", 0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .attr(\"class\", \"aText\")\n .text(\"Place\");\n\n chartGroup.selectAll(\"#x_text\")\n .attr(\"transform\", `translate(${width / 2}, ${height + margin.top + 30})`)\n .attr(\"class\", \"aText\")\n .text(\"Distance (m)\");\n}", "title": "" }, { "docid": "4a8cdd7d889b1cb9d4ba5109155c9d8f", "score": "0.5716993", "text": "function update() {\n \t if (!(year in tdata)) return;\n \t yeartext.text(format_year(year));\n\n \t if(year <= 2015) {\n\t\ttopX.domain(allteams.sort(function(a, b) {\n\t\t return tdata[year][a]['payroll'] - tdata[year][b]['payroll'];\n\t\t}));\n \t\tvar currfillop = 0;\n \t } else { \n\t\ttopX.domain(allteams.sort(function(a, b) {\n\t\t return tdata[2015][a]['payroll'] - tdata[2015][b]['payroll'];\n\t\t}));\n \t\tvar currfillop = 0.4;\n \t }\n\n\t teamCon.transition()\n\t\t.duration(750)\n\t\t.attr(\"transform\", function(team) { return \"translate(\" + topX(team) + \", 0)\"; });\n\n\t teamCon.selectAll(\"rect\")\n\t\t.data(function(team) { return [tdata[year][team]]; })\n\t\t.transition()\n\t\t.duration(750)\n\t\t.attr(\"y\", function(d) { return topY(d['payroll']); })\n\t\t.attr(\"height\", function(d) { return topHeight - topY(d['payroll']); });\n\n\t currTeamCon.transition()\n\t\t.duration(750)\n\t\t.attr(\"transform\", function(team) { return \"translate(\" + topX(team) + \", 0)\"; });\n\n\t currTeamCon.selectAll(\"rect\")\n\t\t.data(function(team) { return [tdata[year][team]]; })\n\t\t.transition()\n\t\t.duration(750)\n\t\t.attr(\"fill-opacity\", currfillop);\n\n\t cappath.data([line_data(salarycaps[year])])\n\t\t.transition()\n\t\t.duration(750)\n \t\t.attr(\"d\", d3.svg.line()\n\t\t .x(function(d) { return d[0]; })\n\t\t .y(function(d) { return topY(d[1]); }));\n\n\t captext.data([line_data(salarycaps[year])[0]])\n\t\t.transition()\n\t\t.duration(750)\n\t\t.attr(\"y\", function(d) { return topY(d[1]) - 5; });\n\t}", "title": "" }, { "docid": "6015633d5045125e7258bd161754bd54", "score": "0.56953335", "text": "function bubbleOverTime(){\n selectedYear = 2010;\n loopThroughYear = true;\n buildBubbleChart(selectedYear, selected_xAxis, selected_yAxis);\n }", "title": "" }, { "docid": "1e3b403f167a40b4623a95bc4ea5f43b", "score": "0.56953084", "text": "runColumnChart(year) {\r\n this.displayData(year,'All');\r\n\r\n }", "title": "" }, { "docid": "9c06a9ca92efa8f905c66d9b9e0fa602", "score": "0.5679457", "text": "function show_main_stats_career_MJ(totalsForMJ) {\n\n\n var ndx2 = crossfilter(totalsForMJ);\n\n let dim = ndx2.dimension(dc.pluck(\"Season\"));\n let ast = dim.group().reduceSum(dc.pluck(\"AST\"));\n let stl = dim.group().reduceSum(dc.pluck(\"STL\"));\n let blk = dim.group().reduceSum(dc.pluck(\"BLK\"));\n\n // var seasonPlayerGroup = seasonDim.group();\n\n let minSeason = dim.bottom(1)[0].Season;\n let maxSeason = dim.top(1)[0].Season;\n\n let composite = dc.compositeChart(\"#show_points_over_career_MJ\");\n\n composite\n .width(885)\n .height(310)\n .margins({ top: 10, right: 60, bottom: 50, left: 45 })\n .dimension(dim)\n .elasticY(true)\n .legend(dc.legend().x(230).y(320).itemHeight(15).gap(5)\n .horizontal(true).itemWidth(100))\n .x(d3.time.scale().domain([new Date(minSeason, 0, 1), new Date(maxSeason, 0, 1)]))\n .y(d3.scale.linear())\n .transitionDuration(500)\n .shareTitle(false)\n .on(\"renderlet\", (function(chart) {\n chart.selectAll(\".dot\")\n .style(\"cursor\", \"pointer\");\n }))\n .on(\"pretransition\", function(chart) {\n chart.selectAll(\"g.y text\")\n .style(\"font-size\", \"12px\");\n chart.selectAll(\"g.x text\")\n .style(\"font-size\", \"12px\");\n chart.select(\"svg\")\n .attr(\"height\", \"100%\")\n .attr(\"width\", \"100%\")\n .attr(\"viewBox\", \"0 0 840 340\");\n chart.selectAll(\".dc-chart text\")\n .attr(\"fill\", \"#E5E5E5\");\n chart.selectAll(\".dc-legend-item text\")\n .attr(\"font-size\", \"15px\")\n .attr(\"fill\", \"white\");\n chart.selectAll(\"line\")\n .style(\"stroke\", \"#E5E5E5\");\n chart.selectAll(\".domain\")\n .style(\"stroke\", \"#E5E5E5\");\n chart.selectAll(\".line\")\n .style(\"stroke-width\", \"2.5\");\n })\n .compose([\n dc.lineChart(composite)\n .group(ast, \"Assist\")\n .interpolate(\"monotone\")\n .title(function(d) {\n let numberWithCommas = d.value.toLocaleString();\n return numberWithCommas + \" assists\";\n })\n .colors(\"#ff7e0e\")\n .dotRadius(15)\n .renderDataPoints({ radius: 6 }),\n dc.lineChart(composite)\n .interpolate(\"monotone\")\n .group(stl, \"Steal\")\n .title(function(d) {\n let numberWithCommas = d.value.toLocaleString();\n return numberWithCommas + \" steals\";\n })\n .colors(\"#d95350\")\n .dotRadius(15)\n .renderDataPoints({ radius: 6 }),\n dc.lineChart(composite)\n .group(blk, \"Block\")\n .interpolate(\"monotone\")\n .title(function(d) {\n let numberWithCommas = d.value.toLocaleString();\n return numberWithCommas + \"blocks\";\n })\n .colors(\"#1e77b4\")\n .dotRadius(15)\n .renderDataPoints({ radius: 6 })\n ])\n .brushOn(false)\n .yAxisPadding(\"5%\")\n .elasticX(true)\n .xAxisPadding(\"8%\")\n\n\n composite.yAxis().ticks(5).outerTickSize(0);\n}", "title": "" }, { "docid": "f82984524fa59efbae4a2c304d615c39", "score": "0.5648481", "text": "function setChart(yearExpressed) {\n // reset the timelineFeatureArray each time setChart is called\n timelineFeatureArray = []; //this will hold the new feature objects that will include a value for which year a law changed\n // colorize is different for the chart since some states have more than one law\n colorizeChart = colorScaleChart(timelineFeatureArray);\n\n //initial setup of chart\n var chart = d3.select(\".graph\")\n .append(\"svg\")\n .attr(\"width\", chartWidth+\"px\")\n .attr(\"height\", chartHeight+\"px\")\n .attr(\"class\", \"chart\");\n \n //put all rects in a g element\n var squareContainer = chart.append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + ', ' + margin.top + ')');\n\n //for-loop creates an array of feature objects that stores three values\n for (var feature in joinedJson) {\n var featureObject = joinedJson[feature];\n for (var thisYear = 1; thisYear<=keyArray.length-1; thisYear++){\n var lastYear = thisYear - 1;\n if (featureObject.properties[expressed][keyArray[thisYear]] != featureObject.properties[expressed][keyArray[lastYear]]) { //have to account for the value not being undefined since the grade data is part of the linked data, and that's not relevant for the timeline\n timelineFeatureArray.push({yearChanged: Number(keyArray[thisYear]), newLaw: featureObject.properties[expressed][keyArray[thisYear]], feature: featureObject}); //each time a law is passed in a given year, a new feature object is pushed to the timelineFeatureArray\n };\n };\n };\n var yearObjectArray = []; //will hold a count for how many features should be drawn for each year, the following for-loop does that\n\n //for-loop determines how many rects will be drawn for each year\n for (key in keyArray) {\n var yearCount = 1;\n for (i = 0; i < timelineFeatureArray.length; i++) {\n //loop through here to see which year it matches and up\n if (timelineFeatureArray[i].yearChanged == keyArray[key]) {\n //countYears++;\n yearObjectArray.push({\"year\": Number(keyArray[key]), \"count\":yearCount});\n yearCount = yearCount++;\n };\n }; \n };\n\n //attach data to the rects and start drawing them\n chartRect = squareContainer.selectAll(\".chartRect\")\n .data(timelineFeatureArray) //use data from the timelineFeatureArray, which holds all of the states that had some change in law \n .enter()\n .append(\"rect\") //create a rectangle for each state\n .attr(\"class\", function(d) {\n return \"chartRect \" + d.feature.properties.postal;\n })\n .attr(\"width\", squareWidth+\"px\")\n .attr(\"height\", squareHeight+\"px\");\n \n //determine the x-scale for the rects, determing where along the x-axis they will be drawn according to which year the law changed\n var x = d3.scale.linear()\n .domain([keyArray[0], keyArray[keyArray.length-1]]) //domain is an array of 2 values: the first and last years in the keyArray (1973 and 2014)\n .rangeRound([0, chartWidth - margin.left - margin.right]); //range determines the x value of the square; it is an array of 2 values: the furthest left x value and the furthest right x value (on the screen)\n\n //set a time scale for drawing the axis; use a separate time scale rather than a linear scale for formatting purposes.\n var timeScale = d3.time.scale()\n .domain([new Date(keyArray[1]), d3.time.year.offset(new Date(keyArray[keyArray.length-1]), 1)]) //domain is an array of 2 values: the first and last years in the keyArray (1973 and 2014)\n .rangeRound([0, chartWidth - margin.left - margin.right]); //range determines the x value of the square; it is an array of 2 values: the furthest left x value and the furthest right x value (on the screen)\n\n //place the rects on the chart\n var rectStyle = chartRect.attr(\"transform\", function(d) {\n return \"translate(\" + x(d.yearChanged) + \")\"; //this moves the rect along the x axis according to the scale, depending on the corresponding year that the law changed\n })\n //y-value determined by how many rects are being drawn for each year\n .attr(\"y\", function(d,i) {\n var yValue = 0;\n for (i = 0; i < yearObjectArray.length; i++) {\n if (yearObjectArray[i].year == d.yearChanged) {\n yValue = yearObjectArray[i].count*(squareHeight+1);\n yearObjectArray[i].count-=1;\n };\n };\n return yValue;\n })\n .style(\"fill\", function(d) {\n return choroplethChart(d.newLaw, colorize); //apply the color according to what the new law is in that year\n })\n .on(\"mouseover\", highlightChart)\n .on(\"mouseout\", dehighlight);\n\n //save text description of the color applied to each rect to be able to use this for dehighlight\n rectColor = rectStyle.append(\"desc\")\n .text(function(d) {\n return choroplethChart(d.newLaw, colorize);\n })\n .attr(\"class\", \"rectColor\");\n\n //Creates the axis function\n var axis = d3.svg.axis()\n .scale(timeScale)\n .orient(\"bottom\")\n .ticks(d3.time.years, 1)\n .tickFormat(d3.time.format('%y'))\n .tickPadding(5) //distance between axis line and labels\n .innerTickSize(50);\n\n //sets the thickness of the line between the ticks and the corresponding squares in the chart\n var timelineLine = axis.tickSize(1);\n\n //sets the margins for the timeline transform\n var timelineMargin = {top: 50, right: 20, bottom: 30, left:40};\n\n //draw the timeline as a g element on the chart\n var timeline = chart.append(\"g\")\n .attr(\"height\", chartHeight)\n .attr(\"width\", chartWidth)\n .attr('transform', 'translate(' + timelineMargin.left + ',' + (chartHeight - timelineMargin.top - timelineMargin.bottom) + ')') //set the starting x,y coordinates for where the axis will be drawn\n .attr(\"class\", \"timeline\")\n .call(axis); //calls the axis function on the timeline\n \n //adds mouse events\n timeline.selectAll('g') \n .each(function(d){\n d3.select(this)\n .on(\"mouseover\", function(){\n d3.select(this)\n .attr(\"font-weight\", \"bold\")\n .attr(\"cursor\", \"pointer\")\n .attr(\"font-size\", \"18px\")\n .attr(\"stroke\", \"#986cb3\");\n })\n .on(\"mouseout\", function(){\n d3.select(this)\n .attr(\"font-weight\", \"normal\")\n .attr(\"font-size\", \"12px\")\n .attr(\"stroke\", \"gray\")\n .attr(\"cursor\", \"pointer\");\n })\n .on(\"click\", function(){\n d3.select(this)\n .attr(\"font-weight\", \"bold\")\n .attr(\"cursor\", \"pointer\")\n .attr(\"font-size\", \"18px\")\n .attr(\"stroke\", \"#986cb3\");\n var year = d.getFullYear();\n changeAttribute(year, colorize);\n animateMap(year, colorize, yearExpressedText);\n });\n });\n}", "title": "" }, { "docid": "0b04ff058b4cc4dd0f0432a3feb3c3f8", "score": "0.5639336", "text": "function revenuechange() {\n var data = google.visualization.arrayToDataTable([\n ['Category'\n ,'Arts'\n ,'Education'\n ,'Higher education'\n ,'Other education'\n ,'Environment and animals'\n ,'Health'\n ,'Hospitals and primary care facilities'\n ,'Other health care'\n ,'Human services'\n ,'International'\n ,'Other public and social benefit'\n ,'Religion related'\n ],\n ['2005 Revenue'\n ,31.7\n ,251.7\n ,166.3\n ,85.4\n ,13.0\n ,817.2\n ,689.3\n ,127.9\n ,185.3\n ,30.5\n ,82.3\n ,12.3\n ],\n ['2015 Revenue'\n ,40.6\n ,354.3\n ,230.9\n ,123.4\n ,19.7\n ,1160.5\n ,977.1\n ,183.4\n ,234.1\n ,38.5\n ,111.3\n ,19.6\n ]\n ]);\n \n var options = {\n title:'Change in Revenue (2005-2015) by Category',\n titlePosition: 'none',\n titleTextStyle: {fontSize: 20, color: '#062635'},\n legend: {position: \"top\", maxLines: 5, textStyle: {fontSize: '14'}},\n chartArea:{left: 80, right: 0, width:\"100%\",height:\"80%\"},\n annotations: {alwaysOutside: true, stemColor: 'none'},\n backgroundColor: { fill:'transparent' },\n fontName: 'Karla', \n fontSize: '16',\n pointSize: '10',\n vAxis: {title: \"$ Billions\", gridlines: {color: 'transparent'}},\n hAxis: {gridlines: {color: 'black', count: 2}}\n };\n \n var chart = new google.visualization.LineChart(document.getElementById('seven'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "0195dd4c6cc764692741a068bdd21c38", "score": "0.56200004", "text": "function changeYearGap(){\r\n details=[{year: \"1900-1940\", number:indexFor1900+indexFor1920, percentage: (per1+per2).toString()+\"%\" },\r\n {year: \"1941-1980\", number: indexFor1940+indexFor1960,percentage: (per3+per4).toString()+\"%\"},\r\n {year: \"1981-2020\", number: indexFor1980+indexFor2000,percentage: (per5+per6).toString()+\"%\"}\r\n ];\r\n drawPieChart();\r\n }", "title": "" }, { "docid": "3d1b9741ad2d64c54a03a0891cd5d8dd", "score": "0.5596402", "text": "function addPieSeries(team) {\n var stats;\n team.pieSerie = [];\n stats = team.data.data.stats;\n team.pieSerie.push({\n name: 'Percentage',\n data: [{\n name: 'Won',\n y: stats.won\n }, {\n name: 'Lost',\n y: stats.lost,\n sliced: true,\n selected: true\n }, {\n name: 'Drawn',\n y: stats.drawn\n }]\n });\n\n log.info('Pie series added.');\n }", "title": "" }, { "docid": "bb8e4a04996d98d6e6dfe7ee0861700e", "score": "0.5567725", "text": "function detailsOf2016(flag) {\n\n\t\t\t\t\t\tif (flag != 2016 ){\n\t\t\t\t\t\t\talert(\"Team did not play in 2016\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmain.statsOf2016.winPercent = ((noOfWins*100)/noOfMatches).toFixed(2) ;\n\t\t\t\t\t\tmain.statsOf2016.lossPercent = ((noOfLosses*100)/noOfMatches).toFixed(2) ;\n\t\t\t\t\t\tmain.statsOf2016.goalDifference = noOfGoalsScored - noOfGoalsConceded ;\n\t\t\t\t\t\tmain.statsOf2016.totalMatches = noOfMatches ;\n\t\t\t\t\t\tmain.statsOf2016.totalWins = noOfWins ;\n\t\t\t\t\t\tmain.statsOf2016.totalLosses = noOfLosses ;\n\t\t\t\t\t\tmain.statsOf2016.totalGoalsScored = noOfGoalsScored ;\n\t\t\t\t\t\tmain.statsOf2016.totalGoalsConceded = noOfGoalsConceded ;\n\t\t\t\t\t\tmain.statsOf2016.totalTies = noOfTies ;\n\t\t\t\t\t}", "title": "" }, { "docid": "e690e021f8603ebc41bd0054636c32bf", "score": "0.55596465", "text": "function drawColumnChart(dateRange, useOldData) {\n var mylist = document.getElementById(\"myList\");\n console.log('mylist is: ' + mylist);\n\n data = new google.visualization.DataTable();\n data.addColumn('number', 'week');\n data.addColumn('number', 'tfy-3.1253');\n data.addColumn('number', 'mat-125.4254');\n data.addColumn('number', 't-106.1200');\n data.addColumn('number', 'tik.kand');\n dateCounter = 1;\n monthCounter = 3;\n var alphaCounter = 0;\n var betaCounter = 0;\n var gammaCounter = 0;\n var deltaCounter = 0;\n var previousWeek = 0;\n for (var i = 0; i < 30; i++) {\n courseSelector = Math.floor((Math.random() * 4) + 1);\n dateCounter = dateCounter + Math.floor((Math.random() * 4) + 1);\n var date = new Date(2013, monthCounter, dateCounter);\n var week = date.getWeek();\n if (week > previousWeek) {\n previousWeek = week;\n var alphaCounter = 0;\n var betaCounter = 0;\n var gammaCounter = 0;\n var deltaCounter = 0;\n }\n switch (courseSelector) {\n case 1:\n alphaCounter++;\n data.addRows([\n [week, alphaCounter, betaCounter, gammaCounter, deltaCounter]\n ]);\n console.log('case 1');\n break;\n case 2:\n betaCounter++;\n data.addRows([\n [week, alphaCounter, betaCounter, gammaCounter, deltaCounter]\n ]);\n console.log('case 2');\n break;\n case 3:\n gammaCounter++;\n data.addRows([\n [week, alphaCounter, betaCounter, gammaCounter, deltaCounter]\n ]);\n console.log('case 3');\n break;\n case 4:\n deltaCounter++;\n data.addRows([\n [week, alphaCounter, betaCounter, gammaCounter, deltaCounter]\n ]);\n console.log('case 4');\n break;\n }\n\n if (dateCounter > 30) {\n dateCounter = dateCounter - 30;\n monthCounter++;\n }\n }\n\n\n var options = {\n title: 'Course Work Load',\n isStacked: true,\n displayAnnotations: true\n };\n\n var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "e6bfdcc8e522ba66aac44b7de257a556", "score": "0.554461", "text": "function done(){\r\n\tvar i;\r\n\tvar graphData = {\r\n\t\t\t x: [],\r\n\t\t\t y: [],\r\n\t\t\t type: 'Scatter',\r\n\t\t\t line: {\r\n\t\t\t\t color: 'rgb(255, 128, 128)',\r\n\t\t\t\t width: 4\r\n\t\t\t\t }\r\n\t\t\t};\r\n\tvar graphData2 = {\r\n\t\t\t x: [],\r\n\t\t\t y: [],\r\n\t\t\t type: 'Scatter',\r\n\t\t\t line: {\r\n\t\t\t\t color: 'rgb(255, 128, 128)',\r\n\t\t\t\t width: 4\r\n\t\t\t\t }\r\n\t\t\t};\r\n\tvar graphData3 = {\r\n\t\t\t x: [],\r\n\t\t\t y: [],\r\n\t\t\t type: 'Scatter',\r\n\t\t\t line: {\r\n\t\t\t\t color: 'rgb(255, 128, 128)',\r\n\t\t\t\t width: 4\r\n\t\t\t\t }\r\n\t\t\t};\r\n\tvar graphData4 = {\r\n\t\t\t x: [],\r\n\t\t\t y: [],\r\n\t\t\t type: 'Scatter',\r\n\t\t\t line: {\r\n\t\t\t\t color: 'rgb(255, 128, 128)',\r\n\t\t\t\t width: 4\r\n\t\t\t\t }\r\n\t\t\t};\r\n\tfor (i = 0; i < theData.length; i++) {\r\n\t\tif(Number(theData[i].record_calendar_year)<=1860){\r\n\t\t\tgraphData.x.push(theData[i].record_calendar_year);\r\n\t\t\tgraphData.y.push(theData[i].debt_outstanding_amt);\r\n\t\t} else if(Number(theData[i].record_calendar_year)<=1940){\r\n\t\t\tgraphData2.x.push(theData[i].record_calendar_year);\r\n\t\t\tgraphData2.y.push(theData[i].debt_outstanding_amt);\r\n\t\t} else if(Number(theData[i].record_calendar_year)<=1980){\r\n\t\t\tgraphData3.x.push(theData[i].record_calendar_year);\r\n\t\t\tgraphData3.y.push(theData[i].debt_outstanding_amt);\r\n\t\t} else {\r\n\t\t\tgraphData4.x.push(theData[i].record_calendar_year);\r\n\t\t\tgraphData4.y.push(theData[i].debt_outstanding_amt);\r\n\t\t}\r\n\t} \r\n\tvar layout = {\r\n\t\t\tshowLegend: true,\r\n\t\t\ttitle:'Total Debt of the United States 1790-1860',\r\n\t\t\txaxis: {\r\n\t\t\t\ttitle: 'Year'\r\n\t\t\t},\r\n\t\t\tyaxis: {\r\n\t\t\t\ttitle: 'Debt in $'\r\n\t\t\t},\r\n\t\t\tautosize: true,\r\n\t\t\t margin: {\r\n\t\t\t l: 5,\r\n\t\t\t r: 5,\r\n\t\t\t b: 50,\r\n\t\t\t t: 50,\r\n\t\t\t pad: 4\r\n\t\t\t }\r\n\t};\r\n\tvar layout2 = {\r\n\t\t\tshowLegend: true,\r\n\t\t\ttitle:'Total Debt of the United States 1860-1940',\r\n\t\t\txaxis: {\r\n\t\t\t\ttitle: 'Year'\r\n\t\t\t},\r\n\t\t\tyaxis: {\r\n\t\t\t\ttitle: 'Debt in $'\r\n\t\t\t},\r\n\t\t\tautosize: true,\r\n\t\t\t margin: {\r\n\t\t\t l: 5,\r\n\t\t\t r: 5,\r\n\t\t\t b: 50,\r\n\t\t\t t: 50,\r\n\t\t\t pad: 4\r\n\t\t\t }\r\n\t};\r\n\tvar layout3 = {\r\n\t\t\tshowLegend: true,\r\n\t\t\ttitle:'Total Debt of the United States 1940-1980',\r\n\t\t\txaxis: {\r\n\t\t\t\ttitle: 'Year'\r\n\t\t\t},\r\n\t\t\tyaxis: {\r\n\t\t\t\ttitle: 'Debt in $'\r\n\t\t\t},\r\n\t\t\tautosize: true,\r\n\t\t\t margin: {\r\n\t\t\t l: 5,\r\n\t\t\t r: 5,\r\n\t\t\t b: 50,\r\n\t\t\t t: 50,\r\n\t\t\t pad: 4\r\n\t\t\t }\r\n\t};\r\n\tvar layout4 = {\r\n\t\t\tshowLegend: true,\r\n\t\t\ttitle:'Total Debt of the United States 1980-Today',\r\n\t\t\txaxis: {\r\n\t\t\t\ttitle: 'Year'\r\n\t\t\t},\r\n\t\t\tyaxis: {\r\n\t\t\t\ttitle: 'Debt in $'\r\n\t\t\t},\r\n\t\t\tautosize: true,\r\n\t\t\t margin: {\r\n\t\t\t l: 5,\r\n\t\t\t r: 5,\r\n\t\t\t b: 50,\r\n\t\t\t t: 50,\r\n\t\t\t pad: 4\r\n\t\t\t }\r\n\t};\r\n\tvar gd = [graphData];\r\n\tvar gd2 = [graphData2];\r\n\tvar gd3 = [graphData3];\r\n\tvar gd4 = [graphData4];\r\n\tPlotly.newPlot('graph', gd, layout);\r\n\tPlotly.newPlot('graph2', gd2, layout2);\r\n\tPlotly.newPlot('graph3', gd3, layout3);\r\n\tPlotly.newPlot('graph4', gd4, layout4);\r\n}", "title": "" }, { "docid": "122450bed8affe94f112fd75b3962528", "score": "0.5543317", "text": "function setUpSecondaryVisualizations(){\n\tvar oHsh = {\n\t\t10: new google.visualization.AnnotatedTimeLine($(\"reports_div_10\"))//annotated time line\n\t};\n\treturn oHsh;\n}", "title": "" }, { "docid": "2d9ff60a24305c18a790f2d2edac3c6b", "score": "0.5523886", "text": "function create_trend_plots(years, field) {\n \n plot_data = []\n $.each(years, function(index, year){\n try {\n total = data[year]['Fields of Study'][field]['Grand total']\n }\n catch(err) {\n total = \"N/A\"\n } \n if(total != \"N/A\")\n plot_data.push({\"x\":epoch_times[year], \"y\":total}) \n }); \n\n formatted_name = field.split(\"-\")[0]\n\n all_plots = {\n name: formatted_name,\n key : field,\n data: plot_data,\n color: palette.color()\n };\n\n return all_plots; \n}", "title": "" }, { "docid": "83f2bffeda833b8d0d7d54a67dd47822", "score": "0.55192626", "text": "function drawChart() {\n\n // Create the data table.\n var users_data = new google.visualization.DataTable();\n users_data.addColumn('string', 'Topping');\n users_data.addColumn('number', 'Times');\n users_data.addRows(times);\n\n var repos_data = new google.visualization.DataTable();\n repos_data.addColumn('string','Repository');\n repos_data.addColumn('number','Times');\n repos_data.addRows(repos);\n\n // Set chart options\n var options = {'title':'Amount of access',\n 'width':1200,\n 'height':800};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n chart.draw(users_data, options);\n\n var repochart = new google.visualization.PieChart(document.getElementById('repos_div'));\n repochart.draw(repos_data,options);\n\n for (var u in repoovertime)\n {\n\tvar d = repoovertime[u];\n\tvar dv = $('<div></div>').attr('id',u);\n\tdv.append($('<h3></h3>').text(u));\n\tvar chel = $('<div></div>').addClass('chart')\n\tdv.append(chel);\n\n\tvar data = new google.visualization.DataTable();\n\tdata.addColumn('string','Date');\n\tfor (var k in repos) data.addColumn('number',repos[k][0]);\n\tvar out=[]\n\tfor (var date in d)\n\t{\n\t out.push([date,d[date]]);\n\t}\n\n\tout.sort(function(e1,e2) {\n\t if (e1[0]>e2[0]) return 1;\n\t else if (e1[0]<e2[0]) return -1;\n\t else return 0;\n\t});\n\tfor (var i in out)\n\t{\n\t var date = out[i][0];\n\t \n\t var spl = date.split('-');\n\t var dt = new Date(spl[0],spl[1],spl[2]);\n\n\t var row=[];\n\t row.push(date);\n\t for (var repo in repos) {\n\t\tvar r = repos[repo][0];\n\t\trow.push(out[i][1][r]);\n\t }\n\n\t data.addRow(row);\n\t}\n\n\n\tvar ch = new google.visualization.SteppedAreaChart(chel[0]);\n\tvar options = {\n\t title: u+' over time',\n\t hAxis: {title: 'Dates', titleTextStyle: {color: 'red'}},\n\t isStacked:true,\n\t width:1200,\n\t heig:800\n };\n\n\tch.draw(data,options);\n\t//console.log(dv.html());\n\t$('body').append(dv);\n\tdelete data;\n\n }\n}", "title": "" }, { "docid": "e3f20538b4831c736149fe2c5592c495", "score": "0.54988694", "text": "function graphTsunamisByYear(data) {\n \n // Create an array that will hold the number of tsunamis for each year\n var yearTotals = [];\n\n // counter is used within the for loop to count the number of tsunamis for the current\n // year in question\n var counter = 0;\n\n // currentYear is used within the for loop to determine if there is a change in years\n // in the data being processed\n var currentYear = 0;\n\n // Main for loop to count the number of tsunamis by year\n for(i = 0; i < data.length; i++) {\n if (i == 0) {\n // Initialize for first time\n // - set currentYear to the first year found in the data\n // - only count records where the max water height > 0\n currentYear = data[i][\"Year\"];\n if (data[i][\"Maximum Water Height (m)\"] > 0) {\n counter += 1;\n }\n } // end if\n else { \n if (data[i][\"Year\"] == currentYear) {\n // Current data record is for the current year being processed\n if (data[i][\"Maximum Water Height (m)\"] > 0) {\n // Only increment counter if the max water height > 0\n counter += 1;\n }\n if (i == (data.length - 1)) {\n // If we're at the last record, then update the yearTotals array\n yearTotals.push(counter);\n }\n }\n else {\n // Different year found\n // - update the yearTotals array\n // - reinitialize counter\n // - update the currentYear \n yearTotals.push(counter);\n counter = 0;\n currentYear = data[i][\"Year\"];\n } // end else\n } // end else\n } // end for\n \n // Hardcode in the x axis values to the years in our dataset\n x_axis = [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, \n 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020];\n\n // The y axis will be our array of tsunami counts by year\n y_axis = yearTotals;\n\n // Define the trace, data, and layout\n var trace1 = {\n x: x_axis,\n y: y_axis,\n type: 'line'\n };\n var data = [trace1];\n var layout = {\n title: 'Tsunamis by Year',\n xaxis: {\n title: 'Years'\n },\n yaxis: {\n title: 'Number of Tsunamis'\n }\n };\n \n // Create the plot\n Plotly.newPlot('graphTsunamisByYear', data, layout);\n} // end function graphTsunamisByYear()", "title": "" }, { "docid": "f726e6a14e7e9836497b6aa2c7bbf0b8", "score": "0.5435444", "text": "function show_salaries(ndx1) {\n var playerColors = d3.scale.ordinal()\n .domain([\"Michael Jordan\", \"Kobe Bryant\", \"Lebron James\"])\n .range([\"#e22b22bf\", \"#ffe854b5\", \"#13a3547d\"]);\n var eDim = ndx1.dimension(dc.pluck(\"Season\"));\n var salaryDim = ndx1.dimension(function(d) {\n\n return [new Date(Number(d.Season.slice(0, -3)), 0, 1), Number(d.Salary.slice(1)), d.Player];\n\n })\n var salaryPlayerGroup = salaryDim.group();\n var minSeason = eDim.bottom(1)[0].Season.slice(0, -3);\n var maxSeason = eDim.top(1)[0].Season.slice(0, -3);\n\n dc.scatterPlot(\"#salary-vs-season\")\n .width(900)\n .height(400)\n .x(d3.time.scale().domain([new Date(minSeason, 0, 1), new Date(maxSeason, 0, 1)]))\n .brushOn(false)\n .symbolSize(8)\n .clipPadding(10)\n .xAxisLabel(\"Season\")\n .yAxisLabel(\"Salary USD\")\n .title(function(d) {\n return d.key[2] + ' ' + formatter.format(d.key[1]);\n })\n .colorAccessor(function(d) {\n return d.key[2];\n })\n .colors(playerColors)\n .dimension(salaryDim)\n .group(salaryPlayerGroup)\n .margins({ top: 10, right: 50, bottom: 75, left: 140 })\n .on(\"pretransition\", function(chart) {\n chart.selectAll(\"g.y text\")\n .style(\"font-size\", \"12px\");\n chart.selectAll(\"g.x text\")\n .style(\"font-size\", \"12px\");\n chart.selectAll(\".dc-chart text\")\n .attr(\"fill\", \"#E5E5E5\");\n chart.selectAll(\".dc-legend-item text\")\n .attr(\"font-size\", \"15px\")\n .attr(\"fill\", \"white\");\n chart.selectAll(\"line\")\n .style(\"stroke\", \"#E5E5E5\");\n chart.selectAll(\".domain\")\n .style(\"stroke\", \"#E5E5E5\");\n chart.selectAll(\".line\")\n .style(\"stroke-width\", \"2.5\");\n });\n}", "title": "" }, { "docid": "e1959dafd2e5ce352d6adacb272b8af4", "score": "0.54349774", "text": "function showData(dex = 0) {\n // consider the points awarded in the breakdown arrays and for the dex-th entries\n // consider the score for the same spread\n const partialData = data.map(({ name, breakdown, players }) => ({\n name,\n score: breakdown.slice(0, dex).reduce((acc, curr) => acc + curr, 0),\n breakdown: breakdown.slice(0, dex),\n players: players.map(({ name: namePlayer, breakdown: breakdownPlayer }) => ({\n name: namePlayer,\n score: breakdownPlayer.slice(0, dex).reduce((acc, curr) => acc + curr, 0),\n breakdown: breakdownPlayer.slice(0, 1),\n })),\n }));\n\n // ! the update-enter loop is complicated by the nested structure of the visualization\n const updateTeams = game\n .selectAll('g.teams')\n .data(partialData);\n\n // add two groups for the teams\n const enterTeams = updateTeams\n .enter();\n\n const groupTeams = enterTeams\n .append('g')\n .attr('class', 'teams')\n .attr('transform', (d, i) => `translate(${-width / 10 + width / 5 * i} 0)`);\n\n // include the name of the teams and the score described by the partial data\n groupTeams\n .append('text')\n .attr('class', 'team')\n .attr('x', 0)\n .attr('y', ({ score }) => -teamScale(score))\n .attr('text-anchor', (d, i) => (i === 0 ? 'end' : 'start'))\n .attr('font-size', '12px')\n .attr('font-weight', '700')\n .text(({ name }) => name);\n\n groupTeams\n .append('text')\n .attr('class', 'score')\n .attr('x', 0)\n .attr('y', ({ score }) => -teamScale(score) + 36)\n .attr('text-anchor', (d, i) => (i === 0 ? 'end' : 'start'))\n .attr('font-size', '36px')\n .attr('font-weight', '900')\n .attr('fill', (d, i) => ((i === 0) ? 'hsl(79, 70%, 40%)' : 'hsl(198, 70%, 40%)'))\n .text(({ score }) => score);\n\n // update the position of the name, the position and text of the score\n updateTeams\n .select('text.team')\n .attr('y', ({ score }) => -teamScale(score));\n\n updateTeams\n .select('text.score')\n .attr('y', ({ score }) => -teamScale(score) + 36)\n .text(({ score }) => score);\n\n // add one group for each player\n const groupPlayers = updateTeams\n .selectAll('g.player')\n .data(d => d.players.sort((a, b) => d3.descending(a.score, b.score)).reduce((acc, curr, index) => {\n const { name, score, breakdown } = curr;\n const cumulative = index > 0 ? acc[index - 1].cumulative + score : score;\n return [...acc, {\n name,\n score,\n breakdown,\n cumulative,\n }];\n }, []))\n .enter()\n .append('g')\n .attr('class', 'player')\n // translate the group vertically to position the boxes above one another\n // ! consider the cumulative score accrued by the players\n // scale the boxes for the first team with a negative value to have the rectangles drawn away from the center\n .attr('transform', ({ name, cumulative }) => (partialData[0].players.find(player => player.name === name) ? `scale(-1 1) translate(0 ${-playerScale(cumulative)})` : `translate(0 ${-playerScale(cumulative)})`));\n\n // ! the width considers the order with which the rectangles are included\n groupPlayers\n .append('rect')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', (d, i, { length }) => (width / 3) / length * (length - i))\n .attr('height', ({ score }) => playerScale(score))\n .attr('stroke', 'currentColor')\n .attr('stroke-width', '0.5px')\n .attr('fill', ({ name }) => (partialData[0].players.find(player => player.name === name) ? 'hsl(79, 70%, 40%)' : 'hsl(198, 70%, 40%)'));\n\n // by default hide the text elements\n groupPlayers\n .append('text')\n .attr('class', 'name')\n .attr('x', 0)\n .attr('y', ({ score }) => playerScale(score) / 2)\n .attr('font-size', '8px')\n .text(({ name }) => name)\n .attr('opacity', 0)\n .attr('text-anchor', ({ name }) => (partialData[0].players.find(player => player.name === name) ? 'end' : 'start'))\n .attr('transform', ({ name }, i, { length }) => (partialData[0].players.find(player => player.name === name) ? `translate(${(width / 3) / length * (length - i) + 5} 0) scale(-1 1)` : `translate(${(width / 3) / length * (length - i) + 5} 0)`));\n\n\n // update the position of the groups for the players\n updateTeams\n .selectAll('g.player')\n .attr('transform', ({ name, cumulative }) => (partialData[0].players.find(player => player.name === name) ? `scale(-1 1) translate(0 ${-playerScale(cumulative)})` : `translate(0 ${-playerScale(cumulative)})`));\n\n // update the size of the players' rectangles\n updateTeams\n .selectAll('g.player')\n .select('rect')\n .attr('height', ({ score }) => playerScale(score));\n\n // update the position of the players' names\n updateTeams\n .selectAll('g.player')\n .select('text.name')\n .attr('opacity', ({ score }) => (score > 5 ? 1 : 0));\n\n\n // update the highlight element to show a line and area below the line connecting the two sides\n // vertically consider the top of the column by using the player scale with the score of the entire team\n const yMin = playerScale(d3.min(partialData, d => d.score));\n const yMax = playerScale(d3.max(partialData, d => d.score));\n const yCoordinate = (yMax - yMin) / 2;\n\n // horizontally pick the coordinates considering once again the team which scored the most\n // [-width/10, width/10] being the range describing the gap between the columns\n const xCoordinate = (partialData[0].score > partialData[1].score) ? -width / 10 : width / 10;\n\n const colorShadow = (partialData[0].score > partialData[1].score) ? 'hsl(79, 70%, 50%)' : 'hsl(198, 70%, 50%)';\n\n // translate the group to center the element between the two scores\n highlight\n .attr('transform', `translate(0 ${(-yMax - yMin) / 2}) scale(0.75)`);\n\n // update the path element to connect the two sides\n highlight\n .select('path.area')\n .attr('d', `M ${xCoordinate} -${yCoordinate} L ${xCoordinate * -1} ${yCoordinate} H ${xCoordinate}z`)\n .attr('fill', colorShadow)\n .attr('stroke', colorShadow);\n\n highlight\n .select('path.line')\n .attr('d', `M ${xCoordinate} -${yCoordinate} L ${xCoordinate * -1} ${yCoordinate}`);\n\n // as long as the visualization doesn't reach the last point call the function with the incremented index\n if (dex < data[0].breakdown.length - 1) {\n const timeoutID = setTimeout(() => {\n showData(dex + 1);\n clearTimeout(timeoutID);\n }, 100);\n }\n}", "title": "" }, { "docid": "d625133079dbc07921800b78bae961fd", "score": "0.54244304", "text": "function setup(){\n createCanvas(5000, 5000);\n background(255);\n\n// pick one of the five data files to work with and call it 'table#'\n let table1 = usaDayofWeek;\n let table2 = ussrDayofWeek;\n let table3 = ukDayofWeek;\n let table4 = franceDayofWeek;\n let table5 = chinaDayofWeek;\n let table6 = countryWeekDayandTimeCount;\n // let table7 = highestYieldwithPercentageChange;\n\n// log 7 datasets to the console so we can poke around in it\n print(table1);\n print(table2);\n print(table3);\n print(table4);\n print(table5);\n print(table6);\n// print(table7);\n\n// let palette = Brewer.qualitative('Set1', table.columns);\n\n// set up typography\n textFont(\"Rokkitt\");\n textSize(14);\n fill(60);\n noStroke();\n\n // set up x, y, rowHeight, and colWidth\n let x = 200;\n let y = 50;\n let rowHeight = 40;\n let colWidth = 65;\n let colWidth2 = 5;\n\n\n// draw the Weekdays as a Lefthand column. \n textStyle(BOLD);\n textAlign(CENTER);\n for (let i = 0; i<weekDays.length; i++) {\n text(weekDays[i], x-100, y);\n y += rowHeight;\n } \n\n// Set increment and opacity\n let increment = 40;\n let opacity = 90;\n \n// draw five year span across the bottom of the \"x\" axis\n x = 200;\n y = 360;\n textStyle(BOLD);\n textSize(12);\n textAlign(CENTER);\n for (let d = 0; d<fiveYearSpan.length; d++){\n text(fiveYearSpan[d], x, y-rowHeight);\n x += colWidth;\n }\n\n\n// Draw time ticks to fit to the 5 year span\n x = 200;\n y = 375;\n for (let t = 0; t < fiveYearSpan.length; t++){\n fill(255,0,0);\n stroke(255);\n rect(x, y - rowHeight, 2,10);\n x += colWidth;\n }\n\n// Draw time yearly ticks to fit to with the 5 year span\nx = 201;\ny = 380;\n for (let m = 0; m < years.length-2; m++){\n fill(255,0,0);\n stroke(255);\n ellipse(x, y - rowHeight, 2,2);\n x += colWidth/5; \n }\n\n// Monday USA\nx = 200;\ny = 0;\n\nfor (let r=0; r < table1.getRowCount(); r++) {\n let dayofWeek = table1.getString(r, 2);\n // let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n // print(maptableToYearsLength);\n // Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Monday\"){\n fill('blue');\n rect(x, y + increment, 2, 20);\n x += 5;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Tuesday USA\nx = 200;\ny = 40;\nfor (let r=0; r < table1.getRowCount(); r++) {\n let dayofWeek = table1.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Tuesday\"){\n fill('blue');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Wed USA\nx = 200;\ny = 80;\nfor (let r=0; r < table1.getRowCount(); r++) {\n let dayofWeek = table1.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Wednesday\"){\n fill('blue');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Thursday USA\nx = 200;\ny = 120;\nfor (let r=0; r < table1.getRowCount(); r++) {\n let dayofWeek = table1.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2)\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Thursday\"){\n fill('blue');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Friday USA\nx = 200;\ny = 160;\nfor (let r=0; r < table1.getRowCount(); r++) {\n let dayofWeek = table1.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Friday\"){\n fill('blue');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Saturday USA\nx = 200;\ny = 200;\nfor (let r=0; r < table1.getRowCount(); r++) {\n let dayofWeek = table1.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2)\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Saturday\"){\n fill('blue');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Sunday USA\nx = 200;\ny = 240;\nfor (let r=0; r < table1.getRowCount(); r++) {\n let dayofWeek = table1.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Sunday\"){\n fill('blue');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// USSR\n// Monday USSR\nx = 200;\ny = 360;\n\nfor (let r=0; r < table2.getRowCount(); r++) {\n let dayofWeek = table2.getString(r, 2);\n // let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n // print(maptableToYearsLength);\n // Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Monday\"){\n fill('red');\n rect(x, y + increment, 2, 20);\n x += 5;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Tuesday USSR\nx = 200;\ny = 400;\nfor (let r=0; r < table2.getRowCount(); r++) {\n let dayofWeek = table2.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Tuesday\"){\n fill('red');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Wed USSR\nx = 200;\ny = 440;\nfor (let r=0; r < table2.getRowCount(); r++) {\n let dayofWeek = table2.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Wednesday\"){\n fill('red');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Thursday USSR\nx = 200;\ny = 480;\nfor (let r=0; r < table2.getRowCount(); r++) {\n let dayofWeek = table2.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Thursday\"){\n fill('red');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Friday USSR\nx = 200;\ny = 520;\nfor (let r=0; r < table2.getRowCount(); r++) {\n let dayofWeek = table2.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Friday\"){\n fill('red');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Saturday USSR\nx = 200;\ny = 560;\nfor (let r=0; r < table2.getRowCount(); r++) {\n let dayofWeek = table2.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Saturday\"){\n fill('red');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Sunday USSR\nx = 200;\ny = 600;\nfor (let r=0; r < table2.getRowCount(); r++) {\n let dayofWeek = table2.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Sunday\"){\n fill('red');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// UK\n// Monday UK\nx = 200;\ny = 680;\n\nfor (let r=0; r < table3.getRowCount(); r++) {\n let dayofWeek = table3.getString(r, 2);\n // let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n // print(maptableToYearsLength);\n // Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Monday\"){\n fill('green');\n rect(x, y + increment, 2, 20);\n x += 5;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Tuesday UK\nx = 200;\ny = 720;\nfor (let r=0; r < table3.getRowCount(); r++) {\n let dayofWeek = table3.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Tuesday\"){\n fill('green');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Wed UK\nx = 200;\ny = 760;\nfor (let r=0; r < table3.getRowCount(); r++) {\n let dayofWeek = table3.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Wednesday\"){\n fill('green');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Thursday UK\nx = 200;\ny = 800;\nfor (let r=0; r < table3.getRowCount(); r++) {\n let dayofWeek = table3.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Thursday\"){\n fill('green');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Friday UK\nx = 200;\ny = 840;\nfor (let r=0; r < table3.getRowCount(); r++) {\n let dayofWeek = table3.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Friday\"){\n fill('green');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Saturday UK\nx = 200;\ny = 880;\nfor (let r=0; r < table3.getRowCount(); r++) {\n let dayofWeek = table3.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Saturday\"){\n fill('green');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Sunday UK\nx = 200;\ny = 920;\nfor (let r=0; r < table3.getRowCount(); r++) {\n let dayofWeek = table3.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Sunday\"){\n fill('green');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// France\n// Monday France\nx = 200;\ny = 1000;\n\nfor (let r=0; r < table4.getRowCount(); r++) {\n let dayofWeek = table4.getString(r, 2);\n // let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n // print(maptableToYearsLength);\n // Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Monday\"){\n fill('orange');\n rect(x, y + increment, 2, 20);\n x += 5;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Tuesday France\nx = 200;\ny = 1040;\nfor (let r=0; r < table4.getRowCount(); r++) {\n let dayofWeek = table4.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Tuesday\"){\n fill('orange');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Wed France\nx = 200;\ny = 1080;\nfor (let r=0; r < table4.getRowCount(); r++) {\n let dayofWeek = table4.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Wednesday\"){\n fill('orange');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Thursday France\nx = 200;\ny = 1120;\nfor (let r=0; r < table4.getRowCount(); r++) {\n let dayofWeek = table4.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Thursday\"){\n fill('orange');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Friday France\nx = 200;\ny = 1160;\nfor (let r=0; r < table4.getRowCount(); r++) {\n let dayofWeek = table4.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Friday\"){\n fill('orange');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Saturday France\nx = 200;\ny = 1200;\nfor (let r=0; r < table4.getRowCount(); r++) {\n let dayofWeek = table4.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Saturday\"){\n fill('orange');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Sunday France\nx = 200;\ny = 1240;\nfor (let r=0; r < table4.getRowCount(); r++) {\n let dayofWeek = table4.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Sunday\"){\n fill('orange');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n\n// China\n// Monday China\nx = 200;\ny = 1300;\n\nfor (let r=0; r < table5.getRowCount(); r++) {\n let dayofWeek = table5.getString(r, 2);\n // let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n // print(maptableToYearsLength);\n // Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Monday\"){\n fill('purple');\n rect(x, y + increment, 2, 20);\n x += 5;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Tuesday China\nx = 200;\ny = 1340;\nfor (let r=0; r < table5.getRowCount(); r++) {\n let dayofWeek = table5.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Tuesday\"){\n fill('purple');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Wed China\nx = 200;\ny = 1380;\nfor (let r=0; r < table5.getRowCount(); r++) {\n let dayofWeek = table5.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Wednesday\"){\n fill('purple');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Thursday China\nx = 200;\ny = 1420;\nfor (let r=0; r < table5.getRowCount(); r++) {\n let dayofWeek = table5.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Thursday\"){\n fill('purple');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n// Friday China\nx = 200;\ny = 1460;\nfor (let r=0; r < table5.getRowCount(); r++) {\n let dayofWeek = table5.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Friday\"){\n fill('purple');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Saturday China\nx = 200;\ny = 1500;\nfor (let r=0; r < table5.getRowCount(); r++) {\n let dayofWeek = table5.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Saturday\"){\n fill('purple');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n\n\n// Sunday China\nx = 200;\ny = 1540;\nfor (let r=0; r < table5.getRowCount(); r++) {\n let dayofWeek = table5.getString(r, 2);\n// let maptableToYearsLength = map(table1.getRowCount(), 0 ,table1.getRowCount(), 0, years.length-2);\n// print(maptableToYearsLength);\n// Loop through and determine match between country and day of week and color accordingly\n if (dayofWeek === \"Sunday\"){\n fill('purple');\n rect(x, y + increment, 2, 20);\n x += colWidth2;\n // } else {\n // fill(100);\n // rect(x, y + increment, 1.25, 15);\n // x += 1;\n // }\n }\n}\n// save('countrydayofweek.svg');\n}", "title": "" }, { "docid": "e27bbb56d59148db7f7b556df227fbf8", "score": "0.54186773", "text": "function plotDays(results) {\n plotField(results, \"sevenDays\");\n}", "title": "" }, { "docid": "c7aaad3e3e2d9bbc1c400d6bd0e8329e", "score": "0.54131025", "text": "function drawChart27() {\r\n\tvar data = google.visualization.arrayToDataTable([\r\n\t\t['Teams', 'Times Won'],\r\n\t\t['Player\\'s Team', 0],\r\n\t\t['Other Teams', 8]\r\n\t]);\r\n\t\r\n\tvar options = {\r\n\t\ttitle: 'Russell Westbrook\\'s Championships vs. Years Played',\r\n\t\tbackgroundColor:'transparent',\r\n\t\ttitleTextStyle:{color: '#990000', fontName: 'Arial', fontSize: 15, bold:true, italic:false},\r\n\t\tis3D: true,\r\n\t\tlegend:{textStyle:{color: '#990000', fontName: 'Arial', fontSize: 10, bold:true, italic:false}},\r\n\t\tpieSliceText: 'percentage',\r\n\t\tslices: { 1: {offset: 0.2},\r\n\t\t\t2: {offset: 0.2},\r\n\t\t},\r\n\t};\r\n\t\r\n\tvar chart = new google.visualization.PieChart(document.getElementById('piechart_3d24'));\r\n\tchart.draw(data, options);\r\n}", "title": "" }, { "docid": "d80859d1f8432b1ca2ce3d6345119696", "score": "0.54089516", "text": "function addColumnSeries(team) {\n var ranking, stats;\n team.colSerie = [];\n ranking = team.data.data.groups[0].ranking;\n\n //get ranking info for each team\n for (var j = 0; j < ranking.length; j++) {\n if (ranking[j].team && ranking[j].team.id === team.id) {\n stats = ranking[j].team.teamStats;\n\n team.colSerie.push({\n name: 'Goals Scored',\n data: [stats.goalsShotHome, stats.goalsShotAway, stats.goalsShot]\n }, {\n name: 'Goals Taken',\n data: [stats.goalsGotHome, stats.goalsGotAway, stats.goalsGot]\n });\n }\n }\n\n\n log.info('Column series added.');\n }", "title": "" }, { "docid": "386ef1f4467a44cf2821889790bc25c5", "score": "0.54034597", "text": "function TeamProgress(type, z) {\n\n switch (type) {\n case \"Improved\":\n var x0 = data.sort(function(a, b) {\n return d3.ascending(a.id - a[z], b.id - b[z]);\n })\n .filter(function(d) {\n return (d.id - d[z]) > 0\n })\n .map(function(d) {\n return d.team;\n });\n break;\n case \"Deteriorated\":\n var x0 = data.sort(function(a, b) {\n return d3.ascending(a.id - a[z], b.id - b[z]);\n })\n .filter(function(d) {\n return (d.id - d[z]) < 0\n })\n .map(function(d) {\n return d.team;\n });\n break;\n case \"RemainedSame\":\n var x0 = data.sort(function(a, b) {\n return d3.ascending(a.id - a[z], b.id - b[z]);\n })\n .filter(function(d) {\n return (d.id - d[z]) == 0\n })\n .map(function(d) {\n return d.team;\n });\n }\n\n // Populate the return array with the teams for each case \"Improved\",\"Deteriorated\" and \"RemainSame\" \n var retArray = [];\n var i;\n for (i = 0; i < x0.length; i++) {\n retArray.push(x0[i]);\n }\n return retArray;\n }", "title": "" }, { "docid": "a3a2d76bd2e3baf113727612ca806980", "score": "0.54002035", "text": "function runDeseason(n){\n nSeason = n\n timeSeries = seasonalAdjustment(timeSeries)\n seasonTimeSeries = timeSeries\n hasBeenDeSeason = true\n resetChart(chart2, timeSeries)\n}", "title": "" }, { "docid": "af7ef8f4f6d0e7f527520c49789fc4e1", "score": "0.5399024", "text": "function drawViz(data, type=\"amount\") {\r\n \r\n\r\n var months = Array.from(new Set(data.map(d => d.month)))\r\n var years = [2018 ,2019, 2020]\r\n // Add X axis\r\n var x = d3.scaleBand()\r\n .domain( months )\r\n .range([ 0, width ]);\r\n\r\n svg.select(\".xAxis-g\")\r\n .call(d3.axisBottom(x));\r\n\r\n // Add Y axis\r\n var y = d3.scaleLinear()\r\n .domain(d3.extent(data, function(d) { return +d.diff; }))\r\n .range([ height, 0 ])\r\n .nice()\r\n\r\n var y2 = d3.scaleLinear()\r\n .domain(d3.extent(data, function(d) { return +d.amount; }))\r\n .range([ height, 0 ])\r\n .nice()\r\n\r\n // Draw for the initial page\r\n drawAxes(\"amount\")\r\n drawLines(\"amount\")\r\n drawAnnotations(1)\r\n \r\n // 2020 line is invisible on page 1\r\n d3.select(\"path.year-line-2020\").transition().duration(0).style(\"opacity\",0)\r\n\r\n d3.selectAll(\"button\").on(\"click\", loadPage)\r\n\r\nfunction drawLines(type){\r\n // Draws the corresponding lines based on whether we are using amount or percent difference(diff)\r\n years.forEach( (yr) => {\r\n var yearData = data.filter( d => d.year == yr)\r\n\r\n svg.selectAll(`path.year-line-${yr}`)\r\n .datum(yearData) \r\n .attr(\"transform\", `translate(${x.bandwidth() / 2 },0)`)\r\n .transition()\r\n .duration(1000)\r\n .style(\"opacity\",1)\r\n .attr(\"fill\", \"none\")\r\n .attr(\"stroke\", yr==\"2020\"? \"#444\": \"#999\") // 2020 has a thicker + darker line\r\n .attr(\"stroke-width\", yr==\"2020\"? 2: 1.3)\r\n .attr(\"d\", d3.line()\r\n .x(function(d) { return x(d.month) })\r\n .y(function(d) { return (type == \"amount\") ? y2(d.amount): y(d.diff)})\r\n )\r\n })\r\n}\r\n\r\n\r\nfunction drawAxes(type){\r\n\r\n // Set the Title for the y axes\r\n if(type == \"amount\"){\r\n svg.select(\".yAxis-g\")\r\n .transition()\r\n .call(d3.axisLeft(y2))\r\n\r\n svg.select(\".yAxis-g\")\r\n .select(\".axisTitle-1.page-1\")\r\n .attr(\"x\", 230)\r\n .attr(\"y\", 10)\r\n .attr(\"fill\",\"#4d4d4d\")\r\n .style(\"font-size\",\"14px\")\r\n .text(\"Personal consumption expenditures\");\r\n \r\n svg.select(\".yAxis-g\")\r\n .select(\".axisTitle-1.page-3\")\r\n .attr(\"x\", 145)\r\n .attr(\"y\", 10)\r\n .attr(\"fill\",\"#4d4d4d\")\r\n .style(\"font-size\",\"14px\")\r\n .text(\"Percentage difference\");\r\n\r\n svg.select(\".yAxis-g\")\r\n .select(\".axisTitle-2.page-1\")\r\n .attr(\"x\", 90)\r\n .attr(\"y\", 25)\r\n .attr(\"fill\",\"#4d4d4d\")\r\n .style(\"font-size\",\"13px\")\r\n .text(\"(Millions USD)\");\r\n }\r\n else{\r\n svg.select(\".yAxis-g\")\r\n .transition()\r\n .call(d3.axisLeft(y)\r\n .tickFormat(ytick => ytick+\"%\"))\r\n }\r\n\r\n // Selects which of the titles are to be displayed based on current type of graph\r\n if(type == \"diff\") { // page 3\r\n d3.selectAll(\"text.page-1\").style(\"display\", \"none\")\r\n d3.selectAll(\"text.page-3\").style(\"display\", \"block\")\r\n } \r\n else{ // pages 1,2\r\n d3.selectAll(\"text.page-1\").style(\"display\", \"block\")\r\n d3.selectAll(\"text.page-3\").style(\"display\", \"none\")\r\n } \r\n}\r\n\r\nfunction loadPage(page){\r\n\r\n // get chosen page from button's innerHTML\r\n page = this.innerHTML\r\n\r\n // draw components based on current page\r\n if(page == 1 ){\r\n \r\n drawAxes(\"amount\")\r\n drawLines(\"amount\")\r\n drawAnnotations(page)\r\n\r\n d3.select(\"path.year-line-2020\").transition().duration(800).style(\"opacity\",0)\r\n }\r\n else if(page ==2){\r\n \r\n d3.select(\"path.year-line-2020\").transition().duration(800).style(\"opacity\",1)\r\n drawAxes(\"amount\")\r\n drawLines(\"amount\")\r\n drawAnnotations(page)\r\n \r\n }\r\n else if(page == 3){\r\n \r\n d3.select(\"path.year-line-2020\").transition().duration(800).style(\"opacity\",1)\r\n drawAxes(\"diff\")\r\n drawLines(\"diff\")\r\n drawAnnotations(page)\r\n\r\n }\r\n\r\n}\r\n\r\nfunction drawAnnotations(page){\r\n const annotType = d3.annotationLabel\r\n\r\n const annotations = [\r\n {\r\n note: {\r\n title: \"The previous years\",\r\n label: \"The years preceding 2020 showed similar trends to one another, growing at a steady rate of 4% each year.\"},\r\n x: 600,\r\n y: 5,\r\n className: \"page-1\",\r\n },\r\n {\r\n note: {\r\n title: \"What changed in 2020\",\r\n label: \"The start of COVID-19 lockdowns caused mass panic-buying resulting to the spike in sales in March 2020.\"},\r\n x: 600,\r\n y: 5,\r\n className: \"page-2\",\r\n },\r\n {\r\n note: {\r\n label: \"2019\"},\r\n x: 715,\r\n y: 265,\r\n className: \"page-2 page-1\",\r\n },\r\n {\r\n note: {\r\n label: \"2018\"},\r\n x: 715,\r\n y: 310,\r\n className: \"page-2 page-1\",\r\n },\r\n {\r\n note: {\r\n label: \"2020\"},\r\n x: 715,\r\n y: 162,\r\n className: \"page-2 bold-annot\",\r\n },\r\n {\r\n note: {\r\n title: \"Surge due to panic buying\",\r\n label: \"This is the same chart when viewing the percentage differences from the start of the year. This gives us an idea of exactly how much this surge deviated from the normal spending habits.\"},\r\n x: 600,\r\n y: 5,\r\n className: \"page-3\",\r\n },\r\n {\r\n note: {\r\n label: \"2019\"},\r\n x: 715,\r\n y: 205,\r\n className: \"page-3\",\r\n },\r\n {\r\n note: {\r\n label: \"2018\"},\r\n x: 715,\r\n y: 222,\r\n className: \"page-3\",\r\n },\r\n {\r\n note: {\r\n label: \"2020\"},\r\n x: 715,\r\n y: 240,\r\n className: \"page-3 bold-annot\",\r\n },\r\n ]\r\n\r\n const makeAnnotations = d3.annotation()\r\n .editMode(false)\r\n .notePadding(15)\r\n .type(annotType)\r\n .disable([\"connector\"])\r\n .textWrap(250)\r\n .annotations(annotations)\r\n \r\n d3.select(\".annotation-group\")\r\n .call(makeAnnotations)\r\n\r\n // First hide all annotations\r\n d3.selectAll(\".annotation\")\r\n .style(\"display\",\"none\")\r\n\r\n // Displays relevant annotations based on current page.\r\n if(page == 1 ){\r\n d3.selectAll(\".annotation.page-1\").style(\"display\",\"block\")\r\n }\r\n else if(page == 2 ){\r\n d3.selectAll(\".annotation.page-2\").style(\"display\",\"block\")\r\n }\r\n else if(page == 3 ){\r\n d3.selectAll(\".annotation.page-3\").style(\"display\",\"block\")\r\n }\r\n\r\n d3.selectAll(\"button\").style(\"background\",\"#999\")\r\n d3.select(`button.p${page}-btn`).style(\"background\",\"#222\")\r\n\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "70e71b27ec8ef5a59a4ef01bb48cc2a3", "score": "0.5377981", "text": "function drawChart28() {\r\n\tvar data = google.visualization.arrayToDataTable([\r\n\t\t['Teams', 'Times Won'],\r\n\t\t['Player\\'s Team', 0],\r\n\t\t['Other Teams', 4]\r\n\t]);\r\n\t\r\n\tvar options = {\r\n\t\ttitle: 'Anthony Davis\\' Championships* vs. Years Played',\r\n\t\tbackgroundColor:'transparent',\r\n\t\ttitleTextStyle:{color: '#990000', fontName: 'Arial', fontSize: 15, bold:true, italic:false},\r\n\t\tis3D: true,\r\n\t\tlegend:{textStyle:{color: '#990000', fontName: 'Arial', fontSize: 10, bold:true, italic:false}},\r\n\t\tpieSliceText: 'percentage',\r\n\t\tslices: { 1: {offset: 0.2},\r\n\t\t\t2: {offset: 0.2},\r\n\t\t},\r\n\t};\r\n\t\r\n\tvar chart = new google.visualization.PieChart(document.getElementById('piechart_3d25'));\r\n\tchart.draw(data, options);\r\n}", "title": "" }, { "docid": "278977948e1c17d1d49c82b317ac25da", "score": "0.5376994", "text": "function showcond(number){\n var groupnumber = number;\n d3.select(\"div.cond2018\").html(\"\");\n console.log(\"the click number is \"+ groupnumber)\n\n var fliteredData = cond2018.filter(result => result.district == groupnumber);\n\n // Trace1 for the election in 2018\n var data = [{\n values: fliteredData.map(row => row.votes), \n labels: fliteredData.map(row => row.candidate),\n textinfo: \"label+percent\",\n textposition: \"outside\",\n automargin: true,\n type: \"pie\",\n hole: 0.2,\n\n }];\n \n var layout = {\n height:400,\n width: 500,\n title:\"Ohio's Congressional District election, 2018\",\n showlegend: false,\n annotations: [\n {\n font: {\n size: 20\n },\n showarrow: false,\n text: 'Results have been certified',\n x: 0.17,\n y: 0.5\n }]\n }\n\n Plotly.newPlot('cond2018', data, layout);\n\n\n\n\n }", "title": "" }, { "docid": "8dae425c717568ed120d0f539a0daff0", "score": "0.5372991", "text": "function drawChart25() {\r\n\tvar data = google.visualization.arrayToDataTable([\r\n\t\t['Teams', 'Times Won'],\r\n\t\t['Player\\'s Team', 0],\r\n\t\t['Other Teams', 9]\r\n\t]);\r\n\t\r\n\tvar options = {\r\n\t\ttitle: 'Kevin Durant\\'s Championships* vs. Years Played',\r\n\t\tbackgroundColor:'transparent',\r\n\t\ttitleTextStyle:{color: '#990000', fontName: 'Arial', fontSize: 15, bold:true, italic:false},\r\n\t\tis3D: true,\r\n\t\tlegend:{textStyle:{color: '#990000', fontName: 'Arial', fontSize: 10, bold:true, italic:false}},\r\n\t\tpieSliceText: 'percentage',\r\n\t\tslices: { 1: {offset: 0.2},\r\n\t\t\t2: {offset: 0.2},\r\n\t\t},\r\n\t};\r\n\tvar chart = new google.visualization.PieChart(document.getElementById('piechart_3d22'));\r\n\tchart.draw(data, options);\r\n}", "title": "" }, { "docid": "1ccf0057d067e599b2f7f06cab1227e9", "score": "0.53715366", "text": "function updateDonationsTimelines(year){//year determines which tab is updated\n if(fixeddata.othertabs.indexOf(year)==-1){\n if(year!=\"alltime\"){\n year=year*1;\n }\n if(year==\"alltime\"&&dashboarddata.donations.length==0&&dashboarddata.recurringdonations.length==0){\n $(\"#alltimedonationstimelineheader\").hide();\n $(\"#alltimedonationstimeline\").hide();\n }\n else{\n var alldonations=basicfunctions.unpackRecurringDonations(dashboarddata.donations,dashboarddata.recurringdonations,new Date(fixeddata.endyear+1,dashboarddata.yearstartmonth,dashboarddata.yearstartdate).addDays(-1));\n var getTimes=function(donations){\n if(donations.length==0){\n return [-Infinity];\n }\n else{\n var times=donations.transpose()[0];\n for(var j=0;j<times.length;j++){\n times[j]=times[j].getTime();\n }\n return times;\n }\n };\n var startdate=year==\"alltime\"?(new Date(Math.min.apply(Math,getTimes(alldonations)))).addDays(-1):new Date(year,dashboarddata.yearstartmonth,dashboarddata.yearstartdate);\n var enddate=year==\"alltime\"?(new Date(Math.max.apply(Math,getTimes(alldonations)))).addDays(1):(new Date(year+1,dashboarddata.yearstartmonth,dashboarddata.yearstartdate)).addDays(-1);\n if((year==\"alltime\"||year==fixeddata.endyear||year==getcurrentyear())&&fixeddata.today.getTime()>Math.max.apply(Math,getTimes(alldonations))){\n enddate=fixeddata.today;\n }\n\n //makes a line graph\n var donationindices=[];\n for(var j=0;j<alldonations.length;j++){\n donationindices.push(j);\n }\n donationindices.sort(function(a,b){if(alldonations[a][0].getTime()==alldonations[b][0].getTime()){return a<b?-1:1;}else{return (alldonations[a][0].getTime()<alldonations[b][0].getTime())?-1:1;}});\n $(\"#\"+year+\"donationstimelineheader\").hide();\n $(\"#\"+year+\"donationstimeline\").hide();\n var array=[[\"Date\",\"Donations\"]];\n var date=startdate;\n var cumulativedonations=0;\n var j=0;\n while(date.getTime()<=enddate.getTime()){\n if(j<donationindices.length&&alldonations[donationindices[j]][0].getDate()==date.getDate()&&alldonations[donationindices[j]][0].getMonth()==date.getMonth()&&alldonations[donationindices[j]][0].getFullYear()==date.getFullYear()){\n $(\"#\"+year+\"donationstimelineheader\").show();\n $(\"#\"+year+\"donationstimeline\").show();\n cumulativedonations+=alldonations[donationindices[j]][3]*basicfunctions.currencyConversionFactor(alldonations[donationindices[j]][2],dashboarddata.defaultcurrency,alldonations[donationindices[j]][0]);\n j++;\n }\n else if(j<donationindices.length&&alldonations[donationindices[j]][0].getTime()<startdate.getTime()){\n j++;\n }\n else{\n array.push([basicfunctions.formatDate(date),cumulativedonations]);\n date=date.addDays(1);\n }\n }\n if(visualizationLoaded){\n var data=google.visualization.arrayToDataTable(array);\n var formatter=new google.visualization.NumberFormat(typeof(fixeddata.currencysymbol[dashboarddata.defaultcurrency])==\"undefined\"?{\"suffix\": \" \"+dashboarddata.defaultcurrency}:{\"prefix\":fixeddata.currencysymbol[dashboarddata.defaultcurrency]});\n formatter.format(data,1);\n var options={\n \"hAxis\":{\"title\":\"Date\",\"textPosition\":\"none\"},\n \"vAxis\":{\"title\":\"Donations (\"+(typeof(fixeddata.currencysymbol[dashboarddata.defaultcurrency])==\"undefined\"?dashboarddata.defaultcurrency:fixeddata.currencysymbol[dashboarddata.defaultcurrency])+\")\",\"minValue\":0},\n \"legend\":{\"position\":\"none\"},\n \"colors\":[\"#6c0000\"]\n };\n var chart=new google.visualization.LineChart(document.getElementById(year+\"donationstimeline\"));\n chart.draw(data,options);\n }\n\n //makes an annotated timeline\n /*var dates=[];\n var array=[];\n var date=startdate;\n while(date.getTime()<=enddate.getTime()){\n dates.push(date.getDate()+\"/\"+(date.getMonth()+1)+\"/\"+date.getFullYear());\n array.push([date,0]);\n date=date.addDays(1);\n }\n $(\"#\"+year+\"donationstimelineheader\").hide();\n $(\"#\"+year+\"donationstimeline\").hide();\n for(var j=0;j<alldonations.length;j++){\n var index=dates.indexOf(alldonations[j][0].getDate()+\"/\"+(alldonations[j][0].getMonth()+1)+\"/\"+alldonations[j][0].getFullYear());\n if(index!=-1){\n $(\"#\"+year+\"donationstimelineheader\").show();\n $(\"#\"+year+\"donationstimeline\").show();\n while(index<dates.length){\n array[index][1]+=alldonations[j][3]*basicfunctions.currencyConversionFactor(alldonations[j][2],dashboarddata.defaultcurrency,alldonations[j][0]);\n index++;\n }\n }\n }\n if(visualizationLoaded){\n var data=new google.visualization.DataTable();\n data.addColumn(\"date\",\"Date\");\n data.addColumn(\"number\",\"Donations\");\n data.addRows(array);\n var chart=new google.visualization.AnnotatedTimeLine(document.getElementById(year+\"donationstimeline\"));\n chart.draw(data,{\"displayAnnotations\":true});\n }*/\n\n }\n }\n }", "title": "" }, { "docid": "4f3c593b65f5662c3f68a2f1d0de329b", "score": "0.5370292", "text": "function extraRunPerYear(matchArr, deliveriesArr, year) {\n var matchIdArr = getMatchId(matchArr, year);\n\n var lastId = matchIdArr.length - 1;\n\n return deliveriesArr.reduce((extraRunObj, matchObj) => {\n if (\n parseInt(matchObj[\"match_id\"]) >= matchIdArr[0] &&\n parseInt(matchObj[\"match_id\"]) <= matchIdArr[lastId]\n ) {\n extraRunObj[matchObj[\"bowling_team\"]] =\n (extraRunObj[matchObj[\"bowling_team\"]] || 0) +\n Number(matchObj[\"extra_runs\"]);\n }\n return extraRunObj;\n }, {});\n}", "title": "" }, { "docid": "dccbd649bd23ff98e20068aee9e5fec6", "score": "0.5359923", "text": "function setTimeData(timeToAnalyse) {\r\n\r\n var timeArray = [];\r\n var plotData = new google.visualization.DataTable();\r\n\r\n if (timeToAnalyse == \"day\") {\r\n timeArray = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"] \r\n\r\n // adds rows and cols to datatable\r\n\r\n addStandardColumns();\r\n dayMonthAnalysis()\r\n }\r\n else if (timeToAnalyse == \"month\"){\r\n timeArray = [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\r\n \"August\",\"September\",\"October\",\"November\",\"December\"];\r\n\r\n addStandardColumns();\r\n dayMonthAnalysis()\r\n }\r\n else if (timeToAnalyse == \"year\"){\r\n addStandardColumns();\r\n yearAnalysis()\r\n }\r\n else if (timeToAnalyse == \"time\"){\r\n\r\n plotData.addColumn('timeofday', timeToAnalyse)\r\n\r\n participantsListTrue.forEach(participant =>{\r\n plotData.addColumn('number', participant)\r\n })\r\n\r\n timeAnalysis() // time is the only thing left\r\n }\r\n else { // fulldate\r\n plotData.addColumn('date', \"Date\");\r\n\r\n participantsListTrue.forEach(participant =>{\r\n plotData.addColumn('number', participant);\r\n });\r\n\r\n fulldateAnalysis();\r\n }\r\n\r\n function dayMonthAnalysis() {\r\n for (let index = 0; index < timeArray.length; index++) {\r\n var newRow = [timeArray[index]]\r\n \r\n for (let j = 0; j < participantsListTrue.length; j++) {\r\n newRow[j+1] = conversation[participantsListTrue[j]][\"timedata\"][timeToAnalyse][index]\r\n }\r\n \r\n plotData.addRow(newRow);\r\n }\r\n }\r\n\r\n function yearAnalysis() {\r\n var validYears = Object.keys(conversation[\"Conversation Totals\"][\"timedata\"][timeToAnalyse]);\r\n \r\n validYears.forEach(year => {\r\n var newRow = [year]\r\n \r\n for (let j = 0; j < participantsListTrue.length; j++) {\r\n newRow[j+1] = conversation[participantsListTrue[j]][\"timedata\"][timeToAnalyse][year]\r\n }\r\n\r\n plotData.addRow(newRow);\r\n })\r\n }\r\n\r\n function timeAnalysis(){\r\n var validTimes = Object.keys(conversation[\"Conversation Totals\"][\"timedata\"][timeToAnalyse])\r\n\r\n validTimes.forEach(time => {\r\n hours = Number(String(time).split(':')[0])\r\n mins = Number(String(time).split(':')[1])\r\n\r\n var newRow = [[hours, mins, 0]]\r\n\r\n for (let j = 0; j < participantsListTrue.length; j++) {\r\n newRow[j+1] = conversation[participantsListTrue[j]][\"timedata\"][timeToAnalyse][time]\r\n }\r\n\r\n plotData.addRow(newRow);\r\n })\r\n }\r\n\r\n function fulldateAnalysis(){\r\n var validDates = Object.keys(conversation[\"Conversation Totals\"][\"timedata\"][timeToAnalyse])\r\n\r\n validDates.forEach(date =>{\r\n\r\n var newRow = []\r\n\r\n if (history_ChartDisplay == \"Day\") {\r\n newRow.push(new Date(Number(date)))\r\n\r\n for (let j = 0; j < participantsListTrue.length; j++) {\r\n newRow[j+1] = conversation[participantsListTrue[j]][\"timedata\"][timeToAnalyse][date]\r\n }\r\n\r\n }\r\n else{\r\n var monthOnly = new Date(Number(date))\r\n monthOnly.setDate(1)\r\n monthOnly.setHours(12, 0, 0, 0)\r\n\r\n newRow.push(monthOnly)\r\n\r\n for (let j = 0; j < participantsListTrue.length; j++) {\r\n\r\n var sum = 0;\r\n \r\n var allFullDateData = conversation[participantsListTrue[j]][\"timedata\"][timeToAnalyse];\r\n \r\n for (const key in allFullDateData) {\r\n \r\n if (allFullDateData.hasOwnProperty(key)) {\r\n \r\n if ((new Date(Number(date)).getMonth() == new Date(Number(key)).getMonth()) && (new Date(Number(date)).getFullYear() == new Date(Number(key)).getFullYear())) {\r\n sum += allFullDateData[key]\r\n }\r\n }\r\n }\r\n \r\n newRow[j+1] = sum;\r\n }\r\n }\r\n\r\n plotData.addRow(newRow);\r\n });\r\n }\r\n\r\n function addStandardColumns(){\r\n plotData.addColumn('string', timeToAnalyse)\r\n\r\n participantsListTrue.forEach(participant =>{\r\n plotData.addColumn('number', participant)\r\n })\r\n }\r\n\r\n return plotData;\r\n}", "title": "" }, { "docid": "f0f4e11e8d0624fbbafc597e3d22d6a0", "score": "0.53445596", "text": "update () {\n\n //Domain definition for global color scale\n let domain = [-60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40, 50, 60];\n\n //Color range for global color scale\n let range = [\"#063e78\", \"#08519c\", \"#3182bd\", \"#6baed6\", \"#9ecae1\", \"#c6dbef\", \"#fcbba1\", \"#fc9272\", \"#fb6a4a\", \"#de2d26\", \"#a50f15\", \"#860308\"];\n\n //ColorScale be used consistently by all the charts\n this.colorScale = d3.scaleQuantile()\n .domain(domain)\n .range(range);\n\n // ******* TODO: PART I ******* \n // Create the chart by adding circle elements representing each election year\n //The circles should be colored based on the winning party for that year\n //HINT: Use the .yearChart class to style your circle elements\n //HINT: Use the chooseClass method to choose the color corresponding to the winning party.\n let xScale = d3.scaleLinear()\n .domain([d3.min(this.electionWinners,function(t){return +t.YEAR}), d3.max(this.electionWinners,function(t){return +t.YEAR})])\n .range([this.margin.left, this.svgWidth-this.margin.left]);\n\n let circles = this.svg.selectAll('circle')\n .data(this.electionWinners);\n circles.enter().append('circle')\n .attr('r', 15)\n .attr('cx',function(d){\n let y = +d.YEAR;\n return xScale(y);\n })\n .attr('cy',this.svgHeight/2)\n .attr('class',(d)=>{\n return this.chooseClass(d.PARTY);\n });\n //Append text information of each year right below the corresponding circle\n //HINT: Use .yeartext class to style your text elements\n let texts = this.svg.selectAll('.yeartext')\n .data(this.electionWinners.map(d=>d.YEAR));\n texts.enter().append('text')\n .attr('dy','2.0em') \n .attr(\"x\", function(d) {\n return xScale(+d);\n })\n .attr('y',this.svgHeight/2)\n .attr('class','yeartext')\n .text(function(d) { return d; }); \n //Style the chart by adding a dashed line that connects all these years.\n //HINT: Use .lineChart to style this dashed line\n let linesy = this.svgHeight/2;\n let lines = this.svg\n .append('line')\n .attr('x1', 0)\n .attr('x2', this.svgWidth)\n .attr('y1', linesy)\n .attr('y2', linesy)\n .attr('class', 'lineChart');\n //Clicking on any specific year should highlight that circle and update the rest of the visualizations\n //HINT: Use .highlighted class to style the highlighted circle\n let circlegroup = this.svg.selectAll('circle');\n\n circlegroup.on('click', (d,i)=>{\n circlegroup.classed('selected',false);\n let onecircle = circlegroup.filter(function(elm,j){return i == j;});\n \n onecircle.classed('selected',true);\n d3.csv('data/Year_Timeline_' + d.YEAR + '.csv', (error, electionResult)=> {\n this.electoralVoteChart.update(electionResult, this.colorScale);\n this.votePercentageChart.update(electionResult);\n this.tileChart.update(electionResult, this.colorScale);\n });\n });\n circlegroup\n .on('mouseover', function() {\n d3.select(this)\n .classed('highlighted', true);\n })\n .on('mouseout', function () {\n d3.select(this)\n .classed('highlighted', false);\n });\n //Election information corresponding to that year should be loaded and passed to\n // the update methods of other visualizations\n\n\n //******* TODO: EXTRA CREDIT *******\n\n //Implement brush on the year chart created above.\n //Implement a call back method to handle the brush end event.\n //Call the update method of shiftChart and pass the data corresponding to brush selection.\n //HINT: Use the .brush class to style the brush.\n let brushed = ()=>{\n console.log(d3.event.selection);\n if(d3.event.selection){\n let loc = d3.event.selection;\n let selectedYear = this.electionWinners.filter((d)=>{\n let start = xScale(+d.YEAR)-15;\n let end = start+30;\n return start >= loc[0] && end <= loc[1];\n })\n .map((s)=>{return s.YEAR;});\n let self = this; \n this.dataForYears = [];\n \n if(selectedYear.length>0)\n this.loadSeveralYear(selectedYear,0,self);\n \n }\n }\n\n\n var brush = d3.brushX().extent([[0,20],[this.svgWidth,this.svgHeight/2]]).on(\"end\", brushed);\n this.svg.append(\"g\").attr(\"class\", \"brush\").call(brush);\n\n }", "title": "" }, { "docid": "c3e5624e219632097dafb3b882b157c5", "score": "0.53379124", "text": "function drawStateHistorical(state) {\r\n\r\n // draw historical trends chart\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Year');\r\n data.addColumn('number', '# Women MLAs');\r\n //data.addColumn({type: 'string', role: 'annotation'});\r\n\r\n for (var iter = 0; iter < statesData[state].length; iter++) {\r\n \tdata.addRow([ statesData[state][iter]['year_value'].toString(), statesData[state][iter]['women_mlas']]);\r\n }\r\n\r\n var options = {\r\n chart: {\r\n title: 'Legislative assembly historical trends - ' + statesData[state][0]['state_name']\r\n },\r\n colors: ['#aa3333'],\r\n legend: {\r\n position: 'none'\r\n },\r\n lineWidth: 2,\r\n vAxis: {\r\n gridlines: {\r\n color: 'transparent'\r\n }\r\n },\r\n width: 800,\r\n height: 600,\r\n pointSize: 5,\r\n view: {\r\n columns: [0, 1]\r\n }\r\n };\r\n\r\n sLayer.setStyle(styleSelector);\r\n\r\n /*sLayer.onEachFeature(function(feature, layer) {\r\n \tif(feature.properties.CD === state) {\r\n \t\tlayer.setStyle({\r\n\t\t\t\tcolor: 'black',\r\n\t\t\t\tweight: 2,\r\n\t\t\t\tfillColor: '#AA3333',\r\n\t\t\t\tfillOpacity: 1\r\n\t\t\t});\r\n \t}\r\n });*/\r\n\r\n if(statesData[state].length > 1) {\r\n \tvar chart = new google.visualization.LineChart(document.getElementById('historical')); \r\n \t//var chart = new google.charts.Line(document.getElementById('historical')); // material charts\r\n \tchart.draw(data, options);\r\n\t} else {\r\n\t\tvar chart = new google.charts.Bar(document.getElementById('historical'));\r\n\t\tchart.draw(data, options);\r\n\t}\r\n\r\n} // end of drawStateHistorical function", "title": "" }, { "docid": "b96d15404e65a930156c2cce2ec5069c", "score": "0.5332755", "text": "constructor (electoralVoteChart, tileChart, votePercentageChart,shiftChart, electionWinners) {\n\n //Creating YearChart instance\n this.electoralVoteChart = electoralVoteChart;\n this.tileChart = tileChart;\n this.votePercentageChart = votePercentageChart;\n this.shiftChart = shiftChart;\n // the data\n this.electionWinners = electionWinners;\n \n // Initializes the svg elements required for this chart\n this.margin = {top: 10, right: 20, bottom: 30, left: 50};\n let divyearChart = d3.select(\"#year-chart\").classed(\"fullView\", true);\n\n //fetch the svg bounds\n this.svgBounds = divyearChart.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 100;\n\n //add the svg to the div\n this.svg = divyearChart.append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", this.svgHeight)\n }", "title": "" }, { "docid": "7ceff26245985a0582444794c7fb5c7c", "score": "0.5330792", "text": "constructor (electoralVoteChart, tileChart, votePercentageChart, electionWinners, voteShiftChart) {\n this.voteShiftChart = voteShiftChart;\n //Creating YearChart instance\n this.electoralVoteChart = electoralVoteChart;\n this.tileChart = tileChart;\n this.votePercentageChart = votePercentageChart;\n // the data\n this.electionWinners = electionWinners;\n \n // Initializes the svg elements required for this chart\n this.margin = {top: 10, right: 20, bottom: 30, left: 50};\n let divyearChart = d3.select(\"#year-chart\").classed(\"fullView\", true);\n\n //fetch the svg bounds\n this.svgBounds = divyearChart.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 100;\n\n //add the svg to the div\n this.svg = divyearChart.append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", this.svgHeight);\n\n this.dataForYears; \n }", "title": "" }, { "docid": "68ec99d5d05d21da82d3c31aa314a722", "score": "0.5323788", "text": "function buildPlot3(event, year) {\n toolTip.hide();\n runnersList.sort(compareValues('speed', 'desc'));\n\n runnersList.forEach((d, i) => {\n d.place = i + 1;\n });\n\n // Create scale functions\n var xLinearScale = d3.scaleLinear()\n .domain([d3.min(runnersList, d => d.speed) * 0.95, d3.max(runnersList, d => d.speed) * 1.07])\n .range([0, width]);\n\n var yLinearScale = d3.scaleLinear()\n .domain([(runnersList.length + .5), 0.5])\n .range([height, 0]);\n\n // Create axis functions\n var bottomAxis = d3.axisBottom(xLinearScale);\n var leftAxis = d3.axisLeft(yLinearScale).tickFormat(d3.format(\"d\")).ticks(runnersList.length);\n\n // Update Axes in Chart\n chartGroup.selectAll(\".x_axis\")\n .call(bottomAxis);\n\n chartGroup.selectAll(\".y_axis\")\n .call(leftAxis);\n\n // Initialize tool tip\n toolTip.html(function (d) {\n var speed = d3.format('.3f')(d.speed);\n return (`Place: ${d.place}<br><strong>${d.name}</strong> (${d.nationality})<br>${d.year} ${d.event}<br>Speed: ${speed} m/s`);\n });\n\n // Create Circles and Text\n var circlesGroup = chartGroup.selectAll(\".symbol\")\n .data(runnersList);\n circlesGroup\n .enter()\n .append(\"text\")\n .attr(\"class\", \"symbol fa\")\n .on(\"mouseover\", function (data) {\n console.log(this);\n toolTip.show(data, this);\n })\n .on(\"click\", function (data) {\n toolTip.hide(data);\n })\n .merge(circlesGroup)\n\n .attr(\"x\", 0)\n .attr(\"y\", d => yLinearScale(d.place))\n .transition()\n .delay(200)\n .duration(1500)\n\n .text(d => `\\uf70c`)\n .attr(\"x\", d => xLinearScale(d.speed))\n .attr(\"y\", d => yLinearScale(d.place))\n .attr(\"opacity\", d => {\n if (d.place == \"1\") { return \"1\" };\n if (d.place == \"2\") { return \"0.8\" };\n if (d.place == \"3\") { return \"0.7\" };\n return \"0.9\"\n })\n .attr(\"fill\", d => {\n if (d.place == \"3\") { return \"#A77044\" }\n else if (d.place == \"2\") { return \"#A7A7AD\" }\n else if (d.place == \"1\") { return \"gold\" }\n return \"black\"\n });\n circlesGroup\n .exit()\n .transition()\n .duration(200)\n .attr(\"x\", width)\n .remove();\n\n var namesGroup = chartGroup.selectAll(\".plot3names\")\n .data(runnersList);\n namesGroup\n .enter()\n .append(\"text\")\n .attr(\"class\", \"plot3names\")\n .merge(namesGroup)\n\n .attr(\"x\", 0)\n .attr(\"y\", d => yLinearScale(d.place))\n .attr(\"transform\", \"translate(-30, 23)\")\n .transition()\n .delay(1350)\n .duration(100)\n\n .text(d => `${d.name}`)\n .attr(\"x\", d => xLinearScale(d.speed))\n .attr(\"y\", d => yLinearScale(d.place))\n .attr(\"transform\", \"translate(-30, 23)\")\n .attr(\"fill\", d => {\n if (d.place == \"3\") { return \"#A77044\" }\n else if (d.place == \"2\") { return \"#A7A7AD\" }\n else if (d.place == \"1\") { return \"gold\" }\n return \"black\"\n });\n namesGroup\n .exit()\n .transition()\n .duration(200)\n .attr(\"x\", width)\n .remove();\n\n\n // Create axes labels\n chartGroup.selectAll(\"#y_text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - margin.left)\n .attr(\"x\", 0 - (height / 2))\n .attr(\"dy\", \"1em\")\n .attr(\"class\", \"aText\")\n .text(\"Place\");\n\n chartGroup.selectAll(\"#x_text\")\n .attr(\"transform\", `translate(${width / 2}, ${height + margin.top + 30})`)\n .attr(\"class\", \"aText\")\n .text(\"Speed (m/s)\");\n\n}", "title": "" }, { "docid": "3b335c6f89cb3662fb26ff22ab7f4672", "score": "0.5315947", "text": "function dashboardFlotTwo() {\n\n var data1 = [\n [gd(2012, 1, 1), 7],\n [gd(2012, 1, 2), 6],\n [gd(2012, 1, 3), 4],\n [gd(2012, 1, 4), 8],\n [gd(2012, 1, 5), 9],\n [gd(2012, 1, 6), 7],\n [gd(2012, 1, 7), 5],\n [gd(2012, 1, 8), 4],\n [gd(2012, 1, 9), 7],\n [gd(2012, 1, 10), 8],\n [gd(2012, 1, 11), 9],\n [gd(2012, 1, 12), 6],\n [gd(2012, 1, 13), 4],\n [gd(2012, 1, 14), 5],\n [gd(2012, 1, 15), 11],\n [gd(2012, 1, 16), 8],\n [gd(2012, 1, 17), 8],\n [gd(2012, 1, 18), 11],\n [gd(2012, 1, 19), 11],\n [gd(2012, 1, 20), 6],\n [gd(2012, 1, 21), 6],\n [gd(2012, 1, 22), 8],\n [gd(2012, 1, 23), 11],\n [gd(2012, 1, 24), 13],\n [gd(2012, 1, 25), 7],\n [gd(2012, 1, 26), 9],\n [gd(2012, 1, 27), 9],\n [gd(2012, 1, 28), 8],\n [gd(2012, 1, 29), 5],\n [gd(2012, 1, 30), 8],\n [gd(2012, 1, 31), 25]\n ];\n\n var data2 = [\n [gd(2012, 1, 1), 800],\n [gd(2012, 1, 2), 500],\n [gd(2012, 1, 3), 600],\n [gd(2012, 1, 4), 700],\n [gd(2012, 1, 5), 500],\n [gd(2012, 1, 6), 456],\n [gd(2012, 1, 7), 800],\n [gd(2012, 1, 8), 589],\n [gd(2012, 1, 9), 467],\n [gd(2012, 1, 10), 876],\n [gd(2012, 1, 11), 689],\n [gd(2012, 1, 12), 700],\n [gd(2012, 1, 13), 500],\n [gd(2012, 1, 14), 600],\n [gd(2012, 1, 15), 700],\n [gd(2012, 1, 16), 786],\n [gd(2012, 1, 17), 345],\n [gd(2012, 1, 18), 888],\n [gd(2012, 1, 19), 888],\n [gd(2012, 1, 20), 888],\n [gd(2012, 1, 21), 987],\n [gd(2012, 1, 22), 444],\n [gd(2012, 1, 23), 999],\n [gd(2012, 1, 24), 567],\n [gd(2012, 1, 25), 786],\n [gd(2012, 1, 26), 666],\n [gd(2012, 1, 27), 888],\n [gd(2012, 1, 28), 900],\n [gd(2012, 1, 29), 178],\n [gd(2012, 1, 30), 555],\n [gd(2012, 1, 31), 993]\n ];\n\n\n var dataset = [\n {\n label: \"Number of orders\",\n grow:{stepMode:\"linear\"},\n data: data2,\n color: \"#1ab394\",\n bars: {\n show: true,\n align: \"center\",\n barWidth: 24 * 60 * 60 * 600,\n lineWidth: 0\n }\n\n },\n {\n label: \"Payments\",\n grow:{stepMode:\"linear\"},\n data: data1,\n yaxis: 2,\n color: \"#1C84C6\",\n lines: {\n lineWidth: 1,\n show: true,\n fill: true,\n fillColor: {\n colors: [\n {\n opacity: 0.2\n },\n {\n opacity: 0.2\n }\n ]\n }\n }\n }\n ];\n\n\n var options = {\n grid: {\n hoverable: true,\n clickable: true,\n tickColor: \"#d5d5d5\",\n borderWidth: 0,\n color: '#d5d5d5'\n },\n colors: [\"#1ab394\", \"#464f88\"],\n tooltip: true,\n xaxis: {\n mode: \"time\",\n tickSize: [3, \"day\"],\n tickLength: 0,\n axisLabel: \"Date\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Arial',\n axisLabelPadding: 10,\n color: \"#d5d5d5\"\n },\n yaxes: [\n {\n position: \"left\",\n max: 1070,\n color: \"#d5d5d5\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Arial',\n axisLabelPadding: 3\n },\n {\n position: \"right\",\n color: \"#d5d5d5\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: ' Arial',\n axisLabelPadding: 67\n }\n ],\n legend: {\n noColumns: 1,\n labelBoxBorderColor: \"#d5d5d5\",\n position: \"nw\"\n }\n\n };\n\n function gd(year, month, day) {\n return new Date(year, month - 1, day).getTime();\n }\n\n /**\n * Definition of variables\n * Flot chart\n */\n this.flotData = dataset;\n this.flotOptions = options;\n}", "title": "" }, { "docid": "3b335c6f89cb3662fb26ff22ab7f4672", "score": "0.5315947", "text": "function dashboardFlotTwo() {\n\n var data1 = [\n [gd(2012, 1, 1), 7],\n [gd(2012, 1, 2), 6],\n [gd(2012, 1, 3), 4],\n [gd(2012, 1, 4), 8],\n [gd(2012, 1, 5), 9],\n [gd(2012, 1, 6), 7],\n [gd(2012, 1, 7), 5],\n [gd(2012, 1, 8), 4],\n [gd(2012, 1, 9), 7],\n [gd(2012, 1, 10), 8],\n [gd(2012, 1, 11), 9],\n [gd(2012, 1, 12), 6],\n [gd(2012, 1, 13), 4],\n [gd(2012, 1, 14), 5],\n [gd(2012, 1, 15), 11],\n [gd(2012, 1, 16), 8],\n [gd(2012, 1, 17), 8],\n [gd(2012, 1, 18), 11],\n [gd(2012, 1, 19), 11],\n [gd(2012, 1, 20), 6],\n [gd(2012, 1, 21), 6],\n [gd(2012, 1, 22), 8],\n [gd(2012, 1, 23), 11],\n [gd(2012, 1, 24), 13],\n [gd(2012, 1, 25), 7],\n [gd(2012, 1, 26), 9],\n [gd(2012, 1, 27), 9],\n [gd(2012, 1, 28), 8],\n [gd(2012, 1, 29), 5],\n [gd(2012, 1, 30), 8],\n [gd(2012, 1, 31), 25]\n ];\n\n var data2 = [\n [gd(2012, 1, 1), 800],\n [gd(2012, 1, 2), 500],\n [gd(2012, 1, 3), 600],\n [gd(2012, 1, 4), 700],\n [gd(2012, 1, 5), 500],\n [gd(2012, 1, 6), 456],\n [gd(2012, 1, 7), 800],\n [gd(2012, 1, 8), 589],\n [gd(2012, 1, 9), 467],\n [gd(2012, 1, 10), 876],\n [gd(2012, 1, 11), 689],\n [gd(2012, 1, 12), 700],\n [gd(2012, 1, 13), 500],\n [gd(2012, 1, 14), 600],\n [gd(2012, 1, 15), 700],\n [gd(2012, 1, 16), 786],\n [gd(2012, 1, 17), 345],\n [gd(2012, 1, 18), 888],\n [gd(2012, 1, 19), 888],\n [gd(2012, 1, 20), 888],\n [gd(2012, 1, 21), 987],\n [gd(2012, 1, 22), 444],\n [gd(2012, 1, 23), 999],\n [gd(2012, 1, 24), 567],\n [gd(2012, 1, 25), 786],\n [gd(2012, 1, 26), 666],\n [gd(2012, 1, 27), 888],\n [gd(2012, 1, 28), 900],\n [gd(2012, 1, 29), 178],\n [gd(2012, 1, 30), 555],\n [gd(2012, 1, 31), 993]\n ];\n\n\n var dataset = [\n {\n label: \"Number of orders\",\n grow:{stepMode:\"linear\"},\n data: data2,\n color: \"#1ab394\",\n bars: {\n show: true,\n align: \"center\",\n barWidth: 24 * 60 * 60 * 600,\n lineWidth: 0\n }\n\n },\n {\n label: \"Payments\",\n grow:{stepMode:\"linear\"},\n data: data1,\n yaxis: 2,\n color: \"#1C84C6\",\n lines: {\n lineWidth: 1,\n show: true,\n fill: true,\n fillColor: {\n colors: [\n {\n opacity: 0.2\n },\n {\n opacity: 0.2\n }\n ]\n }\n }\n }\n ];\n\n\n var options = {\n grid: {\n hoverable: true,\n clickable: true,\n tickColor: \"#d5d5d5\",\n borderWidth: 0,\n color: '#d5d5d5'\n },\n colors: [\"#1ab394\", \"#464f88\"],\n tooltip: true,\n xaxis: {\n mode: \"time\",\n tickSize: [3, \"day\"],\n tickLength: 0,\n axisLabel: \"Date\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Arial',\n axisLabelPadding: 10,\n color: \"#d5d5d5\"\n },\n yaxes: [\n {\n position: \"left\",\n max: 1070,\n color: \"#d5d5d5\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Arial',\n axisLabelPadding: 3\n },\n {\n position: \"right\",\n color: \"#d5d5d5\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: ' Arial',\n axisLabelPadding: 67\n }\n ],\n legend: {\n noColumns: 1,\n labelBoxBorderColor: \"#d5d5d5\",\n position: \"nw\"\n }\n\n };\n\n function gd(year, month, day) {\n return new Date(year, month - 1, day).getTime();\n }\n\n /**\n * Definition of variables\n * Flot chart\n */\n this.flotData = dataset;\n this.flotOptions = options;\n}", "title": "" }, { "docid": "ecef22bf5513e8b72cb260c2c4501f12", "score": "0.5294736", "text": "function drawChart26() {\r\n\tvar data = google.visualization.arrayToDataTable([\r\n\t\t['Teams', 'Times Won'],\r\n\t\t['Player\\'s Team', 2],\r\n\t\t['Other Teams', 11]\r\n\t]);\r\n\t\r\n\tvar options = {\r\n\t\ttitle: 'Lebron James\\' Championships* vs. Years Played',\r\n\t\tbackgroundColor:'transparent',\r\n\t\ttitleTextStyle:{color: 'white', fontName: 'Arial', fontSize: 15, bold:true, italic:false},\r\n\t\tis3D: true,\r\n\t\tlegend:{textStyle:{color: 'white', fontName: 'Arial', fontSize: 10, bold:true, italic:false}},\r\n\t\tpieSliceText: 'percentage',\r\n\t\tslices: { 1: {offset: 0.2},\r\n\t\t\t2: {offset: 0.2},\r\n\t\t},\r\n\t};\r\n\t\r\n\tvar chart = new google.visualization.PieChart(document.getElementById('piechart_3d23'));\r\n\tchart.draw(data, options);\r\n}", "title": "" }, { "docid": "19e9ce42e2c382e9b9eb999ac42bd085", "score": "0.5294705", "text": "function mkCharts(imm2012) {\n\tvar dataObj = imm2012.immData;\n\tvar dataArray = [];\n\tvar dataHeaders = [\"Country\", \"Green cards\"];\n\tdataArray.push(dataHeaders);\n\tfor (var i = 0; i < dataObj.length; i++) {\n\t\tvar currObj = dataObj[i];\n\t\tvar currArray = [currObj.Country, currObj.Immigrants];\n\t\tdataArray.push(currArray);\n\t}\n\tvar data = google.visualization.arrayToDataTable(dataArray);\n\tvar formatter = new google.visualization.NumberFormat({\n\t\tpattern : '###,###'\n\t});\n\tformatter.format(data, 1);\n\n\t//Default options\n\tvar options = {\n\t\tcolorAxis : {\n\t\t\tmaxValue : 25000,\n\t\t\tcolors : ['#edecec', '#4C4646']\n\t\t},\n\t\twidth : 900,\n\t\tkeepAspectRatio : true,\n\t\tforceIFrame : true,\n\t\tbackgroundColor : {\n\t\t\tstroke : '#000',\n\t\t\tstrokeWidth : 4\n\t\t}\n\t};\n\n\t//Options on click\n\t$(\".button\").on(\"click\", function() {\n\t\tvar parClass = $(this).attr(\"class\");\n\t\tvar contName = parClass.split(\" \")[1];\n\t\t//World Options\n\t\tif (contName == \"world\") {\n\t\t\toptions = {\n\t\t\t\tcolorAxis : {\n\t\t\t\t\tmaxValue : 25000,\n\t\t\t\t\tcolors : ['#edecec', '#4C4646']\n\t\t\t\t},\n\t\t\t\twidth : 900,\n\t\t\t\tkeepAspectRatio : true,\n\t\t\t\tforceIFrame : true,\n\t\t\t\tbackgroundColor : {\n\t\t\t\t\tstroke : '#000',\n\t\t\t\t\tstrokeWidth : 4\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Africa Options\n\t\tif (contName == \"africa\") {\n\t\t\toptions = {\n\t\t\t\tcolorAxis : {\n\t\t\t\t\tmaxValue : 15000,\n\t\t\t\t\tcolors : ['#eae5e5', '#330000']\n\t\t\t\t},\n\t\t\t\twidth : 900,\n\t\t\t\tkeepAspectRatio : true,\n\t\t\t\tforceIFrame : true,\n\t\t\t\tregion : '002',\n\t\t\t\tbackgroundColor : {\n\t\t\t\t\tstroke : '#000',\n\t\t\t\t\tstrokeWidth : 4\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Americas Options\n\t\tif (contName == \"americas\") {\n\t\t\toptions = {\n\t\t\t\tcolorAxis : {\n\t\t\t\t\tmaxValue : 25000,\n\t\t\t\t\tcolors : ['#d0d1dc', '#151B54']\n\t\t\t\t},\n\t\t\t\twidth : 900,\n\t\t\t\tkeepAspectRatio : true,\n\t\t\t\tforceIFrame : true,\n\t\t\t\tregion : '019',\n\t\t\t\tbackgroundColor : {\n\t\t\t\t\tstroke : '#000',\n\t\t\t\t\tstrokeWidth : 4\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Asia Options\n\t\tif (contName == \"asia\") {\n\t\t\toptions = {\n\t\t\t\tcolorAxis : {\n\t\t\t\t\tmaxValue : 80000,\n\t\t\t\t\tcolors : ['#e5dcd0', '#7F5217']\n\t\t\t\t},\n\t\t\t\twidth : 900,\n\t\t\t\tkeepAspectRatio : true,\n\t\t\t\tforceIFrame : true,\n\t\t\t\tregion : '142',\n\t\t\t\tbackgroundColor : {\n\t\t\t\t\tstroke : '#000',\n\t\t\t\t\tstrokeWidth : 4\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Europe Options\n\t\tif (contName == \"europe\") {\n\t\t\toptions = {\n\t\t\t\tcolorAxis : {\n\t\t\t\t\tmaxValue : 12000,\n\t\t\t\t\tcolors : ['#ddd1e5', '#451564']\n\t\t\t\t},\n\t\t\t\twidth : 900,\n\t\t\t\tkeepAspectRatio : true,\n\t\t\t\tforceIFrame : true,\n\t\t\t\tregion : '150',\n\t\t\t\tbackgroundColor : {\n\t\t\t\t\tstroke : '#000',\n\t\t\t\t\tstrokeWidth : 4\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Oceania Options\n\t\tif (contName == \"oceania\") {\n\t\t\toptions = {\n\t\t\t\tcolorAxis : {\n\t\t\t\t\tmaxValue : 2500,\n\t\t\t\t\tcolors : ['#bdc6b9', '#254117']\n\t\t\t\t},\n\t\t\t\twidth : 900,\n\t\t\t\tkeepAspectRatio : true,\n\t\t\t\tforceIFrame : true,\n\t\t\t\tregion : '009',\n\t\t\t\tbackgroundColor : {\n\t\t\t\t\tstroke : '#000',\n\t\t\t\t\tstrokeWidth : 4\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//End Options\n\n\t\t//When a given button is clicked, its options will be displayed in the mapWrapper.\n\t\t//A class of CSS called \"active\" will also be applied to indicate to the user that the button has been activated and the map is showing.\n\t\t//That CSS class will be removed when a different button is clicked and becomes active.\n\t\tif ($(this).hasClass(\"active\")) {\n\t\t} else {\n\t\t\t$(\"#mapHead\").html(\"<h2>\" + contName + \"</h2>\");\n\t\t\t$(\"#nav .button\").removeClass(\"active\");\n\t\t\t$(this).addClass(\"active\");\n\t\t\t//History.js for custom URLs\n\t\t\tHistory.pushState({\n\t\t\t\tstate : 1\n\t\t\t}, \"Who wants to be an American?\", \"?view=\" + contName);\n\t\t\tvar chart = new google.visualization.GeoChart(document.getElementById('mapWrapper'));\n\t\t\tchart.draw(data, options);\n\n\t\t\t//Need these vars to update share buttons based on custom URL\n\t\t\tvar urlData = History.getState().cleanUrl;\n\t\t\tvar queryString = urlData.split(\"?\")[1];\n\n\t\t\tvar fbStart = '<a class=\"facebook\" href=\"JavaScript:window.open(';\n\t\t\tvar fbURLStart = \"'http://www.facebook.com/sharer.php?u=http://www.columbia.edu/~hjs2136/immigrant-map/index.html\";\n\t\t\tvar fbURLEnd = \"','','width=657,height=400,scrollbars=1')\";\n\t\t\tvar fbEnd = '\">FACEBOOK</a>';\n\n\t\t\tvar twStart = '<a class=\"twitter\" href=\"JavaScript:window.open(';\n\t\t\tvar twURLStart = \"'https://twitter.com/share?url=http://www.columbia.edu/~hjs2136/immigrant-map/index.html\";\n\t\t\tvar twURLEnd = \"&text=This data visualization shows which nationalities received the most green cards in 2012&hashtags=immigration,dataviz&related=Harry_Stevens','','width=450,height=350')\";\n\t\t\tvar twEnd = '\">TWITTER</a>';\n\n\t\t\tvar goStart = '<a class=\"google\" href=\"JavaScript:window.open(';\n\t\t\tvar goURLStart = \"'https://plus.google.com/share?url=http://www.columbia.edu/~hjs2136/immigrant-map/index.html\";\n\t\t\tvar goURLEnd = \"','','width=657,height=400,scrollbars=1')\";\n\t\t\tvar goEnd = '\">GOOGLE +</a>';\n\n\t\t\tvar liStart = '<a class=\"linkedin\" href=\"JavaScript:window.open(';\n\t\t\tvar liURLStart = \"'https://linkedin.com/cws/share?url=http://www.columbia.edu/~hjs2136/immigrant-map/index.html\";\n\t\t\tvar liURLEnd = \"','','width=657,height=400,scrollbars=1')\";\n\t\t\tvar liEnd = '\">LINKEDIN</a>';\n\n\t\t\t$(\"#sharebuttons\").html(fbStart + fbURLStart + \"?\" + queryString + fbURLEnd + fbEnd + \"<br />\" + twStart + twURLStart + \"?\" + queryString + twURLEnd + twEnd + \"<br />\" + goStart + goURLStart + \"?\" + queryString + goURLEnd + goEnd + \"<br />\" + liStart + liURLStart + \"?\" + queryString + liURLEnd + liEnd);\n\n\t\t}//end active if\n\n\t});\n\t//end click handler\n\n\t//History.js to handle default states and reloads\n\tvar urlData = History.getState().cleanUrl;\n\tvar queryString = urlData.split(\"?\")[1];\n\tif (!queryString) {\n\t\tvar chart = new google.visualization.GeoChart(document.getElementById('mapWrapper'));\n\t\tchart.draw(data, options);\n\t} else {\n\t\tvar viewName = queryString.split(\"=\")[1];\n\t\t//Need separate case for world because when page loads it defaults to world view, so world button can't be clicked\t\t\n\t\tif (viewName == 'world'){\n\t\t\tvar chart = new google.visualization.GeoChart(document.getElementById('mapWrapper'));\n\t\t\tchart.draw(data, options);\n\t\t} else {\n\t\t\t$(\".\" + viewName).click();\n\t\t}\n\t}\n}//end immdata", "title": "" }, { "docid": "45c45daa4eee043ff568c35646a4ca09", "score": "0.5294468", "text": "function drawChart24() {\r\n\tvar data = google.visualization.arrayToDataTable([\r\n\t\t['Teams', 'Times Won'],\r\n\t\t['Player\\'s Team', 1],\r\n\t\t['Other Teams', 6]\r\n\t]);\r\n\t\r\n\tvar options = {\r\n\t\ttitle: 'Steph Curry\\'s Championships vs. Years Played',\r\n\t\tbackgroundColor:'transparent',\r\n\t\ttitleTextStyle:{color: '#990000', fontName: 'Arial', fontSize: 15, bold:true, italic:false},\r\n\t\tis3D: true,\r\n\t\tlegend:{textStyle:{color: '#990000', fontName: 'Arial', fontSize: 10, bold:true, italic:false}},\r\n\t\tpieSliceText: 'percentage',\r\n\t\tslices: { 1: {offset: 0.2},\r\n\t\t\t2: {offset: 0.2},\r\n\t\t},\r\n\t};\r\n\t\r\n\tvar chart = new google.visualization.PieChart(document.getElementById('piechart_3d21'));\r\n\tchart.draw(data, options);\r\n}", "title": "" }, { "docid": "fdf4e2d0a442d9cc1cb231c5f0ed23f8", "score": "0.5282527", "text": "getCompetitionLadder(country, teams, fromYear, toYear, part, xAxis) {\n // table competitionLadder cols: year, team, rank, points, goalsFor, goalsAgainst, goalsPercentage, finalRank\n var competitionLadder = [];\n\n if (xAxis == \"parts\") {\n // return all parts in case xAxis == \"parts\", part \"finals\" will be added later\n this.parts = [ \"early\", \"mid\", \"end\" ];\n }\n else if (part == \"finals\") {\n this.parts = [ \"end\" ];\n }\n else if (part != \"end\") {\n this.parts = [ part, \"end\" ];\n }\n \n this.years = this.getYears().filter(m => (m >= fromYear && m <= toYear));\n this.teams = this.getTeams();\n\n this.parts.forEach(part => {\n var competitionLadderPart = [];\n\n this.years.forEach(year => {\n var competitionLadderYear = [];\n // get data for the current year in loop\n const yearData = this.jsonFullData.filter(item => item.year == year);\n\n this.teams.forEach(team => {\n // calculate points, goalsFor, goalsAgainst, goalsPercentage\n var dataByPart = this._getDataByPart(yearData, team, part);\n\n var recordCompetitionLadder = {\n year,\n team,\n rank: 0,\n points: dataByPart.points,\n goalsFor: dataByPart.goalsFor,\n goalsAgainst: dataByPart.goalsAgainst,\n goalsPercentage: dataByPart.goalsPercentage,\n finalRank: 0\n };\n\n competitionLadderYear.push(recordCompetitionLadder);\n });\n\n // ORDER BY points DESC, goalsPercentage DESC\n competitionLadderYear.sort((a, b) =>\n (a.points < b.points)\n ? 1\n : (a.points === b.points)\n ? ((a.goalsPercentage < b.goalsPercentage)\n ? 1\n : -1)\n : -1);\n\n // update field rank based on sorted list\n competitionLadderYear.map((item, index) => { item.rank = index + 1; });\n\n competitionLadderPart.push(...competitionLadderYear);\n });\n\n competitionLadder.push({ part: part, competitionLadder: competitionLadderPart });\n });\n\n // create deep copy, not shadow copy of \"end-season\" part\n // https://medium.com/@gamshan001/javascript-deep-copy-for-array-and-object-97e3d4bc401a\n var competitionLadderFinals = JSON.parse(JSON.stringify(competitionLadder[competitionLadder.length - 1].competitionLadder));\n\n // update finalRank. Because the rank in ladder and final standing may be not the same.\n // e.g. in 2008, Waikato ranked #1 in the ladder (regular season), but after the finals, the champion is New South Wales\n // https://en.wikipedia.org/wiki/2008_ANZ_Championship_season\n this.years.forEach(year => {\n const yearData = this.jsonFullData.filter(item => item.year == year);\n\n // get final standings of the year. There are only 4 final standings (#1 - #4)\n var finalStandings = this._getFinalStandings(yearData);\n\n competitionLadderFinals.filter(m => m.year == year).map((item) => {\n var finalStandingRecords = finalStandings.filter(x => x.team == item.team);\n \n // update final rank\n if (finalStandingRecords.length > 0) {\n item.rank = item.finalRank = finalStandingRecords[0].finalStanding;\n }\n else {\n item.finalRank = item.rank;\n }\n });\n });\n\n competitionLadder.push({ part: \"finals\", competitionLadder: competitionLadderFinals });\n\n // set finalRank for every records\n this.parts.forEach((part, index) => {\n var competitionLadderPart = competitionLadder.filter(m => m.part == part)[0].competitionLadder;\n\n this.years.forEach(year => {\n var competitionLadderYear = competitionLadderPart.filter(m => m.year == year);\n\n competitionLadderYear.forEach(item => {\n var finalRank = competitionLadderFinals.filter(m => m.team == item.team && m.year == year)[0].finalRank;\n item.finalRank = finalRank;\n });\n });\n });\n\n // ORDER BY year ASC, finalRank ASC\n competitionLadder.forEach(m => {\n var competitionLadderPart = m.competitionLadder;\n \n competitionLadderPart.sort((a, b) =>\n (a.year > b.year)\n ? 1\n : (a.year === b.year)\n ? ((a.finalRank > b.finalRank)\n ? 1\n : -1)\n : -1);\n });\n\n // filter parts\n if (xAxis != \"parts\") {\n competitionLadder = competitionLadder.filter(m => m.part == part);\n }\n\n // filter teams\n this.filteredTeams = (teams == null || teams.length == 0)\n ? this.getTeams(country)\n : teams;\n competitionLadder.forEach(item => {\n item.competitionLadder = item.competitionLadder.filter(m => this.filteredTeams.includes(m.team));\n });\n\n // return data\n if (xAxis != \"parts\") {\n return competitionLadder;\n } else {\n // format data in case xAxis == \"parts\"\n return this._formatPartData(competitionLadder);\n }\n }", "title": "" }, { "docid": "783c512b6466e165bae670f05f77481d", "score": "0.5277127", "text": "function plotIndividualDays()\n {\n // 1. work out offset + start point\n const fOffset = oChart.chartRect.width() / ( oData.query.days - 1 );\n const oDate = new Date( oData.query.start );\n\n // 2. now iterate!\n for ( let i = 0; i <= oData.query.days; i++ )\n {\n // a. draw the grid\n addGridLine( fOffset * i );\n\n // b. and a label\n addLabel( fOffset * i, fOffset ).appendChild( createEl(\n 'span',\n { class: 'ct-label ct-horizontal' },\n `${MONTHS[oDate.getMonth() + 1]} ${oDate.getDate()}`\n ));\n\n // c. increment!\n addDays( oDate );\n }\n }", "title": "" }, { "docid": "43098f275226382008b1cb198f7ba95d", "score": "0.52733237", "text": "function line(club){\n\n//Retreive value of club per year from parameter that's passed\nvar y_13 = club[\"value\"][\"year_2013\"];\nvar y_14 = club[\"value\"][\"year_2014\"];\nvar y_15 = club[\"value\"][\"year_2015\"];\nvar y_16 = club[\"value\"][\"year_2016\"];\nvar y_17 = club[\"value\"][\"year_2017\"];\n\n//Array for the value of that club for each year\nvar years = [y_13, y_14, y_15, y_16, y_17];\n\nvar data1 = []\nvar step;\nvar year = 2013;\n\n//Create array of objects that contain each year and value of that club for that year\nfor (step = 0; step < 5; step++){\n\tdata1.push({\"Year\": new Date(year,0), \"Value\": years[step]});\n \tyear++;\n }\n\n//Set dimensions\nvar margin = {top: 30, right: 20, bottom: 50, left: 50},\n\twidth = 260 - margin.left - margin.right,\n\theight = 230 - margin.top - margin.bottom;\n\n//Add svg1, the line chart\nvar svg1 = d3.select(\"#area2\")\n\t\t\t .append(\"svg\")\n\t\t\t .attr(\"width\", width + margin.left + margin.right)\n\t\t\t .attr(\"height\", height + margin.top + margin.bottom)\n\t\t\t\t .append(\"g\")\n\t\t\t .attr(\"transform\",\"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n//Set the scales\n\n//Time scale for the years\nvar x = d3.time.scale().domain(d3.extent(data1, function(d) { return d.Year; })).range([0, width]).nice();\n\nvar y = d3.scale.linear().domain([d3.min(data1, function(d){ return d.Value; }), \n\t\t\t\t\t\t\t\t d3.max(data1, function(d){ return d.Value; })])\n\t\t\t\t\t\t\t\t\t.range([height,0]).nice();\n\n//Define the axes\n//Time axis displays year only once. One time a year.\nvar xAxis = d3.svg.axis().scale(x).orient(\"bottom\").ticks(d3.time.years, 1).tickFormat(d3.time.format(\"%Y\"));\n\nvar yAxis = d3.svg.axis().scale(y).orient(\"left\").ticks(4);\n\n//Create values for the line\nvar valueline = d3.svg.line()\n\t\t\t\t .x(function(d) { \n\t\t\t\t \treturn x(d.Year);})\n\t\t\t\t .y(function(d) { return y(d.Value);});\n\n//Draw the line\nsvg1.append(\"path\")\n .attr(\"class\", \"line\")\n .attr(\"d\", valueline(data1));\n\n//Add x-axis for line chart\nsvg1.append(\"g\")\n.attr(\"class\", \"x axis\")\n.attr(\"transform\", \"translate(0,\" + height + \")\")\n.call(xAxis)\n.append(\"text\")\n.attr(\"x\", width+10)\n.attr(\"y\", height/3)\n.style(\"text-anchor\", \"end\")\n.text(\"Year\");\n\n//Add y-axis for line chart\nsvg1.append(\"g\")\n.attr(\"class\", \"y axis\")\n.call(yAxis)\n.append(\"text\")\n.attr(\"x\", -5)\n.attr(\"y\", -15)\n.style(\"text-anchor\", \"end\")\n.text(\"Value\");\n\n}", "title": "" }, { "docid": "dc137e39ebfe5627540beff8532c8c85", "score": "0.52708554", "text": "function new_year(data, col) {\n var pie = d3.pie()\n .value(function (d) {\n return d[col];\n }).sort(null);\n\n var width = 400;\n var height = 400;\n var radius = Math.min(width, height) / 2.5;\n var donutWidth = 85;\n\n var commas = d3.format(\",\");\n\n var path = d3.select(\"#donut_chart\")\n .selectAll(\"path\")\n .data(pie(data))\n .on('mouseover', function (event, i) {\n d3.select(this).transition()\n .duration('50')\n .attr('opacity', '.85');\n div.transition()\n .duration(50)\n .style(\"opacity\", 1);\n div.html(\"Total Petitions on \" + i.data.complete_c+ \": \"+commas(i['data'][col]))\n .style(\"left\", (event.pageX + 10) + \"px\")\n .style(\"top\", (event.pageY - 15) + \"px\");\n })\n .on('mouseout', function (d, i) {\n d3.select(this).transition()\n .duration('50')\n .attr('opacity', '1');\n div.transition()\n .duration('50')\n .style(\"opacity\", 0);\n });\n \n var arc = d3.arc()\n .innerRadius(radius - donutWidth)\n .outerRadius(radius);\n \n path.transition().duration(700).attr(\"d\", arc); \n \n }", "title": "" }, { "docid": "ebe4dd6a22feee4aeb3eef8355fbce0d", "score": "0.5266514", "text": "function renderYearOverYearChart(ids) {\n\n // Adjust `now` to experiment with different days, for testing only...\n var now = moment(); // .subtract(3, 'day');\n\n var thisYear = query({\n 'ids': ids,\n 'dimensions': 'ga:month,ga:nthMonth',\n 'metrics': 'ga:users',\n 'start-date': moment(now).date(1).month(0).format('YYYY-MM-DD'),\n 'end-date': moment(now).format('YYYY-MM-DD')\n });\n\n var lastYear = query({\n 'ids': ids,\n 'dimensions': 'ga:month,ga:nthMonth',\n 'metrics': 'ga:users',\n 'start-date': moment(now).subtract(1, 'year').date(1).month(0)\n .format('YYYY-MM-DD'),\n 'end-date': moment(now).date(1).month(0).subtract(1, 'day')\n .format('YYYY-MM-DD')\n });\n\n Promise.all([thisYear, lastYear]).then(function(results) {\n var data1 = results[0].rows.map(function(row) { return +row[2]; });\n var data2 = results[1].rows.map(function(row) { return +row[2]; });\n var labels = ['Jan','Feb','Mar','Apr','May','Jun',\n 'Jul','Aug','Sep','Oct','Nov','Dec'];\n\n // Ensure the data arrays are at least as long as the labels array.\n // Chart.js bar charts don't (yet) accept sparse datasets.\n for (var i = 0, len = labels.length; i < len; i++) {\n if (data1[i] === undefined) data1[i] = null;\n if (data2[i] === undefined) data2[i] = null;\n }\n\n var data = {\n labels : labels,\n datasets : [\n {\n label: 'Last Year',\n fillColor : \"rgba(220,220,220,0.5)\",\n strokeColor : \"rgba(220,220,220,1)\",\n data : data2\n },\n {\n label: 'This Year',\n fillColor : \"rgba(151,187,205,0.5)\",\n strokeColor : \"rgba(151,187,205,1)\",\n data : data1\n }\n ]\n };\n\n new Chart(makeCanvas('chart-2-container')).Bar(data);\n generateLegend('legend-2-container', data.datasets);\n })\n .catch(function(err) {\n console.error(err.stack);\n })\n}", "title": "" }, { "docid": "af98e24697eda3a9e89c0328c82156ac", "score": "0.5265796", "text": "_getDataByPart(yearData, team, part) {\n var endRound = 0;\n\n switch (part) {\n case \"early\":\n // early-season is from round 1 to 5\n endRound = 5;\n break;\n case \"mid\":\n // mid-season is from round 6 to 10\n endRound = 10;\n break;\n case \"end\":\n // end-season is from round 11 to 14\n endRound = 14;\n break;\n default:\n endRound = 14;\n }\n \n // calculate points\n var points = yearData\n .filter(item => item.homeTeam == team && item.type == \"regular\" && item.round <= endRound)\n .reduce((prev, current) => {\n return prev + current.htPoints;\n }, 0);\n points += yearData\n .filter(item => item.awayTeam == team && item.type == \"regular\" && item.round <= endRound)\n .reduce((prev, current) => {\n return prev + current.atPoints;\n }, 0);\n\n // calculate goalsFor\n var goalsFor = yearData\n .filter(item => item.homeTeam == team && item.type == \"regular\" && item.round <= endRound)\n .reduce((prev, current) => {\n return prev + current.htScore;\n }, 0);\n goalsFor += yearData\n .filter(item => item.awayTeam == team && item.type == \"regular\" && item.round <= endRound)\n .reduce((prev, current) => {\n return prev + current.atScore;\n }, 0);\n\n // calculate goalsAgainst\n var goalsAgainst = yearData\n .filter(item => item.homeTeam == team && item.type == \"regular\" && item.round <= endRound)\n .reduce((prev, current) => {\n return prev + current.atScore;\n }, 0);\n goalsAgainst += yearData\n .filter(item => item.awayTeam == team && item.type == \"regular\" && item.round <= endRound)\n .reduce((prev, current) => {\n return prev + current.htScore;\n }, 0);\n\n // calculate goalsPercentage\n var goalsPercentage = goalsFor / goalsAgainst * 100;\n\n return {\n points,\n goalsFor,\n goalsAgainst,\n goalsPercentage\n };\n }", "title": "" }, { "docid": "a4a31024341d64e27f05abcc0a29abfb", "score": "0.5254646", "text": "function createDemandInfo(myUtilityID, checkedDemand) {\n //parse date to scale axis\n parseDate = d3.timeParse(\"%Y-%m-%d\");\n\n //console.log(checkedDemand);\n //read in stream stats\n d3.csv(\"data/demand/demand_over_time.csv\").then(function (demandData) {\n demandData.forEach(function (d) {\n d.date3 = parseDate(\"2021-\" + d.date2.substring(5, d.date2.length));\n d.mean_demand = +d.mean_demand;\n d.month = +d.month;\n d.year = +d.year;\n d.peak_demand = +d.peak_demand;\n });\n\n var selDemand = demandData.filter(function (d) {\n return d.pwsid === myUtilityID.toLowerCase() && d.year >= 1997;\n });\n //console.log(selDemand)\n\n if (selDemand.length <= 0) {\n console.log(\"no utility\");\n //Plotly.purge('demandPlot');\n document.getElementById(\"demandTitle\").innerHTML =\n \"Select a utility with data to see demand\";\n document.getElementById(\"demandPlot\").innerHTML =\n '<img src=\"img/demand_chart_icon.png\" style=\"width: 350px; height: 350px; display: block; margin-left: auto; margin-right: auto;\">';\n }\n\n if (selDemand.length > 0) {\n document.getElementById(\"demandPlot\").innerHTML = \"\"; //set blank plot\n var maxYValue = (\n d3.max(selDemand, function (d) {\n return d.peak_demand;\n }) * 1.1\n ).toFixed(0);\n //console.log(maxYValue);\n //create multiple traces\n var data = [];\n var xMonths = selDemand.map(function (d) {\n return d.date2;\n });\n let xMonth = xMonths.filter(\n (item, i, ar) => ar.indexOf(item) === i\n );\n\n //draw the traces for all years but current\n var xYears = [];\n for (var i = 2000; i <= currentYear; i++) {\n xYears.push(i);\n }\n\n var yOther = [];\n var otherYearTrace;\n\n for (i = 0; i < xYears.length - 1; i++) {\n tempSelect = xYears[i];\n temp = selDemand.filter(function (d) {\n return d.year === tempSelect;\n });\n tempName = \"%{y:.1f} mgd in \" + tempSelect;\n //xDate = temp.map(function(d){ return d.date; });\n yOther = temp.map(function (d) {\n return d.mean_demand;\n });\n //create individual trace\n var showLegVal = true;\n if (i > 0) {\n showLegVal = false;\n }\n\n OtherYearTrace = {\n x: xMonth,\n y: yOther,\n mode: \"lines\",\n type: \"scatter\",\n hovertemplate: tempName,\n opacity: 0.4,\n line: { color: \"#c5c5c5\", width: 1 }, //light coral\n name: \"years\",\n showlegend: showLegVal,\n };\n\n //push trace\n data.push(OtherYearTrace);\n } // end for loop\n\n //draw other selected years\n var selectYears;\n var selectTraces;\n //set array of colors\n var colorLineAll = [\n \"rgb(26,121,131)\",\n \"#567258\",\n \"#bf9f4c\",\n \"#b9b59f\",\n \"#6f634d\",\n \"#314837\",\n \"#b0d76f\",\n \"#0ed0d0\",\n \"#246f8f\",\n \"5234578\",\n \"#900909\",\n \"#d16014\",\n \"#58381f\",\n ];\n var colorLine;\n\n for (i = 0; i < checkedDemand.length; i++) {\n tempSelect = Number(checkedDemand[i]);\n selectYears = selDemand\n .filter(function (d) {\n return d.year === tempSelect;\n })\n .map(function (d) {\n return d.mean_demand;\n });\n tempName = \"%{y:.1f} mgd in %{x}, \" + tempSelect;\n colorLine = colorLineAll[i];\n if (tempSelect === 2002) {\n colorLine = \"red\";\n }\n if (tempSelect === 2007) {\n colorLine = \"darkred\";\n }\n\n selectTraces = {\n x: xMonth,\n y: selectYears,\n mode: \"lines\",\n type: \"scatter\",\n hovertemplate: \"%{y:.1f} mgd in %{x}, \" + tempSelect,\n opacity: 1,\n line: { color: colorLine, width: 2 },\n name: tempSelect,\n showlegend: true,\n };\n data.push(selectTraces);\n }\n\n //draw median and selected year\n selDemandNow = selDemand.filter(function (d) {\n return d.year === currentYear;\n });\n var ySelect = selDemandNow.map(function (d) {\n return d.mean_demand;\n });\n\n //PLOTLY\n var seltrace = {\n y: ySelect,\n x: xMonth,\n /*marker: {\n size: 6, color: \"rgb(43,28,88\",\n line: {color: 'black', width: 1}\n },*/\n line: { color: \"rgb(43,28,88\", width: 3 },\n mode: \"lines\",\n type: \"scatter\",\n name: \"2021\",\n showlegend: true,\n hovertemplate: \"%{y:.1f} mgd in %{x}\",\n };\n\n var layout = {\n yaxis: {\n title: \"Daily Demand (MGD)\",\n titlefont: { color: \"rgb(0, 0, 0)\", size: 14 },\n tickfont: { color: \"rgb(0, 0, 0)\", size: 12 },\n showline: false,\n showgrid: true,\n showticklabels: true,\n range: [0, maxYValue],\n },\n xaxis: {\n showline: false,\n showgrid: true,\n showticklabels: true,\n tickformat: \"%b-%d\",\n title: \"\",\n titlefont: { color: \"rgb(0, 0, 0)\", size: 14 },\n tickfont: { color: \"rgb(0, 0, 0)\", size: 12 },\n //range: [0, 15]\n },\n hovermode: \"closest\",\n height: 375,\n //showlegend: true,\n margin: { t: 20, b: 50, r: 10, l: 40 },\n };\n\n data.push(seltrace);\n Plotly.newPlot(\"demandPlot\", data, layout, config);\n\n //load document names\n if (myUtility === \"none\") {\n document.getElementById(\"demandTitle\").innerHTML =\n \"Select a utility on the map to learn more\";\n }\n\n if (myUtility !== \"none\") {\n var selCurDemand = selDemand.map(function (d) {\n return d.mean_demand;\n });\n var thisWeekDemand = selCurDemand[selCurDemand.length - 1];\n var lastWeekDemand = selCurDemand[selCurDemand.length - 8];\n\n //now how does this compare to last week?\n var demandTrajectory;\n if (thisWeekDemand > lastWeekDemand) {\n demandTrajectory = \"higher\";\n }\n if (thisWeekDemand < lastWeekDemand) {\n demandTrajectory = \"lower\";\n }\n if (thisWeekDemand.toFixed(1) === lastWeekDemand.toFixed(1)) {\n demandTrajectory = \"equal\";\n }\n\n document.getElementById(\"demandTitle\").innerHTML =\n myUtility +\n \" has \" +\n demandTrajectory +\n \" demand than last week\";\n }\n } //end if we have utility data for selectect utility\n }); // end D3\n} //END CREATE CHART FUNCTION ##########################################################", "title": "" }, { "docid": "8339087826ba002612065dcea9a64efb", "score": "0.5252514", "text": "function plotWeeksAndMonths()\n {\n // 0. get some stuff that might come in useful\n const iNumDays = ( oData.meta.bucketWidth * oData.meta.numBuckets ) - 1;\n const iSvgWidth = oChart.chartRect.width();\n const fWeekWidth = ( 7 / iNumDays ) * iSvgWidth;\n\n // 1. work out our starting day, and a month location to start\n const oStartDate = addDays( new Date( oData.query.start ), oData.meta.offsetDays );\n let oCurrMonth = new Date( oData.query.finish.replace( /-\\d{2}$/, '-01' ));\n\n // 2. store an offset + start subtracting months\n const aMonthPositions = [];\n while ( oCurrMonth > oStartDate )\n {\n // a. work out an offset, and plot a grid line there\n const fOff = ( dateDiff( oStartDate, oCurrMonth ) / iNumDays ) * iSvgWidth;\n addGridLine( fOff, 'ct-major', true );\n\n // b. add a label\n addLabel( fOff, fWeekWidth ).appendChild( createEl(\n 'span',\n { class: 'ct-label ct-horizontal ct-month' },\n `${MONTHS[ oCurrMonth.getMonth() + 1 ]} ${oCurrMonth.getFullYear()}`\n ));\n\n // c. shunt for later + shunt our date\n aMonthPositions.push( fOff );\n addMonths( oCurrMonth, -1 );\n }\n\n // 3. push what would’ve been the next month onto our list + work out how wide to put minor ticks\n aMonthPositions.push(( dateDiff( oStartDate, oCurrMonth ) / iNumDays ) * iSvgWidth );\n\n // a. start off with days\n let iTickWidth = ( 1 / iNumDays ) * iSvgWidth;\n const iDayWidth = iTickWidth;\n let iTickEvery = 1;\n let iLabelEvery = 7;\n let iStopAt = 32;\n\n // b. if that fails, try weeks\n if ( iTickWidth < 40 )\n {\n iTickWidth *= 7;\n iTickEvery = 7;\n iLabelEvery = 2;\n iStopAt = 28;\n }\n\n // c. otherwise, fortnights\n if ( iTickWidth < 40 )\n {\n iTickWidth *= 2;\n iTickEvery = 14;\n iLabelEvery = 28;\n }\n\n // 4. now unpack some weeks…\n let fLastOff = iSvgWidth;\n aMonthPositions.forEach( fMonthOff =>\n {\n // i. draw individual ticks\n for ( let i = 0; i < iStopAt; i += iTickEvery )\n {\n // a. work out where we are on the viewport + weather we should show anything\n const fPosition = fMonthOff + ( iDayWidth * i );\n const bShow = ( fPosition > 0 ) && ( fPosition < fLastOff ) && ( i > 0 );\n\n // b. if we’re showing…\n if ( bShow )\n {\n // a. draw a line\n addGridLine( fPosition, 'ct-minor' );\n\n // b. if we’re drawing a label\n if (( i % iLabelEvery ) === 0 )\n {\n addLabel( fPosition, iTickWidth ).appendChild( createEl(\n 'span',\n { class: 'ct-label ct-horizontal ct-dayofmonth' },\n i\n ))\n }\n }\n }\n\n // ii. store our last offset\n fLastOff = fMonthOff - 10;\n });\n }", "title": "" }, { "docid": "471e3b4e6a0668face22f96e6b625e53", "score": "0.5247375", "text": "function calcTurnovers(team) {\n const finalArray = [];\n let obj = {};\n team.forEach(function(element) {\n function appendText(value) {\n const newValue = value.concat(' has an assist to turnover ratio of ' + obj.ast + ':' + obj.tov);\n return newValue;\n }\n let newArray = [];\n obj = element;\n const name = obj.fn + ' ' + obj.ln;\n if(obj.tov > obj.ast) {\n newArray.push(name);\n newArray = newArray.map(appendText);\n finalArray.push(newArray);\n }\n });\n return finalArray;\n }", "title": "" }, { "docid": "87e5006b4cc572e88bdd5bd32946bfe3", "score": "0.52413654", "text": "function setup_draw_xy_axis_year(element, time_scale, count_scale){\n\n var time_axis = d3.svg.axis()\n .scale(time_scale)\n .tickValues(d3.range(2002, 2017, 1))\n .tickFormat(d3.format('d'));\n\n element.append('g')\n .attr('class', 'x axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(time_axis);\n\n element.append('text')\n .attr('x', width / 2 + margin / 2 - 15)\n .attr('y', height + margin/1.5)\n .text('year')\n .attr('font-size', '20px') ;\n \n var count_axis = d3.svg.axis()\n .scale(count_scale)\n .orient('left')\n\n element.append('g')\n .attr('class', 'y axis')\n .attr('transform', 'translate(' + margin + ',0)')\n .call(count_axis);\n\n element.append('text')\n .attr('transform', 'rotate(-90)')\n .attr('transform', 'translate('+ (margin/3) +','+(height/2 + margin/2)+')rotate(-90)')\n .text('total flights ontime ratio')\n .attr('font-size', '20px') ;\n \n}", "title": "" }, { "docid": "99d20b3d0f2f725295727fbd41b5de12", "score": "0.5237138", "text": "function calculateMonthlyPayment() {\n rate = document.getElementById(\"rate\").value\n rate = rate / 100 / 12\n N = document.getElementById(\"no-mpayments\").value\n principal = document.getElementById(\"principal\").value\n principal = principal / 1.0\n\n c = rate * principal / (1 - Math.pow((1+rate), -N))\n tipaid = c * N - principal \n cipaid = (principal * rate - c) * (Math.pow((1+rate), N) - 1) / rate + c * N\n\n\n array = [['Year', 'Debt', 'Interest paid']]\n array.push([0, principal, 0])\n years = N / 12\n y = 1\n while (y <= years) {\n cipy = (principal * rate - c) * (Math.pow((1+rate), y*12) - 1) / rate + c * y*12\n debt = principal - c*y*12 + cipy\n array.push([y, debt, cipy])\n y++\n }\n\n document.getElementById(\"output-mpayments\").innerHTML = \"Monthly payments: \" + c\n document.getElementById(\"output-total-interest-paid\").innerHTML = \"Total interest paid: \" + tipaid \n document.getElementById(\"output-cumulative-interest-paid\").innerHTML = \"Cumulative interest paid: \" +cipaid \n var data = google.visualization.arrayToDataTable(array);\n drawChart(data)\n}", "title": "" }, { "docid": "9b38cb38a75436802208a9a8f4f745dd", "score": "0.52323216", "text": "function createVisualization(error, worldGDP, worldData) {\n // Visualize data1 and data2\n var world = topojson.feature(worldData, worldData.objects.countries).features\n \n var democratsCount = 0;\n var republicansCount = 0;\n \n //set indicator values\n document.getElementById(\"usa\").innerHTML = presPeriod + \" - \" + worldGDP.countries[0].country;\n document.getElementById(\"gdp\").innerHTML = currencyFormat(worldGDP.countries[0].gdp[presPeriod]);\n document.getElementById(\"gdpChange\").innerHTML = percentFormat(worldGDP.countries[0].gdpChange[presPeriod]);\n \n if(worldGDP.countries[0].gdpChange[presPeriod] > 0){\n document.getElementById(\"changeText\").innerHTML = \"Increase from \" + (presPeriod - 2)\n }else{document.getElementById(\"changeText\").innerHTML = \"Decrease from \" + (presPeriod - 2)}\n \n //document.getElementById(\"currentPresident\").innerHTML = worldGDP.countries[0].president[presPeriod]\n \n /*if(worldGDP.countries[0].party[presPeriod].presidentParty===\"R\"){\n document.getElementById(\"currentPresParty\").innerHTML = \"Republican\";\n $(\"#currentPresParty\").css(\"color\",\"#c0392b\");\n republicansCount++;\n }else{\n document.getElementById(\"currentPresParty\").innerHTML = \"Democrat\";\n $(\"#currentPresParty\").css(\"color\",\"#2980b9\");\n democratsCount++;\n }\n \n if(worldGDP.countries[0].party[presPeriod].senateParty===\"R\"){\n document.getElementById(\"currentSenParty\").innerHTML = \"Republican\";\n $(\"#currentSenParty\").css(\"color\",\"#c0392b\");\n republicansCount++;\n }else{\n document.getElementById(\"currentSenParty\").innerHTML = \"Democrat\";\n $(\"#currentSenParty\").css(\"color\",\"#2980b9\");\n democratsCount++;\n }\n \n if(worldGDP.countries[0].party[presPeriod].houseParty===\"R\"){\n document.getElementById(\"currentHouseParty\").innerHTML = \"Republican\";\n $(\"#currentHouseParty\").css(\"color\",\"#c0392b\");\n republicansCount++;\n }else{\n document.getElementById(\"currentHouseParty\").innerHTML = \"Democrat\";\n $(\"#currentHouseParty\").css(\"color\",\"#2980b9\");\n democratsCount++;\n }*/\n \n $(\"#pImgTxt\").text(worldGDP.countries[0].president[presPeriod])\n if(worldGDP.countries[0].party[presPeriod].presidentParty===\"R\"){\n $(\"#presImg\").attr(\"src\",\"images/repPres.png\")\n }else{$(\"#presImg\").attr(\"src\",\"images/demPres.png\")}\n if(worldGDP.countries[0].party[presPeriod].senateParty===\"R\"){\n $(\"#senImg\").attr(\"src\",\"images/repSen.png\")\n }else{$(\"#senImg\").attr(\"src\",\"images/demSen.png\")}\n if(worldGDP.countries[0].party[presPeriod].houseParty===\"R\"){\n $(\"#houseImg\").attr(\"src\",\"images/repHouse.png\")\n }else{$(\"#houseImg\").attr(\"src\",\"images/demHouse.png\")}\n \n // Render the U.S. by using the path generator\n svg.selectAll(\"path\")\n .data(world)\n .enter().append(\"path\")\n .attr(\"d\", path);\n \n //removing previous circles\n d3.selectAll(\"circle\").remove();\n d3.selectAll(\"text\").remove();\n \n //add the countries pointers\n var myCircle = svg.selectAll(\"circle\")\n .data(worldGDP.countries)\n .enter()\n .append('circle')\n .attr(\"class\",\"myCircle\")\n .on(\"click\",function(d){\n document.getElementById(\"country\").innerHTML = presPeriod + \" - \" + d.country;\n document.getElementById(\"gdpCountry\").innerHTML = currencyFormat(d.gdp[presPeriod]);\n document.getElementById(\"gdpChangeCountry\").innerHTML = percentFormat(d.gdpChange[presPeriod]);\n if(d.gdpChange[presPeriod] > 0){\n document.getElementById(\"countryText\").innerHTML = \"Increase from \" + (presPeriod - 2)\n }else{\n document.getElementById(\"countryText\").innerHTML = \"Decrease from \" + (presPeriod - 2)\n }\n return;\n })\n .attr(\"r\",function(d){\n if( d.gdpChange[presPeriod] > 0.05 || d.gdpChange[presPeriod] < -0.05){\n return 20;\n }else{\n return 10;\n }\n })\n //.style(\"fill\",\"coral\")\n .style(\"fill\",function(d){\n if(d.gdpChange[presPeriod] > 0){\n return \"#2ecc71\";\n }else{\n return \"#e74c3c\";\n }\n })\n /*.attr(\"cx\", function(d) {\n return projection([d.longitude, d.latitude])[0];\n })\n .attr(\"cy\", function(d) {\n return projection([d.longitude, d.latitude])[1];\n })*/\n .attr(\"transform\", function(d) {\n return \"translate(\" + projection([d.longitude, d.latitude]) + \")\";\n });\n \n svg.selectAll(\"text\")\n .data(worldGDP.countries)\n .enter()\n .append('text')\n .attr(\"class\",\"circleCountryText\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + projection([d.longitude, d.latitude]) + \")\";\n })\n //.text(\"GDP Percentage\")\n .text(function(d){\n //console.log(d.country);\n //document.getElementById(\"country\").innerHTML = d.country;\n //document.getElementById(\"gdpCountry\").innerHTML = d.gdp[presPeriod];\n //document.getElementById(\"gdpChangeCountry\").innerHTML = d.gdpChange[presPeriod];\n //changeData(d);\n //d3.select(this).style(\"fill\", \"purple\");\n return (percentFormat(d.gdpChange[presPeriod]));\n })\n \n //create zoom tool\n var zoom = d3.behavior.zoom()\n .on(\"zoom\",function() {\n svg.attr(\"transform\",\"translate(\"+ \n d3.event.translate.join(\",\")+\")scale(\"+d3.event.scale+\")\");\n svg.selectAll(\"path\") \n .attr(\"d\", path.projection(projection)); \n });\n svg.call(zoom) \n \n}", "title": "" }, { "docid": "8ee121f8c8b2138924bf129848f70ee1", "score": "0.52314025", "text": "function callReDraw() {\n if (currentYear == 2023) {\n countryCount = 1991\n currentYear = countryCount;\n }\n if (currentYear <= 2022) {\n svg.selectAll(\"circle\")\n .transition()\n //.delay(10)\n .duration(1000)\n .attr(\"cx\", function (d) {\n return x(d.data.males_aged_15plus_employment_rate_percent[currentYear]);\n })\n .attr(\"cy\", function (d) {\n return y(d.data.females_aged_15plus_employment_rate_percent[currentYear]);\n })\n .attr(\"r\", function (d) {\n //greater than 100mil\n if (d.data.population_total[currentYear] > 100000000) {\n return z(circleXL);\n }\n //greater than 10mill & less then 100mil\n else if (d.data.population_total[currentYear] > 10000000 && d.data.population_total[currentYear] < 100000000) {\n return z(circleL);\n }\n else {\n return z(circleM);\n }\n })\n .text(function (d) { return d.name })\n .style(\"fill\", function (d) {\n //if females work percetage is greater than males return red color\n if (d.data.females_aged_15plus_employment_rate_percent[currentYear] >= 50 && d.data.males_aged_15plus_employment_rate_percent[currentYear] < 50) {\n return \"pink\";\n }\n //if male work percetage is greater than females return blue color\n else if (d.data.females_aged_15plus_employment_rate_percent[currentYear] < 50 && d.data.males_aged_15plus_employment_rate_percent[currentYear] >= 50) {\n return \"blue\";\n }\n // both females and male have percentage is over 50\n else if (d.data.females_aged_15plus_employment_rate_percent[currentYear] >= 50 && d.data.males_aged_15plus_employment_rate_percent[currentYear] >= 50) {\n return \"orange\";\n }\n // both females and males work percentage is less than 50\n else if (d.data.females_aged_15plus_employment_rate_percent[currentYear] < 50 && d.data.males_aged_15plus_employment_rate_percent[currentYear] < 50) {\n return \"red\";\n }\n\n })\n .style(\"opacity\", \"0.7\")\n .attr(\"stroke\", \"black\");\n\n svg.select(\"#yearBGText\")\n .transition()\n .duration(1000)\n .text(currentYear);\n }\n }", "title": "" }, { "docid": "507016184fab56e0067c2792d32e8caf", "score": "0.52307534", "text": "function populateFutureTimeline() {\n // Same as with the past timeline\n\n let dataPoint = document.querySelector(\"#future-data-point\");\n let parentContainer = document.querySelector(\"#future-parent-container\");\n\n let startingYear = futureYearsArray[0];\n parseInt(startingYear);\n\n for (let i = 1; i < futureYearsArray.length; i++) {\n let currentYear = futureYearsArray[i];\n parseInt(currentYear);\n\n let yDistance = (currentYear - startingYear) * 240 + 2450;\n\n yFutureDataPointsArray.push(yDistance);\n\n let cloneDP = dataPoint.cloneNode(true);\n cloneDP\n .querySelector(\".outer-circle\")\n .setAttribute(\"transform\", `matrix(1,0,0,1,918.5,${yDistance})`);\n cloneDP\n .querySelector(\".inner-circle\")\n .setAttribute(\"transform\", `matrix(1,0,0,1,918.5,${yDistance})`);\n parentContainer.appendChild(cloneDP);\n }\n\n createYearsTimeline();\n}", "title": "" }, { "docid": "8904b4599c31f236742c4140861b29fb", "score": "0.5226998", "text": "function TeamProgress(type, s, z) {\n\n switch (type) {\n case \"Improved\":\n var x0 = data.sort(function(a, b) {\n return d3.ascending(a[s] - a[z], b[s] - b[z]);\n })\n .filter(function(d) {\n return (d[s] - d[z]) > 0\n })\n .map(function(d) {\n return d.team;\n });\n break;\n case \"Deteriorated\":\n var x0 = data.sort(function(a, b) {\n return d3.ascending(a[s] - a[z], b[s] - b[z]);\n })\n .filter(function(d) {\n return (d[s] - d[z]) < 0\n })\n .map(function(d) {\n return d.team;\n });\n break;\n case \"RemainedSame\":\n var x0 = data.sort(function(a, b) {\n return d3.ascending(a[s] - a[z], b[s] - b[z]);\n })\n .filter(function(d) {\n return (d[s] - d[z]) == 0\n })\n .map(function(d) {\n return d.team;\n });\n }\n\n // Populate the return array with the teams for each case \"Improved\",\"Deteriorated\" and \"RemainSame\" \n var retArray = [];\n var i;\n for (i = 0; i < x0.length; i++) {\n retArray.push(x0[i]);\n }\n return retArray;\n }", "title": "" }, { "docid": "554758b766ea0d3e9b78481ca409bb0a", "score": "0.5226899", "text": "function updateCollatedDonations(year){//year determines which tab is updated\n var update=function(year){\n var collateddonations=year==\"alltime\"?basicfunctions.getCollatedDonations(dashboarddata.donations,dashboarddata.recurringdonations,dashboarddata.defaultcurrency,{\"cap\":new Date(fixeddata.endyear+1,dashboarddata.yearstartmonth,dashboarddata.yearstartdate).addDays(-1)}):basicfunctions.getCollatedDonations(dashboarddata.donations,dashboarddata.recurringdonations,dashboarddata.defaultcurrency,{\"start\":new Date(year,dashboarddata.yearstartmonth,dashboarddata.yearstartdate),\"end\":new Date(year+1,dashboarddata.yearstartmonth,dashboarddata.yearstartdate)});\n if(collateddonations.length>0){\n $(\"#\"+year+\"collateddonations\").show();\n $(\"#\"+year+\"collateddonationsheader\").show();\n if(visualizationLoaded){\n var data=google.visualization.arrayToDataTable([[\"Charity\",\"Donation\"]].concat(collateddonations));\n var formatter=new google.visualization.NumberFormat(typeof(fixeddata.currencysymbol[dashboarddata.defaultcurrency])==\"undefined\"?{\"suffix\": \" \"+dashboarddata.defaultcurrency}:{\"prefix\":fixeddata.currencysymbol[dashboarddata.defaultcurrency]});\n formatter.format(data,1);\n var options={\n \"pieSliceText\":\"value\"\n };\n var chart=new google.visualization.PieChart(document.getElementById(year+\"collateddonations\"));\n chart.draw(data,options);\n }\n }\n else{\n $(\"#\"+year+\"collateddonations\").hide();\n $(\"#\"+year+\"collateddonationsheader\").hide();\n }\n };\n if(typeof(year)==\"undefined\"){\n for(var i=-1;i<fixeddata.endyear-fixeddata.startyear+1;i++){\n var year=i==-1?\"alltime\":(fixeddata.startyear+i);\n update(year);\n }\n }\n else{\n if(year!=\"alltime\"){\n year=year*1;\n }\n update(year);\n }\n }", "title": "" }, { "docid": "24e21d191df21ce24cab7faa761222ec", "score": "0.52249825", "text": "function draw_kg_per_year(data) {\r\n var jsonObj = []\r\n\r\n // Adapt data to NVD3.js format\r\n for (wastetype in data)\r\n {\r\n var tempjson = {};\r\n tempjson['key'] = wastetype;\r\n tempjson['values'] = [];\r\n for (year in data[wastetype])\r\n tempjson['values'].push([parseInt(year), parseInt(data[wastetype][year])]);\r\n tempjson['color'] = getContainerColor(wastetype);\r\n jsonObj.push(tempjson);\r\n }\r\n\r\n // Draw MultiBar chart\r\n nv.addGraph(function() {\r\n var chart = nv.models.multiBarChart()\r\n .x(function(d) { return d[0] })\r\n .y(function(d) { return d[1] })\r\n .clipEdge(true);\r\n\r\n chart.xAxis\r\n .tickFormat(function(d) {\r\n var date = new Date();\r\n date.setYear(parseInt(d));\r\n return d3.time.format('%Y')(date)\r\n });\r\n //.tickFormat(d3.format('.f'));\r\n\r\n chart.yAxis\r\n .tickFormat(function(d) { return d3.format(',f')(d) + ' kg' });\r\n\r\n d3.select('#kg_per_year svg')\r\n .datum(jsonObj)\r\n .transition().duration(500).call(chart);\r\n\r\n nv.utils.windowResize(chart.update);\r\n\r\n chart.legend.dispatch.on('legendClick.updateExamples', function() {\r\n setTimeout(function() {\r\n for (var i = 0; i < chartlist.length; i++)\r\n //alert(chartlist[i]);\r\n chartlist[i].update();\r\n }, 100);\r\n });\r\n\r\n chartlist.push(chart);\r\n\r\n return chart;\r\n });\r\n}", "title": "" }, { "docid": "cb63b010ef319de124cd5e4553d5302b", "score": "0.5220843", "text": "function updateChart() {\n\t\n\t\tqueue()\n\t\t\t.defer(d3.json, \"soccerviz.json\")\n\t\t\t.await(ready_fill);\n\n\t\tfunction ready_fill(error, data) {\n\t\t\tif (error) return console.error(error);\n\t\t\t\n\t\t\t//Find appearances by country per team per year\n\t\t\tvar i = 0;\n\t\t\tvar found = 0;\n\t\t\tvar roster = team_data.roster;\n\t\t\t\n\t\t\t// while(i < data.leagues.length && found == 0){\n\t\t\t// \tif (data.leagues[i].id_league === league){\n\t\t\t// \t\tvar j = 0;\n\t\t\t// \t\twhile (j < data.leagues[i].seasons.length && found == 0){\n\t\t\t// \t\t\tif (data.leagues[i].seasons[j].season == year){\n\t\t\t// \t\t\t\tvar k = 0;\n\t\t\t// \t\t\t\twhile (k < data.leagues[i].seasons[j].teams.length && found == 0){\n\t\t\t// \t\t\t\t\tif (data.leagues[i].seasons[j].teams[k].id_team == team){\n\t\t\t// \t\t\t\t\t\tfound = 1;\n\t\t\t// \t\t\t\t\t\troster = data.leagues[i].seasons[j].teams[k].roster\n\t\t\t// \t\t\t\t\t}\n\t\t\t// \t\t\t\tk = k + 1;\n\t\t\t// \t\t\t\t}\n\t\t\t// \t\t\t}\n\t\t\t// \t\tj = j + 1;\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// \ti = i + 1;\n\t\t\t// }\n\t\t\t\n\t\t\tvar appearancesTotal = d3.nest()\n\t\t\t\t.key(function(d) { return d.nation_ISO_code; })\n\t\t\t\t.rollup(function(v) { return {\n\t\t\t\t\tvalue: d3.sum(v, function(d) { return d.appearances; })\n\t\t\t\t}; })\n\t\t\t\t.map(roster);\n\t\t\t\n\t\t\t//Define Color Scale\n\t\t\tvar quantize = d3.scale.quantile()\n .domain(d3.extent(d3.values(appearancesTotal), function (d) { return d.value; }))\n .range(d3.range(9)),\n cb = \"YlOrRd\";\n\n\t\t\t//Fill\n\t\t\tfunction fill(datum, index) {\n var iso = datum.id,\n\t\t\t\t\tval = appearancesTotal[iso] && appearancesTotal[iso].value;\n if (val) {\n var c = colorbrewer[cb][9][quantize(val)];\n return c;\n } else {\n return \"lightgray\";\n }\n\t\t\t}\n\t\t\t\n\t\t\tmap_svg.selectAll(\"path\")\n\t\t\t\t.on(\"mouseover\", function(d) {\n\t\t\t\t\td3.select(this).transition().duration(300).style(\"opacity\", 1);\n\t\t\t\t\tdiv.transition().duration(300)\n\t\t\t\t\t.style(\"opacity\", 1)\n\t\t\t\t\t.style(\"left\", (d3.event.pageX) + \"px\")\n\t\t\t\t\t.style(\"top\", (d3.event.pageY +30) + \"px\")\n\t\t\t\t\tif (appearancesTotal[d.id]) { div.text(appearancesTotal[d.id].value + \" appearances from \" + d.properties.name) }\n\t\t\t\t\telse { div.text(\"0 appearances from \" + d.properties.name) };\n\t\t\t\t\t\n\t\t\t\t})\n\t\t\t\t.on(\"mouseout\", function() {\n\t\t\t\t\td3.select(this)\n\t\t\t\t\t.transition().duration(300)\n\t\t\t\t\t.style(\"opacity\", 0.8);\n\t\t\t\t\tdiv.transition().duration(300)\n\t\t\t\t\t.style(\"opacity\", 0);\n\t\t\t\t});\n\t\t\t\n\t\t\tmap_svg.selectAll(\".namer-country\")\n\t\t\t\t.style(\"fill\", fill);\n\t\t\tmap_svg.selectAll(\".camer-country\")\n\t\t\t\t.style(\"fill\", fill);\n\t\t\tmap_svg.selectAll(\".samer-country\")\n\t\t\t\t.style(\"fill\", fill);\n\t\t\tmap_svg.selectAll(\".carib-country\")\n\t\t\t\t.style(\"fill\", fill);\n\t\t\tmap_svg.selectAll(\".west-eu-country\")\n\t\t\t\t.style(\"fill\", fill);\n\t\t\tmap_svg.selectAll(\".east-eu-country\")\n\t\t\t\t.style(\"fill\", fill);\t\n\t\t\tmap_svg.selectAll(\".mid-east-country\")\n\t\t\t\t.style(\"fill\", fill);\t\t\n\t\t\tmap_svg.selectAll(\".east-asia-country\")\n\t\t\t\t.style(\"fill\", fill);\t\t\t\n\t\t\tmap_svg.selectAll(\".se-asia-country\")\n\t\t\t\t.style(\"fill\", fill);\t\t\t\t\n\t\t\tmap_svg.selectAll(\".south-asia-country\")\n\t\t\t\t.style(\"fill\", fill);\t\t\t\t\n\t\t\tmap_svg.selectAll(\".africa-country\")\n\t\t\t\t.style(\"fill\", fill);\t\t\t\t\n\t\t\tmap_svg.selectAll(\".oceania-country\")\n\t\t\t\t.style(\"fill\", fill);\t\t\t\t\n\t\t\tmap_svg.selectAll(\".cent-asia-country\")\n\t\t\t\t.style(\"fill\", fill);\t\n\t\t\t\t\n\t\t\t// console.log(roster)\n\t\t\t\t\n\t\t\t//Table\n\t\t\t//This needs work. Data isn't clearing and updating correctly\n\t\t\t// var tr = tbody.selectAll(\"tr\")\n\t\t\t// \t.data(roster);\n\t\t\t\n\t\t\t// tr.enter().append('tr');\n\t\t\t\n\t\t\t// tr.exit().remove();\n\t\t\t\t\n\t\t\t// var td = tr.selectAll('td')\n\t\t\t// \t.data(function(d) { return [d.name, d.position, d.appearances, d.nation_name]; });\n\t\t\t// td.enter().append('td')\n\t\t\t// \t.text(function(d) { return d; });\n\t\t\t\t\n\t\t\t// td.exit().remove();\n\t\t\t\n\t\t\t\n\t\t};\n\t}", "title": "" }, { "docid": "58fe0875d2ed2c136955189d224c19df", "score": "0.52184236", "text": "function drawProductivityProcrastination(activityArray) {\n google.charts.load('current', {'packages':['corechart']});\n google.charts.setOnLoadCallback(drawChart);\n\n function drawChart() {\n var data = new google.visualization.DataTable();\n \n data.addColumn('string','Date');\n data.addColumn('number', 'Productivity');\n data.addColumn('number', 'Procrastination');\n data.addRows(3);\n \n var currentDate = new Date();\n \n var firstDate = new Date(currentDate.getTime() - 79500000);\n var secondDate = new Date(currentDate.getTime() - 67500000);\n var thirdDate = new Date(currentDate.getTime() - 42500000);\n \n console.log(firstDate);\n data.setCell(0, 0, firstDate.toString());\n data.setCell(0, 1, 200);\n data.setCell(0, 2, 300);\n \n data.setCell(1, 0, secondDate.toString());\n data.setCell(1, 1, 748);\n data.setCell(1, 2, 120);\n \n data.setCell(2, 0, thirdDate.toString());\n data.setCell(2, 1, 500);\n data.setCell(2, 2, 987);\n\n var options = {\n title: 'Eternal Battle for All of Us',\n hAxis: {title: 'Date', titleTextStyle: {color: '#333'}},\n vAxis: {minValue: 0}\n };\n\n var chart = new google.visualization.AreaChart(document.getElementById('productivity'));\n chart.draw(data, options);\n }\n}", "title": "" }, { "docid": "36d927763e81ac5ab61b587d53168e14", "score": "0.5215078", "text": "function Timeline(paper, datesAndVersions) {\n if ( !(this instanceof arguments.callee) ) {\n return new arguments.callee(arguments);\n }\n\n this.paper = paper;\n this.datesAndVersions = datesAndVersions;\n\n this.parseDates = function () {\n var parsedDatesAndVersions = [],\n i = 0,\n obj,\n dateParts,\n parsedDate;\n for (i = 0; i < this.datesAndVersions.length; i++) {\n obj = this.datesAndVersions[i];\n dateParts = obj.date.split(/\\//);\n parsedDate = new Date();\n parsedDate.setFullYear(parseInt(dateParts[2], 10),\n parseInt(dateParts[0], 10) - 1,\n parseInt(dateParts[1], 10));\n parsedDatesAndVersions.push({date: parsedDate, version: obj.version});\n }\n this.datesAndVersions = parsedDatesAndVersions;\n };\n\n this.draw = function () {\n var radius = 26,\n timeRange,\n graphWidth = this.paper.width - radius * 2 - 2,\n startTime, endTime,\n i = 0,\n obj,\n dot,\n label,\n xOffset;\n\n startTime = this.datesAndVersions[0].date.getTime();\n endTime = this.datesAndVersions[this.datesAndVersions.length - 1].date.getTime();\n timeRange = endTime - startTime;\n\n // Versions with dot\n this.plotArray(this.datesAndVersions,\n this.drawDotAndLabel,\n graphWidth,\n startTime,\n timeRange,\n radius);\n\n // Years\n this.plotArray([\n {date: (new Date(2005, 0, 1)), version: \"2005\"},\n {date: (new Date(2006, 0, 1)), version: \"2006\"},\n {date: (new Date(2007, 0, 1)), version: \"2007\"},\n {date: (new Date(2008, 0, 1)), version: \"2008\"},\n {date: (new Date(2009, 0, 1)), version: \"2009\"},\n {date: (new Date(2010, 0, 1)), version: \"2010\"},\n {date: (new Date(2011, 0, 1)), version: \"2011\"},\n {date: (new Date(2012, 0, 1)), version: \"2012\"},\n {date: (new Date(2013, 0, 1)), version: \"2013\"},\n {date: (new Date(2014, 0, 1)), version: \"2014\"},\n {date: (new Date(2015, 0, 1)), version: \"2015\"},\n {date: (new Date(2016, 0, 1)), version: \"2016\"},\n ], this.drawYear, graphWidth, startTime, timeRange, radius);\n };\n\n this.plotArray = function (theArray, aDrawingCallback, graphWidth, startTime, timeRange, radius) {\n var i = 0,\n obj,\n xOffset;\n for (i = 0; i < theArray.length; i++) {\n obj = theArray[i];\n xOffset = graphWidth * ((obj.date.getTime() - startTime) / timeRange) + radius;\n aDrawingCallback(obj, xOffset, radius);\n };\n }\n\n this.drawDotAndLabel = function (obj, xOffset, radius) {\n var dot, label, yOffset, xSeries, ySeries;\n xSeries = obj.version.match(/^\\d/);\n ySeries = obj.version.match(/^\\d\\.\\d/) - xSeries;\n yOffset = 20 + radius + xSeries * 60;\n if(xSeries > 0) {\n\t yOffset += ySeries * 250;\n }\n\n dot = paper.circle(xOffset, yOffset, radius - 6);\n dot.attr({\n \"stroke-width\": 0,\n fill: \"#cccccc\",\n \"fill-opacity\": 1.0\n });\n if (obj.version.match(/^\\d\\.\\d\\.0/)) {\n dot.attr({ fill: \"#732F2F\", r: radius });\n }\n\n label = paper.text(xOffset, yOffset, obj.version);\n label.attr({\n fill: \"#ffffff\",\n \"font-size\": 20,\n \"font-family\": \"'League Gothic', 'Futura-CondensedMedium', 'Gill Sans MT Condensed', 'Arial Narrow', sans-serif\"\n });\n };\n\n this.drawYear = function (obj, xOffset, radius) {\n var label;\n label = paper.text(xOffset, 10, obj.version);\n label.attr({\n fill: \"#000000\",\n \"fill-opacity\": 0.5,\n \"font-size\": 10,\n \"font-family\": \"sans-serif\"\n });\n };\n\n this.parseDates();\n this.draw();\n}", "title": "" }, { "docid": "76908dd81cbe12e26e9c4f737898e8a9", "score": "0.52103907", "text": "function drawChart23() {\r\n\tvar data = google.visualization.arrayToDataTable([\r\n\t\t['Teams', 'Times Won'],\r\n\t\t['Player\\'s Team', 0],\r\n\t\t['Other Teams', 16]\r\n\t]);\r\n\t\r\n\tvar options = {\r\n\t\ttitle: 'Charles Barkley\\'s Championships vs. Years Played',\r\n\t\tbackgroundColor:'transparent',\r\n\t\ttitleTextStyle:{color: '#990000', fontName: 'Arial', fontSize: 15, bold:true, italic:false},\r\n\t\tis3D: true,\r\n\t\tlegend:{textStyle:{color: '#990000', fontName: 'Arial', fontSize: 10, bold:true, italic:false}},\r\n\t\tpieSliceText: 'percentage',\r\n\t\tslices: { 1: {offset: 0.2},\r\n\t\t\t2: {offset: 0.2},\r\n\t\t},\r\n\t};\r\n\t\r\n\tvar chart = new google.visualization.PieChart(document.getElementById('piechart_3d20'));\r\n\tchart.draw(data, options);\r\n}", "title": "" }, { "docid": "4654f7727f910e1d0cd6350057a3ab67", "score": "0.5209273", "text": "function plotFoundingTimeline(data, yMax){\n \n showBaseLayer()\n var yMax = 1;\n data.forEach(d => {\n var row = Object.values(d);\n row.shift() // remove first item\n var rowSum = row.reduce((a,b) => a+b)\n if(rowSum > yMax){yMax = rowSum}\n })\n\n // set axis titles\n setXAxisTitle('Year')\n setYAxisTitle('Companies Founded')\n\n // set axes\n // new y axis\n y.domain([0,yMax*1.1]).nice()\n svg.select(\".yAxis\")\n .transition()\n .duration(1000)\n .call(d3.axisLeft(y).ticks(5));\n \n // new x axis\n x.domain([2000,2020]).nice()\n svg.select(\".xAxis\")\n .transition()\n .duration(1000)\n .call(d3.axisBottom(x)\n .tickValues([2000,2005,2010,2015,2020])\n .tickFormat(d => d.toFixed(0)));\n\n // show axes\n fadeIn('.axis');\n \n var keys = Object.keys(data[0]);\n keys.shift() // remove first item, qtr variable\n\n var stacked = d3.stack()\n .keys(keys)\n (data)\n \n var areaGen = d3.area()\n .x(d => x(d.data.qtr))\n .y0(d => y(d[0]))\n .y1(d => y(d[1]))\n\n const color = d3.scaleOrdinal()\n .range([\"#03045e\",\"#0077b6\",\"#00b4d8\",\"#90e0ef\",\"#caf0f8\"]);\n\n // add data to svg\n svg.append('g')\n .attr('id', 'cityLines')\n .attr('z-index', 95)\n .style('opacity', 0)\n .selectAll('.cityLines')\n .data(stacked)\n .enter()\n .append('path')\n .classed('.cityLines', 'true')\n .attr('d', d => areaGen(d))\n .attr('fill', d => color(d.key))\n .on('mouseover', (event, d) => mouseoverArea(event, d))\n .on('mousemove', mousemoveArea)\n .on('mouseleave', mouseleaveMap)\n .on('click', clickFoundingTimeline)\n\n svg.selectAll('#cityLines')\n .transition()\n .duration(500)\n .style('opacity', 1)\n .delay(600)\n}", "title": "" }, { "docid": "4654f7727f910e1d0cd6350057a3ab67", "score": "0.5209273", "text": "function plotFoundingTimeline(data, yMax){\n \n showBaseLayer()\n var yMax = 1;\n data.forEach(d => {\n var row = Object.values(d);\n row.shift() // remove first item\n var rowSum = row.reduce((a,b) => a+b)\n if(rowSum > yMax){yMax = rowSum}\n })\n\n // set axis titles\n setXAxisTitle('Year')\n setYAxisTitle('Companies Founded')\n\n // set axes\n // new y axis\n y.domain([0,yMax*1.1]).nice()\n svg.select(\".yAxis\")\n .transition()\n .duration(1000)\n .call(d3.axisLeft(y).ticks(5));\n \n // new x axis\n x.domain([2000,2020]).nice()\n svg.select(\".xAxis\")\n .transition()\n .duration(1000)\n .call(d3.axisBottom(x)\n .tickValues([2000,2005,2010,2015,2020])\n .tickFormat(d => d.toFixed(0)));\n\n // show axes\n fadeIn('.axis');\n \n var keys = Object.keys(data[0]);\n keys.shift() // remove first item, qtr variable\n\n var stacked = d3.stack()\n .keys(keys)\n (data)\n \n var areaGen = d3.area()\n .x(d => x(d.data.qtr))\n .y0(d => y(d[0]))\n .y1(d => y(d[1]))\n\n const color = d3.scaleOrdinal()\n .range([\"#03045e\",\"#0077b6\",\"#00b4d8\",\"#90e0ef\",\"#caf0f8\"]);\n\n // add data to svg\n svg.append('g')\n .attr('id', 'cityLines')\n .attr('z-index', 95)\n .style('opacity', 0)\n .selectAll('.cityLines')\n .data(stacked)\n .enter()\n .append('path')\n .classed('.cityLines', 'true')\n .attr('d', d => areaGen(d))\n .attr('fill', d => color(d.key))\n .on('mouseover', (event, d) => mouseoverArea(event, d))\n .on('mousemove', mousemoveArea)\n .on('mouseleave', mouseleaveMap)\n .on('click', clickFoundingTimeline)\n\n svg.selectAll('#cityLines')\n .transition()\n .duration(500)\n .style('opacity', 1)\n .delay(600)\n}", "title": "" }, { "docid": "a8df94ca9895725008a467f537d8d80e", "score": "0.5205131", "text": "function calcActRev(actArray){\n if(actArray.length > 0){\n actArray.forEach(function (x) {\n //Count activity only if conservee\n if(x.conservee && x.conservee == \"true\"){\n d.activitiestot ++;\n }\n //Revenue sum for conservee activities\n if(x.conservee == \"true\"){\n if(x.remuneration && x.remuneration.montant.montant){\n //If the revenue only has 1 entry the data structure is a bit different\n if(x.remuneration.montant.montant.annee && x.remuneration.montant.montant.annee == currentYear){\n d.revenuetot += Number(x.remuneration.montant.montant.montant);\n } else if(x.remuneration.montant.montant.length > 0){\n //If there are more entries, loop through revenue entries, 1 entry per year; pick the current year entry\n x.remuneration.montant.montant.forEach(function (y) {\n if(y.annee == currentYear){\n d.revenuetot += Number(y.montant);\n }\n });\n }\n }\n //Revenue sum average\n var thisacttot = 0;\n var thisactyears = 0;\n if(x.remuneration && x.remuneration.montant.montant){\n //If the revenue only has 1 entry the data structure is a bit different\n if(x.remuneration.montant.montant.annee){\n d.revenuetotAvg += Number(x.remuneration.montant.montant.montant);\n } else if(x.remuneration.montant.montant.length > 0){\n //If there are more entries, loop through revenue entries, 1 entry per year; sum the revenues and divide by years amount\n x.remuneration.montant.montant.forEach(function (y) {\n thisacttot += Number(y.montant);\n thisactyears ++;\n });\n }\n }\n if(thisactyears > 0){\n d.revenuetotAvg += Number(thisacttot)/Number(thisactyears);\n //.toFixed(2)\n }\n }\n //If any is kept, set activcons to OUI\n if(x.conservee && x.conservee == \"true\"){\n d.activcons = \"OUI\";\n }\n });\n }\n }", "title": "" }, { "docid": "7f8254cec9cfac426351935e70967c76", "score": "0.51937765", "text": "function teamStatsGraphs(leagueTable, teamNumber) {\n\n if (typeof myPieChart[teamNumber] !== \"undefined\") {\n myPieChart[teamNumber].destroy();\n }\n\n var target = \"games-chart-\" + teamNumber;\n var games_chart = document.getElementById(target).getContext('2d');\n myPieChart[teamNumber] = new Chart(games_chart, {\n type: 'pie',\n data: {\n labels: ['Won', 'Drawn', 'Lost'],\n datasets: [{\n label: 'Number of Games',\n data: [leagueTable.won, leagueTable.draw, leagueTable.lost],\n backgroundColor: [\n 'rgba(255, 99, 132, 0.7)',\n 'rgba(54, 162, 235, 0.7)',\n 'rgba(255, 206, 86, 0.7)'\n ]\n }]\n },\n options: {\n cutoutpercentage: 0,\n responsive: true,\n maintainAsepctRatio: true,\n title: {\n display: true,\n text: '' +leagueTable.team.name+ '',\n fontSize: 14,\n },\n legend: {\n fullWidth: false,\n position: 'right',\n labels: {\n fontSize: 14,\n }\n }\n }\n});\n\n}", "title": "" }, { "docid": "4ba9b3882313239330124b5a6005024a", "score": "0.51927143", "text": "function analyze (error, data) {\n\tif (error) { console.log(error); }\n //console.log(data)\n xScale.domain([d3.min(data, xValue)-1, 150]);\n yScale.domain([d3.min(data, yValue)-1, 45]);\n\n // x-axis\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"x\", width)\n .attr(\"y\", -6)\n .style(\"text-anchor\", \"end\")\n .text(\"Years Competing\");\n\n // y-axis\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Championships\");\n\n // draw dots\n var circle = svg.selectAll(\".dot\")\n .data(data)\n .enter().append(\"circle\")\n .attr(\"class\", \"dot\")\n .attr(\"r\", function(d){ return radius(d)})\n .attr(\"cx\", xMap)\n .attr(\"cy\", yMap)\n .style(\"fill\", function(d) { return color(colValue(d));})\n // Assign ID for interactive legend\n .attr(\"id\", function (d) {return 'tag' + d.sport.replace(/\\s+/g, '')})\n .on('mouseover',function(d){tip.show(d); mouseOver (d) })\n .on('mouseout', tip.hide);\n \n circle.append(\"text\")\n .attr(\"dy\",\".3em\")\n .style(\"text-anchor\", \"middle\")\n .text(function(d) { return d.rank; });\n\n //when hovered update next charts\n function mouseOver(d) {\n d3.select(\".line\")\n .datum(d)\n .attr(\"id\", function(d) {\n return d.team\n });\n //change and remove when hovered\n for( var i = 0; i < data.length; i++ ) {\n if (d.team == data[i].team){\n var tempData = data[i];\n d3.select(\"#newline2\").remove();\n d3.select(\"#newline\").remove();\n lineGraph(tempData);\n forcechart(tempData);\n console.log(tempData);\n }\n }\n }\n\n // draw legend\n var legend = svg.selectAll(\".legend\")\n .data(color.domain())\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\n\n // draw legend colored rectangles\n legend.append(\"rect\")\n .attr(\"x\", width - 18)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", color)\n .on(\"click\", function(d) {\n var active = d.active ? false : true,\n newOpacity = active ? 0 : 1;\n d3.selectAll(\"#tag\" + d.replace(/\\s +/g, ''))\n .transition().duration(100)\n .style(\"opacity\", newOpacity);\n console.log(active);\n d.active = active;\n console.log(active)\n });\n\n // draw legend text\n legend.append(\"text\")\n .attr(\"x\", width - 24)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d;});\n}", "title": "" }, { "docid": "a5d13472e2bda4c3c85176229e42009d", "score": "0.51919883", "text": "function daydataGraphing() {\n daydata = new google.visualization.DataTable();\n daydata.addColumn(\"string\", \"X\");\n daydata.addColumn(\"number\", \"Kabelrummet\");\n daydata.addColumn(\"number\", \"Kafeterian\");\n daydata.addColumn(\"number\", \"Pingisrummet\");\n daydata.addColumn(\"number\", \"Personalrummet\");\n daydata.addColumn(\"number\", \"Tekniklabbet\");\n\n console.log(\"-----------------------------------------------------\");\n for (const i in long) {\n let keys = Object.keys(long[i]);\n //gets which is the current hour\n dateAmount = 0;\n if (keys.length > dateAmount) {\n dateAmount = keys.length;\n hours = keys;\n }\n if (keys.length > currDate.getHours()) {\n dateAmount = currDate.getHours(); //getHours returns hour value from 0-23\n }\n }\n //puts the hour values that has not passed at the right location of the horizontal axis(for exampel if the current hour is 22 then the first x label will be 23 as that hour has not accured yet during the day and then the labels will follow from 0 to 22)\n for (var j = 23; j > dateAmount; j--) {\n daydata.addRows([\n [\n hours[j],\n long[\"rum1\"][hours[j]][\"temp\"],\n long[\"rum2\"][hours[j]][\"temp\"],\n long[\"rum3\"][hours[j]][\"temp\"],\n long[\"rum4\"][hours[j]][\"temp\"],\n long[\"rum5\"][hours[j]][\"temp\"],\n ],\n ]);\n }\n for (var k = 0; k <= dateAmount; k++) {\n daydata.addRows([\n [\n hours[k],\n long[\"rum1\"][hours[k]][\"temp\"],\n long[\"rum2\"][hours[k]][\"temp\"],\n long[\"rum3\"][hours[k]][\"temp\"],\n long[\"rum4\"][hours[k]][\"temp\"],\n long[\"rum5\"][hours[k]][\"temp\"],\n ],\n ]);\n }\n\n options = {\n curveType: grafCurveType,\n\n chartArea: {\n left: \"8%\",\n right: \"8%\",\n width: \"100%\",\n },\n hAxis: {\n title: \"Hour\",\n },\n vAxis: {\n title: \"Temperature\",\n },\n legend: {\n position: \"bottom\", //sets chart position\n },\n backgroundColor: {\n fill: \"transparent\",\n },\n };\n\n drawnow();\n console.log(hours);\n}", "title": "" }, { "docid": "3063619cd2b42bf675230077adfc851f", "score": "0.5190195", "text": "function publictypechange() {\n var data = google.visualization.arrayToDataTable([\n ['Type', '2005', '2015', {role: 'annotation'}, {role: 'style'}],\n [\"International\", 0, 17.8, \"17.8%\", \"color: #55B748\"],\n [\"Higher Education\", 0, 13.2, \"13.2%\", \"color: #55B748\"],\n [\"Envionment and animals\", 0, 12.8, \"12.8%\", \"color: #55B748\"],\n [\"Religion related\", 0, 8.2, \"8.2%\", \"color: #55B748\"],\n [\"Human Services\", 0, 4.4, \"4.4%\", \"color: #55B748\"],\n [\"All public charities\", 0, 0.6, \"0.6%\", \"color: #1696d2\"],\n [\"Hospitals/primary care\", 0, -0.5, \"-0.5%\", \"color: #DB2B27\"],\n [\"Other public and social benefit\", 0, -2.4, \"-2.4%\", \"color: #DB2B27\"],\n [\"Education\", 0, -3.3, \"-3.3%\", \"color: #DB2B27\"],\n [\"Other Education\", 0, -4, \"-4%\", \"color: #DB2B27\"],\n [\"Health\", 0, -4.9, \"-4.9%\", \"color: #DB2B27\"],\n [\"Other health care\", 0, -5.9, \"-5.9%\", \"color: #DB2B27\"],\n [\"Arts\", 0, -9.7, \"-9.7%\", \"color: #DB2B27\"]\n ]);\n \n var options = {\n title:'Change in Number of Reporting Publich Charities from 2005 to 2015',\n titlePosition: 'none',\n titleTextStyle: {fontSize: 20, color: '#062635'},\n legend: {position: \"none\"},\n chartArea:{left: 250, right: 20, bottom: 75, width:\"100%\",height:\"80%\"},\n bar: {groupWidth: \"100%\"},\n annotations: {alwaysOutside: true, stemColor: 'none'},\n backgroundColor: { fill:'transparent' },\n fontName: 'Karla', \n fontSize: '16',\n hAxis: {title: \"% Change in Number of Organizations from 2005-2010\"}\n };\n \n var chart = new google.visualization.BarChart(document.getElementById('six'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "27c41a7798cce69c5e2220957b5c07f9", "score": "0.5180462", "text": "function updateChart(year) {\n\t \tlabel_b.text(Math.round(year)); /*update year label, since year could be a fraction of years, round it to the whole year number*/\n\t \tcircleGroup\n\t /*bind new data interpolated from the dataset based on the tween year, and use key to match up with existing bound data*/\n\t \t\t.data(interpolateData(year),key) \n\t \t\t.attr(\"r\", data=>radiusScale_b(data.population))\n\t \t\t.attr(\"cx\", data=>xScale_b(data.crimeRate))\n\t \t\t.attr(\"cy\", data=>yScale_b(data.unemploymentRate))\n\t \t\t.attr(\"opacity\",.8)\n\t \t\t.style(\"fill\", data=>colorScale_b(data.category))\n\t \t\t.sort(order)\n\t }", "title": "" }, { "docid": "d453594c424389366cae70af982ceb59", "score": "0.51797545", "text": "function setData(index) {\n svg2.selectAll(\"*\").remove();\n title.selectAll(\"*\").remove();\n let countRef2 = svg2.append(\"g\");\n\n d3.csv(\"data/football.csv\").then(function(data) {\n var teamRecords = {}\n for (var ii = 0; ii < data.length; ii++) {\n if (data[ii]['tournament'] != \"Friendly\" && (index == 0 || 1999 < parseInt(data[ii]['date'].substring(0,4)))){\n var home_team = data[ii]['home_team']\n var away_team = data[ii]['away_team']\n home_score = data[ii]['home_score']\n away_score = data[ii]['away_score']\n if (data[ii]['home_score'] > data[ii]['away_score']){\n var home_score = 1;\n var away_score = 0;\n } else if (data[ii]['home_score'] < data[ii]['away_score']){\n var home_score = 0;\n var away_score = 1;\n } else {\n var home_score = 0.5;\n var away_score = 0.5;\n }\n if (home_team in teamRecords){\n teamRecords[home_team].push(home_score);\n } else{\n teamRecords[home_team] = [home_score];\n }\n if (away_team in teamRecords){\n teamRecords[away_team].push(away_score);\n } else{\n teamRecords[away_team] = [away_score];\n }\n }\n }\n\n for (var team in teamRecords){\n if (teamRecords[team].length > 100){\n teamRecords[team] = teamRecords[team].reduce((x,y)=>x+y,0) / teamRecords[team].length\n } else {\n delete teamRecords[team]\n }\n }\n\n teamRecords = Object.keys(teamRecords).map((team)=>[team, teamRecords[team]]);\n teamRecords.sort((team1,team2)=>team2[1] - team1[1])\n teamRecords = teamRecords.slice(0,10)\n\n let y = d3.scaleBand()\n .domain(teamRecords.map(function(d) {return d[0]}))\n .range([0, graph_2_height])\n .padding(0.1);\n\n let x = d3.scaleLinear()\n .domain([.5, .8])\n .range([margin.left, graph_2_width - margin.right]);\n\n let bars = svg2.selectAll(\"rect\").data(teamRecords);\n\n let color = d3.scaleOrdinal()\n .domain(teamRecords.map(function(d) { return d[1] }))\n .range(d3.quantize(d3.interpolateHcl(\"#66a0e2\", \"#81c2c3\"), 10));\n\n bars.enter()\n .append(\"rect\")\n .merge(bars)\n .attr(\"fill\", function(d) { return color(d[0]) })\n .attr(\"y\", function(d) { return y(d[0]); })\n .attr(\"x\", x(0.5))\n .attr(\"width\", function(d) {return x(d[1]) - margin.left; })\n .attr(\"height\", y.bandwidth());\n\n svg2.append(\"g\")\n .call(d3.axisBottom(x).tickSize(0).tickPadding(10))\n .attr(\"transform\", `translate(0, ${graph_1_height})`) ;\n\n svg2.append(\"g\")\n .call(d3.axisLeft(y).tickSize(0).tickPadding(10))\n .attr(\"transform\", `translate(${(margin.left)}, 0)`) ;\n\n let counts = countRef2.selectAll(\"text\").data(teamRecords);\n\n // TODO: Render the text elements on the DOM\n counts.enter()\n .append(\"text\")\n .merge(counts)\n .attr(\"x\", function(d) {return x(d[1]) + 5; })\n .attr(\"y\", function(d) { return y(d[0]) + y.bandwidth()/2 + 5; })\n .style(\"text-anchor\", \"start\")\n .text( function(d) {return d[1].toFixed(3); });\n\n svg2.append(\"text\")\n .attr(\"transform\", `translate(${(graph_1_width) / 2},\n ${(graph_1_height) + 35})`)\n .style(\"text-anchor\", \"middle\")\n .text(\"Win percentage\");\n\n svg2.append(\"text\")\n .attr(\"transform\", `translate(${(graph_1_width) / 2},\n ${(graph_1_height) + 50})`)\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", 10)\n .text(\"*Tournament win percentage determined by excluding friendlies from consideration, as \\\n these matches are often not very compaetitive and/or played by a nations B-team. Additionally, \\\n teams that\");\n\n svg2.append(\"text\")\n .attr(\"transform\", `translate(${(graph_1_width) / 2},\n ${(graph_1_height) + 60})`)\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", 10)\n .text(\"have played fewer than 100 matches are filtered out to remove controvesial (eg. North Korea) and very small (eg, Jersey) teams. \");\n\n if(index == 0){\n title.append(\"text\")\n .attr(\"transform\", `translate(${(graph_1_width) / 2}, 25)`)\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", 18)\n .text(\"Tournament Win percentage of top ten nations (All Time)*\");\n } else {\n title.append(\"text\")\n .attr(\"transform\", `translate(${(graph_1_width) / 2}, 25)`)\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", 18)\n .text(\"Tournament Win percentage of top ten nations (Since 2000)*\");\n }\n });\n}", "title": "" }, { "docid": "d83d9223a9dcb008006b00099129aa96", "score": "0.51794004", "text": "function drawLineChart() {\n let experienceData = placementData.filter( d => d.workex == 'Yes');\n var Expcount= Object.keys(experienceData).length;\n //console.log(Expcount)\n let placedwexpData=experienceData.filter( d => d.status == 'Placed');\n //console.log(placedwexpData)\n var PlacedWithExpcount= Object.keys(placedwexpData).length;\n //console.log(PlacedWithExpcount)\n let notexperienceData = placementData.filter( d => d.workex == 'No');\n var noExpcount= Object.keys(notexperienceData).length;\n //console.log(noExpcount)\n let woexpData=notexperienceData.filter( d => d.status == 'Placed');\n var PlacedWithoutExpcount= Object.keys(woexpData).length;\n //console.log(PlacedWithoutExpcount)\n// console.log(woexpData)\n \nvar ratioofexperienceplaced=(PlacedWithExpcount/Expcount)*100;\nconsole.log(ratioofexperienceplaced);\nvar ratioofNonexperienceplaced=(PlacedWithoutExpcount/noExpcount)*100;\nconsole.log(ratioofNonexperienceplaced);\n//var data2=[ratioofexperienceplaced,ratioofNonexperienceplaced]\nvar data2=[{x:'YES',y:ratioofexperienceplaced},{x:'NO',y:ratioofNonexperienceplaced}]\n\n\n var svg = d3.select(\"#right\")\n \n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin.left + \",\" + margin.top + \")\");\n \n var x = d3.scaleBand()\n .range([ 0, 400 ])\n .domain(data2.map(function(d) { return d.x; }))\n .padding(0.1);\n svg.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 var y = d3.scaleLinear()\n .domain([0, 100])\n .range([ height, 0]);\n svg.append(\"g\")\n .call(d3.axisLeft(y));\n\n // Bars\n svg.selectAll(\"mybar\")\n .data(data2)\n .enter()\n .append(\"rect\")\n .attr(\"x\", function(d) { return x(d.x); })\n .attr(\"y\", function(d) { return y(d.y); })\n .attr(\"width\", 50)\n .attr(\"transform\", \"translate(60,0)\")\n .attr(\"height\", function(d) { return height - y(d.y); })\n .attr(\"fill\", function(d, i) { \n \n let val = d.x;\n if (val == \"YES\") {\n return \"green\";\n } else {\n return \"red\";\n } \n \n } \n \n \n )\n \n svg.append(\"text\")\n \n .attr(\"transform\",\n \"translate(\" + (width /1.5) + \" ,\" +\n ( height + margin.top+20) + \")\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Work Experience(YES/NO)\")\n \n svg\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", -60)\n .attr(\"x\", 0 - (height /2))\n .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Percentage of people got placed\")\n ;\n \n \n svg.append(\"text\")\n \n .attr(\"transform\",\n \"translate(\" + (200 ) + \" ,\" +\n ( height + margin.top+80) + \")\")\n .style(\"text-anchor\", \"middle\")\n .style(\"text-decoration\", \"underline\")\n .style(\"font-style\",\"italic\")\n .style(\"font-size\",\"10px\")\n .style(\"font-weight\", \"bold\")\n .text(\"Caption:\");\n svg.append(\"text\")\n \n .attr(\"transform\",\n \"translate(\" + (200 ) + \" ,\" +\n ( height + margin.top+100) + \")\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-style\",\"italic\")\n .style(\"font-size\",\"10px\")\n .text(\"Experience Matters and experienced people got placements more.\");\n \n svg.append(\"text\")\n .attr(\"transform\",\n \"translate(\" + (240 ) + \" ,\" +\n ( margin.top) + \")\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\",\"14px\")\n .style(\"font-weight\", \"bold\")\n .style(\"font-family\",\"sans-serif\")\n .style(\"font-weight\", \"700\")\n .style(\"text-decoration\", \"underline\")\n .text(\"Placements with experience versus without experience.\")\n\n}", "title": "" }, { "docid": "cb8bc157be705cc062f3a28316713824", "score": "0.5178617", "text": "function show_highest_points(ndx) {\n var playerColors = d3.scale.ordinal()\n .domain([\"Michael Jordan\", \"Kobe Bryant\", \"Lebron James\"])\n .range([\"#e22b22bf\", \"#ffe854b5\", \"#13a3547d\"]);\n\n var eDim = ndx.dimension(dc.pluck(\"Season\"));\n var seasonDim = ndx.dimension(function(d) {\n return [new Date(Number(d.Season.slice(0, -3)), 0, 1), Number(d.PTS), (d.Player)];\n\n })\n var seasonPlayerGroup = seasonDim.group();\n var minSeason = Number(eDim.bottom(1)[0].Season.slice(0, -3));\n var maxSeason = Number(eDim.top(1)[0].Season.slice(0, -3));\n\n dc.scatterPlot(\"#highest-points-per-season\")\n .width(900)\n .height(400)\n .x(d3.time.scale().domain([new Date(minSeason, 0, 1), new Date(maxSeason, 0, 1)]))\n .brushOn(false)\n .symbolSize(8)\n .clipPadding(10)\n .xAxisLabel(\"Season\")\n .yAxisLabel(\"Points\")\n .title(function(d) {\n return d.key[2] + ': ' + d.key[1] + ' Points';\n })\n\n .colorAccessor(function(d) {\n return d.key[2];\n })\n .colors(playerColors)\n .dimension(seasonDim)\n .group(seasonPlayerGroup)\n .margins({ top: 15, right: 40, bottom: 75, left: 120 })\n .on(\"pretransition\", function(chart) {\n chart.selectAll(\"g.y text\")\n .style(\"font-size\", \"12px\");\n chart.selectAll(\"g.x text\")\n .style(\"font-size\", \"12px\");\n chart.selectAll(\".dc-chart text\")\n .attr(\"fill\", \"#E5E5E5\");\n chart.selectAll(\".dc-legend-item text\")\n .attr(\"font-size\", \"15px\")\n .attr(\"fill\", \"white\");\n chart.selectAll(\"line\")\n .style(\"stroke\", \"#E5E5E5\");\n chart.selectAll(\".domain\")\n .style(\"stroke\", \"#E5E5E5\");\n chart.selectAll(\".line\")\n .style(\"stroke-width\", \"2.5\");\n });\n \n}", "title": "" }, { "docid": "7ccfecb29a212046785f20b39867500d", "score": "0.5177486", "text": "function update() {\n y.domain(0, Math.min(100, pv.max(pv.values(pv.nest(jobs.filter(test))\n .key(function(d) { return d.year} )\n .rollup(function(v) { return pv.sum(v, function(d) { return d.percent} )} )))));\n vis.render();\n }", "title": "" }, { "docid": "5065aa9350ba1a37ba72d433eb99dee3", "score": "0.5176957", "text": "function drawChart(group, type) {\n if (!chart) chart = new google.visualization.LineChart(document.getElementById('groupChart'));\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'X');\n\n var groupToShow = gameGroup[group];\n\n for (var i = 0; i < gameGroup[group].users.length; i++) {\n data.addColumn('number', gameGroup[group].users[i].role.name);\n }\n\n for (var i = 1; i < gameGroup[group].week; i++) {\n var dataRow = [i.toString()];\n for (var j = 0; j < gameGroup[group].users.length; j++) {\n var numToPush = 0;\n switch (type) {\n case \"Cost\":\n numToPush = gameGroup[group].users[j].costHistory[i];\n vAxisTitle = \"Cost ($)\";\n break;\n case \"Inventory\":\n numToPush = parseInt(gameGroup[group].users[j].inventoryHistory[i]) - parseInt(gameGroup[group].users[j].backlogHistory[i]);\n vAxisTitle = \"Inventory (units)\";\n break;\n case \"Orders\":\n numToPush = gameGroup[group].users[j].orderHistory[i];\n vAxisTitle = \"Orders (units)\";\n break;\n default:\n }\n\n dataRow.push(numToPush);\n }\n data.addRows([dataRow]);\n }\n\n var vAxisTitle = \"\";\n var chartTitle = \"Group \" + parseInt(parseInt(group) + 1);\n switch (type) {\n case \"Cost\":\n vAxisTitle = \"Cost ($)\";\n break;\n case \"Inventory\":\n vAxisTitle = \"Inventory (units)\";\n break;\n case \"Orders\":\n vAxisTitle = \"Orders (units)\";\n break;\n default:\n }\n\n var options = {\n hAxis: {\n title: 'Week #'\n },\n vAxis: {\n title: vAxisTitle\n },\n series: {\n 1: { curveType: 'function' }\n },\n 'legend': 'bottom',\n 'title': chartTitle,\n 'width': 675,\n 'height': 250\n };\n\n chart.draw(data, options);\n}", "title": "" }, { "docid": "5377aeebd771e595e5b69bad6ecaf8f4", "score": "0.5173109", "text": "function LineChart(data){\n //Variables\n var margin = {top: 40, right: -10, bottom:5, left: 130},\n width = 630 - margin.left - margin.right,\n height = 450 - margin.top - margin.bottom;\n\n //Transform year to date format\n var parseTime = d3.timeParse(\"%Y\")\n data.forEach(function (d) {\n d.year = parseTime(d.year);});\n\n var commas = d3.format(\",\");\n \n //Pallete for lines, depending of each case status\n var color = d3.scaleOrdinal()\n .range([\"#000000\",\"green\", \"#DD98D6\", \"red\", \"#08B2B2\"])\n data.forEach(function (d) {\n color.domain(keys(d).filter(function(key) {return key !== \"year\"}))});\n \n //Function to create a new dataset with key/values\n var case_s = color.domain().map(function(id) {\n return {\n id: id,\n values: data.map(function(d) {\n return {year: d.year, petitions: d[id], id: id};})};});\n \n //x, y Axis Scale. X is based on a ScaleTime (Years) and Y is based on the Total Petitions\n const y = d3.scaleLinear().range([height - margin.bottom, margin.top]).domain([0,120000]);\n var xExtent = d3.extent(data, d => d.year);\n const x = d3.scaleTime().range([margin.left, width - margin.right]).domain(xExtent);\n\n //Define the SVG alocation and size\n var svg = d3.select(\"#figure0\").append(\"svg\")\n .attr(\"width\", 800)\n .attr(\"height\", 500)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\")\n \n //x, y Axis alocating in the svg figure\n var xAxis = g => g\n .attr(\"transform\", `translate(0,${height - margin.bottom})`)\n .call(d3.axisBottom(x).ticks(width / 80).tickSizeOuter(0).tickFormat((d3.timeFormat(\"%Y\"))))\n\n var yAxis = g => g\n .attr(\"transform\", `translate(${margin.left},0)`)\n .call(d3.axisLeft(y))\n .call(g => g.select(\".domain\"))\n .call(g => g.select(\".tick:last-of-type text\").clone())\n\n svg.append(\"g\").call(xAxis);\n svg.append(\"g\").call(yAxis);\n \n //New div to allocate the tooltip\n var div = d3.select(\"#figure0\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n \n //Create and add the line to the svg, call the transition functions\n svg.selectAll(\".line\")\n .data(case_s)\n .enter()\n .append(\"path\")\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", function(d){return color(d.id)})\n .attr(\"stroke-width\", 1.5)\n .attr(\"d\", function(d){\n return d3.line()\n .x(function(d) { return x(d.year); })\n .y(function(d) { return y(d.petitions); })\n (d.values)\n }).call(transition)\n\n //Add points to the line, and assign the appropiate transition and tooltip\n var points = svg.selectAll(\"dot\")\n .data(case_s)\n .enter().append(\"g\")\n .selectAll(\"cicle\")\n .data(d => d.values)\n .enter()\n .append('circle')\n\n //Transition points\n points\n .attr(\"r\", 5)\n .attr(\"cx\", d => x(d.year))\n .attr(\"cy\", d => y(d.petitions))\n .transition()\n .duration(15000)\n .attr(\"fill\", function(d){return color(d.id)})\n .attr(\"fill-opacity\", 1)\n\n //tooltip\n points.on(\"mouseover\", function(event,d) {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div.html(function (){if(d.id == \"Total Petitions\")\n {return d.id + \" in US: \"+ commas(d.petitions)}\n {return d.id + \" petitions: \"+ commas(d.petitions)}})\n .style(\"left\", (event.pageX) + \"px\")\n .style(\"top\", (event.pageY) + \"px\")})\n .on(\"mouseout\", function(d) {\n div.transition()\n .duration(500)\n .style(\"opacity\", 0);});\n\n //Label Text for X axis\n svg.append(\"text\")\n .attr(\"class\", 'axis_a')\n .attr(\"x\", width-200) \n .attr(\"y\", 430)\n .attr(\"text-anchor\", \"middle\") \n .text(\"Year\");\n\n //Label for Y axis\n svg.append(\"text\")\n .attr(\"class\", 'axis_a')\n .attr(\"text-anchor\", \"middle\")\n .attr(\"transform\", \"rotate(90)\")\n .attr('x', 180)\n .attr(\"y\", -60)\n .text(\"Number of Petitions\");\n \n //Label for Title\n svg.append(\"text\")\n .attr(\"x\", 210) \n .attr(\"y\", -10)\n .attr(\"text-anchor\", \"middle\") \n .style(\"font-size\", \"20px\") \n .attr(\"font-weight\", 550)\n .text(\"Total PERM petitions evolution by year and status\");\n\n //Label for Sub-Title\n svg.append(\"text\")\n .attr(\"x\", 210) \n .attr(\"y\", 10)\n .attr(\"text-anchor\", \"middle\")\n .style(\"fill\", \"red\")\n .style(\"font-size\", \"12px\") \n .attr(\"font-weight\", 550)\n .text(\"Hover the points to get more details!\");\n\n //Legends\n //Title of my Leyend\n svg.append(\"text\")\n .attr(\"id\", 'legend')\n .attr(\"x\", -40) \n .attr(\"y\", 120)\n .attr(\"text-anchor\", \"middle\") \n .text(\"Case Status\");\n\n //legend size and spacing\n var legendRectSize = 15;\n var legendSpacing = 7;\n var legend = svg.selectAll('.legend') //the legend and placement\n .data(color.domain())\n .enter()\n .append('g')\n .attr('class', 'circle-legend')\n .attr('transform', function (d, i) {\n var height = legendRectSize + legendSpacing;\n var offset = height * color.domain().length / 2;\n var horz = -4 * legendRectSize - 13;\n var vert = i * height - offset;\n return 'translate(' + horz + ',' + vert + ')';\n });\n\n //Legend lines\n legend.append(\"rect\")\n .attr(\"width\", 10).attr(\"height\", 0.8)\n .style('fill', color)\n .style('stroke', color)\n .attr('x', -10)\n .attr('y', 195)\n \n //Legend text\n legend.append('text')\n .attr('x', 10)\n .attr('y', 200)\n .text(function (d) {\n return d;\n });\n\n //Functions to call the transition on the lines\n function transition(path) {\n path.transition()\n .duration(10000)\n .attrTween(\"stroke-dasharray\", Dash)\n .on(\"end\", () => { d3.select(this).call(transition); });\n }\n function Dash() {\n const l = this.getTotalLength(),\n i = d3.interpolateString(\"0,\" + l, l + \",\" + l);\n return function(t) { return i(t) };\n }\n}", "title": "" }, { "docid": "7f3f94fe099d657ab829c059eb1369b5", "score": "0.51664776", "text": "function buildChartJS(chartValues, prj, iterations) {\n \n var iterationNames = Object.keys(chartValues); //iterationNames = Object.keys(chartValues).filter( function(name){ return chartValues[name].start <= new Date(); });\n\n var maxPlanned = iterationNames.map(function(e) {\n return chartValues[e].c_planned;\n }).max();\n\n\n if (maxPlanned <= 0) {\n $(\"#myChart\").hide();\n $(\"#noData\").show();\n $(\"#velocityTrend\").hide();\n }\n else {\n var options = {\n title: {\n display: true,\n text: 'Enhanced Release Burn Up\\nfor ' + prj.Description + ' (' + prj._refObjectName + ')',\n fontSize: 16\n },\n scales: {\n yAxes: [{\n scaleLabel: {\n display: true,\n labelString: 'Story Points'\n }\n }],\n xAxes: [{\n scaleLabel: {\n display: true,\n labelString: 'Iteration'\n }\n }]\n },\n maintainAspectRatio: false,\n layout: {padding: 10},\n hover: {mode: 'x'},\n tooltips: {mode: 'x'},\n elements:{ point: { radius: 0} } // hide points\n };\n\n var data = {\n labels: iterationNames,\n datasets: [{\n label: 'Accepted',\n data: iterationNames.map(function(e) {return chartValues[e].c_accepted;}),\n startAtZero: true,\n borderColor: '#3465AA',\n backgroundColor: '#3465AA'\n }, {\n label: \"Scope\",\n type: 'line',\n cubicInterpolationMode: 'default',\n fill: false,\n lineTension: 0,\n borderWidth: 1,\n data: iterationNames.map(function(e) {return chartValues[e].c_planned;}),\n borderDash: [5, 3],\n borderColor: 'orange', //'#E8D7AB',\n backgroundColor: 'orange', //'#E8D7AB',\n pointBorderColor: 'orange', //'#E8D7AB',\n pointBackgroundColor: 'orange' //'#E8D7AB'\n\n } \n ]\n };\n \n var currentProj = (iterationNames.map(function(e){ return chartValues[e]; } ).filter(function(v){ return v.end >= new Date() }).length) > 0;\n \n console.log( 'current proj = ' + currentProj );\n \n // only add projections if its still a current project\n if( currentProj )\n data.datasets.push({\n label: 'Projected',\n data: extrapolateBurnup(chartValues, iterations, maxPlanned),\n type: 'line',\n startAtZero: true,\n fill: false,\n lineTension: 0,\n borderWidth: 1,\n borderDash: [5, 3],\n borderColor: 'black',\n backgroundColor: 'black',\n pointBorderColor: 'black',\n pointBackgroundColor: 'black'\n });\n\n\n var ctx = $(\"#myChart\");\n ctx.show();\n $(\"#noData\").hide();\n $(\"#velocityTrend\").show();\n\n if (chart) chart.destroy();\n\n chart = new Chart(ctx, {\n type: 'bar',\n data: data,\n options: options\n });\n }\n }", "title": "" }, { "docid": "55c61dc1719b91256bd5d826ef8ccea8", "score": "0.51599765", "text": "function make_plot4(csv_data) {\n var country_data1 = csv_data.filter(d => d.country == \"Urban China\");\n\n\n var mortality_data = country_data1.map(d => Number(d.mortality))\n var min_mortality = Math.min(...mortality_data)\n var max_mortality = Math.max(...mortality_data)\n\n var regression_data = country_data1.map(d => [stretch(d.year, 1990, 2019, 0, 1),\n stretch(d.mortality, min_mortality, max_mortality, 0, 1)])\n\n var regression_result = regression.polynomial(regression_data, { order: 3 });\n\n var extension_x = [];\n var extension_y = [];\n for (var year = 2019; year < 2031; year++) {\n var prediction = regression_result.predict(stretch(year, 1990, 2019, 0, 1))[1]\n\n extension_x.push(year);\n extension_y.push(stretch(prediction, 0, 1, min_mortality, max_mortality));\n }\n\n\n var trace1 = {\n x: country_data1.map(d => d.year),\n y: country_data1.map(d => d.mortality),\n mode: 'lines',\n name: 'Child Mortality Rate',\n line: {\n color: lineColors.blue,\n width: 4,\n }\n };\n var trace2 = {\n x: extension_x,\n y: extension_y,\n mode: 'lines',\n name: 'Prediction',\n line: {\n color: lineColors.green,\n width: 4,\n }\n };\n\n var data = [trace1, trace2]\n\n var layout = {\n title: \"Predicting Urban China's child mortaltity rate\",\n\n paper_bgcolor: \"rgb(0,0,0,000)\",\n plot_bgcolor: \"rgb(0,0,0,000)\",\n\n font: {\n size: 15,\n family: \"Helvetica, sans-serif\",\n color: \"rgb(21,36,61)\",\n },\n xaxis: {\n title: \"Years\"\n },\n yaxis: {\n title: \"Deaths per 1,000 live births\"\n },\n\n legend: {\n bgcolor: \"#ffffff\",\n },\n\n annotations: [\n {\n x: 2030,\n y: 0,\n xref: 'x',\n yref: 'y',\n text: '0 Mortaltiy Rate',\n showarrow: true,\n arrowhead: 3,\n ax: 0,\n ay: -100,\n\n font: {\n color: '#ffffff'\n },\n\n bordercolor: lineColors.blue,\n borderwidth: 2,\n borderpad: 4,\n bgcolor: lineColors.blue,\n },\n ]\n\n };\n\n Plotly.newPlot('vis7', data, layout, config);\n}", "title": "" }, { "docid": "271f6e169fd317a7e5324f9b39ef3862", "score": "0.5146986", "text": "function updateTime(layers) {\n $('.year-timeline-wrapper').show(); //console.log(yearList)\n //console.log(layers);\n //var currentLayer = {}\n\n currentTimeLayer = layers;\n var latestTime = currentTimeLayer.slice(-1);\n changeDataOnMap(latestTime[0].field_name); //var startLayer = find(currentTimeLayer, function(o) {return o.time === yearValue})\n //console.log(showLayer)\n //changeDataOnMap(showLayer.field_name);\n //console.log(currentLayer)\n\n var yearList = currentTimeLayer.map(function (x) {\n return x.time;\n });\n var year_html = ''; //$('.year-timeline').append(year_html);\n\n $('.year-timeline').empty();\n\n if (yearList.length == 1) {\n $('.year-timeline').html(\"<p class='m-0'> Data only available for \".concat(yearList, \"</p>\"));\n $('.year-timeline-wrapper').addClass('single-year-only');\n return;\n }\n\n var last_percentage = 0;\n\n for (var i = 0; i < yearList.length; i++) {\n var class_for_year = \"\";\n\n if (i == 0) {\n class_for_year = \"alpha\";\n } else if (i == yearList.length - 1) {\n class_for_year = \"omega\";\n } // \n\n\n var totalContainerWidth = $('.year-timeline').outerWidth(); // Calculating the pecetange of this block\n\n var different_first_last = yearList[yearList.length - 1] - yearList[0]; // Now calculate the distance between the current item and the next one\n\n var distance_to_next = yearList[i] - yearList[0];\n\n if (i == yearList.length - 1) {\n console.log('is omega');\n }\n\n var size_in_percentage = distance_to_next / different_first_last * 100;\n size_in_percentage = size_in_percentage.toFixed(2);\n var widthStyle = \"width: \".concat(size_in_percentage, \"%;\");\n var fromLeftPosition = 0;\n var fromLeftPixels = 0;\n var fromLeftStyle = \"\";\n\n if (i > 0 && i < yearList.length - 1) {\n fromLeftPosition = parseInt(size_in_percentage); // convert from left position to pixels\n\n fromLeftPixels = fromLeftPosition / 100 * totalContainerWidth;\n fromLeftStyle = \"left: \".concat(fromLeftPixels, \"px;\");\n } else {\n last_percentage = parseInt(size_in_percentage);\n }\n\n last_percentage = fromLeftPosition;\n year_html = \"<div _style=' \".concat(widthStyle, \"' data-width='\").concat(size_in_percentage, \"' class=\\\"year-timeline-block \").concat(class_for_year, \"\\\" data-year-idx=\\\"\").concat(i + 1, \"\\\">\\n <input type=\\\"radio\\\" name=\\\"year-selected\\\" value=\\\"\").concat(yearList[i], \"\\\" id=\\\"year-\").concat(yearList[i], \"\\\" \").concat(i == 0 ? 'checked' : '', \">\\n <label for=\\\"year-\").concat(yearList[i], \"\\\">\\n <span style='\").concat(fromLeftStyle, \"' class=\\\"label-value\\\">\").concat(yearList[i], \"</span>\\n <span style='\").concat(fromLeftStyle, \"' class=\\\"circle-radio\\\"></span>\\n </label>\\n </div>\");\n $('.year-timeline').append(year_html);\n }\n\n $('body').on('change click', 'input[name=\"year-selected\"]', function (e) {\n e.preventDefault(); //so it doesn't run twice\n\n isReachedToEnd = false;\n var yearValue = $('[name=\"year-selected\"]:checked').val();\n $('.year-timeline-block.alpha input[type=\"radio\"').prop('checked', true); //console.log('-----')\n\n console.log(yearValue);\n console.log(this);\n var check = $(this).attr('checked');\n if (check) $(this).removeAttr('checked').prop('checked', false);else $(this).attr('checked', true).prop('checked', true);\n console.log(this); //console.log(currentTimeLayer);\n\n var showLayer = (0, _lodash.default)(currentTimeLayer, function (o) {\n return o.time === yearValue;\n }); //console.log(showLayer)\n\n changeDataOnMap(showLayer.field_name); //console.log(yearValue);\n });\n}", "title": "" }, { "docid": "7ec824a5ff57e211472cb6b15252c5b9", "score": "0.51448196", "text": "function show_planet_distance_orbitalperiod_relationship(ndx) {\n var distance_dim = ndx.dimension(dc.pluck(\"distanceFromSun\"));\n var period_dim = ndx.dimension(dc.pluck(\"orbitalPeriod\"));\n var periodDim = ndx.dimension(function(d) {\n return [d.distanceFromSun, d.orbitalPeriod, d.name];\n });\n var distancePeriodGroup = periodDim.group();\n\n var planetColors = d3.scale.ordinal()\n .domain(['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune'])\n .range([\"#808080\", \"#E1D3C1\", \"#739FEE\", \"#B85B1A\", \"#FFA332\", \"#D6BFA4\", \"#E5FFF6\", \"#5077BD\"]);\n\n var maxDistance = distance_dim.top(1)[0].distanceFromSun;\n var maxPeriod = period_dim.top(1)[0].orbitalPeriod;\n\n dc.scatterPlot(\"#planetary-distance-orbitalperiod-relationship\")\n .x(d3.scale.linear().domain([0, maxDistance]))\n .y(d3.scale.linear().domain([0, maxPeriod]))\n .brushOn(false)\n .symbolSize(8)\n .clipPadding(10)\n .yAxisLabel(\"Days\")\n .xAxisLabel(\"x 10^6 km\")\n .title(function(d) {\n return d.key[2] + \" has an orbital period of \" + d.key[1] + \" days at a distance of \" + d.key[0] + \" x 10^6 km from the sun.\";\n })\n .colorAccessor(function(d) {\n return d.key[2];\n })\n .colors(planetColors)\n .dimension(periodDim)\n .group(distancePeriodGroup)\n .margins({ top: 10, right: 25, bottom: 50, left: 70 });\n }", "title": "" }, { "docid": "08150981d0bf079dbcab03d67a33a9d1", "score": "0.51413983", "text": "function drawWeekTotalChart() {\n\n\t// Create the data table for Sarah's pizza.\n\tvar data = new google.visualization.DataTable();\n\tdata.addColumn('string', 'Date');\n\tdata.addColumn('number', 'Use to Date');\n\tdata.addRows([\n\t\t['1/2/2016',26],\n\t\t['1/9/2016',92],\n\t\t['1/16/2016',172],\n\t\t['1/23/2016',267],\n\t\t['1/30/2016',335],\n\t\t['2/6/2016',422],\n\t\t['2/13/2016',537],\n\t\t['2/20/2016',633],\n\t\t['2/27/2016',716],\n\t\t['3/5/2016',804],\n\t\t['3/12/2016',909],\n\t\t['3/19/2016',974],\n\t\t['3/26/2016',1075],\n\t\t['4/2/2016',1126],\n\t\t['4/9/2016',1217],\n\t\t['4/16/2016',1328],\n\t\t['4/23/2016',1426],\n\t\t['4/30/2016',1517],\n\t\t['5/7/2016',1642],\n\t\t['5/14/2016',1725],\n\t\t['5/21/2016',1779],\n\t\t['5/28/2016',1854],\n\t\t['6/4/2016',1923],\n\t\t['6/11/2016',2020],\n\t\t['6/18/2016',2126],\n\t\t['6/25/2016',2210],\n\t\t['7/2/2016',2280],\n\t\t['7/9/2016',2386],\n\t\t['7/16/2016',2441],\n\t\t['7/23/2016',2538],\n\t\t['7/30/2016',2614],\n\t\t['8/6/2016',2674],\n\t\t['8/13/2016',2819],\n\t\t['8/20/2016',2903],\n\t\t['8/27/2016',2997],\n\t\t['9/3/2016',3115],\n\t\t['9/10/2016',3224],\n\t\t['9/17/2016',3299],\n\t\t['9/24/2016',3378],\n\t\t['10/1/2016',3460],\n\t\t['10/8/2016',3557],\n\t\t['10/15/2016',3644],\n\t\t['10/22/2016',3689],\n\t\t['10/29/2016',3801],\n\t\t['11/5/2016',3868],\n\t\t['11/12/2016',3949],\n\t\t['11/19/2016',4037],\n\t\t['11/26/2016',4118],\n\t\t['12/3/2016',4199],\n\t\t['12/10/2016',4281],\n\t\t['12/17/2016',4363],\n\t\t['12/24/2016',4465],\n\t\t['12/31/2016',4580]\n\t]);\n\n\t// Set options for Anthony's pie chart.\n\tvar options = {title:'2016 Weekly Total Water Use',\n\t\t\t\t\t\t\t\twidth:700,\n\t\t\t\t\t\t\t\theight:400,\n\t\t\t\t\t\t\t\tvAxis: {title: 'Water Use'},\n\t\t\t\t\t\t\t\tseriesType:'bars',\n\t\t\t\t\t\t\t\tseries: {1: {type: 'line'}},\n\t\t\t\t\t\t\t\tlegend: { position: 'bottom' }\n\t};\n\n\t// Instantiate and draw the chart for Sarah's pizza.\n\tvar chart = new google.visualization.ComboChart(document.getElementById('linechartweek'));\n\tchart.draw(data, options);\n}", "title": "" }, { "docid": "6468148120462be773ebf16142dfab93", "score": "0.5135415", "text": "constructor (electoralVoteChart, tileChart, votePercentageChart, electionWinners) {\n\n //Creating YearChart instance\n this.electoralVoteChart = electoralVoteChart;\n this.tileChart = tileChart;\n this.votePercentageChart = votePercentageChart;\n // the data\n this.electionWinners = electionWinners;\n \n // Initializes the svg elements required for this chart\n this.margin = {top: 10, right: 20, bottom: 30, left: 50};\n let divyearChart = d3.select(\"#year-chart\").classed(\"fullView\", true);\n\n //fetch the svg bounds\n this.svgBounds = divyearChart.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 100;\n\n //add the svg to the div\n this.svg = divyearChart.append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", this.svgHeight)\n }", "title": "" }, { "docid": "6468148120462be773ebf16142dfab93", "score": "0.5135415", "text": "constructor (electoralVoteChart, tileChart, votePercentageChart, electionWinners) {\n\n //Creating YearChart instance\n this.electoralVoteChart = electoralVoteChart;\n this.tileChart = tileChart;\n this.votePercentageChart = votePercentageChart;\n // the data\n this.electionWinners = electionWinners;\n \n // Initializes the svg elements required for this chart\n this.margin = {top: 10, right: 20, bottom: 30, left: 50};\n let divyearChart = d3.select(\"#year-chart\").classed(\"fullView\", true);\n\n //fetch the svg bounds\n this.svgBounds = divyearChart.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 100;\n\n //add the svg to the div\n this.svg = divyearChart.append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", this.svgHeight)\n }", "title": "" }, { "docid": "6468148120462be773ebf16142dfab93", "score": "0.5135415", "text": "constructor (electoralVoteChart, tileChart, votePercentageChart, electionWinners) {\n\n //Creating YearChart instance\n this.electoralVoteChart = electoralVoteChart;\n this.tileChart = tileChart;\n this.votePercentageChart = votePercentageChart;\n // the data\n this.electionWinners = electionWinners;\n \n // Initializes the svg elements required for this chart\n this.margin = {top: 10, right: 20, bottom: 30, left: 50};\n let divyearChart = d3.select(\"#year-chart\").classed(\"fullView\", true);\n\n //fetch the svg bounds\n this.svgBounds = divyearChart.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 100;\n\n //add the svg to the div\n this.svg = divyearChart.append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", this.svgHeight)\n }", "title": "" }, { "docid": "fd8f743ca6003420f7a6e2a914babce1", "score": "0.51331073", "text": "function drawChart(dataStuff1,dataStuff2,dataStuff3) {\n\n // Create the data table.\n var data1 = new google.visualization.DataTable();\n data1.addColumn('string', 'Year');\n data1.addColumn('number', 'ACH');\n data1.addColumn('number', 'BusinessLoan');\n data1.addColumn('number', 'Check');\n data1.addColumn('number', 'ConsumerLoan');\n data1.addColumn('number', 'CreditDebitCard');\n data1.addColumn('number', 'Wire');\n data1.addRows(dataStuff1);\n\n var data2 = new google.visualization.DataTable();\n data2.addColumn('string', 'Year');\n // data2.addColumn('number', 'AvoidingBSARequirement');\n // data2.addColumn('number', 'AvoidingCTRRequirement');\n data2.addColumn('number', 'ChangesName');\n data2.addColumn('number', 'ExchangesBills');\n data2.addColumn('number', 'LittleConcernForPenalites');\n data2.addColumn('number', 'SharedIdentities');\n data2.addColumn('number', 'QuestionableDocumentation');\n data2.addColumn('number', 'AvoidingDocumentationRequest');\n data2.addColumn('number', 'MultipleIdentities');\n data2.addColumn('number', 'CounterfeitInstrument');\n data2.addRows(dataStuff2);\n\n var data3 = new google.visualization.DataTable();\n data3.addColumn('string', 'Year');\n data3.addColumn('number', 'AccountTakeover');\n data3.addColumn('number', 'BriberyorGratuity');\n data3.addColumn('number', 'ElderFinancialExploitation');\n data3.addColumn('number', 'EmbezzlementOrTheft');\n data3.addColumn('number', 'Forgeries');\n data3.addColumn('number', 'IdentityTheft');\n data3.addColumn('number', 'PyramidScheme');\n data3.addColumn('number', 'TradeBasedMoneyLaundering');\n data3.addColumn('number', 'PublicPrivateCorruption');\n data3.addRows(dataStuff3);\n\n // Set chart options\n var options1 = {'title':'MSB filings by product type',\n 'width':1500,\n 'height':800,\n legend: { position: 'bottom' }\n };\n \n var options2 = {'title':'MSB filings by suspicious activity type',\n 'width':1500,\n 'height':800,\n legend: { position: 'bottom' }\n }; \n\n var options3 = {'title':'MSB filings by suspected crime',\n 'width':1500,\n 'height':800,\n legend: { position: 'bottom' }\n }; \n\n // Instantiate and draw our charts, passing in some options.\n var chart1 = new google.visualization.LineChart(document.getElementById('chart1_div'));\n chart1.draw(data1, options1);\n\n var chart2 = new google.visualization.LineChart(document.getElementById('chart2_div'));\n chart2.draw(data2, options2);\n\n var chart3 = new google.visualization.LineChart(document.getElementById('chart3_div'));\n chart3.draw(data3, options3);\n\n }", "title": "" }, { "docid": "b8df6a70cb2d96a241d4594f697a49a1", "score": "0.5125456", "text": "function generateLineGraph(dailyStats) {\r\n var dateLable = [];\r\n var totalCasesData = [];\r\n var totalActiveCasesData = [];\r\n var dailyCaseCountData = [];\r\n\r\nvar i=0;\r\n for (dayIndex in dailyStats) {\r\n var dayStats = dailyStats[dayIndex];\r\n dateLable.push(dayStats.day);\r\n totalCasesData.push(dayStats.summary.total);\r\n totalActiveCasesData.push(dayStats.summary.total - dayStats.summary.deaths - dayStats.summary.discharged);\r\n var dayCaseCount = totalCasesData[i]-totalCasesData[i-1];\r\n dayCaseCount = dayCaseCount<0?0:dayCaseCount;\r\n dailyCaseCountData.push(dayCaseCount);\r\n i++;\r\n }\r\n\r\n totalCasesData.length = dateLable.length;\r\n\r\n // //moved to other function because of state filter\r\n // //By Siddharth, hackish for computing average of last 7 days\r\n // var countI = 0;\r\n // var sum = 0;\r\n // dailyCaseCountData.slice().reverse().forEach(function(x) {\r\n // if(countI < 7) {\r\n // sum += x;\r\n // countI++;\r\n // }\r\n // })\r\n // $('#cic').html(JSON.stringify(sum));\r\n\r\n resetCanvas();\r\n var ctx = document.getElementById(\"lineChart\").getContext(\"2d\");\r\n var lineChart = new Chart(ctx, {\r\n type: 'line',\r\n data: {\r\n labels: dateLable,\r\n datasets: [{\r\n label: \"Total Cases \",\r\n data: totalCasesData,\r\n backgroundColor: ['rgba(0, 0, 0, 0.1)'],\r\n borderColor: '#20EDE9',\r\n borderWidth: 2,\r\n fill: false\r\n },\r\n {\r\n label: \"Total Active Cases\",\r\n data: totalActiveCasesData,\r\n backgroundColor: ['rgba(0, 0, 0, 0.1)'],\r\n borderColor: '#ff0078',\r\n borderWidth: 2,\r\n fill: false\r\n },\r\n {\r\n label: \"Daily Increase\",\r\n data: dailyCaseCountData,\r\n backgroundColor: ['rgba(0, 0, 0, 0.1)'],\r\n borderColor: '#ffe900',\r\n borderWidth: 2,\r\n fill: false\r\n }\r\n ]\r\n },\r\n options: {\r\n legend: {\r\n position: 'top',\r\n labels: {\r\n fontColor: graphsLabelsColor\r\n }\r\n },\r\n\r\n //cutoutPercentage: 40,\r\n responsive: true,\r\n xAxisID: \"dd\",\r\n maintainAspectRatio: false\r\n ,\r\n scales: {\r\n yAxes: [{\r\n ticks: {\r\n fontColor: graphsLabelsColor,\r\n }\r\n }],\r\n xAxes: [{\r\n ticks: {\r\n fontColor: graphsLabelsColor,\r\n }\r\n }]\r\n }\r\n }\r\n });\r\n\r\n}", "title": "" }, { "docid": "13f376c8c3d735018e4a6cf0cb33c691", "score": "0.5122065", "text": "function getExtraRunsPerTeamForYear(matches, deliveries, year) {\n let matchesYear = getMatchesOfAYear(matches, year)\n\n return deliveries.reduce((extraRuns, delivery) => {\n if (matchesYear[delivery.match_id]) {\n\n if (!extraRuns[delivery[\"bowling_team\"]]) {\n extraRuns[delivery[\"bowling_team\"]] = parseInt(delivery[\"extra_runs\"])\n }\n else {\n extraRuns[delivery[\"bowling_team\"]] += parseInt(delivery[\"extra_runs\"])\n }\n\n }\n return extraRuns\n }, {})\n}", "title": "" }, { "docid": "eba2bacd5deb4bfa3f3bac35fa301565", "score": "0.51211226", "text": "function colorRows () {\n var matchesPlayed = 0;\n for (var m = 0; m < matches.length; m++) {\n if (matches[m].played()) {\n matchesPlayed++;\n }\n }\n for (var t = 0; t < teams.length; t++) {\n teams[t].resetGroupStatus();\n }\n try {\n if (matchesPlayed <= 2) { //If 2 or fewer games have been played, no team can have clinched or been eliminated.\n throw matchesPlayed;\n }\n if (matchesPlayed === 6) {//If all games have been played, the top 2 teams have clinched and the bottom 2 are eliminated.\n teams[0].clinch();\n teams[1].clinch();\n teams[2].eliminate();\n teams[3].eliminate();\n throw matchesPlayed;\n }\n var teamsClinched = 0;\n var teamsEliminated = 0;\n var teamsKnownStatus = 0;\n for (var t = 0; t < teams.length; t++) {\n if (teams[t].getStat(\"points\") >= 7) { //7 points clinches. (There are only 18 points up for grabs.)\n teams[t].clinch();\n teamsClinched++;\n teamsKnownStatus++;\n }\n else if (teams[t].getStat(\"played\") === 3 && teams[t].getStat(\"points\") <= 1) {\n teams[t].eliminate(); //Finishing with 2 points eliminates.\n teamsEliminated++;\n teamsKnownStatus++;\n }\n else if (teams[t].getStat(\"played\") <= 1) { //You cannot be eliminated, or clinch, after only one match.\n teams[t].isEliminated = -1;\n teams[t].hasClinched = -1;\n teamsKnownStatus++;\n }\n else if (teams[t].getStat(\"played\") === 2) {\n if (teams[t].getStat(\"points\") <= 3) {\n teams[t].hasClinched = -1; //If you've only scored 3 points through 2 matches, you haven't clinched.\t \t\t\t\t\n }\n if (teams[t].getStat(\"points\") >= 3) {\n teams[t].isEliminated = -1; //If you've scored at least 3 points through 2 matches, you aren't eliminated.\n }\n if (teams[t].isEliminated == -1 && teams[t].hasClinched == -1) {\n teamsKnownStatus++;\n }\n }\n }\n /* This is where it gets complicated. To decide the status of the remaining teams, we simulate the remaining matches.\n * To decide whether a team is eliminated, we make the sims as favorable to that team as possible and see if they can\n * finish in 1st or 2nd. To determine whether a team has clinched, we make the sims as unfavorable to that team as\n * possible and see if they can finish in 3rd or 4th. More info is in groupUtils.js.\n */\n var matchesLeft;\n for (var t = teams.length-1; t >= 0; t--) {\n if (!teams[t].knownStatus()) {\n matchesLeft = [];\n for (var m = 0; m < matches.length; m++) {\n if (!matches[m].played()) {\n if (matches[m].team1.id === teams[t].id || matches[m].team2.id === teams[t].id) {\n matchesLeft.unshift(matches[m]);\t//when we pass to helper function, we want to sim\n }\t\t\t\t\t\t\t\t\t\t//the team in question's matches first.\n else {\n matchesLeft.push(matches[m]);\n }\n }\n }\n if (teams[t].isEliminated !== -1 && Tournament.groupUtils.determineIfEliminated(t, matchesLeft, teams)) {\n teams[t].eliminate();\n teamsEliminated++;\n }\n else if (teams[t].hasClinched !== -1 && Tournament.groupUtils.determineIfClinched(t, matchesLeft, teams)) {\n teams[t].clinch();\n teamsClinched++;\n }\n else {\n teams[t].isEliminated = -1;\n teams[t].hasClinched = -1;\n }\n teamsKnownStatus++;\n }\n if (teamsEliminated === 2) {\n throw \"clinchRest\";\n }\n if (teamsClinched === 2) {\t\t\n throw \"eliminateRest\";\n }\n if (teamsKnownStatus === 4) {\n throw \"done\";\n }\n }\n }\n catch (e) {\n //alert(e);\n if (e === \"clinchRest\") {\t//If two teams are eliminated, the other two have clinched.\n for (var t = 0; t < teams.length; t++) {\n if (!teams[t].knownStatus()) {\n teams[t].clinch();\n }\n }\n }\n else if (e === \"eliminateRest\") {\n for (var t = 0; t < teams.length; t++) {\n if (!teams[t].knownStatus()) {\n teams[t].eliminate();\n }\n }\n }\n else if (e instanceof Error){\n alert(\"There was a problem running clinching/elimination scenarios: \"+e.message+\". Please take a screenshot and email [email protected].\");\n }\n }\n //Finally, after having decided the status of every team, color the rows.\n finally {\n for (var t = 0; t < teams.length; t++) {\n if (teams[t].hasClinched === 1) {\n $('#'+idChar+' .groupTable #row'+teams[t].id+' div').removeClass('eliminated');\n $('#'+idChar+' .groupTable #row'+teams[t].id+' div').addClass('clinched');\n }\n else if (teams[t].isEliminated === 1) {\n $('#'+idChar+' .groupTable #row'+teams[t].id+' div').removeClass('clinched');\n $('#'+idChar+' .groupTable #row'+teams[t].id+' div').addClass('eliminated');\n }\n else {\n $('#'+idChar+' .groupTable #row'+teams[t].id+' div').removeClass('clinched');\n $('#'+idChar+' .groupTable #row'+teams[t].id+' div').removeClass('eliminated');\n }\n }\n }\n }", "title": "" }, { "docid": "47a671285d01370cf161c9b2359ac025", "score": "0.51194197", "text": "function drawHeatmap(data) {\n\tconst prev = document.getElementById(\"prevYear\");\n\tconst selected = document.getElementById(\"selectedYear\");\n\tconst next = document.getElementById(\"nextYear\");\n\n Date.prototype.getWeek = function () {\n var d = new Date(\n Date.UTC(this.getFullYear(), this.getMonth(), this.getDate())\n );\n d.setUTCDate(d.getUTCDate() - d.getUTCDay());\n var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));\n return Math.ceil(((d - yearStart) / 86400000 + 1) / 7);\n };\n\n\tlet currentYear, currentWeek;\n\tif (selected.innerText == \"\") {\n\t\tcurrentYear = new Date().getFullYear();\n\t\tcurrentWeek = new Date().getWeek();\n\t\tselected.innerText = currentYear;\n\t} else {\n\t\tcurrentYear = +selected.innerText;\n\t\tcurrentWeek = 52;\n\t}\n\n const days = [[], [], [], [], [], [], []];\n Object.keys(data).forEach((elem) => {\n data[elem].dates.forEach((date) => {\n if (date.getFullYear() != currentYear) return;\n\n const day = date.getDay();\n const week = date.getWeek();\n\n if (week > currentWeek) return;\n\n if (!days[day][week]) days[day][week] = 0;\n days[day][week]++;\n });\n });\n\n for (let i = 0; i < days.length; i++) {\n for (let j = 0; j < days[i].length; j++) {\n if (!days[i][j]) days[i][j] = 0;\n }\n }\n\n const ctx = document.getElementById(\"heatMap\");\n const chart = new ApexCharts(ctx, {\n chart: {\n type: \"heatmap\",\n foreColor: \"#fff\",\n background: \"#141414\",\n },\n theme: {\n mode: \"dark\",\n },\n series: [\n {\n name: \"Saturday\",\n data: days[6],\n },\n {\n name: \"Friday\",\n data: days[5],\n },\n {\n name: \"Thursday\",\n data: days[4],\n },\n {\n name: \"Wednesday\",\n data: days[3],\n },\n {\n name: \"Tuesday\",\n data: days[2],\n },\n {\n name: \"Monday\",\n data: days[1],\n },\n {\n name: \"Sunday\",\n data: days[0],\n },\n ],\n plotOptions: {\n heatmap: {\n colorScale: {\n ranges: [\n {\n from: 0,\n to: 5,\n color: \"#00a100\",\n name: \"low\",\n },\n {\n from: 6,\n to: 10,\n color: \"#128fd9\",\n name: \"medium\",\n },\n {\n from: 10,\n to: 20,\n color: \"#ffb200\",\n name: \"high\",\n },\n {\n from: 21,\n to: 100,\n color: \"#ff5100\",\n name: \"very high\",\n },\n {\n from: 101,\n to: 1000,\n color: \"#e50914\",\n name: \"wtf\",\n },\n ],\n },\n },\n },\n });\n chart.render();\n\n\tprev.onclick = () => {\n\t\tselected.innerText = +selected.innerText - 1;\n\t\tchart.destroy();\n\t\tdrawHeatmap(data);\n\t}\n\n\tnext.onclick = () => {\n\t\tselected.innerText = +selected.innerText + 1;\n\t\tchart.destroy();\n\t\tdrawHeatmap(data);\n\t}\n\n}", "title": "" }, { "docid": "45c38146a852d7f019dfdfb13f738130", "score": "0.5117903", "text": "function country_participants(team_name,i) {\nvar stat = d3.csv(\"data/olympics_2012.csv\", function(data){\n\t\n\tteam_name_tmp = team_name.split(',');\n\tteam_name = team_name_tmp[0];\n\t\n data.forEach(function(d,i){\n if(d.team == team_name) {\n var latlon = d.born_lat_lon.split(',');\n var bornloc = d.born_location.split(', ');\n if(bornloc[bornloc.length - 1] == team_name) {\n if(!isNaN(latlon[1]) && !isNaN(latlon[0])) { addLine(latlon[1],latlon[0],\"#228B22\",i); }\n } else { \n if(!isNaN(latlon[1]) && !isNaN(latlon[0])) { addLine(latlon[1],latlon[0],\"#DC143C\",i); }\n }\n }\n });\n});\n}", "title": "" }, { "docid": "4eeb543aa69cc16f08c096bc50c4e79e", "score": "0.5117284", "text": "function plotCycles(data) {\n \"use strict\";\n d3.selectAll(\".chart1\").selectAll(\"svg\").remove();\n var loans = data;\n // Set margins\n var margin = {\n top: 30,\n right: 0, \n bottom: 20, \n left: 60\n },\n chart_width = \"100%\",\n chart_height = 250,\n width = \"90%\",\n height = chart_height - margin.top - margin.bottom,\n xlegend1 = 220,\n xlegend2 = xlegend1 + 15,\n xlegend3 = xlegend2 + 40,\n xlegend4 = xlegend3 + 15;\n // add svg\n var svg0 = dimple.newSvg(\".chart1\", chart_width, chart_height);\n svg0.append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",20)\")\n .append(\"text\")\n .attr(\"class\", \"dataviztext-sm\")\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .style(\"text-anchor\", \"left\")\n .text(\"NUMBER OF LOANS (IN THOUSANDS)\");\n svg0.append(\"g\")\n .attr(\"transform\", \"translate(\" + xlegend1 + \",12)\")\n .append(\"rect\")\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n .style(\"fill\", \"#dedede\")\n svg0.append(\"g\")\n .attr(\"transform\", \"translate(\" + xlegend2 + \",20)\")\n .append(\"text\")\n .attr(\"class\", \"dataviztext-sm\")\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .text(\"REPAID\");\n svg0.append(\"g\")\n .attr(\"transform\", \"translate(\" + xlegend3 + \",12)\")\n .append(\"rect\")\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n .style(\"fill\", \"#ee7272\")\n svg0.append(\"g\")\n .attr(\"transform\", \"translate(\" + xlegend4 + \",20)\")\n .append(\"text\")\n .attr(\"class\", \"dataviztext-sm\")\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .text(\"DEFAULTED\");\n // add chart\n var rateChart = new dimple.chart(svg0, loans);\n rateChart.setBounds(margin.left, margin.top, width, height);\n rateChart.defaultColors = [\n new dimple.color(\"#dedede\", \"#dedede\", 1), // light gray \n new dimple.color(\"#ee7272\", \"#ee7272\", 1), // salmon\n ];\n var x = rateChart.addCategoryAxis(\"x\", [\"customer\", \"period\"]); \n x.addGroupOrderRule(\"period\");\n x.addOrderRule([\"New customers\", \"Repeat customers\"]);\n var y1 = rateChart.addMeasureAxis(\"y\", \"loans\");\n var s1 = rateChart.addSeries([\"customer\", \"status\"], dimple.plot.bar, [x, y1]);\n s1.aggregate = dimple.aggregateMethod.sum;\n s1.barGap = 0.2;\n s1.getTooltipText = function(e) {\n return [\"Loan cycle: \" + e.xField[1],\n \"Number of \" + e.aggField[1] + \" loans: \" + (e.aggField[1] === \"Defaulted\" ? d3.format(\",.0f\")(e.yValue) : d3.format(\",.0f\")(e.cy)),\n (e.aggField[1] === \"Defaulted\" && e.cx === \"New customers\") ? (\"New customer default rate: \" + d3.format(\".1%\")(e.yValue/e.cy)) : (e.aggField[1] === \"Defaulted\" && e.cx === \"Repeat customers\") ? (\"Repeat customer default rate: \" + d3.format(\".1%\")(e.yValue/e.cy)) : null ];\n }\n rateChart.staggerDraw = true;\n rateChart.draw(500);\n x.titleShape.remove();\n y1.titleShape.remove(); \n y1.gridlineShapes.selectAll(\"line\").attr(\"stroke-dasharray\", \"2,2\");\n}", "title": "" }, { "docid": "691aee7901b3ce820c271f924f2c99f1", "score": "0.5116573", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label2.text(Math.round(year));\n }", "title": "" }, { "docid": "c7a6a2534851005ee7ef702e3dac0623", "score": "0.5113079", "text": "function getDataTable() {\r\n var dataTable = new google.visualization.DataTable();\r\n\r\n var chartyear = document.getElementById('yearChart').value;\r\n \r\n var rowCount = 0;\r\n var entries;\r\n var entry;\r\n\r\n dataTable.addColumn('string', 'Source');\r\n dataTable.addColumn('date', 'Date');\r\n dataTable.addColumn('number', 'Visits');\r\n dataTable.addColumn('number', 'Bounces');\r\n dataTable.addColumn('number', 'Pageviews');\r\n dataTable.addColumn('number', 'Time On Site');\r\n\r\n dataTable.addRows(totalSources * 12);\r\n\r\n for (source in mainChartData) {\r\n entries = mainChartData[source];\r\n for (var idx = 0; idx < entries.length; idx++) {\r\n entry = entries[idx];\r\n dataTable.setCell(rowCount, 0, source);\r\n dataTable.setCell(rowCount, 1, new Date(chartyear, idx, 1));\r\n dataTable.setCell(rowCount, 2, entry.getValueOf('ga:visits'));\r\n dataTable.setCell(rowCount, 3, entry.getValueOf('ga:bounces'));\r\n dataTable.setCell(rowCount, 4, entry.getValueOf('ga:pageviews'));\r\n dataTable.setCell(rowCount, 5, entry.getValueOf('ga:timeOnSite'));\r\n rowCount++;\r\n }\r\n }\r\n hideLoadingMessage();\r\n\r\n\r\n if (motionChart) {\r\n delete motionChart;\r\n }\r\n motionChart =\r\n new google.visualization.MotionChart(document.getElementById('motionChartDiv'));\r\n motionChart.draw(dataTable,\r\n {width: 800, height: 450, showSelectListComponent: 'true', showSidePanel: 'true'});\r\n delete mainChartData;\r\n mainChartData = {};\r\n}", "title": "" }, { "docid": "311f9037eb4640f244190ef761b5e752", "score": "0.51056886", "text": "function chart(selector, data) {\n console.log(makeOptiondict(data, 2015))\n let newData = createTable(data)\n let svg = d3.select(selector)\n .append('svg')\n .attr('preserveAspectRatio', 'xMidYMid meet') \n .attr('width', '100%') \n .style('background-color', '#FFFFFF') \n .attr('viewBox', [0, 0, width + margin.left + margin.right, height + margin.top + margin.bottom].join(' '))\n \n let g = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n let tooltip = d3.select(\"div.tooltip2\")\n \n //make x axis\n let x = d3.scaleBand().domain(data.map(function(d) { return d.Year; })).range([0, width]).padding(1)\n\n g.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x))\n \n //make y axis\n let y = d3.scaleLinear().range([height, 0])\n y.domain([0, getnewMax(data)])\n \n g.append(\"g\")\n .attr(\"class\", \"axis axis--y\")\n .call(d3.axisLeft(y)\n .tickFormat(function(d){\n return d;}))\n\n \n \n let columnNames = [\n 'Printing & Stationery',\n 'Accounting Charges',\n 'School Maintenance',\n 'Property Tax',\n 'Repairs & Maintenances']\n // 'Office Maintenance',\n // 'Water Charges',\n // 'Vehicle Maintenance',\n // 'Security Charges',\n // 'Festival & Celabration Exp',\n // 'Legal Fees',\n // 'Depreciation']\n\n let color = d3.scaleOrdinal()\n .domain(columnNames.concat([]))\n .range(['#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231']);\n // '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe', '#008080', '#e6beff']);\n\n // let z = color\n\n let z = color\n\n let keys = ['Printing & Stationery',\n 'Accounting Charges',\n 'School Maintenance',\n 'Property Tax',\n 'Repairs & Maintenances']\n\n var stackedData = d3.stack()\n .keys(keys)(newData)\n\n console.log(stackedData, \"stacked 000\")\n\n svg.selectAll(\"mylayers\")\n .data(stackedData)\n .enter()\n .append(\"path\")\n .attr(\"fill\", function(d) {\n console.log(z(name), \"c000\")\n name = d.key;\n return z(name)})\n .attr(\"d\", d3.area()\n .x(function(d,i) { \n console.log(d, \"checkk 000\")\n return x(d.data.year)})\n .y0(function(d) {return y(d[0])})\n .y1(function(d) {return y(d[1])})\n )\n .on(\"click\", function (d, i) {\n let expenseType = i.key\n let years = [2015, 2016, 2017, 2018, 2019]\n let result = []\n for (let x = 0; x < years.length; x++) {\n result.push({\n \"year\": years[x],\n \"type\": expenseType,\n \"amount\": i[x].data[expenseType]\n })\n }\n console.log(result)\n console.log(expenseType)\n\n d3.select(this).classed('selected')\n let dispatchString = Object.getOwnPropertyNames(dispatcher._)[0];\n console.log(dispatchString, \"ds\")\n console.log(g, \"this\")\n dispatcher.call(dispatchString, this, result);\n })\n .on(\"mouseover\", function (d, i) {\n console.log(i, \"i\")\n console.log(d, \"d\")\n tooltip.transition().delay(30).duration(200).style(\"opacity\", 1)\n // console.log(d.screenx)\n // let xp = x.invert(\"expense\")\n // let currentXPosition = d3.mouse(this);\n console.log(this, \"pos\")\n\n // console.log(d3.pointer(d, this), \"current pos\")\n\n let xp = d3.pointer(d, this)[0]\n let yp = d3.pointer(d, this)[1]\n console.log(xp, yp, \"coordinates\")\n if(xp < 240 && xp > 115) {\n tooltip.html(\"amount : \" + i[0].data[i.key] + '<br/>' + \"year : 2015\" + '<br/>' + \"type : \" + i.key).style(\"left\", d.pageX + \"px\").style(\"top\", d.pageY + \"px\")\n }\n else if(xp > 240 && xp < 360) {\n tooltip.html(\"amount : \" + i[1].data[i.key] + '<br/>' + \"year : 2016\" + '<br/>' + \"type : \" + i.key).style(\"left\", d.pageX + \"px\").style(\"top\", d.pageY + \"px\")\n }\n else if(xp > 360 && xp < 480) {\n tooltip.html(\"amount : \" + i[2].data[i.key] + '<br/>' + \"year : 2017\" + '<br/>' + \"type : \" + i.key).style(\"left\", d.pageX + \"px\").style(\"top\", d.pageY + \"px\")\n }\n else if(xp > 480 && xp < 600) {\n tooltip.html(\"amount : \" + i[3].data[i.key] + '<br/>' + \"year : 2018\" + '<br/>' + \"type : \" + i.key).style(\"left\", d.pageX + \"px\").style(\"top\", d.pageY + \"px\")\n }\n })\n .on(\"mouseout\", function (d) {\n tooltip.transition().duration(100).style(\"opacity\", 0)\n // return tooltip.style(\"visibility\", \"hidden\");\n })\n \n \n // Appending the Y axis label for the bar chart.\n svg.append(\"text\")\n .attr(\"x\", -((height / 2) + margin.top))\n .attr(\"y\", (margin.top / 3) - 40) \n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"text-anchor\" ,\"middle\")\n .text(\"Amount in Indian Rupees\")\n \n //Appending the X axis label for the bar chart.\n svg.append(\"text\")\n .attr(\"x\", width / 2 + margin.top)\n .attr(\"y\", margin.bottom)\n .attr(\"text-anchor\" ,\"middle\")\n .text(\"Expenditure per year by Category\")\n\n svg.append(\"text\")\n .attr(\"x\", width / 2 + margin.top)\n .attr(\"y\", height + 100)\n .attr(\"text-anchor\" ,\"middle\")\n .text(\"Academic Year\")\n \n var legendClassArray = [];\n \n var legend = svg.selectAll(\".legend\")\n .data(color.domain().slice().reverse())\n .enter().append(\"g\")\n .attr(\"class\", function (d) {\n legendClassArray.push(d.replace(/\\s/g, ''));\n return \"legend\";\n })\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\n \n legendClassArray = legendClassArray.reverse();\n \n legend.append(\"rect\")\n .attr(\"x\", width - 18)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", color)\n .attr(\"id\", function (d, i) {\n return \"id\" + d.replace(/\\s/g, '');\n })\n \n legend.append(\"text\")\n .attr(\"x\", width - 24)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d; });\n\n let options = [\n 'Printing & Stationery',\n 'Accounting Charges',\n 'School Maintenance',\n 'Property Tax',\n 'Repairs & Maintenances',\n 'Office Maintenance',\n 'Water Charges',\n 'Vehicle Maintenance',\n 'Security Charges',\n 'Festival & Celabration Exp',\n 'Legal Fees',\n 'Depreciation',\n 'Electricity Charges',\n 'Property Tax',\n 'Travelling Exp',\n 'Telephone exp',]\n\n let filter = d3.select(\"#Efilter\").on(\"change\", change)\n\n filter\n .selectAll(\"option\")\n .data(options)\n .enter()\n .append(\"option\")\n .attr(\"value\", function(d) {return d;})\n .text(function(d) {return d})\n\n \n // document.multiselect('#Efilter');\n\n // d3.select(\"#Efilter\")\n // .selectAll(\"option\")\n // .filter(function (d, i) { \n // return d.selected; \n // });\n\n let newoptions = []\n\n // let rarea = d3.selectAll(\"this\").selectAll(\"path\")\n\n function change() {\n console.log(\"hey sup\")\n for (var option of d3.select('#Efilter').property(\"selectedOptions\")){\n newoptions.push(option.value)\n }\n\n console.log(newoptions, \"newo\")\n if(newoptions.length > 0) {\n console.log(d3.selectAll(\"path\"),\"what\")\n svg.remove();\n\n let svg1 = d3.select(selector)\n .append('svg')\n .attr('preserveAspectRatio', 'xMidYMid meet') \n .attr('width', '100%') \n .style('background-color', '#FFFFFF') \n .attr('viewBox', [0, 0, width + margin.left + margin.right, height + margin.top + margin.bottom].join(' '))\n \n let g = svg1.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n let tooltip = d3.select(\"div.tooltip2\")\n \n //make x axis\n let x = d3.scaleBand().domain(data.map(function(d) { return d.Year; })).range([0, width]).padding(1)\n\n g.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x))\n \n //make y axis\n let y = d3.scaleLinear().range([height, 0])\n y.domain([0, getnewMax(data)])\n \n g.append(\"g\")\n .attr(\"class\", \"axis axis--y\")\n .call(d3.axisLeft(y)\n .tickFormat(function(d){\n return d;}))\n\n \n \n let columnNames = newoptions\n\n let color = d3.scaleOrdinal()\n .domain(columnNames.concat([]))\n .range(['#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231']);\n // '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe', '#008080', '#e6beff']);\n\n // let z = color\n\n let z = color\n\n let keys = newoptions\n\n var stackedData = d3.stack()\n .keys(keys)(newData)\n\n console.log(newData ,\"basic\")\n\n console.log(stackedData, \"stacked 111\")\n\n svg1.selectAll(\"mylayers\")\n .data(stackedData)\n .enter()\n .append(\"path\")\n .attr(\"fill\", function(d) {\n console.log(z(name), \"c11\")\n name = d.key;\n return z(name)})\n .attr(\"d\", d3.area()\n .x(function(d,i) { \n console.log(d, \"checkk 1\")\n return x(d.data.year)})\n .y0(function(d) {return y(d[0])})\n .y1(function(d) {return y(d[1])})\n )\n .on(\"click\", function (d, i) {\n let expenseType = i.key\n let years = [2015, 2016, 2017, 2018, 2019]\n let result = []\n for (let x = 0; x < years.length; x++) {\n result.push({\n \"year\": years[x],\n \"type\": expenseType,\n \"amount\": i[x].data[expenseType]\n })\n }\n console.log(result)\n console.log(expenseType)\n\n d3.select(this).classed('selected')\n let dispatchString = Object.getOwnPropertyNames(dispatcher._)[0];\n console.log(dispatchString, \"ds\")\n console.log(g, \"this\")\n dispatcher.call(dispatchString, this, result);\n })\n .on(\"mouseover\", function (d, i) {\n console.log(i, \"i\")\n console.log(d, \"d\")\n tooltip.transition().delay(30).duration(200).style(\"opacity\", 1)\n // console.log(d.screenx)\n // let xp = x.invert(\"expense\")\n // let currentXPosition = d3.mouse(this);\n console.log(this, \"pos\")\n\n // console.log(d3.pointer(d, this), \"current pos\")\n\n let xp = d3.pointer(d, this)[0]\n let yp = d3.pointer(d, this)[1]\n console.log(xp, yp, \"coordinates\")\n if(xp < 240 && xp > 115) {\n tooltip.html(\"amount : \" + i[0].data[i.key] + '<br/>' + \"year : 2015\" + '<br/>' + \"type : \" + i.key).style(\"left\", d.pageX + \"px\").style(\"top\", d.pageY + \"px\")\n }\n else if(xp > 240 && xp < 360) {\n tooltip.html(\"amount : \" + i[1].data[i.key] + '<br/>' + \"year : 2016\" + '<br/>' + \"type : \" + i.key).style(\"left\", d.pageX + \"px\").style(\"top\", d.pageY + \"px\")\n }\n else if(xp > 360 && xp < 480) {\n tooltip.html(\"amount : \" + i[2].data[i.key] + '<br/>' + \"year : 2017\" + '<br/>' + \"type : \" + i.key).style(\"left\", d.pageX + \"px\").style(\"top\", d.pageY + \"px\")\n }\n else if(xp > 480 && xp < 600) {\n tooltip.html(\"amount : \" + i[3].data[i.key] + '<br/>' + \"year : 2018\" + '<br/>' + \"type : \" + i.key).style(\"left\", d.pageX + \"px\").style(\"top\", d.pageY + \"px\")\n }\n })\n .on(\"mouseout\", function (d) {\n tooltip.transition().duration(100).style(\"opacity\", 0)\n // return tooltip.style(\"visibility\", \"hidden\");\n })\n \n \n // Appending the Y axis label for the bar chart.\n svg1.append(\"text\")\n .attr(\"x\", -((height / 2) + margin.top))\n .attr(\"y\", (margin.top / 3) - 40) \n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"text-anchor\" ,\"middle\")\n .text(\"Amount in Indian Rupees\")\n \n //Appending the X axis label for the bar chart.\n svg1.append(\"text\")\n .attr(\"x\", width / 2 + margin.top)\n .attr(\"y\", margin.bottom)\n .attr(\"text-anchor\" ,\"middle\")\n .text(\"Expenditure per year by Category\")\n\n svg1.append(\"text\")\n .attr(\"x\", width / 2 + margin.top)\n .attr(\"y\", height + 100)\n .attr(\"text-anchor\" ,\"middle\")\n .text(\"Academic Year\")\n \n var legendClassArray = [];\n \n var legend = svg1.selectAll(\".legend\")\n .data(color.domain().slice().reverse())\n .enter().append(\"g\")\n .attr(\"class\", function (d) {\n legendClassArray.push(d.replace(/\\s/g, ''));\n return \"legend\";\n })\n .attr(\"transform\", function(d, i) { return \"translate(0,\" + i * 20 + \")\"; });\n \n legendClassArray = legendClassArray.reverse();\n \n legend.append(\"rect\")\n .attr(\"x\", width - 18)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", color)\n .attr(\"id\", function (d, i) {\n return \"id\" + d.replace(/\\s/g, '');\n })\n \n legend.append(\"text\")\n .attr(\"x\", width - 24)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"end\")\n .text(function(d) { return d; });\n\n }\n }\n\n\n return chart\n \n }", "title": "" } ]
c4308efeac9410a119590f7315dcc453
Flatten a children object (typically specified as `props.children`) and return an array with appropriately rekeyed children. See
[ { "docid": "b74f8c2123a2fc0038e85830acdd63d4", "score": "0.0", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n}", "title": "" } ]
[ { "docid": "55c6a74570ab7b024e4b1c13685389c4", "score": "0.7616984", "text": "function toArray(children) {\n // allow [c,[a,b]]\n var c = [];\n _react2[\"default\"].Children.forEach(children, function (child) {\n if (child) {\n c.push(child);\n }\n });\n return c;\n}", "title": "" }, { "docid": "a3e63931c6f58f0ea98e1466b78333ee", "score": "0.7517575", "text": "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,function(child){return child;});return result;}", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "d662bd0ebc8d9375ab7e53d9e7d5fc81", "score": "0.7404774", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "672cb8ce3bdba6ce35797f7496c97d91", "score": "0.7397847", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "e4d53cabe08c291cc68abbbfc3266ce9", "score": "0.73952484", "text": "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,emptyFunction.thatReturnsArgument);return result;}", "title": "" }, { "docid": "e4d53cabe08c291cc68abbbfc3266ce9", "score": "0.73952484", "text": "function toArray(children){var result=[];mapIntoWithKeyPrefixInternal(children,result,null,emptyFunction.thatReturnsArgument);return result;}", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "d1dfe93af9bafd5a05bf8dfb290c1f43", "score": "0.7394055", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "a4e9a32a71d7c43e7955b1fa1cb04d73", "score": "0.7381381", "text": "function toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}", "title": "" }, { "docid": "ba8e712f6609862b02e3e80f3d13801a", "score": "0.7373502", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "5bec83502926111bd105c2f1080108ae", "score": "0.737312", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "5bec83502926111bd105c2f1080108ae", "score": "0.737312", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\n return child;\n });\n return result;\n }", "title": "" }, { "docid": "42d6c297ce032c72fc1e620a1f3114db", "score": "0.73529196", "text": "function toArray(children) {\r\n var result = [];\r\n mapIntoWithKeyPrefixInternal(children, result, null, function (child) {\r\n return child;\r\n });\r\n return result;\r\n }", "title": "" }, { "docid": "4a854f42ce33edcd6615ad7396221f38", "score": "0.73487526", "text": "function toArray(children) {\n var result = [];\n return mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument), \n result;\n }", "title": "" }, { "docid": "27759ed1c836ba369ed41581a7c70478", "score": "0.7339945", "text": "function toArray(children) {\n var result = [];\n mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);\n return result;\n }", "title": "" }, { "docid": "e4bf7ef17bfc756eaa72018b8a47090d", "score": "0.73051435", "text": "function toArray(children) {\n return mapChildren(children, function(child) {\n return child;\n }) || [];\n }", "title": "" } ]
ec6abe5ae6f21d2bd0443885a7fd16b3
Resets variables for second attempt
[ { "docid": "e2f0279ba169a35a3c260e79debca4ba", "score": "0.0", "text": "function startSecondAttempt()\n{\n // Re-randomize the trial order (DO NOT CHANGE THESE!)\n shuffle(phrases, true);\n current_trial = 0;\n target_phrase = phrases[current_trial];\n phrase_size = 0;\n\n // Resets performance variables (DO NOT CHANGE THESE!)\n letters_expected = 0;\n letters_entered = 0;\n errors = 0;\n currently_typed = \"\";\n CPS = 0;\n \n current_letter = 'a';\n current_word = \"\";\n result = [];\n \n // Show the watch and keyboard again\n second_attempt_button.remove();\n draw_finger_arm = true;\n attempt_start_time = millis(); \n}", "title": "" } ]
[ { "docid": "eb8cdc385618b630b5333cff3b870309", "score": "0.76401657", "text": "function resetVariables() {\n\t\tcount = 0;\n\t\tpastGuesses = [];\n\t\tguessHtml='';\n\t\tuserGuess = '';\n\t\tuserFeedback = 'Make your Guess';\n\t}", "title": "" }, { "docid": "723961d8e3791a074a0e365b2d587bcb", "score": "0.75731647", "text": "function resetVariables() {\n firstOperand = null;\n secondOperand = null;\n preOperand = null;\n decimalUsed = false;\n }", "title": "" }, { "docid": "e40f459d6f688891352d75379dfa25d4", "score": "0.75285995", "text": "function resetVariables() {\n // INSERT CODE HERE!\n }", "title": "" }, { "docid": "48df88dbfb842a8820baf3a3308d058f", "score": "0.75108033", "text": "function resetVars() {\n\t\tidArrays = [];\n\t\tdeathArrays = [];\n\t\tfollowUpArrays = [];\n\t\tdataType = \"number\";\n\t\tsources = 0;\n\t\tNs = [];\n\t\thaveFollowUp = false;\n\t\tdataName = \"\";\n\t\tdragZone = {'left':-1, 'top':-1, 'right':-1, 'bottom':-1, 'name':\"\", 'ID':\"\"};\n\t\tlimits = {'minX':0, 'maxX':0, 'minY':0, 'maxY':0};\n\t\tunique = 0; // number of data points with non-null values\n\t\tNULLs = 0;\n\t\tlocalSelections = []; // the data to send to the parent\n\t}", "title": "" }, { "docid": "aecb4448b81bc79ef5cc54367eb4d91a", "score": "0.7423428", "text": "function resetVars() {\n console.log(\"start of resetVars()\");\n sumTemp = 0;\n sumClouds = 0;\n sumRain = 0;\n console.log(\"SumTemp: \"+sumTemp);\n console.log(\"SumClouds: \"+sumClouds);\n console.log(\"SumRain: \"+sumRain);\n }", "title": "" }, { "docid": "d5630ea9fbe42258457d5dfa885e4c58", "score": "0.7404629", "text": "function resetTally() {\n r2d2 = 0;\n solo = 0;\n droideka = 0;\n falcon = 0;\n jabba = 0;\n deathstar = 0;\n sevens = 0;\n blanks = 0;\n}", "title": "" }, { "docid": "2db784df1e999b902945d2e94c30c755", "score": "0.73808587", "text": "function resetVariables() {\n scoreString = [];\n scoreArray = [];\n rollNumber = 0;\n totalScore = 0;\n}", "title": "" }, { "docid": "8194ade524fefb14f3e7594df17ab95e", "score": "0.7369624", "text": "function resetVariables() {\n gattServer = null;\n fitnessService = null;\n plotStateCharacteristic = null;\n timeCharacteristic = null;\n soundCharacteristic = null;\n tempCharacteristic = null;\n lightCharacteristic = null;\n edxGraderCharacteristic = null;\n stepsNotify = false;\n stepsCharacteristic = null;\n serverReady = false;\n }", "title": "" }, { "docid": "dcc1ad9bc5d09add9bf036cef849a3c2", "score": "0.73194265", "text": "function resetVariables()\n {\n \t// Reset the dependency variables\n \t_aAvailables = null;\n \t_aColours = null;\n\t\t\t_aWheels = null;\n\t\t\t_aOptionalEquipment = null;\n\t\t\t_aUpholstries = null;\n\t\t\t_aInlays = null;\n\t\t\t_aOptionalAccessories = null;\n _initConfiguration = null;\n _carData = null;\n _oPackEquipment = null;\n _extendedWheel = {\n\t \tID:\"\",\n\t \tfinish:null,\n\t \tcap:null,\n\t \tsurround:null\n\t };\n\t _aWheelEquipment = null;\n }", "title": "" }, { "docid": "eca376470e5c8f84b68421eeeefc99ce", "score": "0.73013866", "text": "function resetGame() {\n // wipe these variables\n isInitialised = false;\n readySet = {};\n }", "title": "" }, { "docid": "560f0c3611d192792ea7b645df001ee0", "score": "0.72821146", "text": "function resetVariables(){\n pressleftFlag = false;\n pressRightFlag = false;\n pressUpFlag = false;\n pressDownFlag = false;\n characterRunningFlag = false;\n characterIdleflag = true;\n characterLookLeft = false;\n characterLookRight = false;\n characterLookUp = false;\n characterLookDown = false;\n charIndex = 42;\n index = 0;\n score = 0;\n}", "title": "" }, { "docid": "bf374723e5f7ee52d04be8818ff32841", "score": "0.72465616", "text": "function resetVars() {\n rightLetters = [];\n wrongLetters = [];\n remainingGuesses = 12;\n}", "title": "" }, { "docid": "39ac39d207f46fccf0310eba437fc598", "score": "0.7177935", "text": "function resetVariables()\n{\n\tcanvasWidth = 1200,\n\t\tcanvasHeight = 680;\n\tcanvas1 = \"\",\n\t\tcanvas2 = \"\",\n\t\tcanvas3 = \"\";\t\n\tctx1 = \"\",\n\t\tctx2 = \"\",\n\t\tctx3 = \"\";\n\n\t/*******************************************************************************\n\t*Variable du player\n\t********************************************************************************/\n\tplayer=undefined;\n\n\t/*******************************************************************************\n\t*Variables des tableaux ou seront stocker les plateformes et ennemies du niveau \n\t*en cour\n\t********************************************************************************/\n\tplateformeArray = [],\n\t\tennemisArray = [],\n\t\ttessonArray = [],\n\t\tinterrupteurArray = [];\n\t\tprismeArray = [];\n}", "title": "" }, { "docid": "6a2bdd848428f443b940f5f6f585e025", "score": "0.71317965", "text": "function resetAll() {\n if (reset === true) {\n firstSecondValue = [];\n accumulator = undefined;\n historyArr = [];\n resetSwitches();\n reset = false;\n continueOperation = false;\n }\n }", "title": "" }, { "docid": "0d0c6cb8e5d8dcf374e42ef1b8eaa2e7", "score": "0.7126524", "text": "function reset() {\n //Reset all variables back to zero. \n yourName = '';\n yourHealth = 0;\n yourAttack = 0;\n defenderName = '';\n defenderHealth = 0;\n defenderCounterAttack = 0;\n attackDouble = 0;\n tracker = true;\n }", "title": "" }, { "docid": "e78315cb26373ee734f67c390cd91991", "score": "0.71231306", "text": "function reset() {}", "title": "" }, { "docid": "1c23379e0585acc81bfe8bb32ad97b17", "score": "0.71198094", "text": "function resetVariables(){\n randomNum();\n var targetNumber = randomNum(minNum, maxNum);\n $(\"#number-to-guess\").html(targetNumber); \n currentScore = [];\n counter = 0;\n crystalValue = [];\n }", "title": "" }, { "docid": "ea48f0789ba66f51594702b4d4ddb1a1", "score": "0.7088347", "text": "function reset() {\n\tquestionCounter = 0;\n\tcorrect = 0;\n\tincorrect = 0;\n\tmissed = 0;\n\tuserAns = [];\n\tresetTimer();\n}", "title": "" }, { "docid": "50876f07a83183706f2400a1ed30d19d", "score": "0.70818734", "text": "function resetValues() {\r\n questionNo = 0;\r\n score = 0;\r\n progress = 0;\r\n}", "title": "" }, { "docid": "c1f8a66e3fd7dd8536a87d94a34410d1", "score": "0.70576066", "text": "function reset() { isTaken = false; isNotTaken = false; }", "title": "" }, { "docid": "96ac61c6995d51613182ed83f1096c97", "score": "0.7047012", "text": "function myReset() {\n count = 0;\n guessLeft = 9;\n letters = [];\n updateComputerGuess();\n }", "title": "" }, { "docid": "dd00cfdfb149af31ab09c5bc85cc772f", "score": "0.7037504", "text": "function reset()\n {\n player_balls=0;\n player_score=0;\n player_fours=0;\n player_sixes=0;\n }", "title": "" }, { "docid": "b5636f424eda4d906828e52d2ee24fd0", "score": "0.7033813", "text": "function reset () {\n initGlobals();\n }", "title": "" }, { "docid": "4f20dc03e4d86d9398a4b4b616fee714", "score": "0.7012885", "text": "function resetVarJuego(){\r\n usuarioEnUso = '';\r\n claveEnUSo = '';\r\n respActividad = '';\r\n actividadAudioJuego = '';\r\n posicionArrayExcursion = 0;\r\n idExcursion = 0;\r\n idUsuario = 0;\r\n}", "title": "" }, { "docid": "189030c7c387813507ba64b3dd4da445", "score": "0.6995835", "text": "function resetValues() {\n length = 0;\n characterPool = \"\";\n finalPassword = \"\";\n}", "title": "" }, { "docid": "fa0aecd4f586953d32709c789589132c", "score": "0.69835764", "text": "function updateVariables() {\n secondNumber = null;\n firstNumber = displayValue;\n operation = null;\n}", "title": "" }, { "docid": "8360807b4815bde1b9c38962cb7750a7", "score": "0.6974636", "text": "function reset() {\n questCount = 0;\n correct = 0;\n incorrect = 0;\n missed = 0;\n userAnswer = [];\n timerReset();\n }", "title": "" }, { "docid": "8bbb1175219b2e4131eac8d1a1da9f99", "score": "0.69746256", "text": "function _resetInitialSettings() {\n learningController.reset();\n qoeEvaluator.reset();\n }", "title": "" }, { "docid": "683426b8a47b6def41b6cf4edd42bd25", "score": "0.6973331", "text": "reset(){}", "title": "" }, { "docid": "3b480734aa42130e7ae82a86e434deb1", "score": "0.69659376", "text": "function _resetInitialSettings() {\n l2AStateDict = {};\n l2AParameterDict = {};\n }", "title": "" }, { "docid": "dfaf325810c36ea15e1a4085a74b596f", "score": "0.69504505", "text": "function resetLocalVars(){\n lx = 0;\n ly = 0;\n lz = 0;\n lrotateX = 0\n lrotateY = 0\n lrotateZ = 0;\n}", "title": "" }, { "docid": "c0a1199038978a1ceaad214a88729441", "score": "0.6922547", "text": "function reset()\n{\n matchNames = [];\n autoScale = [];\n autoSwitch = [];\n teleScale = [];\n teleSwitch = [];\n autoLineCount = [0];\n deadAutoCount = [0];\n climbed = [0];\n gotHelp = [0];\n gaveHelp = [0];\n died = [0];\n tippedOver = [0];\n}", "title": "" }, { "docid": "0fe95a227d5d54378dae7688b5c5e2d4", "score": "0.690282", "text": "function reset() {\n typeOperation = \"\";\n acumulate = 0;\n calculate(acumulate)\n}", "title": "" }, { "docid": "d8501001676a423bdc17bf87f8374ba5", "score": "0.68843466", "text": "function resetParameters() {\n parameters.gameState.round = 0; \n parameters.gameState.playerItem = null; \n parameters.gameState.computerItem = null;\n parameters.gameState.playerResult = 0;\n parameters.gameState.computerResult = 0;\n parameters.gameState.roundResult = null;\n parameters.progress = [];\n }", "title": "" }, { "docid": "a6d587d6f4675292c9391e8232f2360c", "score": "0.68830186", "text": "function resetGraphVariables() {\n typeGroups = {};\n typeIndex = 0;\n\n currentGraph = {\n nodes: [],\n edges: []\n }\n labelGraph = {\n nodes: [],\n edges: []\n }\n\n idCache = {};\n}", "title": "" }, { "docid": "c111b7440cbc54eccd5cebb6dbbd30a9", "score": "0.68808985", "text": "function resetVariables(){\n \t\trandomNumber = Math.floor(Math.random() * 101) + 19;\n\t\tblue = Math.floor(Math.random() * 12) + 1;\n\t\tred = Math.floor(Math.random() * 11) + 2;\n\t\tdiamond = Math.floor(Math.random() * 10) + 3;\n\t\tgreen = Math.floor(Math.random() * 9) + 4;\n\t\ttotalScore = 0;\n\t\t$(\"#totalScore\").html(\"\" + totalScore);\n\t\t$(\"#randomNumber\").html(\"\" + randomNumber);\n\n \t\t}", "title": "" }, { "docid": "be21be76658cef92702b4cfbedd9d016", "score": "0.6880675", "text": "function resetValues() {\n name = '';\n point = 100;\n turn = 1;\n showLine = true;\n line1 = 0;\n line2 = 0;\n line3 = 0;\n arrRandomNum = [0];\n arrNumberBingoCart = [0];\n}", "title": "" }, { "docid": "8b81a276fb90b459f20d73fab7b3ea5d", "score": "0.68770885", "text": "function reset(){\n setAllManDetails(undefined)\n setVinDetails(undefined)\n setManDetails(undefined)\n }", "title": "" }, { "docid": "f9824f5453cfed744dae310949207c5c", "score": "0.6874218", "text": "resetGameVars() {\n this.paddle1Pos = leftEyeStartOffset;\n this.paddle2Pos = rightEyeStartOffset;\n this.xPuck = 0;\n this.yPuck = 0;\n this.xVelecityPuck = puckStartSpeed;\n this.yVelecityPuck = 0;\n this.scoreLeft = 0;\n this.scoreRight = 0;\n }", "title": "" }, { "docid": "60e33f2c69a47a6d985ba81136beaa82", "score": "0.68701184", "text": "function reset(){\n newNumber = true\n firstNum = 0\n secondNum = 0\n firstOperation = 0\n secondOperation = 0\n operationSpecified = false\n}", "title": "" }, { "docid": "b88709577ac7d073eb7261c1cf5f6a72", "score": "0.6862638", "text": "reset() {\n this.startingTeam = dataGenerator.getStartingTeam();\n console.log(this.startingTeam);\n this.usedWords = this.usedWords.concat(Object.keys(this.cards));\n this.cards = GameSession.generateCards(wordCount, this.startingTeam, this.usedWords);\n }", "title": "" }, { "docid": "3aa2fc96cebbc5304ac9475d93de6f4b", "score": "0.6856054", "text": "function resetVars(state) {\n keepBallAttached = false;\n ballIsUp = false;\n fired = false;\n }", "title": "" }, { "docid": "ca7e8444a3a44c09075d0574a92db8b2", "score": "0.6845753", "text": "function reset(){\n stars = [];\n circleForms = [];\n percentFinished = 0;\n}", "title": "" }, { "docid": "a9fb8a9b2d705b744acc5431a44d9e7f", "score": "0.6843912", "text": "resetGame() {\n this.lastScore = this.Hero.totalDownload;\n this.entities = [];\n this.nextObstacle = 0;\n this.init();\n }", "title": "" }, { "docid": "b4c1039a75b00bf8204d5620569de660", "score": "0.6843007", "text": "async reset() {}", "title": "" }, { "docid": "08ba63deb99b38c6057e4d3c1c44c414", "score": "0.6841065", "text": "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n}", "title": "" }, { "docid": "d3599a7f7ea79bb37fef045aed42d09b", "score": "0.68338406", "text": "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n \n}", "title": "" }, { "docid": "3495c827e53a599601542ff8fa294441", "score": "0.68269676", "text": "function reset(){\n cardFlipped = false;\n stopClick = false;\n firstPick = null;\n secondPick = null;\n }", "title": "" }, { "docid": "aba794672ecafdb1e2ba40c86b864f73", "score": "0.6826453", "text": "function Reset() {\n wrongGuess = [];\n underscore = [];\n guessesRemaining = 10;\n wordGuess()\n}", "title": "" }, { "docid": "1f45fa71c95c0597c2795e536d063364", "score": "0.6819436", "text": "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 4000;\n turn = 0;\n playerBet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n}", "title": "" }, { "docid": "57734f8d0f8bf8a29f5c7490f2a36704", "score": "0.6813808", "text": "reset() {\n /**\n * The overall error.\n */\n this.globalError = 0;\n /**\n * The size of a set.\n */\n this.setSize = 0;\n\n this.sum = 0;\n }", "title": "" }, { "docid": "7b1a76be7b6c7f6c159824447edbf30f", "score": "0.68124664", "text": "function reset()\n{\n resetting = true;\n}", "title": "" }, { "docid": "0f924a2b33c004abda84d7914bf1cd63", "score": "0.6802819", "text": "reset()\n {\n this._state = this._initialState;\n this._prevState = this._initialState;\n this._prevPrevState = this._initialState;\n this._iterations = 0;\n this._epoch = 0;\n }", "title": "" }, { "docid": "0f924a2b33c004abda84d7914bf1cd63", "score": "0.6802819", "text": "reset()\n {\n this._state = this._initialState;\n this._prevState = this._initialState;\n this._prevPrevState = this._initialState;\n this._iterations = 0;\n this._epoch = 0;\n }", "title": "" }, { "docid": "fe46bec984429b97d1f097249647b334", "score": "0.67615163", "text": "function clearVariables(displayResult) {\n firstNumber = null;\n secondNumber = null;\n operation = null;\n displayValue = displayResult;\n}", "title": "" }, { "docid": "e6a774dd77fc2b11e16b23477a40f961", "score": "0.67553353", "text": "function reset() {\n reset_checked_planets();\n reset_planets_type();\n reset_removed_planets();\n set_stat(stat_types.lives, 3);\n set_stat(stat_types.score, 0);\n set_stat(stat_types.level, 0);\n set_stat(stat_types.shoots, 0);\n gamer.timer.minute = 0;\n gamer.timer.second = 0;\n set_stat(stat_types.time);\n clearInterval(gamer.timer.interval);\n gamer.available_planets = 0;\n gamer.next.type = planet_types.none;\n gamer.missed_groups = 0;\n hardmode = false;\n insert_counter = 0;\n }", "title": "" }, { "docid": "50480ab6548c857428c17c0aa2deda42", "score": "0.67485964", "text": "function boardReset() {\n [pickedCard, cardsLocked] = [false, false];\n [cardOne, cardTwo] = [null, null];\n}", "title": "" }, { "docid": "068f01eb270747007700b1ba325ba5d0", "score": "0.6747578", "text": "function reset(){\r\n _clear();\r\n _setTurn();\r\n }", "title": "" }, { "docid": "518291e35a1f06bf7be3a6aa71987ad8", "score": "0.6719998", "text": "function resetVars(){\n\t\tallTutorials = false;\n\t\tallElements = false;\n\t\tallComponents = false;\n\t\tallPageTypes = false;\n\t\t$('.active').each(function(){\n\t\t\t$(this).removeClass('active');\n\t\t});\n\t}", "title": "" }, { "docid": "81998337b856317e2a90ca7fd8cca990", "score": "0.6713536", "text": "reset() {\n\t\tthis.ready = false;\n\t\tthis.states = [];\n\t\tthis.battles = [];\n\t\tthis.fighters = [];\n\t}", "title": "" }, { "docid": "80a356f324182b9bbe72640fa02469bf", "score": "0.66999125", "text": "function reset() {\n allEnemies = [];\n player = null;\n rocks = [];\n levelKey = null;\n gemOrange = null;\n gemBlue = null;\n heart = null;\n star = null;\n GameObject.destroyAllObject();\n level = 0;\n updateLevel();\n collectedOrangeGem = 0;\n }", "title": "" }, { "docid": "bbbb0cb9d06ba50ddc8534358e6a0d90", "score": "0.668889", "text": "function reset() {\n hasFlipped = false;\n boardLock = false;\n card1 = null;\n card2 = null;\n}", "title": "" }, { "docid": "5017b7b4ad74d87206cbaef695504083", "score": "0.6685761", "text": "function resetStats(){\n name;\n str = 1;\n killCount = 0;\n key = false;\n}", "title": "" }, { "docid": "0d0e13249a136abbb21c0b698c566790", "score": "0.6685705", "text": "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n playerBet = 10;\n}", "title": "" }, { "docid": "9dac13295fce3b74cd182d1ed78f0eb5", "score": "0.66839546", "text": "function reSet() {\n lettersGuessed = [];\n holder = [];\n blankWord = [];\n guessesLeft = 12;\n wordGen();\n setUp();\n}", "title": "" }, { "docid": "1df03b1ceb25d8c9f36f79194ad94cd7", "score": "0.6676544", "text": "function reset() {\n guessesRemaining = 9;\n wrongGuess = [];\n blanksAndCorrect = [];\n Game()\n}", "title": "" }, { "docid": "018c941609550296cba7df2d4cdb09b5", "score": "0.6675705", "text": "function reset () {\n guessLeft = startingGuesses;\n guessHistory = [];\n }", "title": "" }, { "docid": "25828f4a0f1aea94dd6b3e1ca15028f4", "score": "0.66693795", "text": "function reset(){\n\tnumber1 = null;\n\tnumber2 = null;\n\toperator = null;\n\tanswer = null;\n\tnumberAfterComma = 1;\n\tisFirstNumberDone = false;\n\tisNumberOperatorEntered = false;\n\tisCalculationComplete = false;\n\tisCommaEntered = false;\n\tdocument.getElementById(\"outputText\").innerHTML = \"Ready to be used!\";\n}", "title": "" }, { "docid": "853848a8a47f28ee8d5b83b91919812e", "score": "0.6664955", "text": "function resetGame() {\n questionCount = 0;\n correctGuess = 0;\n incorrectGuess = 0;\n unansweredGuess = 0;\n time = 30;\n generateQuestions();\n timerWrapper();\n }", "title": "" }, { "docid": "1e06ee278ff75e5dc42a78349ce9423b", "score": "0.6664303", "text": "function reset()\n\t{\n\t\t$scope.steam = {};\n\t\t$scope.user = {};\n\n\t\t$scope.success = false;\n\t\t$scope.warning = false;\n\t\t$scope.error = false;\n\n\t\t$scope.searching = false;\n\t\t$scope.found = false;\n\t\t$scope.message = false;\n\n\t\t$scope.adding = false;\n\t\t$scope.addUserError = false;\n\t}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.6652631", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.6652631", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.6652631", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.6652631", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.6652631", "text": "reset() {}", "title": "" }, { "docid": "ab4872ff403fa3b4cb4aa32bbccb2d4b", "score": "0.6652631", "text": "reset() {}", "title": "" }, { "docid": "b9242629433aab25626794d963fbcb44", "score": "0.66486114", "text": "function resetResults() {\n correct = 0;\n incorrect = 0;\n unanswered = 0;\n }", "title": "" }, { "docid": "821959a0ab496578ceca04a7e5763c95", "score": "0.66446507", "text": "function reset() {\r\n mapDataHistory = [];\r\n redoBranch = [];\r\n}", "title": "" }, { "docid": "334c83f6925da8029c8d008ea2773b38", "score": "0.66353077", "text": "function reset() {\n\tmoves.textContent = 0;\n\tmatches = 0;\n\tresetStars();\n\tcards = [];\n\tfillCard();\n\thideAndPlaceDeck();\n\tfaceDown();\n\n\tcard1 = '';\n\tcard2 = '';\n\n\ttimer.textContent = \"0s\";\n\tstart = 0;\n\tseconds = 0;\n}", "title": "" }, { "docid": "6d4b94d03d88a7b343946c48bd71c0ee", "score": "0.66329926", "text": "function restartValues() {\n operationStr = '';\n result = 0;\n }", "title": "" }, { "docid": "8dba8f96fd8e25f069a81d9a8080d4b3", "score": "0.66300815", "text": "function reset() {\n generateGameNumbers();\n console.log(global_nums);\n history = [];\n round = 0;\n guessedNums = [];\n }", "title": "" }, { "docid": "ddd6971cfa518c86949987b23c9e9920", "score": "0.66264963", "text": "function reset(){\n \tnonMatchingLetters = [];\n\t // matching letters\n\t matchingLetters = [];\n\t usedLetters = []; \n\t guesses = 10;\n\t currentWordPosition++;\n\t currentWord = wordArray[currentWordPosition];\n\t currentWordLetters = [];\n playerWinOrLose = false;\n blanksRemaining = null;\n\n\t initialWordBlanks();\n\n\t updateUsedWords();\n\n\t updateGuesses();\n\n\t $('.js-win-or-lose').html(\"\");\n\t $('.js-already-used-warning ').html(\"\");\n\n\t log('currentWordPosition = ' + currentWordPosition);\n }", "title": "" }, { "docid": "6062e69dc8439aab6b527d3adb57b1ef", "score": "0.6621503", "text": "function reset(){\n binaryNumber = null;\n userBinaryNum = [];\n getRandomNumber();\n convertToBinary();\n}", "title": "" }, { "docid": "cf8dbe815ddd2c6c008f9909b69d3159", "score": "0.6621428", "text": "reset() {\r\n\r\n this.currentState = this.config.initial; \r\n this.arrStates = [this.currentState];\r\n }", "title": "" }, { "docid": "b32e21ff59dbcf67e668faf693254a60", "score": "0.66139543", "text": "function reset(){\n\tisMovingEaten = false;\n\tisClockEaten = false;\n\tisPillEaten = false;\n\tkeysDown = {};\n\tlife = 5;\n\tscore = 0;\n\tshape.i = undefined;\n\tshape.j = undefined;\n\tmoveIterator = 0;\n\tclockIterator = 0;\n\tpillIterator = 0;\n\tif (intervalTimer != undefined){\n\t\twindow.clearInterval(intervalTimer);\n\t}\n}", "title": "" }, { "docid": "ed7c8fa865523fa040925f4208277da7", "score": "0.6613113", "text": "function resetSettings(){}", "title": "" }, { "docid": "4a4687821d14d9ad9ff566886bcfdb25", "score": "0.6610922", "text": "function reset() {\n\n }", "title": "" }, { "docid": "4befe5e36743b8f9e05500c5fbfcfada", "score": "0.66101867", "text": "function reset() {\n incorrect = 10;\n guesses = [];\n initGame();\n}", "title": "" }, { "docid": "5acdb573e63906be976b88871162e731", "score": "0.6609336", "text": "function reset() {\n parts = [];\n fnCounter = 0;\n propId = props = undefined;\n }", "title": "" }, { "docid": "543f8772aac85413a78509474f248dc0", "score": "0.66082287", "text": "function reset() {\n initialize(); \n }", "title": "" }, { "docid": "aebb4fe10904e6271486663b1983b2dc", "score": "0.6602426", "text": "_reset() {\n this.sum = 0;\n this.count = 0;\n }", "title": "" }, { "docid": "9cab3523454138dcf16d784aa159816a", "score": "0.65989125", "text": "function reset(){\n return init();\n}", "title": "" }, { "docid": "e99d47e382e0daaca886e1f1b9730282", "score": "0.6598812", "text": "function reset () {\n setCurrentNumberString(\"0\");\n setCurrentNumberAsResult(false);\n setPreviousNumber(null);\n setCurrentOperator(null);\n setPreviousDisplay(null);\n setErrorStatus(false);\n }", "title": "" }, { "docid": "9e72a784a734fee767dc507aff3847e5", "score": "0.6598608", "text": "reset(){\r\n this.downDirStartX = this.downDirStartX;\r\n this.upDirStartX = this.upDirStartX;\r\n this.rightDirStartX = this.rightDirStartX;\r\n this.leftDirStartX = this.leftDirStartX;\r\n\r\n this.frames = this.initFrames;\r\n\r\n this.downDelay = this.initDownDelay;\r\n this.upDelay = this.initUpDelay;\r\n this.rightDelay = this.initRightDelay;\r\n this.leftDelay = this.initLeftDelay;\r\n this.delay = this.initDelay;\r\n\r\n this.frameCounter = null;\r\n this.downFrameCounter = null;\r\n this.upFrameCounter = null;\r\n this.rightFrameCounter = null;\r\n this.leftFrameCounter = null;\r\n\r\n this.startX = 0;\r\n this.direction = this.initDirection;\r\n this.savedStartX = this.startX;\r\n }", "title": "" }, { "docid": "7c90335f13cadcdac7d1248577af2f03", "score": "0.65930104", "text": "reset() {\n this.board = Array(9).fill(null)\n this.turn = 'X'\n this.player = 'X'\n this.opponent = 'O'\n this.init = false\n this.winner = null\n this.finished = false\n this.history = []\n this.snapIdx = null\n }", "title": "" }, { "docid": "6352dace8562a41798326e18e36cd795", "score": "0.6589778", "text": "function resetAll() {\n questionSelector = 0;\n correctAnswers = 0;\n wrongAnswers = 0;\n unanswered = 0;\n answerIsCorrect = false;\n deleteChildren()\n beginGame()\n }", "title": "" }, { "docid": "100367bd7cf9e8e6e37f9ef52f15fd20", "score": "0.6589341", "text": "function resetVariables(){\n\t\t\t\tisContentLoaded = false;\n\t\t\t\tvideoDuration = currentTime = \"\";\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "eaad31d44b428dcd01f986d1d1d69f7d", "score": "0.6588562", "text": "function softReset () {\n exports.getData().players[0].alive = true;\n exports.getData().players[1].alive = true;\n exports.getData().players[2].alive = true;\n exports.getData().players[3].alive = true;\n exports.getData().players[4].alive = true;\n gameData.daysOnTrail = 0;\n gameData.totalMiles = 0;\n gameData.currentHealth = 100;\n gameData.currentPace = paceArray[0] ;\n}", "title": "" }, { "docid": "ce315f368f19147e52ad300181eaf5b1", "score": "0.6584999", "text": "function resetStudio() {\n // reset variables\n nodes = [];\n links = [];\n tubes = [];\n cables = [];\n lastNodeId = 0;\n // update layout items\n updateMatrix();\n update();\n saveOperation();\n restart();\n}", "title": "" }, { "docid": "d387dafd27877741727efb5bee74bf93", "score": "0.6584332", "text": "function gameReset() {\n\t\tquestionCounter = 0;\n\t\tcorrectGuesses = 0;\n\t\tincorrectGuesses = 0;\n\t}", "title": "" }, { "docid": "d387dafd27877741727efb5bee74bf93", "score": "0.6584332", "text": "function gameReset() {\n\t\tquestionCounter = 0;\n\t\tcorrectGuesses = 0;\n\t\tincorrectGuesses = 0;\n\t}", "title": "" } ]
250ace8de63016342c106a62a430d59a
based on jquery.param, removed 'traditional'
[ { "docid": "1b1c4225757088e23ee6ccf48cf9bc9a", "score": "0.0", "text": "function buildParams(obj){\n var r20 = /%20/g;\n var s = [], prefix;\n for(prefix in obj){\n s.push(encodeURIComponent( prefix ) + \"=\" + encodeURIComponent( obj[prefix] ));\n }\n return s.join( \"&\" ).replace( r20, \"+\" );\n}", "title": "" } ]
[ { "docid": "2c37fb0ff1e2ff7294bd3701e0a4a2d6", "score": "0.63816947", "text": "function param(a, traditional) {\n var prefix, s = [], add = function (key, value) {\n // If value is a function, invoke it and return its value\n value = exports._.isFunction(value) ? value() : (value == null ? \"\" : value);\n s[s.length] = encodeURIComponent(key) + \"=\" + encodeURIComponent(value);\n };\n // Set traditional to true for jQuery <= 1.3.2 behavior.\n /*if (traditional === undefined)\n {\n // TODO Support for traditionalEncoding\n //traditional = !!m.config().traditionalEncoding;\n }*/\n // If an array was passed in, assume that it is an array of form elements.\n if(isArrayOrArrayLike(a)) {\n // Serialize the form elements\n exports._.each(a, function (x) {\n add(x.name, x.value);\n });\n } else {\n // If traditional, encode the \"old\" way (the way 1.3.2 or older\n // did it), otherwise encode params recursively.\n for(prefix in a) {\n buildParams(prefix, a[prefix], traditional, add);\n }\n }\n // Return the resulting serialization\n return s.join(\"&\").replace(r20, \"+\");\n }", "title": "" }, { "docid": "44eb1f7e2d3fbadfff89b982f88e2526", "score": "0.60203546", "text": "function serializeData(options) {\n\t if (options.processData && options.data && $.type(options.data) != \"string\") options.data = $.param(options.data, options.traditional);\n\t if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType)) options.url = appendQuery(options.url, options.data), options.data = undefined;\n\t }", "title": "" }, { "docid": "0e61ef7c043f4f65fdc01ef384ac7ecc", "score": "0.5887937", "text": "function prepareAjaxData(params) {\n var data = {};\n if (settings.filterBy) {\n data[settings.filterBy] = params.term;\n }\n return data;\n}", "title": "" }, { "docid": "7a14348ecaf3d54bed74467e95fc9535", "score": "0.5860279", "text": "function paramify(data) {\n var query = '';\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n query += '&' + key + '=' + data[key];\n }\n }\n return query;\n }", "title": "" }, { "docid": "375df811a9fc839686f6fd6e2e1dfcf9", "score": "0.5831886", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data)\n }", "title": "" }, { "docid": "375df811a9fc839686f6fd6e2e1dfcf9", "score": "0.5831886", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data)\n }", "title": "" }, { "docid": "9e928f1a04912ba844f175db41f0adf5", "score": "0.58122694", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\") options.data = $.param(options.data, options.traditional);\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) options.url = appendQuery(options.url, options.data), options.data = undefined;\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5806817", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5806817", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5806817", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5806817", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5806817", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5806817", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5806817", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "5eebc7145024e74831d01302e5e03c71", "score": "0.5785096", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "d1ffcc9a399d41811ad66b1976e250ba", "score": "0.57738", "text": "function serializeData(options) {\n if (options.processData && options.data && typeof(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "f81939ace247c46d4bb02d28adee4819", "score": "0.57597655", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "01245ef68ea1418ec9961c93e0c3f3f0", "score": "0.5731862", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != 'string')\n options.data = $.param(options.data, options.traditional);\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined;\n }", "title": "" }, { "docid": "8babf9a7e0818f3369b26e32719c9660", "score": "0.5730945", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "8babf9a7e0818f3369b26e32719c9660", "score": "0.5730945", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "e680fd6a54cf7aff768e5ad80d2d873d", "score": "0.5718446", "text": "function normaliseParams(params) {\r\n if (typeof params == 'string') {\r\n params = params.split(' ');\r\n }\r\n else if (!$.isArray(params)) {\r\n var opts = [];\r\n for (var name in params) {\r\n opts[0] = name;\r\n opts[1] = params[name];\r\n }\r\n params = opts;\r\n }\r\n return params;\r\n }", "title": "" }, { "docid": "5e3ebbb9223ebf3ed65893b65ea09f5f", "score": "0.57040447", "text": "function buildParams( prefix, obj, traditional, add ) {\r\n var name;\r\n\r\n if ( $.isArray( obj ) ) {\r\n // Serialize array item.\r\n $.each( obj, function( i, v ) {\r\n if ( traditional || rbracket.test( prefix ) ) {\r\n // Treat each array item as a scalar.\r\n add( prefix, v );\r\n\r\n } else {\r\n // Item is non-scalar (array or object), encode its numeric index.\r\n buildParams( prefix + \"[\" + ( typeof v === \"object\" ? i : \"\" ) + \"]\", v, traditional, add );\r\n }\r\n });\r\n\r\n } else if ( !traditional && $.type( obj ) === \"object\" ) {\r\n // Serialize object item.\r\n for ( name in obj ) {\r\n buildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\r\n }\r\n\r\n } else {\r\n // Serialize scalar item.\r\n add( prefix, obj );\r\n }\r\n }", "title": "" }, { "docid": "1d0fe1ba5c36ac51637c5bbeda74f1ed", "score": "0.56987727", "text": "addParam(param) {\n this.url += this.hasParams() ? `&${param}` : `?${param}` \n }", "title": "" }, { "docid": "3d12247f6cf686d9a41999532ce25bc4", "score": "0.5690945", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "1688ef348a1029dfda6cfe01165f06a1", "score": "0.5684481", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\") options.data = $.param(options.data, options.traditional);\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType)) options.url = appendQuery(options.url, options.data), options.data = undefined;\n }", "title": "" }, { "docid": "c574152206381688ab2884acd795f322", "score": "0.5671793", "text": "function obj2params(obj) {\n\tvar result = '';\n\tvar item;\n\tfor (item in obj) {\n\t\tresult += '&' + item + '=' + encodeURIComponent(obj[item]);\n\t}\n\tif (result) {\n\t\tresult = result.slice(1);\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "c3108cb7a06297075828edade88121f5", "score": "0.56535995", "text": "function serializeData(options) {\n if (options.processData && options.data && !uap.isString(options.data)){\n options.data = $.param(options.data, options.traditional);\n }\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')){\n options.data = $.param(options.data, options.traditional);\n options.url = appendQuery(options.url, options.data);\n options.data = undefined;\n }\n }", "title": "" }, { "docid": "870f77952bbf1247b67c1791204cd9da", "score": "0.5632362", "text": "function getUrl_val(parameter) {\n\n return $.urlParam(parameter);\n\n}", "title": "" }, { "docid": "e2cbee90de8e735fb59ee12ca6d8c099", "score": "0.55910623", "text": "function serializeData(options) {\r\n options.data = options.data || options.query;\r\n if (options.processData && options.data && type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) {\r\n if (type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n options.url = appendQuery(options.url, options.data);\r\n options.data = undefined;\r\n }\r\n }", "title": "" }, { "docid": "e2cbee90de8e735fb59ee12ca6d8c099", "score": "0.55910623", "text": "function serializeData(options) {\r\n options.data = options.data || options.query;\r\n if (options.processData && options.data && type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) {\r\n if (type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n options.url = appendQuery(options.url, options.data);\r\n options.data = undefined;\r\n }\r\n }", "title": "" }, { "docid": "e2cbee90de8e735fb59ee12ca6d8c099", "score": "0.55910623", "text": "function serializeData(options) {\r\n options.data = options.data || options.query;\r\n if (options.processData && options.data && type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) {\r\n if (type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n options.url = appendQuery(options.url, options.data);\r\n options.data = undefined;\r\n }\r\n }", "title": "" }, { "docid": "e2cbee90de8e735fb59ee12ca6d8c099", "score": "0.55910623", "text": "function serializeData(options) {\r\n options.data = options.data || options.query;\r\n if (options.processData && options.data && type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) {\r\n if (type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n options.url = appendQuery(options.url, options.data);\r\n options.data = undefined;\r\n }\r\n }", "title": "" }, { "docid": "e2cbee90de8e735fb59ee12ca6d8c099", "score": "0.55910623", "text": "function serializeData(options) {\r\n options.data = options.data || options.query;\r\n if (options.processData && options.data && type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) {\r\n if (type(options.data) != \"string\") {\r\n options.data = param(options.data, options.traditional);\r\n }\r\n options.url = appendQuery(options.url, options.data);\r\n options.data = undefined;\r\n }\r\n }", "title": "" }, { "docid": "94e7f526ce3401c380e37b97ac7748b2", "score": "0.55797094", "text": "function normaliseParams(params) {\r\n\t\tif (typeof params == 'string') {\r\n\t\t\tparams = params.split(' ');\r\n\t\t}\r\n\t\telse if (!$.isArray(params)) {\r\n\t\t\tvar opts = [];\r\n\t\t\tfor (var name in params) {\r\n\t\t\t\topts[0] = name;\r\n\t\t\t\topts[1] = params[name];\r\n\t\t\t}\r\n\t\t\tparams = opts;\r\n\t\t}\r\n\t\treturn params;\r\n\t}", "title": "" }, { "docid": "705fb8a91395c19435babf715a21b056", "score": "0.55346566", "text": "function set_urlParams() {\n\t\tvar parts, value,\n\t\t\tparams = {},\n\t\t\tsearch = location.search.substring(1).split('&'),\n\t\t\ti = 0,\n\t\t\tlen = search.length;\n\n\t\tfor (; len > i; ++i) {\n\t\t\tparts = search[i].split('=');\n\t\t\tvalue = parts[1];\n\t\t\t// Cast booleans and treat no value as true\n\t\t\tparams[decodeURIComponent(parts[0])] =\n\t\t\t\tvalue && value !== 'true' ?\n\t\t\t\t\tvalue === 'false' ? false :\n\t\t\t\t\tdecodeURIComponent(value) :\n\t\t\t\ttrue;\n\t\t}\n\n\t\treturn params;\n\t}", "title": "" }, { "docid": "957bce8242dab4efb9374752bcc2a488", "score": "0.55297744", "text": "function interpretParams() {\n $(\"input[type=radio]\").each(function() {\n var words = _.words($(this).attr('id'), '-');\n var initial = _.initial(words).join('-');\n $(this).prop(\"checked\", $(this).attr(\"checked\") || params[initial] == _.last(words));\n });\n $(\"input[type=checkbox]\").each(function() {\n $(this).prop(\"checked\", _.toBool(params[$(this).attr('id')]));\n });\n }", "title": "" }, { "docid": "4d4438e22200aee9f521fc35128e3d3c", "score": "0.552715", "text": "function searchByParam(param_name, param_value, order_param_id)\n {\n data = {};\n data[param_name] = param_value\n \n order_param = jQuery(\"#\"+order_param_id)[0];\n if (order_param)\n data[order_param.name] = order_param.value;\n \n jQuery.get(document.location.href, data, null, \"script\");\n }", "title": "" }, { "docid": "70dd74e3e0f6b57801d3fae7c301f453", "score": "0.55158913", "text": "function parseQueryParams() {\n\t\t$_REQUEST = {}; // PHP-like global array of [paramname -> value]\n\t\tif (!window.location.search || window.location.search.length < 1) {\n\t\t\treturn $_REQUEST;\n\t\t}\n\n\t\tvar url = window.location.search.substring(1);\n\t\tvar chunks = url.split(/&/);\n\t\tfor (var i = 0; i < chunks.length; i++) {\n\t\t\tvar keyValue = chunks[i].split(/=/);\n\t\t\tif (keyValue[0] && keyValue[1]) {\n\t\t\t\tvar thisValue = unescape(keyValue[1]);\n\t\t\t\tthisValue = thisValue.replace(/[+]/, \" \"); // unescape URL spaces\n\t\t\t\t$_REQUEST[keyValue[0]] = thisValue;\n\t\t\t}\n\t\t}\n\t\treturn $_REQUEST;\n\t}", "title": "" }, { "docid": "14f3e8bda3ca1a81266082704aa3df4a", "score": "0.5513457", "text": "enQuery(data) {\r\n const ret = [];\r\n for (let d in data) {\r\n ret.push(encodeURIComponent(d) + \"=\" + encodeURIComponent(data[d]));\r\n }\r\n return ret.join(\"&\");\r\n }", "title": "" }, { "docid": "6198b6e7525cd7976a5b63cd95c56785", "score": "0.550628", "text": "function jq_param_sub(is_fragment,get_func,url,params,merge_mode){var result,qs,matches,url_params,hash;if(params!==undefined){// Build URL by merging params into url string.\n// matches[1] = url part that precedes params, not including trailing ?/#\n// matches[2] = params, not including leading ?/#\n// matches[3] = if in 'querystring' mode, hash including leading #, otherwise ''\nmatches=url.match(is_fragment?re_fragment:/^([^#?]*)\\??([^#]*)(#?.*)/);// Get the hash if in 'querystring' mode, and it exists.\nhash=matches[3]||'';if(merge_mode===2&&is_string(params)){// If merge_mode is 2 and params is a string, merge the fragment / query\n// string into the URL wholesale, without converting it into an object.\nqs=params.replace(is_fragment?re_params_fragment:re_params_querystring,'');}else{// Convert relevant params in url to object.\nurl_params=jq_deparam(matches[2]);params=is_string(params)// Convert passed params string into object.\n?jq_deparam[is_fragment?str_fragment:str_querystring](params)// Passed params object.\n:params;qs=merge_mode===2?params// passed params replace url params\n:merge_mode===1?$.extend({},params,url_params)// url params override passed params\n:$.extend({},url_params,params);// passed params override url params\n// Convert params object into a sorted params string.\nqs=jq_param_sorted(qs);// Unescape characters specified via $.param.noEscape. Since only hash-\n// history users have requested this feature, it's only enabled for\n// fragment-related params strings.\nif(is_fragment){qs=qs.replace(re_no_escape,decode);}}// Build URL from the base url, querystring and hash. In 'querystring'\n// mode, ? is only added if a query string exists. In 'fragment' mode, #\n// is always added.\nresult=matches[1]+(is_fragment?fragment_prefix:qs||!matches[1]?'?':'')+qs+hash;}else{// If URL was passed in, parse params from URL string, otherwise parse\n// params from window.location.href.\nresult=get_func(url!==undefined?url:location.href);}return result;}", "title": "" }, { "docid": "5ca6b2027aeece15c35b7d51a7bee497", "score": "0.5487972", "text": "function queryParams(params) {\n params = {};\n return params\n}", "title": "" }, { "docid": "d8f4039f9113a049d3f9deba642fd377", "score": "0.5474936", "text": "function read_querystring_Ajax() {\r\n var separator = \"#\";\r\n if (location.href.indexOf(\"?\") > 0) {\r\n window.location.href = location.href.replace(\"?\", \"#\");\r\n } \r\n return read_querystring();\r\n}", "title": "" }, { "docid": "4b526f746d6dd983b956e9fee3b64c5c", "score": "0.5471197", "text": "function handleParameter(param, fieldName, msgName)\n {\n // the ajax deferred or null\n var rval = null;\n\n // check \"json-ld\" parameter\n if(param !== null)\n {\n hasQueryData = true;\n if(param.length == 0 || param[0] == \"{\" || param[0] == \"[\")\n {\n // param looks like JSON\n queryData[fieldName] = param;\n }\n else\n {\n // treat param as a URL\n rval = $.ajax({\n url: param,\n dataType: 'text',\n success: function(data, textStatus, jqXHR) {\n queryData[fieldName] = data;\n },\n error: function(jqXHR, textStatus, errorThrown) {\n // FIXME: better error handling\n $(\"#markup-errors\")\n .text(\"Error loading \" + msgName + \" URL: \" + param);\n }\n });\n }\n };\n\n return rval;\n }", "title": "" }, { "docid": "e988eff2772829c8704743af01c2f3e3", "score": "0.5456169", "text": "function jq_deparam_sub(is_fragment,url_or_params,coerce){if(url_or_params===undefined||typeof url_or_params==='boolean'){// url_or_params not specified.\ncoerce=url_or_params;url_or_params=jq_param[is_fragment?str_fragment:str_querystring]();}else{url_or_params=is_string(url_or_params)?url_or_params.replace(is_fragment?re_params_fragment:re_params_querystring,''):url_or_params;}return jq_deparam(url_or_params,coerce);}", "title": "" }, { "docid": "2d36d2537b1d60ed8e151e75111f374f", "score": "0.54480034", "text": "function AddSortParameters(url) {\n var sortParameters = $thead.find('.sortable-th');\n for (var i = 0; i < sortParameters.length; i++) {\n if ($(sortParameters[i]).find('.ptr-sort').hasClass('fa-sort-asc')) {\n url = url + '&sortBy=' + $(sortParameters[i]).attr('data-container') + '&sortingType=asc';\n break;\n } else if ($(sortParameters[i]).find('.ptr-sort').hasClass('fa-sort-desc')) {\n url = url + '&sortBy=' + $(sortParameters[i]).attr('data-container') + '&sortingType=desc';\n break;\n }\n }\n return url;\n }", "title": "" }, { "docid": "05b47ca5ec3e738e8a6257a47b8fc307", "score": "0.54437387", "text": "function paramsToQuery(data) {\n\tdata = data || {};\n\treturn Object\n\t\t.keys(data)\n\t\t.map( key => encodeURIComponent(key) + '=' + encodeURIComponent(data[key]) )\n\t\t.join('&');\n}", "title": "" }, { "docid": "b125ae7409615f9ccc9e679ff7a5aa9c", "score": "0.54368377", "text": "renderQueryString (applySpecialHandlerConversions) {\n let simpleObject = this.renderSimpleObject(applySpecialHandlerConversions);\n return serializeObjectToQueryStringParameters(simpleObject);\n }", "title": "" }, { "docid": "9f7853b5b4d9e17c13ea9b6d873b20bb", "score": "0.54245424", "text": "function replaceParams() {\n var href = $(this).attr(\"href\") || $(this).serialize()\n href = href.match(/\\?(.+)/)[1]\n href = TaxonGuide.cleanParamString(href)\n var state = href.match(/[\\?\\&=]/) ? $.deparam.querystring(href) : {}\n $.bbq.pushState(state, TaxonGuide.REPLACE_EXISTING)\n return false\n }", "title": "" }, { "docid": "20b13e4906eb7d11757331433cf59383", "score": "0.5422195", "text": "function QueryParams()\r\n{\r\n this.fncNameValuePairs = NameValuePairs;\r\n this.fncNameValuePairs(document.location.search.substring(1), \"=\", \"&\");\r\n delete(this.fncNameValuePairs);\r\n}", "title": "" }, { "docid": "3915b2da0a3223c205d80a6a33ea3818", "score": "0.54208696", "text": "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n }", "title": "" }, { "docid": "e5b41ab32106e9268b9b35bb6ae73beb", "score": "0.5418912", "text": "function getUrlParameters() {\n var query = window.location.search.replace('?', '');\n if (query.charAt(query.length - 1) == '&') {//La funcio loadPage() posa un '&' al final de tot a vegades.\n query = query.substring(0, query.length - 1);\n }\n var json_string = '{\"' + decodeURI(query.replace(/&/g, \"\\\",\\\"\").replace(/=/g, \"\\\":\\\"\")) + '\"}';\n return JSON.parse(json_string);\n}", "title": "" }, { "docid": "51670dabeabc5b50b7f6d35597345738", "score": "0.5410293", "text": "function convertArrayToQueryString(arrObj,toListName){\r\n\tvar queryString =\"\";\r\n\t$.each(arrObj, function(index,item) {\r\n\t\t queryString += toListName+'%5B'+index+'%5D'+'='+item+'&';\r\n\t});\r\n\t//queryString = queryString.slice(0,queryString.length - 1);\r\n\treturn queryString;\r\n}", "title": "" }, { "docid": "daef448d4f5e84d8a25eb62a46d4be34", "score": "0.5403049", "text": "toParams() {\n return this.toJS();\n }", "title": "" }, { "docid": "9af05d9a91900958d3526e56c4ccd4a7", "score": "0.53970695", "text": "function removeParam (params, removedParam) {\n //using a copy of the params means that the select obj\n //is still available on query.params for share url generation\n var paramsCopy = $.extend(true, {}, params);\n try {\n delete paramsCopy[removedParam];\n } catch (e) {\n //nested property doesn't exist\n }\n delete paramsCopy.select;\n return paramsCopy;\n}", "title": "" }, { "docid": "47d4c97aa86d6bec5ac4765f8fd42a7b", "score": "0.53663796", "text": "function qs(c,b){b=b||{};return decodeURIComponent((\"\"+c).split(\"?\").pop()).split(\"&\").forEach(function(a){a=a.split(\"=\"),this[a[0]]=(a[1]-0.3534)?+a[1]:a[1]},b),b}", "title": "" }, { "docid": "20dcb0d0eb6dd655c74998e48e2d5241", "score": "0.53598946", "text": "function buscar_parametros_get() {\n var prmstr = window.location.search.substr(1);\n return prmstr != null && prmstr != \"\" ? transformToAssocArray(prmstr) : {};\n}", "title": "" }, { "docid": "ed4c701765281e741b4334b3f50a8737", "score": "0.53598523", "text": "function cleanAjaxQuery(ajaxQuery, parameterizeString) {\n parameterizeString = typeof parameterizeString !== 'undefined' ? parameterizeString : false;\n var cleanQuery = parameterizeString ? \"\" : {} ;\n for (p in ajaxQuery) {\n if(\"_\" == p)\n continue;\n if(parameterizeString) {\n cleanQuery += \" \" + ajaxQuery[p];\n continue;\n }\n cleanQuery[p] = ajaxQuery[p];\n }\n return cleanQuery;\n}", "title": "" }, { "docid": "496902bbd47afed991c0dfe3a1c8684e", "score": "0.5347309", "text": "function query_params() {\nvar urlParams = {};\nvar e,\n a = /\\+/g, // Regex for replacing addition symbol with a space\n r = /([^&=]+)=?([^&]*)/g,\n d = function (s) { return decodeURIComponent(s.replace(a, \" \")); },\n q = window.location.search.substring(1);\n\nwhile (e = r.exec(q)) {\n key = d(e[1]);\n value = d(e[2]);\n\n // if the same key exists multiple times, add it to an array\n // solr has this with facet.field for instance\n if(urlParams.hasOwnProperty(key)) {\n if(typeof urlParams[key] == \"object\") {\n urlParams[key].push(value);\n }\n else {\n urlParams[key] = [ urlParams[key], value ];\n }\n }\n else {\n urlParams[key] = value;\n }\n }\nreturn urlParams;\n}", "title": "" }, { "docid": "b42524be4aa189e981b0ea8af1e760fd", "score": "0.53473073", "text": "function searching_selected_data(params) {\n $.ajax({\n url: \"/organizations/selected_data\",\n data: {\n season: $('#season_id').val().replace(' (current)',''),\n org_id: $('#org').val(),\n session: $('#session_data').val(),\n enrollement: $('#enrollement_id').val(),\n page: params ? params['page'] : 1,\n sort: params ? params['sort'] : null,\n direction: params ? params['direction'] : null\n },\n beforeSend: function () {\n $(\"#form_loading\").show();\n },\n complete: function () {\n $('#form_loading').hide();\n// restoreEnrolleesSelection();\n\n },\n success: function (html) {\n // $('#form_loading').hide();\n $('#loading').empty();\n $('#loading').html(html);\n }\n });\n }", "title": "" }, { "docid": "6c819584a63c4e3db713e7b03bc354e3", "score": "0.5341529", "text": "function paramify(obj) {\n\tvar finalString = '', objArray = [];\n\tfor(var key in obj) {\n\t\t// make sure this obj has this key\n\t\tif (obj.hasOwnProperty(key)) {\n\t\t\tobjArray.push(key + '=' + obj[key]);\n\t\t}\n\t}\n\t// use array to sort element alphabetically\n\tobjArray.sort();\n\tfinalString = objArray.join('&');\n\treturn finalString; // or return join(finalString, '&');\n}", "title": "" }, { "docid": "53292c62d3a64c4581dca074846c000d", "score": "0.532155", "text": "function objectToParams(a) {\n var keys = Object.keys(a);\n keys.sort();\n var str = \"\";\n keys.forEach(function (key) {\n if (a[key]) {\n str += \"&\" + key + \"=\" + a[key];\n }\n });\n return str.substring(1);\n}", "title": "" }, { "docid": "415bcaaa7f446577bd2a34eb249748b1", "score": "0.53187793", "text": "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "title": "" }, { "docid": "415bcaaa7f446577bd2a34eb249748b1", "score": "0.53187793", "text": "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "title": "" }, { "docid": "415bcaaa7f446577bd2a34eb249748b1", "score": "0.53187793", "text": "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "title": "" }, { "docid": "415bcaaa7f446577bd2a34eb249748b1", "score": "0.53187793", "text": "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "title": "" }, { "docid": "415bcaaa7f446577bd2a34eb249748b1", "score": "0.53187793", "text": "function normalizeQueryParams(params) {\n return params && params[0] !== '?' ? '?' + params : params;\n}", "title": "" }, { "docid": "95ea956f07fed1339735316a7ea87ede", "score": "0.53039855", "text": "function paramEncode(str) {\n\n return encodeURIComponent(str);\n\n /*var s = replaceAll(str, '&', '%26');\n s = replaceAll(s, ' ', '+');\n s = replaceAll(s, \"#\", \"%23\");\n return s;*/\n }", "title": "" }, { "docid": "cc2e3c3be24040d244aacece09a3eff4", "score": "0.5302259", "text": "function parseArguments(url, data, success, dataType) {\n\t if ($.isFunction(data)) dataType = success, success = data, data = undefined;\n\t if (!$.isFunction(success)) dataType = success, success = undefined;\n\t return {\n\t url: url,\n\t data: data,\n\t success: success,\n\t dataType: dataType\n\t };\n\t }", "title": "" }, { "docid": "71772cff092378b83b7475307eb460b7", "score": "0.5294177", "text": "function serializeData(options) {\n if (isObject(options.data)) options.data = $.param(options.data)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data)\n }", "title": "" }, { "docid": "6acd17e221e08ca1dd33acd2118c4603", "score": "0.529295", "text": "getParams() {\n // recup params dans url\n const parsedURL = queryString.parse(this.props.location.search);\n const filters = (parsedURL.filters) ? JSON.parse(parsedURL.filters) : null;\n const api = this.props.match.params.api;\n const view = parsedURL.view || 'list';\n const query = parsedURL.query || '';\n const currentQueryText = query;\n const pageSize = parsedURL.pageSize;\n const page = parsedURL.page;\n const sort = (parsedURL.sort) ? JSON.parse(parsedURL.sort) : null;\n const newState = {\n api,\n currentQueryText,\n view,\n request: {\n query,\n sort,\n page,\n pageSize,\n filters,\n },\n data: { results: [] },\n };\n return newState;\n }", "title": "" }, { "docid": "5f949f89c4446f360e4b1eac775ce08e", "score": "0.5292453", "text": "function parseParameters(text=undefined){\n let match;\n let search=/([^&=]+)=?([^&]*)/g;\n let decode=s=>decodeURIComponent(s.replace(/\\+/g,\" \"));\n let search_term=(new URL(window.location.protocol+\"//\"+window.location.hostname+window.daedalus_location)).search;\n \n let query=(text===undefined)?search_term.substring(1):text;\n let urlParams={};\n while(match=search.exec(query)){\n let value=decode(match[2]);\n let key=decode(match[1]);\n if(urlParams[key]===undefined){\n urlParams[key]=[value];\n }else{\n urlParams[key].push(value);\n }\n }\n return urlParams;\n }", "title": "" }, { "docid": "6f4d1ad789a6feed55470d2a4d6b06b4", "score": "0.52864325", "text": "function getParam() {return param;}", "title": "" }, { "docid": "f9b1993fa11b94c3cbd9803d6d7e12ba", "score": "0.5286163", "text": "function ParamMap(){}", "title": "" }, { "docid": "6b46ccef806ddeda8417f784a0d80ba2", "score": "0.52746844", "text": "function serializeQueryString() {\n\t return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n\t }", "title": "" }, { "docid": "308fbe2085d0bf014a6c522aa4b21ab2", "score": "0.5273316", "text": "paramsSerializer(params) {\n return querystring_1.default.stringify(params);\n }", "title": "" }, { "docid": "f5dc78615a61f571f20e722693b6b43a", "score": "0.5270246", "text": "function ajxSelectPostits() {\n serializedData = JSON.stringify({});\n jQuery.ajax({type: 'POST', url: \"ajxSelectPostit.php\", dataType: 'json', data: \"data=\" + serializedData,\n success: function(data) {\n ajxSelectPostitsDone(data);\n }\n });\n }", "title": "" }, { "docid": "cb82b04878a9a79bf568381ce291e234", "score": "0.5269315", "text": "function objectToParameters(obj) {\n var text = '';\n for (var i in obj) {\n // encodeURIComponent is a built-in function that escapes to URL-safe values\n text += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]) + '&';\n }\n return text;\n}", "title": "" }, { "docid": "11536d3c5a4794205c630e375701ad76", "score": "0.52689356", "text": "function setParams() {\n $(\"input[type=radio]:checked\").each(function() {\n var words = _.words($(this).attr('id'), '-');\n var initial = _.initial(words).join('-');\n if (!$(this).attr(\"checked\") || params[initial]) {\n params[initial] = _.last(words);\n }\n });\n $(\"input[type=checkbox]\").each(function() {\n if (_.toBool($(this).attr(\"checked\")) != $(this).prop(\"checked\") ||\n _.toBool(params[$(this).attr('id')]) != $(this).prop(\"checked\"))\n params[$(this).attr('id')] = $(this).prop(\"checked\") ? 1 : 0;\n });\n jHash.val(params);\n }", "title": "" }, { "docid": "d7436d0eb7af7d65ebbbc8b007930a0a", "score": "0.52620524", "text": "function _getAllUrlParams(url, desiredParam) {\n\t\t\tif (typeof desiredParam === 'string') {\n\t\t\t\tdesiredParam = desiredParam.toLowerCase();\n\t\t\t} else {\n\t\t\t\t// Any other type = NO FILTERING\n\t\t\t\tdesiredParam = false;\n\t\t\t}\n\t\n\t\t\t// get query string from url (optional) or window\n\t\t\t// RLN: modified logic to consider any String url as being complete; otherwise URL with no\n\t\t\t// search causing using window URL\n\t//\t\tvar queryString = url ? url.split('?')[1] : window.location.search.slice(1);\n\t\t\tvar queryString = (typeof url === 'string') ? url.split('?')[1] : window.location.search.slice(1);\n\t\n\t\t\t// we'll store the parameters here\n\t\t\tvar obj = {};\n\t\n\t\t\t// if query string exists\n\t\t\tif (queryString) {\n\t\t\t\t// stuff after # is not part of query string, so get rid of it\n\t\t\t\tqueryString = queryString.split('#')[0];\n\t\n\t\t\t\t// split our query string into its component parts\n\t\t\t\tvar arr = queryString.split('&');\n\t\n\t\t\t\tfor (var i=0; i<arr.length; i++) {\n\t\t\t\t\t// separate the keys and the values\n\t\t\t\t\tvar a = arr[i].split('=');\n\t\n\t\t\t\t\t// in case params look like: list[]=thing1&list[]=thing2\n\t\t\t\t\tvar paramNum = undefined;\n\t\t\t\t\tvar paramName = a[0].replace(/\\[\\d*\\]/, function(v) {\n\t\t\t\t\t\t\tparamNum = v.slice(1,-1);\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t});\n\t\n\t\t\t\t\t// set parameter value (use 'true' if empty)\n\t\t\t\t\tvar paramValue = typeof(a[1])==='undefined' ? true : a[1];\n\t\n\t\t\t\t\t// (optional) keep case consistent\n\t\t\t\t\tparamName = paramName.toLowerCase();\n\t\t\t\t\t// RLN: skip paramName not matching filter\n\t\t\t\t\tif (desiredParam) {\n\t\t\t\t\t\tif (paramName !== desiredParam) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// RLN FIX: wrapped to only operate on typeof === 'string'\n\t\t\t\t\tif (typeof paramValue === 'string') {\n\t\t\t\t\t\tparamValue = paramValue.toLowerCase();\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// if parameter name already exists\n\t\t\t\t\tif (obj[paramName]) {\n\t\t\t\t\t\t// convert value to array (if still string)\n\t\t\t\t\t\tif (typeof obj[paramName] === 'string') {\n\t\t\t\t\t\t\tobj[paramName] = [obj[paramName]];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if no array index number specified...\n\t\t\t\t\t\tif (typeof paramNum === 'undefined') {\n\t\t\t\t\t\t\t// put the value on the end of the array\n\t\t\t\t\t\t\tobj[paramName].push(paramValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if array index number specified...\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// put the value at that index number\n\t\t\t\t\t\t\tobj[paramName][paramNum] = paramValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// if param name doesn't exist yet, set it\n\t\t\t\t\t// RLN FIX: when paramValue is boolean, obj[paramName] has no push() failing if param is included again with string value: ?a&a=2\n\t\t\t\t\telse {\n\t\t\t\t\t\tobj[paramName] = [];\n\t\t\t\t\t\tobj[paramName].push(paramValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\treturn obj;\n\t\t}", "title": "" }, { "docid": "006743fa694457cd22a61ba81c8d1c00", "score": "0.5261784", "text": "function handleParams () {\n // thanks http://stackoverflow.com/a/901144/539470\n var parm = function(name) {\n name = name.replace(/[\\[\\]]/g, \"\\\\$&\");\n var url = window.location.href;\n var regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"),\n results = regex.exec(url);\n if (!results) return null;\n if (!results[2]) return '';\n return decodeURIComponent(results[2].replace(/\\+/g, \" \"));\n }\n switch(parm(\"op\")) {\n case \"bookmark\":\n $('#newName').prop('value', parm(\"title\"));\n $('#newLink').prop('value', parm(\"url\"));\n $('#add_bookmark').get(0).scrollIntoView();\n\tbreak;\n default:\n\t// do nothing\n }\n}", "title": "" }, { "docid": "1969864fa9dda403a0b50b12b2301e77", "score": "0.5249755", "text": "function prepArrayForAjax( array ) {\n\toutput = \"\";\n for (i in array){\n \toutput += i +\"=\"+array[i]+\"&\";\n }\n return output;\n}", "title": "" }, { "docid": "ada5f3c679cd716bc0da0030c7ac4e0b", "score": "0.52424824", "text": "function _encodeParam(param) {\n\t// parameters are usually a string\n\t// though they may be other types, such as number\n\t// only string would be encoded.\n\tif (!param || typeof param != 'string') return param;\n\treturn param.replace(/\\$/g,'$dl').replace(/\\,/g,'$cm').replace(/\\|/g,'$vb');\n}", "title": "" }, { "docid": "d0c6c1cfe647febe5f3173476affb432", "score": "0.5234947", "text": "function serialize(params){\n var qs=\"?\";\n\n for(var param in params){\n if(params.hasOwnProperty(param)){\n var key = param;\n var value = params[param];\n qs+=encodeURIComponent(key);\n qs+=\"=\";\n qs+=encodeURIComponent(value);\n qs+=\"&\";\n }\n }\n\n return qs.substring(0, qs.length - 1);\n }", "title": "" }, { "docid": "74d37e39cd8fe89d6a928fff2a28bbda", "score": "0.5234147", "text": "function verifyParameters() {\r\n var sql = null;\r\n \r\n // Ugh, this is ugly, need to rework this soon\r\n if (DataExplorer.QueryEditor.exists()) {\r\n sql = DataExplorer.QueryEditor.value();\r\n } else {\r\n // This is a pretty big assumption\r\n sql = $('#queryBodyText').text();\r\n }\r\n\r\n if (!sql) {\r\n return false;\r\n }\r\n\r\n var params = DataExplorer.QueryEditor.parse(sql),\r\n ordered = [],\r\n complete = true,\r\n wrapper = document.getElementById('query-params'),\r\n fieldList = wrapper.getElementsByTagName('input'),\r\n fields = {},\r\n field, name, label, row, value, hasValue, key, first;\r\n\r\n $(wrapper).toggle(!!params.count);\r\n\r\n for (var i = fieldList.length - 1; i > -1 ; --i) {\r\n field = fieldList.item(i);\r\n value = field.getAttribute('value');\r\n name = field.name;\r\n\r\n if (field.value && field.value.length /*&& value != field.value*/) {\r\n fields[name] = field.value; \r\n }\r\n\r\n field.parentNode.parentNode.removeChild(field.parentNode);\r\n }\r\n\r\n for (key in params.items) {\r\n ordered[params.items[key].index] = params.items[key];\r\n ordered[params.items[key].index].name = key;\r\n }\r\n\r\n for (var i = 0; i < ordered.length; ++i) {\r\n label = document.createElement('label');\r\n label.htmlFor = 'dynParam' + i;\r\n label[_textContent] = ordered[i].name;\r\n\r\n value = fields[ordered[i].name];\r\n hasValue = !(!value && value !== 0);\r\n\r\n if (!hasValue) {\r\n value = window.location.param(ordered[i].name);\r\n hasValue = !(!value && value !== 0);\r\n }\r\n\r\n if (!hasValue) {\r\n value = ordered[i].auto;\r\n hasValue = !(!value && value !== 0);\r\n }\r\n\r\n if (!hasValue && ordered[i].name.toLowerCase() === 'userid') {\r\n if (DataExplorer.options.User.isAuthenticated &&\r\n DataExplorer.options.User.guessedID) {\r\n hasValue = true;\r\n value = DataExplorer.options.User.guessedID;\r\n }\r\n }\r\n\r\n if (complete) {\r\n complete = hasValue;\r\n }\r\n\r\n field = document.createElement('input');\r\n field.name = ordered[i].name;\r\n field.id = 'dynParam' + i;\r\n field.type = 'text';\r\n\r\n if (hasValue) {\r\n field.setAttribute('value', value);\r\n } else if (!first) {\r\n first = field;\r\n }\r\n\r\n row = document.createElement('div');\r\n row.className = 'form-row';\r\n row.appendChild(label);\r\n row.appendChild(field);\r\n\r\n wrapper.appendChild(row);\r\n }\r\n\r\n if (!complete && first) {\r\n first.focus();\r\n }\r\n\r\n return complete;\r\n }", "title": "" }, { "docid": "4da7e43a6656b73683e7374c4e4c9737", "score": "0.5230188", "text": "function queryParams(params) {\n // params.advFilter = \"projectID\";\n params.serviceID = id;\n return(params);\n // return {advFilter: 'projectID', advFilterValue: id};\n}", "title": "" }, { "docid": "792156aa540aaa12ba9e8f9ce4d3c25a", "score": "0.521088", "text": "function getQueryParameters(str){\n return (str || document.location.search).replace(/(^\\?)/,'').split(\"&\").map(function(n){return n = n.split(\"=\"),this[n[0]] = n[1],this}.bind({}))[0];\n}", "title": "" }, { "docid": "1c8c962a81285eb0afc170f64defa606", "score": "0.52085775", "text": "function JOSC_HTTPParam()\r\n{\r\n}", "title": "" }, { "docid": "203ca5f4696bf7ffb42865cadea215bf", "score": "0.51985186", "text": "function prepareQuery() {\n\tvar selections = [paragraph_id];\n\t$(\".tagit-label\").each(function() { selections.push($(this).text()) });\n\tvar json_data = JSON.stringify({\n\t\t\"param\": selections.join(\"\\t\"),\n\t\t\"passcode\" : $('#passcode_hidden_id').val()\n\t});\n\t\n\treturn json_data;\n}", "title": "" }, { "docid": "4e0fa2781141c528120301ea07c06d9f", "score": "0.51675063", "text": "function qs() {\n\tvar qsParam = new Array();\n\tvar query = window.location.search.substring(1);\n\tvar parms = query.split('&');\n\tfor (var i = 0; i < parms.length; i++) {\n\t\tvar pos = parms[i].indexOf('=');\n\t\tif (pos > 0) {\n\t\t\tvar key = parms[i].substring(0, pos);\n\t\t\tvar val = parms[i].substring(pos + 1);\n\t\t\tqsParam[key] = val;\n\t\t}\n\t}\n\treturn qsParam;\n}", "title": "" }, { "docid": "aceb2efb2f8bf8394fda30c189887e33", "score": "0.51607347", "text": "function getSearchParams() {\n\t\t \tif ( $('.page-template-property-half-map .noo-form-halfmap').length > 0 ) {\n\t\t \t\treturn $('.page-template-property-half-map .noo-form-halfmap').serializeArray();\n\t\t \t}\n\t\t \treturn form_map.serializeArray();\n\t\t }", "title": "" }, { "docid": "ec809c1d2c7390c477e240db53b1e2f1", "score": "0.5158881", "text": "objectToQueryString(a) {\n\t\tlet prefix, add, r20, output;\n\t\tlet s = [];\n\t\tr20 = /%20/g;\n\t\tadd = function (key, value) {\n\t\t\t// If value is a function, invoke it and return its value\n\t\t\tvalue = (typeof value == 'function') ? value() : (value == null ? \"\" : value);\n\t\t\ts[s.length] = encodeURIComponent(key) + \"=\" + encodeURIComponent(value);\n\t\t};\n\t\tif (a instanceof Array) {\n\t\t\ta.forEach((value, key) => add(key, value));\n\t\t} else {\n\t\t\tfor (prefix in a) {\n\t\t\t\tthis.buildParams(prefix, a[prefix], add);\n\t\t\t}\n\t\t}\n\t\toutput = s.join(\"&\").replace(r20, \"+\");\n\t\treturn output;\n\t}", "title": "" }, { "docid": "106b601fb489d90e9abcb56074c1b96e", "score": "0.51548284", "text": "function encodeQueryData(data)\n {\n var ret = [];\n for (var d in data)\n ret.push(encodeURIComponent(d) + \"=\" + encodeURIComponent(data[d]));\n return ret.join(\"&\");\n }", "title": "" }, { "docid": "e6a5a176784c74d90346dbc299bbbb7c", "score": "0.51515883", "text": "function _setParamIfEmpty(param){\r\n\t\t\r\n\t\tif(param == undefined){\r\n\t\t\tparam = {};\r\n\t\t}\r\n\t\r\n\t\tif(param['parent_slt'] == undefined){\r\n\t\t\tthrow new Error(\"Please set a 'parent_slt'\");\r\n\t\t}\r\n\t\r\n\t\tif(param['row_slt'] == undefined){\r\n\t\t\tparam['row_slt'] = 'tr';\r\n\t\t}\r\n\t\r\n\t\tif(param['def_ent'] == undefined){\r\n\t\t\tthrow new Error(\"Please set a 'def_ent'\");\r\n\t\t}\r\n\t\r\n\t\tif(param['sort_field'] == undefined){\r\n\t\t\tparam['sort_field'] = 'sort_no';\r\n\t\t}\r\n\t\t\r\n\r\n\t\t\r\n\t\tif(param['fields'] == undefined){\r\n\t\t\tvar fields = [];\r\n\t\t\tfor(var f in param['def_ent']){\r\n\t\t\t\tfields.push(f);\r\n\t\t\t}\r\n\t\t\tparam['fields'] = fields;\r\n\t\t}\r\n\t\t\r\n\t\treturn param;\r\n\t}", "title": "" }, { "docid": "c915a0986cac47e284ba71c5c1e5967b", "score": "0.5146189", "text": "function getURLArg() \n{ \n var query = location.search.substr(1);\n var data = query.split(\"&\");\n var result = {};\n for(var i=0; i<data.length; i++) \n {\n var item = data[i].split(\"=\");\n result[item[0]] = item[1];\n }\n return result;\n}", "title": "" }, { "docid": "8440d2cc8a54b353c00bac46cd97857e", "score": "0.51396245", "text": "function parseArguments(url, data, success, dataType) {\r\n if ($.isFunction(url)) {\r\n dataType = data, success = url, data = undefined,url = undefined;\r\n } else if ($.isFunction(data)) {\r\n dataType = success, success = data, data = undefined;\r\n } \r\n if (!$.isFunction(success)) dataType = success, success = undefined\r\n return {\r\n url: url,\r\n data: data,\r\n success: success,\r\n dataType: dataType\r\n }\r\n }", "title": "" }, { "docid": "8440d2cc8a54b353c00bac46cd97857e", "score": "0.51396245", "text": "function parseArguments(url, data, success, dataType) {\r\n if ($.isFunction(url)) {\r\n dataType = data, success = url, data = undefined,url = undefined;\r\n } else if ($.isFunction(data)) {\r\n dataType = success, success = data, data = undefined;\r\n } \r\n if (!$.isFunction(success)) dataType = success, success = undefined\r\n return {\r\n url: url,\r\n data: data,\r\n success: success,\r\n dataType: dataType\r\n }\r\n }", "title": "" }, { "docid": "a189b12be1ad3d431d8b696243af1c95", "score": "0.51392436", "text": "function stringifyParams (obj) {\n return obj ? index$5(index$4(obj).sort(), function (key) {\n var val = obj[key]\n\n if (angular.isArray(val)) {\n return index$5(val.sort(), function (val2) {\n return encodeURIComponent(key) + '=' + encodeURIComponent(val2)\n }).join('&')\n }\n\n return encodeURIComponent(key) + '=' + encodeURIComponent(val)\n }).join('&') : ''\n }", "title": "" }, { "docid": "ccd2b08a858b79abc9bd9a6ac805bebe", "score": "0.51324207", "text": "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "title": "" }, { "docid": "ccd2b08a858b79abc9bd9a6ac805bebe", "score": "0.51324207", "text": "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "title": "" }, { "docid": "f8a272ea59ccaa0c0e242a3bcc5b7724", "score": "0.5130466", "text": "function parseArguments(url, data, success, dataType) {\n if ($.isFunction(data)) dataType = success, success = data, data = undefined\n if (!$.isFunction(success)) dataType = success, success = undefined\n return {\n url: url\n , data: data\n , success: success\n , dataType: dataType\n }\n }", "title": "" }, { "docid": "ae4f9723965696ae7bd5dda72dad0d72", "score": "0.5129219", "text": "function encodeQueryPhil(q,sf) {\n var encodedQuery = encodeURIComponent(q);\n var url = [APIurl];\n url.push('/' + encodedQuery);\n url.push('?callback=?');\n //console.log(url.join(''));\n $.ajax({\n url: url.join(''),\n dataType: \"jsonp\",\n success: sf,\n error: function () {alert(\"AJAX ERROR for \" + q ); }\n });\n}", "title": "" } ]
79eaf7a56ae1b2e8aa1868dea7568578
Registers New User Info
[ { "docid": "0fb6049eb622b9ed135e6f3aad1bce9a", "score": "0.0", "text": "function register(){\n var fieldValue = document.getElementById(\"fName\").value;\n localStorage.setItem(\"fName\", fieldValue);\n var fieldValue = document.getElementById(\"lName\").value;\n localStorage.setItem(\"lName\", fieldValue);\n var fieldValue = document.getElementById('mail').value;\n localStorage.setItem(\"mail\", fieldValue);\n var fieldValue = document.getElementById('currentUser').value;\n localStorage.setItem(\"currentUser\", fieldValue);\n var fieldValue = document.getElementById('pass').value;\n localStorage.setItem(\"pass\", fieldValue);\n}", "title": "" } ]
[ { "docid": "2f3db65a228b5a92e61d9c094f435837", "score": "0.7313098", "text": "function register() {\n var userName = request.params;\n\n response.end(JSON.stringify(userName));\n\n// if(request.user in data){\n// response.end(response.statusCode);\n// } else {\n// response.end(JSON.stringify(data));\n// }\n\n //Creates a new user and returns a key for that user.\n //If the user already exists just returns a 409 response code.\n }", "title": "" }, { "docid": "259be26b922f629a2ed988654f270948", "score": "0.7067537", "text": "function registerUser() {\n\t\t\tuserFactory.register({\n\t\t\t\temail: $scope.newAccount.email,\n\t\t\t\tpassword: $scope.newAccount.password\n\t\t\t})\n\t\t\t.then((userData) => {\n\t\t\t\t// any error registering will return the userData as undefined -- if register is successfull then log in and update User Profile Name\n\t\t\t\tif (userData !== undefined ){\n\t\t\t\t\t//Immediately log them in\n\t\t\t\t\tuserFactory.logIn($scope.newAccount)\n\t\t\t\t\t.then((newaccount) => {\n\t\t\t\t\t\tlet name = $scope.displayName;\n\t\t\t\t\t\t//Update profile using the name they provided\n\t\t\t\t\t\tuserFactory.updateDisplayName(name);\n\t\t\t\t\t})\n\t\t\t\t\t.then(() => {\n\t\t\t\t\t\taddUser();\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\tconsole.log(\"error updating display name\", error);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "18cceaadaa64fcb96be72a2019aaa8c6", "score": "0.7067219", "text": "function registerUser() {\r\n clearError()\r\n addUser() \r\n }", "title": "" }, { "docid": "f7591e10b532da6915bf32be0fb3ba0f", "score": "0.6939118", "text": "function registerUser(){\n\t//alert('register user ' + username);\n\t//trace(\"REGISTER\");\n\tCloud.Users.create({\n\t //username: \"new_username_\" + Ti.Platform.name, //_\" + Math.floor((Math.random() * 100) + 1),\n\t username: username,\n\t password: password,\n\t password_confirmation: password,\n\t first_name: \"Firstname\",\n\t last_name: \"Lastname\"\n\t}, function (e) {\n\t if (e.success) {\n\t \t//alert(\"USER CREATED SUCCESSFULLY.\");\n\t\t\t// user created successfully\n\t } else {\n\t // oops, something went wrong\n\t //alert(\"USER not created. something went wrong \"+e);\n\t }\n\t login();\n\t});\n}", "title": "" }, { "docid": "495b4a32e89483b31aa0824be0aecee1", "score": "0.69203675", "text": "register(){\n if(_.isEmpty(this.email) || _.isEmpty(this.password) || _.isEmpty(this.username)) return;\n keys = this.createKeys();\n //FIXME have a field where the suer inputs their actual name\n Accounts.createUser({\n username: this.username,\n email: this.email,\n password: this.password,\n createdAt: new Date(),\n profile: {\n name: '',\n picture: '',\n contacts: {},\n key: this.create_random_string()\n }\n }, (err) => {\n if (err) return this.handleError(err);\n //redirect to chats page\n this.$state.go('tab.chats');\n });\n\n }", "title": "" }, { "docid": "f4bda98218daed8b8731085ab12ec7f9", "score": "0.69170064", "text": "function register(data, callback) {\n var usersCollection = data.DbHelper.getCollection('Users');\n\n var now = (new Date()).getTime();\n\n var credentials = data.user.credentials;\n\n data.user.settings.sound = true;\n var newUser = {\n 'geoInfo': data.user.geoInfo,\n 'settings': data.user.settings,\n 'score': 0,\n 'xp': 0,\n 'rank': 1,\n 'createdAt': now,\n 'lastLogin': now,\n 'lastClientInfo': data.user.clientInfo\n };\n\n if (data.user.credentials.type === 'facebook') {\n newUser.facebookUserId = data.user.credentials.facebookInfo.userId;\n newUser.facebookAccessToken = data.user.credentials.facebookInfo.accessToken\n newUser.name = data.user.name;\n newUser.email = data.user.email; //keep sync with Facebook changes - might be null if user removed email permission\n newUser.ageRange = data.user.ageRange;\n }\n else if (data.user.credentials.type === 'guest') {\n newUser.uuid = data.user.credentials.guestInfo.uuid;\n newUser.name = generalUtils.settings.client.ui[data.user.settings.language]['GUEST_DEFAULT_NAME'];\n if (generalUtils.settings.server.guest.name.random.use) {\n var randomNumber = random.rnd(generalUtils.settings.server.guest.name.random.range.min, generalUtils.settings.server.guest.name.random.range.max);\n newUser.name += ' ' + randomNumber;\n }\n newUser.avatar = generalUtils.settings.server.guest.defaultAvatar;\n }\n else {\n callback(new exceptions.ServerException('Unsupported credentials type: ' + data.user.credentials.type + '. Supported types are: facebook, guest', {}, 'error'));\n return;\n }\n\n if (data.user.gcmRegistrationId) {\n newUser.gcmRegistrationId = data.user.gcmRegistrationId;\n }\n\n usersCollection.insert(newUser\n , {}, function (err, insertResult) {\n if (err) {\n\n closeDb(data);\n\n callback(new exceptions.ServerException('Error inserting new user', {\n 'user': newUser,\n 'dbError': err\n }, 'error'));\n return;\n }\n\n data.user = newUser;\n data.user.credentials = credentials;\n data.user.justRegistered = true; //does not need to be in db - just returned back to the client\n\n checkToCloseDb(data);\n\n callback(null, data);\n });\n}", "title": "" }, { "docid": "f4ca7fa9cbfe1a4202d3e6c1d9ece094", "score": "0.6810452", "text": "createUserInfo() {\n UserInfoActions.createUserInfo()\n }", "title": "" }, { "docid": "260e36e79dbcb71489118b8964867c0d", "score": "0.68006766", "text": "function register() {\n var name = livechat.vm.username;\n var userid = livechat.vm.username;\n if (name == '') {\n window.alert(\"You must insert your user name\");\n return;\n }\n\n setRegisterState(settings.registerState.REGISTERING);\n\n var message = {\n id: 'register',\n name: name,\n number: userid,\n type: 'USER'\n };\n sendMessage(message);\n}", "title": "" }, { "docid": "23dae1ef01fe1a43bd879a8a7cf3b8a0", "score": "0.66925603", "text": "function onRegister({ name,username,pwd }) { \n //crates a modal \n let user = new User(name,pwd)\n if(JSON.parse(localStorage.getItem(\"all_users_data\")) === null) {\n localStorage.setItem(\"all_users_data\", JSON.stringify({}))\n }\n let totUsers = JSON.parse(localStorage.getItem(\"all_users_data\"))\n totUsers[username] = user\n localStorage.setItem(\"all_users_data\",JSON.stringify(totUsers))\n //saves to db\n //close the modal\n}", "title": "" }, { "docid": "570c96ebd8d6393cb1f4192292e60c25", "score": "0.6661926", "text": "function _onRegisterSucceed(userInfo) {\n var user = JSON.parse(userInfo.response).user;\n CDHelper.displayHideDiv(prog_register_loadingRing, false);\n CDHelper.showHideLoading(false);\n WinJS.Navigation.navigate(Pages.dataSources);\n Login.saveCredentials(new LoginHelper.UserCredentials(user.email, txt_register_pswValue.value));\n //ToDo\n Messages.showConfirmMessage(MessagesHelper.MSG_REGISTER_TITLE_ERROR, MessagesHelper.TXT_VALIDATE_ACCOUNT);\n topAppBar.winControl.disabled = false;\n topAppBarInIntro.winControl.disabled = true;\n // fill bugsnag user\n CDHelper.requireScriptJS(Scripts.bugsnag);\n BugsnagTemplate.fillUserBugsnag(user);\n }", "title": "" }, { "docid": "d1c5786ee0a850f9872858a793e5733d", "score": "0.6654602", "text": "function addUser(user, email, password, admissionyear) {\n usersInfo.push({\n Email: email, // For adding @~\n Password: password,\n AdmissionYear: admissionyear,\n Grade: Grade\n });\n console.log(user, \"You are signed up!!!\");\n window.location=\"main.html\";\n }", "title": "" }, { "docid": "554a870192c6f895056bcc94d5fb28d8", "score": "0.66480374", "text": "function update_user_info(data, success, fail) {\n _post(updateUserUrl, data, success, fail)\n}", "title": "" }, { "docid": "58db4e7669598db93ae9466864f1c7c0", "score": "0.6617397", "text": "function info(){\r\n firebase.database().ref(\"users/\"+uid).set({ \r\n \"uid\": uid ,\r\n \"Email\": email_signup,\r\n \"Avatar\" : \"https://firebasestorage.googleapis.com/v0/b/chat-app2-b59ab.appspot.com/o/JSIMG%2Fpp.png?alt=media&token=17b65eef-fe8d-4ff0-9b8f-3ada4ffd4e11\",\r\n \"Password\": pass_signup,\r\n 'UserName': username\r\n });\r\n}", "title": "" }, { "docid": "c3e68acae66714565cd27a00a457b116", "score": "0.6615468", "text": "function register( req, res ) {\n // TODO: Validate unique username and send notification accordingly\n // TODO: Encrypt password\n\n User.create ({\n username: req.body.username,\n password: req.body.password\n }, function ( err, user ) {\n if ( err ) {\n return world.handleError ( res, \"Registration problem\", err );\n }\n\n return world.myRender ( req, res, \"success\", {\n title: \"User created\",\n data: {\n username: req.body.username\n }\n });\n\n });\n }", "title": "" }, { "docid": "f6cf30aa18a78a0f844a2848be370ce7", "score": "0.659584", "text": "function createUserData() {\n\n\t// Saves data for application storage \n\tEcwidApp.setAppStorage(initialConfig.private, function (value) {\n\t\tconsole.log('Initial private user preferences saved!');\n\t});\n\n\t// Saves data for public app config\n\tEcwidApp.setAppPublicConfig(initialConfig.public, function (value) {\n\t\tconsole.log('Initial public user preferences saved!');\n\t});\n\n\t// Function to prepopulate values of select, input and textarea elements based on default settings for new accounts\n\tsetValuesForPage(initialConfig);\n\n\tselected();\n\tsetInfo();\n\tloadReq();\n\n\tdocument.querySelector(\"#body\").style.display = 'block';\n}", "title": "" }, { "docid": "5c42ac67c169929dd1e13341c4157f41", "score": "0.65835935", "text": "register(request, response) {\n const user = request.body;\n user.id = uuid();\n user.height = Number(user.height);\n user.startingweight = Number(user.startingweight);\n user.noOfAssessments = 0;\n userstore.addUser(user);\n logger.info(`registering ${user.email}`);\n response.redirect('/');\n }", "title": "" }, { "docid": "316a7e67f554b6c4f274b412e11a31c2", "score": "0.65696406", "text": "function onNewUser() {\n console.log('This is a new user');\n // Informs user\n // TODO(issue/102): replace with proper notification\n alert(STRINGS['new-user-info']);\n\n window.location.href = HOMEPAGE_PATH;\n}", "title": "" }, { "docid": "cebe01f73fdd6600e5922ee79a12c16d", "score": "0.6552602", "text": "function register() {\r\n self.text = \"\";\r\n if(!validateEmail(self.user.email)){\r\n self.text += \"Bitte geben Sie eine korrekte Email Adresse ein. \\n\";\r\n }\r\n if(self.user.password != self.user.passwordRepeat){\r\n self.text += \"Das Passwort und das wiederholte Passwort müssen übereinstimmen. \\n\";\r\n }\r\n if(self.text != \"\"){\r\n $(\"#registerErrorModal\").modal();\r\n }\r\n else {\r\n $requests.register(self.user, self.callback);\r\n }\r\n }", "title": "" }, { "docid": "417639a66b6b9498f1c2ef6f03552fe3", "score": "0.6545912", "text": "function newUserHandler(data) {\n var user = data.val();\n // TODO: send user a text\n}", "title": "" }, { "docid": "8c974b2455172a9f0c5719f3b83e1876", "score": "0.65305316", "text": "function registerUser() {\n const userData = getUserData(true);\n\n if (!isDataValid(userData)) {\n showMessage(\"Info: All fields need to be filled out and valid!\");\n return;\n }\n\n fetch(\"/users\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(userData)\n })\n .then(res => res.json())\n .then(res => {\n showMessage(\"Successfully registered...\").then(() => {\n hideModal();\n });\n })\n .catch(err => {\n showMessage(\"Registration failed.\");\n console.log(err.message);\n });\n}", "title": "" }, { "docid": "dfe31ded563df44e3e490c06a7a6ff55", "score": "0.65205777", "text": "userRegister (data) {\n return instance.post(API.register, data)\n }", "title": "" }, { "docid": "76c960e85230644a88d5fcec17a00c13", "score": "0.65129673", "text": "function setUserInformation( name, email, type ){\n\n /* setting the information to be saved */\n var userInformationReference = {\n name : name,\n email: email,\n type: type\n };\n\n // Saving the user information\n $localStorage.userInformation = JSON.stringify( userInformationReference );\n }", "title": "" }, { "docid": "8c473f8084ad607a1abd656358bca559", "score": "0.64898086", "text": "function handleNewUser(userID, userName) {\n setUserID(userID)\n setUserName(userName)\n }", "title": "" }, { "docid": "f9ae25a341d1c0cc591e04080234efba", "score": "0.648637", "text": "function setup_user(){\n\t\toauth.get(redirect+\"/api/users/show.json\", function (data){\n\t\t\t\tuserinfo = data.text;\n\t\t\t\tconsole.log(userinfo);\n\t\t\t}, \n\t\t\tfunction(data){\n\t\t\t\t\tconsole.log(\"Api: Could not get userinfo\");\n\t\t\t\t});\t\t\t\n\t}", "title": "" }, { "docid": "784474d5b0cf88173dcf6d22b29e5137", "score": "0.648589", "text": "static async createUser(userInfo) {\n\t\ttry {\n await Storage.setProfile(userInfo.profile);\n return 200;\n\t\t} catch (error) {\n\t\t\tthrow Error('unable to create a user');\n\t\t}\n }", "title": "" }, { "docid": "a9a157e3c9fd5e0e2d16be3e8ba9c20d", "score": "0.64838773", "text": "function addUser() {\n \n users = getUsers();\n usersIdTracker = parseInt(getUserIdTracker()) + 1;\n validateUserSignup = validateSignup();\n \n if(validateUserSignup == true) { \n password = hashPassword(document.getElementById(\"password\").value);\n username = (document.getElementById(\"userName\").value).toString()\n newUser = {\t\n \"userID\" : usersIdTracker,\n \"img\" : \"\",\n \"userName\" : username.toLowerCase(),\n \"fullName\" : document.getElementById(\"fullName\").value,\n \"mail\" : document.getElementById(\"mail\").value,\n \"phone\" : \"\",\n \"password\" : password,\n \"location\" : \"\",\n \"sex\" : \"\",\n \"userType\" : \"user\",\n \"level\" : \"0\",\n \"ban\" : \"0\" ,\n \"latlong\" : [],\n \"bio\": \"Hi, I am new to the i2talk chatting platform\"\n }\n localStorage.setItem(\"tempUsers\", JSON.stringify(newUser));\n loggedUserIn(username);\n localStorage.setItem(\"logged\", JSON.stringify(newUser.userName));\n localStorage.setItem(\"usersIdTracker\", usersIdTracker);\n window.location.assign(\"welcome.html\");\n } else {\n document.getElementById(\"error-signup\").style.display = \"Block\";\n document.getElementById(\"error-signup\").innerHTML = validateUserSignup;\n //window.location.assign(\"#formSignUp\");\n }\n event.preventDefault();\n}", "title": "" }, { "docid": "ae781b167db0d37fddb57d35457527f1", "score": "0.64794046", "text": "function _registerUser() {\n // Check if all inputs values are valide or no\n if (_isValidCredentials()) {\n CDHelper.displayHideDiv(prog_register_loadingRing, true);\n CDHelper.showHideLoading(true);\n var user = new User(txt_register_firstNameValue.value, txt_register_lastNameValue.value, txt_register_emailAdress.value, txt_register_pswValue.value);\n LoginServices.signUpRequest(user, _onRegisterSucceed, _onRegisterFailed);\n }\n }", "title": "" }, { "docid": "44638e34ad2cc7198a47911723366911", "score": "0.6471825", "text": "addUserData(userData)\n {\n this._loadedUserInfo({\n body: userData,\n });\n }", "title": "" }, { "docid": "a0b0a646bccf4e8746b80edbe77e4096", "score": "0.64691514", "text": "function register() {\n var email = $(constants.locators.register.email).val();\n var displayName = $(constants.locators.register.name).val();\n var password = $(constants.locators.register.password).val();\n var confirmation = $(constants.locators.register.passwordConfirm).val();\n\n // Clear any validation errors that might've occured during\n // previous submissions\n clearValidationErrors();\n\n try {\n // Make sure all user-supplied data is valid\n validateRegistrationForm();\n } catch (e) {\n // If any issues were discovered with user data,\n // let the user know and halt the registration process\n displayValidationError(e.locator, e.message);\n return;\n }\n\n // Proceed with actual registration; display an error\n // message if the server has found any issue with the data\n loginApi.register(\n email, displayName, password,\n displayRegistrationSuccessMessage,\n displayRegistrationBackendError\n );\n }", "title": "" }, { "docid": "e93c4f328d4b0402960e4eb81586308f", "score": "0.6460482", "text": "function signUpUser(userInfo) {\n $.post(\"/api/signup\", {\n firstName: userInfo.firstName,\n lastName: userInfo.lastName,\n email: userInfo.email,\n password: userInfo.password\n }).then(function(data) {\n window.location.reload();\n console.log(\"signed up\");\n }).catch(handleLoginErr);\n }", "title": "" }, { "docid": "884218108d1c6e49bc49077468f49271", "score": "0.6456982", "text": "function UserInfo(id, name, email, password, agree) {\n this.id = id;\n this.name = name;\n this.email = email;\n this.password = password;\n this.agree = agree;\n}", "title": "" }, { "docid": "23317b299cd94c53f6fd40274d292620", "score": "0.6455492", "text": "function createUser(event) {\r\n let data = {};\r\n data.email = $('[name=email]')[0].value;\r\n data.password = $('[name=password]')[0].value;\r\n data.firstname = $('[name=firstname]')[0].value;\r\n data.infix = $('[name=infix]')[0].value;\r\n data.lastname = $('[name=lastname]')[0].value;\r\n data.street = $('[name=street]')[0].value;\r\n data.housenumber = $('[name=housenumber]')[0].value;\r\n data.zipcode = $('[name=zipcode]')[0].value;\r\n data.city = $('[name=city]')[0].value;\r\n data.newsletter = $('[name=newsletter]')[0].checked ? 1 : 0;\r\n data.country = $('[name=country]')[0].value;\r\n\r\n api(\r\n 'users',\r\n function (response, status) {\r\n loadPage('login');\r\n },\r\n function (response, status) {\r\n\r\n },\r\n 'POST',\r\n data\r\n );\r\n}", "title": "" }, { "docid": "ef4e92c21e0dd62c05054dc7e8afd9aa", "score": "0.64541817", "text": "function addUser() {\n\n console.log('writing to ' + userID);\n writeUserData(userID);\n showIndex();\n}", "title": "" }, { "docid": "892ab06ef19ba5af7180369bebf9cbeb", "score": "0.64538217", "text": "function register(req, res, next) {\n // check for existing username\n User.count({ username: req.body.username }, (err, count) => {\n // handle case of dumplicate username\n if (count > 0) {\n flashError([{ msg: 'Username already exists.' }], req, res);\n return;\n }\n\n // set plain text fields\n const user = new User({\n displayName: req.body.displayName,\n username: req.body.username,\n email: req.body.email,\n admin: false,\n created: new Date(),\n });\n\n // set password and save\n user.setPassword(req.body.password, () => {\n saveUser(user, next);\n });\n });\n}", "title": "" }, { "docid": "423c7d735d1c47ac68937edb298b8ff4", "score": "0.6452368", "text": "function createUserData() {\n\n\t// Saves data for application storage \n\tEcwidApp.setAppStorage(initialConfig.private, function(value){\n\t\tconsole.log('Initial private user preferences saved!');\n\t});\n\n\t// Saves data for public app config\n\tEcwidApp.setAppPublicConfig(initialConfig.public, function(value){\n\t\tconsole.log('Initial public user preferences saved!');\n\t});\n\n\t// Function to prepopulate values of select, input and textarea elements based on default settings for new accounts\n\tsetValuesForPage(initialConfig);\n}", "title": "" }, { "docid": "809758cdd63827acafcb7420b6e5c01d", "score": "0.6442701", "text": "function onUserCreated( tStatus )\n {\n console.log( 'creatue new user status:' );\n console.log( tStatus.dataValues );\n\n //return to this page for now (reset fields)\n tResponse.redirect( '/register' );\n }", "title": "" }, { "docid": "fe6a8159c82148bcaa71f770b37c7c83", "score": "0.6441392", "text": "function RegisterUser (){\n addUser();\n }", "title": "" }, { "docid": "9d74167a5a0ac4cb03d5c01fbda2169e", "score": "0.6437947", "text": "function setUserData(user){\n $('#nickname').html('<h4>'+ user.login +'</h4>');\n var html = '<h5>Name: '+ user.name + '</h5><h5>Name: '+ user.email + '</h5><h5>Name: '+ user.country\n + '</h5><h5>Name: '+ user.city + '</h5><h5>Name: '+ user.createDate + '</h5>';\n $('#info').html(html);\n}", "title": "" }, { "docid": "0e250a92b1675126e1caf244b576d914", "score": "0.6435323", "text": "function createUser()\n\t{\n\t\tif( ! redirect(\"http://localhost/Examensarbete/App/CodeIgniter/index.php/register/create_user\"))\n\t\t{\n\t\t\tlet username = createUsername();\n\t\t\tlet password = createPassword();\n\t\n\t\t\tdocument.getElementById(\"form-username\").value = username;\n\t\t\tdocument.getElementById(\"form-password\").value = password;\n\t\t\tdocument.getElementById(\"form-passconf\").value = password;\n\t\n\t\t\tcreated_users_data.push([username, password]);\n\t\t\t\n\t\t\tlocalStorage.setItem(\"users_added\", users_added + 1);\n\t\t\tlocalStorage.setItem(\"created_users_data\", JSON.stringify(created_users_data));\n\t\n\t\t\tprintTimesRun();\n\t\n\t\t\tdocument.getElementsByName(\"submit\")[0].click();\n\t\t}\n\t}", "title": "" }, { "docid": "49249a0c9ba44297499bc9d61182d8d2", "score": "0.6433993", "text": "function newUser(id = adminId, name) {\n if(userExists(id)) return\n let time = getDate() + \" \" + getTime()\n let userData = [id, time, time,\"[]\", name]\n userSheet().insertRowBefore(2).getRange(2, 1, 1, userData.length).setValues([userData]);\n}", "title": "" }, { "docid": "7ff2df370fcd856b56ca0b20cc121b95", "score": "0.642804", "text": "function addUser(data) {\n console.log(` Adding: ${data.firstName} ${data.lastName} (${data.owner})`);\n Users.insert(data);\n}", "title": "" }, { "docid": "3041db7db46d365577c299498e76d708", "score": "0.6421342", "text": "function populateUserInfo() {\n document.getElementById('upUserName').innerHTML =currentUser.userName;\n document.getElementById('upFirstName').innerHTML =currentUser.firstName;\n document.getElementById('upLastName').innerHTML =currentUser.lastName;\n document.getElementById('upEmail').innerHTML =currentUser.email;\n document.getElementById('upMobileNumber').innerHTML =currentUser.mobileNumber;\n document.getElementById('upAddress').innerHTML = currentUser.address + \" \" + currentUser.postCode;\n getUserPaymentMethod();\n checkUserSellerRating();\n checkUserBuyerRating();\n }", "title": "" }, { "docid": "a6bf1576c7cc4f197dca3a14b658a6d8", "score": "0.6420157", "text": "function newuser(normalControlList, hidecontrolList, locationInfo) {\r\n\r\n // To Reset controls\r\n resetControls(normalControlList);\r\n\r\n //To Show controls\r\n showControls(normalControlList);\r\n\r\n //To hide controls\r\n hideControls(hidecontrolList);\r\n\r\n //To edit new user\r\n $('[data-controlid=\"' + locationInfo + '\"]').find('.locediticon').click();\r\n}", "title": "" }, { "docid": "4029ce95c2d06d54bea040d036230fe9", "score": "0.64160985", "text": "function onRegistered(e){\n\t\tvar now = new Date().getTime();\n\t\tfor (var i in e.user) {\n\t\t\tvar id = e.user[i].userid;\n\t\t\t\n\t\t\tvar name = e.user[i].name;\n\t\t\tif (typeof _usernames[name] === 'undefined'){\n\t\t\t\t_usernames[name] = id;\n\t\t\t\t_users[id] = name;\n\t\t\t\t_idleTimers[id] = now;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "6bdbee590a3226a5ff8f50fa98556964", "score": "0.64116955", "text": "async function registerUser() {\n await register(showLoader, name, email, password);\n }", "title": "" }, { "docid": "c33e5bf094e53fc15f12a5184e7151dd", "score": "0.64067596", "text": "function registerUser(event) {\n event.preventDefault();\n\n // Don't do anything if the name fields hasn't been filled out\n if (\n !userName\n .val()\n .trim()\n .trim()\n ) {\n return;\n }\n // Calling the newUser function and passing in the value of the name input\n newUser({\n userName: userName.val().trim(),\n userPassword: userPassword.val().trim(),\n userPhone: userPhone.val().trim(),\n userEmail: userEmail.val().trim(),\n userCC: userCC.val().trim()\n });\n }", "title": "" }, { "docid": "67582969dcd74a211c0ebd0d9dc3ebde", "score": "0.6401646", "text": "function signup({ username, password, email, dateOfBirth, city }) {\n //create new user\n}", "title": "" }, { "docid": "c37cb382356d841e28eac4f4b3e3610d", "score": "0.6396126", "text": "async function handleRegister(req, res) {\n const { email, phone } = req.locals.user;\n db.collection('user_metadata').doc(email).set({\n phone,\n spotify_refresh_token: null,\n song_entries: [],\n });\n return res.status(200).json({ message: 'success' });\n}", "title": "" }, { "docid": "569c4b7dabaf0655cab426d9c034462b", "score": "0.6395571", "text": "_registerUser() {\n }", "title": "" }, { "docid": "b991cb3d1d42907e45601a94b448d550", "score": "0.63929635", "text": "addNewUser(name, email, password) {\n return axios.post(USERS_REST_API_URL + '/addUser', { name: name, email: email, password: password });\n }", "title": "" }, { "docid": "e762d4977b525d60ad89880f2ca691c6", "score": "0.63795435", "text": "addNew(slots){\n let user = new User(slots);\n // Add new user to the user directory\n User.directory[slots.userId] = user;\n \n console.log(`New user with username: ${slots.userName} added`);\n }", "title": "" }, { "docid": "1b0669f3816302a49e9f70b8f0730061", "score": "0.6368598", "text": "function register(req, res, next) {\n userService.create(req.body)\n .then(() => res.json({}))\n .catch(err => next(err));\n}", "title": "" }, { "docid": "fa8add1582252c7face47fe9ad05b05e", "score": "0.6367145", "text": "function register_done() {\n //Obtenemos los datos\n first_name=$('#firstname').val();\n second_name=$('#lastname').val();\n username=$('#user_name').val();\n password=$('#passwordregister').val();\n\n firebase.auth().createUserWithEmailAndPassword(username, password)\n .then(function(user){\n $('#regiter_section').css('display', 'none');\n $('#start_section').css('display', 'block');\n user.updateProfile({\n displayName: first_name\n }).then(function() {\n // Update successful.\n }).catch(function(error) {\n // An error happened.\n });\n })\n .catch(function (err) {\n // Handle errors\n });\n}", "title": "" }, { "docid": "9d20387e34a41031b74dc498ff84ecb5", "score": "0.63511485", "text": "function registerUser(ev) {\n ev.preventDefault();\n let registerUsername = $('#registerUsername');\n let registerName = $('#registerName');\n let registerPassword = $('#registerPasswd');\n\n let usernameVal = registerUsername.val();\n let nameVal = registerName.val();\n let passVal = registerPassword.val();\n\n auth.register(usernameVal, passVal, nameVal)\n .then((userInfo) => {\n saveSession(userInfo);\n registerUsername.val(\"\");\n registerName.val(\"\");\n registerPassword.val(\"\");\n showInfo('User registration successful.');\n }).catch(handleError);\n }", "title": "" }, { "docid": "cd59d61d06938b688e296d813cb8b405", "score": "0.6347788", "text": "function signup({username, password, email, dateOfBirth, city}) {\n\t// create new user\n\n}", "title": "" }, { "docid": "dc3c51753a42a45110e43aa6f50dc7eb", "score": "0.6346754", "text": "function submitRegister() {\n\tconst username = document.forms[\"registerform\"][\"username\"].value;\n\tconst password = document.forms[\"registerform\"][\"password\"].value;\n\tconst firstname = document.forms[\"registerform\"][\"firstname\"].value;\n\tconst lastname = document.forms[\"registerform\"][\"lastname\"].value;\n\tconst email = document.forms[\"registerform\"][\"email\"].value;\n\tconst birthday = document.forms[\"registerform\"][\"birthday\"].value;\n\t// debugger;\n\tusersMap.set(username, new UserData(username, password, firstname, lastname, email, birthday));\n\tdisplayDiv('welcome');\n\tdocument.forms['registerform'].reset();\n}", "title": "" }, { "docid": "88f1c9a89edb03271f9af91b17942fb5", "score": "0.6346105", "text": "function signUp({ email, password, dateOfBirth, city, username}) {\n //create a new user\n}", "title": "" }, { "docid": "58bbcd82ac8a9601e7add786dda8d9a7", "score": "0.63405913", "text": "function addUser(userName, userPassword, firstName, lastName, address_1, address_2, _city, _state, _zipcode, _usertags) {\n // Create new XMLHttpRequest. Declare the endpoint and send parameters data in JSON form.\n var req = new XMLHttpRequest();\n req.open('POST', user_sign_up_endpoint);\n req.onreadystatechange = function(event) {\n if (this.readyState == 4 && event.target.response === \"true\") {\n alert(\"Signed up successfully.\");\n location.href = \"homepage.html\";\n } else if (this.readyState == 4) {\n alert(\"Invalid details\")\n }\n };\n var parameters = {\n username: userName,\n password: userPassword,\n firstname: firstName,\n lastname: lastName,\n address1: address_1,\n address2: address_2,\n city: _city,\n state: _state,\n zipcode: _zipcode,\n usertags: _usertags\n }\n req.send(JSON.stringify(parameters));\n}", "title": "" }, { "docid": "43eb144686fc776b5b1b67816268836a", "score": "0.63369966", "text": "function addUser(userName) {\n //getting logged in user info from auth\n var user = firebase.auth().currentUser;\n var uid = user.uid;\n var userEmail = user.email;\n firebase\n .database()\n //Node level user and asssing user auth uid as key of this record\n .ref(\"/user/\" + uid)\n // Setting key of data base from auth user\n .set({\n userId: uid,\n email: userEmail,\n uname: userName\n })\n .then(res => {\n // opening landing page after sign up\n txtNewName.value = \"\";\n txtNewEmail.value = \"\";\n txtNewPassword.value = \"\";\n location.href = \"landing.html\";\n\n })\n .catch(function(error) {\n console.error(\"Error writing new user to Realtime Database:\", error);\n });\n }", "title": "" }, { "docid": "ded9f175903624a8b3eeb53a6bf621dd", "score": "0.6335339", "text": "function signupNew({ username, password, email, dateOfBirth, city }) {\n //create new user\n console.log(username);\n}", "title": "" }, { "docid": "f1e0384e9a5a0278cafa42e1617f8915", "score": "0.6332735", "text": "register(data) {\n\t\taxios('http://localhost:8080/users/register', {\n\t\t\tmethod: 'POST',\n\t\t\tdata\n\t\t})\n\t\t\t.then(resp => {\n\t\t\t\tconsole.log('response token:', resp.data.token);\n\t\t\t\tTokenService.save(resp.data.token);\n\t\t\t\tconsole.log('user ====>', resp.data.user);\n\t\t\t\tthis.setState({ userData: resp.data.user });\n\t\t\t\tconsole.log('prefs ====>', resp.data.prefs);\n\t\t\t\tthis.setState({ prefData: resp.data.prefs });\n\t\t\t\tthis.setState({ signUpClicked: false });\n\t\t\t\tthis.checkLogin();\n\t\t\t})\n\t\t\t.catch(err => console.log(`err: ${err}`));\n\t}", "title": "" }, { "docid": "f8f4f6fd49a38d7f0375d1da3b59592a", "score": "0.6327853", "text": "function register(email, password, name, callback) {\t\t//needed callback here (from Laura)\n var regUser = new User(email, password, name);\n // sessionHash remains empty, we don't have one yet\n var request = new Arrival(\"registration\", null, regUser);\n send(request, function (data) {\n alert(data.object.description);\n callback();\n });\n}", "title": "" }, { "docid": "61d0323bd8aa324e806586f77cbb378d", "score": "0.6310904", "text": "function register(oucu) {\n // 2(a) FR1.1\n // This is implemented for you and no further work is needed on it.\n var onSuccess = function (data) {\n var obj = $.parseJSON(data)\n if (obj.status == \"success\") {\n alert(\"User \" + oucu + \" has been successfully registered.\")\n } else {\n alert(\"User \" + oucu + \" is already registered.\")\n }\n }\n\n // Post the user ID using the \"users\" API\n var uri = \"http://137.108.92.9/openstack/taxi/users\"\n var params = { OUCU: oucu }\n if (oucu != \"\") $.post(uri, params, onSuccess)\n }", "title": "" }, { "docid": "3bd0fc88c53d2628fbaafde50dd6a2c5", "score": "0.63086295", "text": "function adminRegister() {\n emailAdmin = document.getElementById('usersEmail').value;\n passwordAdmin = document.getElementById('userPassword').value;\n\n firebase.auth().createUserWithEmailAndPassword(emailAdmin, passwordAdmin)\n .then((usuario) => {\n console.log(\"El registro de usuario fue exitoso\");\n let admin = firebase.auth().currentUser;\n admin.updateProfile({ displayName: nameValue })\n .catch((error) => {\n console.log(error)\n })\n })\n .catch((error) => {\n console.log(\"Error de firebase > Código > \" + error.code);\n console.log(\"Error de firebase > Mensaje > \" + error.message);\n\n });\n let empleado = {\n employeeEmail : document.getElementById('usersEmail').value,\n employeeName : document.getElementById('usersName').value,\n employeeOficina : document.getElementById('usersOffice').value\n }\n firebase.database().ref('Empleados').push(empleado);\n}", "title": "" }, { "docid": "0be3fb8886d05bb08f0e3ac9c239dcbe", "score": "0.6308333", "text": "function getUserInfo(store) {\n // Do the actual RPC call.\n getCurrentUserInfo()\n .then(response => {\n // Set the username to what the server indicates.\n store.commit('newUser', response.data.user)\n })\n .catch(error => {\n // Set the username to {}. An error probably means the\n // user is not logged in.\n store.commit('newUser', {})\n })\n}", "title": "" }, { "docid": "b6442a5f40539c0aef3a04ed21a1763f", "score": "0.62973887", "text": "function newUser(userInfo) {\n $.post(\"/api/users\", userInfo);\n\n // resets form and closes modal\n $(\"#user-form\").each(function() {\n this.reset();\n })\n\n $(\".modal\").modal(\"hide\");\n }", "title": "" }, { "docid": "757528159abcb6ada61041516e7608d2", "score": "0.6293927", "text": "postRegistion(userInf) {\n return apiClient.post('/register', userInf)\n }", "title": "" }, { "docid": "574bc75a3018bb6d393ebe9179f305bf", "score": "0.6292691", "text": "function updateUserInfo(data){\n return {\n type: USER_INFO,\n data\n }\n}", "title": "" }, { "docid": "7307de873ba9ba98b6e184cc45adf7f4", "score": "0.62915933", "text": "function user_register( args, done ) {\n var pin = this.pin({ role:plugin, cmd:'*' })\n\n this.prior( args, function( err, out ) {\n if( err ) return done( err );\n if( !out.ok ) return done( null, out )\n\n var resargs = {user:out.user}\n if( args.account ) resargs.account = args.account;\n\n pin.resolve(resargs, function( err, result ){\n if( err ) return done( err );\n var account = result.account\n\n additem( out.user, account, 'accounts' ) \n additem( account, out.user, 'users' ) \n delete out.user.account\n\n save( out.user, account, function( err, res ){\n if( err ) return done( err );\n out.user = res.user\n done( err, out )\n })\n })\n })\n }", "title": "" }, { "docid": "bd0fc9b7a1818896336206e2cf6f305f", "score": "0.62872916", "text": "function add_user($name, $state, $time){\n //If Avatar Caching is enabled, set cache name\n if($this->cacheAvatar){\n $avatar = \"/avatar.php?name={$name}&size=40&cache=1\";\n }else{\n $avatar = \"/avatar.php?name={$name}&size=40\";\n }\n\n //Enter user data into array\n $this->users[$name] = array(\n 'name' => $name,\n 'online' => $state,\n 'logcount' => 1,\n 'avatar' => $avatar,\n 'time' => $time,\n 'lastonline' => $time,\n 'totaltime' => 0\n );\n}", "title": "" }, { "docid": "58ae78aed3b248bd6fff524f84179e60", "score": "0.62860686", "text": "static register(username, password, cb) {\n const newUser = new User({\n _id: new mongoose.Types.ObjectId(),\n username,\n password,\n todoList: [],\n });\n\n newUser.save()\n .then((res) => {\n cb(null, res);\n })\n .catch((err) => {\n cb(err, null);\n });\n }", "title": "" }, { "docid": "1df59ac3a59cf58b3632384126ba2dcf", "score": "0.6285058", "text": "function createAccount() {\n event.preventDefault();\n console.log(\"wooo\")\n var displayID = $(\"#userNameEntry\").val().trim();\n var email = $(\"#emailEntry\").val().trim();\n var password = $(\"#passwordEntry\").val().trim();\n\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function () {\n //add the display name after the user is done being created \n firebase.auth().currentUser.updateProfile({ displayName: displayID });\n });\n\n }", "title": "" }, { "docid": "97a8dfa6739fc349eb76da4bf56de42a", "score": "0.62799704", "text": "function setUserData(e) {\n\tTi.API.info(\"Logged User Token Data Set :\"+ JSON.stringify(e));\n\t\n\tTi.App.Properties.setInt(\"accountID\", e.user_Details.accountId);\n\tTi.App.Properties.setString(\"emailID\", e.user_Details.emailAddress);\n\tTi.API.info(\"Logged User Token Data Set :\"+ e.account_details.firstName);\n\tvar str = e.account_details.firstName;\n //var storeFirstname = str.substr(0,str.indexOf(' '));\n Ti.App.Properties.setString(\"firstName\", str);\n //Ti.API.info(\"Logged User Token Data Set :\"+ storeFirstname);\n\tcall_web_serivce_updateRegistrationWithUser(e);\t\n}", "title": "" }, { "docid": "f27a79278bfc2a09c4891370957151df", "score": "0.62707627", "text": "function addRegister (usrName) {\n return new Promise((resolve, reject) => {\n const timestamp = moment().format()\n const payload = {\n time: timestamp,\n user: usrName,\n type: \"register\",\n msg: \"User \" + usrName + \" registered at \" + timestamp\n }\n addLog(payload).then(resolve({})).catch((err) => reject(err))\n })\n}", "title": "" }, { "docid": "790c398399118f2de52602e9028ba12c", "score": "0.6266596", "text": "function registerFetch(callsign, password, name, email, my_qth){\n const userData = {user: {\n callsign: callsign,\n password: password,\n name: name,\n email: email,\n my_qth: my_qth\n }\n }\n // create user in backend\n fetch(usersUrl, {\n method: \"POST\",\n headers: {\"Content-Type\": \"application/json\"},\n body: JSON.stringify(userData)})\n .then(response => response.json())\n .then(json => {\n sessionStorage.currentUserId = json.id\n state.page = \"profile\"\n state.user = json\n renderPage()\n })\n}", "title": "" }, { "docid": "0903c1563385e977eb6444b13cfb5236", "score": "0.6260837", "text": "function signup(username, password, email, dateOfBirth, city) {\n\t// create new user\n\n}", "title": "" }, { "docid": "bc732bdb1d27e04dc4bf8d919800c495", "score": "0.6257347", "text": "function createusers() {\n var createusersObject = new com.kony.users();\n // Success callback creates a new record on frmusersDetails\t\n function createusersSuccessCallback(res) {\n callAlert(getMessageTemplate(\"addSuccess\", \"users\"), \"info\")\n }\n createusersObject.username = frmusersAdd.widgetusernameValue.text;\n createusersObject.pin = frmusersAdd.widgetpinValue.text;\n createusersObject.firstName = frmusersAdd.widgetfirstNameValue.text;\n createusersObject.lastName = frmusersAdd.widgetlastNameValue.text;\n createusersObject.gender = frmusersAdd.widgetgenderValue.text;\n createusersObject.dob = frmusersAdd.widgetdobValue.formattedDate;\n createusersObject.homePhone = frmusersAdd.widgethomePhoneValue.text;\n createusersObject.mobile = frmusersAdd.widgetmobileValue.text;\n createusersObject.email = frmusersAdd.widgetemailValue.text;\n createusersObject.targetweight = frmusersAdd.widgettargetweightValue.text;\n createusersObject.actualweight = frmusersAdd.widgetactualweightValue.text;\n // Call the com.kony.users.create ORM API\n createusersObject.create(createusersSuccessCallback, eventErrorCallBack);\n}", "title": "" }, { "docid": "f6eb07729808225f2ce3a98c592bca4d", "score": "0.62565106", "text": "registerUser (data, callback) {\n\t\tthis.data = data;\n\t\tthis._registerUser(callback);\n\t}", "title": "" }, { "docid": "c9350148575d72cad41460c76c5d5898", "score": "0.6248127", "text": "static registerUser(e) {\n e.preventDefault();\n let formData = Array.from(document.querySelectorAll(\".finput\"));\n // We remove age field from array; default value of 25\n const formDataArr = Array.from(formData);\n const formFiltered = formDataArr.filter(data => {\n return !data.classList.contains(\"age\");\n });\n\n let validated = UserFunctionality.validateData(formFiltered);\n if (validated) {\n let newData = Array.from(formFiltered, input => {\n return input.value;\n });\n // If validated we instatiate new user\n let newUser = new User(newData);\n // we clear all fields\n formDataArr.forEach(input => input.value = \"\"); \n // we display new user\n UserView.displayUser(newUser);\n }\n }", "title": "" }, { "docid": "2db085e0d39fff797b8b47c1b997edd9", "score": "0.6246016", "text": "_onRegisterClick() {\n const email = this.shadowRoot.getElementById('email').value;\n const name = this.shadowRoot.getElementById('name').value;\n const pass1 = this.shadowRoot.getElementById('pass1').value;\n const pass2 = this.shadowRoot.getElementById('pass2').value;\n\n // check the inputs the user has filled\n if (this._checkInputs(email, name, pass1, pass2)) {\n // sends an event to register the user and store it in the users table\n const event = new CustomEvent('register-ok', {\n detail: {\n 'user': new Map().set(email, {name: name, pass: pass1, lastLogin: -1}),\n },\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(event);\n }\n }", "title": "" }, { "docid": "8177a8c572536547d7c68a1bdbbb46f0", "score": "0.6245238", "text": "function createUser(){\n if (creatingUserCurrendtly) {\n closeUserUpdateField();\n}\n emptyCRUDStorage();\n loadUserUpdateField();\n creatingUserCurrendtly =true;\n verb = \"create\";\n}", "title": "" }, { "docid": "6f4162c02a5ec231d484b74d6a380bd2", "score": "0.6245127", "text": "newUser(req, res, next) {\n const { username, password } = req.body;\n\n const newUser = { username, password };\n\n // USE MODEL TO REGISTER A NEW USER\n User.addUser(newUser)\n .then((user) => {\n res.status(201).json({\n success: true,\n message: 'User registered',\n data: { id: user.id },\n });\n })\n .catch((err) => next(err));\n }", "title": "" }, { "docid": "2fcd817469d2ee9aca7a9825518c960a", "score": "0.62421435", "text": "function registerUser(user) {\n\n var newUser = {\n name: user.name,\n username: user.name,\n email: user.email,\n password: user.password,\n facebookId: user.id,\n profilePicture: user.picture.data.url\n\n };\n\n APIRequest('POST', '/Players', newUser, 'loginUser')\n\n }", "title": "" }, { "docid": "42c22470eb9211e986174335e46a2e3a", "score": "0.62264043", "text": "addUser(res, data) {\n User.create(data, (err, newUser) => {\n if (err) throw err;\n res.json({\n status: 200,\n message: 'Creado',\n user: newUser\n })\n })\n }", "title": "" }, { "docid": "1f6ccbb9e7bce7c179b217200689c9e6", "score": "0.6222597", "text": "function addUser(){\n\tvar user = {\n\t\t\tusername: $('#username').val(),\n\t\t\tpassword: $('#password').val(),\n\t};\n\tvar xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function(){\n\t\tif(xhr.readyState == 4){\n\t\t\tif(xhr.status == 201){//created\n\t\t\t\t//go to home page so user can log in with new credentials\n\t\t\t}\n\t\t\telse if (xhr.status > 399){\n\t\t\t\t//some sort of issue. go to error page\n\t\t\t}\n\t\t}\n\t}\n\t\n\txhr.open(\"POST\", \"register\");\n\txhr.setRequestHeader(\"Content-type\", \"application/json\");\n\txhr.send(JSON.stringify(user));\n}", "title": "" }, { "docid": "1220a6b631a871de3ccefc3143326718", "score": "0.6216669", "text": "function insertData(uid,regist,fname,lname,address,city,province,postc,phone){\n //update regist status to already login to database\n firebase.database().ref(\"User/\"+ uid).update(\n {\n regist:regist\n });\n firebase.database().ref(\"User/\"+ uid + \"/Personal Information\").set(\n {\n fname:fname,\n lname:lname,\n address:address,\n city:city,\n province:province,\n postc:postc,\n phone:phone\n });\n\n }", "title": "" }, { "docid": "7461cf999f73658f0368f48de72de41a", "score": "0.62136567", "text": "function signup() {\n\n }", "title": "" }, { "docid": "64458ff1017301a5a7e9f7fa95179e7d", "score": "0.62080187", "text": "async register(ctx) {\n const { body } = ctx.request\n\n let user = await userSchema.validate(body, {\n abortEarly: false,\n context: { validatePassword: true }\n })\n\n user = await new User(user).save()\n\n ctx.status = 201\n ctx.set('Location', `${ctx.URL}/${user.id}`)\n\n ctx.body = { token: generateToken(user) }\n }", "title": "" }, { "docid": "1e35f1494f93605b2b9516454e0420f6", "score": "0.61984193", "text": "static addUserToDB(userObj) {\n // console.log(\"userObj --->\", userObj);\n users[userObj.id] = { \n id : `${userObj.id}`,\n email: `${userObj.email}`,\n password:`${userObj.password}`\n };\n }", "title": "" }, { "docid": "13d907c25efbb0736be7250e71a839a8", "score": "0.61846775", "text": "function register(req, res) {\n\n var user = req.body;\n user = userModel.createUser(user)\n .then(function (user) {\n\n res.json(user);\n },\n\n function (err) {\n res.status(400).send(err);\n }\n );\n\n }", "title": "" }, { "docid": "0df2a4ad52b1c5f253d8f7f12d50f28b", "score": "0.6184077", "text": "function createUser (userData, name, cb) { User.createAndSaveInstance(userData, function(err, user) { users[name] = user; return cb(err); }); }", "title": "" }, { "docid": "3d25e4e7dbd6f7ad8f4eb46b6a129a67", "score": "0.6183856", "text": "async registerUser(args, context) {\n const { user } = args\n const { userId, res } = context\n\n // TODO: Re-run all the client-side form validation logic here\n\n await appendLogEvent({\n userId,\n source: AUTH,\n event: { message: 'registerUser', user }\n })\n\n const { user: newUser } = await registerDbUser(userId, user)\n const userProfileToken = getAndSetUserProfile({ user: newUser, res })\n return {\n user: newUser,\n userProfileToken\n }\n }", "title": "" }, { "docid": "8e293d6a8a6f09a05523b99ac27fd314", "score": "0.6177944", "text": "storeUserInfo(userInfo) {\n store.save(this.USER_INFO_STORAGE_KEY, userInfo);\n }", "title": "" }, { "docid": "e9b639f66b0f761dec778b71bb06f66e", "score": "0.6169289", "text": "function signUp({username, password, email, dateOfBirth, city}) {\n\t// create new user\n}", "title": "" }, { "docid": "1648e6342e153e99f75772d4f7efb44c", "score": "0.6165403", "text": "function processuserform() {\n var newuser = true;\n var getValiduserinfo = validateEachInput(newuser);\n if (getValiduserinfo == 0) {\n var newUser = {};\n console.log(\"Inside the new user signup form.\");\n var fName = $('.fname').val();\n var lName = $('.lname').val();\n var phone_num = $('.tel').val();\n\n var emailId = $('.email').val();\n var secretKey = $('.s_key').val();\n\n if (fName && lName && phone_num && emailId && secretKey) {\n newUser[\"first_name\"] = fName;\n newUser[\"last_name\"] = lName;\n newUser[\"phone_num\"] = phone_num;\n newUser[\"emailID\"] = emailId;\n }\n firstTimeUsrData(default_stocks, secretKey, newUser)\n\n }\n else {\n console.log(\"There is an error.\");\n }\n }", "title": "" }, { "docid": "c7af48573c52b0ca9c1c05f1587d7905", "score": "0.616144", "text": "function updateUserInfo() {\n console.log(username.value);\n console.log(password.value);\n smartTarp.updateUserInfo(username.value, password.value);\n}", "title": "" }, { "docid": "e87b7335b96970e50be2c1d70d86a692", "score": "0.6161124", "text": "function registerNewUser(req, res, newUser, newPass){\n let query = 'SELECT rowid AS id, username FROM LOGINS WHERE (username=\"'+ newUser +'\");';\n db.get(query, function(err,row){\n if (row) {\n addMessage(req,'error','Username ' + newUser + ' already taken.');\n res.redirect('back');\n }\n else {\n db.serialize(function(){\n var stmt = db.prepare('INSERT INTO LOGINS VALUES (?,?,?,?)');\n hasher({password: newPass}, function(err, pass, salt, hash){\n if (err) throw err; \n stmt.run(newUser, salt, hash, 1);\n stmt.finalize();\n });\n console.log('added regular user ' + newUser + ' to html5.db');\n });\n\n db.serialize(function(){\n var stmt = db.prepare('INSERT INTO PROFILES VALUES (?,?,?,?)');\n stmt.run(newUser,\"\",0,null);\n stmt.finalize();\n console.log('added ' + newUser + 's profile to html5.db');\n })\n\n addMessage(req,'ok',\"Registered successfully! Please log in.\");\n res.redirect('back'); \n }\n });\n}", "title": "" }, { "docid": "9b2cc8a2261b3d03f6f2205b9d9562e7", "score": "0.6155505", "text": "async ['POST /register']({ body }, res) {\n const user = await this.db.User.findByUsername(body.username);\n if (user instanceof Object) {\n throw this.services.boom.conflict('Pick up another username as the entered one already exists');\n }\n await this.db.User.createNew(body);\n res.send({ ok: true });\n }", "title": "" }, { "docid": "9d58142f48b7f3c1458e4510d238ce33", "score": "0.61535627", "text": "function newUser(e) {\n if (e.preventDefault) e.preventDefault();\n if (this.name.value && this.email.value && this.password.value) {\n var newUser = {};\n newUser.name = this.name.value;\n newUser.email = this.email.value;\n newUser.password = this.password.value;\n console.log(newUser);\n rest.post('users', newUser);//postUser(newUser);\n };\n this.name.value = '';\n this.email.value = '';\n this.password.value = '';\n location.reload();\n return false;\n }", "title": "" }, { "docid": "627334f32b4174564c60224a0d82debe", "score": "0.6149201", "text": "function useradd(userid, nickname, thumbnail_image) {\n makeFigureWithPOPAnimation({\n userid: userid,\n nickname: nickname,\n thumbnail_image: thumbnail_image\n }, document.getElementById('profiles'));\n console.log('add user -> id: ' + userid + ', name:' + nickname);\n}", "title": "" }, { "docid": "f34ee404d03dab0b20405ac5a575775b", "score": "0.61479044", "text": "function initUser(name) {\n\tusersList[name] = {username: name, fgColor: '', bgColor: '', tag: '', icon: ''};\n}", "title": "" } ]
954dde6bcf49fdef5e62183470873524
Update the last user action
[ { "docid": "0d813ecc8064ef74bc1903f66194463a", "score": "0.7802905", "text": "function updateLastUserAction(user_id) {\n\t\t_lastUserActions[user_id] = new Date().getTime();\n\t}", "title": "" } ]
[ { "docid": "f6bf268f75d4c324cf359ec5d493d4a7", "score": "0.6763421", "text": "setLastAction(action) {\n this.last.action = action;\n }", "title": "" }, { "docid": "3af1307fb4ec67dc4c151dcc7f3eee6b", "score": "0.611964", "text": "function _currentUserUpdateSuccess() {\r\n render();\r\n }", "title": "" }, { "docid": "0e00968ffebdc4c5aba792f6a63b2361", "score": "0.59984565", "text": "function updateLastSeen() {\n $scope.age = moment().diff($scope.lastAccessed,'seconds')\n\n //if it's 30 seconds since the last access, call an error\n if ($scope.age > 40) {\n notResponding()\n }\n }", "title": "" }, { "docid": "90131b6c97fd2e6e4148b5d9400a2c0f", "score": "0.59023607", "text": "function updateLastOnline () {\n\t\t\t$.ajax({\n\t\t\t\turl : BASEURL + 'users/updateLastOnline',\n\t\t\t\ttype : 'POST',\n\t\t\t\tdataType : 'JSON',\n\t\t\t\tdata : {'userID': reqdata.userID},\n\t\t\t\tsuccess : function (data) {\n\t\t\t\t\tconsole.log(data);\n\t\t\t\t},\n\t\t\t\terror: function (e) {console.log(e);},\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "ce7daa319591b519d083408e1932692e", "score": "0.5826749", "text": "onUpdate() {\n this._saveUsers();\n }", "title": "" }, { "docid": "0448d8252ded592698fd91915a4461ff", "score": "0.5810102", "text": "function updateUser(entry){\n\t\tmodels.User\n\t\t\t.find({'google_id':req.user.google_id})\n\t\t\t.sort()\n\t\t\t.exec(userCallback);\n\n\t\tfunction userCallback (err, users){\n\t\t\tif(err){console.log(err); res.send(500)}\n\t\t\tvar pasteats = users[0].pasteats;\n\t\t\tpasteats.unshift(entry);\n\t\t\tusers[0].update({'pasteats': pasteats}).exec(addCallback);\n\t\t}\n\n\t\t//Once it's all done, it reloads the past eats page.\n\t\tfunction addCallback(err){\n\t\t\tif(err){console.log(err); res.send(500)}\n\t\t\tres.redirect('/pasteats');\n\t\t}\n\t}", "title": "" }, { "docid": "9dd0c9858939dfdb96d81e7bf7b8bba1", "score": "0.5789558", "text": "_touchLastUpdate() {\n // update last update time stamp\n this._lastUpdate += 1;\n }", "title": "" }, { "docid": "0234ac6b534c1de04a699fd8a40f7542", "score": "0.57584435", "text": "async updateLastRunAt () {\n\t\tawait this.data.reinviteUsersLastRunAt.updateDirect(\n\t\t\t{ }, \n\t\t\t{ $set: { lastRunAt: Date.now() } },\n\t\t\t{ upsert: true}\n\t\t);\n\t}", "title": "" }, { "docid": "f591ccf024c4894313caf189c06c9cd1", "score": "0.57475686", "text": "update(currentUser, modifiedUser){\n \n this.httpClient.post('/AccountEdit/' + currentUser.id + '/' + modifiedUser.mail.toLowerCase() + '/' + modifiedUser.nickname + '/' + modifiedUser.password)\n .then(() => {\n this.ea.publish('user-updated', { modifiedUser });\n });\n\n \n }", "title": "" }, { "docid": "956cf35937d4295385eb818ab56d78d9", "score": "0.57307637", "text": "function updateLoggedUsersActionDate(oauth_uid, token, callback) {\n\n var datetime = new Date().toMysqlFormat();\n\n // making sure client exists.\n getLoggedUserIdByOAuthUid(oauth_uid, function(err, result) {\n if (err) {\n console.log(err);\n callback(err);\n } else {\n if (result == null) {\n // user is not exists. nothing to do.\n callback(new Error(\"The given user id is not exists\"));\n } else {\n\n mysqlPool.getConnection(function (err, connection) {\n if (err) {\n console.log(err);\n callback(err);\n } else {\n var sqlUpdateLoggedUserActionDate = \"UPDATE logged_users_tbl SET last_action_date=? \" +\n \"WHERE oauth_uid=? AND token=?\";\n\n connection.query(sqlUpdateLoggedUserActionDate, [datetime, oauth_uid, token], function(err, result) {\n\n connection.release();\n if (err) {\n console.log(err);\n callback(err);\n } else {\n callback(false, result);\n }\n });\n }\n });\n }\n }\n });\n}", "title": "" }, { "docid": "0bbfe6acecb32e795c1bbf228b9dd9f0", "score": "0.5691735", "text": "async updateUser () {\n\t\t// token becomes the user's actual access token for CodeStream, and also the New Relic token\n\t\t// for observability functions\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tmodifiedAt: Date.now(),\n\t\t\t\t...this.refreshResult.userSet\n\t\t\t}\n\t\t};\n\n\t\tthis.updateOp = await new ModelSaver({\n\t\t\trequest: this,\n\t\t\tcollection: this.data.users,\n\t\t\tid: this.refreshResult.user.id\n\t\t}).save(op);\n\t}", "title": "" }, { "docid": "1ef4d9a398cbc0f85fe97fa59580bd3f", "score": "0.5678622", "text": "function showPreviousUser()/*:void*/ {var this$=this;\n AS3.getBindable(this,\"applyChanges\")(function ()/*:void*/ {\n if (AS3.getBindable(this$,\"userAdministration\").hasSearchResult()) {\n var users/*:Array*/ = AS3.getBindable(this$,\"userAdministration\").getSearchResult();\n var activeUserIndex/*:int*/ = this$.getActiveUserIndex$27zj();\n if (users != null && activeUserIndex > 0) {\n AS3.getBindable(this$,\"userAdministration\").set(com.coremedia.elastic.social.studio.model.UserAdministrationPropertyNames.EDITED, null);\n com.coremedia.ui.util.EventUtil.invokeLater(function()/*:void*/ {\n AS3.getBindable(this$,\"userAdministration\").startEditing(AS3.as(users[activeUserIndex - 1], com.coremedia.elastic.social.studio.model.User));\n });\n }\n }\n this$.updateButtons$27zj();\n });\n }", "title": "" }, { "docid": "fd6b9e5c05efd669dab31a9e73c2aa52", "score": "0.5677226", "text": "updateUserActions(req, res) {\n const {username} = req.params;\n const {actions} = req.body;\n User.findOneAndUpdate({username},{actions},(err, user)=>{\n if(err){\n res.send(\"error in updateUser: \" +err)\n return res.status(400);\n }\n if(user.nModified === 0){\n res.send('user '+ username +' was not updated')\n return res.status(501);\n }\n return res.status(200).json(user);\n })\n }", "title": "" }, { "docid": "423ef076198c3b5ada39c7a6050ae6d4", "score": "0.5603504", "text": "function checkLastActiveAndRecharge() {\n\t\ttry {\n\t\t\t// allow offline\n\t\t\tif (Page.data.mode.notActive) return;\n\t\t\t// don't allow if mode disabled or stealth\n\t\t\tif (T.tally_options.gameMode === \"disabled\" || T.tally_options.gameMode === \"stealth\") return;\n\n\t\t\tif (DEBUG) console.log(\"🕗 TallyEvents.checkLastActiveAndRecharge()\", \"00:00:00\",\n\t\t\t\tFS_String.pad(FS_Date.diffHours(\"now\", T.tally_user.lastActive), 2) + \":\" +\n\t\t\t\tFS_String.pad(FS_Date.diffMinutes(\"now\", T.tally_user.lastActive), 2) + \":\" +\n\t\t\t\tFS_String.pad(FS_Date.diffSeconds(\"now\", T.tally_user.lastActive), 2)\n\t\t\t);\n\t\t\t// if player hasn't been online for n minutes then recharge\n\t\t\tif (FS_Date.diffMinutes(\"now\", T.tally_user.lastActive) > 60) { // 0=testing\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t// reset tally stats\n\t\t\t\t\tStats.reset(\"tally\");\n\t\t\t\t\t// play sound\n\t\t\t\t\tSound.playRandomJump();\n\t\t\t\t\t// tell them\n\t\t\t\t\tDialogue.showStr(\"You took a break from the internet to recharge!\", \"happy\");\n\t\t\t\t}, 700);\n\t\t\t}\n\t\t\t// update last active\n\t\t\tT.tally_user.lastActive = moment().format();\n\t\t\tTallyStorage.saveData(\"tally_user\", T.tally_user, \"🕗 TallyEvents.checkLastActiveAndRecharge()\");\n\t\t\t// if (DEBUG) console.log(\"🕗 TallyEvents.checkLastActiveAndRecharge()\", T.tally_user.lastActive);\n\t\t} catch (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t}", "title": "" }, { "docid": "476da34278882b25bd7a02ac612a2ab2", "score": "0.5599096", "text": "function callback(updatedUser){\n if (updatedUser){\n $scope.message = \"user updated\";\n $scope.currentUser = updatedUser;\n $rootScope.currentUser = updatedUser;\n } else {\n $scope.error = \"unable to update the user\";\n }\n }", "title": "" }, { "docid": "8724ce846515f0b622427b01c531356e", "score": "0.55718255", "text": "update() {\n //update output\n var text = os.userInfo().username;\n this.output.full_text = text;\n this.output.short_text = text;\n\n //emit updated event to i3Status\n this.emit('updated', this, this.output);\n }", "title": "" }, { "docid": "514df86f6c6528a116862fd4abd7386a", "score": "0.5563159", "text": "function modifyActHistory (actions, store)\n{\n actions.actions[0].isDirectAction = true;\n actions.actionHistory[0].isDirectAction = false;\n actions.actions[0].moveFromHistory = false;\n actions.actionHistory[0].moveFromHistory = true;\n actions.howMuchActMustBeCanceled = store.getState().stepBack.history.otherUsersActionCnt;\n actions.NeedStepForwar = 0;\n store.getState().stepBack.history.otherUsersActionCnt = 0;\n}", "title": "" }, { "docid": "ba9f880e76ce054616dbf752d503deb2", "score": "0.55593294", "text": "async postProcess () {\n\t\tawait this.publishUserUpdate();\n\t}", "title": "" }, { "docid": "2ea56a559fd096b6d3081d0efcdb698c", "score": "0.5550554", "text": "update() {\n\t\tthis.setState({\n\t\t\tuser: this.props.currentUser.getUser()\n\t\t});\n\t}", "title": "" }, { "docid": "b27508731a9a64882888f16b18b63b78", "score": "0.5545998", "text": "function update_status(m_action)\n\t{\t\n\t\tm_action = (m_action) ? m_action : false;\n\t\t\n\t\tdocument.f_status.status_bankroll.value = g['bankroll'];\n\t\tdocument.f_status.status_games.value = g['games_played'];\n\t\tdocument.f_status.status_hilo.value = g['hiloCount'].toString();\n\t\tdocument.f_status.status_cardsleft.value = document.f_status.status_cards_total.value - g['cID'];\n\t}", "title": "" }, { "docid": "fee1b8486cb51442978d3a6ca90b92b5", "score": "0.55451304", "text": "getFrequencyNextUserAction() {\n\t \treturn this.frequencyNextUserAction;\n\t }", "title": "" }, { "docid": "1f445d54847a9f1f2549b57d45937c7e", "score": "0.5540101", "text": "onUpdateClick (e) {\n this.props.history.push('/profile-update');\n }", "title": "" }, { "docid": "4e9c7c724d060fe500ecd5baa10c7520", "score": "0.55279016", "text": "function updateUsersInfo() {\n firebase.auth().currentUser.updateProfile({\n displayName: displayName,\n photoURL: `${clearance}|-|${title}|-|${classification}|-|${site}|-|${keyphrase}`\n })\n .then(function() {\n reloadInfo()\n appendNormal(`<span style=\"color:#98FB98\">[✓] </span>Updated successfully`)\n editState = 0\n cmdShow()\n btnShow()\n }, function(error) {\n appendError(`${error.message.toUpperCase()}, EDITING PROCESS EXCITED.`)\n editState = 0\n cmdShow()\n btnShow()\n })\n}", "title": "" }, { "docid": "a975bda7a1e0e4bea8de10713c24183a", "score": "0.55207646", "text": "InternalUserUpdate(old, newU)\n {\n \n }", "title": "" }, { "docid": "81ddb077c7f2446b6ae390d023246b5d", "score": "0.5517058", "text": "updateLastNotificationCheckToNow() {\n const conn = this.conn;\n\n var updateLastNotificationCheckQuery =\n \"update Account set lastNotificationCheck = current_timestamp where accountID = \" +\n this.accountID +\n \";\";\n\n conn.getConnection(function (err, conn) {\n conn.query(updateLastNotificationCheckQuery, function (\n error,\n results,\n fields\n ) {});\n });\n }", "title": "" }, { "docid": "b6dc11bc9e340c5c236606e1b11666c2", "score": "0.55035794", "text": "setLastChange(changetime){\n if(!this.state.lastChange || changetime.isAfter(this.state.lastChange)) this.state.lastChange = changetime;\n }", "title": "" }, { "docid": "6313b22516321cb26b2437763b1c0e98", "score": "0.54394954", "text": "refresh() {\n this.get('session').set('data.lastUpdated', Date.now());\n }", "title": "" }, { "docid": "84b80257944d51182d2a4a1295b5df84", "score": "0.54150367", "text": "function recent() {\n\t\tvar url = \"http://localhost:3000/update/recent\";\n\t\trequestToServer(url);\n\t\t\t\t\n\t}", "title": "" }, { "docid": "c24ad6e7449e29e90c522bb86a0e9f60", "score": "0.53830016", "text": "changeUserStatus() {\n }", "title": "" }, { "docid": "70117ccea27849f38b93cedc73bab76d", "score": "0.5379624", "text": "function _updateUser(updatedUser) {\n\t\tvar user = utui.users.getUser(updatedUser.email);\n\t\tif (user) {\n\t\t\t$.extend(user, updatedUser);\n\t\t} else {\n\t\t\t_userData[updatedUser.email] = updatedUser;\n\t\t}\n\n\t\t// Show you are no longer in read only state if is_stale has changed to false\n\t\tif (utui.users.isStale && !updatedUser.is_stale) {\n\t\t\tutui.users.isStale = false;\n\t\t\t// 12/14/2015 - do not block UI while permission cache is being updated\n//\t\t\tutui.util.showMsgDialog('<strong>' + localize.t('tiq.users.permissions_updated_body') + '</strong>', localize.t('tiq.users.permissions_updated_title'));\n\t\t}\n\n\t\t// update the admin menu text\n\t\tutui.util.pubsub.publish(utui.constants.users.UPDATED);\n\t}", "title": "" }, { "docid": "565aa94a019c29c82f1d4deb92c73c89", "score": "0.5356211", "text": "function StatusUpdate(id) {\n\tif (iCount == 0) {\n\t\talert(\"You can't submit nothing O_o\");\n\t} else {\n\t\tif (overCount == 1) {\n\t\t\talert(\"You can submit that many characters, sorry.\");\n\t\t} else {\n\t\t\tif (Submitter(id)) {\n var nickname = document.getElementById(\"username\").innerHTML;\n var profileUrl = \"http://\"+ enviro +\"people.ign.com/\"+ nickname;\n var imgurl = document.getElementById(\"user-avatar\").src;\n var newStatusText= jQuery(\"#StatusText\").val();\n var adate = new Date();\n console.log(newStatusText);\n// if (jQuery(\"#activityList\").length != 0){\n// ign.social.activityItem.create(0, profileUrl, imgurl, nickname, \" \"+newStatusText,adate);\n// }\n\t\t\t\tStatusClose();\n\t\t\t\tClearing(id);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ee8fc4c1fab18611e1e582dbb6502486", "score": "0.5348304", "text": "function userActions(){\n // ცხრილში ღილაკებზე უნდა მიამაგროთ event listener-ები\n // იქნება 2 ღილაკი რედაქტირება და წაშლა\n // id შეინახეთ data-user-id ატრიბუტად ღილაკებზე\n // წაშლა ღილაკზე უნდა გაიგზავნოს წაშლის მოთხოვნა და გადაეცეს id\n // ედიტის ღილაკზე უნდა გაიხსნას მოდალ სადაც ფორმი იქნება\n // ედიტის ღილაკზე უნდა გამოიძახოთ getUser ფუნქცია და რომ დააბრუნებს ერთი მომხმარებლის დატას (ობიექტს და არა მასივს)\n // ეს დატა უნდა შეივსოს ფორმში formManager აქვს ახალი შესაძლებლობა formManager.setFields(userObject)\n // ეს ფუნქცია გამოიძახე და გადაეცი user-ის დატა\n}", "title": "" }, { "docid": "15ecf89d6cf03aafb048e3999a4f7313", "score": "0.53103757", "text": "function updateOnTapCurrent() {\n const http = new easyHTTP;\n // Create POST\n http.postRecieve('/update', function(err, post) {\n // console.log('****************updateTappingNext*****************')\n if (err) {\n console.log(err);\n } else {\n tappingCurrent(post);\n }\n });\n}", "title": "" }, { "docid": "3ef57316bd29146af7e60534794bd284", "score": "0.5300661", "text": "function showNextUser()/*:void*/ {var this$=this;\n AS3.getBindable(this,\"applyChanges\")(function ()/*:void*/ {\n if (AS3.getBindable(this$,\"userAdministration\").hasSearchResult()) {\n var activeUserIndex/*:int*/ = this$.getActiveUserIndex$27zj();\n var users/*:Array*/ = AS3.getBindable(this$,\"userAdministration\").getSearchResult();\n if (users && activeUserIndex < users.length - 1) {\n AS3.getBindable(this$,\"userAdministration\").set(com.coremedia.elastic.social.studio.model.UserAdministrationPropertyNames.EDITED, null);\n com.coremedia.ui.util.EventUtil.invokeLater(function()/*:void*/ {\n AS3.getBindable(this$,\"userAdministration\").startEditing(users[activeUserIndex + 1]);\n });\n }\n }\n this$.updateButtons$27zj();\n });\n }", "title": "" }, { "docid": "6fa088799ce9f6daf7e27d5904d88df0", "score": "0.5300076", "text": "function dataLastModify() {\n $(\"#date_last_modify\").val(getCurrentDate());\n}", "title": "" }, { "docid": "a53edd7d86cbc46f424f96387f6391aa", "score": "0.52843213", "text": "updateLastFed(){\n \n this.lastFed = hour();\n dataBase.ref(\"lastFed\").update({time: this.lastFed});\n\n }", "title": "" }, { "docid": "c186a25ae939d915eab63d910edc3cbd", "score": "0.52817106", "text": "function _updateSuccess() {\n\t\t\taccount.btnSaved = true;\n\t\t\taccount.btnSaveText = 'Saved!';\n\n\t\t\t$timeout(_btnSaveReset, 2500);\n\t\t}", "title": "" }, { "docid": "c186a25ae939d915eab63d910edc3cbd", "score": "0.52817106", "text": "function _updateSuccess() {\n\t\t\taccount.btnSaved = true;\n\t\t\taccount.btnSaveText = 'Saved!';\n\n\t\t\t$timeout(_btnSaveReset, 2500);\n\t\t}", "title": "" }, { "docid": "c9e431cc2f7bc372246f76d8435be99a", "score": "0.52745473", "text": "function previousUser() {}", "title": "" }, { "docid": "7c4db8199677ddd47aa321afa16d2e88", "score": "0.5270749", "text": "function updateStatsForApplicant(entity, action, _callback) {\n\tlet stats_entity = seneca.make$('stats_entity');\n\tswitch (action) {\n\t\tcase 'create': \n\t\t\tentity.stats_wr_created = entity.stats_wr_created + 1;\n\t\t\tentity.stats_wr_opened = entity.stats_wr_opened + 1;\n\t\t\t// update\n\t\t\tstats_entity.save$(entity, function(err, result){\n\t\t\t\tif(err) {\n\t\t\t\t\t_callback(err);\n\t\t\t\t} else {\n\t\t\t\t\t_callback(result);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'delete':\n\t\t\tentity.stats_wr_opened = entity.stats_wr_opened - 1;\n\t\t\t// update\n\t\t\tstats_entity.save$(entity, function(err, result){\n\t\t\t\tif(err) {\n\t\t\t\t\t_callback(err);\n\t\t\t\t} else {\n\t\t\t\t\t_callback(result);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'close': \n\t\t\tentity.stats_wr_opened = entity.stats_wr_opened - 1;\n\t\t\tentity.stats_wr_closed = entity.stats_wr_closed + 1;\n\t\t\t// update\n\t\t\tstats_entity.save$(entity, function(err, result){\n\t\t\t\tif(err) {\n\t\t\t\t\t_callback(err);\n\t\t\t\t} else {\n\t\t\t\t\t_callback(result);\n\t\t\t\t}\n\t\t\t});\n\t\t\tbreak;\n\t\tdefault: \n\t\t\t_callback('stats action not supported');\n\t}\n}", "title": "" }, { "docid": "2ff613ca0b9e5a1aa7369d2081551e21", "score": "0.52697074", "text": "Update(){}", "title": "" }, { "docid": "adcbf68a70c34a887521d11121ef8624", "score": "0.52599984", "text": "function updateProfile() {\n\t\t\tvar _profileData = { displayName: account.user.displayName };\n\n\t\t\tif (account.user.displayName) {\n\t\t\t\t// Set status to Saving... and update upon success or error in callbacks\n\t\t\t\taccount.btnSaveText = 'Saving...';\n\n\t\t\t\t// Update the user, passing profile data and assigning success and error callbacks\n\t\t\t\tUserData.updateUser(_profileData).then(_updateSuccess, _updateError);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "85c46b1a861efefc516712d4e8f78a85", "score": "0.52562165", "text": "function updateProfile() {\n\t\t\tvar _profileData = { displayName: account.user.displayName };\n\n\t\t\tif (account.user.displayName) {\n\t\t\t\t// Set status to Saving... and update upon success or error in callbacks\n\t\t\t\taccount.btnSaveText = 'Saving...';\n\n\t\t\t\t// Update the user, passing profile data and assigning success and error callbacks\n\t\t\t\tuserData.updateUser(_profileData).then(_updateSuccess, _updateError);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "455d0e453f1a505550b5653c4b37e8a5", "score": "0.52482516", "text": "async function changestatus(e) {\n const data = { userId: whichUserId };\n await fetch(\n \"https://dashybackend.herokuapp.com/homeworkfinished/\".concat(e),\n {\n method: \"POST\",\n body: JSON.stringify(data),\n headers: { \"Content-Type\": \"application/json\" },\n }\n );\n setopenInputWindow(e);\n }", "title": "" }, { "docid": "d508581bd73ea81b2f3cbeb04f616415", "score": "0.5247113", "text": "function updateTime() {\n document.getElementById(\"lastUpdated\").innerHTML = \"Last updated @ \" + (new Date(time)).toLocaleString() + \", \" + Math.round((Date.now() - time) / 1000) + \" seconds ago\";\n}", "title": "" }, { "docid": "18d1ebe996738f09c4f9c7ce19fca983", "score": "0.524382", "text": "function update_last_used(email) {\n log(\"Updating last_active field for $1\", 'inf', [email]);\n db.query(\"UPDATE golfers SET last_active=$1 WHERE email=$2\", [moment.utc(), email])\n .then(function(data) {\n log(\"Successfully updated last_active field for $1\", 'suc', [email]);\n })\n .catch(function(error) {\n log(\"$1 wasn't able to update last_active field because there was an error quering the golfers database:\", 'err', [email]);\n console.log(error);\n });\n}", "title": "" }, { "docid": "f9f6bf985c442acaa63994bcc12e51da", "score": "0.52432996", "text": "saveAction() {\n this.sendAction('saveAction');\n }", "title": "" }, { "docid": "1cfba4cdd02b66cf748568a28865d7ea", "score": "0.5237471", "text": "function userListChanged() {\n\tvar toUser = getSelectedUser();\n\toutputComment(\"userListChanged called with \" + getSelectedUser());\n\t//no need to process further as only used locally as parameter for send command\n}", "title": "" }, { "docid": "72c3f68939d0cd2b049e357ae44859b2", "score": "0.52337474", "text": "refresh()\n {\n this.lastAccessed = Date.now();\n }", "title": "" }, { "docid": "197dae7133dca29c99441bd0a35a9dcb", "score": "0.52334654", "text": "function updateCurrentUserProfile() {\n\n //Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.userRoles.indexOf(data.Role) //<-- use ACCOUNT roles, NOT PLATFORM roles!\n\n if (vm.currentUserProfile.Id == \"\" || vm.currentUserProfile == null) {\n //Log user out if empty\n window.location.replace(\"/login\");\n }\n\n //Debug.trace(\"Profile refreshed!\");\n //Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "title": "" }, { "docid": "b32f64bbf7ffd79ba4d25fe96f5c305c", "score": "0.52282035", "text": "function updateScore() {\n STORE.userScore++;\n}", "title": "" }, { "docid": "a9b5a9c687ad034e71457b4a2a3c7671", "score": "0.522486", "text": "function update() {\n console.log('update');\n CheckIfAdmin();\n Refresh();\n //setTimeout(()=>{setRefreshThingy(!refreshThingy)}, 1000);\n }", "title": "" }, { "docid": "08b94c01ce982a6ec2e72a8d07b1f555", "score": "0.5224854", "text": "function registerUserActiveListener()\n {\n document.addEventListener('click', event => {\n if (isOneMinuteAgo(lastClick)) {\n sendUserActive()\n store.dispatch('app/updateLastClick')\n }\n })\n }", "title": "" }, { "docid": "7cd9f1e8e777edb62974c62e4d5d4265", "score": "0.52239275", "text": "function updateUser() {\n userService\n .updateUser(model.userId, model.user)\n .then(function() {\n model.message = \"User updated successfully.\";\n });\n }", "title": "" }, { "docid": "006ac106c49b36a0aeef3233aa8e57fa", "score": "0.52213687", "text": "function confirmSuccessfulUpdate() {\n console.log('Update successful! New stock for Item #' + currentItem.item_id + ': ' + (currentItem.currentQuantity + currentItem.quantityToAdd));\n setTimeout(promptForAdditionalActions, 1500);\n}", "title": "" }, { "docid": "e47ae61baaa00e65263c18e8d17eecc5", "score": "0.5220672", "text": "@action\n updatePrefsAction() {\n const alerts = this.args.alerts.map((alert) => {\n return {\n id: alert.id,\n use_sms: alert.use_sms ? 1 : 0,\n use_email: alert.use_email ? 1 : 0,\n }\n });\n\n this.isSubmitting = true;\n this.ajax.request(`person/${this.args.person.id}/alerts`, {\n method: 'PATCH',\n data: {alerts}\n }).then(() => {\n this.toast.success('The alert preferences have been successfully updated.')\n })\n .catch((response) => {\n this.house.handleErrorResponse(response)\n })\n .finally(() => this.isSubmitting = false);\n }", "title": "" }, { "docid": "cfda7290ee99874c3f2e8a544eb995d8", "score": "0.52181894", "text": "function user_updated(message) {\n var pos = message['pos']\n , click = message['click']\n , txt = message['txt']\n , last = message['c']\n , force = message['force']\n , tuuid = message['uuid']\n , mouse = mice[tuuid];\n\n if (!mouse) return user_joined(message);\n\n // Common to reset value if page reloaded\n if (last && (mouse.last||0) - last > 100)\n mouse.last = last;\n\n // Self\n ///if (force) mouse.last = last;\n\n // Prevent Jitter from Early Publish\n if (\n !force &&\n last &&\n mouse.last &&\n mouse.last > last\n ) return;\n\n // Set last for the future.\n if (last) mouse.last = last;\n\n // Update Text Display\n if (txt && lastletrs[tuuid] != txt) {\n fading_text( txt.replace( nohtml, ' ' ), mouse );\n }\n\n txt && (lastletrs[tuuid] = txt);\n\n // Set Delay to Fade User Out on No Activity.\n mouse.timerfade && clearTimeout(mouse.timerfade);\n mouse.timerfade = setTimeout( function() {\n PUBNUB.css( mouse.node, { 'opacity' : 0.4 } );\n clearTimeout(mouse.timerfade);\n mouse.timerfade = setTimeout( function() {\n PUBNUB.css( mouse.node, { 'display' : 'none' } );\n }, mousefade );\n }, mousefade );\n\n // Reshow if hidden.\n PUBNUB.css( mouse.node, {\n 'display' : 'block',\n 'opacity' : 1.0\n } );\n\n // Move Player.\n if (pos) {\n Sprite.move( mouse, {\n 'left' : pos[0],\n 'top' : pos[1]\n }, wait - 10 );\n\n // Change Direction\n if (pos[0] > mouse.left)\n Sprite.setframe( mouse, 0, { top : 200 } );\n else if (pos[0] < mouse.left)\n Sprite.setframe( mouse, 0, { top : 200 } );\n }\n}", "title": "" }, { "docid": "d80648eca8cdfab7b4776950acbcf102", "score": "0.5213228", "text": "printLastAccess() {\n const messages = this.contacts[this.currentUser].messages;\n return lastMessage = messages[messages.length - 1].date;\n }", "title": "" }, { "docid": "6825f62fc9b8f8907c61d4b6c88d4e32", "score": "0.5203716", "text": "function edit_user_start(state, action) {\n return {\n ...state,\n user: {\n ...state.user,\n editing: {\n updating: true,\n updated: false\n }\n }\n };\n}", "title": "" }, { "docid": "f65034bed285d84c953dba2bc8e5e5c3", "score": "0.5198784", "text": "update(delta){\n if(this._started && !this.currentBattlerTurn){\n const nextTurn = this.checkTurn();\n nextTurn && this.startTurn(nextTurn);\n };\n if(!this._busy && this.actionsTimeLine){ // si des actions dans file attend? atack,def,attakitem, eating..?\n this._busy = true;\n const nextActions = this.actionsTimeLine.shift();\n if(nextActions){ // si plus d'action en suspend , passe a autre passe a autre chose.\n switch (nextActions.type) {\n case this.combatMode[0]:\n this.actionPlay_attack(nextActions);\n break;\n case this.combatMode[1]:\n this.actionPlay_defense(nextActions)\n break;\n } \n }else{\n // fin du tour, plus d'action dans la list\n this.endTurn();\n }\n }\n\n }", "title": "" }, { "docid": "fed4b9a8d3982672c331ebd4dbff8557", "score": "0.5198674", "text": "updateCurrentUserPhrase(numberOfRemainingRepetitions) {\n\n store.dispatch(\"lastKnownPhraseId\", { lastKnownPhraseId: store.getters.currentPhrase.phraseId });\n this.loadNewPhrases();\n\n\n store.dispatch(\"updateCurrentUserPhrase\", {\n phraseId: store.getters.currentPhrase.phraseId,\n numberOfRemainingRepetitions: numberOfRemainingRepetitions,\n });\n\n \n \n }", "title": "" }, { "docid": "b4b10d6d3de9aed40c06d272d1fc6dad", "score": "0.51973754", "text": "function updateUserActivity(){\n\t//\tcalls updateActivity.php to update user database;\n\t\tif(!stop){\n\t\t\tcreateXMLHttpRequest();\n\t\t\txmlobj.open(\"GET\", \"updateActivityDB.php\", true);\n\t\t\txmlobj.send(\"r=\"+Math.random());//使用随机数处理缓存\n\t\t\tstop = true;//prevent user hitting stop button multiple times and updata databse multiple times;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "0a85711d31f3be7e0fe0e5eb158e43c5", "score": "0.5193348", "text": "updateStatus(){}", "title": "" }, { "docid": "2832d9e1a1d75e5eb07a48dff75ad786", "score": "0.51927274", "text": "function observer(action, channel, who) {\n if (who !== _bot.userName) {\n if (_seen[channel] == undefined) {\n _seen[channel] = {};\n }\n _seen[channel][who] = {\n \"action\": action,\n \"date\": new Date()\n };\n }\n }", "title": "" }, { "docid": "2e87db331fc70ea3681f9773d31df0c3", "score": "0.5190006", "text": "function setLastReadNotification() {\n if ($scope.notifications.length !== 0) {\n $scope.user.lastReadNotificationId = $scope.notifications[0]._id;\n\n UserService.update($scope.user)\n .then(res => {});\n\n $rootScope.$emit('notifications-read', 'Latest notifications read!');\n }\n }", "title": "" }, { "docid": "2f64af400dc1602dd044b0f2b2bcc04f", "score": "0.517393", "text": "updateLastPosition() {\n var map = this.get('map');\n var user = this.get('parcels.user');\n\n var actualPosition = webMercatorUtils.webMercatorToGeographic(map.extent.getCenter());\n user.setProperties({\n lastLongitude: actualPosition.x,\n lastLatitude: actualPosition.y,\n zoomLevel: map.getLevel(),\n spatialReference: (actualPosition.spatialReference.wkid).toString()\n });\n user.save();\n }", "title": "" }, { "docid": "e38567873af79e7fffd4ce259930f265", "score": "0.5172083", "text": "getUpActionUpdate() {\n var movingPicKey = this.state.currentUser.getTransitionGif(\"up\") \n this.setState({ moving: true });\n this.state.currentUser.changeLocation(\"up\");\n this.updateLocationStates(this.state.currentUser.getLocationInfo());\n this.setState({ movingPic: movingPicKey });\n this.setUserActive();\n this.turnOffLeftBar();\n this.turnOffRightBar();\n }", "title": "" }, { "docid": "b36233ccd24974c45d71f8e162145242", "score": "0.51684463", "text": "async editStats(){\n try {\n const requestBody = JSON.stringify({\n username: this.state.username,\n birthday: this.state.birthday\n });\n const url = \"/users/\"+this.state.userID;\n await api.put(url,requestBody);\n } catch (error){\n alert(`something went wrong: \\n${handleError(error)}`);\n }\n }", "title": "" }, { "docid": "1c635f594759c661a42a04fd3a142603", "score": "0.516607", "text": "updateScript() {\n\t\tthis.scriptAction++;\n\t\tthis.updateScriptAction = true;\n\t}", "title": "" }, { "docid": "d2494c5b4355b5e68af36adf6c4a8907", "score": "0.5165939", "text": "function updateActionRight(action) {\n actionFactory.updateActionRight(action)\n }", "title": "" }, { "docid": "74e2df17b33a7b591d60b2a66f4a4c9f", "score": "0.514765", "text": "function updateLastMsg(userId, newTs, newURL, callback) {\n db.getLastMsg(userId, (success, res) => {\n // has last msg\n if (res) {\n // delete last msg\n if (newTs === res.ts) return callback(true);\n else if (!newTs || newTs > res.ts) {\n sendMsgToUrl({ \"text\": \" \" }, res.response_url);\n if (newTs) db.updateLastMsg(userId, newTs, newURL, () => {});\n return callback(true);\n }\n // delete current msg\n else {\n sendMsgToUrl({ \"text\": \"This message has timed out. To start a new conversation, use `/teambot`\"}, newURL);\n return callback(false);\n }\n } else if (newTs) db.updateLastMsg(userId, newTs, newURL, () => callback(true));\n });\n}", "title": "" }, { "docid": "a94149ca51288f414c804460da1d94f1", "score": "0.51468635", "text": "updateUser(user) {\n user.updated = dateTime.now();\n $localStorage.user = user;\n User.update(user).$promise.then(() => {\n $log.debug('Cambios en User persistidos en el servidor.');\n }).catch(() => {\n $log.error('Actualización de cambios en User en el servidor falló.');\n });\n }", "title": "" }, { "docid": "f6e42291c0bb09bf1b4a4992d656c3e5", "score": "0.51451135", "text": "answer(){\n const user = Meteor.user();\n if (!user) {\n const err = new Meteor.Error(403, \"USER_NOT_LOGGED_IN\");\n Meteor.VideoCallServices.onError(err);\n throw err;\n }\n const session = CallLog.findOne({\n target: user._id,\n status: 'NEW'\n });\n if (!session) {\n const err = new Meteor.Error(500, 'SESSION_NOT_FOUND', {\n target: user._id\n });\n Meteor.VideoCallServices.onError(err, undefined, user);\n throw err;\n }\n\n else {\n CallLog.update({\n _id: session._id\n }, {\n $set: {\n status: 'ACCEPTED'\n }\n });\n }\n }", "title": "" }, { "docid": "6006d786612644f5149529d9a8d2c04d", "score": "0.5144861", "text": "function spotifyTouched(){\n\t\tthat.lastTouched = Date.now();\n\t}", "title": "" }, { "docid": "5c13af9163102b0acf1bb3394804aca3", "score": "0.51411337", "text": "function update() {\n var newUser = {\n username: $scope.profileUsername,\n password: $scope.profilePassword,\n firstName: $scope.profileFirstName,\n lastName: $scope.profileLastName,\n email: $scope.profileEmail\n };\n\n UserService.updateUser(currentUser._id, newUser, function(found) {\n if (found) {\n $location.url(\"profile\");\n console.log(found);\n }\n });\n\n }", "title": "" }, { "docid": "ee6cb8e45e3d4b4b9660e04cc1c2316d", "score": "0.5139217", "text": "function updateAction(step, result) {\n $http.put('rest/checklists/' + $location.search().id + \"/\" + step.id + \"/actionresults/\" + result)\n .success(function (data, status, headers, config) {\n $scope.data = data;\n if (getStepIdFromHash() === step.id && getStepById(step.id).complete) {\n repositionToNextUnfinishedStep();\n }\n }).error(function (data, status, headers, config) {\n console.log('Error updating step ' + step.id);\n });\n }", "title": "" }, { "docid": "5df4acf6abc742137cb9e96b47af45a5", "score": "0.51384914", "text": "async updateHighScore({ commit, state }) {\n\t\t\ttry {\n\t\t\t\tconst [error, user] = await UserAPI.editHighScore(state.userId, state.score);\n\t\t\t\t// Updating values\n\t\t\t\tcommit(\"setUser\", user);\n\t\t\t\tcommit(\"setHighScore\", state.user.highScore);\n\t\t\t\tcommit(\"setUserError\", error);\n\t\t\t} catch (error) {\n\t\t\t\tcommit(\"setUserError\", error.message);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "86cd4b18fa6471e2015aa43f89fb4a74", "score": "0.5133718", "text": "updateCount({ state, commit }, value) {\n if (state.user.name == 'Chris') {\n commit('INCREMENT_COUNT', value)\n }\n }", "title": "" }, { "docid": "52977296391a3b9bd4d2f170419e4157", "score": "0.5131728", "text": "function update(){}", "title": "" }, { "docid": "df7134f4d6400ef2ca829a34c5cef44f", "score": "0.5127581", "text": "function handleUpdateUser({ name, about }) {\n closeAllPopups();\n api\n .setUserInfo({ name, about })\n .then((res) => setCurrentUser(res))\n .catch((err) => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "e454404caee4040346b06ef11a23619e", "score": "0.51167566", "text": "function updateUserGains() {\n $rootScope.points = $scope.infoPlayer.score;\n $rootScope.coins = $scope.infoPlayer.money;\n }", "title": "" }, { "docid": "14c077742431af67f623bc84a4f1bfac", "score": "0.51103324", "text": "readyModalForUpdate(user) {\n this.setSelectedUser(user);\n }", "title": "" }, { "docid": "a2dc2dea2ca0efc1430a84a1a34f69c6", "score": "0.51078844", "text": "function updateAllOpacities() {\n\t\tvar min = Number.MAX_VALUE;\n\t\tvar max = 0;\n\t\tif(focus_user == null){\n\t\t\t// Calculate min and max (for 1 element min=max)\n\t\t\tfor(var key in user_dict){\n\t\t\t\tif(user_dict[key][\"last_time\"] > max){\n\t\t\t\t\tmax = user_dict[key][\"last_time\"]\n\t\t\t\t}\n\t\t\t\tif(user_dict[key][\"last_time\"] < min){\n\t\t\t\t\tmin = user_dict[key][\"last_time\"]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor(var key in user_dict){\n\t\t\t\tif(max != min){\n\t\t\t\t\t// Opacity is set to % of total range with 0.3 as floor\n\t\t\t\t\tvar calcOpacity = (((user_dict[key][\"last_time\"] - min)/(max - min))*0.7) + 0.3;\n\t\t\t\t\t$('.'+key+'-'+user_dict[key][\"last_time\"]).css({opacity: calcOpacity});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "d1e5f5a7b68d93bec6bf214e81addbbd", "score": "0.51048905", "text": "function AcetatePositionUpdateAction(acetate, acetateAction) {\n _super.call(this, action.Source.View, actionType.ACETATE_POSITION_UPDATE_ACTION);\n this._acetate = acetate;\n this._action = acetateAction;\n this.auditLog.logContent = this.auditLog.logContent.replace('{0}', acetate.clientToken);\n }", "title": "" }, { "docid": "cadfa0b1b4c4d8662a46690aa503f275", "score": "0.5102996", "text": "function updateInvitees() {\r\n updating = true;\r\n doRequest('/user.php?action=invite', requestComplete);\r\n}", "title": "" }, { "docid": "62068253d9cd55552c458118501dd83d", "score": "0.5101644", "text": "function decrementUsers() {\n \t\t$$invalidate(1, numNewGameUsers--, numNewGameUsers);\n \t}", "title": "" }, { "docid": "5c62e4f048eda094895e00c639c050f9", "score": "0.50999165", "text": "function onPostUserCompete( tRequest )\n {\n onRequestComplete( tRequest );\n \n //getting the new user ID back from the server\n let tempData = tRequest.response;\n tempData = JSON.parse( tempData );\n userId = tempData.id;\n\n postAnswers( 'answers', userId, answers );\n }", "title": "" }, { "docid": "5c07d94ee8c474eb37959ccce2c6a841", "score": "0.50979376", "text": "playerNightAction(player, action) {\n // First logs the action\n this.playerActions = {\n ...this.playerActions,\n [player]: action,\n };\n //Check if everyone has submitted an action\n if (Object.keys(this.playerActions).length === Object.keys(this.players).length) {\n this.doBaseNightActions();\n }\n }", "title": "" }, { "docid": "bf86bdae8981f677d3aef732be4ec5a8", "score": "0.50948006", "text": "update() {\n const action = pendingAction || this.actions.peek();\n\n if (!actor.alive) {\n this.isDone = true;\n return;\n }\n\n // if there's no action in queue...\n if (!action) {\n // ... and it's npc's turn then decide what to do\n if (!actor.isPlayerControlled) { actor.decideAction(this); }\n // ...and in any case quit the loop\n return;\n }\n\n // quit the loop if an action is pending\n if (action.pending) return;\n\n // execute the action if no pending action was found\n if (action !== pendingAction) {\n action.execute();\n }\n\n // if the action is pending then memorize it so that it won't get executed again\n // when the update loop reaches it after it is no longer pending\n if (action.pending) {\n pendingAction = action;\n return;\n }\n\n if (action.isDone) {\n // if action is done and it's type is not end action then\n // dispatch an event manually here otherwise it won't get sent\n if (action.type !== ActionTypes.END_ACTION_ACTION) {\n const nextPhase = phases.peek();\n sendEvent(EventTypes.END_ACTION_EVENT, { actor, phase: nextPhase });\n }\n\n this.nextPhase();\n }\n\n pendingAction = null;\n this.actions.next();\n }", "title": "" }, { "docid": "2f7f957fecd06aa685208d2080636a37", "score": "0.5088254", "text": "save(){\n return api.callAuthorized(api.updateUser, this.id, this);\n }", "title": "" }, { "docid": "b987fd5a1217520c814326351274a353", "score": "0.5088098", "text": "function updateLastShroom(__player){\r\n\tcontract.lastShroom(__player).then((result) =>\r\n\t{\r\n\t\thandleResult(result, m_lastShroom, 'lastShroom', \"string\");\r\n\t});\r\n}", "title": "" }, { "docid": "24e96686681c3987cb13877753fc2d29", "score": "0.50875056", "text": "function updateQuestion() {\n var date = new Date();\n var num = data.sessions.length - 1;\t// Current graph is most recent in array.\n\n // Update replay count.\n data.sessions[num].replays = data.sessions[num].replays + 1;\n\n // Stores the last time the user played the graph (same format as 'startTime').\n data.sessions[num].endTime = date.getTime();\n\n // Determines and stores the total time the user interacted with the graph (in milliseconds).\n data.sessions[num].totalTime = data.sessions[num].endTime - data.sessions[num].startTime;\n\n bakeCookie();\n}", "title": "" }, { "docid": "cb405510665acf47913cdf0732655faf", "score": "0.50871074", "text": "function On_Update(strUserName, strPwd, iPort, strPath, strMD5, iReplyID, strSessionID, strClientID, userdata) {\n console.log(\"Get update from: ftp://\" + strUserName + \":\" + strPwd + \"@\" + strServerIP + \"/\" + strPath + \" with md5: \" + strMD5);\n client.core_action_response(iReplyID, strSessionID, true, strClientID);\n}", "title": "" }, { "docid": "898795fabeede231bfd9f6bd5676d819", "score": "0.5085137", "text": "_handleSaveUserAction () {\n const { dispatch } = this.props;\n let saveUserResult = dispatch(userActions.saveUser());\n\n saveUserResult.then(() => {\n // refresh user list\n this._refreshUserData();\n // close/hide user detail\n dispatch(uiActions.hideUserView());\n }, error => {\n // TODO: saving user error\n console.log('USER SAVE ERROR!');\n console.log(error);\n })\n }", "title": "" }, { "docid": "a47ee59161347ec5005a6d61da41f131", "score": "0.5083548", "text": "showUpdate(user) {\n \n let adminInfo = {\n name : user.name,\n email: user.mail,\n emailSearch: user.email\n };\n\n this.handleUpdateUser(adminInfo);\n }", "title": "" }, { "docid": "79175ba0aabce070e91f07f8ac1bfe62", "score": "0.5079482", "text": "function CheckForLastShown(userId){\n\tdb.transaction(function(tx) {\n\t\tdoQuery(tx, 'SELECT * FROM Users WHERE UserId = '+userId+';',[],function(tx,result){\n\t\t\tif (result != null && result.rows != null) {\n\t\t\t\tif (result.rows.length != 0 && result.rows.length == 1){\n\t\t\t\t\tvar row = result.rows.item(0);\n\t \t\t\t$('.userData span.level6').html(row.Level6);\n\t \t\t\t$('.userData span.level5').html(row.Level5);\n\t \t\t\t$('.userData span.level4').html(row.Level4);\n\t \t\t\t$('.userData span.level3').html(row.Level3);\n\t \t\t\t$('.userData span.level2').html(row.Level2);\n\t \t\t\t$('.userData span.level1').html(row.Level1);\n\t \t\t\t$('.userData span.level0').html(row.Level0);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\t\n\tdb.transaction(function(tx) {\n\t\tdoQuery(tx, 'SELECT * FROM Result WHERE user_id = '+userId+';',[],function(tx,result){\n\t\t\tif (result != null && result.rows != null) {\n\t\t\t\tif (result.rows.length != 0){\n\t\t\t\t\tfor (var i = 0; i < result.rows.length; i++) {\n\t\t\t\t\t\tvar row = result.rows.item(i);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(DEBUG_MODE) console.log('Update day of learning');\n\t\t\t\t\t\t\n\t\t\t \t\tvar level = parseInt(row.LongtermLevel,10);\n\t\t\t \t\tvar now = parseInt(new Date().setHours(0,0,0,0)/1000,10);\n\t\t\t \t\t\t\t\t \t\t\n\t\t\t \t\tif(DEBUG_MODE) console.log('Now: ' + now);\n\t\t\t\t\t\tif(DEBUG_MODE) console.log('Last Shown: ' + row.LastShown);\n\t\t\t \t\t\n\t\t\t \t\tvar levelInfo = {};\n\t\t \t\t\tlevelInfo['level6'] = $('.userData span.level6').html();\n\t\t \t\t\tlevelInfo['level5'] = $('.userData span.level5').html();\n\t\t \t\t\tlevelInfo['level4'] = $('.userData span.level4').html();\n\t\t \t\t\tlevelInfo['level3'] = $('.userData span.level3').html();\n\t\t \t\t\tlevelInfo['level2'] = $('.userData span.level2').html();\n\t\t \t\t\tlevelInfo['level1'] = $('.userData span.level1').html();\n\t\t \t\t\tlevelInfo['level0'] = $('.userData span.level0').html();\n\t\t \t\t\t\n\t\t \t\t\tif(DEBUG_MODE) console.log('level6 ' + levelInfo['level6']);\n\t\t\t \t\t\n\t\t\t \t\tvar updateLastShownDate = false;\n\t\t\t \t\t\n\t\t\t \t\tvar updateItem = {};\n\t\t\t \t\tupdateItem['learnItemId'] = row.learnItem_id;\t\t\t \t\t\n\t\t\t\t\t\tupdateItem['userId'] = userId;\n\t\t\t \t\t\n\t\t\t\t\t\tif (row.LastShown < now){\n\t\t\t\t\t\t\tvar timeDiff = now - row.LastShown;\n\t\t\t\t\t\t\tvar diffDays = parseInt(timeDiff / (3600 * 24),10);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar d = new Date();\n\t\t\t\t\t\t\tif(DEBUG_MODE) console.log('difference ' + diffDays);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tswitch (level) {\n\t\t\t\t\t\t\t\tcase 6:\t\t\t\n\t\t\t\t\t\t\t\t\t//Check if \n\t\t\t\t\t\t\t\t\tif (levelInfo['level6'] < diffDays){\n\t\t\t\t\t\t\t\t\t\tupdateLastShownDate = true;\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\tupdateLastShownDate = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t\t\t//Downgrade to level 6\n\t\t\t\t\t\t\t\t\tif (levelInfo['level5'] < diffDays){\n\t\t\t\t\t\t\t\t\t\tupdateLastShownDate = true;\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\tupdateLastShownDate = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\tif (levelInfo['level4'] < diffDays){\n\t\t\t\t\t\t\t\t\t\tupdateLastShownDate = true;\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\tupdateLastShownDate = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\tif (levelInfo['level3'] < diffDays){\n\t\t\t\t\t\t\t\t\t\tupdateLastShownDate = true;\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\tupdateLastShownDate = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\tif (levelInfo['level2'] < diffDays){\n\t\t\t\t\t\t\t\t\t\tupdateLastShownDate = true;\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\tupdateLastShownDate = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\tif (levelInfo['level1'] < diffDays){\n\t\t\t\t\t\t\t\t\t\tupdateLastShownDate = true;\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\tupdateLastShownDate = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\tif (levelInfo['level6'] < diffDays){\n\t\t\t\t\t\t\t\t\t\tupdateLastShownDate = true;\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\tupdateLastShownDate = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tupdateLastShownDate = false;\n\t\t\t\t\t\t\t\t\tbreak;\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//Set Longterm level 1 up (if not level 6 learn item)\n\t\t\t\t\t\tif (updateLastShownDate){\n\t\t\t\t\t\t\tif (row.LongtermLevel != 6){\n\t\t\t\t\t\t\t\tupdateItem['longtermLevel'] = row.LongtermLevel + 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tupdateItem['longtermLevel'] = row.LongtermLevel;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// set last shown date for result to span of days in intervals (if user studied level 6 vocabulary the day before yesterday\n\t\t\t\t\t\t\t// and in their interval level 6 ist set to 1 day - the last shown date of the result is set to yesterday)\n\t\t\t\t\t\t\tvar newLastShown = parseInt(d.setDate(d.getDate() - levelInfo['level'+row.LongtermLevel]),10);\n\t\t\t\t\t\t\tupdateItem['lastShown'] = new Date(newLastShown).setHours(0,0,0,0)/1000;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(DEBUG_MODE) console.log('lastShown after update ' + updateItem['lastShown']);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tUpdateResultToDB(updateItem);\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});\n}", "title": "" }, { "docid": "3ace4c01a585eb5a9b145f19d39a4466", "score": "0.5079149", "text": "function lastLocation(req,res){\n\tvar postdata = req.query;\n\tif(!postdata.lastRID) postdata.lastRID = null;\n\tif(req.user){\n\t\tvar userID = new ObjectID(req['user']);\n\t\tusersCollection.update(\n\t\t\t{'_id': userID},\n\t\t\t{'$set': postdata}, \n\t\t\tfunction(err) {\n\t\t\t\tif(err) writeError(res,err.message);\n\t\t\t\telse writeSuccess(res);\n\t\t\t}\n\t\t);\n\t} else if(req.session){\n\t\treq.session.lastLocation = postdata.lastLocation;\n\t\treq.session.lastRID = postdata.lastRID;\n\t\twriteSuccess(res);\n\t}\n\telse writeError(res,'no session or user');\n}", "title": "" }, { "docid": "18db7aa34baa58206ca0a28cc2c2ab81", "score": "0.50790995", "text": "function updateLastOnline(curr_user,callback) {\n var query_statement = 'update user_status set last_online=Now() where user_id=? AND status=\"online\"';\n mysql.getConnection(function (err,conn) {\n if(err){\n console.log(\"connection failed\");\n }else{\n conn.query(query_statement,[curr_user],(err,result) => {\n if (err) {\n callback(false);\n }else{\n console.log(result.affectedRows + \" record(s) updated\");\n callback(true);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "3bdbad39f8e36d3cb419234daa582b72", "score": "0.5077183", "text": "function saveAsPreviousCommandDetails(command){\n User.setProperty('previousCommand', command,'Object');\n}", "title": "" }, { "docid": "6319fa53811691614523abac45726ef9", "score": "0.507608", "text": "function update() {\n const newValues = getCurrentUIValues();\n const userPayment = calculateMonthlyPayment(newValues);\n updateMonthly(userPayment);\n\n}", "title": "" } ]
9bccfaca915987223ef47eae5299b4fc
Clones (copies) an Object using deep copying. This function supports circular references by default, but if you are certain there are no circular references in your object, you can save some CPU time by calling clone(obj, false). Caution: if `circular` is false and `parent` contains circular references, your program may enter an infinite loop and crash.
[ { "docid": "b0c509caf9eb39530aa8fe6dd3a8364d", "score": "0.77269274", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" } ]
[ { "docid": "9d70ee0e0ad3fc4d62309a9720fd9cfb", "score": "0.83630484", "text": "function clone(parent, circular) {\n if (typeof circular == 'undefined')\n circular = true;\n\n var useBuffer = typeof Buffer != 'undefined';\n\n var circularParent = {};\n var circularResolved = {};\n var circularReplace = [];\n\n function _clone(parent, context, child, cIndex) {\n var i; // Use local context within this function\n // Deep clone all properties of parent into child\n if (typeof parent == 'object') {\n if (parent == null)\n return parent;\n // Check for circular references\n for(i in circularParent)\n if (circularParent[i] === parent) {\n // We found a circular reference\n circularReplace.push({'resolveTo': i, 'child': child, 'i': cIndex});\n return null; //Just return null for now...\n // we will resolve circular references later\n }\n\n // Add to list of all parent objects\n circularParent[context] = parent;\n // Now continue cloning...\n if (util.isArray(parent)) {\n child = [];\n for(i in parent)\n child[i] = _clone(parent[i], context + '[' + i + ']', child, i);\n }\n else if (util.isDate(parent))\n child = new Date(parent.getTime());\n else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (useBuffer && Buffer.isBuffer(parent))\n {\n child = new Buffer(parent.length);\n parent.copy(child);\n }\n else {\n child = {};\n\n // Also copy prototype over to new cloned object\n child.__proto__ = parent.__proto__;\n for(i in parent)\n child[i] = _clone(parent[i], context + '[' + i + ']', child, i);\n }\n\n // Add to list of all cloned objects\n circularResolved[context] = child;\n }\n else\n child = parent; //Just a simple shallow copy will do\n return child;\n }\n\n var i;\n if (circular) {\n var cloned = _clone(parent, '*');\n\n // Now this object has been cloned. Let's check to see if there are any\n // circular references for it\n for(i in circularReplace) {\n var c = circularReplace[i];\n if (c && c.child && c.i in c.child) {\n c.child[c.i] = circularResolved[c.resolveTo];\n }\n }\n return cloned;\n } else {\n // Deep clone all properties of parent into child\n var child;\n if (typeof parent == 'object') {\n if (parent == null)\n return parent;\n if (parent.constructor.name === 'Array') {\n child = [];\n for(i in parent)\n child[i] = clone(parent[i], circular);\n }\n else if (util.isDate(parent))\n child = new Date(parent.getTime() );\n else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else {\n child = {};\n child.__proto__ = parent.__proto__;\n for(i in parent)\n child[i] = clone(parent[i], circular);\n }\n }\n else\n child = parent; // Just a simple shallow clone will do\n return child;\n }\n}", "title": "" }, { "docid": "9d70ee0e0ad3fc4d62309a9720fd9cfb", "score": "0.83630484", "text": "function clone(parent, circular) {\n if (typeof circular == 'undefined')\n circular = true;\n\n var useBuffer = typeof Buffer != 'undefined';\n\n var circularParent = {};\n var circularResolved = {};\n var circularReplace = [];\n\n function _clone(parent, context, child, cIndex) {\n var i; // Use local context within this function\n // Deep clone all properties of parent into child\n if (typeof parent == 'object') {\n if (parent == null)\n return parent;\n // Check for circular references\n for(i in circularParent)\n if (circularParent[i] === parent) {\n // We found a circular reference\n circularReplace.push({'resolveTo': i, 'child': child, 'i': cIndex});\n return null; //Just return null for now...\n // we will resolve circular references later\n }\n\n // Add to list of all parent objects\n circularParent[context] = parent;\n // Now continue cloning...\n if (util.isArray(parent)) {\n child = [];\n for(i in parent)\n child[i] = _clone(parent[i], context + '[' + i + ']', child, i);\n }\n else if (util.isDate(parent))\n child = new Date(parent.getTime());\n else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (useBuffer && Buffer.isBuffer(parent))\n {\n child = new Buffer(parent.length);\n parent.copy(child);\n }\n else {\n child = {};\n\n // Also copy prototype over to new cloned object\n child.__proto__ = parent.__proto__;\n for(i in parent)\n child[i] = _clone(parent[i], context + '[' + i + ']', child, i);\n }\n\n // Add to list of all cloned objects\n circularResolved[context] = child;\n }\n else\n child = parent; //Just a simple shallow copy will do\n return child;\n }\n\n var i;\n if (circular) {\n var cloned = _clone(parent, '*');\n\n // Now this object has been cloned. Let's check to see if there are any\n // circular references for it\n for(i in circularReplace) {\n var c = circularReplace[i];\n if (c && c.child && c.i in c.child) {\n c.child[c.i] = circularResolved[c.resolveTo];\n }\n }\n return cloned;\n } else {\n // Deep clone all properties of parent into child\n var child;\n if (typeof parent == 'object') {\n if (parent == null)\n return parent;\n if (parent.constructor.name === 'Array') {\n child = [];\n for(i in parent)\n child[i] = clone(parent[i], circular);\n }\n else if (util.isDate(parent))\n child = new Date(parent.getTime() );\n else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else {\n child = {};\n child.__proto__ = parent.__proto__;\n for(i in parent)\n child[i] = clone(parent[i], circular);\n }\n }\n else\n child = parent; // Just a simple shallow clone will do\n return child;\n }\n}", "title": "" }, { "docid": "1a26135f1b334e65ccd76c2eab18e75f", "score": "0.78108454", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n\t if (typeof circular === 'object') {\n\t depth = circular.depth;\n\t prototype = circular.prototype;\n\t includeNonEnumerable = circular.includeNonEnumerable;\n\t circular = circular.circular;\n\t }\n\t // maintain two arrays for circular references, where corresponding parents\n\t // and children have the same index\n\t var allParents = [];\n\t var allChildren = [];\n\n\t var useBuffer = typeof Buffer != 'undefined';\n\n\t if (typeof circular == 'undefined')\n\t circular = true;\n\n\t if (typeof depth == 'undefined')\n\t depth = Infinity;\n\n\t // recurse this function so we don't reset allParents and allChildren\n\t function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\n\t if (depth === 0)\n\t return parent;\n\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\n\t if (_instanceof(parent, nativeMap)) {\n\t child = new nativeMap();\n\t } else if (_instanceof(parent, nativeSet)) {\n\t child = new nativeSet();\n\t } else if (_instanceof(parent, nativePromise)) {\n\t child = new nativePromise(function (resolve, reject) {\n\t parent.then(function(value) {\n\t resolve(_clone(value, depth - 1));\n\t }, function(err) {\n\t reject(_clone(err, depth - 1));\n\t });\n\t });\n\t } else if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else if (_instanceof(parent, Error)) {\n\t child = Object.create(parent);\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\n\t if (_instanceof(parent, nativeMap)) {\n\t parent.forEach(function(value, key) {\n\t var keyChild = _clone(key, depth - 1);\n\t var valueChild = _clone(value, depth - 1);\n\t child.set(keyChild, valueChild);\n\t });\n\t }\n\t if (_instanceof(parent, nativeSet)) {\n\t parent.forEach(function(value) {\n\t var entryChild = _clone(value, depth - 1);\n\t child.add(entryChild);\n\t });\n\t }\n\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\n\t if (Object.getOwnPropertySymbols) {\n\t var symbols = Object.getOwnPropertySymbols(parent);\n\t for (var i = 0; i < symbols.length; i++) {\n\t // Don't need to worry about cloning a symbol because it is a primitive,\n\t // like a number or string.\n\t var symbol = symbols[i];\n\t var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n\t if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n\t continue;\n\t }\n\t child[symbol] = _clone(parent[symbol], depth - 1);\n\t if (!descriptor.enumerable) {\n\t Object.defineProperty(child, symbol, {\n\t enumerable: false\n\t });\n\t }\n\t }\n\t }\n\n\t if (includeNonEnumerable) {\n\t var allPropertyNames = Object.getOwnPropertyNames(parent);\n\t for (var i = 0; i < allPropertyNames.length; i++) {\n\t var propertyName = allPropertyNames[i];\n\t var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n\t if (descriptor && descriptor.enumerable) {\n\t continue;\n\t }\n\t child[propertyName] = _clone(parent[propertyName], depth - 1);\n\t Object.defineProperty(child, propertyName, {\n\t enumerable: false\n\t });\n\t }\n\t }\n\n\t return child;\n\t }\n\n\t return _clone(parent, depth);\n\t}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6a2d7e9807e65519c618225890b6fee5", "score": "0.7794123", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "cfc4f22f390b2a07983d62e9824707e5", "score": "0.77783155", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (parent instanceof nativeMap) {\n child = new nativeMap();\n } else if (parent instanceof nativeSet) {\n child = new nativeSet();\n } else if (parent instanceof nativePromise) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (parent instanceof Error) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (parent instanceof nativeMap) {\n var keyIterator = parent.keys();\n while(true) {\n var next = keyIterator.next();\n if (next.done) {\n break;\n }\n var keyChild = _clone(next.value, depth - 1);\n var valueChild = _clone(parent.get(next.value), depth - 1);\n child.set(keyChild, valueChild);\n }\n }\n if (parent instanceof nativeSet) {\n var iterator = parent.keys();\n while(true) {\n var next = iterator.next();\n if (next.done) {\n break;\n }\n var entryChild = _clone(next.value, depth - 1);\n child.add(entryChild);\n }\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "cfc4f22f390b2a07983d62e9824707e5", "score": "0.77783155", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (parent instanceof nativeMap) {\n child = new nativeMap();\n } else if (parent instanceof nativeSet) {\n child = new nativeSet();\n } else if (parent instanceof nativePromise) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (parent instanceof Error) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (parent instanceof nativeMap) {\n var keyIterator = parent.keys();\n while(true) {\n var next = keyIterator.next();\n if (next.done) {\n break;\n }\n var keyChild = _clone(next.value, depth - 1);\n var valueChild = _clone(parent.get(next.value), depth - 1);\n child.set(keyChild, valueChild);\n }\n }\n if (parent instanceof nativeSet) {\n var iterator = parent.keys();\n while(true) {\n var next = iterator.next();\n if (next.done) {\n break;\n }\n var entryChild = _clone(next.value, depth - 1);\n child.add(entryChild);\n }\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "f494d891bf6bc5c99bdcfbd7609deb9d", "score": "0.7729889", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if ((typeof circular === 'undefined' ? 'undefined' : _typeof(circular)) === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined') circular = true;\n\n if (typeof depth == 'undefined') depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null) return null;\n\n if (depth === 0) return parent;\n\n var child;\n var proto;\n if ((typeof parent === 'undefined' ? 'undefined' : _typeof(parent)) != 'object') {\n return parent;\n }\n\n if (_instanceof$$1(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof$$1(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof$$1(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function (value) {\n resolve(_clone(value, depth - 1));\n }, function (err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof$$1(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n } else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof$$1(parent, nativeMap)) {\n parent.forEach(function (value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof$$1(parent, nativeSet)) {\n parent.forEach(function (value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n }", "title": "" }, { "docid": "a4dd281f8c396e2f0ba8e90b146d27d7", "score": "0.77003366", "text": "function clone(parent, circular, depth, prototype) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (util.isArray(parent)) {\n child = [];\n } else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (util.isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n \n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "a4dd281f8c396e2f0ba8e90b146d27d7", "score": "0.77003366", "text": "function clone(parent, circular, depth, prototype) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (util.isArray(parent)) {\n child = [];\n } else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (util.isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n \n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "a4dd281f8c396e2f0ba8e90b146d27d7", "score": "0.77003366", "text": "function clone(parent, circular, depth, prototype) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (util.isArray(parent)) {\n child = [];\n } else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (util.isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n \n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "a4dd281f8c396e2f0ba8e90b146d27d7", "score": "0.77003366", "text": "function clone(parent, circular, depth, prototype) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (util.isArray(parent)) {\n child = [];\n } else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (util.isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n \n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "a4dd281f8c396e2f0ba8e90b146d27d7", "score": "0.77003366", "text": "function clone(parent, circular, depth, prototype) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (util.isArray(parent)) {\n child = [];\n } else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (util.isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n \n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2f84054ce06a196e7ed4b8c57667cdb4", "score": "0.7694333", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if ((typeof circular === 'undefined' ? 'undefined' : _typeof(circular)) === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined') circular = true;\n\n if (typeof depth == 'undefined') depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null) return null;\n\n if (depth === 0) return parent;\n\n var child;\n var proto;\n if ((typeof parent === 'undefined' ? 'undefined' : _typeof(parent)) != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function (value) {\n resolve(_clone(value, depth - 1));\n }, function (err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n } else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function (value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function (value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n }", "title": "" }, { "docid": "0a6fce12f5dcdc84d8787f018857089d", "score": "0.7694008", "text": "function clone(parent, circular, depth, prototype) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (util.isArray(parent)) {\n child = [];\n } else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (util.isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "0a6fce12f5dcdc84d8787f018857089d", "score": "0.7694008", "text": "function clone(parent, circular, depth, prototype) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (util.isArray(parent)) {\n child = [];\n } else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (util.isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "6b7c594a5d921d4849810af053a86a47", "score": "0.76865894", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function(resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n } else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n }", "title": "" }, { "docid": "6f6f965598688c77863d6af6ca257e32", "score": "0.7658449", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n }", "title": "" }, { "docid": "b16dd5d8359767181a2bbcf798e8ae38", "score": "0.7657955", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n \t if (typeof circular === 'object') {\n \t depth = circular.depth;\n \t prototype = circular.prototype;\n \t includeNonEnumerable = circular.includeNonEnumerable;\n \t circular = circular.circular;\n \t }\n \t // maintain two arrays for circular references, where corresponding parents\n \t // and children have the same index\n \t var allParents = [];\n \t var allChildren = [];\n\n \t var useBuffer = typeof Buffer != 'undefined';\n\n \t if (typeof circular == 'undefined')\n \t circular = true;\n\n \t if (typeof depth == 'undefined')\n \t depth = Infinity;\n\n \t // recurse this function so we don't reset allParents and allChildren\n \t function _clone(parent, depth) {\n \t // cloning null always returns null\n \t if (parent === null)\n \t return null;\n\n \t if (depth === 0)\n \t return parent;\n\n \t var child;\n \t var proto;\n \t if (typeof parent != 'object') {\n \t return parent;\n \t }\n\n \t if (_instanceof(parent, nativeMap)) {\n \t child = new nativeMap();\n \t } else if (_instanceof(parent, nativeSet)) {\n \t child = new nativeSet();\n \t } else if (_instanceof(parent, nativePromise)) {\n \t child = new nativePromise(function (resolve, reject) {\n \t parent.then(function(value) {\n \t resolve(_clone(value, depth - 1));\n \t }, function(err) {\n \t reject(_clone(err, depth - 1));\n \t });\n \t });\n \t } else if (clone.__isArray(parent)) {\n \t child = [];\n \t } else if (clone.__isRegExp(parent)) {\n \t child = new RegExp(parent.source, __getRegExpFlags(parent));\n \t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n \t } else if (clone.__isDate(parent)) {\n \t child = new Date(parent.getTime());\n \t } else if (useBuffer && Buffer.isBuffer(parent)) {\n \t if (Buffer.allocUnsafe) {\n \t // Node.js >= 4.5.0\n \t child = Buffer.allocUnsafe(parent.length);\n \t } else {\n \t // Older Node.js versions\n \t child = new Buffer(parent.length);\n \t }\n \t parent.copy(child);\n \t return child;\n \t } else if (_instanceof(parent, Error)) {\n \t child = Object.create(parent);\n \t } else {\n \t if (typeof prototype == 'undefined') {\n \t proto = Object.getPrototypeOf(parent);\n \t child = Object.create(proto);\n \t }\n \t else {\n \t child = Object.create(prototype);\n \t proto = prototype;\n \t }\n \t }\n\n \t if (circular) {\n \t var index = allParents.indexOf(parent);\n\n \t if (index != -1) {\n \t return allChildren[index];\n \t }\n \t allParents.push(parent);\n \t allChildren.push(child);\n \t }\n\n \t if (_instanceof(parent, nativeMap)) {\n \t parent.forEach(function(value, key) {\n \t var keyChild = _clone(key, depth - 1);\n \t var valueChild = _clone(value, depth - 1);\n \t child.set(keyChild, valueChild);\n \t });\n \t }\n \t if (_instanceof(parent, nativeSet)) {\n \t parent.forEach(function(value) {\n \t var entryChild = _clone(value, depth - 1);\n \t child.add(entryChild);\n \t });\n \t }\n\n \t for (var i in parent) {\n \t var attrs;\n \t if (proto) {\n \t attrs = Object.getOwnPropertyDescriptor(proto, i);\n \t }\n\n \t if (attrs && attrs.set == null) {\n \t continue;\n \t }\n \t child[i] = _clone(parent[i], depth - 1);\n \t }\n\n \t if (Object.getOwnPropertySymbols) {\n \t var symbols = Object.getOwnPropertySymbols(parent);\n \t for (var i = 0; i < symbols.length; i++) {\n \t // Don't need to worry about cloning a symbol because it is a primitive,\n \t // like a number or string.\n \t var symbol = symbols[i];\n \t var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n \t if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n \t continue;\n \t }\n \t child[symbol] = _clone(parent[symbol], depth - 1);\n \t if (!descriptor.enumerable) {\n \t Object.defineProperty(child, symbol, {\n \t enumerable: false\n \t });\n \t }\n \t }\n \t }\n\n \t if (includeNonEnumerable) {\n \t var allPropertyNames = Object.getOwnPropertyNames(parent);\n \t for (var i = 0; i < allPropertyNames.length; i++) {\n \t var propertyName = allPropertyNames[i];\n \t var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n \t if (descriptor && descriptor.enumerable) {\n \t continue;\n \t }\n \t child[propertyName] = _clone(parent[propertyName], depth - 1);\n \t Object.defineProperty(child, propertyName, {\n \t enumerable: false\n \t });\n \t }\n \t }\n\n \t return child;\n \t }\n\n \t return _clone(parent, depth);\n \t}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "327da88e4668fb1a09294c64daf96156", "score": "0.7649828", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "4b9a2eb150c5886f7e7c0b6a0cebe4ad", "score": "0.76495504", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if ((typeof circular === \"undefined\" ? \"undefined\" : _typeof2(circular)) === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined') circular = true;\n\n if (typeof depth == 'undefined') depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null) return null;\n\n if (depth === 0) return parent;\n\n var child;\n var proto;\n if ((typeof parent === \"undefined\" ? \"undefined\" : _typeof2(parent)) != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function (value) {\n resolve(_clone(value, depth - 1));\n }, function (err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n } else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function (value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function (value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n }", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "2cf9ad6b26c48b68e8c43995e32da65d", "score": "0.7647282", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}", "title": "" }, { "docid": "41d86696c6555a8bf6bf331ba6fd5b26", "score": "0.76354504", "text": "function clone(parent, circular, depth, prototype) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n \n var useBuffer = typeof Buffer != 'undefined';\n \n if (typeof circular == 'undefined')\n circular = true;\n \n if (typeof depth == 'undefined')\n depth = Infinity;\n \n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n \n if (depth == 0)\n return parent;\n \n var child;\n if (typeof parent != 'object') {\n return parent;\n }\n \n if (util.isArray(parent)) {\n child = [];\n } else if (util.isRegExp(parent)) {\n child = new RegExp(parent.source, util.getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (util.isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') child = Object.create(Object.getPrototypeOf(parent));\n else child = Object.create(prototype);\n }\n \n if (circular) {\n var index = allParents.indexOf(parent);\n \n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n \n for (var i in parent) {\n child[i] = _clone(parent[i], depth - 1);\n }\n \n return child;\n }\n \n return _clone(parent, depth);\n }", "title": "" }, { "docid": "4b932f3221ca50a0000deeacc1fcfa32", "score": "0.76123464", "text": "function clone(parent,circular,depth,prototype){var filter;if(_typeof4(circular)==='object'){depth=circular.depth;prototype=circular.prototype;filter=circular.filter;circular=circular.circular;}// maintain two arrays for circular references, where corresponding parents\n// and children have the same index\nvar allParents=[];var allChildren=[];var useBuffer=typeof Buffer!='undefined';if(typeof circular=='undefined')circular=true;if(typeof depth=='undefined')depth=Infinity;// recurse this function so we don't reset allParents and allChildren\nfunction _clone(parent,depth){// cloning null always returns null\nif(parent===null)return null;if(depth==0)return parent;var child;var proto;if(_typeof4(parent)!='object'){return parent;}if(clone.__isArray(parent)){child=[];}else if(clone.__isRegExp(parent)){child=new RegExp(parent.source,__getRegExpFlags(parent));if(parent.lastIndex)child.lastIndex=parent.lastIndex;}else if(clone.__isDate(parent)){child=new Date(parent.getTime());}else if(useBuffer&&Buffer.isBuffer(parent)){if(Buffer.allocUnsafe){// Node.js >= 4.5.0\nchild=Buffer.allocUnsafe(parent.length);}else{// Older Node.js versions\nchild=new Buffer(parent.length);}parent.copy(child);return child;}else{if(typeof prototype=='undefined'){proto=Object.getPrototypeOf(parent);child=Object.create(proto);}else{child=Object.create(prototype);proto=prototype;}}if(circular){var index=allParents.indexOf(parent);if(index!=-1){return allChildren[index];}allParents.push(parent);allChildren.push(child);}for(var i in parent){var attrs;if(proto){attrs=Object.getOwnPropertyDescriptor(proto,i);}if(attrs&&attrs.set==null){continue;}child[i]=_clone(parent[i],depth-1);}return child;}return _clone(parent,depth);}", "title": "" }, { "docid": "5c3d1ce91bfbeacb0c305f0045f279e2", "score": "0.7608565", "text": "function clone(parent, circular, depth, prototype) {\n\t var filter;\n\t if (typeof circular === 'object') {\n\t depth = circular.depth;\n\t prototype = circular.prototype;\n\t filter = circular.filter;\n\t circular = circular.circular\n\t }\n\t // maintain two arrays for circular references, where corresponding parents\n\t // and children have the same index\n\t var allParents = [];\n\t var allChildren = [];\n\t\n\t var useBuffer = typeof Buffer != 'undefined';\n\t\n\t if (typeof circular == 'undefined')\n\t circular = true;\n\t\n\t if (typeof depth == 'undefined')\n\t depth = Infinity;\n\t\n\t // recurse this function so we don't reset allParents and allChildren\n\t function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\t\n\t if (depth == 0)\n\t return parent;\n\t\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\t\n\t if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\t\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\t\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\t\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\t\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\t\n\t return child;\n\t }\n\t\n\t return _clone(parent, depth);\n\t}", "title": "" }, { "docid": "5c3d1ce91bfbeacb0c305f0045f279e2", "score": "0.7608565", "text": "function clone(parent, circular, depth, prototype) {\n\t var filter;\n\t if (typeof circular === 'object') {\n\t depth = circular.depth;\n\t prototype = circular.prototype;\n\t filter = circular.filter;\n\t circular = circular.circular\n\t }\n\t // maintain two arrays for circular references, where corresponding parents\n\t // and children have the same index\n\t var allParents = [];\n\t var allChildren = [];\n\t\n\t var useBuffer = typeof Buffer != 'undefined';\n\t\n\t if (typeof circular == 'undefined')\n\t circular = true;\n\t\n\t if (typeof depth == 'undefined')\n\t depth = Infinity;\n\t\n\t // recurse this function so we don't reset allParents and allChildren\n\t function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\t\n\t if (depth == 0)\n\t return parent;\n\t\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\t\n\t if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\t\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\t\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\t\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\t\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\t\n\t return child;\n\t }\n\t\n\t return _clone(parent, depth);\n\t}", "title": "" }, { "docid": "26d7b55236ad520d77ce041f14d88061", "score": "0.75653034", "text": "function clone(parent, circular, depth, prototype) {\n\t var filter;\n\t if (typeof circular === 'object') {\n\t depth = circular.depth;\n\t prototype = circular.prototype;\n\t filter = circular.filter;\n\t circular = circular.circular\n\t }\n\t // maintain two arrays for circular references, where corresponding parents\n\t // and children have the same index\n\t var allParents = [];\n\t var allChildren = [];\n\n\t var useBuffer = typeof Buffer != 'undefined';\n\n\t if (typeof circular == 'undefined')\n\t circular = true;\n\n\t if (typeof depth == 'undefined')\n\t depth = Infinity;\n\n\t // recurse this function so we don't reset allParents and allChildren\n\t function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\n\t if (depth == 0)\n\t return parent;\n\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\n\t if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\n\t return child;\n\t }\n\n\t return _clone(parent, depth);\n\t}", "title": "" }, { "docid": "26d7b55236ad520d77ce041f14d88061", "score": "0.75653034", "text": "function clone(parent, circular, depth, prototype) {\n\t var filter;\n\t if (typeof circular === 'object') {\n\t depth = circular.depth;\n\t prototype = circular.prototype;\n\t filter = circular.filter;\n\t circular = circular.circular\n\t }\n\t // maintain two arrays for circular references, where corresponding parents\n\t // and children have the same index\n\t var allParents = [];\n\t var allChildren = [];\n\n\t var useBuffer = typeof Buffer != 'undefined';\n\n\t if (typeof circular == 'undefined')\n\t circular = true;\n\n\t if (typeof depth == 'undefined')\n\t depth = Infinity;\n\n\t // recurse this function so we don't reset allParents and allChildren\n\t function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\n\t if (depth == 0)\n\t return parent;\n\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\n\t if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\n\t return child;\n\t }\n\n\t return _clone(parent, depth);\n\t}", "title": "" }, { "docid": "26d7b55236ad520d77ce041f14d88061", "score": "0.75653034", "text": "function clone(parent, circular, depth, prototype) {\n\t var filter;\n\t if (typeof circular === 'object') {\n\t depth = circular.depth;\n\t prototype = circular.prototype;\n\t filter = circular.filter;\n\t circular = circular.circular\n\t }\n\t // maintain two arrays for circular references, where corresponding parents\n\t // and children have the same index\n\t var allParents = [];\n\t var allChildren = [];\n\n\t var useBuffer = typeof Buffer != 'undefined';\n\n\t if (typeof circular == 'undefined')\n\t circular = true;\n\n\t if (typeof depth == 'undefined')\n\t depth = Infinity;\n\n\t // recurse this function so we don't reset allParents and allChildren\n\t function _clone(parent, depth) {\n\t // cloning null always returns null\n\t if (parent === null)\n\t return null;\n\n\t if (depth == 0)\n\t return parent;\n\n\t var child;\n\t var proto;\n\t if (typeof parent != 'object') {\n\t return parent;\n\t }\n\n\t if (clone.__isArray(parent)) {\n\t child = [];\n\t } else if (clone.__isRegExp(parent)) {\n\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t } else if (clone.__isDate(parent)) {\n\t child = new Date(parent.getTime());\n\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t child = new Buffer(parent.length);\n\t parent.copy(child);\n\t return child;\n\t } else {\n\t if (typeof prototype == 'undefined') {\n\t proto = Object.getPrototypeOf(parent);\n\t child = Object.create(proto);\n\t }\n\t else {\n\t child = Object.create(prototype);\n\t proto = prototype;\n\t }\n\t }\n\n\t if (circular) {\n\t var index = allParents.indexOf(parent);\n\n\t if (index != -1) {\n\t return allChildren[index];\n\t }\n\t allParents.push(parent);\n\t allChildren.push(child);\n\t }\n\n\t for (var i in parent) {\n\t var attrs;\n\t if (proto) {\n\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t }\n\n\t if (attrs && attrs.set == null) {\n\t continue;\n\t }\n\t child[i] = _clone(parent[i], depth - 1);\n\t }\n\n\t return child;\n\t }\n\n\t return _clone(parent, depth);\n\t}", "title": "" }, { "docid": "7198a9d583e7eac0c6d8e46fa0ccbe1b", "score": "0.75388396", "text": "function clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n } // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n\n\n var allParents = [];\n var allChildren = [];\n var useBuffer = typeof Buffer != 'undefined';\n if (typeof circular == 'undefined') circular = true;\n if (typeof depth == 'undefined') depth = Infinity; // recurse this function so we don't reset allParents and allChildren\n\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null) return null;\n if (depth === 0) return parent;\n var child;\n var proto;\n\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function (value) {\n resolve(_clone(value, depth - 1));\n }, function (err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n } else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function (value, key) {\n var keyChild = _clone(key, depth - 1);\n\n var valueChild = _clone(value, depth - 1);\n\n child.set(keyChild, valueChild);\n });\n }\n\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function (value) {\n var entryChild = _clone(value, depth - 1);\n\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n\n child[symbol] = _clone(parent[symbol], depth - 1);\n\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n }", "title": "" }, { "docid": "d85d39bd810e5d74bfed95274243a88f", "score": "0.74885637", "text": "function clone(parent, circular, depth, prototype) {\n\t\t\t var filter;\n\t\t\t if (typeof circular === 'object') {\n\t\t\t depth = circular.depth;\n\t\t\t prototype = circular.prototype;\n\t\t\t filter = circular.filter;\n\t\t\t circular = circular.circular\n\t\t\t }\n\t\t\t // maintain two arrays for circular references, where corresponding parents\n\t\t\t // and children have the same index\n\t\t\t var allParents = [];\n\t\t\t var allChildren = [];\n\n\t\t\t var useBuffer = typeof Buffer != 'undefined';\n\n\t\t\t if (typeof circular == 'undefined')\n\t\t\t circular = true;\n\n\t\t\t if (typeof depth == 'undefined')\n\t\t\t depth = Infinity;\n\n\t\t\t // recurse this function so we don't reset allParents and allChildren\n\t\t\t function _clone(parent, depth) {\n\t\t\t // cloning null always returns null\n\t\t\t if (parent === null)\n\t\t\t return null;\n\n\t\t\t if (depth == 0)\n\t\t\t return parent;\n\n\t\t\t var child;\n\t\t\t var proto;\n\t\t\t if (typeof parent != 'object') {\n\t\t\t return parent;\n\t\t\t }\n\n\t\t\t if (clone.__isArray(parent)) {\n\t\t\t child = [];\n\t\t\t } else if (clone.__isRegExp(parent)) {\n\t\t\t child = new RegExp(parent.source, __getRegExpFlags(parent));\n\t\t\t if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n\t\t\t } else if (clone.__isDate(parent)) {\n\t\t\t child = new Date(parent.getTime());\n\t\t\t } else if (useBuffer && Buffer.isBuffer(parent)) {\n\t\t\t child = new Buffer(parent.length);\n\t\t\t parent.copy(child);\n\t\t\t return child;\n\t\t\t } else {\n\t\t\t if (typeof prototype == 'undefined') {\n\t\t\t proto = Object.getPrototypeOf(parent);\n\t\t\t child = Object.create(proto);\n\t\t\t }\n\t\t\t else {\n\t\t\t child = Object.create(prototype);\n\t\t\t proto = prototype;\n\t\t\t }\n\t\t\t }\n\n\t\t\t if (circular) {\n\t\t\t var index = allParents.indexOf(parent);\n\n\t\t\t if (index != -1) {\n\t\t\t return allChildren[index];\n\t\t\t }\n\t\t\t allParents.push(parent);\n\t\t\t allChildren.push(child);\n\t\t\t }\n\n\t\t\t for (var i in parent) {\n\t\t\t var attrs;\n\t\t\t if (proto) {\n\t\t\t attrs = Object.getOwnPropertyDescriptor(proto, i);\n\t\t\t }\n\n\t\t\t if (attrs && attrs.set == null) {\n\t\t\t continue;\n\t\t\t }\n\t\t\t child[i] = _clone(parent[i], depth - 1);\n\t\t\t }\n\n\t\t\t return child;\n\t\t\t }\n\n\t\t\t return _clone(parent, depth);\n\t\t\t}", "title": "" }, { "docid": "b67650e439004bc0e380880f75fa3e10", "score": "0.7470592", "text": "function clone(parent, circular, depth, prototype) {\n var filter;\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n filter = circular.filter;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n if (Buffer.allocUnsafe) {\n // Node.js >= 4.5.0\n child = Buffer.allocUnsafe(parent.length);\n } else {\n // Older Node.js versions\n child = new Buffer(parent.length);\n }\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" }, { "docid": "c95744681ba9c0011c04aca46de6b291", "score": "0.7462419", "text": "function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth == 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }", "title": "" } ]
eb52a60c12409c2ad09fc04c70a6755a
Returns the component count for a certain pixel format. Returns 3(no alpha) or 4 (has alpha) in case there is no clear component type like with compressed formats.
[ { "docid": "836d54a82a0b0dd405ba7a4281a5c745", "score": "0.6376292", "text": "function getComponentCount(eFmt) {\n return getDescriptionFor(eFmt).componentCount;\n }", "title": "" } ]
[ { "docid": "6978b4c1f15edbcec8c10b9bfae72a3a", "score": "0.75922185", "text": "function glFormatToComponents(format) {\n\t switch (format) {\n\t case GL_ALPHA:\n\t return 1;\n\n\t case GL_RGB:\n\t return 3;\n\n\t case GL_RGBA:\n\t return 4;\n\t // TODO: Add support for additional WebGL2 formats\n\n\t default:\n\t (0, _assert.default)(false);\n\t return 0;\n\t }\n\t} // Return byte count for given readPixels WebGL type", "title": "" }, { "docid": "e63851e841e4056ef54062fc28adee07", "score": "0.73047364", "text": "function glFormatToComponents(format) {\n switch (format) {\n case 6406:\n case 33326:\n case 6403:\n return 1;\n\n case 33328:\n case 33319:\n return 2;\n\n case 6407:\n case 34837:\n return 3;\n\n case 6408:\n case 34836:\n return 4;\n // TODO: Add support for additional WebGL2 formats\n\n default:\n Object(_utils_assert__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(false);\n return 0;\n }\n} // Return byte count for given readPixels WebGL type", "title": "" }, { "docid": "f962df9e52fd0287f136e851320c6177", "score": "0.6627226", "text": "function glFormatToComponents(format) {\n switch (format) {\n case __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].ALPHA:\n return 1;\n case __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].RGB:\n return 3;\n case __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].RGBA:\n return 4;\n default:\n throw new Error('Unknown format');\n }\n }", "title": "" }, { "docid": "5df67e1da3d81317af89fb79c461227c", "score": "0.65412724", "text": "function glFormatToComponents(format) {\n switch (format) {\n case __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].ALPHA:\n return 1;\n case __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].RGB:\n return 3;\n case __WEBPACK_IMPORTED_MODULE_0__api__[\"a\" /* default */].RGBA:\n return 4;\n default:\n throw new Error('Unknown format');\n }\n}", "title": "" }, { "docid": "3bcefb905de32e825c2640f3c571b5b4", "score": "0.6539021", "text": "function glFormatToComponents(format) {\n\t switch (format) {\n\t case _webgl.GL.ALPHA:\n\t return 1;\n\t case _webgl.GL.RGB:\n\t return 3;\n\t case _webgl.GL.RGBA:\n\t return 4;\n\t default:\n\t throw new Error('Unknown format');\n\t }\n\t}", "title": "" }, { "docid": "87ddf6d4544f99624074d10790c6f623", "score": "0.579467", "text": "function getNumElemBits(eFormat) {\n return getDescriptionFor(eFormat).elemBytes * 8;\n }", "title": "" }, { "docid": "238fcd82e6b5379d5a168a5cb101b0d0", "score": "0.5589837", "text": "get particleCount () {\n let particleCount = 0;\n let device = this._device;\n device.setFrameBuffer(this.framebuffers.state0);\n let w = this.statesize[0], h = this.statesize[1],\n tw = this._tw, th = this._th,\n rgba = this.buffers.particleCache;\n device._gl.readPixels(0, 0, w, h, device._gl.RGBA, device._gl.UNSIGNED_BYTE, rgba);\n for (let y = 0; y < th; y++) {\n for (let x = 0; x < tw; x++) {\n let offset = y * 3 * tw * 12 + x * 12;\n let rest = decode(rgba, offset, LIFE_SCALE);\n if (rest > 0) {\n particleCount++;\n }\n }\n }\n return particleCount;\n }", "title": "" }, { "docid": "eb1e821702c889ac429b96b44e32a99e", "score": "0.5519901", "text": "function countFormat(files, format) {\n return files.filter( file => file.format == format).length;\n\n }", "title": "" }, { "docid": "a6c4a31b85d3f7dec44efc8dc0e25d57", "score": "0.5483759", "text": "getNumComponents() {\n return this.getComponents().length;\n }", "title": "" }, { "docid": "41ef1c2f99055eba18df2fdf5d9bcffe", "score": "0.5411752", "text": "function getBitDepths(eFormat) {\n /**@const*/ var des = getDescriptionFor(eFormat);\n var rgba = [];\n rgba[0] = des.rbits;\n rgba[1] = des.gbits;\n rgba[2] = des.bbits;\n rgba[3] = des.abits;\n return rgba;\n }", "title": "" }, { "docid": "cc555087360266a78edfe5e7c8eede64", "score": "0.5392653", "text": "function textureLevelSize(format, width, height) {\n switch (format) {\n case COMPRESSED_RGB_S3TC_DXT1_EXT:\n case COMPRESSED_RGB_ATC_WEBGL:\n case COMPRESSED_RGB_ETC1_WEBGL:\n return ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n\n case COMPRESSED_RGBA_S3TC_DXT3_EXT:\n case COMPRESSED_RGBA_S3TC_DXT5_EXT:\n case COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:\n case COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:\n return ((width + 3) >> 2) * ((height + 3) >> 2) * 16;\n\n case COMPRESSED_RGB_PVRTC_4BPPV1_IMG:\n case COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:\n return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);\n\n case COMPRESSED_RGB_PVRTC_2BPPV1_IMG:\n case COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:\n return Math.floor((Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8);\n\n \t//ASTC formats, https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\n case COMPRESSED_RGBA_ASTC_4x4_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16; \n case COMPRESSED_RGBA_ASTC_5x4_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:\n return Math.floor((width + 4) / 5) * Math.floor((height + 3) / 4) * 16;\n case COMPRESSED_RGBA_ASTC_5x5_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:\n return Math.floor((width + 4) / 5) * Math.floor((height + 4) / 5) * 16;\n case COMPRESSED_RGBA_ASTC_6x5_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:\n return Math.floor((width + 5) / 6) * Math.floor((height + 4) / 5) * 16;\n case COMPRESSED_RGBA_ASTC_6x6_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:\n return Math.floor((width + 5) / 6) * Math.floor((height + 5) / 6) * 16;\n case COMPRESSED_RGBA_ASTC_8x5_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:\n return Math.floor((width + 7) / 8) * Math.floor((height + 4) / 5) * 16;\n case COMPRESSED_RGBA_ASTC_8x6_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:\n return Math.floor((width + 7) / 8) * Math.floor((height + 5) / 6) * 16;\n case COMPRESSED_RGBA_ASTC_8x8_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:\n return Math.floor((width + 7) / 8) * Math.floor((height + 7) / 8) * 16;\n case COMPRESSED_RGBA_ASTC_10x5_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:\n return Math.floor((width + 9) / 10) * Math.floor((height + 4) / 5) * 16;\n case COMPRESSED_RGBA_ASTC_10x6_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:\n return Math.floor((width + 9) / 10) * Math.floor((height + 5) / 6) * 16;\n case COMPRESSED_RGBA_ASTC_10x8_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:\n return Math.floor((width + 9) / 10) * Math.floor((height + 7) / 8) * 16;\n case COMPRESSED_RGBA_ASTC_10x10_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:\n return Math.floor((width + 9) / 10) * Math.floor((height + 9) / 10) * 16;\n case COMPRESSED_RGBA_ASTC_12x10_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:\n return Math.floor((width + 11) / 12) * Math.floor((height + 9) / 10) * 16;\n case COMPRESSED_RGBA_ASTC_12x12_KHR:\n case COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:\n return Math.floor((width + 11) / 12) * Math.floor((height + 11) / 12) * 16; \n\n default:\n return 0;\n }\n}", "title": "" }, { "docid": "d036c2dc19968a02340d4b141c5519f9", "score": "0.52785295", "text": "function countColor(color) {\n\tvar count = 0;\n\tfor (var x = 0; x < game.w; ++x)\n\t\tfor (var y = 0; y < game.h; ++y)\n\t\t\tcount += (PS.color(x, y) === color ? 1 : 0);\n\treturn count;\n}", "title": "" }, { "docid": "763b201df8447b49e65eaacf4d284610", "score": "0.51430494", "text": "function greatestColorChannel(pixels) {\r\n var sums = [0, 0, 0];\r\n for (var i = 0; i < pixels.length; i += 1) {\r\n sums[0] += pixels[i][0];\r\n sums[1] += pixels[i][1];\r\n sums[2] += pixels[i][2];\r\n }\r\n if (sums[0] > sums[1]) {\r\n if (sums[0] > sums[2]) {\r\n return 0;\r\n } else {\r\n return 2;\r\n }\r\n } else {\r\n if (sums[1] > sums[2]) {\r\n return 1;\r\n } else {\r\n return 2;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "02e2dd9d90257e147a14ec7d02951c32", "score": "0.512819", "text": "function getNumElemBytes(eFormat) {\n return getDescriptionFor(eFormat).elemBytes;\n }", "title": "" }, { "docid": "130ccb8d4e6dc54e5e35af236e0ea9fb", "score": "0.511857", "text": "function checkTransparency(buffer) {\n var view = new DataView(buffer);\n\n // is a PNG?\n if (view.getUint32(0) === 0x89504e47 && view.getUint32(4) === 0x0d0a1a0a) {\n // We know format field exists in the IHDR chunk. The chunk exists at\n // offset 8 +8 bytes (size, name) +8 (depth) & +9 (type)\n var depth = view.getUint8(8 + 8 + 8);\n var type = view.getUint8(8 + 8 + 9);\n\n var confirm = {\n depth: depth,\n type: [\"G\", \"\", \"RGB\", \"Indexed\", \"GA\", \"\", \"RGBA\"][type],\n buffer: view.buffer,\n hasAlpha: type === 4 || type === 6 // grayscale + alpha or RGB + alpha\n };\n\n if (confirm.hasAlpha == false) {\n prepareLayerRemovalArray($card, input, $cardRendered, true);\n }\n } else {\n prepareLayerRemovalArray($card, input, $cardRendered, true);\n }\n }", "title": "" }, { "docid": "fdcea9fe303266e0a5cc95540b73ad17", "score": "0.5103961", "text": "static byteCount(spec) {\n let matches = spec.match(/^(\\d+(?:\\.\\d*)?)(\\w*)$/);\n if (matches === null) {\n return null;\n }\n let count = Number(matches[1]);\n if (isNaN(count)) {\n return null;\n }\n const UNITS = new Map([\n ['', 1],\n ['k', 1024],\n ['m', 1024*1024],\n ['g', 1024*1024*1024],\n ]);\n let unit = matches[2].toLowerCase();\n if (!UNITS.has(unit)) {\n return null;\n }\n let multiplier = UNITS.get(unit);\n return count * multiplier;\n }", "title": "" }, { "docid": "45c97100d63b3a500ad105c79fad1fad", "score": "0.50897795", "text": "static getTotalBits(segs, version) {\n let result = 0;\n for (const seg of segs) {\n const ccbits = seg.mode.numCharCountBits(version);\n if (seg.numChars >= 1 << ccbits) return Infinity; // The segment's length doesn't fit the field's bit width\n result += 4 + ccbits + seg.bitData.length;\n }\n return result;\n }", "title": "" }, { "docid": "24dbe18cd79821c401d3f67169a46952", "score": "0.5026897", "text": "function getBackgroundLayerCounter() {\n var desc = getDocumentPropertyDescriptor(TID.hasBackgroundLayer);\n var result = Number(desc.getBoolean(TID.hasBackgroundLayer));\n return result;\n}", "title": "" }, { "docid": "e0f705c94f5456a02c9995335617c53b", "score": "0.49866092", "text": "get channelCountMode() {\n return this._nativeDynamicsCompressorNode.channelCountMode;\n }", "title": "" }, { "docid": "3929799765c88fb667e92d549eab87c9", "score": "0.49674213", "text": "get channelCountMode() {\n return this._nativeDynamicsCompressorNode.channelCountMode;\n }", "title": "" }, { "docid": "675a39f342244dd01948fce07105157d", "score": "0.4966728", "text": "get channelCount() {\n return this._nativeDynamicsCompressorNode.channelCount;\n }", "title": "" }, { "docid": "60b413a0557adf0056966226a76855b7", "score": "0.49571824", "text": "get numberOfChannels() {\n if (this._buffer) {\n return this._buffer.numberOfChannels;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "cab530c4a66cd8f41a4b41a72ba0b8fe", "score": "0.49441728", "text": "numCharCountBits(ver) {\n return this.numBitsCharCount[Math.floor((ver + 7) / 17)];\n }", "title": "" }, { "docid": "50feba3d7456f380b08600a7181af23f", "score": "0.4939193", "text": "get channelCount() {\n return this._nativeDynamicsCompressorNode.channelCount;\n }", "title": "" }, { "docid": "ff1eb87682067af1f1cbc8bbc6ff46c4", "score": "0.4934248", "text": "function imageDataFormat() {\n return 'channelsLast';\n}", "title": "" }, { "docid": "e9b35a21ee21b9980899a58319cebf65", "score": "0.49306256", "text": "get channelCountMode() {\n return this._getChannelProperties().channelCountMode;\n }", "title": "" }, { "docid": "c93d84cf9eeded4f5e3cc10b6754ee5e", "score": "0.49245647", "text": "getHeaderColumnCount(data) {\n const colformats = data.column_formats;\n let colCount=0;\n colformats.forEach((entry) => {\n if (entry.hasOwnProperty(\"heading\")) {\n colCount++;\n }\n });\n return colCount;\n }", "title": "" }, { "docid": "2e3952b9cacf52e6e18735cc6ccd766e", "score": "0.49137175", "text": "get numberOfChannels() {\n if (this._buffer) {\n return this._buffer.numberOfChannels;\n }\n else {\n return 0;\n }\n }", "title": "" }, { "docid": "7c4eb56ce7080fcde47d69d7932e5cf7", "score": "0.4887225", "text": "get channelCountMode() {\n return this._getChannelProperties().channelCountMode;\n }", "title": "" }, { "docid": "478134a64e6e373d3cff3f04175492c7", "score": "0.4864857", "text": "function parse_byte_count(spec) {\n var UNITS = {\n k: 1024, m: 1024 * 1024, g: 1024 * 1024 * 1024,\n K: 1024, M: 1024 * 1024, G: 1024 * 1024 * 1024\n };\n var count, units;\n var matches;\n\n matches = spec.match(/^(\\d+(?:\\.\\d*)?)(\\w*)$/);\n if (matches === null)\n return null;\n\n count = Number(matches[1]);\n if (isNaN(count))\n return null;\n\n if (matches[2] === \"\") {\n units = 1;\n } else {\n units = UNITS[matches[2]];\n if (units === null)\n return null;\n }\n\n return count * Number(units);\n}", "title": "" }, { "docid": "f33bf00897dacce7e8ba1ecc711ff1c3", "score": "0.48462605", "text": "function getMemorySize(iWidth, iHeight, iDepth, eFormat) {\n if (isCompressed(eFormat)) {\n switch(eFormat) {\n case // DXT formats work by dividing the image into 4x4 blocks, then encoding each\n // 4x4 block with a certain number of bytes.\n 17 /* DXT1 */ :\n return Math.floor((iWidth + 3) / 4) * Math.floor((iHeight + 3) / 4) * 8 * iDepth;\n case 18 /* DXT2 */ :\n case 19 /* DXT3 */ :\n case 20 /* DXT4 */ :\n case 21 /* DXT5 */ :\n return Math.floor((iWidth + 3) / 4) * Math.floor((iHeight + 3) / 4) * 16 * iDepth;\n // Size calculations from the PVRTC OpenGL extension spec\n // http://www.khronos.org/registry/gles/extensions/IMG/IMG_texture_compression_pvrtc.txt\n // Basically, 32 bytes is the minimum texture size. Smaller textures are padded up to 32 bytes\n case 38 /* PVRTC_RGB2 */ :\n case 39 /* PVRTC_RGBA2 */ :\n {\n akra.logger.setSourceLocation(\"pixelUtil/pixelUtil.ts\", 798);\n akra.logger.assert(iDepth == 1);\n }\n ;\n return (akra.math.max(iWidth, 16) * akra.math.max(iHeight, 8) * 2 + 7) / 8;\n case 40 /* PVRTC_RGB4 */ :\n case 41 /* PVRTC_RGBA4 */ :\n {\n akra.logger.setSourceLocation(\"pixelUtil/pixelUtil.ts\", 802);\n akra.logger.assert(iDepth == 1);\n }\n ;\n return (akra.math.max(iWidth, 8) * akra.math.max(iHeight, 8) * 4 + 7) / 8;\n default:\n {\n akra.logger.setSourceLocation(\"pixelUtil/pixelUtil.ts\", 805);\n akra.logger.error(\"Invalid compressed pixel format\", \"PixelUtil::getMemorySize\");\n }\n ;\n }\n } else {\n return iWidth * iHeight * iDepth * getNumElemBytes(eFormat);\n }\n }", "title": "" }, { "docid": "da8c4630a6b4055c9fcbba8acc89fe6d", "score": "0.48342407", "text": "getComponentDimensions(component){\n\n\t\tvar dim = this.getManagedDimension();\n\t\tvar resizeable;\n\n\t\tif (component.props.$size){\n\t\t\treturn component.props.$size\n\t\t}\n\n\t\tvar size = component.props[dim];\n\t\tif (size === undefined && component.props.style){\n\t\t\tsize = component.props.style[dim];\n\t\t} \n\n\t\tvar resizeable = component.props.resizeable;\n\n\t\tif (size){\n\t\t\treturn {flexShrink:0, flexGrow:0, flexBasis: size, resizeable};\n\t\t}\n\n\t\treturn {flexShrink:1,flexGrow:1,flexBasis:1};\n\t}", "title": "" }, { "docid": "4b143090fb81ac3aca485a733f545168", "score": "0.48213682", "text": "function getModalityLUTOutputPixelRepresentation(dataSet) {\n\n // CT SOP Classes are always signed\n var sopClassUID = dataSet.string('x00080016');\n\n if (sopClassUID === '1.2.840.10008.5.1.4.1.1.2' || sopClassUID === '1.2.840.10008.5.1.4.1.1.2.1') {\n return 1;\n }\n\n // if rescale intercept and rescale slope are present, pass the minimum stored\n // pixel value through them to see if we get a signed output range\n var rescaleIntercept = dataSet.floatString('x00281052');\n var rescaleSlope = dataSet.floatString('x00281053');\n\n if (rescaleIntercept !== undefined && rescaleSlope !== undefined) {\n var minStoredPixelValue = getMinStoredPixelValue(dataSet); //\n var minModalityLutValue = minStoredPixelValue * rescaleSlope + rescaleIntercept;\n\n if (minModalityLutValue < 0) {\n return 1;\n }\n\n return 0;\n }\n\n // Output of non linear modality lut is always unsigned\n if (dataSet.elements.x00283000 && dataSet.elements.x00283000.length > 0) {\n return 0;\n }\n\n // If no modality lut transform, output is same as pixel representation\n return dataSet.uint16('x00280103');\n}", "title": "" }, { "docid": "57dd40b9f145e3cc5ac2de38f8d0cf5f", "score": "0.47991458", "text": "static async getTotalProcessedComponent()\n {\n try {\n let components = await this.getAllProcessedComponent();\n return components.length;\n \n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "d806e4934381b551adf65d6012586a96", "score": "0.4788748", "text": "getNumberOfChannelsInTheProgramme()\n {\n \n /// retrieves the AudioStreamDescriptionCollection\n const asdc = this._audioStreamDescriptionCollection;\n \n if( asdc.hasActiveStream === false )\n {\n throw new Error(\"no programme running !\");\n return 0;\n }\n \n /// retrieves the active AudioStreamDescription(s)\n const asd = asdc.actives;\n \n for( let i = 0; i < asd.length; i++ )\n {\n const stream_ = asd[i];\n \n if( stream_.type === \"Stereo\" && stream_.active === true )\n {\n /// this is the right one\n return stream_.numChannels();\n }\n \n }\n \n throw new Error(\"no programme running !\");\n return 0;\n }", "title": "" }, { "docid": "bb73a3a2b1cf6af46ae908f62b740662", "score": "0.47840095", "text": "getUniqueBoxCount(){\n let validateBoxCount;\n if (BOX_NUM%2 !== 0){\n validateBoxCount = BOX_NUM - 1;\n } else if (BOX_NUM%2 === 0) {\n validateBoxCount = BOX_NUM;\n }\n while(validateBoxCount/this.props.colors.length > 2){\n validateBoxCount = validateBoxCount - 2;\n }\n return validateBoxCount/2;\n }", "title": "" }, { "docid": "02bdeb6aa05a5ca771215d44bde63c07", "score": "0.47820923", "text": "function getNumberOfLayers() {\n var desc = getDocumentPropertyDescriptor(TID.numberOfLayers);\n var numberOfLayers = desc.getInteger(TID.numberOfLayers);\n return numberOfLayers;\n}", "title": "" }, { "docid": "4a01733aa80ab330be5a2946dababcec", "score": "0.47652632", "text": "function getFilledInPixels(stride) {\n if (!stride || stride < 1) {\n stride = 1;\n }\n\n var pixels = ctx.getImageData(0, 0, zWidth, zHeight),\n pdata = pixels.data,\n l = pdata.length,\n total = l / stride,\n count = 0;\n\n // Iterate over all pixels\n for (var i = (count = 0); i < l; i += stride) {\n if (parseInt(pdata[i]) === 0) {\n count++;\n }\n }\n\n return Math.round((count / total) * 100);\n }", "title": "" }, { "docid": "59e3e1910a10d15654b1eba7d30da0d4", "score": "0.4742059", "text": "function parseScaleComponent(model) {\n // TODO: should model.channels() inlcude X2/Y2?\n return model.channels().reduce(function (scaleComponentsIndex, channel) {\n var scaleComponents = parseScale(model, channel);\n if (scaleComponents) {\n scaleComponentsIndex[channel] = scaleComponents;\n }\n return scaleComponentsIndex;\n }, {});\n}", "title": "" }, { "docid": "59e3e1910a10d15654b1eba7d30da0d4", "score": "0.4742059", "text": "function parseScaleComponent(model) {\n // TODO: should model.channels() inlcude X2/Y2?\n return model.channels().reduce(function (scaleComponentsIndex, channel) {\n var scaleComponents = parseScale(model, channel);\n if (scaleComponents) {\n scaleComponentsIndex[channel] = scaleComponents;\n }\n return scaleComponentsIndex;\n }, {});\n}", "title": "" }, { "docid": "9cb1615aaf9c57da5640e84c036f9a28", "score": "0.4741193", "text": "function getVertexCount(_ref6) {\n var drawMode = _ref6.drawMode,\n vertexCount = _ref6.vertexCount;\n \n var primitiveCount = getPrimitiveCount({ drawMode: drawMode, vertexCount: vertexCount });\n switch (drawMode) {\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].POINTS:\n return primitiveCount;\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINES:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINE_STRIP:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINE_LOOP:\n return vertexCount * 2;\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLES:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLE_STRIP:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLE_FAN:\n return vertexCount * 3;\n default:\n __WEBPACK_IMPORTED_MODULE_3_assert___default()(false);return 0;\n }\n }", "title": "" }, { "docid": "d46f75ba1ebd6d92632af2715199cbf1", "score": "0.47282833", "text": "_getInternalCounts() {\n return {\n buffers: this.json.buffers.length,\n bufferViews: this.json.bufferViews.length,\n accessors: this.json.accessors.length,\n images: this.json.images.length\n };\n }", "title": "" }, { "docid": "c5b7dd1c6f91a24cc82373d9103c95a1", "score": "0.47281325", "text": "function countModules(composable) {\n if (typeof composable.composables === 'undefined') {\n return 1;\n }\n else {\n var count = 0;\n\n for (var key in composable.composables) {\n if (composable.composables.hasOwnProperty(key)) {\n count += countModules(composable.composables[key]);\n }\n }\n return count;\n }\n }", "title": "" }, { "docid": "fd45d8f5b9769762a73668e916e4b245", "score": "0.4717258", "text": "get channelCount() {\n return this._getChannelProperties().channelCount;\n }", "title": "" }, { "docid": "5b38a44e18878896ee957d5b29acba26", "score": "0.47150573", "text": "getCategoryWidth() {\r\n let iv = this.i.getCategoryWidth();\r\n return (iv);\r\n }", "title": "" }, { "docid": "9d0a34e8b02028f22d9dc92ff718b8d7", "score": "0.47072306", "text": "function correctCount(type){\r\n\r\n\tvar c=0;\r\n\r\n\tif (type===\"position\"){\r\n\t\tfor (var i=0;i<settings.trialAll;i++){\r\n\t\t\tif (clientResults.posMatch[i]===displayBlock.posMatch[i]){\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse if (type===\"color\"){\r\n\t\tfor (var i=0;i<settings.trialAll;i++){\r\n\t\t\tif (clientResults.colMatch[i]===displayBlock.colMatch[i]){\r\n\t\t\t\tc++;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn c;\r\n\r\n}", "title": "" }, { "docid": "0ac180eea02d26c3d44a6f7bab936adb", "score": "0.47066072", "text": "function getVertexCount(_ref6) {\n var drawMode = _ref6.drawMode,\n vertexCount = _ref6.vertexCount;\n\n var primitiveCount = getPrimitiveCount({ drawMode: drawMode, vertexCount: vertexCount });\n switch (drawMode) {\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].POINTS:\n return primitiveCount;\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINES:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINE_STRIP:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].LINE_LOOP:\n return vertexCount * 2;\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLES:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLE_STRIP:\n case __WEBPACK_IMPORTED_MODULE_0__gl_constants__[\"a\" /* default */].TRIANGLE_FAN:\n return vertexCount * 3;\n default:\n __WEBPACK_IMPORTED_MODULE_3_assert___default()(false);return 0;\n }\n}", "title": "" }, { "docid": "650040939b7532bc0e1dca1d0d199928", "score": "0.46972448", "text": "function countNumbers( layer ){\n let retVals = [0, 0, 0];\n for( let ii in layer ){\n retVals[ parseInt(layer[ii] ) ]++;\n }\n return retVals;\n}", "title": "" }, { "docid": "1931347f2825fc32f3b5ab208d3d7437", "score": "0.46943513", "text": "get channelCount() {\n return this._getChannelProperties().channelCount;\n }", "title": "" }, { "docid": "26e5ac4f49b32e5ef1146970e7435ef6", "score": "0.4658305", "text": "get countsPerBeat() {\n //if the time signature is in 8ths, 1 count per beat is enough\n // otherwise 3 or 4, depending on whether swing == true\n return song.meter.beatUnits == 8 || this.swing ? 3 : 4;\n }", "title": "" }, { "docid": "2c0bf67d9c1b2bf7e4f1c1dedce7ba65", "score": "0.46266305", "text": "function stashPixelWidthHeightData()\n{\n var image = globalCanvasContext.getImageData(0, 0, globalCanvasWidth, globalCanvasHeight);\n \n var imageData = image.data;\n \n var pixelList = '';\n \n for(var loop = 0; loop < imageData.length; loop += 4)\n {\n var red = imageData[loop];\n var green = imageData[loop + 1];\n var blue = imageData[loop + 2];\n var alpha = imageData[loop + 3];\n \n if(red != 0 || green != 0 || blue != 0)\n {\n pixelList += 1;\n }\n \n else\n {\n pixelList += 0;\n }\n }\n \n document.getElementById('pixel-data').value = pixelList + ',' + globalCanvasWidth + ',' + globalCanvasHeight;\n}", "title": "" }, { "docid": "fd08c261df3442fb729324826a48cdc6", "score": "0.46079612", "text": "gamePieceCounter() {\n let whiteReg = /[w]/g;\n let blackReg = /[b]/g;\n let whiteCount = this.board.grid.join('').match(whiteReg).length;\n let blackCount = this.board.grid.join('').match(blackReg).length;\n console.log(`White Pieces: ${whiteCount}`);\n console.log(`Black Pieces: ${blackCount}`);\n console.log('');\n }", "title": "" }, { "docid": "ed505d8cd2620ea0f1b3619a2800ad6f", "score": "0.46022722", "text": "function alpha(cssColorSpec) {\n var matches, result;\n\n if (!cssColorSpec) {\n // undefined so not visible; treat as transparent\n result = 0;\n } else if ((matches = cssColorSpec.match(ALPHA_REGEX)) === null) {\n // an opaque color (a color spec with no alpha channel)\n result = 1;\n } else if (matches[4] === undefined) {\n // cssColorSpec must have been 'transparent'\n result = 0;\n } else {\n result = Number(matches[4]);\n }\n\n return result;\n}", "title": "" }, { "docid": "43a98f0006cfd8757996219cb6a3df14", "score": "0.46005604", "text": "get cmyk(){\n let c, m, y, k;\n\n const r = parseFloat(this.r) / 255.0;\n const g = parseFloat(this.g) / 255.0;\n const b = parseFloat(this.b) / 255.0;\n\n k = 1 - Math.max(r, g, b);\n\n if (k === 1) c = m = y = 0;\n else {\n c = (1 - r - k) / (1 - k);\n m = (1 - g - k) / (1 - k);\n y = (1 - b - k) / (1 - k);\n }\n\n c = Math.round(100 * c);\n m = Math.round(100 * m);\n y = Math.round(100 * y);\n k = Math.round(100 * k);\n\n if (this.alpha) return { c, m, y, k, a: this.alpha };\n else return { c, m, y, k };\n }", "title": "" }, { "docid": "562bd4094d7bc6234293e7d390a50cdb", "score": "0.4597401", "text": "get alphaIsTransparency() {}", "title": "" }, { "docid": "9fbd6f6c727c148abfdf8fcc384accf7", "score": "0.45963356", "text": "function getFormatForBitDepths(eFmt, iIntegerBits, iFloatBits) {\n switch(iIntegerBits) {\n case 16:\n switch(eFmt) {\n case 10 /* R8G8B8 */ :\n case 26 /* X8R8G8B8 */ :\n return 6 /* R5G6B5 */ ;\n case 11 /* B8G8R8 */ :\n case 27 /* X8B8G8R8 */ :\n return 7 /* B5G6R5 */ ;\n case 12 /* A8R8G8B8 */ :\n case 28 /* R8G8B8A8 */ :\n case 13 /* A8B8G8R8 */ :\n case 14 /* B8G8R8A8 */ :\n return 8 /* A4R4G4B4 */ ;\n case 15 /* A2R10G10B10 */ :\n case 16 /* A2B10G10R10 */ :\n return 9 /* A1R5G5B5 */ ;\n default:\n // use original image format\n break;\n }\n break;\n case 32:\n switch(eFmt) {\n case 6 /* R5G6B5 */ :\n return 26 /* X8R8G8B8 */ ;\n case 7 /* B5G6R5 */ :\n return 27 /* X8B8G8R8 */ ;\n case 8 /* A4R4G4B4 */ :\n return 12 /* A8R8G8B8 */ ;\n case 9 /* A1R5G5B5 */ :\n return 15 /* A2R10G10B10 */ ;\n default:\n // use original image format\n break;\n }\n break;\n default:\n // use original image format\n break;\n }\n switch(iFloatBits) {\n case 16:\n switch(eFmt) {\n case 33 /* FLOAT32_R */ :\n return 32 /* FLOAT16_R */ ;\n case 24 /* FLOAT32_RGB */ :\n return 22 /* FLOAT16_RGB */ ;\n case 25 /* FLOAT32_RGBA */ :\n return 23 /* FLOAT16_RGBA */ ;\n default:\n // use original image format\n break;\n }\n break;\n case 32:\n switch(eFmt) {\n case 32 /* FLOAT16_R */ :\n return 33 /* FLOAT32_R */ ;\n case 22 /* FLOAT16_RGB */ :\n return 24 /* FLOAT32_RGB */ ;\n case 23 /* FLOAT16_RGBA */ :\n return 25 /* FLOAT32_RGBA */ ;\n default:\n // use original image format\n break;\n }\n break;\n default:\n // use original image format\n break;\n }\n return eFmt;\n }", "title": "" }, { "docid": "0d921da60ba8c95471e672636cf4c015", "score": "0.4591184", "text": "function getCellCount() {\n\tvar count = 0;\n\tfor(i = 0; i <= 8; i++) {\n\t\tif(!this.gridArr[i].isEmpty()){\n\t\t\tcount++;\n\t\t}\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "a1f9c7b436be06d095873aaaf186a2cb", "score": "0.4584362", "text": "get colorCount() { return this.data.colorCount; }", "title": "" }, { "docid": "53641463a85d4d1329758da643224635", "score": "0.4580255", "text": "function n(e) {\n var c = Object(_cim_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"toCIMSymbolJSON\"])(e);\n if (\"CIMTextSymbol\" === c.type) return c.height;\n var s = 0;\n\n if (c.symbolLayers) {\n var _iterator3 = _createForOfIteratorHelper(c.symbolLayers),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _e14 = _step3.value;\n Object(_cim_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"isCIMMarker\"])(_e14) && _e14.size > s ? s = _e14.size : Object(_cim_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"isCIMStroke\"])(_e14) && _e14.width > s ? s = _e14.width : Object(_cim_utils_js__WEBPACK_IMPORTED_MODULE_1__[\"isCIMFill\"])(_e14);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n\n return s;\n }", "title": "" }, { "docid": "d0324503c22472e7af22ff6dff0281d0", "score": "0.45782986", "text": "function height(format){\n if (!is_balanced(format)){\n // For correctness of the rest of the code\n ex.alert(\"Error: Imbalanced Format\");\n return;\n }\n var result = 0;\n for (var i = 0; i < format.length; i++) {\n if (format[i] == \"(\"){\n result ++;\n }\n }\n return result;\n }", "title": "" }, { "docid": "2c084bd8dd333cf2e096080782548707", "score": "0.45758113", "text": "getNumInstances(props) {\n props = props || this.props;\n\n // First check if the layer has set its own value\n if (this.state && this.state.numInstances !== undefined) {\n return this.state.numInstances;\n }\n\n // Check if app has provided an explicit value\n if (props.numInstances !== undefined) {\n return props.numInstances;\n }\n\n const {data} = props;\n\n // Check if ES6 collection \"count\" function is available\n if (data && typeof data.count === 'function') {\n return data.count();\n }\n\n // Check if ES6 collection \"size\" attribute is set\n if (data && data.size !== undefined) {\n return data.size;\n }\n\n // Check if array length attribute is set\n // Note: checking this last since some ES6 collections (Immutable.js)\n // emit profuse warnings when trying to access `length` attribute\n if (data && data.length !== undefined) {\n return data.length;\n }\n\n throw new Error('Could not deduce numInstances');\n }", "title": "" }, { "docid": "cb92d2a3999a33d555d4f1e24fa095de", "score": "0.4573442", "text": "getColorDepth() {\n return this._colorDepth;\n }", "title": "" }, { "docid": "54cbc7d6f8c1dbfdae502c0f9abebe2e", "score": "0.45700452", "text": "function YColorLedCluster_get_activeLedCount()\n {\n var res; // int;\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_ACTIVELEDCOUNT_INVALID;\n }\n }\n res = this._activeLedCount;\n return res;\n }", "title": "" }, { "docid": "095b73e6eb152bce57a33689e59a14e7", "score": "0.45697853", "text": "function luminanceComponent(part) {\n let part01 = part/255;\n if (part01 <= 0.03928){\n return part01/12.92;\n } else {\n return Math.pow((part01+0.055)/1.055, 2.4);\n } \n}", "title": "" }, { "docid": "21ae38cdc77c2ff019e0e7eee17e6125", "score": "0.45575327", "text": "function getNumElements( type ){\n\t\tvar num = 0;\n\t\tbpmnjs.get('canvas')._elementRegistry.forEach( \n\t\t\tfunction(e){\n\t\t\t\t//console.log(e.id)\n\t\t\t\tif(e.type == type )\n\t\t\t\t\tnum++;\n\t\t\t\t\t\t\t\t\t\n\t\t\t} \n\t\t)\n\t\treturn num;\t\t\n\t}", "title": "" }, { "docid": "442535e176f681b419cce16103bbb0eb", "score": "0.45527214", "text": "function get_field_count (kind) {\n\treturn (kind == \"diagnoses\") ? diagnoses_fields_count : procedures_fields_count;\n}", "title": "" }, { "docid": "3aba35f714b4668d7fdf14592b5bc021", "score": "0.4544767", "text": "function _getChannel(pixIndex){\n\tif (pixIndex % 4 === 0){\n\t\treturn \"r\"\n\t}\n\t\n\tif (pixIndex % 4 === 1){\n\t\treturn \"g\"\n\t}\n\t\n\tif (pixIndex % 4 === 2){\n\t\treturn \"b\"\n\t}\n\t\n\tif (pixIndex % 4 === 3){\n\t\treturn \"a\"\n\t}\n\t\n\t// Did not match any of the above, is not a valid index or other issue occured\n\treturn false;\n}", "title": "" }, { "docid": "039cb7aa7ae8f1965be8710aacf3b44a", "score": "0.45396793", "text": "function getColorComponents(rgb) {\n return rgb.substring(4, rgb.length-1).replace(/ /g, '').split(',');\n}", "title": "" }, { "docid": "57c9ce516780f779efc0617d353f5898", "score": "0.45310175", "text": "function findNumberOfDisplayedImgs(){\r\n //find number of images that are displayed and return in var called displayed\r\n displayed = 0;\r\n for (var i = 0; i< comViewWorkingArray.length; i++){\r\n if (!comViewWorkingArray[i].classList.contains(\"displayNone\")){\r\n displayed++//number of imags that are displayed\r\n }\r\n }\r\n }", "title": "" }, { "docid": "06e6c6edf2b679f1d99523595de8f65b", "score": "0.4506251", "text": "static sizeof() {\r\n return Float32Array.BYTES_PER_ELEMENT * 8;\r\n }", "title": "" }, { "docid": "db9efcd6cb6a3350098adfe376304900", "score": "0.44981882", "text": "function MM_countDisabledCheckboxes(form) {\r\n\t\tvar disabledCount = 0;\r\n\t\tif (form.checkboxes) {\r\n\t\t\tvar checkboxCount = form.checkboxes.length;\r\n\t\t\tfor (i = 0; i < checkboxCount; i++) {\r\n\t\t\t\tvar checkbox = form.checkboxes[i];\r\n\t\t\t\tif (-1 != document[checkbox.mImageName].src.indexOf('dim_16.gif')) {\r\n\t\t\t\t\tdisabledCount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}\r\n\t\t\r\n\r\n\t\treturn disabledCount;\r\n\t}", "title": "" }, { "docid": "8dad7a04f5c07de2ac00ed92a8dec78f", "score": "0.4493059", "text": "getOctetCount() {\n return this.buffer.readUInt32BE(24);\n }", "title": "" }, { "docid": "cc84e12d0febd572afab4ac83df6d6c2", "score": "0.44903964", "text": "function pixelformat_changed() {\n\tif(BinVis.panelBytemap)\n\t{\n\t\tvar k = parseInt($(\"#select-pixelformat\")[0].selectedIndex,10);\n\t\tBinVis.panelBytemap.setPixelFormat(k);\n\n\t}\n}", "title": "" }, { "docid": "692e2e1428e35229ca399dee467f34c2", "score": "0.44682586", "text": "function ColourToID(RGBA){ return (256*256*RGBA[2] + 256*RGBA[1] + RGBA[0])-1; }", "title": "" }, { "docid": "692e2e1428e35229ca399dee467f34c2", "score": "0.44682586", "text": "function ColourToID(RGBA){ return (256*256*RGBA[2] + 256*RGBA[1] + RGBA[0])-1; }", "title": "" }, { "docid": "3a1a7aca36a6c37157359154f315793f", "score": "0.44590247", "text": "function getPicCount(imageDimension, containerDimension) {\n return Math.max( 1, Math.ceil( imageDimension / containerDimension ) );\n }", "title": "" }, { "docid": "f844c5054de0222192e8c663c087fef8", "score": "0.44589597", "text": "getModuleDepth(){return this.faces.get(FaceOrientation.BASE).depth();}", "title": "" }, { "docid": "36f5f4a946fcba41096fd4bd9cea0321", "score": "0.44536927", "text": "function getFilledInPixels(stride) {\n if (!stride || stride < 1) { stride = 1; }\n\n let pixels = ctx.getImageData(0, 0, width, height),\n pdata = pixels.data,\n l = pdata.length,\n total = (l / stride),\n count = 0;\n\n // Iterate over all pixels\n for(let i = count = 0; i < l; i += stride) {\n if (parseInt(pdata[i]) === 0) {\n count++;\n }\n }\n\n return Math.round((count / total) * 100);\n }", "title": "" }, { "docid": "ba9f308dcc2a0c465a76f83c470b7e36", "score": "0.44402117", "text": "get cellCount() {}", "title": "" }, { "docid": "3bca17dfdd41d2028b0ed67906570218", "score": "0.4438078", "text": "getVertexCount() {}", "title": "" }, { "docid": "6cc939ffde532ac3fa42e0265052dcb5", "score": "0.44359937", "text": "function findDominantColor(imageData) {\n var arr = imageData.data,\n cr, cg, cb, ca,\n numColors = 0,\n colors = {},\n colorProp;\n for (var i = 0; i < arr.length; i+=4) {\n // Get the R, G, B and A values\n cr = arr[i]; cg = arr[i+1]; cb = arr[i+2]; ca = arr[i+3];\n\n if (acceptableColor(cr,cg,cb,ca)) {\n propStr = cr + \",\" + cg + \",\" + cb;\n\n // Check if the same color already is in the colors object\n if(colors[propStr]) {\n colors[propStr]++;\n // Check if a close enough color is in the object\n } else if((colorProp = findCloseColorProp(colors, propStr))) {\n colors[colorProp]++;\n // Else create a new property\n } else {\n colors[propStr] = 1;\n }\n }\n }\n var max = getMax(colors);\n // Allow gray colors as fallback\n if(!max) max = getMax(colors, true);\n\n return max ? \"rgb(\" + max + \")\" : null;\n }", "title": "" }, { "docid": "3075a6dd750a60d2079e97f0b9b05d59", "score": "0.44315493", "text": "function getCellCount(grid, x, y) {\r\n if (getCell(grid, x, y)) {\r\n return 1;\r\n } else {\r\n return 0;\r\n } \r\n}", "title": "" }, { "docid": "041aae67770f0f6bdf57d0aa62038d69", "score": "0.44263434", "text": "function getTotal() {\n\t\treturn layers.length;\n\t}", "title": "" }, { "docid": "69539359e73c93081909a621d03936c0", "score": "0.44220072", "text": "function getHeightData() {\n\n var canvas = document.createElement('canvas');\n canvas.width = img.width;\n canvas.height = img.height;\n imgsize = img.width;\n var context = canvas.getContext('2d');\n\n var size = img.width * img.height;\n data = new Float32Array(size);\n\n context.drawImage(img, 0, 0);\n\n for (var i = 0; i < size; i++) {\n data[i] = 0\n }\n\n var imgd = context.getImageData(0, 0, img.width, img.height);\n var pix = imgd.data;\n\n var j = 0;\n for (var i = 0; i < pix.length; i += 4) {\n var all = pix[i] + pix[i + 1] + pix[i + 2]; // all is in range 0 - 255*3\n data[j] = all / 3;\n j++;\n }\n\n }", "title": "" }, { "docid": "e86964c27860fed26b93a7722f874654", "score": "0.44209102", "text": "function getFilledInPixels(stride) {\n if (!stride || stride < 1) {\n stride = 1;\n }\n\n var pixels = ctx.getImageData(0, 0, canvasWidth, canvasHeight),\n pdata = pixels.data,\n l = pdata.length,\n total = l / stride,\n count = 0;\n\n // Iterate over all pixels\n for (var i = (count = 0); i < l; i += stride) {\n if (parseInt(pdata[i]) === 0) {\n count++;\n }\n }\n\n return Math.round((count / total) * 100);\n }", "title": "" }, { "docid": "997c376add60681ca89a3f2d4e2c933a", "score": "0.4418185", "text": "function xGetCS(ele,sP){return parseInt(document.defaultView.getComputedStyle(ele,\"\").getPropertyValue(sP));}", "title": "" }, { "docid": "5b9c7726f931d2191e9ef74788b8dbaf", "score": "0.44079512", "text": "function countMaxLine(){\r\n\r\n\t//gameSessionInfo.maxLine;\r\n\tvar maxZ = 0;\r\n\r\n\tfor (var z=0;z<settings.zDepth;z++){\r\n\t\tfor (var i=0;i<settings.xDepth;i++){\r\n\t\t\tfor (var j=0;j<settings.yDepth;j++){\t\t\t\r\n\t\t\t\tif ( gameSessionInfo.gameField[i][j][z]===1 && z>maxZ ){\r\n\t\t\t\t\tmaxZ=z;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn maxZ;\r\n\r\n}", "title": "" }, { "docid": "a980197a9a6ea92986c3f798a4e764a5", "score": "0.440774", "text": "static getCount() {\r\n return (Point.count == undefined) ? 0 : Point.count;\r\n }", "title": "" }, { "docid": "d05cbfc92d12ed1f3c8a97ab1797c898", "score": "0.43980044", "text": "getSupportedFormat(gl, internalFormat, format, type) {\n if (!this.supportRenderTextureFormat(gl, internalFormat, format, type)) {\n switch (internalFormat) {\n case gl.R16F:\n return this.getSupportedFormat(gl, gl.RG16F, gl.RG, type);\n case gl.RG16F:\n return this.getSupportedFormat(gl, gl.RGBA16F, gl.RGBA, type);\n default:\n return null;\n }\n }\n\n return {\n internalFormat,\n format\n };\n }", "title": "" }, { "docid": "7433d62f443c7fc078cd5d23862ce85e", "score": "0.43950158", "text": "function getFilledInPixels(stride) {\n if (!stride || stride < 1) { stride = 1; }\n \n var pixels = ctx.getImageData(0, 0, canvasWidth, canvasHeight),\n pdata = pixels.data,\n l = pdata.length,\n total = (l / stride),\n count = 0;\n \n // Iterate over all pixels\n for(var i = count = 0; i < l; i += stride) {\n if (parseInt(pdata[i]) === 0) {\n count++;\n }\n }\n \n return Math.round((count / total) * 100);\n }", "title": "" }, { "docid": "c5c4b538dc8aa356a4db6bd328a28171", "score": "0.4391683", "text": "get maxDigits() {\n return this.format && this.format.includes(\".\")\n ? this.format.split(\".\")[1].length\n : 0;\n }", "title": "" }, { "docid": "d46c3cdf68465714d1d568844ebeee8d", "score": "0.43906394", "text": "function getFilledInPixels(stride) {\n if (!stride || stride < 1) { stride = 1; }\n\n var pixels = ctx.getImageData(0, 0, canvasWidth, canvasHeight),\n pdata = pixels.data,\n l = pdata.length,\n total = (l / stride),\n count = 0;\n\n // Iterate over all pixels\n for(var i = count = 0; i < l; i += stride) {\n if (parseInt(pdata[i]) === 0) {\n count++;\n }\n }\n\n return Math.round((count / total) * 100);\n }", "title": "" }, { "docid": "946cc4c4ade434ca2cec1d7c3e1fd9a7", "score": "0.439001", "text": "get mode(): number {\n return this.scale * (this.shape - 1);\n }", "title": "" }, { "docid": "b7084c757e3e34e6c2189c2fda914d8c", "score": "0.4388853", "text": "static async getTotalComponentByModelAndPsType()\n {\n try {\n\n let mo = await MOLogic.getLocalMO();\n\n if(mo != null)\n { \n let total = await ModelComponent.count({\n where:\n {\n [Op.and]:{\n model: {\n [Op.like] : '%' + mo.model + '%'\n },\n pstype: {\n [Op.like] : '%' + mo.ps_type + '%'\n },\n }\n }\n });\n\n return total\n }\n else \n return 0;\n\n } catch (e) {\n \n }\n }", "title": "" }, { "docid": "621f6bd5178ae71a2950f0e9ee3d9c82", "score": "0.43881327", "text": "tileColorIdx(value) {\n if (!value) {\n // TODO: consider if this should ever be the case\n return 0;\n }\n\n const twoToPowerOf = Math.log(value)/Math.log(2);\n\n if (twoToPowerOf === NUMBER_OF_TILE_COLORS) {\n return twoToPowerOf;\n } else {\n return twoToPowerOf % NUMBER_OF_TILE_COLORS;\n }\n }", "title": "" }, { "docid": "4018019472e7344d6a13f83d20744c4d", "score": "0.43854007", "text": "function i64_bitcount(a)\n{\n\n return ( bitcnt_[ (a.l & g_F)>>>0 ] + bitcnt_[ ((a.l>>>16) & g_F)>>>0 ] +\n bitcnt_[ (a.h & g_F)>>>0 ] + bitcnt_[ ((a.h>>>16) & g_F)>>>0 ] );\n}", "title": "" }, { "docid": "3b13e55b0bfbb20816810600dec48839", "score": "0.4378914", "text": "function getCounts(sc) {\n var structure = sc.structure;\n var biomolDict = structure.biomolDict;\n var atomCount, instanceCount;\n if (biomolDict.BU1) {\n var assembly = biomolDict.BU1;\n atomCount = assembly.getAtomCount(structure);\n instanceCount = assembly.getInstanceCount();\n } else {\n atomCount = structure.getModelProxy(0).atomCount;\n instanceCount = 1;\n }\n return { atomCount: atomCount, instanceCount: instanceCount }\n}", "title": "" }, { "docid": "085b520dd75b93a4da03627a6d3f2107", "score": "0.43749037", "text": "function countImages() {\n\tvar images = document.getElementsByClassName('picture');\n\tnumOfImgs = 0;\n\tfor (var i = 0; i < images.length; i++) {\n\t\tnumOfImgs++;\n\t}\n\treturn numOfImgs;\n}", "title": "" }, { "docid": "bbfa4bdefd059c241599ecc85e6cdd4d", "score": "0.43705857", "text": "get contentSize() {\n const [width, height] = this.attrSize;\n const boxSize = this.texturesSize || [0, 0];\n\n let [w, h] = [width, height];\n\n if (width === '') {\n w = boxSize[0] | 0;\n if (height !== '' && boxSize[1]) {\n w *= height / boxSize[1];\n }\n }\n if (height === '') {\n h = boxSize[1] | 0;\n if (width !== '' && boxSize[0]) {\n h *= width / boxSize[0];\n }\n }\n\n return [w, h];\n }", "title": "" }, { "docid": "a120ac4146207d67cb002efe9297371e", "score": "0.4367089", "text": "function YColorLedCluster_get_maxLedCount()\n {\n var res; // int;\n if (this._cacheExpiration == 0) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_MAXLEDCOUNT_INVALID;\n }\n }\n res = this._maxLedCount;\n return res;\n }", "title": "" } ]
4b74093532ea74e076fcd2924a9217ea
OpenSeadragon viewport update callback
[ { "docid": "73dd95980afa979356216027ead65eab", "score": "0.5949342", "text": "onUpdateViewport() {\n // Do nothing if the overlay is not currently rendered\n if (!this.shouldRender) {\n return;\n }\n const { containerHeight, containerWidth } = this.state;\n\n // Update container and SVG width/height\n const { viewer, canvasWorld } = this.props;\n const newState = {};\n if (containerWidth !== viewer.container.clientWidth) {\n newState.containerWidth = viewer.container.clientWidth;\n }\n if (containerHeight !== viewer.container.clientHeight) {\n newState.containerHeight = viewer.container.clientHeight;\n }\n\n // Update SVG page transforms and x-offsets\n newState.pageTransforms = [];\n newState.xOffsets = [0];\n const vpBounds = viewer.viewport.getBounds(true);\n const viewportZoom = viewer.viewport.getZoom(true);\n for (let itemNo = 0; itemNo < viewer.world.getItemCount(); itemNo += 1) {\n const img = viewer.world.getItemAt(itemNo);\n const canvasDims = canvasWorld.canvasDimensions[itemNo];\n // Mirador canvas world scale factor\n const canvasWorldScale = (img.source.dimensions.x / canvasDims.width);\n // Absolute difference between unscaled width and width in canvas world, only relevant\n // for canvases other than the first one\n const canvasWorldOffset = itemNo > 0 ? img.source.dimensions.x - canvasDims.width : 0;\n newState.pageTransforms.push({\n scaleFactor: img.viewportToImageZoom(viewportZoom),\n translateX: -1 * vpBounds.x * canvasWorldScale + canvasWorldOffset,\n translateY: -1 * vpBounds.y * canvasWorldScale,\n });\n newState.xOffsets.push(canvasDims.width);\n }\n this.setState(newState);\n }", "title": "" } ]
[ { "docid": "eb66df2a02e6026616471528b4b47f67", "score": "0.70180875", "text": "registerOsdCallback() {\n const { viewer } = this.props;\n viewer.addHandler('update-viewport', this.onUpdateViewport.bind(this));\n }", "title": "" }, { "docid": "2ea9f05704d7a475b5fd9f757baa2705", "score": "0.67520726", "text": "onUpdateViewport(event) {\n this.updateCanvas();\n }", "title": "" }, { "docid": "05d941eb235899354c20c35e5fa045f5", "score": "0.6312714", "text": "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "title": "" }, { "docid": "05d941eb235899354c20c35e5fa045f5", "score": "0.6312714", "text": "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "title": "" }, { "docid": "05d941eb235899354c20c35e5fa045f5", "score": "0.6312714", "text": "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "title": "" }, { "docid": "12bfd7db8a79384a71b18c6bee5a5067", "score": "0.62173223", "text": "update() {\n this.viewport = window.innerWidth;\n }", "title": "" }, { "docid": "c41423f37825922d5d91688b4d313fc1", "score": "0.61382824", "text": "function updateViewport() {\n\t\tvar topDistance = window.pageYOffset;\n\t\tvar ratio = o.minimap.offsetWidth / document.body.offsetWidth;\n\t\tvar viewport = o.minimap.querySelector('.xivmap-viewport');\n\t\tviewport.style['margin-top'] = topDistance * ratio + 'px';\n\t}", "title": "" }, { "docid": "0050add6d588f215615a0e6fe89f7b31", "score": "0.60156757", "text": "get viewportChanged() {\n return (this.flags & 4 /* Viewport */) > 0;\n }", "title": "" }, { "docid": "710c1a5becc491d5ab3f7eb4030de75c", "score": "0.6008794", "text": "function onResize() {\n fm.readWindowProps()\n\n fm.updateHeight(total_scroll)\n\n // make sure the containers are the proper heights\n graphic.style(\"height\", viewport_height + \"px\")\n interactive_content.style(\"height\", total_scroll + \"px\")\n \n updateScales();\n render(true);\n }", "title": "" }, { "docid": "74533502f240a47d2834728895bfa9a8", "score": "0.6004392", "text": "function OpenSeadragon(t){return new OpenSeadragon.Viewer(t)}", "title": "" }, { "docid": "74533502f240a47d2834728895bfa9a8", "score": "0.6004392", "text": "function OpenSeadragon(t){return new OpenSeadragon.Viewer(t)}", "title": "" }, { "docid": "c9572c673e3ac6cac6c2aa56ace92522", "score": "0.59872216", "text": "updateView_() {\n var view = new View({\n projection: osMap.PROJECTION,\n minZoom: osMap.MIN_ZOOM,\n maxZoom: osMap.MAX_ZOOM\n });\n\n if (this.getMap()) {\n var mainView = this.getMap().getView();\n\n if (mainView) {\n view.setCenter(mainView.getCenter());\n view.setResolution(mainView.getResolution());\n }\n }\n\n var ovmap = this.getOverviewMap();\n if (ovmap) {\n ovmap.setView(view);\n }\n }", "title": "" }, { "docid": "eab2cc2717d755f06cc81f0c46befec7", "score": "0.5976377", "text": "static updateView(data) {\n const viewport = data.viewport;\n const margin = viewport.width / 6;\n const center = {\n x: data.entities.mario.xPos + (data.entities.mario.width * 0.5),\n y: data.entities.mario.yPos + (data.entities.mario.height * 0.5),\n };\n\n if (center.x < viewport.vX + (margin * 2)) {\n viewport.vX = Math.max(center.x - margin, 0);\n } else if (center.x > (viewport.vX + viewport.width) - (margin * 2)) {\n viewport.vX = Math.min((center.x + margin) - viewport.width, 3400 - viewport.width);\n }\n }", "title": "" }, { "docid": "e6d63789b7166baba895d5b782395771", "score": "0.5966622", "text": "function venstre() {\n viewnr = viewnr - 1;\n nytt_view(viewnr);\n}", "title": "" }, { "docid": "4cbf8fa57838484e3f918f9a967856c0", "score": "0.59271467", "text": "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n }", "title": "" }, { "docid": "4cbf8fa57838484e3f918f9a967856c0", "score": "0.59271467", "text": "_updateViewportSize() {\n const window = this._getWindow();\n this._viewportSize = this._platform.isBrowser ?\n { width: window.innerWidth, height: window.innerHeight } :\n { width: 0, height: 0 };\n }", "title": "" }, { "docid": "bca07f06d706f2843eb2546b03b2d8cb", "score": "0.5912547", "text": "function onViewSizeChanged() {\n\n \tif ( FrameTrail.getState('viewMode') != 'video' ) {\n \treturn;\n }\n\n //TODO: CHECK WHY THIS THROWS ERROR RIGHT AFTER DELETING A CONTENT VIEW\n\t\tvar currentTime = FrameTrail.module('HypervideoController').currentTime;\n\t\tupdateTimedStateOfContentViews(currentTime);\n\n\t\tif ( FrameTrail.module('ViewVideo').shownDetails == 'top' ) {\n\t\t\tfor (var i in contentViewsTop) {\n\t\t\t\tcontentViewsTop[i].updateCollectionSlider(true);\n\t\t\t}\n\t\t} else if ( FrameTrail.module('ViewVideo').shownDetails == 'bottom' ) {\n\t\t\tfor (var i in contentViewsBottom) {\n\t\t\t\tcontentViewsBottom[i].updateCollectionSlider(true);\n\t\t\t}\n\t\t}\n\n }", "title": "" }, { "docid": "693211c17f6a13513f423c806936c613", "score": "0.59085965", "text": "function viewChange() {\n\t\textent = ol.proj.transformExtent(view.calculateExtent(map.getSize()),\n\t\t\t\t'EPSG:3857', 'EPSG:4326');\n\t\tif(!isSearchOnly())\n\t\t\tloadStations();\n\t}", "title": "" }, { "docid": "df3fdeb9da677c5aec71d9d27e3ffa66", "score": "0.5905235", "text": "function OpenSeadragon(e) {\n return new OpenSeadragon.Viewer(e);\n}", "title": "" }, { "docid": "808b124c43840b22ddc864ee16f73e48", "score": "0.5892648", "text": "onViewportChange(event) {\n const { updateViewport, windowId } = this.props;\n\n const { viewport } = event.eventSource;\n\n updateViewport(windowId, {\n x: Math.round(viewport.centerSpringX.target.value),\n y: Math.round(viewport.centerSpringY.target.value),\n zoom: viewport.zoomSpring.target.value,\n });\n }", "title": "" }, { "docid": "6c52bf6747aa1964bb1e127217a36b8f", "score": "0.58743304", "text": "get viewport() { return this.viewState.viewport; }", "title": "" }, { "docid": "6c52bf6747aa1964bb1e127217a36b8f", "score": "0.58743304", "text": "get viewport() { return this.viewState.viewport; }", "title": "" }, { "docid": "0af53018c28e546751bda9eb3d020c6b", "score": "0.5839034", "text": "function triggerDOMRefresh() {\n\t if (view._isShown && view._isRendered && Marionette.isNodeAttached(view.el)) {\n\t Marionette.triggerMethodOn(view, 'dom:refresh', view);\n\t }\n\t }", "title": "" }, { "docid": "388ff05648793d781b18f1b0f1ae5b28", "score": "0.58377093", "text": "__onZoomUpdated() {\n this.camera.fov = this.state.vFov;\n this.camera.updateProjectionMatrix();\n this.viewer.needsUpdate();\n }", "title": "" }, { "docid": "b54fe6bb90e6844e76d20c6fc8fd6f4f", "score": "0.5837268", "text": "function ViewportScrollPosition() { }", "title": "" }, { "docid": "91846f2a9d93a920a38bae5272fdfc3d", "score": "0.58259237", "text": "componentDidUpdate(prevProps) {\n const {\n viewer,\n highlightedAnnotations, selectedAnnotations,\n searchAnnotations, selectedContentSearchAnnotations, palette,\n } = this.props;\n const highlightsUpdated = !OpenSeadragonViewer.annotationsMatch(\n highlightedAnnotations, prevProps.highlightedAnnotations,\n );\n const selectionsUpdated = !OpenSeadragonViewer.annotationsMatch(\n selectedAnnotations, prevProps.selectedAnnotations,\n );\n const searchAnnotationsUpdated = !OpenSeadragonViewer.annotationsMatch(\n searchAnnotations, prevProps.searchAnnotations,\n );\n\n const selectedContentSearchAnnotationsUpdated = !OpenSeadragonViewer.annotationsMatch(\n selectedContentSearchAnnotations, prevProps.selectedContentSearchAnnotations,\n );\n\n if (searchAnnotationsUpdated || selectedContentSearchAnnotationsUpdated) {\n this.updateCanvas = () => {\n this.osdCanvasOverlay.clear();\n this.osdCanvasOverlay.resize();\n this.osdCanvasOverlay.canvasUpdate(() => {\n this.annotationsToContext(searchAnnotations, palette.highlights.secondary);\n this.annotationsToContext(\n selectedContentSearchAnnotations,\n palette.highlights.primary,\n );\n });\n };\n this.viewer.forceRedraw();\n }\n\n if (highlightsUpdated || selectionsUpdated) {\n this.updateCanvas = () => {\n this.osdCanvasOverlay.clear();\n this.osdCanvasOverlay.resize();\n this.osdCanvasOverlay.canvasUpdate(() => {\n this.annotationsToContext(highlightedAnnotations, palette.highlights.secondary);\n this.annotationsToContext(selectedAnnotations, palette.highlights.primary);\n });\n };\n this.viewer.forceRedraw();\n }\n\n if (!this.tileSourcesMatch(prevProps.tileSources)) {\n this.viewer.close();\n this.addAllTileSources();\n } else if (viewer && !this.osdUpdating) {\n const { viewport } = this.viewer;\n\n if (viewer.x !== viewport.centerSpringX.target.value\n || viewer.y !== viewport.centerSpringY.target.value) {\n this.viewer.viewport.panTo(viewer, false);\n }\n\n if (viewer.zoom !== viewport.zoomSpring.target.value) {\n this.viewer.viewport.zoomTo(viewer.zoom, viewer, false);\n }\n }\n }", "title": "" }, { "docid": "5f5ae7747ce653ee5b6e978b5e89a757", "score": "0.5821794", "text": "updateViews() {\r\n if (this.graph.views[this.defaultView][0] == \"perspective\") {\r\n var near = this.graph.views[this.defaultView][1];\r\n var far = this.graph.views[this.defaultView][2];\r\n var fov = this.graph.views[this.defaultView][3];\r\n var from = this.graph.views[this.defaultView][4];\r\n var to = this.graph.views[this.defaultView][5];\r\n this.camera = new CGFcamera(fov, near, far, from, to);\r\n }\r\n\r\n else {\r\n var near = this.graph.views[this.defaultView][1];\r\n var far = this.graph.views[this.defaultView][2];\r\n var left = this.graph.views[this.defaultView][3];\r\n var right = this.graph.views[this.defaultView][4];\r\n var top = this.graph.views[this.defaultView][5];\r\n var bottom = this.graph.views[this.defaultView][6];\r\n var from = this.graph.views[this.defaultView][7];\r\n var to = this.graph.views[this.defaultView][8];\r\n this.camera = new CGFcameraOrtho(left, right, bottom, top, near, far, from, to, [0, 1, 0]);\r\n }\r\n\r\n this.interface.setActiveCamera(this.camera);\r\n }", "title": "" }, { "docid": "933e35f5fdc264ca77c159e8f53282cc", "score": "0.580449", "text": "function resize_viewport() {\r\n\t$.event.remove( this, \"resize\", DP_position);\r\n\r\n\tDP_position();\r\n\r\n\t// do what you need to do\r\n\t$.event.add( this, \"resize\", resize_viewport);\r\n}", "title": "" }, { "docid": "4ae41185d5eb2f940f3251ba29ccc1c5", "score": "0.5803728", "text": "updateView () {\n this.setupComponents();\n }", "title": "" }, { "docid": "a936a477f435bc7746f8550bf8cb8e5c", "score": "0.5774398", "text": "updateView() {\r\n if (ViewportService.isDesktop != this.state.isDesktopView){\r\n this.setState({ isDesktopView: ViewportService.isDesktop});\r\n }\r\n }", "title": "" }, { "docid": "5a11d8136244de184fe4cc37c71e9a29", "score": "0.5770767", "text": "updateScene(frame, coordinateSystem, pose){}", "title": "" }, { "docid": "9448f56b391be5e999eb456bc30562f9", "score": "0.57665575", "text": "function onWindowResize() {\n viewportWidth = window.innerWidth;\n viewportHeight = window.innerHeight;\n }", "title": "" }, { "docid": "c8c09f41937fe0a89e9e45f3464ec538", "score": "0.5758894", "text": "function setupView() {\n // set home button view point to initial extent\n var homeButton = new Home({\n view: view,\n viewpoint: new Viewpoint({\n targetGeometry: initialExtent\n })\n });\n \n var track = new Track({\n viewModel:{\n view:view,\n scale: 100000\n }\n });\n\n // layer list\n var layerList = new LayerList({\n view: view, \n listItemCreatedFunction: function(event){\n var item = event.item;\n \n if (item.title === \"Trail Heads\"){\n item.open = true;\n item.panel = {\n content: document.getElementById(\"th\"),\n open: true\n }\n } else if (item.title === \"Point of Interest\"){\n item.open = true;\n item.panel = {\n content: document.getElementById(\"poi\"),\n open: true\n }\n } else if (item.title === \"Visitor Recommendations\"){\n item.open = true;\n item.panel = {\n content: document.getElementById(\"rec\"),\n open: true\n }\n } else if (item.title === \"Roads\"){\n item.open = true;\n item.panel = {\n content: document.getElementById(\"road\"),\n open: true\n }\n } else if (item.title === \"Trails\"){\n item.open = true;\n item.panel = {\n content: document.getElementById(\"trail\"),\n open: true\n }\n }\n }\n });\n \n // expand layer list\n layerExpand = new Expand({\n expandIconClass: \"esri-icon-layers\",\n expandTooltip: \"Turn on and off Map Layers\",\n expanded: false,\n view: view,\n content: layerList,\n mode: \"floating\", \n group:\"top-left\"\n });\n \n\n // expand widget for edit area\n editExpand = new Expand({\n expandIconClass: \"esri-icon-edit\",\n expandTooltip: \"Add a Visitor Recommendation\",\n expanded: false,\n view: view,\n content: editArea,\n mode: \"floating\",\n group:\"top-left\"\n });\n \n // expand widget for query\n var query = document.getElementById(\"info-div\");\n queryExpand = new Expand ({\n expandIconClass: \"esri-icon-filter\",\n expandTooltip: \"Filter Points of Interest\",\n expanded: false,\n view: view,\n content: query,\n mode: \"floating\",\n group:\"top-left\"\n });\n \n // search widget\n var searchWidget = new Search({\n view:view,\n allPlaceholder: \"Search for SNP Places\",\n locationEnabled: false,\n sources: [{\n featureLayer: poi,\n resultSymbol: {\n type: \"simple-marker\",\n color: [0, 0, 0, 0],\n size: \"17px\",\n style: \"square\",\n outline: {\n color: [0, 255, 255, 1],\n width: \"2px\"\n }\n },\n outFields: [\"*\"],\n popupTemplate: poiP\n }, {\n featureLayer:aoi,\n resultSymbol: {\n type: \"simple-marker\",\n color: [0, 0, 0, 0],\n size: \"17px\",\n style: \"square\",\n outline: {\n color: [0, 255, 255, 1],\n width: \"2px\"\n }\n },\n outFields: [\"*\"],\n popupTemplate: aoiP\n }, {\n featureLayer: trailheads,\n resultSymbol: {\n type: \"simple-marker\",\n color: [0, 0, 0, 0],\n size: \"17px\",\n style: \"square\",\n outline: {\n color: [0, 255, 255, 1],\n width: \"2px\"\n }\n },\n outFields: [\"*\"],\n popupTemplate: trailheadsP\n }, {\n featureLayer:trails,\n resultSymbol: {\n type: \"simple-line\",\n color: [0, 255, 255, 1],\n width: \"2px\"\n },\n outFields: [\"*\"],\n popupTemplate: trailsP\n }]\n });\n // search expand\n searchExpand = new Expand({\n expandIconClass: \"esri-icon-search\",\n expandTooltip: \"Search for SNP Places\",\n view: view,\n content: searchWidget,\n mode: \"floating\",\n group:\"top-left\"\n });\n \n // add all widgets to view \n view.ui.move( \"zoom\", \"bottom-right\");\n view.ui.add([homeButton, track, layerExpand], \"bottom-right\")\n view.ui.add([searchExpand, queryExpand, layerExpand, editExpand],\"top-left\");\n }", "title": "" }, { "docid": "b1ab358a42e20abd6edc64ab60337ea2", "score": "0.57527345", "text": "function OpenInternalViewer( ) {\r\n\r\n G.VOM.viewerDisplayed=true;\r\n G.GOM.firstDisplay=false;\r\n jQuery('body').css({overflow:'hidden'}); //avoid scrollbars\r\n\r\n G.VOM.$cont = jQuery('<div class=\"nGY2 nGY2ViewerContainer\" style=\"opacity:1\"></div>').appendTo('body');\r\n \r\n SetViewerTheme();\r\n\r\n G.VOM.$viewer = jQuery('<div class=\"nGY2Viewer\" style=\"opacity:0\" itemscope itemtype=\"http://schema.org/ImageObject\"></div>').appendTo( G.VOM.$cont );\r\n G.VOM.$viewer.css({ msTouchAction: 'none', touchAction: 'none' }); // avoid pinch zoom\r\n\r\n G.VOM.currItemIdx=0;\r\n \r\n var sImg = '<div class=\"nGY2ViewerImagePan\"><img class=\"nGY2ViewerImage\" src=\"' + G.VOM.NGY2Item(-1).responsiveURL() + '\" alt=\" \" itemprop=\"contentURL\"></div>';\r\n sImg += '<div class=\"nGY2ViewerImagePan\"><img class=\"nGY2ViewerImage\" src=\"' + G.VOM.NGY2Item(0).responsiveURL() + '\" alt=\" \" itemprop=\"contentURL\"></div>';\r\n sImg += '<div class=\"nGY2ViewerImagePan\"><img class=\"nGY2ViewerImage\" src=\"' + G.VOM.NGY2Item(1).responsiveURL() + '\" alt=\" \" itemprop=\"contentURL\"></div>';\r\n var sNav = '';\r\n if( G.O.icons.viewerImgPrevious != undefined && G.O.icons.viewerImgPrevious != '') {\r\n sNav += '<div class=\"nGY2ViewerAreaPrevious ngy2viewerToolAction\" data-ngy2action=\"previous\">' + G.O.icons.viewerImgPrevious + '</div>';\r\n }\r\n if( G.O.icons.viewerImgNext != undefined && G.O.icons.viewerImgNext != '') {\r\n sNav += '<div class=\"nGY2ViewerAreaNext ngy2viewerToolAction\" data-ngy2action=\"next\">' + G.O.icons.viewerImgNext + '</div>';\r\n }\r\n G.VOM.$content = jQuery('<div class=\"nGY2ViewerContent\">' + sImg + sNav + '</div>').appendTo( G.VOM.$viewer );\r\n G.VOM.$imgP = G.VOM.$content.find('.nGY2ViewerImagePan').eq(0);\r\n G.VOM.$imgC = G.VOM.$content.find('.nGY2ViewerImagePan').eq(1);\r\n G.VOM.$imgN = G.VOM.$content.find('.nGY2ViewerImagePan').eq(2);\r\n G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.NGY2Item(0) );\r\n G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.NGY2Item(-1) );\r\n G.VOM.ImageLoader.loadImage( VieweImgSizeRetrieved, G.VOM.NGY2Item(1) );\r\n \r\n ViewerDisplayDominantColors(G.VOM.NGY2Item(0), G.VOM.$imgC.children());\r\n ViewerDisplayDominantColors(G.VOM.NGY2Item(-1), G.VOM.$imgP.children());\r\n ViewerDisplayDominantColors(G.VOM.NGY2Item(1), G.VOM.$imgN.children());\r\n\r\n // makes content unselectable --> avoid image drag effect during 'mouse swipe'\r\n G.VOM.$cont.find('*').attr('draggable', 'false').attr('unselectable', 'on');\r\n \r\n G.VOM.padding.H=parseInt(G.VOM.$content.css(\"padding-left\"))+parseInt(G.VOM.$content.css(\"padding-right\"));\r\n G.VOM.padding.V=parseInt(G.VOM.$content.css(\"padding-top\"))+parseInt(G.VOM.$content.css(\"padding-bottom\"));\r\n \r\n // build image toolbar container\r\n var vtbBg1='';\r\n var vtbBg2=' toolbarBackground';\r\n if( G.O.viewerToolbar.fullWidth ) {\r\n vtbBg1=' toolbarBackground';\r\n vtbBg2='';\r\n }\r\n var vtbAlign='text-align:center;';\r\n switch ( G.O.viewerToolbar.align ) {\r\n case 'left':\r\n vtbAlign='text-align:left;';\r\n break;\r\n case 'right':\r\n vtbAlign='text-align:right;';\r\n break;\r\n }\r\n var sTB='<div class=\"toolbarContainer nGEvent'+vtbBg1+'\" style=\"visibility:'+(G.O.viewerToolbar.display ? \"visible\" : \"hidden\")+';'+vtbAlign+'\"><div class=\"toolbar nGEvent'+vtbBg2+'\">';\r\n sTB+='</div></div>';\r\n G.VOM.$toolbar=jQuery(sTB).appendTo(G.VOM.$viewer);\r\n\r\n if( G.VOM.toolbarMode == 'min' || (G.O.viewerToolbar.autoMinimize > 0 && G.O.viewerToolbar.autoMinimize >= G.GOM.cache.viewport.w) ) {\r\n ViewerToolbarForVisibilityMin();\r\n }\r\n else {\r\n ViewerToolbarForVisibilityStd();\r\n }\r\n \r\n // top-left toolbar\r\n if( G.O.viewerTools.topLeft != '' ) {\r\n var sTopLeft='<div class=\"nGY2ViewerToolsTopLeft nGEvent\"><div class=\"toolbar nGEvent\">';\r\n var sTL = G.O.viewerTools.topLeft.split(',');\r\n for( var i=0, sTLL=sTL.length; i<sTLL; i++) {\r\n sTopLeft+=ToolbarAddElt( sTL[i] );\r\n }\r\n sTopLeft+='</div></div>';\r\n G.VOM.$toolbarTL = jQuery(sTopLeft).appendTo(G.VOM.$viewer);\r\n }\r\n // top-right toolbar\r\n if( G.O.viewerTools.topRight != '' ) {\r\n var sTopRight='<div class=\"nGY2ViewerToolsTopRight nGEvent\"><div class=\"toolbar nGEvent\">';\r\n var sTR = G.O.viewerTools.topRight.split(',');\r\n for( var i=0, sTRL=sTR.length; i<sTRL; i++) {\r\n sTopRight+=ToolbarAddElt( sTR[i] );\r\n }\r\n sTopRight+='</div></div>';\r\n G.VOM.$toolbarTR = jQuery(sTopRight).appendTo(G.VOM.$viewer);\r\n }\r\n\r\n // Go to fullscreen mode\r\n if( ngscreenfull.enabled && G.O.viewerFullscreen ) { ngscreenfull.request(); }\r\n\r\n // set the events handler for toolbars\r\n ViewerToolsOn();\r\n\r\n // display logo\r\n if( G.O.viewerDisplayLogo ) {\r\n G.$E.vwLogo=jQuery('<div class=\"nGY2 nGY2ViewerLogo\"></div>').appendTo(G.VOM.$viewer);\r\n }\r\n\r\n setElementOnTop('', G.VOM.$viewer);\r\n ResizeInternalViewer(true);\r\n G.VOM.timeImgChanged=new Date().getTime();\r\n \r\n \r\n var tweenable = new NGTweenable();\r\n tweenable.tween({\r\n from: { opacity: 0, posY: G.VOM.window.lastHeight*.5 },\r\n to: { opacity: 1, posY: 0 },\r\n delay: 30,\r\n duration: 500,\r\n easing: 'easeOutQuart',\r\n step: function (state) {\r\n G.VOM.$viewer.css('opacity', state.opacity);\r\n G.VOM.$viewer[0].style[G.CSStransformName] = 'translateY(' + (state.posY) + 'px) ';\r\n }\r\n });\r\n\r\n // stop click propagation on image ==> if the user clicks outside of an image, the viewer is closed\r\n G.VOM.$viewer.find('img').on('click', function (e) { e.stopPropagation(); });\r\n \r\n ImageSwipeTranslateX(0);\r\n ViewerSetEvents();\r\n\r\n DisplayInternalViewer(0, '');\r\n \r\n if( G.O.slideshowAutoStart ) {\r\n G.VOM.playSlideshow=false;\r\n SlideshowToggle();\r\n }\r\n }", "title": "" }, { "docid": "603333ed186ba121e1b781f8abf0a05c", "score": "0.5752143", "text": "_setViewport(reset, elementId) {\n // this.screenWidth = window.innerWidth;\n const layoutManager = this._score.layoutManager;\n // All pages have same width/height, so use that\n const layout = layoutManager.getGlobalLayout();\n\n // zoomScale is the zoom level pct.\n // layout.svgScale is note size pct, used to calculate viewport size. Larger viewport\n // vs. window size means smaller notes/more notes per page.\n // renderScale is the product of the zoom and svg scale, used to size the window in client coordinates\n const zoomScale = layoutManager.getZoomScale();\n const renderScale = layout.svgScale * zoomScale;\n const totalHeight = layout.pageHeight * layoutManager.pageLayouts.length * zoomScale;\n const pageWidth = layout.pageWidth * zoomScale;\n $(elementId).css('width', '' + Math.round(pageWidth) + 'px');\n $(elementId).css('height', '' + Math.round(totalHeight) + 'px');\n // Reset means we remove the previous SVG element. Otherwise, we just alter it\n if (reset) {\n $(elementId).html('');\n this.renderer = new VF.Renderer(elementId, VF.Renderer.Backends.SVG);\n this.viewportChanged = true;\n if (this.measureMapper) {\n this.measureMapper.scroller.scrollAbsolute(0, 0);\n }\n }\n svgHelpers.svgViewport(this.context.svg, 0, 0, pageWidth, totalHeight, renderScale);\n // this.context.setFont(this.font.typeface, this.font.pointSize, \"\").setBackgroundFillStyle(this.font.fillStyle);\n this.resizing = false;\n console.log('layout setViewport: pstate initial');\n this.dirty = true;\n if (this.measureMapper) {\n this.measureMapper.scroller.updateViewport();\n }\n SuiRenderState._renderer = this.renderer;\n }", "title": "" }, { "docid": "474d4a49b889c84d59a4e1b6d5f0d3e0", "score": "0.5708387", "text": "get viewportChanged() {\n return (this.flags & 4) /* Viewport */ > 0\n }", "title": "" }, { "docid": "2d72a63547f0cdeaa0d1e4aebf957acf", "score": "0.5701396", "text": "update() {\n const fullWindow = windowController.isFullscreenOrMaximized();\n const tall = window.innerHeight > window.innerWidth;\n state.set(state.State.TABLET_LANDSCAPE, fullWindow && !tall);\n state.set(state.State.MAX_WND, fullWindow);\n state.set(state.State.TALL, tall);\n\n const {width: boxW, height: boxH} =\n this.previewBox_.getBoundingClientRect();\n const video = dom.get('#preview-video', HTMLVideoElement);\n\n if (state.get(Mode.SQUARE)) {\n const viewportSize = Math.min(boxW, boxH);\n this.setViewportSize_(viewportSize, viewportSize);\n const scale =\n viewportSize / Math.min(video.videoHeight, video.videoWidth);\n const contentW = scale * video.videoWidth;\n const contentH = scale * video.videoHeight;\n this.setContentSize_(contentW, contentH);\n this.setContentOffset_(\n (viewportSize - contentW) / 2, (viewportSize - contentH) / 2);\n } else {\n const scale = Math.min(boxH / video.videoHeight, boxW / video.videoWidth);\n const contentW = scale * video.videoWidth;\n const contentH = scale * video.videoHeight;\n this.setViewportSize_(contentW, contentH);\n this.setContentSize_(contentW, contentH);\n this.setContentOffset_(0, 0);\n }\n }", "title": "" }, { "docid": "d78609a19246c8bb1e07509a7fc7e3ce", "score": "0.5694948", "text": "function updateViewbox() {\n\t$('#viewport').setAttributeNS(null, \"viewBox\", Math.round(app.pan.dx) + \" \" + Math.round(app.pan.dy) + \" \" + Math.round(document.body.offsetWidth * app.zoomLevel) + \" \" + Math.round(document.body.offsetHeight * app.zoomLevel));\n}", "title": "" }, { "docid": "7881e27d00f6d3ea44bb5b72abc1d693", "score": "0.5693849", "text": "get viewportChanged() {\n return (this.flags & 4 /* Viewport */) > 0;\n }", "title": "" }, { "docid": "7424909ff62f7f4376537523a7197e37", "score": "0.56916726", "text": "_listenForAdaptiveChanges() {\n this._$log.debug(`_listenForAdaptiveChanges( )`);\n\n this.subscribeToAdaptiveChanges((viewPort) => {\n this._$log.debug(`onAdaptiveChange( ${viewPort.viewport} )`);\n\n this.viewPort = viewPort.gridInfo[\"detailView\"];\n this.isMobile = (viewPort.minWidth < 840 || viewPort.display == 'mobile');\n });\n\n }", "title": "" }, { "docid": "66107a95ee83a936fbac556c27e4ea88", "score": "0.5689652", "text": "function ResizeInternalViewer( forceUpdate ) {\r\n forceUpdate = typeof forceUpdate !== 'undefined' ? forceUpdate : false;\r\n \r\n if( G.VOM.$toolbar === null ) { return; } // viewer build not finished\r\n \r\n \r\n // window.requestAnimationFrame( function() { // synchronize with screen\r\n var windowsW=G.VOM.$viewer.width();\r\n var windowsH=G.VOM.$viewer.height();\r\n var $elt=G.VOM.$imgC.children().eq(0);\r\n if( $elt == null || G.VOM.currItemIdx == -1 ) { return; }\r\n \r\n if( !forceUpdate && G.VOM.window.lastWidth == windowsW && G.VOM.window.lastHeight == windowsH ) { return; }\r\n \r\n G.VOM.window.lastWidth=windowsW;\r\n G.VOM.window.lastHeight=windowsH;\r\n\r\n var vwImgC_H=$elt.height(),\r\n vwImgC_W=$elt.width(),\r\n vwImgC_OHt=$elt.outerHeight(true),\r\n vwImgC_OHf=$elt.outerHeight(false);\r\n\r\n var $tb=G.VOM.$toolbar.find('.toolbar');\r\n var tb_OHt=$tb.outerHeight(true);\r\n\r\n switch( G.O.viewerToolbar.position ) {\r\n case 'topOverImage':\r\n G.VOM.$content.css({height:windowsH, width:windowsW, top:0 });\r\n G.VOM.$toolbar.css({top: 0, bottom:''});\r\n break;\r\n case 'top':\r\n windowsH-=tb_OHt;\r\n G.VOM.$content.css({height:windowsH, width:windowsW, top:tb_OHt });\r\n G.VOM.$toolbar.css({top: 0});\r\n break;\r\n case 'bottomOverImage':\r\n G.VOM.$content.css({height:windowsH, width:windowsW, bottom:0, top:0 });\r\n G.VOM.$toolbar.css({bottom: 0});\r\n break;\r\n case 'bottom':\r\n default:\r\n windowsH-=tb_OHt;\r\n G.VOM.$content.css({ width:windowsW, top:0, bottom:tb_OHt });\r\n G.VOM.$toolbar.css({bottom: 0});\r\n break;\r\n }\r\n\r\n if( !G.VOM.viewerImageIsChanged && G.VOM.zoom.isZooming ) {\r\n ViewerImageSetPosAndZoom();\r\n }\r\n else {\r\n G.VOM.zoom.userFactor=1;\r\n G.VOM.zoom.isZooming=false;\r\n G.VOM.panPosX=0;\r\n G.VOM.panPosY=0;\r\n G.VOM.zoom.posX=0;\r\n G.VOM.zoom.posY=0;\r\n G.VOM.$imgC[0].style[G.CSStransformName]= 'translate3D(0,0,0) ';\r\n ViewerImageSetPosAndZoom(); \r\n }\r\n }", "title": "" }, { "docid": "6d7f5a581795b37d39e3407adf1da005", "score": "0.5625949", "text": "function adjustToNewViewport(){var newWindowHeight=getWindowHeight();var newWindowWidth=getWindowWidth();if(windowsHeight!==newWindowHeight||windowsWidth!==newWindowWidth){windowsHeight=newWindowHeight;windowsWidth=newWindowWidth;reBuild(true);}}", "title": "" }, { "docid": "9599c2efc4ee7242d99ff214438eab84", "score": "0.5622424", "text": "userActionIotCampusSADE15() {\n console.log(\"Zoom on SADE clicked\")\n this.setState ( {\n viewport: {\n width: 1280,\n height: this.state.viewport.height,\n longitude: 23.102628,\n latitude: 60.389487,\n zoom: 15,\n pitch: 60,\n bearing: 0,\n mapStyle: 'mapbox://styles/mapbox/streets-v11',\n }\n });\n console.log(\"viewport updeitattu\");\n console.log(this.state);\n console.log(\"uusi zoom taso:\" + this.state.viewport.zoom);\n console.log(\"uusi width taso:\" + this.state.viewport.width);\n console.log(\"uusi height taso:\" + this.state.viewport.height);\n }", "title": "" }, { "docid": "c8afef2b7388c3d2b5ca607717c70dd2", "score": "0.56203485", "text": "function updateView() {\n var bounds = tornadoPaths.bounds(tornadoes),\n topLeft = bounds[0],\n bottomRight = bounds[1];\n\n svg.attr({\n \"width\": bottomRight[0] - topLeft[0],\n \"height\": bottomRight[1] - topLeft[1]\n })\n .style({\n \"left\": topLeft[0] + \"px\",\n \"top\": topLeft[1] + \"px\"\n });\n\n g.attr(\"transform\", \"translate(\" + -topLeft[0] + \",\" + -topLeft[1] + \")\");\n tornadoGeo.attr(\"d\", tornadoPaths);\n\n tornadoGeo.attr({\n \"stroke-dasharray\": function(d) {\n return this.getTotalLength() + \" \" + this.getTotalLength();\n },\n \"stroke-dashoffset\": function(d) {\n return d3.select(this).classed(\"dateOff\") ||\n d3.select(this).classed(\"seasonOff\") ? this.getTotalLength() : 0;\n }\n });\n }", "title": "" }, { "docid": "8ffa53a47f0ec548d4febe4daf35d31c", "score": "0.5620088", "text": "function resizeViewport() {\n\t\tvar ratio = o.minimap.offsetWidth / document.body.offsetWidth;\n\t\tvar viewport = o.minimap.querySelector('.xivmap-viewport');\n\t\tviewport.style.height = window.innerHeight * ratio + 'px';\n\t}", "title": "" }, { "docid": "eea2fc869ea5721e0f06fd8820b5eef1", "score": "0.5619433", "text": "updateViewport() {\n const { width, height } = this.renderer.getSize();\n const rw = width / this.frameWidth;\n const rh = height / this.frameHeight;\n const ratio = Math.max(rw, rh);\n const rtw = this.frameWidth * ratio;\n const rth = this.frameHeight * ratio;\n\n let x = 0;\n let y = 0;\n\n if (rw < rh) {\n x = -(rtw - width) / 2;\n } else if (rw > rh) {\n y = -(rth - height) / 2;\n }\n\n this.renderer.setViewport(x, y, rtw, rth);\n }", "title": "" }, { "docid": "68c373be506da6da7bc3e876f61a3649", "score": "0.56185883", "text": "updateScene(frame, coordinateSystem, pose){\n\n\t}", "title": "" }, { "docid": "f9d4005a5d87c22559e23f47adee3dec", "score": "0.5614595", "text": "viewport() {\n let viewport = this.camera.rect;\n\n this.viewer.gl.viewport(viewport[0], viewport[1], viewport[2], viewport[3]);\n }", "title": "" }, { "docid": "5c9775ebe9aa71d318595333fbdcc8d6", "score": "0.56125325", "text": "function ViewActiveSection()\n{\ndocument.addEventListener('scroll',isInViewport);\n}", "title": "" }, { "docid": "80a83f56b7e6902dff435339a2a0ebdd", "score": "0.5609785", "text": "onContainerUpgradeClick_() {\n this.browserProxy_.requestCrostiniContainerUpgradeView();\n }", "title": "" }, { "docid": "808ceec16877eceea66a2b5c70874f63", "score": "0.5597064", "text": "updateView() {\n if (this.myView) {\n this.myView.update();\n }\n }", "title": "" }, { "docid": "808ceec16877eceea66a2b5c70874f63", "score": "0.5597064", "text": "updateView() {\n if (this.myView) {\n this.myView.update();\n }\n }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.5596292", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.5596292", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.5596292", "text": "function LView() { }", "title": "" }, { "docid": "34aa8b3c7ab01ebab1e631c873df5da5", "score": "0.5596292", "text": "function LView() { }", "title": "" }, { "docid": "c7106c4167c6bc70a270d48f4c03fb2b", "score": "0.5596173", "text": "function velov() {\n fdc = new Gmap(divId, centralLat, centralLng);\n affStationsOpen(fdc.objectMap, contrat); // If true only the open stations are displayed\n window.setInterval('actualisation()', timer); // Actualization function is set to timer value\n}", "title": "" }, { "docid": "fcc9b34c5e90631aa944ec22f7aac8d6", "score": "0.5583397", "text": "function inView () {\n if (win.scrollTop() >= 47 && win.width() >= 600) {\n page.addClass(\"in-view\");\n }\n else {\n page.removeClass(\"in-view\");\n }\n}", "title": "" }, { "docid": "3cc1956222019828a1de3a4db494a051", "score": "0.558139", "text": "function onResize() {\n\t\tvar height = window.innerHeight;\n\t\tvar width = window.innerWidth;\n\t\to.next({ height, width });\n\t}", "title": "" }, { "docid": "b366cd952481f8c697bd1d71888f6c05", "score": "0.55760163", "text": "function navChange() {\n isPlaying ? pause() : null\n currentStream = 'ot'\n updateShowFacets()\n view.setBounds({ x: 0, y: 0, width: 0, height: 0 })\n win.webContents.send('stream-changed', null)\n setTimeout(setViewBounds, 1000)\n}", "title": "" }, { "docid": "abed4c59cb0dfd855302006511c19c28", "score": "0.557151", "text": "function render() {\n\t\tupdateDom();\n\t\tresizeViewport();\n\t\tupdateViewport();\n\t}", "title": "" }, { "docid": "e7e3ea055592e09d8b030d2ede56afc7", "score": "0.5562955", "text": "function initViews(EM) {\n EM.on(\"change-panel\", () => {\n const panel = window.state.panel;\n const site = window.state.site;\n if (panel === \"site-editor\") {\n showSiteEditor(site, EM);\n mapSiteMarker(site);\n } else if (panel === \"site-content\") {\n showSiteContentPanel(site, EM);\n mapSiteMarker(site);\n mapAll(window.state.site.scenarioList);\n mapBubbleplots(window.state.site.bubbleplotList);\n } else if (panel === \"scenario-editor\") {\n showScenarioPanel(window.state.mapItem, EM);\n mapSiteMarker(site);\n } else if (panel === \"bubbleplot-editor\") {\n showBubbleplotPanel(window.state.mapItem, EM);\n mapSiteMarker(site);\n mapAll(window.state.site.scenarioList);\n } else {\n console.err(\"No panel of the name \", panel);\n }\n });\n}", "title": "" }, { "docid": "a911c116d7a9a93630e4c8dc22f15976", "score": "0.554586", "text": "onResize() {}", "title": "" }, { "docid": "d96dd7fe0787234e1aaf528b2c50d669", "score": "0.55421084", "text": "get viewport() { return this._viewport; }", "title": "" }, { "docid": "56ea43cf98fd4ff1b93762bbc24ad441", "score": "0.5539013", "text": "function handleWindowScrolled() {\n updateParallax();\n}", "title": "" }, { "docid": "7e41cc264256a84ec6f0f8c58452bd52", "score": "0.5524667", "text": "_contentChanged() {\n if (this.isShowing) {\n this._getInfowindowSize();\n let placement = this._setInfowindowPosition();\n // do not do _panToShowInfowindow - see issue #8\n }\n }", "title": "" }, { "docid": "71ecececad5db4e9285c99cd22470048", "score": "0.55042225", "text": "function onDocumentResize() {\n // Resize panorama renderer (moved to onFullScreenChange)\n //renderer.resize();\n //animateInit();\n\n // Kludge to deal with WebKit regression: https://bugs.webkit.org/show_bug.cgi?id=93525\n onFullScreenChange('resize');\n}", "title": "" }, { "docid": "14f517561dfbbe8faf1bedac194fa5c6", "score": "0.54931027", "text": "function onWindowResize() {\n\torbitCamera.aspect = container.clientWidth / container.clientHeight;\n\torbitCamera.updateProjectionMatrix();\n\tvessel.bridgeCamera.aspect = container.clientWidth / container.clientHeight;\n\tvessel.bridgeCamera.updateProjectionMatrix();\n\trenderer.setSize(container.clientWidth, container.clientHeight);\n}", "title": "" }, { "docid": "ba8601ba02e48fe839a627ec4af6471d", "score": "0.54842", "text": "function UpdateViewWindow()\n{\n // Adjust new view window for inverted view cases\n if(initialYPositionOfViewWindow > endingYPositionOfViewWindow)\n {\n let temp = endingYPositionOfViewWindow;\n endingYPositionOfViewWindow = initialYPositionOfViewWindow;\n initialYPositionOfViewWindow = temp;\n }\n if(initialXPositionOfViewWindow > endingXPositionOfViewWindow)\n {\n let temp = endingXPositionOfViewWindow;\n endingXPositionOfViewWindow = initialXPositionOfViewWindow;\n initialXPositionOfViewWindow = temp;\n }\n\n // Map the old maximum and minimum values for the real and imaginary axes to the new window view space\n let newMinImaginary = (initialYPositionOfViewWindow / height) * (maxImaginary - minImgaginary) + minImgaginary;\n let newMaxImaginary = (endingYPositionOfViewWindow / height) * (maxImaginary - minImgaginary) + minImgaginary;\n let newMinReal = (initialXPositionOfViewWindow / width) * (maxReal - minReal) + minReal;\n let newMaxReal = (endingXPositionOfViewWindow / width) * (maxReal - minReal) + minReal;\n \n // Set the new maximums and minimums\n minReal = newMinReal;\n maxReal = newMaxReal;\n minImgaginary = newMinImaginary;\n maxImaginary = newMaxImaginary;\n}", "title": "" }, { "docid": "d2b0adf7899c61dfbcf545af3fb60aa5", "score": "0.54775625", "text": "function doc_visChange() {\n updatePlaybackState();\n }", "title": "" }, { "docid": "be914731e07b3e69bccc0c9792dde526", "score": "0.54632324", "text": "get viewport() {\n return this.viewState.viewport\n }", "title": "" }, { "docid": "993bc9375a6a833ed5f28741ba857447", "score": "0.5458483", "text": "updated() {\n if (RollCall.lockFocus && this.state.guest.length >= 3) {\n let walkon = document.getElementsByClassName(\"walkon\")[0];\n let offset = walkon.offsetTop + walkon.offsetHeight / 2 - window.innerHeight / 2;\n jQuery(\"html, body\").animate({scrollTop: offset}, \"slow\")\n }\n }", "title": "" }, { "docid": "f0683c6f303676047db4d8ced0b8529e", "score": "0.5457477", "text": "function updateoverlay(){\n\n blocktitle.html(title);\n content.find(\">:first-child\").addClass('vbox-figlio').css({\n 'width': framewidth,\n 'height': frameheight,\n 'padding': border,\n 'background': bgcolor\n });\n\n $('img.vbox-figlio').on('dragstart', function(event) {\n event.preventDefault();\n });\n\n updateOL();\n\n content.animate({\n 'opacity': '1'\n },'slow', function(){\n $preloader.hide();\n });\n\n option.cb_content_loaded(obj, gallIndex, thenext, theprev);\n }", "title": "" }, { "docid": "c171b905157f15e6e7bc207160f9f0f0", "score": "0.54515004", "text": "setupViewport(div, viewportData, displaySet) {\n const viewportWrapper = div.parentElement;\n\n // Seems like VolumeRendering in 4-up is not fast enough to use progressive\n // updating and have a nice user experience. Added loading spinner instead.\n div.innerHTML = `<div class=\"imageViewerLoadingIndicator loadingIndicator\">\n <div class=\"indicatorContents\">\n <p>Loading... <i class=\"fa fa-spin fa-circle-o-notch fa-fw\"></i></p>\n </div>\n </div>`;\n\n // Reusing the OHIF loading indicator here... this is a bit ugly\n const loadingIndicator = div.querySelector('.imageViewerLoadingIndicator');\n\n // Default values are position:absolute and display: none so we have to change\n // them here if we want this to display\n loadingIndicator.style.position = 'relative';\n loadingIndicator.style.display = 'block';\n\n\n if (!displaySet) {\n displaySet = OHIF.plugins.ViewportPlugin.getDisplaySet(viewportIndex);\n }\n\n viewportWrapper.style.position = \"relative\";\n\n const { VTKUtils } = window;\n const imageDataObject = VTKUtils.getImageData(displaySet);\n\n if (imageDataObject === null){\n throw new Error('Cached VTK image data object was null.');\n }\n\n const imageData = imageDataObject.vtkImageData;\n\n function displayVolumeRendering() {\n div.innerHTML = '';\n\n const genericRenderWindow = vtk.Rendering.Misc.vtkGenericRenderWindow.newInstance({\n background: [0, 0, 0],\n });\n\n genericRenderWindow.setContainer(div);\n\n // TODO: VTK's canvas currently does not fill the viewport element\n // after it has been resized. We need to set the height to 100% and\n // trigger volumeViewer.resize() whenever things are resized.\n // We might need to find a way to hook onto the OHIF Viewer ResizeManager\n // div.querySelector('canvas').style.height = '100%';\n genericRenderWindow.resize();\n\n const actor = VolumeRenderingPlugin.setupVTKActor(imageData);\n\n VTKUtils.installVTKViewer(genericRenderWindow, actor);\n\n // We need to fix to load our color tables.\n const controllerWidget = vtk.Interaction.UI.vtkVolumeController.newInstance({\n size: [400, 150],\n rescaleColorMap: false,\n expanded: false\n });\n\n // TODO we assume for now that the background is \"dark\".\n const isDark = true;\n controllerWidget.setContainer(viewportWrapper);\n\n VolumeRenderingPlugin.installVTKVolumeController(controllerWidget, genericRenderWindow, actor, isDark);\n }\n\n // Don't load data until the viewports etc are set up (above).\n if (imageDataObject.loaded === true) {\n displayVolumeRendering();\n } else {\n VTKUtils.loadImageData(imageDataObject).then(displayVolumeRendering);\n }\n }", "title": "" }, { "docid": "f4164cba09ed137b0f6c0b19e7ed20b5", "score": "0.54486966", "text": "function initView(){\n\n}", "title": "" }, { "docid": "696c2095bf80038210aab3f5993fc866", "score": "0.5446772", "text": "function JViewpoint() {}", "title": "" }, { "docid": "7fcc0bc2ede9f7d016f929dc30bd57e6", "score": "0.54466033", "text": "function setWindowView() {\n winchFactory.setWindowView(\n $window.innerHeight,\n $window.innerWidth\n );\n }", "title": "" }, { "docid": "f7ac67214128053d72ef8b14c5302296", "score": "0.5442104", "text": "onRender() {\n let hits = $('.hit');\n function onVisible(hit) {\n $(hit).addClass('hit__inViewport');\n }\n _.each(hits, (hit) => {\n inViewport(hit, {offset: 50}, onVisible);\n });\n }", "title": "" }, { "docid": "f65ab3b49b54caebb5a889a2ac1e1a3d", "score": "0.5440639", "text": "function refresh() {\n var vp = viewport();\n if (vp) {\n // check that the offset is within bounds\n if (offsetMaxX || offsetMaxY) {\n constrainOffset(vp);\n } // if\n \n // update the last refresh x and y\n refreshX = offsetX;\n refreshY = offsetY;\n \n // trigger the refresh event\n _this.trigger('refresh', _this, vp);\n \n // invalidate\n viewChanges++;\n } // if\n }", "title": "" }, { "docid": "de8ae5e99007171de69ba65a2c8bc767", "score": "0.54393095", "text": "function updateView() { \n display.displayTime(timeString); \n display.displayMode(modeString);\n display.displayTitle(timeString, modeString);\n display.displayPomosFinished(numPomos);\n}", "title": "" }, { "docid": "8bd84f2ae3c1e29ce42924f20dfe59f3", "score": "0.5426615", "text": "updatePageScrollHeight() {\n\n // Get scope\n const scope = this;\n\n /**\n * @type {PageElement|{updateDimensions}}\n */\n const $item = scope.view.get$item();\n\n if ($item) {\n //$item.updateDimensions(padding);\n } else {\n scope.eventManager.subscribe({\n event: scope.eventManager.eventList.successRendered,\n callback() {\n scope.view.get$item().updateDimensions();\n }\n }, true);\n }\n }", "title": "" }, { "docid": "2572611cf9d03d946fff3e002add61ab", "score": "0.5420469", "text": "onNewView(view) {\n console.log(\"New view:\", view)\n }", "title": "" }, { "docid": "f096c1bcd5423f072dbd2aae3308fff4", "score": "0.5418787", "text": "update() {\n\t\tif (SHOW_TILES) {\n\t\t\tupdateSeen();\n\t\t}\n\n\t\tif (SHOW_VIEW) {\n\t\t\tmoveView();\n\t\t}\n\t}", "title": "" }, { "docid": "4db0f4fabcf0881efc1cfa86743af1cb", "score": "0.54076266", "text": "function onLoadLayout() {\r\n}", "title": "" }, { "docid": "a33ae86812fa1a676f5c7971b14e03f8", "score": "0.5405704", "text": "function qodeOnWindowResize() {\n qodeSelfHostedVideoSize();\n }", "title": "" }, { "docid": "8f35bdf8e49247336c4100149fa1bc52", "score": "0.5401487", "text": "get Viewport() { return window; }", "title": "" }, { "docid": "a1e796ff0c66c7ea7b23151256f5a106", "score": "0.5397067", "text": "updateViewport () {\r\n\r\n let diff = {\r\n x: (this.target.x + this.target.width / 2) - this.viewport.halfwidth,\r\n y: (this.target.y + this.target.height / 2) - this.viewport.halfheight,\r\n }\r\n\r\n if (this.checkViewPortBounds(diff.x, diff.y)) {\r\n this.x = diff.x\r\n this.y = diff.y\r\n\r\n this.viewport.x = this.x\r\n this.viewport.y = this.y\r\n\r\n if (game.stage) {\r\n game.stage.x = -this.viewport.x\r\n game.stage.y = -this.viewport.y\r\n }\r\n }\r\n }", "title": "" }, { "docid": "7407d9ee4aac25fa94adf32e3821344a", "score": "0.5396933", "text": "setViewerCoordinates() {\n \n }", "title": "" }, { "docid": "3116759b3a48a3c9e7e30749021a4ba1", "score": "0.53951794", "text": "function handleViewChange(e) {\n if (e.matches) {\n updateWaveHeights();\n moveMan();\n }\n else {\n updateWaveHeights();\n moveMan();\n }\n}", "title": "" }, { "docid": "263215197c0ee2f78ce7341efc279e24", "score": "0.5394791", "text": "function viewDidUpdate() {\n // stub\n }", "title": "" }, { "docid": "cdd82706b024c7943c8f1f3452958bd9", "score": "0.5392901", "text": "_onWindowScroll(){\n this.markAsDirty();\n }", "title": "" }, { "docid": "283b0c29b4d60feb03b7f6ee40edd74a", "score": "0.53904104", "text": "static update() {\n this.height = document.body.clientHeight\n this.width = document.body.clientWidth\n listeners.forEach(cb => cb(this.width, this.height))\n }", "title": "" }, { "docid": "c11ba80ad387a00d67078857a4c91ae3", "score": "0.539031", "text": "function onViewer(viewer) {\n //console.log('onViewer',viewer);\n} // end function", "title": "" }, { "docid": "f79c667fec2177f280e4aa4e19564f6e", "score": "0.5383862", "text": "onPositionChange() {}", "title": "" }, { "docid": "b855e852284afe80dee3dc312b9444d5", "score": "0.53816104", "text": "function update() {\n //Update all projectile views\n group.projViews.forEach(function(projView){\n projView.update();\n });\n group.components.forEach(function (view, i) {\n if (i !== 0) {\n view.update();\n }\n else {\n view.set({ left: 0, top: 0 })\n }\n });\n }", "title": "" }, { "docid": "4cee7e35f744af3a73b2b57abf5fa96a", "score": "0.53721744", "text": "async resize (width, height) {\n this.page.set('viewportSize', {width, height})\n }", "title": "" }, { "docid": "5606222ea247f11f7117d790ef4245fe", "score": "0.53706926", "text": "function windowResize() {\n resizeSvg();\n setMenuPosition();\n}", "title": "" }, { "docid": "d69fe3e34b35a1f8781d9b899f73f637", "score": "0.5365329", "text": "componentDidUpdate(prevProps) {\n const { enabled, viewer } = this.props;\n // OSD instance becomes available, register callback\n if (enabled && viewer && viewer !== prevProps.viewer) {\n this.registerOsdCallback();\n }\n // Newly enabled, force initial setting of state from OSD\n if (this.shouldRender() && !this.shouldRender(prevProps)) {\n this.onUpdateViewport();\n }\n }", "title": "" }, { "docid": "42db01dc5498f3f26b0f4d4f89203947", "score": "0.5362054", "text": "function updateHeightsInViewport(cm){var display=cm.display;var prevBottom=display.lineDiv.offsetTop;for(var i=0;i<display.view.length;i++){var cur=display.view[i],height=void 0;if(cur.hidden){continue;}if(ie&&ie_version<8){var bot=cur.node.offsetTop+cur.node.offsetHeight;height=bot-prevBottom;prevBottom=bot;}else{var box=cur.node.getBoundingClientRect();height=box.bottom-box.top;}var diff=cur.line.height-height;if(height<2){height=textHeight(display);}if(diff>.005||diff<-.005){updateLineHeight(cur.line,height);updateWidgetHeight(cur.line);if(cur.rest){for(var j=0;j<cur.rest.length;j++){updateWidgetHeight(cur.rest[j]);}}}}}// Read and store the height of line widgets associated with the", "title": "" }, { "docid": "42db01dc5498f3f26b0f4d4f89203947", "score": "0.5362054", "text": "function updateHeightsInViewport(cm){var display=cm.display;var prevBottom=display.lineDiv.offsetTop;for(var i=0;i<display.view.length;i++){var cur=display.view[i],height=void 0;if(cur.hidden){continue;}if(ie&&ie_version<8){var bot=cur.node.offsetTop+cur.node.offsetHeight;height=bot-prevBottom;prevBottom=bot;}else{var box=cur.node.getBoundingClientRect();height=box.bottom-box.top;}var diff=cur.line.height-height;if(height<2){height=textHeight(display);}if(diff>.005||diff<-.005){updateLineHeight(cur.line,height);updateWidgetHeight(cur.line);if(cur.rest){for(var j=0;j<cur.rest.length;j++){updateWidgetHeight(cur.rest[j]);}}}}}// Read and store the height of line widgets associated with the", "title": "" } ]
60a1be12d86417d4f5342c58408ea314
Rule for validating a value exists in an enumerable list.
[ { "docid": "37f989831099b761bba1da4b46f163bc", "score": "0.5966479", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"d\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" } ]
[ { "docid": "860363283dba653980cb230eaa56329b", "score": "0.6461769", "text": "function exists(list) {\n return list.value.length === list.parameter.length;\n }", "title": "" }, { "docid": "5a7bf2e1ac24af5dbb61362e84b982b0", "score": "0.6444063", "text": "function oneOf(value, validList) {\n for (var i = 0; i < validList.length; i++) {\n if (value === validList[i]) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "30dd4a249a4f133d8f379e1e1ad681d8", "score": "0.63651884", "text": "function contains(list, value) {\n\t// check every item in the list until we find the item\n\tvar valueExists = false;\n\tvar counter = 0;\n\twhile (!valueExists && counter < list.length) {\n\t\tif (value == list[counter]) {\n\t\t\tvalueExists = true;\n\t\t}\n\t\tcounter = counter + 1;\n\t}\n\treturn valueExists;\n}", "title": "" }, { "docid": "3f094446f03effa2f2fdfb017ef7bed0", "score": "0.6351062", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "ef4766bc41cf4b34a2cd513d20dbb990", "score": "0.6339347", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "ef4766bc41cf4b34a2cd513d20dbb990", "score": "0.6339347", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "ef4766bc41cf4b34a2cd513d20dbb990", "score": "0.6339347", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "5c95f1a84441927f0299ab5c9c38cb44", "score": "0.6330548", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3999bc17e264c102fd01b413b56a8d2a", "score": "0.632095", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "6f38cc017bf33238811540ed270e42ee", "score": "0.63097525", "text": "function enumerable(rule, value, source, errors, options) {\n\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t if (rule[ENUM].indexOf(value) === -1) {\n\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t }\n\t}", "title": "" }, { "docid": "d8f0322b6e524d63e0c32a7cf3d7d926", "score": "0.6302419", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(format$1(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "dd0f24f97ed854f01a4b6dfea8a2dfad", "score": "0.6288043", "text": "has(value) {\n return value in this.items;\n }", "title": "" }, { "docid": "571959376b535d39e0322ebcd05be601", "score": "0.6287605", "text": "function enumerable(rule, value, source, errors, options) {\n\t\t rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n\t\t if (rule[ENUM].indexOf(value) === -1) {\n\t\t errors.push(util.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n\t\t }\n\t\t}", "title": "" }, { "docid": "0e448d16f53c5201017723662def177b", "score": "0.62278795", "text": "function enumerable(rule,value,source,errors,options){rule[ENUM]=Array.isArray(rule[ENUM])?rule[ENUM]:[];if(rule[ENUM].indexOf(value)===-1){errors.push(format(options.messages[ENUM],rule.fullField,rule[ENUM].join(', ')));}}", "title": "" }, { "docid": "573b467fac36f4106036c9c667e0d1b5", "score": "0.61447245", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "573b467fac36f4106036c9c667e0d1b5", "score": "0.61447245", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__.format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "de1c5478869e50cd34118162625ab1ac", "score": "0.61237067", "text": "function listContains( list, value ) {\n for ( var i = 0; i < list.options.length; i++ ) {\n if ( list.options[i].value == value ) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "b924dd62ff80e4e57fa42118af94ac5a", "score": "0.61059314", "text": "function listContains(list, value) {\n if (list.value === value) {\n return true;\n } else if (list.next !== null) {\n return listContains(list.next, value);\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "01ce6b38249fd1569871d29113896de3", "score": "0.6079359", "text": "function valueInList(alist:array, values:string, descr:string) {\n // Verify that value is in alist.\n if (values === \"\" ) return;\n var vlist=values.split(',');\n for (var vind in vlist) {\n var vval=vlist[vind];\n if (alist.indexOf(vval)<0)\n throw \"Invalid \"+descr+\": \"+vval+\" is not one of: \"+alist.join(', ');\n }\n }", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "3af7cce30b4dda86f78c384bfb0e5ab5", "score": "0.6024649", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"e\" /* format */](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c9684dcf5553103820253290ecad9f0d", "score": "0.60021424", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "c041aaabe351aeb5c4b1f4dd349553df", "score": "0.5982973", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"a\" /* default */][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "3feabc4f3016e891e3798eeea73ad5b1", "score": "0.59370494", "text": "function enumerable(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) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "3eb494751058319b60158dce58fc1873", "score": "0.59257483", "text": "function enumerable(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 (value) {\n __WEBPACK_IMPORTED_MODULE_0__rule___[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "f70cb178ac48abde60464a59f5659ae6", "score": "0.59154636", "text": "function enumerable(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 (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "f70cb178ac48abde60464a59f5659ae6", "score": "0.59154636", "text": "function enumerable(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 (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "695b0d4085dfde8bfc98c4c8c9bb0809", "score": "0.5900301", "text": "function enumerable(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) && !rule.required) {\n return callback();\n }\n _rule___WEBPACK_IMPORTED_MODULE_0__.default.required(rule, value, source, errors, options);\n if (value) {\n _rule___WEBPACK_IMPORTED_MODULE_0__.default[ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "01762e7dc5c7d922d0a76f5a8e2dc398", "score": "0.5893768", "text": "function isExisting(x, list){\n for (var i = 0; i < list.length; i++) {\n if (x == list[i]) {\n return true;\n }\n }\n return false;\n \n}", "title": "" }, { "docid": "83e18c72e7eeff86d6d0323e985bc292", "score": "0.5884919", "text": "contains(value) {\n let cur = this.head;\n while(cur) {\n if(cur.value === value) return true;\n cur = cur.next;\n }\n return false;\n }", "title": "" }, { "docid": "81caa4e0ec1c6ba0282b5c0c096c6fc9", "score": "0.58711976", "text": "__contains__(value) {\n if (value.type() === \"dict\") {\n return value.valueOf()[this.toString()] !== undefined; // fixme: toString() conversion falsifies data\n }\n else if (value.type() === \"list\") {\n // We need to compare every item using __cmp__()\n for(let item of value.valueOf()) {\n item = new Value(item);\n if(item.__cmp__(this) === 0) {\n return true;\n }\n }\n\n return false;\n //return new Value(value.valueOf().indexOf(this.valueOf()) >= 0);\n }\n\n return value.toString().indexOf(this.toString()) >= 0;\n }", "title": "" }, { "docid": "54e9dcb117d97dbb1988f1d1e2eaa69b", "score": "0.58478266", "text": "function enumerable$1(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) && !rule.required) {\n\t return callback();\n\t }\n\t\n\t rules.required(rule, value, source, errors, options);\n\t\n\t if (value !== undefined) {\n\t rules[ENUM$1](rule, value, source, errors, options);\n\t }\n\t }\n\t\n\t callback(errors);\n\t}", "title": "" }, { "docid": "9e7d0400645ef28adcd4e4c969638475", "score": "0.58202404", "text": "function enumerable(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) && !rule.required) {\n return callback();\n }\n _rule2.default.required(rule, value, source, errors, options);\n if (value) {\n _rule2.default[ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "716e7766f37ddba81eaa4a2ed54d46e9", "score": "0.58140665", "text": "function contains (value) {\n var node = list\n while (node) {\n if (node.value == value) {\n return true\n }\n node = node.next\n }\n return false\n}", "title": "" }, { "docid": "8014718e8b36dc755897be0857f1400f", "score": "0.58094686", "text": "function enumerable(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) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2['default'].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2['default'][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "2f29db6ad86f72354c7ea46dd8ee6319", "score": "0.5784474", "text": "contains(value) {\n let current = this.head;\n while (current !== null) {\n if (current.value === value) return true;\n current = current.next;\n }\n return false;\n }", "title": "" }, { "docid": "a6fc01383867564ee9a5466d27c304b4", "score": "0.5776334", "text": "function enumerable(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) && !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 (value) {\n\t\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t\t }\n\t\t }\n\t\t callback(errors);\n\t\t}", "title": "" }, { "docid": "59fa924661b50990302e5c6949e584ab", "score": "0.5774735", "text": "contains(value) {\n return this.values().indexOf(value) !== -1;\n }", "title": "" }, { "docid": "c042e25821c6d3d02462f52b59cc4642", "score": "0.57705843", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n rules.required(rule, value, source, errors, options);\n if (value) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "41186529ca4dccfba682dd4598034545", "score": "0.577036", "text": "function enumerable(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) && !rule.required) {\n return callback();\n }\n _rule2['default'].required(rule, value, source, errors, options);\n if (value) {\n _rule2['default'][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "9fe4a132a3d09108741248c1d39be934", "score": "0.57659984", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(__WEBPACK_IMPORTED_MODULE_0__util__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "901142e86aae61a44dedf1da09b4fcfb", "score": "0.5765929", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "901142e86aae61a44dedf1da09b4fcfb", "score": "0.5765929", "text": "function enumerable(rule, value, source, errors, options) {\n rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];\n if (rule[ENUM].indexOf(value) === -1) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_0__[\"format\"](options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));\n }\n}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(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) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(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) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(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) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "76b286d30a7cccee3f49159cb0fbc6fa", "score": "0.5761201", "text": "function enumerable(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) && !rule.required) {\n\t return callback();\n\t }\n\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t if (value) {\n\t _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n\t }\n\t }\n\t callback(errors);\n\t}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "1c00969f4d710703477b3145fe21850d", "score": "0.5754529", "text": "function enumerable$1(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) && !rule.required) {\n return callback();\n }\n\n rules.required(rule, value, source, errors, options);\n\n if (value !== undefined) {\n rules[ENUM$1](rule, value, source, errors, options);\n }\n }\n\n callback(errors);\n}", "title": "" }, { "docid": "8f078aae5b84e1b4d0e72e9e65a310b5", "score": "0.5725055", "text": "function enumerable(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) && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (value) {\n _rule2[\"default\"][ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "f1b9c6cbaab36b081cabdca9338fd600", "score": "0.57006836", "text": "contains(value) {\n let elem = this.head;\n let isFound = false;\n\n for (let i = 0; i < this.length; i++) {\n elem = elem.next;\n if (elem.value === value) {\n isFound = true;\n break;\n }\n }\n\n return isFound;\n }", "title": "" }, { "docid": "4502cdcbb2f4b25c605146536a788786", "score": "0.5669864", "text": "contains(val){\n var runner = this.head;//start runner (pointer to a node) at the beginning of the list\n //while loop to travel through the list\n while(runner != null){\n if(runner.value == val){\n return true;//value found - we'll return true\n }\n runner = runner.next;//moves the runner to the next node in the list \n }\n return false;//value is not in the list\n }", "title": "" }, { "docid": "eeccbb61a4f4c497a5f0a7583517010f", "score": "0.5656005", "text": "function contains(list, value, startIndex) {\n\n //differentiate between object and array\n if (Array.isArray(list)) {\n return (list.indexOf(value) === -1) ? false: true;\n } else {\n //is an object\n for (var key in list){\n if (list[key] === value) return true;\n }\n return false;\n\n }\n}", "title": "" }, { "docid": "b7b16f9171d41f443c9bb089a5ecb4be", "score": "0.56387705", "text": "function existsIn(num,lst){\n var i = 0;\n while(i < lst.length){\n if(lst[i] == num){\n return true;\n }\n i++;\n }\n return false;\n }", "title": "" }, { "docid": "872250b47578f7b41444fb14d0936f34", "score": "0.5626036", "text": "contains(val) {\n\n let runner = this.head;\n\n while (runner) {\n if (runner.val === val) return true;\n runner = runner.next;\n }\n return false;\n }", "title": "" }, { "docid": "200bf0df01cff0cc780ae2cec46ad902", "score": "0.5625629", "text": "function existsInList(item, list) {\n\t for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {\n\t var inList = list_1[_i];\n\t if (item == inList) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "title": "" }, { "docid": "f2bed96ac0697156c9b9c8e3ae5efd68", "score": "0.56246305", "text": "function enum_enumerable(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) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value) {\n es_rule[enum_ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "f2bed96ac0697156c9b9c8e3ae5efd68", "score": "0.56246305", "text": "function enum_enumerable(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) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value) {\n es_rule[enum_ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "f2bed96ac0697156c9b9c8e3ae5efd68", "score": "0.56246305", "text": "function enum_enumerable(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) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value) {\n es_rule[enum_ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "f2bed96ac0697156c9b9c8e3ae5efd68", "score": "0.56246305", "text": "function enum_enumerable(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) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (value) {\n es_rule[enum_ENUM](rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" } ]
188325a405c6da9b870aeb87f847e1c4
Fire up the select2 and the two datetimepickers.
[ { "docid": "c771034544ff34f4f265ec71d7b232af", "score": "0.52432287", "text": "componentDidMount() {\n\n // Fire up the select2 box.\n $('#comedians').select2({\n placeholder: \"Find your favourite comics! Click or type here.\",\n templateResult: (comic) => {\n if (comic.element) {\n return $('<span><img width=\"100\" height=\"100\" src=\"' + comic.element.attributes['data-src'].nodeValue + '\">&nbsp;&nbsp;' + comic.text + '</span>');\n }\n },\n templateSelection: (comic) => {\n if (comic.element) {\n return $('<span>&nbsp;<img width=\"60\" height=\"60\" title=\"' + '\" src=\"' + comic.element.attributes['data-src'].nodeValue + '\"></span>');\n }\n }\n });\n\n // If the finest date granularity we have is months, it makes server caching so much easier.\n $('#start_date').datetimepicker({\n format: 'MMMM YYYY',\n defaultDate: this.props.startDate*1000,\n });\n\n $('#end_date').datetimepicker({ \n format: 'MMMM YYYY',\n defaultDate: this.props.endDate*1000,\n });\n\n $('#start_date, #end_date').on('dp.change', () => { \n this.handleSearchFormChange(); \n });\n $('#comedians').on('change', () => { \n this.handleSearchFormChange(); \n });\n\n // Keeping the comedian search <ul> at the right height is\n // too dynamic and fiddly to implement with CSS alone. \n // We want the comedian selection list to halt 10px above the page bottom no matter what.\n $('#comedians').on('select2:open', (e) => { \n let comedianSelectBottom = 52 + parseInt($('.select2-container').css('height'));\n $('.select2-results__options').css('max-height', 'calc(100vh - ' + (comedianSelectBottom + 65) + 'px)');\n });\n }", "title": "" } ]
[ { "docid": "15c8fd0b93c0bf4314e0fda5d9a1564d", "score": "0.64029574", "text": "function apply_select2()\n{\n $('select:not(.not_appli)').select2()\n .on(\"opening\", function() {\n $( \".hasDatepicker\" ).datepicker(\"hide\");\n });\n}", "title": "" }, { "docid": "fe4eaae57bc8dc86a35421ea05cae37a", "score": "0.6158627", "text": "function handleDatePick() {\n \n}", "title": "" }, { "docid": "0b5e0449aaae488196e0a6853829fe1b", "score": "0.6132274", "text": "function setupDatePickers(callback) {\n createCalendarFields();\n callback();\n \n \n }", "title": "" }, { "docid": "f502af5f5c3a0f759ce47e9a167deaf9", "score": "0.61016715", "text": "function setDropdownChosenAndDatePickerAndDataTable() {\n bindChosenDDLMulitpleSelectEvent('ddlBusinessEntityId');\n bindChosenDDLMulitpleSelectEvent('ddlDriverOrTechnicianId');\n initializeDatePicker('txtRequiredDate');\n // data table section\n initializeDataTableEvent('dtPickingListSummary');\n hideTheSearchBarTheadDataTable(); \n}", "title": "" }, { "docid": "fa6123238e247eeb6dc5766f88a35c26", "score": "0.6083262", "text": "function applyDatePickers(wid) {\n\n var $start = $('#startDateId_' + wid);\n $start.datepicker();\n $start.datepicker('option', 'dateFormat', DATE_FORMAT);\n var $end = $('#endDateId_' + wid);\n $end.datepicker();\n $end.datepicker('option', 'dateFormat', DATE_FORMAT);\n }", "title": "" }, { "docid": "dfd6cbbb2799a6576a2f29a87a46616a", "score": "0.6014258", "text": "autocomplete() {\n $.get('/admin/v1/api/teams?selected='+$('#selected-team').val(), function(data) {\n $('#inputTeam').html(data)\n $('#inputTeam').chosen()\n })\n\n $('#inputTeam').on('change', function(event, params) {\n $.get('/admin/v1/api/teams/' + event.target.value, function(data) {\n $('#inputMembers').html(data)\n $('#inputMembers').chosen()\n $('#inputMembers').trigger('chosen:updated')\n })\n })\n\n $.get('/admin/v1/api/teams/' + $('#selected-team').val() +'?multiSelected='+$('#selected-teamMembers').val(), function(data) {\n $('#inputMembers').html(data)\n $('#inputMembers').chosen()\n $('#inputMembers').trigger('chosen:updated')\n })\n\n// campaigns edit for date\n $(\"#editInputFrom\").datetimepicker({\n format: 'DD-MM-YYYY hh:mm A',\n minDate:new Date($('#selected-editInputFrom').val()), \n });\n\n// campaigns edit for date\n $(\"#editInputTo\").datetimepicker({\n format: 'DD-MM-YYYY hh:mm A',\n });\n\n// calendar edit for date\n $(\"#editCalendarDate\").datetimepicker({\n format: 'DD-MM-YYYY',\n });\n\n//task edit date \n $(\"#editTaskFrom\").datetimepicker({\n format: 'DD-MM-YYYY',\n });\n\n\n// for date time\n $(\"#inputFromDateTimeCreate\").datetimepicker({\n format: 'DD-MM-YYYY hh:mm A',\n });\n\n $(\"#inputToDateTimeCreate\").datetimepicker({\n format: 'DD-MM-YYYY hh:mm A',\n useCurrent: false, \n });\n\n $(\"#CampaignEditInputFrom\").datetimepicker({\n format: 'DD-MM-YYYY hh:mm A',\n });\n\n $(\"#CampaignEditInputTo\").datetimepicker({\n format: 'DD-MM-YYYY hh:mm A',\n useCurrent: false, \n });\n\n if(typeof $('#selected-createInputDateTimeTo').val() !== 'undefined'){\n $('#inputToDateTimeCreate').data(\"DateTimePicker\").minDate(new Date($('#selected-createInputDateTimeTo').val()));\n }\n\n if(typeof $('#selected-CampaignEditInputTo').val() !== 'undefined'){\n $('#CampaignEditInputTo').data(\"DateTimePicker\").minDate(new Date($('#selected-CampaignEditInputTo').val()));\n }\n\n if(typeof $('#selected-editInputFrom').val() !== 'undefined'){\n $('#editInputTo').data(\"DateTimePicker\").minDate(new Date($('#selected-editInputFrom').val()));\n }\n\n $(\"#inputFromDateTimeCreate\").on(\"dp.change\", function (e) {\n $('#inputToDateTimeCreate').data(\"DateTimePicker\").minDate(e.date);\n });\n $(\"#inputToDateTimeCreate\").on(\"dp.change\", function (e) {\n $('#inputFromDateTimeCreate').data(\"DateTimePicker\").maxDate(e.date);\n });\n\n $(\"#editInputFrom\").on(\"dp.change\", function (e) {\n $('#editInputTo').data(\"DateTimePicker\").minDate(e.date);\n });\n $(\"#editInputTo\").on(\"dp.change\", function (e) {\n $('#editInputFrom').data(\"DateTimePicker\").maxDate(e.date);\n });\n\n $(\"#CampaignEditInputFrom\").on(\"dp.change\", function (e) {\n $('#CampaignEditInputTo').data(\"DateTimePicker\").minDate(e.date);\n });\n $(\"#CampaignEditInputTo\").on(\"dp.change\", function (e) {\n $('#CampaignEditInputFrom').data(\"DateTimePicker\").maxDate(e.date);\n });\n\n $('[data-chosen]').chosen()\n }", "title": "" }, { "docid": "719866c9379881219660f236cc5ad634", "score": "0.59840316", "text": "function init_picker() {\r\n $('.date_picker').datetimepicker({\r\n format: 'YYYY-MM-DD',\r\n });\r\n// $('.end_date_range').datetimepicker({\r\n// format: 'YYYY-MM-DD',\r\n//// useCurrent: false //Important! See issue #1075\r\n// });\r\n}", "title": "" }, { "docid": "9b3b3ddf0b74625fd3d581f9678abf72", "score": "0.59422123", "text": "function initializeSelect2ForCheckPointTypes() {\n $(\"#checkPointTypeSelect2\").select2({\n width: '90%',\n placeholder: 'Select checkpoints'\n });\n}", "title": "" }, { "docid": "d7a0244950a1aa3b9d95a99a02445ee4", "score": "0.58851516", "text": "function loadDateTimePicker() {\n loadAllDateTimePicker('#ref_date, #date_of_purchase', 1);\n loadAllDateTimePicker('#year_renovated_DP, #year_built_DP', 0);\n}", "title": "" }, { "docid": "3abbfc3ef7d5da4c9fa60aed11eb3dc9", "score": "0.58529323", "text": "function initializeSelect2ForCheckPoints() {\n $(\"#checkPointsSelect2\").select2({\n width: '90%',\n placeholder: 'Select checkpoints'\n });\n}", "title": "" }, { "docid": "0e4e1958da6f655c3cf5772d381c71b3", "score": "0.5839626", "text": "function scaleTimeDropDownList(paramTrendID){\n\t\t //alert(paramTrendID);\n\t\t //check selected option\n\t\tvar val1 = $(\"#paramScaleTime-\"+paramTrendID+\"\").val();\n\t\t$(\"select#scaleTime-\"+paramTrendID+\" option\").filter(function() {\n\t\t return $(this).val() == val1; \n\t\t}).prop('selected', true);\n\t\t\n\t\t\n\t \t\n\t \t\n\t \t$(\"#scaleTime-\"+paramTrendID+\"\").change(function(){\n\t \t\t\n\t \t\tif($(this).val()==\"Second\"){\n\t \t\t\t\n\t \t\t\t$(\".forSecondFormShow\").show();\n\t \t\t\t$(\".forSecondFormHide\").hide();\n\t \t\t\t\n\t \t\t\t\n\t \t\t\t$(\"#dateFrom-\"+paramTrendID+\"\").val($(\"#paramFromDate-\"+paramTrendID+\"\").val());\n\t \t\t\t$(\"#dateFrom-\"+paramTrendID+\"\").kendoDatePicker({\n\t \t\t\t\t format: \"yyyy-MM-dd\"\n\t \t\t\t });\n\t \t\t\t$(\"#dateTo-\"+paramTrendID+\"\").val($(\"#paramToDate-\"+paramTrendID+\"\").val());\n\t \t\t\t$(\"#dateTo-\"+paramTrendID+\"\").kendoDatePicker({\n\t \t\t\t\t format: \"yyyy-MM-dd\"\n\t \t\t\t });\n\t \t\t\t\n\t \t\t}else if($(this).val()==\"Month\"){\n\t \t\t\t\n\t \t\t\t$(\"#dateFrom-\"+paramTrendID+\"\").kendoDatePicker({\n\t \t\t\t\t format: \"yyyy-MM\"\n\t \t\t\t });\n\t \t\t\t$(\"#dateTo-\"+paramTrendID+\"\").kendoDatePicker({\n\t \t\t\t\t format: \"yyyy-MM\"\n\t \t\t\t });\n\t \t\t\t\n\t \t\t\t$(\".forSecondFormShow\").hide();\n\t \t\t\t$(\".forSecondFormHide\").show();\n\t \t\t\t\n\t \t\t}else{\n\t \t\t\t\n\t \t\t\t$(\".forSecondFormShow\").hide();\n\t \t\t\t$(\".forSecondFormHide\").show();\n\t \t\t\t\n\t \t\t\t\n\t \t\t\t$(\"#dateFrom-\"+paramTrendID+\"\").val($(\"#paramFromDate-\"+paramTrendID+\"\").val());\n\t \t\t\t$(\"#dateFrom-\"+paramTrendID+\"\").kendoDatePicker({\n\t \t\t\t\t format: \"yyyy-MM-dd\"\n\t \t\t\t });\n\t \t\t\t$(\"#dateTo-\"+paramTrendID+\"\").val($(\"#paramToDate-\"+paramTrendID+\"\").val());\n\t \t\t\t$(\"#dateTo-\"+paramTrendID+\"\").kendoDatePicker({\n\t \t\t\t\t format: \"yyyy-MM-dd\"\n\t \t\t\t });\n\t \t\t}\n\t \t\t\n\t \t});\n\t \t\n\t \t$(\"#scaleTime-\"+paramTrendID+\"\").change();\n\t}", "title": "" }, { "docid": "32e5557a462e20237a845aa8bd639094", "score": "0.5820791", "text": "function select2Init() {\n $(\".select2\").select2();\n}", "title": "" }, { "docid": "9eb3128bae0121a6f104ecfae94620fc", "score": "0.5807791", "text": "function bindSelect2s() {\n $('select.select_2').each(function(i,e) {\n var placeholder = $(this).data(\"placeholder\");\n if (typeof(placeholder)!='undefined') {\n $(this).select2({\n placeholder: placeholder\n });\n } else {\n $(this).select2();\n }\n });\n}", "title": "" }, { "docid": "f1137317b444943f1756f9680a9c86cf", "score": "0.57994163", "text": "function changeBothDate(start, end) {\n changeBothDateFinished = false;\n startDatePicker.value(start);\n changeBothDateFinished = true;\n endDatePicker.value(end);\n}", "title": "" }, { "docid": "12edca03f0b49a0675a7d29b78568c8f", "score": "0.5708576", "text": "function initDatePickers() {\n $(\".valid-to\" ).datepicker({\n minDate: 1,\n defaultDate: \"+1w\",\n dateFormat: \"yy-mm-dd\",\n changeMonth: true,\n changeYear: true\n });\n $( \"#from\" ).datepicker({\n defaultDate: \"+1w\",\n changeMonth: true,\n numberOfMonths: 3,\n dateFormat: \"yy-mm-dd\",\n onClose: function( selectedDate ) {\n $( \"#to\" ).datepicker( \"option\", \"minDate\", selectedDate );\n }\n }, \"setDate\", new Date());\n $( \"#to\" ).datepicker({\n defaultDate: \"+1w\",\n changeMonth: true,\n numberOfMonths: 3,\n dateFormat: \"yy-mm-dd\",\n onClose: function( selectedDate ) {\n $( \"#from\" ).datepicker( \"option\", \"maxDate\", selectedDate );\n }\n });\n}", "title": "" }, { "docid": "1d8ce53b1512c1aa0284a5b0a6c5fbef", "score": "0.56471115", "text": "function synchronizePickers() {\n // update 'from' date picker only if not currently open\n // and 'from' is updating (ie. contains 'now')\n if (!fromPicker || !fromPicker.data('daterangepicker').isShowing) {\n fromPicker = $(this.$el).find('[data-role=from-picker]').daterangepicker(\n $.extend({\n startDate: dateMath.parse(this.editRawFrom)\n }, pickerOptions),\n onPickerApply.bind(this, 'editRawFrom')\n );\n }\n // update 'to' date picker only if not currently open\n // and 'to' is updating (ie. contains 'now')\n if (!toPicker || !toPicker.data('daterangepicker').isShowing) {\n toPicker = $(this.$el).find('[data-role=to-picker]').daterangepicker(\n $.extend({\n startDate: dateMath.parse(this.editRawTo),\n minDate: dateMath.parse(this.editRawFrom)\n }, pickerOptions),\n onPickerApply.bind(this, 'editRawTo')\n );\n }\n }", "title": "" }, { "docid": "5a0c7d08fabb11ce8119d437e50967c9", "score": "0.5605046", "text": "function setDatePickerToItemServiceField() {\n\t\t$(\".datetimepicker2\").datetimepicker({\n\t\t\tlanguage: 'en',\n\t\t\tformat: 'dd-mm-yyyy hh:mm:ss',\n\t\t\tpick12HourFormat: true,\n\t\t//\tautoclose: true,\n\t\t\t//\tdefaultDate: new Date()\n\t\t}).on('changeDate', function(){\n\t\t\t//hide datetimepicker\n\t\t\t $(this).datetimepicker('hide');\n\t\t});;\n\t}", "title": "" }, { "docid": "186c8723739e72e7f92b92e25d2c2086", "score": "0.55800843", "text": "function loadRideInfo\n(\n res\n)\n{ \n var date = $.getDateTime.formatDate(res.dt);\n var time = $.getDateTime.formatTime(res.dt);\n var currentDate = new Date().getTime(); \n var rideDate = new Date(res.dt).getTime();\n if(rideDate < currentDate)\n {\n time = $.getDateTime.formatTime(new Date());\n } \n \n // remove error class\n $('#editRideForm').find('input').each(function(){\n if($(this).hasClass('error'))\n {\n $(this).removeClass('error');\n }\n });\n $('#editRideDateTime').val(date);\n $('#editRideTime').val(time);\n $(\"#editRideDateTime\").datePicker(date); \n $(\"#editRideTime\").timePicker(time); \n $('#editRideViaLocation').val(res.via); \n $('#editRideSeat').select2('val',res.seats); \n $('#editRideNote').val(res.note);\n $('#editRideBagSize').val(res.bagSize);\n $('#editRideBagSizeSelect').select2('val',res.bagSize);\n $('#editBags').val(res.bags);\n \n if(res.startType == ADDRESS_START)\n {\n \n if($('#editRideToAddress').hasClass('isShown'))\n {\n $(\"#startEditRideSelect,#startEditRideInput\").toggleClass('hide');\n $(\"#toEditRideInput,#toEditRideSelect\").toggleClass('hide'); \n $('#startEditRideInput #editRideFromAddress').toggleClass('ignore');\n $(\"#toEditRideInput #editRideToAddress\").toggleClass('ignore'); \n $(\"#editRideStartLocation,#editRideFromAddress\").toggleClass(\n 'isShown');\n $(\"#editRideToAddress,#editRideToStartLocation\").toggleClass(\n 'isShown'); \n }\n airportName = res.to;\n driverAddress = res.start;\n $(\"#editRideFromAddress\").val(res.start);\n $(\"#editRideToStartLocation\").select2('val',res.to); \n $('#startLabel').html('Address');\n $('#toLabel').html('Airport');\n }\n else if(res.startType == AIRPORT_START)\n { \n if($('#editRideFromAddress').hasClass('isShown'))\n {\n $(\"#startEditRideSelect,#startEditRideInput\").toggleClass('hide'); \n $(\"#toEditRideInput,#toEditRideSelect\").toggleClass('hide'); \n $(\"#startEditRideInput #editRideFromAddress\").toggleClass('ignore');\n $(\"#toEditRideInput #editRideToAddress\").toggleClass('ignore'); \n $(\"#editRideStartLocation,#editRideFromAddress\").toggleClass(\n 'isShown');\n $(\"#editRideToAddress,#editRideToStartLocation\").toggleClass(\n 'isShown'); \n }\n airportName = res.start;\n driverAddress = res.to;\n $('#editRideStartLocation').select2('val',res.start); \n $('#editRideToAddress').val(res.to); \n $('#startLabel').html('Airport');\n $('#toLabel').html('Address'); \n }\n \n var isSmoker = res.smoker==1 ? 'checked' : ''; \n $('#smoker').prop('checked',isSmoker);\n \n $( \"#editRideLocation\" ).getSlider('editRideRange',' Miles');\n $( \"#editRidePriceSlider\" ).getSlider('editRidePriceRange',null,'$',0.01);\n var price = getPriceForRide(airportName,driverAddress,$('#maxDistance').text());\n $('#editRidePriceSlider').slider(\"option\",\"max\",price);\n $('#editRidePriceSlider').slider(\"option\",\"disabled\",false);\n $('#editRidePriceRange').html(res.contribution);\n $( \"#editRidePriceSlider\" ).slider( \"value\",res.contribution );\n $(\"#editRideLocation\").slider( \"value\",res.maxMiles);\n $( \"#editRideRange\" ).html( $( \"#editRideLocation\" ).slider( \"value\" ) + \n ' Miles');\n $( \"#editRidePriceRange\" ).html( '$'+res.contribution ); \n $('#maxPrice').html(price);\n \n // add the validation method and rules\n $.validator.addMethod('minStrict', function (value, el, param) {\n var newDateTime = $('#editRideDateTime').val()+' '+\n $('#editRideTime').val();\n value = new Date(newDateTime).getTime();\n return value > param;\n }); \n $('#editRideTime').rules( \"add\", {\n required: true,\n minStrict: new Date().getTime(),\n messages: {\n required: \"Please enter time\",\n minStrict: jQuery.format(\"Time should be greater than current time\")\n }\n });\n}", "title": "" }, { "docid": "dd77442de038cf2d1e7a2e14ba358cab", "score": "0.5556532", "text": "function observers () {\n select2_observers();\n datepicker_observer();\n masks_observer();\n default_on_click();\n}", "title": "" }, { "docid": "e6ca523142022edb985ea1728c45d2bb", "score": "0.5542181", "text": "function initialiseDatepickers() {\n\t\tvar initalD = new Date(datetimeStart);\n\t\tinitalD.setMinutes(0);\n\t\tvar datepickerOptions = {\n\t\t\tweekStart: 1,\n\t\t\tautoclose: 1,\n\t\t\ttodayHighlight: 1,\n\t\t\tinitialDate: initalD,\n\t\t\tstartView: 2,\n\t\t\tpickerPosition: \"bottom-left\",\n\t\t\tmaxView: 3,\n\t\t\tminView: 1\n\t\t};\n\t\tvar dp_from = $('#dtpicker-from').datetimepicker(datepickerOptions);\n\t\tvar dp_to = $('#dtpicker-to').datetimepicker(datepickerOptions);\n\t\tdp_from.on('changeDate', function(ev) {\n\t\t\tdatetimeStart = Date.parse(ev.date) + ev.date.getTimezoneOffset() * 60000;\n\t\t});\n\t\tdp_to.on('changeDate', function(ev) {\n\t\t\tdatetimeEnd = Date.parse(ev.date) + ev.date.getTimezoneOffset() * 60000;\n\t\t});\n\n\t\t$(\"#table-load\").click(function() {\n\t\t\tvar thisBtn = $(this);\n\t\t\tthisBtn.button('loading');\n\t\t\tModel.ApiConnector.getHistoricalDataValues(datetimeStart, datetimeEnd, \"json\", function(feed) {\n\t\t\t\tvar failureGUI = $(\"#history-failed\");\n\t\t\t\tif(feed === undefined || feed.datapoints.length === 0) {\n\t\t\t\t\tfailureGUI.show();\n\t\t\t\t} else {\n\t\t\t\t\tfailureGUI.hide();\n\t\t\t\t\tsetHistoryTableTitle();\n\t\t\t\t\tdraw(feed);\n\t\t\t\t}\n\t\t\t\tthisBtn.button('reset');\n\t\t\t});\n\t\t});\n\n\t\t$(\"#export button\").click(function() {\n\t\t\tvar format = $(\"#export input[type=radio]:checked\").val();\n\t\t\twindow.open(Model.ApiConnector.buildApiUrl(\".\" + format + \"?datetimeStart=\" + datetimeStart + \"&datetimeEnd=\" + datetimeEnd));\n\t\t});\n\n\t\tsetHistoryTableTitle();\n\t}", "title": "" }, { "docid": "c5b703cde26e2d13f1b5e9a2f478b7ef", "score": "0.55374396", "text": "function initSelect2() {\n if ($('.select2').length > 0) {\n $.each($('.select2'), function (index) {\n\n $(this).select2({\n// data: newOptions,\n placeholder: $(this).attr('data-placeholder'),\n allowClear: true,\n minimumInputLength: 0,\n ajax: {\n quietMillis: 200,\n url: $(this).attr('data-url'),\n dataType: 'json',\n data: function (params) {\n return {\n q: $.trim(params.term)\n };\n },\n processResults: function (data) {\n return {\n results: data\n };\n },\n cache: true\n }\n });\n });\n }\n}", "title": "" }, { "docid": "486a816d15fe8d877f64b7fa0ad265df", "score": "0.5531577", "text": "function selectTodos(select) {\r\n $('#' + select + ' option').prop('selected', true);\r\n $('#' + select + '').change();\r\n $('#' + select + '').trigger('change.select2');\r\n}", "title": "" }, { "docid": "db95f8b390a770d010dcc797567c5654", "score": "0.552927", "text": "function tpl_select2_init(){\n\t\t$('body .tpl-dt-select').each(function(){\n\t\t\tif ( $(this).has('.select2').length < 1 && !$(this).hasClass('no-select2') && !$(this).parents('#tpl_repeater_bank').length ) {\n\n\t\t\t\tif ( $(this).is('.tpl-dt-font_awesome') ) {\n\t\t\t\t\t$(this).find('select').select2( fa_icon_settings );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$(this).find('select').select2( select2_settings );\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "13a5c276444c9ac8cda43727cf5e14eb", "score": "0.55097014", "text": "function selectDate(id){\r\n \r\n var selectedmonth = $(\"#select2-selFrmDatMon-container\").text();\r\n var selectedyear = $(\"#select2-selFrmDatYr-container\").text();\r\n var x = $(\"#select2-selFrmDatMon-container\").title;\r\n var size=31;\r\n if(selectedmonth=='December'||selectedmonth=='October'||selectedmonth=='August'||selectedmonth=='July'||selectedmonth=='May'||selectedmonth=='March'||selectedmonth=='January')\r\n {\r\n size=31;\r\n $(\"#select2-selFrmDatToDate-container\").text(\"1\");\r\n }\r\nelse if(selectedmonth=='April'||selectedmonth=='June'||selectedmonth=='September'||selectedmonth=='November')\r\n {\r\n size=30;\r\n $(\"#select2-selFrmDatToDate-container\").text(\"1\");\r\n }\r\n else if(selectedmonth='February') \r\n { var isLeap = new Date(selectedyear1, 1, 29).getMonth() == 1\r\n \r\n if(isLeap)\r\n {\r\n size=29;\r\n $(\"#select2-selFrmDatToDate-container\").text(\"1\");\r\n }\r\n else\r\n {\r\n size=28;\r\n $(\"#select2-selFrmDatToDate-container\").text(\"1\");\r\n }\r\n \r\n }\r\n else\r\n {\r\n \r\n }\r\n var htmlVardatef = \"\";\r\n \r\n \r\n \r\n for(var i=1;i<=size;i++){\r\n htmlVardatef += \"<option id='selFrmDatToDate\"+i+\"' value='\"+i+\"'>\"+i+\"</option>\";\r\n }\r\n \r\n $(\"#\"+id).html(\"\");var date=\"01\"\r\n $(\"#\"+id).append(htmlVardatef);\r\n parent.$(\"#selFrmDatToDate\" +date).prop(\"selected\", \"true\");\r\n \r\n }", "title": "" }, { "docid": "a9b1e90180a9802bef8fd62f91f9b919", "score": "0.5504381", "text": "function pick_date(){\n/* 284 */ \t\t//Date picker de data inicial\n/* 285 */ \t\te.cal_start.datePicker({\n/* 286 */ \t\t\tinline: \t\t\t\ttrue,\n/* 287 */ \t\t\tstartDate:\t\t\t\t$.i18n._(\"lang_start_date\"),\n/* 288 */ \t\t\tshowYearNavigation: \tfalse\n/* 289 */ \t\t}).bind('dateSelected', function(evt, selectedDate, $td){\n/* 290 */ \t\t\tvar f = e.cal_end.dpGetSelected();\n/* 291 */ \t\t\te.cal_end.dpSetStartDate(selectedDate.asString());\n/* 292 */ \t\t\tif(!f[0] || f[0]< selectedDate){\n/* 293 */ \t\t\t\te.cal_end.dpSetSelected(selectedDate.asString(), false);\n/* 294 */ \t\t\t}\n/* 295 */ \t\t\te.cal_end.dpRerenderCalendar();\n/* 296 */ \t\t\t\n/* 297 */ \t\t\t//atualiza campo de data\n/* 298 */ \t\t\tupdate_date();\n/* 299 */ \t\t});\n/* 300 */ \t\t\n\n/* datepickerrange.js */\n\n/* 301 */ \t\t//Date picker de data Final\n/* 302 */ \t\te.cal_end.datePicker({\n/* 303 */ \t\t\tinline: \t\t\t\ttrue,\n/* 304 */ \t\t\tstartDate:\t\t\t\t$.i18n._(\"lang_start_date\"),\n/* 305 */ \t\t\tshowYearNavigation: \tfalse\n/* 306 */ \t\t}).bind('dateSelected', function(evt, selectedDate, $td){\n/* 307 */ \t\t\t//atualiza campo de data\n/* 308 */ \t\t\tupdate_date();\n/* 309 */ \t\t});\n/* 310 */ \t}", "title": "" }, { "docid": "273476dc9884276607ffc2e3344545de", "score": "0.54946977", "text": "function load_task_date(){ \n\tif($('.plan_type_sel').val() == 'P'){\n\t\t\t// remove time picker\n\t\t\t$('.tsk_time').removeClass('tsk_timepicker');\n\t\t\t$('.tsk_time').timepicker('remove');\n\t\t\t// add date picker\n\t\t\t$('.tsk_time').addClass('datepick_tsk');\n\t\t\tcall_datepicker();\t\t\t\n\t\t}else{\n\t\t\t// remove date picker\n\t\t\t$('.tsk_time').removeClass('datepick_tsk');\n\t\t\t$('.tsk_time').datepicker('remove');\n\t\t\t// add time picker\n\t\t\t$('.tsk_time').addClass('tsk_timepicker');\n\t\t\ttimePicker();\t\t\t\n\t}\n}", "title": "" }, { "docid": "0b84cc155134f4c533383fa2b9c0d4da", "score": "0.5451016", "text": "function prepareInputs(start_date, min_date, max_date){\n var options = {\n format:'d.m.Y',\n formatDate:'d.m.Y',\n startDate: start_date, \n minDate: min_date, \n maxDate: max_date, \n timepicker: false, \n validateOnBlur: false,\n closeOnDateSelect: true};\n var start_date_options = $.extend({}, options, {value: start_date});\n $('#id_start_date').datetimepicker(start_date_options);\n $('#id_end_date').datetimepicker(options);\n amount_formatter();\n}", "title": "" }, { "docid": "714ed18cbba57829622b41f9e5236485", "score": "0.54443973", "text": "function setDefaultTimeOnDateSelection() {\n\n //To get the selected date\n var selectedDate = document.getElementById('bdate').value;\n selectedDate = selectedDate.replace(/-/g, '');\n\n //To get the system date\n var date = new Date();\n var day = date.getDate();\n var month = date.getMonth() + 1;\n var year = date.getFullYear();\n\n if (day <= 9) {\n day = '0' + day;\n }\n if (month <= 9) {\n month = '0' + month;\n }\n var systemDate = \"\" + day + month + year;\n\n //Added condition to check systemDate and selected date is same or not\n if (selectedDate == systemDate) {\n setDefaultStartAndEndTime();\n } else {\n $('#timepicker1').timepicker().val('09:00');\n $('#timepicker2').timepicker().val('09:15');\n }\n}", "title": "" }, { "docid": "9731cedd0fe6038efb6b592491ec7ad6", "score": "0.54282427", "text": "function dayUpdate() {\n\n // acquire days\n var days = extendWithPlaceholder(getDayObjData(month, year));\n\n // clear and set new data\n dayObj.empty().select2({\n data: days,\n allowClear: true,\n placeholder: dayPlaceholder\n });\n\n // select previously selected day if day is in available range\n // or select day 1\n if(day > dayInMonthCount) {\n day = 1;\n }\n\n dayObj.val(day).trigger('change');\n }", "title": "" }, { "docid": "fff46902269839dd005c0fe3ad52e60c", "score": "0.5415467", "text": "function runAllForms(){$.fn.slider&&$(\".slider\").slider(),$.fn.select2&&$(\".select2\").each(function(){var a=$(this),b=a.attr(\"data-select-width\")||\"100%\";a.select2({allowClear:!0,width:b}),a=null}),$.fn.mask&&$(\"[data-mask]\").each(function(){var a=$(this),b=a.attr(\"data-mask\")||\"error...\",c=a.attr(\"data-mask-placeholder\")||\"X\";a.mask(b,{placeholder:c}),a=null}),$.fn.autocomplete&&$(\"[data-autocomplete]\").each(function(){var a=$(this),b=a.data(\"autocomplete\")||[\"The\",\"Quick\",\"Brown\",\"Fox\",\"Jumps\",\"Over\",\"Three\",\"Lazy\",\"Dogs\"];a.autocomplete({source:b}),a=null}),$.fn.datepicker&&$(\".datepicker\").each(function(){var a=$(this),b=a.attr(\"data-dateformat\")||\"dd.mm.yy\";a.datepicker({dateFormat:b,prevText:'<i class=\"fa fa-chevron-left\"></i>',nextText:'<i class=\"fa fa-chevron-right\"></i>'}),a=null}),$(\"button[data-loading-text]\").on(\"click\",function(){var a=$(this);a.button(\"loading\"),setTimeout(function(){a.button(\"reset\")},3e3),a=null})}", "title": "" }, { "docid": "cfc6ad3a49e89f062a64dc52c0b24c0d", "score": "0.54112595", "text": "_dateChanged(e) {\n this.selectedDate = new Date(e.target.modelValue);\n this.selectedDate = this.selectedDate.toLocaleDateString('en-CA');\n this.showTimeSlotDropdown = false;\n }", "title": "" }, { "docid": "a14ce196cf6963e4ca8a0298be03e38c", "score": "0.54042363", "text": "function coursesSelect2() {\n $(\"#materiaProf\").select2({\n dropdownParent: newModalCt,\n width: \"100%\"\n });\n}", "title": "" }, { "docid": "fcf56b0155da758e20a7c81cca918aae", "score": "0.5395586", "text": "function courseTeachersSelect2() {\n $(\"#docenteMat\").select2({\n dropdownParent: newModalRc,\n width: \"100%\"\n });\n}", "title": "" }, { "docid": "3756483664b799299c4f50e824784f85", "score": "0.5380704", "text": "function setRangeTime(selector, time) {\n\t// get <select> tags and attach appropriate values from click event\n\tvar components = $('#range-' + selector + ' .date-selector').children();\n\tvar hours = to12Hour(time.getHours());\n\tcomponents[0].value = days[time.getDay()];\n\tcomponents[1].value = hours.hours;\n\tcomponents[2].value = minutesToString(time.getMinutes());\n\tcomponents[3].value = hours.cycle;\n}", "title": "" }, { "docid": "98156a7e7b8deaebd7f51eec8e1de5aa", "score": "0.53763175", "text": "function tdf_select2() {\r\n $('.video-library-select').select2({\r\n placeholder: \"All videos\",\r\n minimumResultsForSearch: Infinity\r\n }); \r\n }", "title": "" }, { "docid": "7c1c5ca2ee9e59c75bf705a0f62119d0", "score": "0.53621066", "text": "function initializeSelectors(){\n $('#from__selector').awselect({\n background: \"transparent\", //the dark blue background\n active_background: \"none\", // the light blue background\n placeholder_color: \"#f8f8f8\", // the light blue placeholder color\n placeholder_active_color: \"#f2c649\", // the dark blue placeholder color\n option_color: \"#f8f8f8\", // the option colors\n vertical_padding: \"3px\", //top and bottom padding\n horizontal_padding: \"0\", // left and right padding,\n immersive: true\n });\n $('#to__selector').awselect({\n background: \"transparent\", //the dark blue background\n active_background: \"none\", // the light blue background\n placeholder_color: \"#f8f8f8\", // the light blue placeholder color\n placeholder_active_color: \"#f2c649\", // the dark blue placeholder color\n option_color: \"#f8f8f8\", // the option colors\n vertical_padding: \"3px\", //top and bottom padding\n horizontal_padding: \"0\", // left and right padding,\n immersive: true\n }); \n }", "title": "" }, { "docid": "b7398b6555e53c69e6415ec5ef7b0f3c", "score": "0.53520876", "text": "function seleccion()\n { \n $(\".select\").addClass('selectbootstrap').select2();\n\n $('.selectbootstrap').selectpicker(\n {\n style: 'btn-info',\n size: 4\n });\n\n }", "title": "" }, { "docid": "8313a62745a4db24da230f59539a8226", "score": "0.5340858", "text": "function autocomplete(from, to) {\n if (from.val() != \"\") {\n var valor = from.val();\n $('#' + to).val(valor).trigger('change.select2');\n }\n else {\n $('#' + to).val(null).trigger('change.select2');\n }\n}", "title": "" }, { "docid": "607c273709e967b73b68be4f0b1c1676", "score": "0.533377", "text": "function on_timeslider_change(event, element) {\n start_date = new Date(parseInt($('select#start').val()) * 1000);\n end_date = new Date(parseInt($('select#end').val()) * 1000);\n\n start_str = start_date.getDate() + \"-\" + (start_date.getMonth() + 1) + \"-\" + start_date.getFullYear();\n end_str = end_date.getDate() + \"-\" + (end_date.getMonth() + 1) + \"-\" + end_date.getFullYear();\t\n\t$( \"#date_slider_value\" ).text( \"From \" + start_str + \" to \" + end_str );\n}", "title": "" }, { "docid": "0de53079375d59e232e86128a9ddfcf3", "score": "0.53280956", "text": "function populateSelectDropdown(){\n $.fn.select2.defaults.set( \"theme\", \"bootstrap4\" ); // ensure select2(for dropdown) is using Bootstrap4\n\n // generate all_user_id options for dropdown\n for(i=1; i<=noOfUsers; i++){\n var idName = prefix + i;\n allUserIDs.push(idName);\n idName = \"\"\n }\n // populate select2 dropdown with all_user_ids\n $(\"#UserId\").select2();\n $(\"#UserId\").select2({\n data: allUserIDs });\n $('#UserId').select2({\n placeholder:'Select a User ID'\n })\n // on selection/data-value change invoke other functions\n $('#UserId').on('change', function() {\n USERID = $(\"#UserId option:selected\").text();\n // FN CALLS\n toggleOptions()\n showStartTestDiv()\n })\n }", "title": "" }, { "docid": "5789670163ed6d08778b2fe6bd3d5d03", "score": "0.53122187", "text": "onSelectedEndDate(date) {\n this.value.end_date = date;\n this.$emit('input', {\n start_date: formatDate(this.value.start_date, 'YYYY-MM-DD'),\n end_date: formatDate(date, 'YYYY-MM-DD')\n });\n }", "title": "" }, { "docid": "d9bd4e3ad5d9ad57245b55e5608b3447", "score": "0.5304945", "text": "function Selection2(idDropdownlist) {\n\n $(\"#\" + idDropdownlist).select2({\n allowClear: true,\n width: '100%',\n height: '34px'\n //data: data\n });\n}", "title": "" }, { "docid": "2b3ac554484b003471d6a5fdbcc46c2f", "score": "0.5300491", "text": "function renderDateTimePicker(from, to, force) {\n if (!$('#timechange').length || force == true) {\n var maxDateTime = new Date();\n // set to midnight of current day\n maxDateTime.setHours(23,59,59,999);\n $('#graphheader').html(\"<table width='100%'><tr><td width='20%'></td><td width='60%' align='center'>\" +\n \"<input size=19 id=timefrom class=hasDatePicker \" +\n \"type=text name=timefrom value='\" + ISODateString(from) + \"'> to \" +\n \"<input size=19 id=timeto class=hasDatePicker \" +\n \" type=text name=timeto value='\" + ISODateString(to) + \"'> \" +\n \"<button id='timechange' style='visibility: hidden' \" +\n \"<td width='20%' align='right'>Graph Granularity <select name='barspan' id=barspan style='width: 100px'><option value='100'>Low</option><option value='10'>Medium</option><option value='1'>High</option></select></td></tr></table>\"\n );\n \n if(window.hashjson.barspan == undefined)\n\t window.hashjson.barspan = '10';\n\n\t $('#barspan').val(window.hashjson.barspan);\n\n $('#timefrom').datetimepicker({\n showSecond: true,\n timeFormat: 'hh:mm:ss',\n dateFormat: 'yy-mm-dd',\n separator: 'T',\n maxDate: maxDateTime,\n maxDateTime: maxDateTime,\n onSelect: function (dateText, inst) {\n // Work arround bug: /jQuery-Timepicker-Addon/issues/302\n if ($('#timeto').val() != '') {\n $('#timeto').datetimepicker('setDate',\n $('#timeto').val());\n }\n var tFrom = $(this).datetimepicker('getDate').getTime();\n var tTo = $('#timeto').datetimepicker('getDate').getTime();\n var now = new Date().getTime();\n if (tFrom > now-(1000*60)) {\n // set timeto to now and timefrom to now - 1 min\n $('#timeto').datetimepicker('setDate', (new Date(now)));\n $('#timefrom').datetimepicker('setDate',\n (new Date(now-60*1000)));\n } else if (tFrom > tTo-(1000*60)) {\n // set timeto to min(now, timefrom + 15 min)\n $('#timeto').datetimepicker('setDate',\n (new Date(Math.min(now, tFrom+(15*60*1000)))));\n }\n $('#timechange').css('visibility', 'visible');\n $('#timeinput').val('custom');\n }\n });\n\n $('#timeto').datetimepicker({\n showSecond: true,\n timeFormat: 'hh:mm:ss',\n dateFormat: 'yy-mm-dd',\n separator: 'T',\n maxDate: maxDateTime,\n maxDateTime: maxDateTime,\n onSelect: function (dateText, inst) {\n if ($('#timefrom').val() != '') {\n $('#timefrom').datetimepicker('setDate',\n $('#timefrom').val());\n }\n var tTo = $(this).datetimepicker('getDate').getTime();\n var tFrom = $('#timefrom').datetimepicker('getDate').getTime();\n var now = new Date().getTime();\n if (tTo > now) {\n // set timeto to now\n $('#timeto').datetimepicker('setDate', (new Date(now)));\n } else if (tFrom > tTo) {\n // set timefrom to timeto - 15 min\n $('#timefrom').datetimepicker('setDate',\n (new Date(tTo-15*60*1000)));\n }\n $('#timechange').css('visibility', 'visible');\n $('#timeinput').val('custom');\n }\n });\n\n $('#timefrom,#timeto').change(function () {\n $('#timechange').css('visibility', 'visible');\n $('#timeinput').val('custom');\n $('#timeinput').change();\n });\n\n // Give user a nice interface for selecting time ranges\n $(\"#timechange\").click(function () {\n var time = {\n \"from\": ISODateString(Date.parse($('#timefrom').val())-window.tOffset),\n \"to\": ISODateString(Date.parse($('#timeto').val())-window.tOffset)\n };\n window.hashjson.offset = 0;\n window.hashjson.time = time;\n window.hashjson.timeframe = \"custom\";\n setHash(window.hashjson);\n });\n \n $('#barspan').change(function () {\n window.hashjson.barspan = $(this).val();\n\t setHash(window.hashjson);\n\t });\n }\n}", "title": "" }, { "docid": "8e8c4b8f6e94168bcbd3c432aee54796", "score": "0.5288405", "text": "function addDateTimePicker() {\r\n if ($.timepicker != undefined) {\r\n $('input.datefield, input.datetimefield').each(function() {\r\n PMA_addDatepicker($(this));\r\n });\r\n }\r\n}", "title": "" }, { "docid": "7155de30a8fd4d29dfe98753517b5017", "score": "0.52793086", "text": "function update() {\n\t\tselect.bindEvents( $( this ) );\n\t}", "title": "" }, { "docid": "fb69864d255fd658143b00261edb9d9f", "score": "0.52777195", "text": "function wdtApplyBootstrapElements() {\n $('.wdt-constructor-column-type').selectpicker();\n $('.wdt-constructor-date-input-format').selectpicker();\n $('.wdt-constructor-possible-values').tagsinput({\n tagClass: 'label label-primary'\n });\n }", "title": "" }, { "docid": "d2bebf67474e1995c253a16e092a2608", "score": "0.5269597", "text": "function handleDateChange() {\n if (changeBothDateFinished) {\n console.log($('#start-date').val());\n console.log($('#end-date').val());\n let startDate = parseDate($('#start-date').val(), DAYTIME.START);\n let endDate = parseDate($('#end-date').val(), DAYTIME.END);\n orderFilters.set(ORDER_CONSTANT.DATETIME, item => {\n return startDate <= item.datetime && item.datetime <= endDate;\n });\n renderOrderList(orders, orderFilters);\n }\n}", "title": "" }, { "docid": "73b8dca6e4a3b766a63bbd1465259fb2", "score": "0.5250894", "text": "function filterTrigger(filter1, filter2) {\n filter1.toggleClass(\"show\").toggleClass(\"hide\");\n filter2.toggleClass(\"hide\").toggleClass(\"show\");\n setTimeout(function () {\n $('.select_style').trigger('refresh');\n }, 1)\n}", "title": "" }, { "docid": "7adfa2f8d59b9e395743b1525ccd0a0d", "score": "0.52466667", "text": "function overrideSelect2Functions() {\n // Added proprty to avoid duplicate check while initialization.\n window.Select2.class.multi.prototype.skipDuplicateCheck = true;\n // This is a workaround to resolve performance issue with select2\n window.Select2.class.multi.prototype.updateSelection = function (data) {\n var ids = [], filtered = [], self = this;\n \n if(!window.Select2.class.multi.prototype.skipDuplicateCheck) {\n // filter out duplicates\n $(data).each(function () {\n if (indexOf(self.id(this), ids) < 0) {\n ids.push(self.id(this));\n filtered.push(this);\n }\n });\n data = filtered;\n }\n\n this.selection.find(\".select2-search-choice\").remove();\n $(data).each(function () {\n self.addSelectedChoice(this);\n });\n self.postprocessResults();\n };\n \n // This is a workaround to resolve performance issue with select2\n window.Select2.class.multi.prototype.setVal = function (val) {\n var unique;\n if (this.select) {\n this.select.val(val);\n } else {\n unique = [];\n if(!window.Select2.class.multi.prototype.skipDuplicateCheck) {\n // filter out duplicates\n $(val).each(function () {\n if (indexOf(this, unique) < 0) unique.push(this);\n });\n \n this.opts.element.val(unique.length === 0 ? \"\" : unique.join(this.opts.separator));\n } \n }\n }\n // This is a workaround to resolve performance issue with select2\n function indexOf(value, array) {\n var i = 0, l = array.length;\n for (; i < l; i = i + 1) {\n if (equal(value, array[i])) return i;\n }\n return -1;\n }\n\n // This is a workaround to resolve performance issue with select2\n function equal(a, b) {\n if (a === b) return true;\n if (a === undefined || b === undefined) return false;\n if (a === null || b === null) return false;\n // Check whether 'a' or 'b' is a string (primitive or object).\n // The concatenation of an empty string (+'') converts its argument to a string's primitive.\n if (a.constructor === String) return a+'' === b+''; // a+'' - in case 'a' is a String object\n if (b.constructor === String) return b+'' === a+''; // b+'' - in case 'b' is a String object\n return false;\n }\n }", "title": "" }, { "docid": "3c3e152c9038550399ce438a835939e7", "score": "0.523776", "text": "function initializeDatetimePicker() {\n \n\n $('[data-rel=datepicker]').datepicker({\n format: 'dd/mm/yyyy',\n autoclose: true,\n todayHighlight: true\n });\n $('i.glyphicon-calendar').on('click', function () {\n $(this).closest(\".datepicker-input\").find(\"input\").focus();\n });\n //$('[data-rel=datepicker-now]').datepicker({\n // format: 'dd/mm/yyyy',\n // autoclose: true,\n // todayHighlight: true,\n // startDate: currentDate\n //});\n\n $('[data-rel=timepicker]').timepicker();\n $('[data-rel=datepicker]').datepicker().on('show', function (ev) {\n //Component này quá tù - custom display popup datepicker\n\n if ($(document.body)[0].scrollWidth >= $(window).width()) {\n $(\".datepicker\").css({ \"left\": $(this).offset().left - ($(document.body)[0].scrollWidth - $(window).width()) - 18 });\n }\n\n });\n\n $('[data-rel=datepicker]').datepicker().on('changeDate', function (ev) {\n if ($('#Date').length > 0) {\n var date = $('#Date').data('datepicker').date;\n var hour = $('#Time').data('timepicker').meridian == \"AM\" ? $('#Time').data('timepicker').hour : 24 - $('#Time').data('timepicker').hour;\n var minute = $('#Time').data('timepicker').minute;\n var cloneDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hour, minute, 0, 0);\n\n if (cloneDate <= currentDate) {\n $(\"input:radio[name='active'][value='true']\").prop(\"checked\", true);\n }\n else {\n $(\"input:radio[name='active'][value='false']\").prop(\"checked\", true);\n }\n }\n });\n\n $(\"#Time\").change(function () {\n var date = $('#Date').data('datepicker').date;\n var hour = $('#Time').data('timepicker').meridian == \"AM\" ? $('#Time').data('timepicker').hour : 24 - $('#Time').data('timepicker').hour;\n var minute = $('#Time').data('timepicker').minute;\n var cloneDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hour, minute, 0, 0);\n\n if (cloneDate <= currentDate) {\n $(\"input:radio[name='active'][value='true']\").prop(\"checked\", true);\n }\n else {\n $(\"input:radio[name='active'][value='false']\").prop(\"checked\", true);\n }\n });\n}", "title": "" }, { "docid": "666156ab7fc1e0fd677839f81fa47cd3", "score": "0.5236355", "text": "function onReadyScripts() {\n\t\tif ($.fn.select2) {\n\t\t\t$('.select2_font_awesome').select2({\n\t\t\twidth: \"100%\",\n\t\t\ttemplateResult: templateForCustomFont,\n\t\t\ttemplateSelection: templateForCustomFont,\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "2c2d0cf62a5c4cb30e8753b3382f5896", "score": "0.5233364", "text": "function runAllForms() {\n\t\n\t\t/*\n\t\t * BOOTSTRAP SLIDER PLUGIN\n\t\t * Usage:\n\t\t * Dependency: js/plugin/bootstrap-slider\n\t\t */\n\t\tif ($.fn.slider) {\n\t\t\t$('.slider').slider();\n\t\t}\n\t\n\t\t/*\n\t\t * SELECT2 PLUGIN\n\t\t * Usage:\n\t\t * Dependency: js/plugin/select2/\n\t\t */\n\t\tif ($.fn.select2) {\n\t\t\t$('.select2').each(function() {\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\twidth = $this.attr('data-select-width') || '100%';\n\t\t\t\t//, _showSearchInput = $this.attr('data-select-search') === 'true';\n\t\t\t\t$this.select2({\n\t\t\t\t\t//showSearchInput : _showSearchInput,\n\t\t\t\t\tallowClear : true,\n\t\t\t\t\twidth : width\n\t\t\t\t});\n\n\t\t\t\t//clear memory reference\n\t\t\t\t$this = null;\n\t\t\t});\n\t\t}\n\t\n\t\t/*\n\t\t * MASKING\n\t\t * Dependency: js/plugin/masked-input/\n\t\t */\n\t\tif ($.fn.mask) {\n\t\t\t$('[data-mask]').each(function() {\n\t\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tmask = $this.attr('data-mask') || 'error...', mask_placeholder = $this.attr('data-mask-placeholder') || 'X';\n\t\n\t\t\t\t$this.mask(mask, {\n\t\t\t\t\tplaceholder : mask_placeholder\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//clear memory reference\n\t\t\t\t$this = null;\n\t\t\t});\n\t\t}\n\t\n\t\t/*\n\t\t * AUTOCOMPLETE\n\t\t * Dependency: js/jqui\n\t\t */\n\t\tif ($.fn.autocomplete) {\n\t\t\t$('[data-autocomplete]').each(function() {\n\t\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tavailableTags = $this.data('autocomplete') || [\"The\", \"Quick\", \"Brown\", \"Fox\", \"Jumps\", \"Over\", \"Three\", \"Lazy\", \"Dogs\"];\n\t\n\t\t\t\t$this.autocomplete({\n\t\t\t\t\tsource : availableTags\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//clear memory reference\n\t\t\t\t$this = null;\n\t\t\t});\n\t\t}\n\t\n\t\t/*\n\t\t * JQUERY UI DATE\n\t\t * Dependency: js/libs/jquery-ui-1.10.3.min.js\n\t\t * Usage: <input class=\"datepicker\" />\n\t\t */\n\t\tif ($.fn.datepicker) {\n\t\t\t$('.datepicker').each(function() {\n\t\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tdataDateFormat = $this.attr('data-dateformat') || 'dd.mm.yy';\n\t\n\t\t\t\t$this.datepicker({\n\t\t\t\t\tdateFormat : dataDateFormat,\n\t\t\t\t\tprevText : '<i class=\"fa fa-chevron-left\"></i>',\n\t\t\t\t\tnextText : '<i class=\"fa fa-chevron-right\"></i>',\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//clear memory reference\n\t\t\t\t$this = null;\n\t\t\t});\n\t\t}\n\t\n\t\t/*\n\t\t * AJAX BUTTON LOADING TEXT\n\t\t * Usage: <button type=\"button\" data-loading-text=\"Loading...\" class=\"btn btn-xs btn-default ajax-refresh\"> .. </button>\n\t\t */\n\t\t$('button[data-loading-text]').on('click', function() {\n\t\t\tvar btn = $(this);\n\t\t\tbtn.button('loading');\n\t\t\tsetTimeout(function() {\n\t\t\t\tbtn.button('reset');\n\t\t\t}, 3000);\n\t\t\t\t\n\t\t\t//clear memory reference\n\t\t\tbtn = null;\n\t\t});\n\t\n\t}", "title": "" }, { "docid": "7df5df7b0647dde58bfd536eb3eb2dd6", "score": "0.52303374", "text": "function setChosenOnDropDownListType() {\n bindChosenDDLMulitpleSelectEvent('ddlInventoryItemTypeId');\n bindChosenDDLMulitpleSelectEvent('ddlYear');\n bindChosenDDLMulitpleSelectEvent('ddlInventoryLocation');\n bindChosenDDLMulitpleSelectEvent('ddlMonth');\n}", "title": "" }, { "docid": "b15563888410536e8e467cba86646402", "score": "0.5224103", "text": "function wpbooklistEnableStorefrontSelect2() {\n\n\t\t// Adding in the line to enable the select2.js file\n $('.storefront-select2-upsells').select2();\n $('.storefront-select2-crosssells').select2();\n\n $(document).on(\"click\",\".wpbooklist-edit-actions-edit-button, #wpbooklist-woocommerce-yes\", function(event){\n $('.storefront-select2-upsells').select2();\n $('.storefront-select2-crosssells').select2();\n });\n\t}", "title": "" }, { "docid": "b9dd62cf9efc9fe275c8a9edf1080dff", "score": "0.5208012", "text": "function OnChangeSelect2(e)\n {\n var getId = $(this).attr(\"id\");\n var getValue = $(this).val();\n console.log('getId', getId, 'value', $(this).val())\n\n if (getId.indexOf('zone') !== -1)\n {\n $scope.itemChange_detailcommande($(this).val(), 'zone');\n }\n else if (getId.indexOf('client_commande') !== -1)\n {\n $scope.itemChange_detailcommande($(this).val(), 'client');\n //$scope.client_commande = getValue;\n\n if (!($(\"#modal_addcommande\").data('bs.modal') || {})._isShown)\n {\n $scope.clientSelected = null;\n }\n $.each($scope.clients, function (keyItem, valueItem)\n {\n if (getValue == valueItem.id)\n {\n $scope.clientSelected = valueItem;\n\n return false;\n }\n });\n }\n else if (getId.indexOf('tier_depense') !== -1)\n {\n //$scope.tier_depense = getValue;\n if (!($(\"#modal_adddepense\").data('bs.modal') || {})._isShown)\n {\n $scope.tierSelected = null;\n }\n $.each($scope.tiers, function (keyItem, valueItem)\n {\n if (getValue == valueItem.id)\n {\n $scope.tierSelected = valueItem;\n console.log('item détecté ici');\n return false;\n }\n });\n }\n else if (getId.indexOf('categorie_depense_depense') !== -1)\n {\n var currentTypeDepense = null;\n $.each($scope.categoriedepenses, function (keyItem, valueItem)\n {\n if (getValue == valueItem.id && valueItem.type_depense)\n {\n currentTypeDepense = valueItem.type_depense.id;\n return false;\n }\n });\n\n $('#type_depense_depense').val(currentTypeDepense);\n\n }\n\n\n if(!$scope.$$phase)\n {\n $scope.$apply();\n }\n }", "title": "" }, { "docid": "b935631af25b2c6e88c59f5982af4231", "score": "0.5196805", "text": "function change(val) {\r\n $(\"#cheque_no\").empty().trigger('change');\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"exec/checkSeries.php?type=cheque\",\r\n data: {bank_code: val}\r\n }).done(function (a) {\r\n if ((a === 'Used' || a === 'Range Error') && val !== '') {\r\n $(\"button\").prop(\"disabled\", true);\r\n var msg = '';\r\n if (a === 'Range Error') {\r\n msg = \"<br><a href='check_range.php'>Click here</a> to add new cheque range.\";\r\n } else {\r\n msg = \"<br>Other user is using this account, Please try again later.\";\r\n }\r\n var msg = \"<font color='red'>Bank Account Status: \" + a + \" \" + msg + \"</font>\";\r\n $(\"#msg\").html(msg);\r\n } else {\r\n var data = $.parseJSON(a);\r\n $(\"#cheque_no\").select2({data: data});\r\n $(\"button\").prop(\"disabled\", false);\r\n voucherNo(val);\r\n $(\"#msg\").html();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "32c9dfef4be87959edbff7d851a7bdb2", "score": "0.51954114", "text": "function addEvents() {\n // form should not actually submit. Catch that behaviour by binding the submit event to the `refresh`\n // function, and make sure that function returns `false`\n $(\"form\").on(\"submit\", refresh);\n\n // add a datetime picker element to the from and until inputs\n $(function () {\n $('#from-datetime').datetimepicker({format: \"YYYY-MM-DD HH:mm:ss\"});\n });\n $(function () {\n $('#until-datetime').datetimepicker({format: \"YYYY-MM-DD HH:mm:ss\"});\n });\n\n\n $(\"#date-range-today\").on(\"click\", setTodayDateRange);\n\n $(\"#date-range-last-2-days\").on(\"click\", set2DayDateRange);\n\n $(\"#date-range-last-7-days\").on(\"click\", set7DayDateRange);\n }", "title": "" }, { "docid": "84b440832804d470d7beadddd4f3479b", "score": "0.51939", "text": "function init_datepicker() {\r\n var datepickers = $('.datepicker');\r\n var datetimepickers = $('.datetimepicker');\r\n if (datetimepickers.length == 0 && datepickers.length == 0) {\r\n return;\r\n }\r\n var opt;\r\n // Datepicker without time\r\n $.each(datepickers, function() {\r\n var opt = {\r\n format: date_format,\r\n timepicker: false,\r\n scrollInput: false,\r\n lazyInit: true,\r\n dayOfWeekStart: calendar_first_day,\r\n };\r\n // Check in case the input have date-end-date or date-min-date\r\n var max_date = $(this).data('date-end-date');\r\n var min_date = $(this).data('date-min-date');\r\n if (max_date) {\r\n opt.maxDate = max_date;\r\n }\r\n if (min_date) {\r\n opt.minDate = min_date;\r\n }\r\n // Init the picker\r\n $(this).datetimepicker(opt);\r\n });\r\n var opt_time;\r\n // Datepicker with time\r\n $.each(datetimepickers, function() {\r\n opt_time = {\r\n format: date_format + ' H:i',\r\n lazyInit: true,\r\n scrollInput: false,\r\n dayOfWeekStart: calendar_first_day,\r\n };\r\n // Check in case the input have date-end-date or date-min-date\r\n var max_date = $(this).data('date-end-date');\r\n var min_date = $(this).data('date-min-date');\r\n if (max_date) {\r\n opt_time.maxDate = max_date;\r\n }\r\n if (min_date) {\r\n opt_time.minDate = min_date;\r\n }\r\n // Init the picker\r\n $(this).datetimepicker(opt_time);\r\n });\r\n}", "title": "" }, { "docid": "a538a0d03ffe9e5c0ee37b14833089f8", "score": "0.5193743", "text": "function instantiateSelect2Boxes(country_id){\n checkCountryHasStates(country_id, function (){\n $('*[data-hide-when=\"country_has_no_states\"]').fadeIn();\n\n sb_state_.select2({\n placeholder: sb_state_.attr(\"data-text\"),\n width: '100%',\n theme: 'bootstrap',\n allowClear: true,\n ajax: {\n url: base_url+'common/get_states/'+country_id,\n dataType: 'json',\n data: function(params) {\n return {\n term: params.term || '',\n page: params.page || 1\n }\n },\n cache: true\n }\n });\n }, function (){\n $('*[data-hide-when=\"country_has_no_states\"]').fadeOut();\n });\n\n sb_city_.select2({\n placeholder: sb_city_.attr(\"data-text\"),\n width: '100%',\n theme: 'bootstrap',\n allowClear: true,\n ajax: {\n url: base_url+'common/get_cities/'+country_id,\n dataType: 'json',\n data: function(params) {\n return {\n term: params.term || '',\n page: params.page || 1\n }\n },\n cache: true\n }\n });\n\n sb_town_.select2({\n placeholder: sb_town_.attr(\"data-text\"),\n width: '100%',\n theme: 'bootstrap',\n allowClear: true,\n ajax: {\n url: base_url+'common/get_towns/'+country_id,\n dataType: 'json',\n data: function(params) {\n return {\n term: params.term || '',\n page: params.page || 1\n }\n },\n cache: true\n }\n });\n\n sb_train_.select2({\n placeholder: sb_train_.attr(\"data-text\"),\n width: '100%',\n theme: 'bootstrap',\n allowClear: true,\n ajax: {\n url: base_url+'common/get_train_stations/'+country_id,\n dataType: 'json',\n data: function(params) {\n return {\n term: params.term || '',\n page: params.page || 1\n }\n },\n cache: true\n }\n });\n\n sb_zone_.select2({\n placeholder: sb_zone_.attr(\"data-text\"),\n width: '100%',\n theme: 'bootstrap',\n allowClear: true,\n ajax: {\n url: base_url+'common/get_zones/'+country_id,\n dataType: 'json',\n data: function(params) {\n return {\n term: params.term || '',\n page: params.page || 1\n }\n },\n cache: true\n }\n });\n }", "title": "" }, { "docid": "5df77d2cc278ff56dc0de183526912f9", "score": "0.51892376", "text": "function cmbstipo_servicio_codigo__init(){\n $(\"#cmbstipo_servicio_codigo\").html('');\n $(\"#cmbstipo_servicio_codigo\").html('refresh');\n\n cmbsruta_servicio_origen_codigo__init();\n cmbsruta_servicio_destino_codigo__init();\n\n $.post(\"../../controller/servicio.php?op=apr_web_tipo_servicio_select\", function(data, status){\n $(\"#cmbstipo_servicio_codigo\").html(data);\n $('#cmbstipo_servicio_codigo').selectpicker('refresh');\n });\n }", "title": "" }, { "docid": "bbe35cc4e40fe1f99b7727d6aac27370", "score": "0.51884764", "text": "function setupStartAndEndTimeFields($jstartTimeField, $jendTimeField, calEvent, timeslotTimes) {\n\n $jstartTimeField.empty();\n $jendTimeField.empty();\n\n for (var i = 0; i < timeslotTimes.length; i++) {\n var startTime = timeslotTimes[i].start;\n var endTime = timeslotTimes[i].end;\n var startSelected = \"\";\n if (startTime.getTime() === calEvent.start.getTime()) {\n startSelected = \"selected=\\\"selected\\\"\";\n }\n var endSelected = \"\";\n if (endTime.getTime() === calEvent.end.getTime()) {\n endSelected = \"selected=\\\"selected\\\"\";\n }\n $jstartTimeField.append(\"<option value=\\\"\" + startTime + \"\\\" \" + startSelected + \">\" + timeslotTimes[i].startFormatted + \"</option>\");\n $jendTimeField.append(\"<option value=\\\"\" + endTime + \"\\\" \" + endSelected + \">\" + timeslotTimes[i].endFormatted + \"</option>\");\n\n $jtimestampsOfOptions.start[timeslotTimes[i].startFormatted] = startTime.getTime();\n $jtimestampsOfOptions.end[timeslotTimes[i].endFormatted] = endTime.getTime();\n\n }\n $jendTimeOptions = $jendTimeField.find(\"option\");\n $jstartTimeField.trigger(\"change\");\n }", "title": "" }, { "docid": "15b8a004f6d199d538c662a5b9007b08", "score": "0.5185109", "text": "function init_date(){\n/* 134 */ \t\t//verifica se o valor do input está vazio. Sai caso esteja\n/* 135 */ \t\tvar data_i = e.i_start.val();\n/* 136 */ \t\tvar data_f = e.i_end.val();\n/* 137 */ \t\tif(data_i == \"\" || data_f == \"\") return;\n/* 138 */ \t\t\n/* 139 */ \t\t//atualiza picks\n/* 140 */ \t\tupdate_picks(data_i, data_f);\n/* 141 */ \t\t\n/* 142 */ \t\tupdate_date();\n/* 143 */ \t}", "title": "" }, { "docid": "5df461532847ca64668119c068071f2a", "score": "0.5185042", "text": "function getData() {\n\t//获取时间\n\tvar url = \"baselineCheck/getParamTasks\";\n\t$.ajax({\n\t\ttype: \"post\",\n\t\turl: url,\n\t\t//data:{ids:platform_type_ids},\n\t\tdataType: \"json\",\n\t\tsuccess: function (data) {\n\t\t\tvar paramQueryDateSelect = $(\"#paramQueryDate\").select2({\n\t\t\t\tplaceholder: \"请选择日期\",\n\t\t\t\t//allowClear: true,\n\t\t\t\tdata: data\n\t\t\t});\n\t\t\t$(\"#paramQueryDate\").val(getCurrentDate()).trigger(\"change\");\n\t\t\tvar task = getCurrentDate(\"kget\");\n\t\t\t$(\"#paramQueryDate\").val(getCurrentDate(\"kget\")).trigger(\"change\");\n\t\t\tif ($(\"#paramQueryDate\").val() == null) {\n\t\t\t\t$(\"#paramQueryDate\").val(getYesterdayDate(\"kget\")).trigger(\"change\");\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d4c1393aaae16b059decf4deb0b7e424", "score": "0.51791734", "text": "function setDefaultStartAndEndTime() {\n var startTime = getSystemTimeInfo();\n $('#timepicker1').timepicker().val(startTime);\n fillEndTime();\n}", "title": "" }, { "docid": "6f1b243f2e279c31d4cdbbe0b56c8498", "score": "0.51769525", "text": "_initialize()\r\n {\r\n this.$type.select2({\r\n width: '100%',\r\n allowClear: true,\r\n dropdownCssClass: \"fontSelect2\",\r\n });\r\n }", "title": "" }, { "docid": "5aa413ee362b0d62288eb94e3b6954ff", "score": "0.51762974", "text": "function coursesSelect2() {\n $(\"#materias\").select2({\n dropdownParent: newModalRc,\n width: \"100%\"\n });\n}", "title": "" }, { "docid": "5849bbba4feb08570811420a8b9b7953", "score": "0.5169748", "text": "function runAllForms() {\n\t\n\t\t/*\n\t\t * BOOTSTRAP SLIDER PLUGIN\n\t\t * Usage:\n\t\t * Dependency: js/plugin/bootstrap-slider\n\t\t */\n\t\tif ($.fn.slider) {\n\t\t\t$('.slider').slider();\n\t\t}\n\t\n\t\t/*\n\t\t * SELECT2 PLUGIN\n\t\t * Usage:\n\t\t * Dependency: js/plugin/select2/\n\t\t */\n\t\t/*\n\t\tif ($.fn.select2) {\n\t\t\t$('select.select2').each(function () {\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\twidth = $this.attr('data-select-width') || '100%';\n\t\t\t\t//, _showSearchInput = $this.attr('data-select-search') === 'true';\n\t\t\t\t$this.select2({\n\t\t\t\t\t//showSearchInput : _showSearchInput,\n\t\t\t\t\tallowClear: true,\n\t\t\t\t\twidth: width\n\t\t\t\t});\n\n\t\t\t\t//clear memory reference\n\t\t\t\t$this = null;\n\t\t\t});\n\t\t}\n\t\t*/\n\t\n\t\t/*\n\t\t * MASKING\n\t\t * Dependency: js/plugin/masked-input/\n\t\t */\n\t\tif ($.fn.mask) {\n\t\t\t$('[data-mask]').each(function() {\n\t\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tmask = $this.attr('data-mask') || 'error...', mask_placeholder = $this.attr('data-mask-placeholder') || 'X';\n\t\n\t\t\t\t$this.mask(mask, {\n\t\t\t\t\tplaceholder : mask_placeholder\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//clear memory reference\n\t\t\t\t$this = null;\n\t\t\t});\n\t\t}\n\t\n\t\t/*\n\t\t * AUTOCOMPLETE\n\t\t * Dependency: js/jqui\n\t\t */\n\t\tif ($.fn.autocomplete) {\n\t\t\t$('[data-autocomplete]').each(function() {\n\t\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tavailableTags = $this.data('autocomplete') || [\"The\", \"Quick\", \"Brown\", \"Fox\", \"Jumps\", \"Over\", \"Three\", \"Lazy\", \"Dogs\"];\n\t\n\t\t\t\t$this.autocomplete({\n\t\t\t\t\tsource : availableTags\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//clear memory reference\n\t\t\t\t$this = null;\n\t\t\t});\n\t\t}\n\t\n\t\t/*\n\t\t * JQUERY UI DATE\n\t\t * Dependency: js/libs/jquery-ui-1.10.3.min.js\n\t\t * Usage: <input class=\"datepicker\" />\n\t\t */\n /*if ($.fn.datepicker) {\n $('.datepicker').each(function () {\n var $this = $(this),\n dataDateFormat = $this.attr('data-dateformat') || 'yy-mm-dd';\n\n $this.datepicker({\n dateFormat: dataDateFormat,\n prevText: '<i class=\"fa fa-chevron-left\"></i>',\n nextText: '<i class=\"fa fa-chevron-right\"></i>'\n });\n\n //clear memory reference\n $this = null;\n });\n }*/\n\n\t\tloadModule(\"datetimepicker\", function(){\n\t\t\t//定义全局方法\n\t\t\tbindDateTimePicker = function (picker) {\n\t\t\t\tvar minView = 0;\n\t\t\t\tvar format = \"yyyy-mm-dd\";\n\t\t\t\tif(picker.hasClass(\"datepicker\")){\n\t\t\t\t\tminView = 2;\n\t\t\t\t} else {\n\t\t\t\t\tformat = \"\";\n\t\t\t\t}\n\n\t\t\t\tpicker.datetimepicker({\n\t\t\t\t\tformat: format,\n\t\t\t\t\tlanguage: \"zh-CN\",\n\t\t\t\t\tautoclose: true,\n\t\t\t\t\ttodayBtn: true,\n\t\t\t\t\ttodayHighlight: true,\n\t\t\t\t\tstartView: 2,\n\t\t\t\t\tminView: minView,\n\t\t\t\t\tforceParse: 0\n\t\t\t\t});\n\t\t\t}\n\t\t\t//全局绑定\n\t\t\tvar datetimepickers = $(\".datepicker,.datetimepicker\");\n\t\t\tif(datetimepickers.length > 0) {\n\t\t\t\tdatetimepickers.each(function(){\n\t\t\t\t\tvar picker = $(this);\n\t\t\t\t\tbindDateTimePicker(picker);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tloadModule(\"daterangepicker\", function() {\n\t\t\t//定义全局方法\n\t\t\tbindDateRangePicker = function (dateRange) {\n\t\t\t\tvar callback = arguments[1] || function () { };\n\t\t\t\tdateRange.daterangepicker({\n\t\t\t\t\tautoUpdateInput: false,\n\t\t\t\t\tautoUpdateInput: false,\n\t\t\t\t\tformat: 'YYYY-MM-DD HH:mm:ss',\n\t\t\t\t\tlocale: {\n\t\t\t\t\t\tapplyLabel: '确 定',\n\t\t\t\t\t\tcancelLabel: '清 空',\n\t\t\t\t\t\tfromLabel: '起始时间',\n\t\t\t\t\t\ttoLabel: '结束时间',\n\t\t\t\t\t\tcustomRangeLabel: '自定义',\n\t\t\t\t\t\tdaysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],\n\t\t\t\t\t\tmonthNames: ['一月', '二月', '三月', '四月', '五月', '六月',\n\t\t\t\t\t\t\t'七月', '八月', '九月', '十月', '十一月', '十二月'],\n\t\t\t\t\t\tfirstDay: 1\n\t\t\t\t\t},\n\t\t\t\t\tranges: {\n\t\t\t\t\t\t//'今天': [moment(), moment()],\n\t\t\t\t\t\t//'昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n\t\t\t\t\t\t//'最近7天': [moment().subtract(6, 'days'), moment()],\n\t\t\t\t\t\t//'最近30天': [moment().subtract(29, 'days'), moment()],\n\t\t\t\t\t\t'本月': [moment().startOf('month'), moment().endOf('month')],\n\t\t\t\t\t\t//'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n\t\t\t\t\t}\n\t\t\t\t}).on('apply.daterangepicker', function (event, picker) {\n\t\t\t\t\tvar start = picker.startDate.format('YYYY-MM-DD');\n\t\t\t\t\tvar end = picker.endDate.format('YYYY-MM-DD');\n\t\t\t\t\t$(dateRange.attr(\"start\") || \"startDate\").val(start);\n\t\t\t\t\t$(dateRange.attr(\"end\") || \"endDate\").val(end);\n\t\t\t\t\tdateRange.val(start + \" 至 \" + end);\n\t\t\t\t\tcallback && callback();\n\t\t\t\t}).on('cancel.daterangepicker', function (ev, picker) {\n\t\t\t\t\t$(dateRange.attr(\"start\") || \"startDate\").val(\"\");\n\t\t\t\t\t$(dateRange.attr(\"end\") || \"endDate\").val(\"\");\n\t\t\t\t\tdateRange.val(\"\");\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t//全局绑定\n\t\t\t/*var dateranges = $(\".daterange\");\n\t\t\tif (dateranges.length > 0) {\n\t\t\t\tdateranges.each(function () {\n\t\t\t\t\tvar dateRange = $(this);\n\t\t\t\t\tbindDateRangePicker(dateRange);\n\t\t\t\t});\n\t\t\t}*/\n\t\t});\n\t\t/*\n\t\t * AJAX BUTTON LOADING TEXT\n\t\t * Usage: <button type=\"button\" data-loading-text=\"Loading...\" class=\"btn btn-xs btn-default ajax-refresh\"> .. </button>\n\t\t */\n\t\t$('button[data-loading-text]').on('click', function() {\n\t\t\tvar btn = $(this);\n\t\t\tbtn.button('loading');\n\t\t\tsetTimeout(function() {\n\t\t\t\tbtn.button('reset');\n\t\t\t\t//clear memory reference\n\t\t\t\tbtn = null;\n\t\t\t}, 3000);\n\n\t\t});\n\t\n\t}", "title": "" }, { "docid": "f1a7aafb04f750ff3d6323a273d12551", "score": "0.5168309", "text": "function qodefInitIDXSelect2() {\n var idxSelect = $('.dsidx-resp-search-form select');\n if (idxSelect.length) {\n idxSelect.each(function() {\n var thisSelect = $(this);\n\n thisSelect.select2({\n minimumResultsForSearch: Infinity\n });\n });\n }\n\n var idxSort = $('.dsidx-sorting-control select');\n if(idxSort.length) {\n idxSort.each(function() {\n var thisSort = $(this);\n\n thisSort.select2({\n minimumResultsForSearch: Infinity\n });\n });\n }\n\n var idxSchedule = $('.dsidx-contact-form-schedule-date-row select');\n if(idxSchedule.length) {\n idxSchedule.each(function() {\n var thisSchedule = $(this);\n\n thisSchedule.select2({\n minimumResultsForSearch: Infinity\n });\n });\n }\n }", "title": "" }, { "docid": "27ce334d7ec76c8694cc72dca05c1219", "score": "0.5162841", "text": "function wireEvents() {\r\n $(\".multiselect\").on(\"change\", handleQueryChange);\r\n $(QUERY_EDITOR).on(\"blur\", \"input[type=text]\", handleQueryChange); \r\n $(DOWNLOAD_QUERY).on(\"click\", handleQueryDownload);\r\n $(DOWNLOAD_DATA).on(\"click\", handleDataDownload);\r\n $(COUNTID).on(\"change\", handleQueryChange);\r\n }", "title": "" }, { "docid": "a5e9a74c9bdbf293c3aca9b6c3084c23", "score": "0.5160231", "text": "function initialize(){\n \n $(\"#panelList\").find(\"select\").select2({\n theme: \"bootstrap\",\n placeholder: \"Please Select Option\"\n });\n\n $(\"#panelList\").find(\"input:checkbox\").bootstrapSwitch();\n }", "title": "" }, { "docid": "99ee4faf039a1caa49d52a3f292c0dd1", "score": "0.5154441", "text": "function datePicker(f,f2) {\n \n var start = moment().subtract(2, 'days');\n var end = moment();\n\n function cb(start, end) {\n // showe date in picker\n $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));\n // function to return data\n if (f) { f(start, end); }\n if (f2) { f2(start, end); } \n }\n\n $('#reportrange').daterangepicker({\n startDate: start,\n endDate: end,\n ranges: {\n 'Today': [moment(), moment()],\n 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\n 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\n 'This Month': [moment().startOf('month'), moment().endOf('month')],\n 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n }\n }, cb);\n\n cb(start, end); \n}", "title": "" }, { "docid": "33cb44fb401e76fbb0e238735c3bdff7", "score": "0.51512754", "text": "function initDatePicker() {\n\t\t\t//wrapper is here just because for layout - in order to prevent calendar icon floating left or right -> keep it near the field\t\t\t\n\t\t\tvalues.dateFromField.attr('data-dateFormat', values.dateFormat).wrap('<div class=\"wrapper\"></div>').dv_datepicker();\n\t\t\tvalues.dateToField.attr('data-dateFormat', values.dateFormat).dv_datepicker();\t\t\t\n } //initDatePicker()", "title": "" }, { "docid": "413aabd5060f03b6a9321c289dc41c66", "score": "0.5150074", "text": "function update_calendar_cloud(){\n\n\t// Click slider2DatesButton; OR mouseup event?(later)\n\t// Get domain of focus\n\t// Convert domain to YYYY-mm-dd\n\t// Pass dates to calendars' values\n\t// Trigger update_cloud(); \n\n\t//console.log(x.domain());\n\tvar brush_start = new Date(x.domain()[0]);\n\tvar input_start_picker = (\"0\"+brush_start.getDate()).slice(-2)+'-'+(\"0\"+(brush_start.getMonth()+1)).slice(-2)+'-'+brush_start.getFullYear();\n \n\t// document.getElementById(\"start\").value = input_start_picker;\n\t$(\"#start\").datepicker(\"update\", input_start_picker);\n\n\tvar brush_end = new Date(x.domain()[1]);\n\tvar input_end_picker = (\"0\"+brush_end.getDate()).slice(-2)+'-'+(\"0\"+(brush_end.getMonth()+1)).slice(-2)+'-'+brush_end.getFullYear();\n \n\t//console.log(input_start_picker, input_end_picker);\n\t// document.getElementById(\"end\").value = input_end_picker;\n\t$(\"#end\").datepicker(\"update\", input_end_picker);\n\tupdate_cloud();\n\n}", "title": "" }, { "docid": "acb7655e95f5be65f23da6edce56c630", "score": "0.51466435", "text": "function selectTollEmails() {\n var toll_emails = $('#send_toll option:selected').map(function() {\n return $(this).val()\n });\n toll_emails = $.makeArray(toll_emails);\n $('toll_emails').selectpicker('val', toll_emails);\n }", "title": "" }, { "docid": "99026f2e469c8506282dd58d34371d2c", "score": "0.514548", "text": "function move_slider(start_date, end_date) {\n $('select#start').val(start_date.getTime() / 1000);\n $('select#end').val(end_date.getTime() / 1000);\n\n // fire changes so the UI can update\n $('select#start').change();\n $('select#end').change();\n\n // re-load any visible date-driven layers\n update_date_layers();\n}", "title": "" }, { "docid": "422ffdf09062f5d837f03107eb07dc68", "score": "0.51406753", "text": "function update_picks(a, b){\n/* 317 */ \t\tvar i \t\t= \"\";\n/* 318 */ \t\tvar f \t\t= \"\";\n/* 319 */ \t\tvar is \t\t= e.cal_start.dpGetSelected()[0] ? e.cal_start.dpGetSelected()[0].asString() : \"\";\n/* 320 */ \t\tvar fs \t\t= e.cal_end.dpGetSelected()[0] ? e.cal_end.dpGetSelected()[0].asString() : \"\";\n/* 321 */ \t\tvar data_i = e.i_start.val();\n/* 322 */ \t\tvar data_f = e.i_end.val();\n/* 323 */ \t\t\n/* 324 */ \t\t//Chamada sem parâmetros, Busca do campo de Data\n/* 325 */ \t\tif(a==undefined || a==null){\n/* 326 */ \t\t\ti\t\t= data_i;\n/* 327 */ \t\t\tf\t\t= data_f;\n/* 328 */ \t\t}\n/* 329 */ \t\t//parametros são vazios, limpa seleção de datas\n/* 330 */ \t\telse if(a=='' && b==''){\n/* 331 */ \t\t\te.cal_start.dpClear();\n/* 332 */ \t\t\te.cal_end.dpClear();\n/* 333 */ \t\t\tupdate_date();\n/* 334 */ \t\t\treturn;\n/* 335 */ \t\t}\n/* 336 */ \t\t//Com parametros, utiliza as datas recebidas\n/* 337 */ \t\telse if(a && b){\n/* 338 */ \t\t\ti \t\t= a;\n/* 339 */ \t\t\tf \t\t= b;\n/* 340 */ \t\t}\n/* 341 */ \t\t//Com parametros, utiliza as datas recebidas\n/* 342 */ \t\t//ERRO\n/* 343 */ \t\telse{\n/* 344 */ \t\t\treturn;\n/* 345 */ \t\t}\n/* 346 */ \t\t\n/* 347 */ \t\t//validando datas\n/* 348 */ \t\ti = (i.length == 10) ? i : false;\n/* 349 */ \t\tf = (f.length == 10) ? f : false;\n/* 350 */ \t\t\n\n/* datepickerrange.js */\n\n/* 351 */ \t\t//Verifica se as datas atualmente selecionadas sao diferentes das informadas e retira a pre-selecao\n/* 352 */ \t\tif(i != is || fs != f){\n/* 353 */ \t\t\t//retirando selecao do menu lateral\n/* 354 */ \t\t\te.itens.filter(\".selected\").removeClass(\"selected\");\n/* 355 */ \t\t}\n/* 356 */ \t\t\n/* 357 */ \t\t//Selecionando as datas ou limpando caso as datas nao coincidam\n/* 358 */ \t\tif(i){ \n/* 359 */ \t\t\te.cal_start.dpSetSelected(i);\n/* 360 */ \t\t}else{\n/* 361 */ \t\t\te.cal_start.dpSetSelected(is, false);\n/* 362 */ \t\t\te.cal_end.dpSetStartDate($.i18n._(\"lang_start_date\"));\n/* 363 */ \t\t\te.cal_end.dpRerenderCalendar();\n/* 364 */ \t\t}\n/* 365 */ \t\t\n/* 366 */ \t\t//selecionando data final\n/* 367 */ \t\tif(f){\n/* 368 */ \t\t\te.cal_end.dpSetSelected(f);\n/* 369 */ \t\t\t//se nao conseguir selecionar a data final por alguma limitacao, seleciona a mesma data do inicio\n/* 370 */ \t\t\tif(e.cal_end.dpGetSelected(f)[0].asString() != f){\n/* 371 */ \t\t\t\te.cal_end.dpSetSelected(e.cal_start.dpGetSelected()[0].asString());\n/* 372 */ \t\t\t}\n/* 373 */ \t\t}else{\n/* 374 */ \t\t\tif(e.cal_end.dpGetSelected()[0]){\n/* 375 */ \t\t\t\te.cal_end.dpSetSelected(e.cal_end.dpGetSelected()[0].asString(), false);\n/* 376 */ \t\t\t}\n/* 377 */ \t\t}\n/* 378 */ \t}", "title": "" }, { "docid": "265008447dde46279e18f3b84a2a4e88", "score": "0.51382136", "text": "function qodefInitSelect2() {\n\t\tvar selectDropdown = $('.qodef-add-property-page .qodef-dashboard-item select, .qodef-edit-property-page .qodef-dashboard-item select');\n\t\tif (selectDropdown.length) {\n\t\t selectDropdown.each(function() {\n\t\t var thisDropdown = $(this);\n\t\t\t thisDropdown.select2({\n\t\t\t\t minimumResultsForSearch: Infinity\n\t\t\t });\n });\n\t\t}\n\t}", "title": "" }, { "docid": "5609a8417cf06019563c5820c0113e49", "score": "0.5128668", "text": "function initAdminUserListPage() {\r\n // Set up date chooser tool\r\n jQuery('#createdFrom').datepicker();\r\n}", "title": "" }, { "docid": "78286c15bcd6c4c2feb1790c89b196d5", "score": "0.51286465", "text": "function load_date_pickers() {\n $('.datepicker').each(function() {\n $(this).datepicker({ dateFormat: 'yy-mm-dd', showOn : 'focus', constrainInput : true });\n });\n\t$('#ui-datepicker-div').css('clip', 'auto');\n}", "title": "" }, { "docid": "cca0661f849fbea5e16fef64c40e3190", "score": "0.5127226", "text": "function setupCalendarSelector() {\n var calendarRange = [];\n for (let i = 0; i < 7; i++) {\n calendarRange.push(calendarDateString(getPreviousDays(i)));\n }\n\n picker = flatpickr(\"#calendar_selector\", {\n defaultDate: calendarDateString(new Date()),\n enable: calendarRange,\n });\n pickerDate = calendarDateString(new Date());\n\n picker.config.onChange.push(function (selectedDate, datestr) {\n selectedDateString = dateString(selectedDate[0]);\n // loading old timesheet, reset current request.\n if (loadDailyTimeSheet) {\n alert(\n \"Timesheet for \" + pickerDate + \" loading, please try again later.\"\n );\n picker.setDate(pickerDate);\n return;\n }\n retrieveDailyData(selectedDateString);\n generateTimeSheet(\"Daily\", selectedDateString);\n renderGraph(\"Daily\", selectedDateString);\n pickerDate = datestr;\n });\n}", "title": "" }, { "docid": "d8bcf0db5cb9c4d1faf8171a7ff7891e", "score": "0.5117371", "text": "function Datepicker() {}", "title": "" }, { "docid": "d8bcf0db5cb9c4d1faf8171a7ff7891e", "score": "0.5117371", "text": "function Datepicker() {}", "title": "" }, { "docid": "b55a1c216b34bc16401818b3038a9e2a", "score": "0.5104867", "text": "function updateSelect(flag){\n console.log(\"updated selected\");\n $('.selectpicker').selectpicker();\n}", "title": "" }, { "docid": "894e09ee380bb953dd32113cdd1a9689", "score": "0.5104727", "text": "function setupStartAndEndTimeFields($startTimeField, $endTimeField, calEvent, timeslotTimes) {\r\n\t\t$startTimeField.html(\"\");\r\n\t\t$endTimeField.html(\"\");\r\n for (var i = 0; i < timeslotTimes.length; i++) {\r\n var startTime = timeslotTimes[i].start;\r\n var endTime = timeslotTimes[i].end;\r\n var startSelected = \"\";\r\n if (startTime.getTime() === calEvent.start.getTime()) {\r\n startSelected = \"selected=\\\"selected\\\"\";\r\n }\r\n var endSelected = \"\";\r\n if (endTime.getTime() === calEvent.end.getTime()) {\r\n endSelected = \"selected=\\\"selected\\\"\";\r\n }\r\n $startTimeField.append(\"<option value=\\\"\" + startTime + \"\\\" \" + startSelected + \">\" + timeslotTimes[i].startFormatted + \"</option>\");\r\n $endTimeField.append(\"<option value=\\\"\" + endTime + \"\\\" \" + endSelected + \">\" + timeslotTimes[i].endFormatted + \"</option>\");\r\n\r\n }\r\n $endTimeOptions = $endTimeField.find(\"option\");\r\n $startTimeField.trigger(\"change\");\r\n }", "title": "" }, { "docid": "932ceea3d96d3469f22751c6b33f935f", "score": "0.51022404", "text": "function qodefInitSelect2() {\n\t\tvar orderByDropDown = $('.woocommerce-ordering .orderby');\n\t\tif (orderByDropDown.length) {\n\t\t\torderByDropDown.select2({\n\t\t\t\tminimumResultsForSearch: Infinity\n\t\t\t});\n\t\t}\n\t\t\n\t\tvar variableProducts = $('.qodef-woocommerce-page .qodef-content .variations td.value select');\n\t\tif (variableProducts.length) {\n\t\t\tvariableProducts.select2();\n\t\t}\n\t\t\n\t\tvar shippingCountryCalc = $('#calc_shipping_country');\n\t\tif (shippingCountryCalc.length) {\n\t\t\tshippingCountryCalc.select2();\n\t\t}\n\t\t\n\t\tvar shippingStateCalc = $('.cart-collaterals .shipping select#calc_shipping_state');\n\t\tif (shippingStateCalc.length) {\n\t\t\tshippingStateCalc.select2();\n\t\t}\n\t}", "title": "" }, { "docid": "ed2c5a3ef5ee2f587026a8e352e27728", "score": "0.51004916", "text": "function mkdfInitSelect2() {\n\t\tvar orderByDropDown = $('.woocommerce-ordering .orderby');\n\t\tif (orderByDropDown.length) {\n\t\t\torderByDropDown.select2({\n\t\t\t\tminimumResultsForSearch: Infinity\n\t\t\t});\n\t\t}\n\t\t\n\t\tvar variableProducts = $('.mkdf-woocommerce-page .mkdf-content .variations td.value select');\n\t\tif (variableProducts.length) {\n\t\t\tvariableProducts.select2();\n\t\t}\n\t\t\n\t\tvar shippingCountryCalc = $('#calc_shipping_country');\n\t\tif (shippingCountryCalc.length) {\n\t\t\tshippingCountryCalc.select2();\n\t\t}\n\t\t\n\t\tvar shippingStateCalc = $('.cart-collaterals .shipping select#calc_shipping_state');\n\t\tif (shippingStateCalc.length) {\n\t\t\tshippingStateCalc.select2();\n\t\t}\n\t}", "title": "" }, { "docid": "e00d76c97c5e6c7395e00e7b505c3155", "score": "0.5098639", "text": "function setup_timepicker() {\r\n\t\tif ($('#timepicker-demo').length) {\r\n\t\t\t\r\n\t\t\t/* default */\r\n\t\t\t$('#timepicker1').timepicker();\r\n\t\t\t\r\n\t\t\t/* in model */\r\n $('#timepicker2').timepicker({\r\n minuteStep: 1,\r\n template: 'modal',\r\n showSeconds: true,\r\n showMeridian: false\r\n });\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7f851651e95ee577a6f704121e6019ac", "score": "0.5093578", "text": "function ApplySelect2()\r\n{\r\n $('select').each(function ()\r\n {\r\n $(this).select2();\r\n $(\".select2-search\").remove();\r\n });\r\n}", "title": "" }, { "docid": "2f331186c6733a9ef9af01a2cf402dfa", "score": "0.50873375", "text": "addSelectEvent() {\n this.parent.on('select2:select', () => {\n this.changeDisabled(true);\n let value = this.parent.val();\n if (value) {\n $.ajax({\n url: this.options.url,\n type: 'GET',\n dataType: 'json',\n data: {\n search: value\n }\n }).done((response) => {\n if(this.options.callback){\n this.options.callback();\n }\n\n //esvazia o select dependente\n this.child\n .empty()\n .prepend('<option></option>')\n .trigger('change');\n\n response.results.forEach((value) => {\n var persist = [];\n\n // verifica se há valores persistidos\n if (this.child.data('persist')) {\n var persistValue = this.child.data('persist').toString().split(',');\n persist = persistValue.length > 0 ? persistValue : [];\n }\n\n // preenche valores\n this.child.append($('<option>', {\n value: value[this.options.id],\n text: value[this.options.text],\n selected: persist.includes(value[this.options.id].toString()) ? 'selected' : false\n }));\n });\n\n this.child.trigger('change').trigger('select2:select');\n\n this.changeDisabled(false);\n\n }).fail(function (error) {\n console.log(error);\n })\n }\n })\n }", "title": "" }, { "docid": "ed927ecd64b9617f75d85819f6586a3c", "score": "0.50843865", "text": "function Bootstrap_Select(){\t\n\t\t\tjQuery('.selectpicker').selectpicker();\n\t\t}", "title": "" }, { "docid": "704d62ef49c1f04c52075b1cf5d62478", "score": "0.50827014", "text": "function addJQDatePickers () {\n//\talert(\"addDatePickers\");\n\tjQuery.each($(\".date\"), function(index, value) {\n//\t\talert(\"value \" + value);\n\t\t$(\"#\" + value.id).datepicker({showOn: 'button', buttonImage: pathprefix + '/images/calendar.png', buttonImageOnly: true});\n\t\t//$(\"#\" + value.id).datepicker($.datepicker.regional['us']);\n\t \n//\t\t console.log(\"index\", index, \"value\", value);\n\t});\n}", "title": "" }, { "docid": "2693dda332c3ed9542d59f9cfbd52247", "score": "0.50664914", "text": "connectedCallback() {\n var date1;\n var date2;\n date1 = new Date(this.fnlmin);\n this.formattedStartDate = date1.getFullYear() + \"-\" + (date1.getMonth() + 1) + \"-\" + date1.getDate()\n date2 = new Date(this.fnlMax);\n this.formattedEndDate = date2.getFullYear() + \"-\" + (date2.getMonth() + 1) + \"-\" + date2.getDate()\n }", "title": "" }, { "docid": "669d4157c171948486671f1ec933e873", "score": "0.5061432", "text": "_attachEvents() {\r\n this.$managers.on('change', event => {\r\n this._onManagerChange(event);\r\n });\r\n\r\n this.$authors.on('select2:unselect', event => {\r\n this._onAuthorUnselect(event);\r\n });\r\n\r\n this.$authors.on('select2:clearing', event => {\r\n this._onAuthorClearing(event);\r\n });\r\n }", "title": "" }, { "docid": "5b26253de7a3e5ca31b9a67dc1ef1d8c", "score": "0.5055004", "text": "function plot2Dailies(chartDivID, selectorDivID, data1, data2) {\n var options = {\n xaxis: { mode: \"time\", tickLength: 5 },\n selection: { mode: \"x\" },\n grid: { \n markings: weekendAreas,\n hoverable:true\n }, \n legend: { \n backgroundColor: \"#FFFFFF\", // null means auto-detect\n backgroundOpacity: 0 // set to 0 to avoid background}\n },\n series: {\n lines: { \n show: true, \n lineWidth: 1 \n },\n points: { \n show: true,\n radius: 1\n }\n },\n tooltip: true,\n tooltipOpts: {\n content: \"<strong>%y</strong>, %x\"\n }\n };\n \n var plot = $.plot($(\"#\"+chartDivID), [data1, data2], options);\n \n var overview = $.plot($(\"#\"+selectorDivID), [data1, data2], {\n series: {\n lines: { show: true, lineWidth: 1 },\n shadowSize: 0\n },\n legend: {\n show: false\n },\n xaxis: { ticks: [], mode: \"time\", font: { family:\"Helvetica\",color:\"#FFF\"} },\n yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },\n selection: { mode: \"x\" }\n });\n\n // now connect the two\n \n $(\"#\"+chartDivID).bind(\"plotselected\", function (event, ranges) {\n // do the zooming\n plot = $.plot($(\"#\"+chartDivID), [data1, data2],\n $.extend(true, {}, options, {\n xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }\n }));\n\n // don't fire event on the overview to prevent eternal loop\n overview.setSelection(ranges, true);\n });\n \n $(\"#\"+selectorDivID).bind(\"plotselected\", function (event, ranges) {\n plot.setSelection(ranges);\n });\n \n}", "title": "" }, { "docid": "31c3a356f2a68dbe5c66ff250c2f4177", "score": "0.50479853", "text": "function datepickerInit(){\n $('.datepicker').datetimepicker({\n format: 'DD/MM/YY',\n icons: {\n time: \"fa fa-clock-o\",\n date: \"fa fa-calendar\",\n up: \"fa fa-arrow-up\",\n down: \"fa fa-arrow-down\"\n }\n });\n $('.datetimepicker').datetimepicker({\n format: 'DD/MM/YY - HH:mm',\n icons: {\n time: \"fa fa-clock-o\",\n date: \"fa fa-calendar\",\n up: \"fa fa-arrow-up\",\n down: \"fa fa-arrow-down\"\n }\n });\n}", "title": "" }, { "docid": "e638ec0dcf16f6a453868ba22e0d443e", "score": "0.5043915", "text": "function mkdfInitSelect2() {\n \n if ($('.woocommerce-ordering .orderby').length) {\n $('.woocommerce-ordering .orderby').select2({\n\t minimumResultsForSearch: Infinity\n });\n }\n \n if($('#calc_shipping_country').length) {\n $('#calc_shipping_country').select2();\n }\n \n if($('.cart-collaterals .shipping select#calc_shipping_state').length) {\n $('.cart-collaterals .shipping select#calc_shipping_state').select2();\n }\n }", "title": "" }, { "docid": "3d42dd8e2d69d2f735c6df5b011b2d6b", "score": "0.50429714", "text": "function cmbsruta_servicio_destino_codigo__init(){\n $(\"#cmbsruta_servicio_destino_codigo\").html('');\n $(\"#cmbsruta_servicio_destino_codigo\").selectpicker('refresh');\n }", "title": "" }, { "docid": "afb4953c6523c47455f78cdbbdc80efb", "score": "0.5039763", "text": "init(){\n let _this = this;\n /**\n * Add language by locale\n */\n moment.locale(app.locale);\n\n\n /**\n * Current data for date, time and calendar\n */\n let curTime = $(_this.wrapRange).data('time'); // add time\n let curSeconds = $(_this.wrapRange).data('seconds'); // add seconds\n let curFormat = $(_this.wrapRange).data('format'); // add date format\n let curSingle = $(_this.wrapRange).data('single'); // add one calendar\n let curRanges = $(_this.wrapRange).data('ranges'); // add left ranges\n let cur24Hour = $(_this.wrapRange).data('24-hour'); // add AM/PM time\n\n let curStartDate = $(_this.wrapRange).val();\n let curEndDate = $(_this.wrapRange).siblings('.js_datetime_picker-end').val();\n if ($(_this.wrapRange).val() === '') {\n $(_this.wrapRange).css('color', '#fff');\n curStartDate = moment().startOf('hour');\n }\n if(curEndDate === ''){\n curEndDate = moment().startOf('hour').add(32, 'hour');\n }\n\n /**\n * Default option\n * @type {{timePicker: jQuery, timePickerSeconds: jQuery, endDate: jQuery, singleDatePicker: jQuery, timePicker24Hour: jQuery, autoUpdateInput: boolean, parentEl: jQuery, locale: {format: jQuery}, startDate: jQuery}}\n */\n let options = {\n singleDatePicker: curSingle,\n timePicker: curTime,\n timePicker24Hour: cur24Hour,\n timePickerSeconds: curSeconds,\n autoUpdateInput: false,\n startDate: curStartDate,\n endDate: curEndDate,/*moment().startOf('hour').add(32, 'hour')*/\n\n // parentEl: $(_this.wrapRange).closest('.js_datetime_picker-blk'),\n language: moment.locale(app.locale),\n locale: {\n format: curFormat\n },\n };\n\n /**\n * Active ranges\n */\n if(curRanges != false) {\n\n options.ranges = {\n [app.translate.calendarOption1]: [moment().subtract(6, 'days'), moment()],\n [app.translate.calendarOption2]: [moment().subtract(13, 'days'), moment()],\n [app.translate.calendarOption3]: [moment().subtract(29, 'days'), moment()],\n [app.translate.calendarOption4]: [moment().subtract(89, 'days'), moment()],\n [app.translate.calendarOption5]: [moment().subtract(1, 'year').add(1,'day'), moment()],\n [app.translate.calendarOption6]: [moment().startOf('month'), moment().endOf('month')],\n //'All Time': [moment().subtract(30, 'years'), moment()]\n };\n }\n\n $(_this.wrapRange).daterangepicker(options);\n\n /**\n * Add data into input's on change\n */\n $(_this.wrapRange).on('apply.daterangepicker', function(ev, picker) {\n $(this).val(picker.startDate.format(curFormat));\n if ($(this).data('single', false)){\n $(this).css('color', '#555');\n $(this).siblings('.js_datetime_picker-end').val(picker.endDate.format(curFormat));\n }\n });\n\n /**\n * Hide calendar for time only active\n */\n $(_this.wrapRange).on('show.daterangepicker', function() {\n if($(this).data('date') === false){\n $(this).closest('.js_datetime_picker-blk').find('.calendar-table').hide();\n }\n });\n\n $(_this.wrapRange).on('cancel.daterangepicker', function(ev, picker) {\n $(this).val('');\n $(this).siblings('.js_datetime_picker-end').val('');\n });\n\n app.bodyEl.on('click', '.js_datetime_picker-end', function () {\n $(this).siblings('.js_datetime_picker').trigger( \"click\" );\n })\n }", "title": "" }, { "docid": "620924eb32861296f67e9e15bc1270a4", "score": "0.50385123", "text": "function setupStartAndEndTimeFields($startTimeField, $endTimeField, calEvent, timeslotTimes) {\n\n $startTimeField.empty();\n $endTimeField.empty();\n\n for (var i = 0; i < timeslotTimes.length; i++) {\n var startTime = timeslotTimes[i].start;\n var endTime = timeslotTimes[i].end;\n var startSelected = \"\";\n if (startTime.getTime() === calEvent.start_time.getTime()) {\n startSelected = \"selected=\\\"selected\\\"\";\n }\n var endSelected = \"\";\n if (endTime.getTime() === calEvent.end_time.getTime()) {\n endSelected = \"selected=\\\"selected\\\"\";\n }\n $startTimeField.append(\"<option value=\\\"\" + startTime + \"\\\" \" + startSelected + \">\" + timeslotTimes[i].startFormatted + \"</option>\");\n $endTimeField.append(\"<option value=\\\"\" + endTime + \"\\\" \" + endSelected + \">\" + timeslotTimes[i].endFormatted + \"</option>\");\n\n $timestampsOfOptions.start[timeslotTimes[i].startFormatted] = startTime.getTime();\n $timestampsOfOptions.end[timeslotTimes[i].endFormatted] = endTime.getTime();\n\n }\n $endTimeOptions = $endTimeField.find(\"option\");\n $startTimeField.trigger(\"change\");\n }", "title": "" }, { "docid": "8117fb1035bfb4a7bcfa8b3870b9f88d", "score": "0.5033891", "text": "function initDatapickers () {\n if(datesTabLoaded) return;\n var lng = $('#current-lng').val();\n// $('#start_dt').datepicker({format: 'yy-mm-dd', weekStart: 1, lng: lng});\n $('#end_dt').datepicker({dateFormat: 'yy-mm-dd', weekStart: 1, lng: lng});\n $('#public_dt').datepicker({dateFormat: 'yy-mm-dd', weekStart: 1, lng: lng});\n datesTabLoaded = true; \n }", "title": "" } ]
784390ff16fead82134e7b1edec59d12
Gets a particular UserPreferences property for a given Job.
[ { "docid": "d839609681a63c0380bd6bb797e16a8f", "score": "0.613588", "text": "static getUserPreferencesProperty(pageClientAPI, orderId, propertyName) {\n var propertyValue = '';\n if (libVal.evalIsEmpty(orderId)) {\n return propertyValue;\n }\n return libWo.getUserPreferences(pageClientAPI, orderId).then(userPreferences => {\n if (userPreferences.length > 0) {\n propertyValue = userPreferences.getItem(0)[propertyName];\n }\n if (libVal.evalIsEmpty(propertyValue)) {\n return '';\n } else {\n return propertyValue;\n }\n });\n }", "title": "" } ]
[ { "docid": "871c391cd1f86aa43822905cd33a1894", "score": "0.56211066", "text": "getUserProfilePropertyFor(loginName, propertyName) {\n const q = this.clone(Profiles, `getuserprofilepropertyfor(accountname=@v, propertyname='${propertyName}')`);\n q.query.set(\"@v\", `'${encodeURIComponent(loginName)}'`);\n return q.get();\n }", "title": "" }, { "docid": "94c9fef9eccf2be3eae7e97681755c97", "score": "0.54738456", "text": "getProfile(uid) {\n var profiles = JSON.parse(localStorage.getItem(\"PROFILES\"));\n for (let profile of profiles) {\n if (profile.uid == uid) {\n return profile;\n }\n }\n }", "title": "" }, { "docid": "f0893e6c48f6dd89ee3898e46cc07138", "score": "0.5452741", "text": "async function getUserPreferences(userId) {\n var db = await MongoClient.connect(process.env.PROD_MONGODB);\n var userDoc = await db.collection('users').find(\n { _id: new ObjectID(userId) }).project(\n {jobQueue: 0, appliedJobs: 0, ignoredJobs: 0, buriedJobs: 0}\n ).limit(1).next();\n \n //Note: Removed reference to matches\n var searchPreferences = await db.collection('preferences').find({userId: new ObjectID(userId)}).project({userId: 0}).toArray();\n await db.close();\n if (!searchPreferences) {\n return [[], [], [], [3, 3, 3]];\n }\n var locationPreferences = [];\n var jobTitlePreferences = [];\n var keywordPreferences = [];\n for (var i = 0; i < searchPreferences.length; i++) {\n switch (searchPreferences[i].type) {\n case 'location':\n locationPreferences.push(searchPreferences[i]);\n break;\n case 'jobTitle':\n jobTitlePreferences.push(searchPreferences[i]);\n break;\n case 'keyword':\n keywordPreferences.push(searchPreferences[i]);\n break;\n default:\n keywordPreferences.push(searchPreferences[i]);\n break;\n }\n }\n var locationPriority = userDoc.locationPriority;\n if (!locationPriority)\n locationPriority = 3;\n var jobTitlePriority = userDoc.jobTitlePriority;\n if (!jobTitlePriority)\n jobTitlePriority = 3;\n var keywordPriority = userDoc.keywordPriority;\n if (!keywordPriority)\n keywordPriority = 3;\n return [locationPreferences, jobTitlePreferences, keywordPreferences, [locationPriority, jobTitlePriority, keywordPriority]];\n}", "title": "" }, { "docid": "3c60ed3bf71c8a88878c8967b075fbe7", "score": "0.5448751", "text": "get(name) {\n return JSON.parse(localStorage.getItem('usersettings'))[name];\n }", "title": "" }, { "docid": "cf5a0d21bacc558209a8f32b3b518c16", "score": "0.5407617", "text": "getUserSetting(settingName){\n\n const userContext = store.getState().currentUserItemContext;\n\n const setting = UserSettings.findOne({\n userId: userContext.userId,\n settingName: settingName\n });\n\n if(setting){\n return setting.settingValue;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "cf56a051f37139717ab796f18c7b8f53", "score": "0.5360894", "text": "function getUserProperties() {\n\n // Get the current client context and PeopleManager instance.\n context = SP.ClientContext.get_current();\n var peopleManager = new SP.UserProfiles.PeopleManager(context);\n\n // Get user properties for the current logged in user. \n personProperties = peopleManager.getMyProperties();\n\n // Load the PersonProperties object and send the request.\n context.load(personProperties);\n\n context.executeQueryAsync(onUserPropertiesSuccess, onUserPropertiesFail);\n}", "title": "" }, { "docid": "7173f79cdbffb9870d8a7ee24437f460", "score": "0.5346241", "text": "function printVal(key) {\n if (key == 'sheetID' || key == 'host' || key == 'projectKey' || key == 'editorEmails') {\n var propVal = PropertiesService.getScriptProperties().getProperty(key);\n } else {\n var propVal = PropertiesService.getUserProperties().getProperty(key);\n }\n return propVal;\n}", "title": "" }, { "docid": "4864d245b172eee418def9ce199d32b2", "score": "0.5290768", "text": "function getUserDataUsingJSOM()\n{\n // Get the current client context and PeopleManager instance.\n var clientContext = SP.ClientContext.get_current();\n var peopleManager = new SP.UserProfiles.PeopleManager(clientContext);\n\n // Get user properties for the current user\n personProperties = peopleManager.getMyProperties();\n\n // Load the PersonProperties object and send the request.\n clientContext.load(personProperties);\n clientContext.executeQueryAsync(onRequestSuccess, onRequestFail);\n}", "title": "" }, { "docid": "c0b56c7ee795b30b745bfd916961224d", "score": "0.5282141", "text": "static getUserPreferences(pageClientAPI, orderId) {\n var queryOptions = '$orderby=PreferenceName';\n if (!libVal.evalIsEmpty(orderId)) {\n queryOptions += \"&$filter=(PreferenceName eq '\" + orderId + \"')\";\n }\n return pageClientAPI.read('/SAPAssetManager/Services/AssetManager.service', 'UserPreferences', [], queryOptions);\n }", "title": "" }, { "docid": "fe16febfe1d9bdbaae481db1abf0cd40", "score": "0.5278437", "text": "function _getPropertyProfile (_this,_propertyPublicOrPrivateName) {\n\t\t\tvar _class = _getClass (_this);\n\t\t\treturn (\n\t\t\t\t_class._propertyProfilesByPublicNames [_propertyPublicOrPrivateName] ||\n\t\t\t\t_class._propertyProfilesByPrivateNames [_propertyPublicOrPrivateName]\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "194f569671620c26d7ab919b28501135", "score": "0.526504", "text": "function get_prefs(username) {\n var return_data = null;\n XHR.setCallback(function (data) {\n return_data = data;\n },\n function (error) {\n console.log('There was a failure: ' + error);\n });\n XHR.GET_SPECIFIC('/parse/classes/Visitors', JSON.stringify({\n \"username\": username\n }));\n if (return_data === null) {\n return null;\n }\n return JSON.parse(return_data).results[0].pref;\n}", "title": "" }, { "docid": "286944c9de5de26f1f621dcc65d7fae2", "score": "0.5264215", "text": "function SSGetPref(pref, defaultValue)\r\n {\r\n if(ShiftSpace.User.isLoggedIn())\r\n {\r\n var key = [ShiftSpace.User.getUsername(), pref].join('.');\r\n return getValue(key, defaultValue);\r\n }\r\n return defaultValue;\r\n }", "title": "" }, { "docid": "451bfc0c9ed8bdee32e9d176387e677f", "score": "0.5242522", "text": "get userProfile() {\n return this.profileLoader.userProfile;\n }", "title": "" }, { "docid": "c05bef80b12998d11f8bf7f544fad213", "score": "0.52300763", "text": "get ownerUserProfile() {\n return this.profileLoader.ownerUserProfile;\n }", "title": "" }, { "docid": "76fde0def095f945b1179468c84130fe", "score": "0.5229983", "text": "get userProfile() {\n return Object(_operations_js__WEBPACK_IMPORTED_MODULE_6__[\"spPost\"])(this.clone(ProfileLoaderFactory, \"getuserprofile\"));\n }", "title": "" }, { "docid": "71de85a761bbc79da538023aa6f1c73a", "score": "0.51886", "text": "function getUser() {\n return getFromUrlParamOrLocalStorage('h_user');\n}", "title": "" }, { "docid": "7b2347987badb4ae92c09df1121e09b5", "score": "0.5181935", "text": "function getProfile() {\n\t\t\treturn userData.getUser().then(_getUserSuccess, _getUserError);\n\t\t}", "title": "" }, { "docid": "cf23ae803e59df56c7654915a1874409", "score": "0.5132255", "text": "function SSGetPrefForSpace(spaceName, pref)\r\n {\r\n if(ShiftSpace.User.isLoggedIn())\r\n {\r\n var key = [ShiftSpace.User.getUsername(), spaceName, pref].join('.');\r\n var value = getValue(key, null);\r\n return value;\r\n }\r\n }", "title": "" }, { "docid": "b5103f2f04a2dc0b6c874d55f614b3d0", "score": "0.5122033", "text": "get profile() {\n const value = this.get(PROFILE_STORAGE_KEY);\n if (value) {\n const profile = new UserProfile();\n // Patch in the values\n Object.assign(profile, JSON.parse(value));\n return profile;\n }\n }", "title": "" }, { "docid": "b5103f2f04a2dc0b6c874d55f614b3d0", "score": "0.5122033", "text": "get profile() {\n const value = this.get(PROFILE_STORAGE_KEY);\n if (value) {\n const profile = new UserProfile();\n // Patch in the values\n Object.assign(profile, JSON.parse(value));\n return profile;\n }\n }", "title": "" }, { "docid": "17437b14615f47462508d94f0ae3bcbc", "score": "0.51184034", "text": "getUserProfile(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast);\n return userProfiles.get(args.key, feathersParams).then(extractFirstItem);\n }", "title": "" }, { "docid": "f0ef0ca05ea5c0039822c230680b85e5", "score": "0.5108387", "text": "function getObjOnlineUser() {\n const arrData = getLocal('users');\n const whoOnline = localStorage.getItem('isOnline');\n\n const dataUser = arrData.find(el => {\n if (el.userName === whoOnline) {\n return el;\n }\n });\n\n return dataUser;\n}", "title": "" }, { "docid": "04c85a1b6993ba404e46b4ea5594b7eb", "score": "0.510413", "text": "function getProperty(obj, prop) {\n\t\tvar parts = prop.split('#');\n\n\t\ttry {\n\t\t\t// global object binding\n\t\t\tif (parts.length == 2) {\n\t\t\t\tobj = JPtr.get(window, toPointer(parts[0]));\n\t\t\t\treturn JPtr.get(obj, toPointer(parts[1]));\n\t\t\t}\n\n\t\t\treturn JPtr.get(obj, toPointer(parts[0]));\n\t\t} catch (exp) {\n\t\t\treturn undefined;//In JS if you try to get not existing property you get undefined but Jpointer trows exception\n\t\t}\n\t}", "title": "" }, { "docid": "044171ec836d4a76a91a15f53eb8ff99", "score": "0.50840324", "text": "getUserId() {\n const profile = this.getUserProfile();\n if (profile) {\n return profile.split(\"/\")[1];\n }\n return null;\n }", "title": "" }, { "docid": "11cc7c0d4edaee09ee80a2b21295453f", "score": "0.5078212", "text": "function prefGetter(aPrefName) {\n\tvar typeAsStr = prefTypeAsStr(prefs[aPrefName].type);\n\n\ttry {\n\t\tvar rez_pref_val = Services.prefs['get' + typeAsStr + 'Pref'](myPrefBranch + aPrefName);\n\t} catch (ex) {\n\t\t// probably the pref doesnt exist\n\t\treturn prefs[aPrefName].default;\n\t}\n\n\tif (prefs[aPrefName].values && prefs[aPrefName].values.indexOf(rez_pref_val) === -1) {\n\t\tconsole.error('WARN will not return gotten pref from pref system, will return default. BECAUSE gotten pref from pref system is:', rez_pref_val, 'and this prefName has a list of accepted values, and the aNewVal is not among them, the accepted values are:', prefs[aPrefName].values);\n\t\treturn prefs[aPrefName].default;\n\t} else {\n\t\treturn rez_pref_val;\n\t}\n}", "title": "" }, { "docid": "66f9a93e9847407d6162997b956e6999", "score": "0.50761235", "text": "function GetPref(name) {\n let type = Services.prefs.getPrefType(name);\n switch (type) {\n case Services.prefs.PREF_STRING:\n return Services.prefs.getCharPref(name);\n case Services.prefs.PREF_INT:\n return Services.prefs.getIntPref(name);\n case Services.prefs.PREF_BOOL:\n return Services.prefs.getBoolPref(name);\n default:\n throw new Error(\"Unknown type\");\n }\n}", "title": "" }, { "docid": "ba6a0f6f98fd7e1f4d89ef84a9fef23f", "score": "0.5073799", "text": "function getProperty(key)\n{\n var scriptProperties = PropertiesService.getScriptProperties();\n try\n {\n return scriptProperties.getProperty(key);\n }\n catch (error)\n {\n Logger.log(error);\n return null;\n }\n}", "title": "" }, { "docid": "80b1e304c4b18b766e8f2b9a1b2dc20b", "score": "0.50615394", "text": "function getPrefElem(prefName) {\n var elems, i, ilength, j, jlength, pref, prefs;\n\n prefName = root + prefName;\n\n elems = prefwindow.getElementsByTagName(\"preferences\");\n ilength = elems.length;\n for (i = 0; i < ilength; ++i) {\n prefs = elems[i].getElementsByAttribute(\"name\", prefName);\n\n jlength = prefs.length;\n for (j = 0; j < jlength; ++j) {\n pref = prefs[j];\n if (pref.localName === \"preference\" &&\n pref.namespaceURI === globaldefs.XUL_NS) {\n return pref;\n }\n }\n }\n\n return null;\n }", "title": "" }, { "docid": "85611a3ba8550515d6fa6c1b5a15c537", "score": "0.5059494", "text": "function getUser() {\n $log.debug('Getting user email');\n $log.debug(chrome);\n if(chrome.identity) {\n chrome.identity.getProfileUserInfo(function(user){\n $log.debug(user);\n return user;\n });\n } else {\n return {};\n }\n }", "title": "" }, { "docid": "b8b9dca8b44935ccdc84b3c8086df917", "score": "0.502974", "text": "get user() {\n var _user;\n try {\n _user = JSON.parse(window.sessionStorage.easyUser);\n } catch (e) {\n return _user;\n }\n return _user;\n }", "title": "" }, { "docid": "17b0fbd5eff17e0a3c2e83f0e315f380", "score": "0.501499", "text": "function getUser() {\n return localStorage.getItem(USER_KEY);\n}", "title": "" }, { "docid": "9cd5710ec2ea0305fadc9ae72c5e20ea", "score": "0.5014485", "text": "function getXPUser(user)\r\n{\r\n if (user in config_save.xps)\r\n return config_save.xps[user];\r\n\r\n return 0;\r\n\r\n}", "title": "" }, { "docid": "bea75676319fe72f48379669db2b2bdd", "score": "0.5012136", "text": "function getUserProfile() {\n var ref = new Firebase(FIREBASE_URL);\n var userProfile = $firebaseObject(ref.child('profiles').child(authenticationService.getUserAuthData().uid));\n return userProfile;\n }", "title": "" }, { "docid": "f339fc8666759c5a7a3372d7f1468d6e", "score": "0.50095814", "text": "async function getUserPreferences() {\r\n // chrome.storage.sync.clear();\r\n let p = new Promise(function (resolve, reject) {\r\n chrome.storage.sync.get(\r\n [\"country\", \"country_flag\", \"services\", \"popup\", \"rent_buy\", \"similar\"],\r\n function (options) {\r\n resolve([\r\n options.country,\r\n options.services,\r\n options.country_flag,\r\n options.popup,\r\n options.rent_buy,\r\n options.similar,\r\n ]);\r\n }\r\n );\r\n });\r\n\r\n const preferences = await p;\r\n return preferences;\r\n}", "title": "" }, { "docid": "f1ba4d99c97937bb00152d3ae0ad6cc2", "score": "0.49890074", "text": "getProfile() {\n return helpers.toObject(omit(this, ['login']))\n }", "title": "" }, { "docid": "0cf4e68b3373367d9c60cc7f7d97f505", "score": "0.49723497", "text": "get(prop) {\r\n let storage = this.props.storage[this.name];\r\n return storage && storage[prop];\r\n }", "title": "" }, { "docid": "490f834681a4e28c1cf6d2817fdf8ab4", "score": "0.49693143", "text": "getMe() {\n console.log(\"UserProfileService.getMe()\");\n // TODO: cache profiles\n return this.__getMe();\n }", "title": "" }, { "docid": "4d261caa0934cc0fb670c34ee6df2a92", "score": "0.4965216", "text": "function getUserProperties_()\n{\n \n var userProps = UserProperties.getProperties();\n \n evernoteMail = userProps['evernoteMail'];\n if( evernoteMail == undefined ) {\n findEvernoteMail_();\n }\n \n // Global variables and default settings\n // Read from user properties, otherwise use defaults\n \n var props = {\n\t'tag' : '',\n\t'log' : '',\n\t'nacct' : 1,\n\t'fields' : 'From, To, Cc, Date',\n\t'hdrcss' : 'border-bottom:1px solid #ccc;padding-bottom:1em;margin-bottom:1em;',\n\t'version' : 0,\n\t'nbk_label' : 'Evernote',\n\t'tag_label' : '',\n\t'sent_label' : '',\n 'keep_sent' : 'off',\n 'version' : 0\n };\n \n for( var p in props ) {\n var key = 'gm2en_' + p;\n if( userProps[key] == undefined ) {\n switch( p ) {\n case 'log' :\n // Create new log sheet\n cfg[p] = createLogSheet_();\n break;\n \n default:\n // Use default value\n cfg[p] = props[p];\n }\n UserProperties.setProperty(key, cfg[p]);\n } else {\n cfg[p] = userProps[key];\n }\n }\n cfg.evernoteMail = evernoteMail;\n}", "title": "" }, { "docid": "51708e7da36815b19bbb7ea72c408b4e", "score": "0.49584273", "text": "function getDefinedProp(name: $Keys<Props & ScrollToTopProps>) {\n // Try to return prop if it exists in props\n if (props[name] !== undefined) return props[name];\n // Else return component's default value\n return ScrollToTopComponent.defaultProps[name];\n }", "title": "" }, { "docid": "6998bb2c32a68192403bbca78fb023bb", "score": "0.49575487", "text": "getLocalStorageUser() {\n\t\treturn JSON.parse(localStorage.getItem('user'));\n\t}", "title": "" }, { "docid": "e22b7bd88d3bda749e240b9812d06580", "score": "0.49445218", "text": "function getUser() {\n if(localStorage.token) {\n return JSON.parse(atob(localStorage.token.split('.')[1])).user;\n }\n}", "title": "" }, { "docid": "f20a1716ca5f8680dedef46f90991048", "score": "0.4939228", "text": "function getProps(identifier) {\n var propKeysList = propKeys(identifier);\n var props = [];\n for (let x of propKeysList) {\n var prop = userProperties.getProperty(x);\n prop = JSON.parse(prop);\n props.push(prop);\n }\n return props;\n}", "title": "" }, { "docid": "efcaf1c9192cc201c61de0e50e514594", "score": "0.49207342", "text": "function getProfileUser() {\n\tif (globalUserdata[\"browser\"])\n\t\treturn \"browser\";\n\treturn \"current\";\n}", "title": "" }, { "docid": "7d8bb4c02d6893d455514c4ebe6cea91", "score": "0.49204946", "text": "function getJobInfo(uid) {\n console.assert(uid in GLC_job_info);\n return GLC_job_info[uid];\n}", "title": "" }, { "docid": "ebc4a0aa03b6dc165058e8688e393f57", "score": "0.49068463", "text": "function _getUserPrefs ()\n{\n $.getJSON(PM_URI + '/pm/info', function (data, status, jqXHR) {\n if (status == \"success\") {\n m_user = data;\n }\n });\n}", "title": "" }, { "docid": "0db9ea6a02565d3434d7083a85c4564e", "score": "0.48531678", "text": "function getUser()\r\n {\r\n var currUser = JSON.parse(Cookies.get('loggedUser'));\r\n var retrieve = localStorage.getItem(currUser);\r\n return retrieve;\r\n }", "title": "" }, { "docid": "262073060810eb047398c1bf6bd7c815", "score": "0.48478928", "text": "function getProperty(key) {\n return key in properties ? properties[key] : null;\n }", "title": "" }, { "docid": "a48371b50251ee56dcd238cbf480312c", "score": "0.48327225", "text": "static getUserData() {\n const profileData = storage.getItem(authenticationKey);\n\n return profileData ? JSON.parse(profileData) : null;\n }", "title": "" }, { "docid": "bd9cfb832421e2726ec1b60d5ba95d18", "score": "0.48194978", "text": "getUserProfile(userId) {\n console.log(\"UserProfileService.getProfile(\" + userId + \")\");\n // TODO: cache profiles\n return this.__getUserProfile(userId);\n }", "title": "" }, { "docid": "6bd3718b124309005a16f86594df8b0c", "score": "0.48186374", "text": "function localstorageGetJobId(){\n\treturn localStorage.getItem(\"jobId\");\n}", "title": "" }, { "docid": "201182c76e391cbc8596a5d553bdea20", "score": "0.48109138", "text": "static getProfile() {\n // Retrieves the profile data from localStorage\n const profile = localStorage.getItem('profile')\n return profile ? JSON.parse(localStorage.profile) : {}\n }", "title": "" }, { "docid": "7e67830b6e9b82d2c0cb19d916d9b908", "score": "0.47947875", "text": "getPropertiesFor(loginName) {\n const q = this.clone(Profiles, \"getpropertiesfor(@v)\");\n q.query.set(\"@v\", `'${encodeURIComponent(loginName)}'`);\n return q.get();\n }", "title": "" }, { "docid": "5054a67743d08eba7df131b5a4a63be2", "score": "0.4791816", "text": "getLocalStorageUser() {\n return JSON.parse(localStorage.getItem(\"user\"));\n }", "title": "" }, { "docid": "4faa7676dffb77fef9203baacfc32881", "score": "0.47692466", "text": "function MygetIntPref(pref, key, unexists){ \n try {\n return pref.getIntPref(key);\n }catch(e) {\n return unexists;\n }\n }", "title": "" }, { "docid": "71e8908a1f51e5a3e17719953a10d4de", "score": "0.47673938", "text": "function getUserFavorite(component) {\r\n\r\n if (!user || !user.userPreferences || !user.userPreferences.favorites) {\r\n return null;\r\n }\r\n var delimitedStr = getUserFavoriteStr(component);\r\n\r\n var matchFound = false;\r\n for (var i = 0; i < user.userPreferences.favorites.length; i++) {\r\n if (user.userPreferences.favorites[i].indexOf(delimitedStr) != -1) {\r\n return user.userPreferences.favorites[i];\r\n }\r\n }\r\n return null;\r\n }", "title": "" }, { "docid": "20ccb2189fae9bc865588d032e5ce0c5", "score": "0.47546458", "text": "function getAJob(){\n\tconsole.log('checking for job. sure!');\n\n\t//-- run in an atomic manner\n\t//-- @TODO - check if there is a job\n\t//-- @TODO - assign myself to the job\n\t//-- @TODO - query if I own the job I asked for\n\t//-- @TODO - return null if I didn't get it... :(\n\tthis.jobId = '' + (new Date().getTime());\n\n\treturn (this.jobId);\n}", "title": "" }, { "docid": "a8b66bcd285b546bc7999e760fbd4a73", "score": "0.47477776", "text": "get ownerUserProfile() {\n let q = this.getParent(ProfileLoaderFactory, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\n if (this.hasBatch) {\n q = q.inBatch(this.batch);\n }\n return Object(_operations_js__WEBPACK_IMPORTED_MODULE_6__[\"spPost\"])(q);\n }", "title": "" }, { "docid": "f2e7bbdca83c90165bb20fc8b1611e95", "score": "0.47370815", "text": "function userOrder(order) {\n let parsedUserPrefs = JSON.parse(getItem('userPrefs'));\n if (arguments.length === 0) { // getter\n return parsedUserPrefs[0];\n } else { // setter\n parsedUserPrefs[0] = order;\n updateItem('userPrefs', JSON.stringify(parsedUserPrefs));\n }\n }", "title": "" }, { "docid": "095fecbc61bbcefd1bd61a17651d705c", "score": "0.47153285", "text": "function workerGetPrefs()\r{\r\tvar getprefsObj = {\r\t\trunning: workerIsRunning,\r\t\tperiod: workerPollingPeriod,\r\t\ttimeout: workerPollingTimeout,\r\t\t//alertperiod: workerAlertPeriod,\r\t\tstatcycle: workerPollingStatCycle\r\t};\r\treturn getprefsObj;\r}", "title": "" }, { "docid": "aca28fb09a75eebda2b4928372953807", "score": "0.47143704", "text": "function get(cache, prefType, prefsRoot, prefName) {\n\t var cachedPref = cache.get(prefName);\n\t if (cachedPref !== undefined) {\n\t return cachedPref;\n\t }\n\t var value = Services.prefs[\"get\" + prefType + \"Pref\"]([prefsRoot, prefName].join(\".\"));\n\t cache.set(prefName, value);\n\t return value;\n\t}", "title": "" }, { "docid": "12ad8af30d6208af0b693bceda9b1861", "score": "0.47133255", "text": "static get getSessionUserId() {\n return Object.keys(sessionStorage).map(key => {\n if (key.includes(\"authUser\")) {\n const auth = sessionStorage.getItem(key);\n if (auth && auth.length > 0) {\n const user = JSON.parse(auth);\n return user.uid;\n }\n }\n return constants.EMPTY_OBJECT;\n });\n }", "title": "" }, { "docid": "8bffe7fda9db0c8057a503d42d4cde8d", "score": "0.47098482", "text": "function getRoomUserInfoFromStorage() {\n\treturn JSON.parse(sessionStorage.getItem(commonConstants.GUEST_ROOM_USER_INFO));\n}", "title": "" }, { "docid": "fbc2348084584190f904de2ea794c5a1", "score": "0.4706581", "text": "function getHint(key, registry, plugin) {\n // First, give priority to checking if the hint exists in the user data.\n let hint = plugin.data.user[key];\n // Second, check to see if the hint exists in composite data, which folds\n // in default values from the schema.\n if (!hint) {\n hint = plugin.data.composite[key];\n }\n // Third, check to see if the plugin schema has defined the hint.\n if (!hint) {\n hint = plugin.schema[key];\n }\n // Finally, use the defaults from the registry schema.\n if (!hint) {\n const { properties } = registry.schema;\n hint = properties && properties[key] && properties[key].default;\n }\n return typeof hint === 'string' ? hint : '';\n }", "title": "" }, { "docid": "fbc2348084584190f904de2ea794c5a1", "score": "0.4706581", "text": "function getHint(key, registry, plugin) {\n // First, give priority to checking if the hint exists in the user data.\n let hint = plugin.data.user[key];\n // Second, check to see if the hint exists in composite data, which folds\n // in default values from the schema.\n if (!hint) {\n hint = plugin.data.composite[key];\n }\n // Third, check to see if the plugin schema has defined the hint.\n if (!hint) {\n hint = plugin.schema[key];\n }\n // Finally, use the defaults from the registry schema.\n if (!hint) {\n const { properties } = registry.schema;\n hint = properties && properties[key] && properties[key].default;\n }\n return typeof hint === 'string' ? hint : '';\n }", "title": "" }, { "docid": "58b8e7024f93cad53a3f77555ddfad31", "score": "0.4691374", "text": "getProfile() {\n return localStorage.getItem(\"profile\");\n }", "title": "" }, { "docid": "547f135e06c8524da93490a67d40a125", "score": "0.46841863", "text": "getCurrentUserId() {\n return JSON.parse(localStorage.getItem(\"user_id\"));\n }", "title": "" }, { "docid": "eeb7d6390fb972efb9055e07f50dc294", "score": "0.46726698", "text": "function getProp() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var prop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_OPTIONS;\n\n var propToFind = options.ignoreCase ? prop.toUpperCase() : prop;\n\n return props.find(function (attribute) {\n // If the props contain a spread prop, then skip.\n if (attribute.type === 'JSXSpreadAttribute') {\n return false;\n }\n\n var currentProp = options.ignoreCase ? (0, _propName2.default)(attribute).toUpperCase() : (0, _propName2.default)(attribute);\n\n return propToFind === currentProp;\n });\n}", "title": "" }, { "docid": "48aa598d3c9b4bde403ab588bc1e5350", "score": "0.46721944", "text": "function getPref(key) {\n if (!key) {\n return objectUtil.assign({}, cachedPrefs);\n }\n return cachedPrefs[key];\n }", "title": "" }, { "docid": "51f898149e0c1c41aff715e8d79de4b3", "score": "0.46614546", "text": "function getUserDataFromStorage() {\n return JSON.parse(localStorage.getItem('users'))\n}", "title": "" }, { "docid": "175632e8a990654cee0240e2eb9d3897", "score": "0.4660905", "text": "function getUser() {\n\t\tvar userSesseion = sessionStorage.getItem('user');\n\t\tif (typeof userSesseion == typeof undefined) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn JSON.parse(userSesseion);\n\t\t}\n\t}", "title": "" }, { "docid": "3ab6e2ab3406bf4ba870cac3f32dcd1f", "score": "0.46392143", "text": "function getWkUserData() {\n return JSON.parse(localStorage.wkUserData);\n}", "title": "" }, { "docid": "bab3c8ad1f8cf2d34dcac2bd401f2d3a", "score": "0.46322802", "text": "getUser(user) {\n\t\tlocalStorage.getItem('user');\n\t}", "title": "" }, { "docid": "4d398b7d0f3e6232f4162f3447eb6bbb", "score": "0.46158177", "text": "function wr_getPref(keyName)\n{\n\tvar keyValue = null;\n\n\tif (window.widget)\n\t{\n\t\tkeyValue = widget.preferenceForKey(keyName);\n\t}\n\n\treturn keyValue;\n}", "title": "" }, { "docid": "4667da955f9c6839e40e75c03c2b0759", "score": "0.4614609", "text": "function get_stored_user_id() {\n return localStorage.getItem('user_id');\n}", "title": "" }, { "docid": "31b132d4f583fba81decfc2c3a7c0fe2", "score": "0.4598597", "text": "getUserId() {\n const payload = this.getPayload();\n if (payload && payload.sub) {\n return payload.sub;\n }\n return null;\n }", "title": "" }, { "docid": "53b4bc51010ae919a14acdf29ca65219", "score": "0.4596814", "text": "function getProp(obj, key) {\n return obj[key];\n}", "title": "" }, { "docid": "2313107566b1ba176f31e52a590b36c6", "score": "0.4595744", "text": "getUser () {\n\n\t\t\tlet user = localStorage.getItem('user')\n\n\t\t\tconsole.log(user)\n\t\t\tif ( ! user ){\n\t\t\t\tconsole.log('no user')\n\t\t\t\treturn null\n\n\t\t\t}else{\n\t\t\t\tconsole.log('yes user')\n\t\t\t\treturn user\n\n\t\t\t}\n\t\t\t\n\t\t}", "title": "" }, { "docid": "b7da3c74750199433722a3912c605eec", "score": "0.45905373", "text": "function getPreferences() {\n return data;\n }", "title": "" }, { "docid": "871392276ab267cbb590fe1847e6aa38", "score": "0.45882094", "text": "function getUserDataAttr(fieldId, bucket, key) {\n var userData = userDataForField(fieldId)\n , bucketVal = userData[bucket]\n , val = bucketVal ? bucketVal[key] : null\n ;\n\n return val;\n }", "title": "" }, { "docid": "d328ac187507b8f695f6a5983214bd6b", "score": "0.45867327", "text": "function getLoggedInUser() {\n return storageService.getStorage('user')\n}", "title": "" }, { "docid": "3425d13d8f721f043f8141aa0fd3038d", "score": "0.4580147", "text": "function getProfile() {\n\t\t\t$scope.$emit('loading-on');\n\t\t\treturn UserData.getUser().then(_getUserSuccess, _getUserError);\n\t\t}", "title": "" }, { "docid": "738db5665152d6f746c1e0ab9a004c48", "score": "0.45770487", "text": "async getMemberProfile(userId) {\n if (!this._session) {\n (0, _warning.default)(false, 'getMemberProfile: should not be called in context without session');\n return null;\n }\n\n switch (this._session.type) {\n case 'room':\n return this._client.getRoomMemberProfile(this._session.room.id, userId);\n\n case 'group':\n return this._client.getGroupMemberProfile(this._session.group.id, userId);\n\n default:\n (0, _warning.default)(false, 'getMemberProfile: should not be called in context which is not room or group session');\n return null;\n }\n }", "title": "" }, { "docid": "bf1864c6e5cec5082dc1a489f9fe0420", "score": "0.4573209", "text": "function GetPropertyValue(sykkelValg, dataToRetrieve) {\n return dataToRetrieve\n .split('.') // split string based on `.`\n .reduce(function(o, k) {\n return o && o[k]; // get inner property if `o` is defined else get `o` and return\n }, sykkelValg); // set initial value as object\n}", "title": "" }, { "docid": "85b6aad3b14040932d1660921949a079", "score": "0.45719135", "text": "function getPreferencesEnabled(){\n\treturn {\n\t\t// show preferences only if the sys_id of the url is the same user that is logged on\n\t preferencesPanelEnabled : GlideStringUtil.nil($sp.getParameter('sys_id')) || $sp.getParameter('sys_id') == gs.getUserID(),\n\n\t\t//certain properties are visible in some cases\n\t\tlanguageEnabled : pm.isActive('com.glide.i18n') && gs.getProperty('glide.ui.language_picker.enabled', 'true') == 'true',\n\t\ttimezoneEnabled: gs.hasRole(gs.getProperty('glide.timezone_changer.roles'))\n\t}\n}", "title": "" }, { "docid": "8e34c621a2ebf6896a39339ee527c6a5", "score": "0.4566639", "text": "async getUserProfile() {\n if (!this._session) {\n (0, _warning.default)(false, 'getUserProfile: should not be called in context without session');\n return null;\n }\n\n if (!this._session.user) {\n (0, _warning.default)(false, 'getUserProfile: should not be called in context without user in session');\n return null;\n }\n\n switch (this._session.type) {\n case 'room':\n return this._client.getRoomMemberProfile(this._session.room.id, this._session.user.id);\n\n case 'group':\n return this._client.getGroupMemberProfile(this._session.group.id, this._session.user.id);\n\n case 'user':\n default:\n return this._client.getUserProfile(this._session.user.id);\n }\n }", "title": "" }, { "docid": "5f97228b2932e2c634faa50a611e2777", "score": "0.45643976", "text": "function\tgetProperty ( propname )\r\n\t {\r\n\r\n\t\tif ( propname !== undefined )\r\n\t\t\treturn ( properties [ propname ] && properties [ propname ] ( ) ) ;\r\n\t\telse\r\n\t\t\tthrow ( \"Invalid argument type for the $.browser.prop() function.\" ) ;\r\n\t }", "title": "" }, { "docid": "614f575909d3d41114f8f2db51f0a91c", "score": "0.45445058", "text": "function getLastKnownUser(chromebook) {\n\n var users = chromebook[\"recentUsers\"]\n var user = users[0];\n var email = user[\"email\"]\n\n return email;\n}", "title": "" }, { "docid": "331e4306bf43151325a879081b25e56a", "score": "0.45353022", "text": "function getUser(username)\r\n {\r\n var retrieve = localStorage.getItem(username);\r\n return retrieve;\r\n }", "title": "" }, { "docid": "496791cd5600a667843273f6cd12fbbe", "score": "0.45312554", "text": "async getProfileForCaseworker(username, id) {\n let { Item: profile } = await this.client.get({\n TableName : this.residentProfilesTable,\n Key: {\n caseworker: username,\n id\n }\n }).promise();\n return profile;\n }", "title": "" }, { "docid": "251cca6b89033aa0033f6f4dc0e7fc5c", "score": "0.45236543", "text": "get prefService() {\n return Services.prefs;\n }", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "eed1b222b077aefaf5cf5ec701e500c1", "score": "0.45227093", "text": "function getPropertyValue(cssRule, prop) {\n try {\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" } ]
2ac7c8de7a2e899d0214b4d02d829801
save the new note to be able to retrieve later
[ { "docid": "7db33256961c126f9a91b02c5c002fb0", "score": "0.6813826", "text": "function saveNote(title,body){\n chrome.storage.sync.set({ [title] : body });\n errorText.innerHTML = \"Notes saved!\";\n // chrome.storage.sync.get(null,function(result){\n // console.log(result);\n // });\n}", "title": "" } ]
[ { "docid": "0dc3f5f948e3695c69ab429c38fb7c7f", "score": "0.78198576", "text": "function saveNote(noteID, note) {\n // Open the object store where all f the notes are stored,\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n \n console.log(note);\n \n var transaction = objectStore.get(noteID);\n // Wait for a success message.\n transaction.onsuccess = function(e) { \n var oldNote = e.target.result;\n oldNote.note = note;\n \n // Update the note.\n objectStore.put(oldNote);\n };\n}", "title": "" }, { "docid": "cf669e8ce119e032db9c4de4ab81dd33", "score": "0.7805982", "text": "function saveNote() {\n var sText = document.getElementById('note_area').value;\n\n if (oSelectedNote == null) {\n note = new Note();\n note.sNote = sText;\n\n oData.jsFormula.addNote(note);\n\n oNotesTable.row.add([\n note.nuNote,\n note.iIdNote,\n note.sNote\n ]).draw( false );\n }\n else {\n oData.jsFormula.getNote(oSelectedNote.nuNote).sNote = sText;\n $('#notes_table').dataTable().fnUpdate(sText , oSelectedNote.nuNote, 2);\n }\n\n initNote();\n}", "title": "" }, { "docid": "2f108096e6ccc4e52b08d614359dfc19", "score": "0.7764918", "text": "saveNote(note) {\n let savedNote = {\n title: note.title,\n text: note.text,\n };\n\n return this.getNotes()\n .then((notes) => [...notes, savedNote])\n .then((newNote) => this.write(newNote))\n .then(() => savedNote);\n\n }", "title": "" }, { "docid": "69c0c5bf7fdaebd254d47e7e7a4bdcc6", "score": "0.7687004", "text": "function note_save()\n {\n var note_obj;\n // grab the note typed into the input box\n var new_note = $(\".bootbox-body textarea\").val().trim();\n\n if (new_note)\n {\n note_obj =\n {\n _id: $(this).data(\"headline\")._id,\n text: new_note\n };\n $.post(\"/api/notes\", note_obj).then(function()\n {\n // on success, close the modal\n bootbox.hideAll();\n });\n }\n }", "title": "" }, { "docid": "755e38cde9916e765dc396f7d9ffa17c", "score": "0.767482", "text": "function NoteSave(){\n\t\tvar noteData;\n\t\tvar newNote = $(\".bootbox-body textarea\").val().trim();\n\t\tif(newNote){\n\t\t\tnoteData = {\n\t\t\t\t_id: $(this).data(\"article\")._id,\n\t\t\t\tnoteText: newNote\n\t\t\t};\n\t\t\t$.post(\"/scrape/notes\", noteData).then(function(){\n\t\t\t\tbootbox.hideAll();\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "3e71685a12b6d3a50860ef9cf255ffaf", "score": "0.7571627", "text": "function saveNote() {\n var noteContent = [];\n // Looping through the paragraphs and getting the contents of them\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n noteContent.push(paragraph.getContent());\n });\n\n // Saving the note content in the server\n utils.showLoadingOverlay($('#paragraphs'));\n $.ajax({\n type: 'PUT',\n data: JSON.stringify(noteContent),\n url: constants.API_URI + 'notes/' + noteSelf.name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully saved');\n\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n if (paragraph.paragraphClient != null) {\n paragraph.paragraphClient.unsavedContentAvailable = false;\n }\n });\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n utils.hideLoadingOverlay($('#paragraphs'));\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay($('#paragraphs'));\n }\n });\n }", "title": "" }, { "docid": "3c0c4a9feba7ada3fb4acd63b81a0f7d", "score": "0.7448321", "text": "function saveNote() {\n window.localStorage.setItem(notes.value, editor.value);\n}", "title": "" }, { "docid": "41c4e3e23d234ed9d174935a5429db67", "score": "0.7433119", "text": "function save_note(beforesave)\n {\n if (!me.selected_note) {\n return false;\n }\n\n var savedata = get_save_data();\n\n // run savedata through the given callback function\n if (typeof beforesave == 'function') {\n beforesave(savedata);\n }\n\n // add reference to old list if changed\n if (me.selected_note.list && savedata.list != me.selected_note.list) {\n savedata._fromlist = me.selected_note.list;\n }\n\n // do some input validation\n if (savedata.title == '') {\n rcmail.alert_dialog(rcmail.gettext('entertitle', 'kolab_notes'), function() {;\n $('.notetitle', rcmail.gui_objects.noteviewtitle).focus();\n });\n\n return false;\n }\n\n if (check_change_state(savedata)) {\n rcmail.lock_form(rcmail.gui_objects.noteseditform, true);\n saving_lock = rcmail.set_busy(true, 'kolab_notes.savingdata');\n rcmail.http_post('action', {_data: savedata, _do: savedata.uid ? 'edit' : 'new'}, true);\n }\n else {\n rcmail.display_message(rcmail.get_label('nochanges', 'kolab_notes'), 'notice');\n }\n }", "title": "" }, { "docid": "4e1a77fc356774538b35249b8c0f4214", "score": "0.7427727", "text": "function saveNote(){\r\n if($('.notes-list-container').children('.note-item').length > 0){\r\n let content = editor.getContents();\r\n editNoteContent(editorNotebook, editorNote, editor.getContents());\r\n $('.notes-list-container .note-item.selected .note-item-title h4').text((content.ops[0].insert.length > 18) ? content.ops[0].insert.substr(0, 18) + \"...\" : content.ops[0].insert);\r\n }\r\n }", "title": "" }, { "docid": "6b80c2245cf0a9fb6fd969668e6445e7", "score": "0.7427664", "text": "function saveNote(event) {\n event.preventDefault();\n\n const button = event.target;\n const buttonId = button.id;\n const index = buttonId.slice(-1);\n\n const textarea = document.getElementById('text' + index);\n const userInput = textarea.value;\n\n const noteData = getNoteData();\n\n noteData[index] =userInput;\n\n localStorage.setItem('notes', JSON.stringify(noteData));\n}", "title": "" }, { "docid": "5e1b72ad242569eb29feca67b2fde7e3", "score": "0.74171233", "text": "newNote(note) {\n const { title, text } = note;\n // This is input validation requiring the title and note to both have at least 1 character.\n if (!title || !text) {\n throw new Error(\"Note 'title' and 'text' both have a 1 character minimum requirement!\");\n }\n\n // This adds a unique ID to the new note as well as the title and text.\n const newNote = { title, text, id: uniqueID() };\n\n // This retrives all the notes, writes all the updated notes, adds the new note, and returns the newNote.\n return this.retrieveNotes()\n .then((notes) => [...notes, newNote])\n .then((updatedNotes) => this.writeFile(updatedNotes))\n .then(() => newNote);\n }", "title": "" }, { "docid": "a3e88e59e515d4257cde584ec4af94a6", "score": "0.7413406", "text": "handleSaveNote(event) {\n const updatedNote = this.trimNote(); //* returns the selected note with the whitespace around title/text removed\n\n if (this.isValidNote(updatedNote)) {\n //* saves the changes from selectedNote into the savedNotes list\n updatedNote.lastSaved = (new Date()).toUTCString(); //* updates save timestamp\n const savedNotes = this.state.savedNotes;\n\n //* updates selected note & state\n savedNotes.set(updatedNote.id, updatedNote);\n this.setState({ savedNotes });\n }\n\n else {\n alert('COMPUTER SAYS: The note must be filled out to use it...');\n }\n }", "title": "" }, { "docid": "562602e6c3c3001497146d1784ed9121", "score": "0.7395026", "text": "saveNote() {\n if (this.noteMessageInput.value) {\n let key = Date.now().toString();\n localStorage.setItem(key, this.noteMessageInput.value);\n this.displayNote(key, this.noteMessageInput.value);\n StickyNotesApp.resetMaterialTextfield(this.noteMessageInput);\n this.toggleButton();\n }\n }", "title": "" }, { "docid": "7e6113102e96509be9f4158c0b3e1e69", "score": "0.7339923", "text": "function saveNotes(note) {\n // Set the note's id to the length of the array\n note.id = data.length;\n // push the note onto the current json array\n data.push(note);\n // write the updated array to the json file\n fs.writeFile(dbPath, JSON.stringify(data), error => {\n if(error){\n throw error;\n }\n });\n\n}", "title": "" }, { "docid": "45b09a1fa2fa36fd5642458f6ded8d69", "score": "0.7285462", "text": "function saveNote(event) {\n const element = event.target;\n\n let noteData;\n const newNote = $('.bootbox-body textarea').val().trim();\n\n if (newNote) {\n noteData = {\n article: $(element).data('article').id,\n body: newNote,\n };\n\n $.ajax({\n url: '/api/notes',\n data: noteData,\n method: 'post',\n headers: { 'X-CSRF-Token': token },\n }).done(() => {\n // Close the modal dialog.\n bootbox.hideAll();\n });\n }\n }", "title": "" }, { "docid": "f686d80864219fb3f7717b4a357a79cc", "score": "0.71908236", "text": "SAVE_NOTE({ commit }, content) {\n const purpose = \"User records note\";\n const c = catchHandler.bind({ purpose });\n if (state.currentUser) {\n const recordedTime = getDate();\n const newNote = { recordedTime, content };\n return c(writeChild(\"notes\", newNote, \"push\")).then((r) => {\n // If no error thrown, continue to update our local notes\n commit(\"WRITE_NOTE\", { newNote, key: r.key });\n return r;\n });\n }\n }", "title": "" }, { "docid": "7110eff2e0209b691bd969bdf7f3cbea", "score": "0.7186822", "text": "function createNote(){\n let note = new Note(\"title\",\"content\");\n notes.push(note);\n addNote(note);\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "title": "" }, { "docid": "741671e4b5c5524c95bed2c80e172dd0", "score": "0.7184083", "text": "addNote(note) {\n // note with the title and text\n const { title, text } = note;\n\n // title and text must have content to save\n if (!title || !text) {\n throw new Error(\"Note cannot be blank!\")\n };\n\n // new note object includes title, text, & id (using uuid version 4 that automatically generates unique ID)\n const newNote = { title, text, id: uuidv4() };\n\n // returning notesArr from getNotes() along with note we want to add\n return this.getNotes()\n // expanding notesArr and adding our new note to the end\n .then((notesArr) => [...notesArr, newNote])\n // creating a NEW ARRAY called \"updatedNotes\" with the new note included and writing said array\n .then((newNotesArr) => this.write(newNotesArr))\n // emptying newNote for the next time we need to add a note\n .then(() => newNote);\n }", "title": "" }, { "docid": "4af3f740a317af84afae4883d2e0d741", "score": "0.7159692", "text": "addNote(note) {\n const {title,text}=note;\n if (!title || !text){\n throw new Error(\"Neither text or title can be blank for the note entered\");\n }\n const newNote={title,text,id:uniqid()};\n return this.getNotes()\n .then((notes)=>[...notes,newNote])\n .then((currentNotes)=>this.write(currentNotes))\n .then(()=>newNote);\n }", "title": "" }, { "docid": "f51c7613a6794fc96f0783d939e9c6d7", "score": "0.71427035", "text": "function saveNote(note, noteArr){\n // if the array is not empty push to the list then write\n if(noteArr){\n noteArr.push(note);\n fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: noteArr}, null, 2));\n return noteArr;\n }\n // else if empty, assign note as array then write\n noteArr = note;\n fs.writeFileSync(path.join(__dirname, '../data/notes.json'), JSON.stringify({notes: noteArr}, null, 2));\n return noteArr;\n}", "title": "" }, { "docid": "6fe1d6c04ab34b29bf3bcca963533ee1", "score": "0.71271163", "text": "function saveNotes() {\n localStorage.setItem(\"notes\", JSON.stringify(notes));\n localStorage.setItem(\"notesLength\", c);\n}", "title": "" }, { "docid": "3db509800692694d5a4b2045581bbb8b", "score": "0.7125907", "text": "function newNotes() {\n fs.writeFile(\"db/db.json\", JSON.stringify(notes), err => {\n if (err) {\n return console.log(err);\n }\n });\n }", "title": "" }, { "docid": "bb1d311433f04e91df84b197b98a03ff", "score": "0.71048015", "text": "function saveChanges() {\n var note_id = $('.note-info').attr('id'),\n csrftoken = $.cookie('csrftoken'),\n title = $('#title').text(),\n note_title = title === \"\" ? \"Untitled note\" : title,\n note_content = $('.editor').html(),\n data = {\n id: note_id,\n title: note_title,\n body: note_content,\n csrfmiddlewaretoken: csrftoken\n };\n\n $.post(\"/notes/editnote/\", data).success(function (data) {\n var note = $('#notelist').find('a[data-noteid=' + note_id + ']');\n $(note).find('strong').html(data.title);\n $(note).find('.preview').html(data.preview);\n });\n }", "title": "" }, { "docid": "874cbf25a26fa4259b5628b124a958a5", "score": "0.7080945", "text": "function saveData(event) {\n let divId = ($(event.target).parent().attr('id'));\n let newNote = ($(event.target).siblings('textarea').val())\n\n // checking that box contains string\n if ($(event.target).siblings('textarea').val()) {\n\n let existingNote = noteArray.find(function (note) {\n return note.id === divId;\n });\n if (existingNote) {\n existingNote.note = newNote;\n } else {\n noteArray.push({\n id: divId,\n note: newNote,\n })\n }\n localStorage.setItem('dayNotes', JSON.stringify(noteArray));\n save.text(\"Saved to Local Storage\");\n setTimeout(function () {\n save.text(\"\");\n }, 2000)\n }\n}", "title": "" }, { "docid": "c5664e71ff43d6b1c25aa30dc2691e31", "score": "0.7070031", "text": "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // create HTML node from note object\n const node = createItem(note);\n // append created node in HTML\n noteList.appendChild(node);\n // put created node in Map to match it with note\n map.set(node, note);\n // push current note to notes object\n notes.push(note);\n // overwrite notes in indexedDB with notes\n idbKeyval.set('notes', notes)\n .catch(err => console.error('submit failed: ', err));\n // reset input values\n noteBody.value = '';\n noteImg.value = '';\n noteAlt.value = '';\n }", "title": "" }, { "docid": "3e5150c458c7928b1b7df97a3d65542a", "score": "0.7064355", "text": "function saveNote(req, username){\n\n if(db.get('posts').find({username: username}).value() !== undefined){\n // modifies existing note\n db.get('posts').find({username: username})\n .assign({title: req.noteTitle, body: req.noteBody}).value()\n db.write()\n }\n else{\n // creates new note\n db.get( 'posts' ).push({username: username,title:req.noteTitle, body: req.noteBody}).write()\n }\n}", "title": "" }, { "docid": "1e0376dba7ab2b963455720d836baec1", "score": "0.7036987", "text": "function saveNewNoteInTicket() {\n \n // Confirm a radio is selected\n if(!($('input[name=\"note-type-' + ticketInternalNotesCounter + '\"]:checked')[0])) {\n $('#error-text-note').removeClass('is-invisible');\n return;\n }\n $('#error-text-note').addClass('is-invisible');\n\n // Get the values\n // Remove the '-x' before we can save it to the DB\n var newNoteTypeWithNumber = $('input[name=\"note-type-' + ticketInternalNotesCounter + '\"]:checked')[0].id;\n var newNoteType = newNoteTypeWithNumber.slice(0, newNoteTypeWithNumber.lastIndexOf('-'));\n var newNoteBy = userName;\n var newNoteDate = $('#new-ticket-date-' + ticketInternalNotesCounter).val();\n var newNoteText = $('#ticket-text-' + ticketInternalNotesCounter).val();\n\n // Confirm text is written\n if (!newNoteText) {\n $('#error-text-note').removeClass('is-invisible');\n return;\n }\n $('#error-text-note').addClass('is-invisible');\n\n // Disable the fields once validation is done\n $('#new-ticket-date-' + ticketInternalNotesCounter).prop('disabled', true);\n $('#ticket-text-' + ticketInternalNotesCounter).prop('disabled', true);\n for(var i=0; i < radioOptions.length; i++) { //Disable all radios\n $('#' + radioIDs[i]+ '-' + ticketInternalNotesCounter).prop('disabled', true);\n }\n\n\n var newNoteID = ticketsRef.child(ticketDBID + '/notes').push().key;\n database.ref('/tickets/' + ticketDBID + '/notes')\n .child(newNoteID)\n .set({\n noteType: newNoteType,\n noteDate: newNoteDate,\n noteText: newNoteText,\n noteBy: newNoteBy,\n noteID: newNoteID,\n internalNotesCounter: ticketInternalNotesCounter\n })\n .then(function() {\n ticketInternalNotesCounter++;\n\n // Save the internalNotesCounter on the ticket\n database.ref('/tickets')\n .child(ticketDBID)\n .update({\n internalNotesCounter: ticketInternalNotesCounter\n })\n })\n\n // Reenable the button to create a new note\n addNewNoteButton.show();\n saveNewNoteButton.hide();\n\n }", "title": "" }, { "docid": "383b42b9a0be2d264801def9db329643", "score": "0.7035851", "text": "function saveNote(note, title) {\n\tvar n = document.getElementById(note).value;\n\tvar t = document.getElementById(title).value;\n\tvar o = new Note(n, t);\n\tvar notes_array = $.parseJSON($.cookie(\"notes_array\"));\n\tnotes_array.push(o);\n\t$.cookie(\"notes_array\", JSON.stringify(notes_array), {expire:365});\n\t//save note to cookie\n\t//save title to corresponding cookie\n\t// console.log(notes_array);\n\tloadTitlesToDropdown();\n}", "title": "" }, { "docid": "4953d592fda81ba9f2f71d50897db457", "score": "0.70209336", "text": "function newNote(gameState, text) {\n thisGameState.notes.push(text);\n socket.emit(\"save\", gameState);\n}", "title": "" }, { "docid": "fce95377839a5484447f80db7f29fd5e", "score": "0.6994292", "text": "addNote(note) {\n const { title, text } = note;\n\n if (!title || !text) {\n throw new Error(\"Note 'title' and 'text' must be completed\");\n\n }\n\n const newNote = { title, text, id: uuidv1() };\n\n return this.getNotes()\n .then((notes) => [...notes, newNote])\n .then((updatedNotes) => this.write(updatedNotes))\n .then(() => newNote);\n }", "title": "" }, { "docid": "befa10ca5417b7e7e4d992ff66c7c5d5", "score": "0.69928074", "text": "function addNote() {\n fs.writeFileSync(\"Develop/db/db.json\", JSON.stringify(notesData))\n}", "title": "" }, { "docid": "4fe531b2960acdf9568066c115611ff4", "score": "0.6988503", "text": "function pushNote(thisNote) {\n //console.log('push has been called');\n myNotes.push(thisNote);\n Cookies.set('storedNotes', myNotes);\n //myNotes = Cookies.getJSON('storedNotes');\n //console.log('New Note Saved');\n confirmation.placeholder = 'New note saved';\n note.value = '';\n}", "title": "" }, { "docid": "86ecdbc995c951a66e30c6d32d25c330", "score": "0.68921995", "text": "function saveNote() {\n const text = document.getElementById(\"NotifyText\").value;\n const noteDate = document.getElementById(\"SelectedDay\").value + \".\" + month + \".\" + year;\n\n if(specialCharsMatch(text)) {\n alert(\"Sonderzeichen sind nicht erlaubt.\");\n return;\n }\n\n for(let i = 0; i < noteCount; i++) {\n \n try {\n const existingNoteDate = localStorage.getItem(\"note\"+i).split(\",\")[1];\n \n if(existingNoteDate === noteDate) {\n alert(\"Bitte nur einen Eintrag pro Tag.\");\n return;\n }\n } catch {\n continue;\n }\n }\n\n localStorage.setItem(\"note\" + noteCount, text + \",\" + noteDate);\n noteCount++;\n localStorage.setItem(\"noteCount\", noteCount);\n\n fillCalendar(year, month, day);\n document.getElementById(\"NotifyText\").value = \"\";\n }", "title": "" }, { "docid": "14c6f83b655ada0579320e6654229fd3", "score": "0.68709594", "text": "function updateNote(e){\n let note = notes[e.path[1].classList[0].split(\"id\")[1]];\n switch(e.target.name){\n case \"title\":\n note.title = e.target.value;\n break;\n case \"content\":\n note.content = e.target.value;\n break;\n case \"color\":\n e.path[1].style.backgroundColor = e.target.value;\n note.color = e.target.value;\n break;\n }\n localStorage.setItem(\"notes\",JSON.stringify(notes));\n}", "title": "" }, { "docid": "2b5d625d339b4b48819e44be49a2829a", "score": "0.6870725", "text": "function saveNotes() {\n // Grab the current HTML of the notepad\n let currentNotesHTML = $('#notepad').html();\n // Store the HTML in an object\n let notesData = {\n html: currentNotesHTML\n }\n // Save it to localStorage\n localStorage.setItem('notes', JSON.stringify(notesData));\n}", "title": "" }, { "docid": "e6514476f21841bf93205acc60a24810", "score": "0.68357897", "text": "function storeNotes() {\n // Store the note in the localStorage\n localStorage.setItem(\"note\", JSON.stringify(notesArray));\n }", "title": "" }, { "docid": "c724f51ffd5a92d57eefd72bdd050337", "score": "0.68333155", "text": "addNote(note) {\n const newNote = {\n title: note.title,\n text: note.text,\n id: note.id,\n };\n return this.getNote()\n .then((notes) => {\n return [...notes, newNote];\n })\n .then((newNoteArr) => {\n this.write(newNoteArr);\n })\n .then(() => newNote);\n }", "title": "" }, { "docid": "f426fe6b1ad70e85f6bcf6c7e7bf851f", "score": "0.68077224", "text": "addNotes(note) {\n // generate random id each time\n let ID = uuidv4();\n // pull data from new note\n const { title, text } = note;\n // new note object to store data from above & adds new ID number\n const newNote = { id: ID, title, text }\n return this.getNotes()\n .then(notes => [...notes, newNote])\n .then(updateNotes => this.write(updateNotes))\n .then(() => newNote)\n }", "title": "" }, { "docid": "357680e5023b04bebc51782e10649f74", "score": "0.6763597", "text": "async function saveNote(){\n\temail = getUserEmail();\n\ttitle = getTitle();\n\tmessage = getMessage();\n\tconst url = `http://localhost:3000/new?email=${email}title=${title}&message=${message}`;\n\tconst response = await fetch(url);\t//calling the server, sending those input values to it\n\tconst data = await response.json();\t//format that response using JSON\n\tnoteMenuView();\t\t\t\t\t\t\t//go back to the main menu\n\n}", "title": "" }, { "docid": "a03cdc5dec067309a84c3a13a767dfa9", "score": "0.6759674", "text": "function enterNote() {\n note = {}\n if (checkIfInputIsCorrect()) {\n // create note\n note.InputOfNote = txtArea.value;\n note.dateOfNote = dateEnterded;\n note.timeOfNote = timeEnterded;\n note.noteNum = noteNumber;\n note.secondsComp = dateEnterdedToCompare;\n noteNumber++;\n NoteArrey.push(note);\n addToLocalStorage();\n printNotes(false);\n }\n}", "title": "" }, { "docid": "d330986183c3664c1587344ef8a5aa61", "score": "0.67566013", "text": "function addNote() {\n\t\t\n\t\tid++;\n\t\tzIndex++;\n\t\t\n\t\tvar body = document.querySelector('body');\n\t\t\n\t\tvar note = document.createElement('div');\n\t\tvar close = document.createElement('div');\n\t\tvar field = document.createElement('div');\n\t\tvar footer = document.createElement('div');\n \t\t\n\t\tnote.setAttribute('id', 'note' + id);\n\t\tclose.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('id', 'note' + id);\n\t\tfield.setAttribute('contenteditable', true);\n\t\t\t\n\t\tnote.classList.add('note');\n\t\tclose.classList.add('close');\n\t\tfield.classList.add('field');\n\t\tfooter.classList.add('footer');\n\t\t\n\t\tnote.style.zIndex = zIndex;\n\t\t\t\n\t\tnote.appendChild(close);\n\t\tnote.appendChild(field);\n\t\tnote.appendChild(footer);\n\t\tbody.appendChild(note);\n\t\t\n\t\tattachListeners(note, close, field, footer);\n\t\t\n\t\tvar data = JSON.parse(localStorage['data']);\n\t\t\n\t\t// Save the current note's data\n\t\tdata.push({\n\t\t\n\t\t\tid: id,\n\t\t\ttext: '',\n\t\t\tposition: { x: 20, y: 20 },\n\t\t\tzIndex: zIndex,\n\t\t\t\n\t\t\ttime: { \n\t\t\t\n\t\t\t\tday: new Date().getDate(), \n\t\t\t\tmonth: new Date().getMonth() + 1, \n\t\t\t\tyear: new Date().getFullYear(), \n\t\t\t\th: new Date().getHours(), \n\t\t\t\tm: new Date().getMinutes(), \n\t\t\t\ts: new Date().getSeconds() \n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t});\n\t\t\n\t\tlocalStorage['data'] = JSON.stringify(data);\n\t\t\n\t}", "title": "" }, { "docid": "9a59c6dff082cf3e0cd30b474b5b6a4b", "score": "0.67303234", "text": "function storeNote() {\n let title = document.getElementById(\"title\").value; //receives text from input field\n let note = document.getElementById(\"takeNote\").value; //recieves text from textarea\n note = note.replace(/\\n\\r/g, \"<br />\"); //replace \\n \\r with \"<br />\" as notices are stored as an string\n if ((title || note) == \"\") {\n //leave function if title or note are empty\n return;\n }\n\n titles.push(title); //store title in array titles\n notes.push(note); //store note in array notes\n setArray(\"titles\", titles); //store also under localStorage\n setArray(\"notes\", notes); //store also under localStorage\n\n document.getElementById(\"title\").value = \"\"; // delete input title\n document.getElementById(\"takeNote\").value = \"\"; // delete input notes\n\n showNotes(\"my-notes\", titles, notes); //shows update notes\n}", "title": "" }, { "docid": "828e08483299b81e68ac8ff04fcba1a6", "score": "0.6718848", "text": "addNote(info) {\n const { title, text } = info;\n const newNote = { title, text, id: uuid() };\n return this.getInfo()\n .then ((info) => [...info, newNote])\n .then((updateInfo)=> this.write(updateInfo))\n .then(() => newNote);\n }", "title": "" }, { "docid": "a680f60e96a46df1f7a3ca4c40d1eef3", "score": "0.670557", "text": "function createNote(note) {\n return API.post(\"notes\", \"/notes\", {\n body: note\n });\n }", "title": "" }, { "docid": "4bbfd2bff51dd729c0c55861141feeb3", "score": "0.6702196", "text": "async onSubmit(note) {\n let clonedNotes = [...this.state.notes];\n for (let n of clonedNotes) {\n if (n.time === note.time) {\n n.text = note.text;\n n.title = note.title;\n n.color = note.color;\n n.lastEdited = new Date().getTime();\n break;\n }\n }\n\n // To make sure changes are stored...\n // Realm storing\n await this.storeLocal(clonedNotes);\n await this.setState({ notes: clonedNotes },\n function() {\n this.updateItem(this.state);\n }.bind(this));\n\n // We request a remote sync, because note was edited.\n await this.state.requestSync();\n }", "title": "" }, { "docid": "8fb71535800d4cd5f2c23642a5c190c5", "score": "0.6683345", "text": "addNote(newNote) {\n const noteAdd = {\n title: newNote.title,\n text: newNote.text,\n id: uuidv1()\n }\n return this.getNotes()\n .then(notes => [...notes, noteAdd])\n .then(allNotes => {\n asyncWriteFile(\"db/db.json\", JSON.stringify(allNotes))\n \n }).then(() => noteAdd)\n }", "title": "" }, { "docid": "7ff538ac0289537279152029a3eb02d1", "score": "0.6676751", "text": "writeFile(note) {\n return fileWrite('db/db.json', JSON.stringify(note));\n }", "title": "" }, { "docid": "1634d47a9ac7daad907433079429be48", "score": "0.6669715", "text": "function createNewNote(body, notesArray) {\n const note = body;\n console.log('notes array:' + notesArray.length);\n let noteId;\n if (!notesArray.length) {\n noteId = 1;\n }\n else {\n noteId = notesArray.length + 1;\n }\n\n console.log(noteId);\n note.id=noteId;\n notesArray.push(note)\n fs.writeFileSync(path.join(__dirname, '../db/db.json'),JSON.stringify(notesArray));\n return note;\n}", "title": "" }, { "docid": "57f803d3a0065c2f91432f878da08850", "score": "0.6665021", "text": "function saveNotes() {\n fs.writeFileSync(\"db/db.json\", JSON.stringify(db));\n}", "title": "" }, { "docid": "a8c2a476e04aedaba6673500f7b85e02", "score": "0.6661871", "text": "function saveClose(noteId) {\n var editPanel = document.getElementById('edit-panel-' + noteId);\n var newContent = editPanel.innerHTML.replace(/(<([^>]+)>)/ig, '<br/>'); //regex removes all html elements present and replaces them with a line break\n //console.log(newContent);\n for (var i = 0; i < myNotes.length; i++) {\n if (myNotes[i].id == noteId) {\n //console.log(myNotes[i].note);\n myNotes[i].note = newContent;\n //console.log(myNotes[i].note);\n Cookies.set('storedNotes', myNotes);\n noteDetailPanel.classList.remove('show');\n }\n }\n if (editorWasOpen === false) { //close the editor panel if it was already closed\n closeEditor();\n }\n}", "title": "" }, { "docid": "933cfde20d8daedb0adb8b364ebe89f8", "score": "0.66597784", "text": "handleNewNote(event) {\n console.log('new note :D');\n \n //TODO ALL:\n //? ask user to save / discard current note if one is selected and has been modified\n //! REMOVE SAVEDNOTES DATA WHILE TESTING\n //* create new note object and save as selectedNote\n //* if the selectedNote is saved it will need to be added to savedNotes\n\n //* setup for new note object\n let notesCreated = this.state.notesCreated; //* id based on number of notes created (not tied to savedNotes.size)\n const selectedNote = {\n id: notesCreated,\n lastSaved: (new Date()).toUTCString(),\n title: '',\n text: ''\n };\n\n notesCreated += 1; //* updates number of notes created\n this.setState({ notesCreated, selectedNote }); \n }", "title": "" }, { "docid": "c4fe08b75a8ca48860352e5ec2157da9", "score": "0.66442925", "text": "function createNewNote(body, notesArray) {\n console.log('body',body)\n //create id\n let newId = getId();\n if(!ids.assigned(newId)){\n createNewNote(body, notesArray)\n }else {\n body.id = newId\n }\n\n let note = body;\n notesArray.push(note);\n\n fs.writeFileSync(\n path.join(__dirname, '../data/notes.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n );\n return note;\n}", "title": "" }, { "docid": "9af44b73653ca68000a5635ee694050e", "score": "0.66332406", "text": "async function saveNote(req) {\n try {\n let data = await fs.promises.readFile(\"./db/db.json\", \"utf8\");\n let dataJSON = JSON.parse(data);\n let currentData;\n if(req.body.id){\n console.log(\"We got an update, not a new Note!\")\n currentData = dataJSON.filter((data) => {\n return data.id != req.body.id\n })\n }else{\n currentData = dataJSON;\n req.body.id = Math.random();\n }\n let newNotes = [...currentData, req.body];\n await write(newNotes);\n return Promise.resolve(newNotes);\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "ade48a36032f222711e26a9ed92fbd7a", "score": "0.6628417", "text": "function saveNewNoteToFB(newNote) {\n return $q((resolve, reject)=>{\n $http.post(`${FBUrl}/notes.json`,\n JSON.stringify(newNote)\n ).then( data =>{\n resolve(data, newNote);\n }).catch(err=>{\n console.log('err',err);\n });\n });\n }", "title": "" }, { "docid": "cc1965c768405f08921185c82293aec2", "score": "0.66100013", "text": "function createNewNote(body, notesArray){\n const note = body; \n notesArray.push(note);\n fs.writeFileSync (\n path.join(__dirname, '../db/db.json'),\n JSON.stringify({ notes: notesArray }, null, 2)\n );\n return note; \n}", "title": "" }, { "docid": "fca3017449e8dff12a4867a81eb4b5e0", "score": "0.66004944", "text": "function addNote(worker, note) {\n if (note != null) {\n note = datastore.createNote(note);\n worker.port.emit(\"NoteAdded\", note);\n }\n}", "title": "" }, { "docid": "e1978dc2a78b4b10c4277e87675548be", "score": "0.65823644", "text": "function saveNote(id) {\n\t$(document).on(\"click\", \"#submit-note\", function() {\n\t\tevent.preventDefault();\n\t $.ajax({\n\t \tmethod: \"POST\",\n\t \turl: \"/articles/note/\" + id,\n\t \tdata: {\n\t \t\tbody: $(\"#note\").val().trim()\n\t \t}\n\t }).done(function(data) {\n\t \tconsole.log(data);\n\t });\n\t $(\"#note\").val(\"\");\n\t});\n}", "title": "" }, { "docid": "dcf05d8ab06a4535cc972b7b9ce0faca", "score": "0.6568704", "text": "saveNote(event) {\n //the preventDefault() option is added to stop the page from reloading upon submitting a note\n event.preventDefault();\n //if the Title of the note is empty, we validate it via alert\n if (this.title.value === \"\") {\n alert(\"Title is needed\");\n } else {\n //we assign each note with an id, title, desc and image upon submit\n const note = {\n id: Number(this.id.value),\n title: this.title.value,\n description: this.description.value\n }\n //we set the new state of the note nav to true so that it can \"redirect\" to the note when clicked\n this.props.persistNote(note);\n this.setState({\n redirect: true\n });\n }\n }", "title": "" } ]
076319de10df51e22f186801cf70c685
convert an array to a date. the array should mirror the parameters below note: all values past the year are optional and will default to the lowest possible value. [year, month, day , hour, minute, second, millisecond]
[ { "docid": "d2177eb782b7977f702a7b670a82eddc", "score": "0.0", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, expectedWeekday, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();\n\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "title": "" } ]
[ { "docid": "55adace34cfbb59d5bc15406f75a8fa0", "score": "0.7140846", "text": "function dateFromArray(input) {\r\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\r\n }", "title": "" }, { "docid": "8a43c30d1c500d17ac19ae322663dc25", "score": "0.7055668", "text": "function dateFromArray(input) {\n return new Date(input[0], input[1] || 0, input[2] || 1, input[3] || 0, input[4] || 0, input[5] || 0, input[6] || 0);\n }", "title": "" }, { "docid": "adcd4fbe1bd993f1dc37b158f2e7f9ae", "score": "0.6908647", "text": "function formatData(array) {\r\n\tfor (var i in array) {\r\n var a = array[i][0];\r\n array[i][0] = new Date(array[i][1]);\r\n array[i][1] = a;\r\n }\r\n return array;\r\n}", "title": "" }, { "docid": "a4dd06ea8e2da035cd456e5089c658b3", "score": "0.60620654", "text": "function dateFromArray( config ){\n\t\tvar i, date, input = [];\n\n\t\tif( config._d ){\n\t\t\treturn;\n\t\t}\n\n\t\tfor( i = 0; i < 7; i++ ){\n\t\t\tconfig._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n\t\t}\n\n\t\t// add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n\t\tinput[3] += config._tzh || 0;\n\t\tinput[4] += config._tzm || 0;\n\n\t\tdate = new Date(0);\n\n\t\tif( config._useUTC ){\n\t\t\tdate.setUTCFullYear(input[0], input[1], input[2]);\n\t\t\tdate.setUTCHours(input[3], input[4], input[5], input[6]);\n\t\t} else{\n\t\t\tdate.setFullYear(input[0], input[1], input[2]);\n\t\t\tdate.setHours(input[3], input[4], input[5], input[6]);\n\t\t}\n\n\t\tconfig._d = date;\n\t}", "title": "" }, { "docid": "f6cfc5bd59a35f50703f786b3c55bed7", "score": "0.6040947", "text": "function dateToNumber(array, array2){\n array.forEach(function(element){\n array2.push(parseInt(element))\n });\n return array2;\n}", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6013863", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6013863", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6013863", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "22259a038544af005417828e09de62b2", "score": "0.6013863", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += config._tzh || 0;\n input[4] += config._tzm || 0;\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "4d3741365a47c70385726d29fff4a36a", "score": "0.59931874", "text": "function firstDate(){\r\n var firstYear = 10000;\r\n var x;\r\n for(x in dayArray){\r\n if(dayArray.hasOwnProperty(x)){\r\n if(+x < firstYear){\r\n firstYear = +x;\r\n }\r\n }\r\n }\r\n\r\n var firstMonth = 0;\r\n while(!dayArray[firstYear][firstMonth]){\r\n firstMonth++;\r\n }\r\n\r\n\r\n var i;\r\n for(i = 0; i<dayArray[firstYear][firstMonth].length; i++){\r\n if(dayArray[firstYear][firstMonth][i]){\r\n break;\r\n }\r\n }\r\n\r\n\r\n return new Date(firstYear, firstMonth, i+1);\r\n }", "title": "" }, { "docid": "3d0dff0ea89ea37baff83153e8a8a8e4", "score": "0.59924275", "text": "function friendly(arr) {\n var date1 = /(\\d{4})[-](\\d{2})[-](\\d{2})/.exec(arr[0]);\n // [ '2016-07-01', '2016', '07', '01', index: 0, input: '2016-07-01' ]\n var date2 = /(\\d{4})[-](\\d{2})[-](\\d{2})/.exec(arr[1]);\n\n function year(date) {\n return date[1];\n }\n\n function month(date) {\n var month = date[2];\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n\n return months[(+month - 1)];\n }\n\n function day(date) {\n var day = date[3];\n\n // remove leading zero\n day = day.replace(/^0/, '');\n if (day == 1) {\n return \"1st\";\n } else if (day == 2) {\n return \"2nd\";\n } else if (day == 3) {\n return \"3rd\";\n } else {\n return day + \"th\";\n }\n }\n\n date1 = month(date1) + \" \" + day(date1) + \", \" + year(date1);\n date2 = month(date2) + \" \" + day(date2) + \", \" + year(date2);\n\n return [date1, date2];\n}", "title": "" }, { "docid": "cc2b0f761bc1176f72e0d084e34124f7", "score": "0.59603435", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "cc2b0f761bc1176f72e0d084e34124f7", "score": "0.59603435", "text": "function dateFromArray(config) {\n var i, date, input = [];\n\n if (config._d) {\n return;\n }\n\n for (i = 0; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "dba15261fddb02b8f0a89926a0680e15", "score": "0.59545743", "text": "function bcdToDate(bcdArray) {\n return new Date(\n bcdToInt(bcdArray[0])*100 + bcdToInt(bcdArray[1]), // Year\n bcdToInt(bcdArray[2]), // Month\n bcdToInt(bcdArray[3]), // Day\n bcdToInt(bcdArray[4]), // Hour\n bcdToInt(bcdArray[5]), // Minute\n bcdToInt(bcdArray[6]) // Second\n );\n}", "title": "" }, { "docid": "1801d06a432653a549db0ed908597673", "score": "0.5874658", "text": "function dateFromArray(config) {\n var i, date, input = [], currentDate;\n\n if (config._d) {\n return;\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n currentDate = currentDateArray(config);\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // add the offsets to the time to be parsed so that we can have a clean array for checking isValid\n input[3] += ~~((config._tzm || 0) / 60);\n input[4] += ~~((config._tzm || 0) % 60);\n\n date = new Date(0);\n\n if (config._useUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n\n config._d = date;\n }", "title": "" }, { "docid": "4b514a659609429f8748c1e2934528f5", "score": "0.5856857", "text": "function convertDates(data)\n{\n\tfor (i = 0; i < data.length; i++)\n\t{\n\t\tvar original = data[i][\"date\"]\n\t\tdata[i][\"date\"] = new Date(original);\n\t\tif (\"onlyYear\" in data[i] && data[i][\"onlyYear\"])\n\t\t{\n\t\t\tdata[i][\"sDate\"] = original;\n\t\t\tdata[i][\"date\"].setDate(data[i][\"date\"].getDate() + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdata[i][\"sDate\"] = formatDate(data[i][\"date\"]);\n\t\t}\n\t}\t\n\treturn data;\n}", "title": "" }, { "docid": "62c80df5d872dd1293a84e382b17007e", "score": "0.584781", "text": "function fixTimes(array){\n for (var i=0;i<array.length;i++){\n array[i].time = new Date(array[i].time);\n }\n}", "title": "" }, { "docid": "a432a81433903bbfefbe8b36b12387a6", "score": "0.5809535", "text": "function textifyDates1D(myArr){\n \n for(var r=0; r < myArr.length; r++){\n if (Object.prototype.toString.call(myArr[r]) === '[object Date]'){\n try {\n //myArr[r] = myArr[r].toString();\n myArr[r] = Utilities.formatDate(myArr[r], \"GMT+08:00\", \"dd-MMM-yyyy\")\n } \n catch(err) { myArr[r] = err};\n }\n \n }\n return myArr;\n}", "title": "" }, { "docid": "68ef38734a8a224b6fa30543d53f46ad", "score": "0.5799609", "text": "function makeFriendlyDates(arr) {\n var begDate = new Date(arr[0].split('-')), //put the array into dates format\n endDate = new Date(arr[1].split('-')),\n begYear = begDate.getFullYear(), //assign separate variables for year,month, date\n endYear = endDate.getFullYear(),\n begMonth = begDate.getMonth(),\n endMonth = endDate.getMonth(),\n begDays = begDate.getUTCDate(),\n endDays = endDate.getUTCDate(),\n curDate = new Date();\n months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n \n function corDate(n){ //depending on the days, assign appropriate ordinal dates\n if (n === 1 || n === 21 || n === 31){\n return n + 'st';\n }\n else if (n === 2 || n === 22){\n return n + 'nd';\n }\n else if (n === 3 || n === 23){\n return n + 'rd';\n }\n else {\n return n + 'th';\n }\n }\n \n if (begDate.getTime() === endDate.getTime()){ //exact same beginning and end date\n return [months[begMonth] + ' ' + corDate(begDays) + ', ' + begYear];\n }\n \n else if (begMonth === endMonth && begYear === endYear){ //same month, same year\n return [months[begDate.getUTCMonth()] + ' ' + corDate(begDays) , corDate(endDays)];\n }\n \n else if (begYear === endYear && begMonth != endMonth) { //same year, different month\n return [months[begMonth] + ' ' + corDate(begDays) + ', ' + begYear, months[endMonth] + ' ' + corDate(endDays)];\n }\n \n else if (begYear === curDate.getFullYear() && begMonth >= endMonth && endYear - begYear < 2) { //starts at current year and then ends within a year\n return [months[begMonth] + ' ' + corDate(begDays), months[endMonth] + ' ' + corDate(endDays)];\n }\n \n else if (endYear - begYear === 1 && begMonth === endMonth && begDays > endDays) {//begins and ends within a year.\n return [months[begMonth] + ' ' + corDate(begDays) + ', ' + begYear, months[endMonth] + ' ' + corDate(endDays)];\n }\n\n else {//more than 365 days difference\n return [months[begDate.getUTCMonth()] + ' ' + corDate(begDays) + ', ' + begYear, months[endDate.getUTCMonth()] + ' ' + corDate(endDays) + ', ' + endYear];\n }\n \n}", "title": "" }, { "docid": "5afed5ee655549ca9132ae93e03401d7", "score": "0.5685846", "text": "function dateFromArray(input, asUTC, hoursOffset, minutesOffset) {\n var i, date, forValid = [];\n for (i = 0; i < 7; i++) {\n forValid[i] = input[i] = (input[i] == null) ? (i === 2 ? 1 : 0) : input[i];\n }\n // we store whether we used utc or not in the input array\n input[7] = forValid[7] = asUTC;\n // if the parser flagged the input as invalid, we pass the value along\n if (input[8] != null) {\n forValid[8] = input[8];\n }\n // add the offsets to the time to be parsed so that we can have a clean array\n // for checking isValid\n input[3] += hoursOffset || 0;\n input[4] += minutesOffset || 0;\n date = new Date(0);\n if (asUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n date._a = forValid;\n return date;\n }", "title": "" }, { "docid": "5afed5ee655549ca9132ae93e03401d7", "score": "0.5685846", "text": "function dateFromArray(input, asUTC, hoursOffset, minutesOffset) {\n var i, date, forValid = [];\n for (i = 0; i < 7; i++) {\n forValid[i] = input[i] = (input[i] == null) ? (i === 2 ? 1 : 0) : input[i];\n }\n // we store whether we used utc or not in the input array\n input[7] = forValid[7] = asUTC;\n // if the parser flagged the input as invalid, we pass the value along\n if (input[8] != null) {\n forValid[8] = input[8];\n }\n // add the offsets to the time to be parsed so that we can have a clean array\n // for checking isValid\n input[3] += hoursOffset || 0;\n input[4] += minutesOffset || 0;\n date = new Date(0);\n if (asUTC) {\n date.setUTCFullYear(input[0], input[1], input[2]);\n date.setUTCHours(input[3], input[4], input[5], input[6]);\n } else {\n date.setFullYear(input[0], input[1], input[2]);\n date.setHours(input[3], input[4], input[5], input[6]);\n }\n date._a = forValid;\n return date;\n }", "title": "" }, { "docid": "e265997c3686ea2f68b351e49575cf7e", "score": "0.55792034", "text": "function formatDateToDatepicker(arr) {\n var ret = arr.map(function (cc) {\n cc.ClosedDateDP = new Date(cc.ClosedDate);\n return cc;\n })\n return ret;\n }", "title": "" }, { "docid": "4e5b66c8d3f0f5c3bd5d0e07609c96ee", "score": "0.5566915", "text": "function StringtoDateArray(Acc){\n let timeArray=new Array();\n for(var i=0;i<Acc.length;i++){\n var d = new Date(Acc[i]);\n timeArray.push(d);\n }\n return timeArray; \n}", "title": "" }, { "docid": "d9eec07c65228bd9452b9fa628a1c240", "score": "0.5529487", "text": "function arrayToTimeSeries(tsArray,yearsArray,possibleYears,bandName){\r\n //Set up dummy image for handling null values\r\n var noDateValue = -32768;\r\n var dummyImage = ee.Image(noDateValue).toArray();\r\n \r\n //Ierate across years\r\n var tsC = possibleYears.map(function(yr){\r\n yr = ee.Number(yr);\r\n \r\n //Pull out given year\r\n var yrMask = yearsArray.eq(yr);\r\n \r\n //Mask array for that given year\r\n var masked = tsArray.arrayMask(yrMask);\r\n \r\n \r\n //Find null pixels\r\n var l = masked.arrayLength(0);\r\n \r\n //Fill null values and convert to regular image\r\n masked = masked.where(l.eq(0),dummyImage).arrayGet([-1]);\r\n \r\n //Remask nulls\r\n masked = masked.updateMask(masked.neq(noDateValue)).rename([bandName]) \r\n .set('system:time_start',ee.Date.fromYMD(yr,6,1).millis());\r\n \r\n return masked;\r\n \r\n \r\n });\r\n return ee.ImageCollection(tsC);\r\n }", "title": "" }, { "docid": "970a75fb4e04189aab2f2770d84869a3", "score": "0.55045456", "text": "function getYear1(){\n\nvar today = new Date();\nvar yyyy = today.getFullYear();\nvar yyyy = yyyy+\"0\"; // array conversion\nreturn yyyy[0];\n\n}", "title": "" }, { "docid": "fd6f0a8a33274f48299dd24c689da1fc", "score": "0.5499891", "text": "function arrayToTimeSeries(tsArray,yearsArray,possibleYears,bandName){\n //Set up dummy image for handling null values\n var noDateValue = -32768;\n var dummyImage = ee.Image(noDateValue).toArray();\n \n //Ierate across years\n var tsC = possibleYears.map(function(yr){\n yr = ee.Number(yr);\n \n //Pull out given year\n var yrMask = yearsArray.eq(yr);\n \n //Mask array for that given year\n var masked = tsArray.arrayMask(yrMask);\n \n \n //Find null pixels\n var l = masked.arrayLength(0);\n \n //Fill null values and convert to regular image\n masked = masked.where(l.eq(0),dummyImage).arrayGet([-1]);\n \n //Remask nulls\n masked = masked.updateMask(masked.neq(noDateValue)).rename([bandName]) \n .set('system:time_start',ee.Date.fromYMD(yr,6,1).millis());\n \n return masked;\n \n \n });\n return ee.ImageCollection(tsC);\n }", "title": "" }, { "docid": "d59d66a177dd69e3292a387f9da3d8e9", "score": "0.549681", "text": "function getYears(array,func) {\n\nlet newarray = func(array);\nlet yearArray = [];\nfor(let i = 0; i < newarray.length; i++){\n yearArray.push(newarray[i].Year);\n}\nreturn yearArray\n}", "title": "" }, { "docid": "78348708b36a289e6a6f97f449f6a0fa", "score": "0.54905033", "text": "function yyyy_mm(data, headers) {\n headers.forEach(function(header) {\n data.forEach(function(item) {\n data_string = item[header];\n item[header] = new Date(data_string + \"-01T00:00:00Z\");\n });\n });\n return data;\n}", "title": "" }, { "docid": "8da0811fa4505eed21e9758c37c31637", "score": "0.54877126", "text": "function linearOK(array){if(!array)return false;for(var i=0;i<array.length;i++){if(isNumeric(array[i]))return true;}return false;}// does the array a have mostly dates rather than numbers?", "title": "" }, { "docid": "460193c5941219f3a4864f9d689dfacc", "score": "0.5415557", "text": "function getYear2(){\n\nvar today = new Date();\nvar yyyy = today.getFullYear();\nvar yyyy = yyyy+\"0\"; // array conversion\nreturn yyyy[1];\n\n}", "title": "" }, { "docid": "3529801a6ed8f15a28e02e8df606fa44", "score": "0.5389816", "text": "function arrayOfAllYears(array){\n return array.map(function(item){\n return item.year;\n });\n}", "title": "" }, { "docid": "91b925394dd033b5a951e56f82a5a2a2", "score": "0.538682", "text": "function textifyDates(myArr){\n \n \n for(var r=0; r < myArr.length; r++){\n for(var c=0; c < myArr[r].length; c++){\n if (Object.prototype.toString.call(myArr[r][c]) === '[object Date]'){\n try { \n //myArr[r] = myArr[r].toString();\n myArr[r][c] = Utilities.formatDate(myArr[r][c], \"GMT+08:00\", \"dd-MMM-yyyy hh:mm:ss\")\n } \n catch(err) { myArr[r][c] = err};\n }\n }\n }\n return myArr;\n}", "title": "" }, { "docid": "2de21e8b2f177c23056ea33d6f275dfb", "score": "0.537959", "text": "function singleDayProccessor(dateArray, priceArray){\n const newDateArray = [];\n const newPriceArray = [];\n const tempDateArray = MStoDate(dateArray);\n // dateArray.map(ms => new Date(parseInt(ms)));\n \n\n if(tempDateArray.length === 1) {\n newPriceArray.push(priceArray[0]);\n newDateArray.push(tempDateArray[0])\n } else {\n for(var i = 0; i < tempDateArray.length; i++) {\n\n //if got two prices recorded for the same day\n if(i !== tempDateArray.length - 1 &&\n tempDateArray[i].getDate() === tempDateArray[i+1].getDate() &&\n tempDateArray[i].getMonth() === tempDateArray[i+1].getMonth() &&\n tempDateArray[i].getFullYear() === tempDateArray[i+1].getFullYear()) {\n\n //if the price for the current entry is lower\n if(priceArray[i] < priceArray[i + 1]) {\n newPriceArray.push(priceArray[i]);\n newDateArray.push(tempDateArray[i])\n i++;\n // if the price for the next entry is lower, record that one\n } else {\n newDateArray.push(tempDateArray[i + 1])\n newPriceArray.push(priceArray[i + 1]);\n i++;\n }\n\n\n // if no two prices on the same day, just record the entry \n } else {\n newPriceArray.push(priceArray[i]);\n newDateArray.push(tempDateArray[i])\n }\n }\n }\n\n // newDateArray.map(date => date.getTime().toString())\n \n return [dateToMS(newDateArray), newPriceArray];\n }", "title": "" }, { "docid": "e647d8c36eae2a938f41abf3a7682892", "score": "0.53718174", "text": "function getYear3(){\n\nvar today = new Date();\nvar yyyy = today.getFullYear();\nvar yyyy = yyyy+\"0\"; // array conversion\nreturn yyyy[2];\n\n}", "title": "" }, { "docid": "a4665d97e023b7a6f47f5fe7c97d94b2", "score": "0.5364828", "text": "function makeDateFromStringAndArray(config) {\nvar tempConfig,\nbestMoment,\nscoreToBeat,\ni,\ncurrentScore;\nif (config._f.length === 0) {\nconfig._pf.invalidFormat = true;\nconfig._d = new Date(NaN);\nreturn;\n}\nfor (i = 0; i < config._f.length; i++) {\ncurrentScore = 0;\ntempConfig = copyConfig({}, config);\nif (config._useUTC != null) {\ntempConfig._useUTC = config._useUTC;\n}\ntempConfig._pf = defaultParsingFlags();\ntempConfig._f = config._f[i];\nmakeDateFromStringAndFormat(tempConfig);\nif (!isValid(tempConfig)) {\ncontinue;\n}\n// if there is any input that was not parsed add a penalty for that format\ncurrentScore += tempConfig._pf.charsLeftOver;\n//or tokens\ncurrentScore += tempConfig._pf.unusedTokens.length * 10;\ntempConfig._pf.score = currentScore;\nif (scoreToBeat == null || currentScore < scoreToBeat) {\nscoreToBeat = currentScore;\nbestMoment = tempConfig;\n}\n}\nextend(config, bestMoment || tempConfig);\n}", "title": "" }, { "docid": "0102d9e4910041ba84249b17461bbc84", "score": "0.5343289", "text": "function bestYearAvg(arr) {\n \n}", "title": "" }, { "docid": "91975edc13990608ce782f06b32bff75", "score": "0.5337377", "text": "function validGetTime(validDateArray) {\n // if (!arrayOfNums[2])\n let dateInstance = new Date(validDateArray[2], (validDateArray[0] - 1),\n validDateArray[1]);\n return dateInstance.getTime();\n}", "title": "" }, { "docid": "daeb8a059d2a12db506ff51258a48a13", "score": "0.5333555", "text": "function dateSortArray(arr) {\n const sortedArray = arr.sort((a, b) => b.timestamp - a.timestamp);\n return sortedArray;\n}", "title": "" }, { "docid": "df2e3a7e37b61dea060b56baecd3f576", "score": "0.5322226", "text": "function bestYearAvg(arr) {}", "title": "" }, { "docid": "6cd3446ee85337eaa0b6db2cbb792b43", "score": "0.5311539", "text": "function makeArray(firstYear, secondYear, thirdYear) {\n let myArray = new Array;\n myArray = '(' + firstYear + ',' + secondYear + ',' + thirdYear + ')';\n\n return myArray;\n}", "title": "" }, { "docid": "c068bd41a42bbed945c3350799a8379b", "score": "0.52990067", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "fa2144d287bd9244d4eaa01f83230f46", "score": "0.52973175", "text": "function WantedDate(ROCdate) {\n const ROCdateArr = ROCdate.split(\"/\");\n const year = Number(ROCdateArr[0]) + 1911\n const month = ROCdateArr[1] - 1\n const day = ROCdateArr[2]\n return [year, month, day]\n}", "title": "" }, { "docid": "ef71de57a3dcf20808e44df04f055d57", "score": "0.52947015", "text": "function getYear4(){\n\nvar today = new Date();\nvar yyyy = today.getFullYear();\nvar yyyy = yyyy+\"0\"; // array conversion\nreturn yyyy[3];\n\n}", "title": "" }, { "docid": "3135cb2d59a8dacd0ab737b3658d68f5", "score": "0.5294196", "text": "function orderByYear (arr){\n\n }", "title": "" }, { "docid": "83cc91d58bf5857ca49c3dbfb39febf4", "score": "0.52909154", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "c55c6e9b14ee68d338d14c1b7f9348e0", "score": "0.5284768", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "title": "" }, { "docid": "c55c6e9b14ee68d338d14c1b7f9348e0", "score": "0.5284768", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n\n // check for mismatching day of week\n if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== config._d.getDay()) {\n getParsingFlags(config).weekdayMismatch = true;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.5284768", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.5284768", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "732c5fda2212c54b9d9b93058ebd00e8", "score": "0.5284768", "text": "function configFromArray(config) {\n var i,\n date,\n input = [],\n currentDate,\n yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "7bb6d7d2e45a40fe0c518a0b824dd7f1", "score": "0.5266575", "text": "function monthArray(array){\n var ageMonth = array;\n for (var i=0; i<rabbitLifeMonths; i+= 1)\n {\n ageMonth.push(0);\n }\n return ageMonth;\n}", "title": "" }, { "docid": "14d9b9002798ccc2ab518bf582a4d412", "score": "0.5257411", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "14d9b9002798ccc2ab518bf582a4d412", "score": "0.5257411", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" }, { "docid": "9d851458f75cddfe8f218940d655c620", "score": "0.5246424", "text": "function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse)) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }", "title": "" } ]
5b3d2e60cd874eebf1d358334368a304
Shows the tooltip with an animation originating from the provided origin
[ { "docid": "99ea88b6c28c86c0ed073ecd343e5d4a", "score": "0.0", "text": "show(delay) {\n // Cancel the delayed hide if it is scheduled\n if (this._hideTimeoutId) {\n clearTimeout(this._hideTimeoutId);\n this._hideTimeoutId = null;\n }\n // Body interactions should cancel the tooltip if there is a delay in showing.\n this._closeOnInteraction = true;\n this._showTimeoutId = setTimeout(() => {\n this._visibility = 'visible';\n this._showTimeoutId = null;\n // Mark for check so if any parent component has set the\n // ChangeDetectionStrategy to OnPush it will be checked anyways\n this._markForCheck();\n }, delay);\n }", "title": "" } ]
[ { "docid": "0d58088a5c84a9c7baf54d3a7eb6c347", "score": "0.72503734", "text": "show() {\n const t = this;\n const animationCompleteCb = () => t.renderingResolved(t._tooltip);\n this._createTooltip().then(() => {\n switch (t._animType) {\n case 'fade': {\n t._tooltip.css({ opacity: 0 });\n t._tooltip.animate({ opacity: 1 }, this._animSpeed, animationCompleteCb);\n break;\n }\n default: {\n animationCompleteCb();\n break;\n }\n }\n });\n }", "title": "" }, { "docid": "0d371fb22b60649d2b13680a141cb197", "score": "0.6281722", "text": "showTooltip() {\n if (!this.state.isRendered) {\n this.setState({isRendered: true});\n }\n this.animation.stopAnimation();\n this.shouldStartShowAnimation = true;\n\n // We have to dynamically calculate the position here as tooltip could have been rendered on some elments\n // that has changed its position\n this.getWrapperPosition()\n .then(({\n x, y, width, height,\n }) => {\n this.setState({\n wrapperWidth: width,\n wrapperHeight: height,\n xOffset: x,\n yOffset: y,\n });\n\n // We may need this check due to the reason that the animation start will fire async\n // and hideTooltip could fire before it thus keeping the Tooltip visible\n if (this.shouldStartShowAnimation) {\n Animated.timing(this.animation, {\n toValue: 1,\n duration: 140,\n delay: 500,\n useNativeDriver: false,\n }).start();\n }\n });\n }", "title": "" }, { "docid": "28f594193490ccb3267dd5b8c61667dc", "score": "0.6106301", "text": "function getAnimateFunction(origin, tooltip, backdrop) {\n\n return function() {\n var options = {\n delay: 50,\n position: 'left'\n };\n var margin = 5;\n\n // Log that we are using it so we don't call it again on ourselves\n origin.data('active', true);\n\n tooltip.css({ display: 'block', left: '0px', top: '0px' });\n\n // Tooltip positioning\n var originWidth = origin.outerWidth();\n var originHeight = origin.outerHeight();\n var tooltipPosition = options.position;\n var tooltipHeight = tooltip.outerHeight();\n var tooltipWidth = tooltip.outerWidth();\n var tooltipVerticalMovement = '0px';\n var tooltipHorizontalMovement = '0px';\n var scale_factor = 8;\n\n // Makes a halfway decent attempt to deal with tooltips moving out of view\n if (tooltipPosition === \"top\") {\n if (origin.offset().top < tooltipHeight) {\n tooltipPosition = 'bottom';\n }\n } else if (tooltipPosition === \"left\") {\n if (origin.offset().left < tooltipWidth) {\n tooltipPosition = 'right';\n }\n } else if (tooltipPosition === \"right\") {\n if (window.innerWidth - origin.offset().left + originWidth < tooltipWidth) {\n tooltipPosition = 'left';\n }\n } else {\n if (window.innerHeight - origin.offset().top + originHeight < tooltipHeight) {\n tooltipPosition = 'top';\n }\n }\n\n // Top Position\n if (tooltipPosition === \"top\") {\n tooltip.css({\n top: origin.offset().top - tooltipHeight - margin,\n left: origin.offset().left + originWidth/2 - tooltipWidth/2\n });\n tooltipVerticalMovement = '-10px';\n backdrop.css({\n borderRadius: '14px 14px 0 0',\n transformOrigin: '50% 90%',\n marginTop: tooltipHeight,\n marginLeft: (tooltipWidth/2) - (backdrop.width()/2)\n\n });\n }\n // Left Position\n else if (tooltipPosition === \"left\") {\n tooltip.css({\n top: origin.offset().top + originHeight/2 - tooltipHeight/2,\n left: origin.offset().left - tooltipWidth - margin\n });\n tooltipHorizontalMovement = '-10px';\n backdrop.css({\n width: '14px',\n height: '14px',\n borderRadius: '14px 0 0 14px',\n transformOrigin: '95% 50%',\n marginTop: tooltipHeight/2,\n marginLeft: tooltipWidth\n });\n }\n // Right Position\n else if (tooltipPosition === \"right\") {\n tooltip.css({\n top: origin.offset().top + originHeight/2 - tooltipHeight/2,\n left: origin.offset().left + originWidth + margin\n });\n tooltipHorizontalMovement = '+10px';\n backdrop.css({\n width: '14px',\n height: '14px',\n borderRadius: '0 14px 14px 0',\n transformOrigin: '5% 50%',\n marginTop: tooltipHeight/2,\n marginLeft: '0px'\n });\n }\n // Bottom Position\n else {\n tooltip.css({\n top: origin.offset().top + origin.outerHeight() + margin,\n left: origin.offset().left + originWidth/2 - tooltipWidth/2\n });\n tooltipVerticalMovement = '+10px';\n backdrop.css({\n marginLeft: (tooltipWidth/2) - (backdrop.width()/2)\n });\n }\n\n // Calculate Scale to fill\n scale_factor = Math.max(tooltipHeight, tooltipWidth) / 4;\n\n if (scale_factor < 8) {\n scale_factor = 8;\n }\n if (tooltipPosition === \"right\" || tooltipPosition === \"left\") {\n // scale_factor = tooltipWidth / 10;\n if (scale_factor < 10)\n scale_factor = 10;\n }\n\n tooltip.velocity({ marginTop: tooltipVerticalMovement, marginLeft: tooltipHorizontalMovement}, { duration: 350, queue: false })\n .velocity({opacity: 1}, {duration: 300, delay: 50, queue: false });\n\n backdrop.css({ display: 'block' })\n .velocity({opacity: 0.98},{duration: 85, delay: 0, queue: false})\n .velocity({scale: scale_factor},{\n duration: 300,\n delay: 50,\n queue: false,\n easing: 'easeInOutQuad',\n complete: function() {\n DraggableItems.itemInfo.inProgress = false;\n }\n });\n };\n}", "title": "" }, { "docid": "750ab47b2d02c9b8d3e8e0046b8d5da7", "score": "0.6033601", "text": "function createTooltip() {\n let tooltip = document.createElement(\"div\");\n let style = tooltip.style;\n\n tooltip.setAttribute(\"role\", \"tooltip\");\n tooltip.setAttribute(\"id\", \"tTip\");\n tooltip.classList.add(\"tooltip\");\n\n let textElement = document.createElement(\"div\");\n textElement.classList.add(\"esri-widget\");\n tooltip.appendChild(textElement);\n\n view.container.appendChild(tooltip);\n\n let x = 0;\n let y = 0;\n let targetX = 0;\n let targetY = 0;\n let visible = false;\n\n // move the tooltip progressively\n function move() {\n x += (targetX - x) * 0.1;\n y += (targetY - y) * 0.1;\n\n if (Math.abs(targetX - x) < 1 && Math.abs(targetY - y) < 1) {\n x = targetX;\n y = targetY;\n } else {\n requestAnimationFrame(move);\n }\n\n style.transform =\n \"translate3d(\" + Math.round(x) + \"px,\" + Math.round(y) + \"px, 0)\";\n }\n\n return {\n show: function(point, text) {\n if (window) {\n if (!visible) {\n x = point.x;\n y = point.y;\n }\n\n targetX = point.x;\n targetY = point.y;\n style.opacity = 1;\n visible = true;\n textElement.innerHTML = text;\n\n move();\n } else {\n style.opacity = 0;\n visible = false;\n }\n },\n\n hide: function() {\n style.opacity = 0;\n visible = false;\n }\n };\n }", "title": "" }, { "docid": "d1bbc72a04e79c86c924a55ad45acec9", "score": "0.59621215", "text": "function tooltipIn (result, div) {\n div.html(result.title)\n .style('left', (d3.event.pageX + 25) + 'px')\n .style('top', (d3.event.pageY - 20) + 'px')\n div.transition()\n .duration(200)\n .style('opacity', 0.9)\n}", "title": "" }, { "docid": "46e4bfd0e66a68a1c2a2852c1a89af6d", "score": "0.5953575", "text": "function createTooltip() {\n const tooltip = document.createElement(\"div\");\n let style = tooltip.style;\n\n tooltip.setAttribute(\"role\", \"tooltip\");\n tooltip.classList.add(\"tooltip\");\n\n const textElement = document.createElement(\"div\");\n textElement.classList.add(\"esri-widget\");\n tooltip.appendChild(textElement);\n\n view.container.appendChild(tooltip);\n\n let x = 0;\n let y = 0;\n let targetX = 0;\n let targetY = 0;\n let visible = false;\n\n // move the tooltip progressively\n function move() {\n x += (targetX - x) * 0.1;\n y += (targetY - y) * 0.1;\n\n if (Math.abs(targetX - x) < 1 && Math.abs(targetY - y) < 1) {\n x = targetX;\n y = targetY;\n } else {\n requestAnimationFrame(move);\n }\n style.transform = \"translate3d(\" + Math.round(x) + \"px,\" + Math.round(y) + \"px, 0)\";\n }\n\n return {\n show: function (point, text) {\n if (!visible) {\n x = point.x;\n y = point.y;\n }\n\n targetX = point.x;\n targetY = point.y;\n style.opacity = 1;\n visible = true;\n textElement.innerHTML = text;\n\n\n move();\n },\n hide: function () {\n style.opacity = 0;\n visible = false;\n }\n };\n }", "title": "" }, { "docid": "5154383df51dfe827027ccde07e41f5c", "score": "0.58662176", "text": "tooltipShow(event, d, isPoint) {\n let vis = this;\n // create and show tooltip\n d3.select('#chordchart-tooltip')\n .style('display', 'block')\n .style('left', () => {\n if (event.pageX > 1650 && !isPoint) {\n return event.pageX - vis.tooltipWidth - vis.config.tooltipPadding + 'px';\n }\n return event.pageX + vis.config.tooltipPadding + 'px'\n }) \n .style('top', (event.pageY + vis.config.tooltipPadding) + 'px')\n .html(isPoint ? vis.tooltipHTMLPoint(d) : vis.tooltipHTMLRim(d));\n }", "title": "" }, { "docid": "944883fdf2e90654dcce179cd987f544", "score": "0.58392555", "text": "function showTooltip(x, y, label, position) {\n // if( clicksYet )\n // label += (pointClicked)? ' hello':' bye';\n\n var tooltipTop = 0, toolTipLeft = 0;\n switch(position)\n {\n case 0:\n tooltipTop = y - 20; \n toolTipLeft = x + 5;\n break;\n case 1:\n tooltipTop = y + 15; \n toolTipLeft = x + 0;\n break;\n case 2:\n tooltipTop = y + 10; \n toolTipLeft = x - 25;\n break;\n case 3:\n tooltipTop = y - 25; \n toolTipLeft = x - 30;\n break;\n default:\n tooltipTop = y - 20; \n toolTipLeft = x + 5;\n }\n\n $('<div id=\"tooltip\">' + label + '</div>').css( {\n \"background-color\":\"rgba(46,48,46,0.8)\",\n \"-webkit-border-radius\": \"4px\",\n \"-moz-border-radius\": \"4px\",\n \"border-radius\": \"4px\",\n color: \"#ffffff\",\n \"font-weight\": \"bold\",\n 'font-size': '10px',\n position: 'absolute',\n top: tooltipTop,\n left: toolTipLeft,\n padding: \"2px\",\n\n\n\n // position: 'absolute',\n // display: 'none',\n // 'font-size': '10px',\n // top: tooltipTop,\n // left: toolTipLeft,\n // border: '1px solid #fdd',\n // padding: '2px',\n // 'background-color': '#fee',\n // opacity: 0.80,\n 'z-index': 3\n }).appendTo(\"body\").fadeIn(100);\n}", "title": "" }, { "docid": "a7cd804f233842f9d11557860a4f6d68", "score": "0.58313173", "text": "function showTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "title": "" }, { "docid": "cf92f7bb9d60f9b62e2955280857f3cb", "score": "0.58080894", "text": "function showTooltip(x, y, label) {\n $('#tooltip').remove()\n $('<div id=\"tooltip\">{0}</div>'.format(label)).appendTo('body')\n .css({'left': x+5, 'top': y+5});\n}", "title": "" }, { "docid": "2efa31b65a4d31576e81936214f03b0c", "score": "0.57961977", "text": "function showTooltip(x, y, contents) {\r\n\t\t$('<div id=\"tooltip\">' + contents + \"</div>\")\r\n\t\t\t.css({\r\n\t\t\t\tposition: \"absolute\",\r\n\t\t\t\tdisplay: \"none\",\r\n\t\t\t\ttop: y + 5,\r\n\t\t\t\tleft: x + 5,\r\n\t\t\t\tborder: \" x solid #fdd\",\r\n\t\t\t\tpadding: \"2px\",\r\n\t\t\t\t\"background-color\": \"#fee\",\r\n\t\t\t\topacity: 0.8\r\n\t\t\t})\r\n\t\t\t.appendTo(\"body\")\r\n\t\t\t.fadeIn(200)\r\n\t}", "title": "" }, { "docid": "7a7209bd24181c28d88fc1ddf2e982dc", "score": "0.5764703", "text": "function mouseover(){\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", .9);\n }", "title": "" }, { "docid": "7715defad177c169874dcfd82f7d1de6", "score": "0.5733366", "text": "function show() {\n\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return angular.noop;\n }\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n }\n \n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n \n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n scope.tt_isOpen = true;\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "944cca1a86ad89e35dadc81f8ff8d5ff", "score": "0.57173073", "text": "function show() {\n\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n }\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n scope.tt_isOpen = true;\n scope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "944cca1a86ad89e35dadc81f8ff8d5ff", "score": "0.57173073", "text": "function show() {\n\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n }\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n scope.tt_isOpen = true;\n scope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "7cf6a6baedc68268743b6b75739634bd", "score": "0.57167125", "text": "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! ttScope.content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n ttScope.$digest();\n\n positionTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n ttScope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "7cf6a6baedc68268743b6b75739634bd", "score": "0.57167125", "text": "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! ttScope.content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n ttScope.$digest();\n\n positionTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n ttScope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "7cf6a6baedc68268743b6b75739634bd", "score": "0.57167125", "text": "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! ttScope.content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n ttScope.$digest();\n\n positionTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n ttScope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "3fde464b701de80da808964f6d31565f", "score": "0.5690211", "text": "hideTooltip() {\n this.animation.stopAnimation();\n this.shouldStartShowAnimation = false;\n Animated.timing(this.animation, {\n toValue: 0,\n duration: 140,\n useNativeDriver: false,\n }).start();\n }", "title": "" }, { "docid": "d714ed61f05e0889df24f9aeb0bee32d", "score": "0.5682958", "text": "hide() {\n switch (this._animType) {\n case 'fade': {\n this._tooltip.animate({ opacity: 0 }, this._animSpeed, this._destroyTooltip);\n break;\n }\n case 'none':\n default: {\n this._destroyTooltip();\n break;\n }\n }\n }", "title": "" }, { "docid": "9a9fa99fa4eda60cd7e392c52953f5f4", "score": "0.56809056", "text": "function markerAnimate(element,delay,duration,series,pointIndex,point,isLabel){var centerX=point.x;var centerY=point.y;var height=0;element.style.visibility='hidden';new Animation({}).animate(element,{duration:duration,delay:delay,progress:function progress(args){if(args.timeStamp>args.delay){args.element.style.visibility='visible';height=(args.timeStamp-args.delay)/args.duration;element.setAttribute('transform','translate('+centerX+' '+centerY+') scale('+height+') translate('+-centerX+' '+-centerY+')');}},end:function end(model){element.style.visibility='';element.removeAttribute('transform');if((series.type==='Scatter'||series.type==='Bubble')&&!isLabel&&pointIndex===series.points.length-1){series.chart.trigger('animationComplete',{series:series});}}});}", "title": "" }, { "docid": "d21af2b52edabcb0239446aaac7e42e7", "score": "0.5677609", "text": "function show() {\n\t\n\t popupTimeout = null;\n\t\n\t // If there is a pending remove transition, we must cancel it, lest the\n\t // tooltip be mysteriously removed.\n\t if (transitionTimeout) {\n\t $timeout.cancel(transitionTimeout);\n\t transitionTimeout = null;\n\t }\n\t\n\t // Don't show empty tooltips.\n\t if (!scope.tt_content) {\n\t return angular.noop;\n\t }\n\t\n\t createTooltip();\n\t\n\t // Set the initial positioning.\n\t tooltip.css({ top: 0, left: 0, display: 'block' });\n\t\n\t // Now we add it to the DOM because need some info about it. But it's not \n\t // visible yet anyway.\n\t if (appendToBody) {\n\t $document.find('body').append(tooltip);\n\t } else {\n\t element.after(tooltip);\n\t }\n\t\n\t positionTooltip();\n\t\n\t // And show the tooltip.\n\t scope.tt_isOpen = true;\n\t scope.$digest(); // digest required as $apply is not called\n\t\n\t // Return positioning function as promise callback for correct\n\t // positioning after draw.\n\t return positionTooltip;\n\t }", "title": "" }, { "docid": "d0e81780d3806bfba8227f4cf359ef30", "score": "0.5669496", "text": "function fnShowToolTip(text, latestMouseProjection) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (toolTip && latestMouseProjection) {\n\n\t\t\t\t\t\t\t\t\ttoolTip.empty();\n\t\t\t\t\t\t\t\t\ttoolTip.text(text);\n\n\t\t\t\t\t\t\t\t\tvar canvasHalfWidth = renderer.domElement.offsetWidth / 2;\n\t\t\t\t\t\t\t\t\tvar canvasHalfHeight = renderer.domElement.offsetHeight / 2;\n\n\t\t\t\t\t\t\t\t\t//Normalized with 0,0,0 centered on the scene \n\t\t\t\t\t\t\t\t\tvar tooltipPosition = latestMouseProjection.clone().project(camera); \n\n\t\t\t\t\t\t\t\t\t//Relative to the renderer\t\t\n\t\t\t\t\t\t\t\t\ttooltipPosition.x = (tooltipPosition.x * canvasHalfWidth) + canvasHalfWidth ;\n\t\t\t\t\t\t\t\t\ttooltipPosition.y = -(tooltipPosition.y * canvasHalfHeight) + canvasHalfHeight;\t\n\n\t\t\t\t\t\t\t\t\ttoolTip.css({\t\n\t\t\t\t\t\t\t\t\t\t//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals\n\t\t\t\t\t\t\t\t\t\tleft: `${tooltipPosition.x - toolTip.outerWidth() / 2 }px`, \n\t\t\t\t\t\t\t\t\t\ttop: `${tooltipPosition.y - toolTip.outerHeight() - 5}px`,\n\t\t\t\t\t\t\t\t\t\topacity: 1.0,\n\t\t\t\t\t\t\t\t\t\tdisplay: \"block\"\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t} //if\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "471d7556d268518b30cfa6f3ebb1fe8c", "score": "0.56562", "text": "showTooltip() {\r\n if (this.domElement && this.latestMouseProjection) {\r\n this.domElement.style.display = 'block';\r\n this.domElement.style.opacity = '0';\r\n\r\n const canvasHalfWidth = this.renderer.domElement.offsetWidth / 2;\r\n const canvasHalfHeight = this.renderer.domElement.offsetHeight / 2;\r\n\r\n const tooltipPosition = this.latestMouseProjection.clone() // .project(camera);\r\n tooltipPosition.x = (tooltipPosition.x * canvasHalfWidth) + canvasHalfWidth + this.renderer.domElement.offsetLeft;\r\n tooltipPosition.y = -(tooltipPosition.y * canvasHalfHeight) + canvasHalfHeight + this.renderer.domElement.offsetTop;\r\n\r\n this.domElement.innerText = this.hoveredObj.userData.tooltipText;\r\n\r\n setTimeout(function() {\r\n const tootipWidth = this.domElement.offsetWidth;\r\n const tootipHeight = this.domElement.offsetHeight;\r\n\r\n this.domElement.style.left = `${tooltipPosition.x - tootipWidth/2}px`;\r\n this.domElement.style.top = `${tooltipPosition.y - tootipHeight - 9}px`;\r\n\r\n setTimeout(function() {\r\n this.domElement.style.opacity = '1';\r\n }.bind(this), 25);\r\n\r\n }.bind(this), 25)\r\n }\r\n }", "title": "" }, { "docid": "31fd515a55f49c1a21eed411e930bd40", "score": "0.56358236", "text": "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! ttScope.content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not\n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n ttScope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "31fd515a55f49c1a21eed411e930bd40", "score": "0.56358236", "text": "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! ttScope.content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not\n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n ttScope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "536e7007999f6241d78db2159707b874", "score": "0.5635235", "text": "function showempushyTooltip(content, event) {\n tt.style('opacity', 1.0)\n .html(content);\n\n updatePosition(event);\n }", "title": "" }, { "docid": "e9b20877ca54883c573c7a04dc696c26", "score": "0.56249404", "text": "function show() {\n var position,\n ttWidth,\n ttHeight,\n ttPosition;\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return;\n }\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n }\n \n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n \n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $body = $body || $document.find( 'body' );\n $body.append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n // Get the position of the directive element.\n position = appendToBody ? $position.offset( element ) : $position.position( element );\n\n // Get the height and width of the tooltip so we can center it.\n ttWidth = tooltip.prop( 'offsetWidth' );\n ttHeight = tooltip.prop( 'offsetHeight' );\n \n // Calculate the tooltip's top and left coordinates to center it with\n // this directive.\n switch ( scope.tt_placement ) {\n case 'right':\n ttPosition = {\n top: position.top + position.height / 2 - ttHeight / 2,\n left: position.left + position.width\n };\n break;\n case 'bottom':\n ttPosition = {\n top: position.top + position.height,\n left: position.left + position.width / 2 - ttWidth / 2\n };\n break;\n case 'left':\n ttPosition = {\n top: position.top + position.height / 2 - ttHeight / 2,\n left: position.left - ttWidth\n };\n break;\n default:\n ttPosition = {\n top: position.top - ttHeight,\n left: position.left + position.width / 2 - ttWidth / 2\n };\n break;\n }\n\n ttPosition.top += 'px';\n ttPosition.left += 'px';\n\n // Now set the calculated positioning.\n tooltip.css( ttPosition );\n \n // And show the tooltip.\n scope.tt_isOpen = true;\n }", "title": "" }, { "docid": "e9b20877ca54883c573c7a04dc696c26", "score": "0.56249404", "text": "function show() {\n var position,\n ttWidth,\n ttHeight,\n ttPosition;\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return;\n }\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n }\n \n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n \n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $body = $body || $document.find( 'body' );\n $body.append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n // Get the position of the directive element.\n position = appendToBody ? $position.offset( element ) : $position.position( element );\n\n // Get the height and width of the tooltip so we can center it.\n ttWidth = tooltip.prop( 'offsetWidth' );\n ttHeight = tooltip.prop( 'offsetHeight' );\n \n // Calculate the tooltip's top and left coordinates to center it with\n // this directive.\n switch ( scope.tt_placement ) {\n case 'right':\n ttPosition = {\n top: position.top + position.height / 2 - ttHeight / 2,\n left: position.left + position.width\n };\n break;\n case 'bottom':\n ttPosition = {\n top: position.top + position.height,\n left: position.left + position.width / 2 - ttWidth / 2\n };\n break;\n case 'left':\n ttPosition = {\n top: position.top + position.height / 2 - ttHeight / 2,\n left: position.left - ttWidth\n };\n break;\n default:\n ttPosition = {\n top: position.top - ttHeight,\n left: position.left + position.width / 2 - ttWidth / 2\n };\n break;\n }\n\n ttPosition.top += 'px';\n ttPosition.left += 'px';\n\n // Now set the calculated positioning.\n tooltip.css( ttPosition );\n \n // And show the tooltip.\n scope.tt_isOpen = true;\n }", "title": "" }, { "docid": "e9b20877ca54883c573c7a04dc696c26", "score": "0.56249404", "text": "function show() {\n var position,\n ttWidth,\n ttHeight,\n ttPosition;\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return;\n }\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n }\n \n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n \n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $body = $body || $document.find( 'body' );\n $body.append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n // Get the position of the directive element.\n position = appendToBody ? $position.offset( element ) : $position.position( element );\n\n // Get the height and width of the tooltip so we can center it.\n ttWidth = tooltip.prop( 'offsetWidth' );\n ttHeight = tooltip.prop( 'offsetHeight' );\n \n // Calculate the tooltip's top and left coordinates to center it with\n // this directive.\n switch ( scope.tt_placement ) {\n case 'right':\n ttPosition = {\n top: position.top + position.height / 2 - ttHeight / 2,\n left: position.left + position.width\n };\n break;\n case 'bottom':\n ttPosition = {\n top: position.top + position.height,\n left: position.left + position.width / 2 - ttWidth / 2\n };\n break;\n case 'left':\n ttPosition = {\n top: position.top + position.height / 2 - ttHeight / 2,\n left: position.left - ttWidth\n };\n break;\n default:\n ttPosition = {\n top: position.top - ttHeight,\n left: position.left + position.width / 2 - ttWidth / 2\n };\n break;\n }\n\n ttPosition.top += 'px';\n ttPosition.left += 'px';\n\n // Now set the calculated positioning.\n tooltip.css( ttPosition );\n \n // And show the tooltip.\n scope.tt_isOpen = true;\n }", "title": "" }, { "docid": "7e49398d74315a4eca6972554ab022af", "score": "0.5611599", "text": "function mouseover() {\n tooltip.style(\"display\", \"inline\");\n }", "title": "" }, { "docid": "e4c9ac7e7d32eaf76e4420531137fd7a", "score": "0.55984265", "text": "function showTooltip() {\r tooltip.container.addClass('graph-tooltip--visible');\r }", "title": "" }, { "docid": "d0cdeeae4b5426b236ba143410814d67", "score": "0.55711246", "text": "function showTooltip(d, i){\n tooltipText(d);\n tooltip.style(\"left\", (d3.event.pageX + 5) + \"px\")\n .style(\"top\", (d3.event.pageY - 5) + \"px\")\n .transition()\n .duration(300)\n .style(\"opacity\", 1)\n //.style(\"background-color\", \"\")\n .style(\"display\", \"block\");\n\n $(this).css(\"stroke\", \"#FF0000\")\n .css(\"stroke-width\", 1.5 + \"px\");\n }", "title": "" }, { "docid": "4f6a018aa2f67383442a4b31c35cea9d", "score": "0.5568612", "text": "function show() {\n animating = true;\n $(\".github\").animate({\n opacity: 1.0,\n top: \"-=50\",\n }, 150, function() {\n $('.github').attr('src', show_image);\n animating = false;\n position = 'up';\n if(!$('.github').is(\":hover\")) {\n hide();\n }\n });\n }", "title": "" }, { "docid": "d5deb886263c69bc17cec24ad2cc67e7", "score": "0.5565803", "text": "function showTooltip(x, y, color, contents) {\n $('<div id=\"tooltip\">' + contents + '</div>').css({\n position: 'absolute',\n top: y - 30,\n left: x + 10,\n border: '2px solid ' + color,\n padding: '2px',\n 'font-size': '12px',\n 'border-radius': '5px',\n 'background-color': 'white',\n 'font-family': 'Verdana, Arial, Helvetica, Tahoma, sans-serif',\n opacity: 0.8\n }).appendTo(\"body\").fadeIn(200);\n }", "title": "" }, { "docid": "9a87e05f36f40d2f5ef4266073cd3134", "score": "0.5563761", "text": "_showTooltip(){\n this._tooltipVisible = true\n this.render()\n \n }", "title": "" }, { "docid": "60d0ec3c9b20faa9bcfa7f7677faee0d", "score": "0.5555489", "text": "function showTooltip(evt, text) {\n let tooltip = document.getElementById(\"tooltip\");\n\n\n tooltip.innerHTML = text\n tooltip.setAttribute('style', evt)\n tooltip.style.position = \"absolute\";\n tooltip.style.display = \"block\"\n // tooltip.style.left = 90 + 'px';\n // tooltip.style.top = 500 + 'px';\n // tooltip.style.left = evt.pageX + '50' + 'px';\n // tooltip.style.top = evt.pageY + '50' + 'px';\n // tooltip.style(\"left\", (d3.mouse(this)[0]+70) + \"px\")\n // .style(\"top\", (d3.mouse(this)[1]) + \"px\");\n}", "title": "" }, { "docid": "40c1df6698538b4ba4bf14f5002d64e1", "score": "0.55280817", "text": "show() {\n if (this.options.showOn !== 'all' && !__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__[\"a\" /* MediaQuery */].is(this.options.showOn)) {\n // console.error('The screen is too small to display this tooltip');\n return false;\n }\n\n var _this = this;\n this.template.css('visibility', 'hidden').show();\n this._setPosition();\n this.template.removeClass('top bottom left right').addClass(this.position)\n this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment);\n\n /**\n * Fires to close all other open tooltips on the page\n * @event Closeme#tooltip\n */\n this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));\n\n\n this.template.attr({\n 'data-is-active': true,\n 'aria-hidden': false\n });\n _this.isActive = true;\n // console.log(this.template);\n this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function() {\n //maybe do stuff?\n });\n /**\n * Fires when the tooltip is shown\n * @event Tooltip#show\n */\n this.$element.trigger('show.zf.tooltip');\n }", "title": "" }, { "docid": "40c1df6698538b4ba4bf14f5002d64e1", "score": "0.55280817", "text": "show() {\n if (this.options.showOn !== 'all' && !__WEBPACK_IMPORTED_MODULE_2__foundation_util_mediaQuery__[\"a\" /* MediaQuery */].is(this.options.showOn)) {\n // console.error('The screen is too small to display this tooltip');\n return false;\n }\n\n var _this = this;\n this.template.css('visibility', 'hidden').show();\n this._setPosition();\n this.template.removeClass('top bottom left right').addClass(this.position)\n this.template.removeClass('align-top align-bottom align-left align-right align-center').addClass('align-' + this.alignment);\n\n /**\n * Fires to close all other open tooltips on the page\n * @event Closeme#tooltip\n */\n this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));\n\n\n this.template.attr({\n 'data-is-active': true,\n 'aria-hidden': false\n });\n _this.isActive = true;\n // console.log(this.template);\n this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function() {\n //maybe do stuff?\n });\n /**\n * Fires when the tooltip is shown\n * @event Tooltip#show\n */\n this.$element.trigger('show.zf.tooltip');\n }", "title": "" }, { "docid": "1214ec5fc812533781c48654ede317a5", "score": "0.55134207", "text": "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n scope.tt_isOpen = true;\n scope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "1214ec5fc812533781c48654ede317a5", "score": "0.55134207", "text": "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if ( transitionTimeout ) {\n $timeout.cancel( transitionTimeout );\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if ( ! scope.tt_content ) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({ top: 0, left: 0, display: 'block' });\n\n // Now we add it to the DOM because need some info about it. But it's not \n // visible yet anyway.\n if ( appendToBody ) {\n $document.find( 'body' ).append( tooltip );\n } else {\n element.after( tooltip );\n }\n\n positionTooltip();\n\n // And show the tooltip.\n scope.tt_isOpen = true;\n scope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "b205473b69ae0117ef8b7a2bd8941e43", "score": "0.5498352", "text": "function showToolTip() {\n\tdocument.getElementById(\"circ_tooltip\").setAttribute(\"fill-opacity\", \"1\");\n}", "title": "" }, { "docid": "4073ec48bc2172b0495ad2e20087108a", "score": "0.54466826", "text": "function showTooltip(d) {\r\n let winningYears = d.data['Winning Years'];\r\n if (winningYears.includes('-')) {\r\n winningYears = winningYears.replace(/-/g, ', ');\r\n }\r\n const html = `\r\n <p class=\"head\"></p>\r\n <p class=\"title\"> ${d.data.Player} <p>\r\n <p> Winning Years <p>\r\n <p>${winningYears}</p>\r\n `;\r\n tooltip.html(html);\r\n tooltip\r\n .style('visibility', 'visible')\r\n .style('top', `${d3.event.layerY + 100}px`)\r\n .style('left', `${d3.event.layerX + 170}px`);\r\n\r\n //Show Image on center\r\n d3.select('#imageid').remove();\r\n d3.select('#circleid').remove();\r\n svg\r\n .append('pattern')\r\n .attr('id', 'imageid')\r\n .attr('width', 1)\r\n .attr('height', 1)\r\n .attr('x', 0)\r\n .attr('y', 0)\r\n .append('svg:image')\r\n .attr('xlink:href', d.data.ImageUrl)\r\n .attr('x', 0)\r\n .attr('y', 0)\r\n .attr('width', 150)\r\n .attr('height', 150);\r\n svg\r\n .append('circle')\r\n .attr('id', 'circleid')\r\n .attr('r', '75')\r\n .attr('cx', '0')\r\n .attr('cy', '0')\r\n .attr('fill', `url(#imageid)`);\r\n}", "title": "" }, { "docid": "12280be49affefdf6be8d43445cd1566", "score": "0.5437228", "text": "function show() {\n\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if (!scope.tt_content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // Set the initial positioning.\n tooltip.css({\n top: 0,\n left: 0,\n display: 'block',\n border: '1px solid #DAE1E8',\n background: '#FDFDFD',\n boxShadow: '0px 0px 2px rgba(34,37,41,.24)',\n borderRadius: '2px'\n });\n\n // Now we add it to the DOM because need some info about it. But it's not\n // visible yet anyway.\n if (appendToBody) {\n $document.find('body').append(tooltip);\n } else {\n element.after(tooltip);\n }\n\n positionTooltip(scope.showEvent);\n\n // And show the tooltip.\n scope.tt_isOpen = true;\n scope.$digest(); // digest required as $apply is not called\n\n // Return positioning function as promise callback for correct\n // positioning after draw.\n return positionTooltip;\n }", "title": "" }, { "docid": "b011b4050f7fcbc47b14aa94b0b75da9", "score": "0.5434028", "text": "function showIt(tmpID) {\n tooltip.text(tmpID);\n tooltip.style(\"visibility\", \"visible\");\n tooltip.property(\"title\", tmpID);\n}", "title": "" }, { "docid": "b011b4050f7fcbc47b14aa94b0b75da9", "score": "0.5434028", "text": "function showIt(tmpID) {\n tooltip.text(tmpID);\n tooltip.style(\"visibility\", \"visible\");\n tooltip.property(\"title\", tmpID);\n}", "title": "" }, { "docid": "b011b4050f7fcbc47b14aa94b0b75da9", "score": "0.5434028", "text": "function showIt(tmpID) {\n tooltip.text(tmpID);\n tooltip.style(\"visibility\", \"visible\");\n tooltip.property(\"title\", tmpID);\n}", "title": "" }, { "docid": "4ff1e2c9476cb0ead7bcc8332860971a", "score": "0.5418275", "text": "function moveTooltip() {\n tooltip.style(\"top\",(d3.event.pageY+tooltipOffset.y)+\"px\")\n .style(\"left\",(d3.event.pageX+tooltipOffset.x)+\"px\");\n}", "title": "" }, { "docid": "11ba669b526df79ffcb7cd265adfc571", "score": "0.5415562", "text": "showAbove() {\n this.tooltipElement.classList.add(getClass(\"top\"));\n this.element.style.setProperty(\"top\", toPx(this.node.getBoundingClientRect().top - this.element.offsetHeight - 10));\n this.centerHorizontally();\n }", "title": "" }, { "docid": "e10c3536282f003a5177ff1257b8f732", "score": "0.54120207", "text": "function showQtip(showTarget, content, delay) {\n var $showTarget = $('#' + showTarget);\n if ($showTarget) {\n $showTarget.qtip({\n content: content,\n position: {\n corner: {\n tooltip: 'topMiddle',\n target: 'bottomMiddle'\n }\n },\n show: {\n when: false,\n ready: true\n }\n });\n if (delay) {\n setTimeout(function() {\n $showTarget.qtip('destroy');\n }, delay);\n }\n else {\n setTimeout(function() {\n $showTarget.qtip('destroy');\n }, g_feature.tip_disapear);\n }\n }\n $showTarget.focus();\n}", "title": "" }, { "docid": "7e3fd212cd26d85eabe78c4d8c5f21d7", "score": "0.54113185", "text": "show() {\n if (this.options.showOn !== 'all' && !Foundation.MediaQuery.is(this.options.showOn)) {\n // console.error('The screen is too small to display this tooltip');\n return false;\n }\n\n var _this = this;\n this.template.css('visibility', 'hidden').show();\n this._setPosition();\n\n /**\n * Fires to close all other open tooltips on the page\n * @event Closeme#tooltip\n */\n this.$element.trigger('closeme.zf.tooltip', this.template.attr('id'));\n\n\n this.template.attr({\n 'data-is-active': true,\n 'aria-hidden': false\n });\n _this.isActive = true;\n // console.log(this.template);\n this.template.stop().hide().css('visibility', '').fadeIn(this.options.fadeInDuration, function() {\n //maybe do stuff?\n });\n /**\n * Fires when the tooltip is shown\n * @event Tooltip#show\n */\n this.$element.trigger('show.zf.tooltip');\n }", "title": "" }, { "docid": "2ba2203c3bb2aaf4f8b71ca76928ade1", "score": "0.5401329", "text": "tipMouseover(event, d) {\n // To make the tooltip easier to read\n let vis = this;\n\n vis.tooltip.html(`\n <div style=\"border: thin solid grey; border-radius: 5px; background: white; width: 200px\">\n <h5><bold>${d.country}</bold></h5>\n <h6>Gold: ${d.Gold}</h6>\n <h6>Silver: ${d.Silver}</h6>\n <h6>Bronze: ${d.Bronze}</h6>\n </div>`\n )\n .style(\"left\", 445 + \"px\")\n .style(\"top\", (0.7*(vis.y(d.country)) + 70) + \"px\")\n .style(\"text-align\", \"center\")\n .transition()\n .duration(300) // ms\n .style(\"opacity\", 0.9)\n\n }", "title": "" }, { "docid": "d85416aed0b3b63b70bf4146c21ecfa8", "score": "0.5399014", "text": "function showInfo() {\n\td3.select(\"#information\").style(\"z-index\",\"1000\").transition().duration(300).style('opacity',1);\n\tstopTooltip = true;\n\tremoveEvents();\n}//showInfo", "title": "" }, { "docid": "e4ba72052c44ece662d216930701cbec", "score": "0.53918236", "text": "function mouseover(d) {\n return tooltip\n .style(\"display\", null); // this removes the display none setting\n } // end mouseover()", "title": "" }, { "docid": "321a527287af4fa98fbfe8e58a491539", "score": "0.538014", "text": "function showScatterPlot() {\n\n g.selectAll('.summary-title')\n .transition()\n .duration(100)\n .attr('opacity', 0);\n\n // ensure axis are set\n showScatterXAxis(xAxisScatter);\n showScatterYAxis(yAxisScatter);\n showScatterDots();\n showScatterLegend();\n showScatterDesc();\n\n \n }", "title": "" }, { "docid": "e26a0353655b596079276eb42f41a572", "score": "0.5374979", "text": "function showQtip(showTarget, content, delay) {\r\n content = display_SIMtoUIM(content);\r\n var $showTarget = $('#' + showTarget);\r\n if ($showTarget) {\r\n $showTarget.qtip({\r\n content: content,\r\n position: {\r\n corner: {\r\n tooltip: 'topMiddle',\r\n target: 'bottomMiddle'\r\n }\r\n },\r\n show: {\r\n when: false,\r\n ready: true\r\n }\r\n });\r\n if (delay) {\r\n setTimeout(function() {\r\n $showTarget.qtip('destroy');\r\n }, delay);\r\n }\r\n else {\r\n setTimeout(function() {\r\n $showTarget.qtip('destroy');\r\n }, g_feature.tip_disapear);\r\n }\r\n }\r\n $showTarget.focus();\r\n}", "title": "" }, { "docid": "050c1e12b00da486a112d87bfcb602f0", "score": "0.53544444", "text": "show() {\n this.$caller.attr({'aria-expanded': true, 'aria-haspopup': true});\n\n switch (this.animation) {\n case ANIMATION_SCALE_FROM_ORIGIN:\n this.scaleFromOrigin(() => this.onShowFinished());\n break;\n case ANIMATION_FLYOUT:\n this.asFlyoutFromOrigin(() => this.onShowFinished());\n break;\n case ANIMATION_FADE_IN_OUT:\n this.$element.stop(true, true).fadeIn(ANIMATION_SPEED, () => this.onShowFinished());\n break;\n case ANIMATION_SLIDE_FROM_BOTTOM:\n this.slideFromBottom(() => this.onShowFinished());\n break;\n default:\n this.$element.show(() => this.onShowFinished());\n break;\n }\n }", "title": "" }, { "docid": "4724a77dc9e5c2bd15e35876619aa30d", "score": "0.5342602", "text": "function show() {\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if (!(options.useContentExp ? ttScope.contentExp() : ttScope.content)) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n if (isOpenExp) {\n isOpenExp.assign(ttScope.origScope, ttScope.isOpen);\n }\n\n if (!$rootScope.$$phase) {\n ttScope.$apply(); // digest required as $apply is not called\n }\n\n tooltip.css({ display: 'block' });\n\n positionTooltip();\n }", "title": "" }, { "docid": "4724a77dc9e5c2bd15e35876619aa30d", "score": "0.5342602", "text": "function show() {\n popupTimeout = null;\n\n // If there is a pending remove transition, we must cancel it, lest the\n // tooltip be mysteriously removed.\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n\n // Don't show empty tooltips.\n if (!(options.useContentExp ? ttScope.contentExp() : ttScope.content)) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.isOpen = true;\n if (isOpenExp) {\n isOpenExp.assign(ttScope.origScope, ttScope.isOpen);\n }\n\n if (!$rootScope.$$phase) {\n ttScope.$apply(); // digest required as $apply is not called\n }\n\n tooltip.css({ display: 'block' });\n\n positionTooltip();\n }", "title": "" }, { "docid": "d5acb0a3f907855805125c78c13220b5", "score": "0.5341066", "text": "_positionTooltip() {\n if (!this._tooltip) { return; }\n const position = this._getTooltipPosition();\n this._tooltip.css(position);\n }", "title": "" }, { "docid": "c6002337835f79d85cdb5c98a3a9e2db", "score": "0.53347915", "text": "function mdEnterAnimation$1(Animation, baseElm, position) {\n const baseAnimation = new Animation();\n const wrapperAnimation = new Animation();\n const wrapperEle = baseElm.querySelector('.toast-wrapper');\n wrapperAnimation.addElement(wrapperEle);\n switch (position) {\n case 'top':\n wrapperAnimation.fromTo('translateY', '-100%', '0%');\n break;\n case 'middle':\n let topPosition = Math.floor(baseElm.clientHeight / 2 - wrapperEle.clientHeight / 2);\n wrapperEle.style.top = `${topPosition}px`;\n wrapperAnimation.fromTo('opacity', 0.01, 1);\n break;\n default:\n wrapperAnimation.fromTo('translateY', '100%', '0%');\n break;\n }\n return baseAnimation\n .addElement(baseElm)\n .easing('cubic-bezier(.36,.66,.04,1)')\n .duration(400)\n .add(wrapperAnimation);\n}", "title": "" }, { "docid": "a9b3e25e535a90fa4046568ca4b2d672", "score": "0.5330651", "text": "function Tooltip() {\n}", "title": "" }, { "docid": "f5e9e5e6a9daa39133f7507f1c05f26d", "score": "0.53216773", "text": "function animation_memory_location (position){\n show_arrow (position);\n}", "title": "" }, { "docid": "f5e9e5e6a9daa39133f7507f1c05f26d", "score": "0.53216773", "text": "function animation_memory_location (position){\n show_arrow (position);\n}", "title": "" }, { "docid": "507427e5fb269375565c830f4187bc79", "score": "0.5320073", "text": "function showTooltip(d) {\n moveTooltip();\n\n tooltip.style(\"display\",\"block\")\n .text(d.properties.nom_mun);\n}", "title": "" }, { "docid": "5019ad27932bbec5c54b475590fdf68c", "score": "0.5319913", "text": "function showTooltip(d) {\n\n\t // Info for tooltips\n var label = this.id;\n\n // Define content of tooltips\n var mouse = d3.mouse(this)\n \t tooltip.classed(\"hidden\", false)\n .attr(\"style\", \"left:\" + (mouse[0] + offsetL) \n \t+ \"px;top:\"+(mouse[1] + offsetT) + \"px\")\n .html(label)\n\t}", "title": "" }, { "docid": "ae2492b4740cd70fbd452b6d90439bca", "score": "0.5316026", "text": "tipMouseout() {\n let vis = this;\n\n vis.tooltip.transition()\n .duration(300) // ms\n .style(\"opacity\", 0); // don't care about position!\n }", "title": "" }, { "docid": "74112a6ecc55ddd76dd9b1224e202783", "score": "0.5294708", "text": "function showTicker(){\n\t\tvar a = $(this).attr('data-tip');\n\t\tticker.attr('class',dataTicker[a]['class']).find('span').text(dataTicker[a]['text']);\n\t\tticker.css({\n\t\t\t'left':dataTicker[a]['left'],\n\t\t\t'right':dataTicker[a]['right'],\n\t\t\t'top':dataTicker[a]['top'],\n\t\t\t'bottom':dataTicker[a]['bottom'],\n\t\t\t'position':'fixed'\n\t\t}).show();\n\t}", "title": "" }, { "docid": "f9c485f12a0a90ced86af00895663050", "score": "0.52789074", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "db05d4e689e4760ff6c2528c9f44b3c2", "score": "0.52732784", "text": "function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }", "title": "" }, { "docid": "f0c52e427c65cac90b5719f3b5d24eea", "score": "0.526588", "text": "show(animate) {\r\n if (animate) {\r\n /*\r\n\t\t\tthis.animator = Animate(this._el.container, {\r\n\t\t\t\tleft: \t\t-(this._el.container.offsetWidth * n) + \"px\",\r\n\t\t\t\tduration: \tthis.options.duration,\r\n\t\t\t\teasing: \tthis.options.ease\r\n\t\t\t});\r\n\t\t\t*/\r\n } else {\r\n this._el.container.style.display = \"block\";\r\n }\r\n }", "title": "" }, { "docid": "12a14f7291ac3a973bf7b65ef3f51337", "score": "0.52650124", "text": "function show() {\n\t cancelShow();\n\t cancelHide();\n\t\n\t // Don't show empty tooltips.\n\t if (!ttScope.content) {\n\t return angular.noop;\n\t }\n\t\n\t createTooltip();\n\t\n\t // And show the tooltip.\n\t ttScope.$evalAsync(function() {\n\t ttScope.isOpen = true;\n\t assignIsOpen(true);\n\t positionTooltip();\n\t });\n\t }", "title": "" }, { "docid": "ed44478c136ee92a9a222bb567e5e8e6", "score": "0.5260686", "text": "function showTooltip(x, y, contents, color) {\r\n\t\t$('<div id=\"IsCtooltipFlot\">' + contents + '</div>')\r\n\t\t\t.css({position:'absolute', display:'none', top: y + 5, left: x + 15, border:'1px solid #fdd', padding:'2px', backgroundColor: color, color:'#000', opacity:0.80, 'z-index':'100000',})\r\n\t\t\t.appendTo(\"body\")\r\n\t\t\t.fadeIn(200);\r\n\t}", "title": "" }, { "docid": "1448ca182ad8b54a7ddb09aac5b87d5a", "score": "0.5251175", "text": "positionPopupInBeginAnimationPosition() {\n this.popup.style.top = this.previewOptions.top;\n this.popup.style.left = this.previewOptions.left;\n\n this.popup.style.transform = `\n scaleX(${this.previewOptions.width / this.popupOptions.width}) \n scaleY(${this.previewOptions.height / this.popupOptions.height})\n `;\n\n this.popup.style.visibility = \"visible\";\n this.popup.style.transitionProperty = \"\";\n this.popup.style.transitionDuration = \"\";\n }", "title": "" }, { "docid": "42336deb3d81e38b170681324e96c995", "score": "0.5250699", "text": "function tooltipOn (html) {\r\n // Hide the tooltip if it's already open somewhere\r\n tooltip.style(\"opacity\", 0);\r\n html = \"<div id=\\\"tooltipCloser\\\"><a href=\\\"#\\\" onclick=\\\"tooltipOff(0); return false;\\\"><i class=\\\"icon-remove\\\"></i></a></div>\" + html;\r\n tooltip\r\n .html(html)\r\n .style(\"left\", \"0px\")\r\n //.style(\"left\", (d3.event.pageX) + \"px\")\r\n .style(\"top\", (d3.event.pageY + 5) + \"px\");\r\n\r\n var tooltip_width = tooltip_jq.outerWidth();\r\n if (d3.event.pageX + tooltip_width > window.innerWidth) {\r\n tooltip.style(\"left\", (window.innerWidth - tooltip_width) + \"px\");\r\n } else {\r\n tooltip.style(\"left\", (d3.event.pageX) + \"px\"); \r\n }\r\n\r\n tooltip.transition()\r\n .duration(100)\r\n .style(\"opacity\", 0.9);\r\n\r\n}", "title": "" }, { "docid": "074f0e640fc4f582fcac76fdac202999", "score": "0.524525", "text": "_showTooltip() {\n this._tooltipContainer = document.createElement('div');\n this._tooltipContainer.textContent = this._tooltipText;\n this.shadowRoot.appendChild(this._tooltipContainer);\n }", "title": "" }, { "docid": "8522e11b48ca1acc6e9d9e748c9c909a", "score": "0.5240586", "text": "function showMarker() {\r\n this.marker.moveAnimation.setPaused(false);\r\n this.marker.alpha = 1;\r\n }", "title": "" }, { "docid": "f4059aafa0bf2413ba1727f55a93ac92", "score": "0.52399653", "text": "function animation() {\n var title1 = new TimelineMax();\n title1.to(\".button\", 0, {visibility: 'hidden', opacity: 0})\n title1.staggerFromTo(\".title span\", 0.5, \n {ease: Back.easeOut.config(1.7), opacity: 0, bottom: -80},\n {ease: Back.easeOut.config(1.7), opacity: 1, bottom: 0}, 0.05);\n title1.to(\".button\", 0.2, {visibility: 'visible' ,opacity: 1})\n }", "title": "" }, { "docid": "93c59dc47dc500d0a70535d5a4a9833d", "score": "0.5236727", "text": "setOrigin(origin) {\n this.origin = origin;\n }", "title": "" }, { "docid": "84cfd20e06a681c9e9c7e5d61343cc8a", "score": "0.523238", "text": "function show() {\n\t cancelShow();\n\t cancelHide();\n\n\t // Don't show empty tooltips.\n\t if (!ttScope.content) {\n\t return angular.noop;\n\t }\n\n\t createTooltip();\n\n\t // And show the tooltip.\n\t ttScope.$evalAsync(function() {\n\t ttScope.isOpen = true;\n\t assignIsOpen(true);\n\t positionTooltip();\n\t });\n\t }", "title": "" }, { "docid": "a6947ad66840daa7806ee03bf403c38f", "score": "0.5223911", "text": "function showSummary() {\n\n g.selectAll('.scatter')\n .transition()\n .duration(100)\n .style('opacity', 0);\n\n g.selectAll('.dot.scatter')\n .transition(\"translate\")\n .duration(1000)\n .attr('cy', d => yScale(0));\n\n g.selectAll('.desc.scatter')\n .transition(\"translate-desc\")\n .duration(1000)\n .attr('y', yScale(0));\n\n g.selectAll('.summary-title')\n .transition()\n .duration(600)\n .attr('opacity', 1.0);\n }", "title": "" }, { "docid": "6e0e9110955269aa702e704e07854b21", "score": "0.52171975", "text": "function showTip(e, node) {\n\n tipOffsetX = 20;\n tipOffsetY = 20;\n\n var target = e.target ? e.target : e.srcElement;\n\n tip = document.getElementById('tooltip');\n\n //Add mousemove event handler\n addEvent(target, 'mousemove', function(e, win){\n //get mouse position\n win = win || window;\n e = e || win.event;\n var doc = win.document;\n doc = doc.html || doc.body;\n var page = {\n x: e.pageX || e.clientX + doc.scrollLeft,\n y: e.pageY || e.clientY + doc.scrollTop\n };\n tip.style.display = '';\n //get window dimensions\n win = {\n 'height': document.body.clientHeight,\n 'width': document.body.clientWidth\n };\n //get tooltip dimensions\n var obj = {\n 'width': tip.offsetWidth,\n 'height': tip.offsetHeight\n };\n //set tooltip position\n var style = tip.style, x = tipOffsetX, y = tipOffsetY;\n style.top = ((page.y + y + obj.height > win.height)?\n (page.y - obj.height - y) : page.y + y) + 'px';\n style.left = ((page.x + obj.width + x > win.width)?\n (page.x - obj.width - x) : page.x + x) + 'px';\n });\n\n addEvent(target, 'mouseout', function(e, win){\n tip.style.display = 'none';\n });\n\n tip.innerHTML = makeHTMLFromData(node.name, node.data);\n}", "title": "" }, { "docid": "c35c4ceef92c814faaf4fe59ab54ef15", "score": "0.52035373", "text": "setTooltip ( ) {\n this.tooltip.attr( 'id', 'tooltip' ).attr( 'transform', 'translate( 100, 80)' );\n this.tooltipText.attr( 'id', 'tooltip-text' );\n this.tooltipIcon.attr( 'id', 'tooltip-icon' )\n .attr(\n 'd',\n `M79.544 173.652v-21.96h44.45v43.92h-44.45zm27.199 10.795c.332-.332.433-2.248.157-2.968-.108\n -.283-.496-.419-1.19-.419h-1.03v-6.3c0-4.645-.088-6.418-.334-6.754-.292-.399-.777-.446-3.902\n -.381l-3.57.074v3.44l1.125.08 1.124.082v9.729l-1.124.081-1.125.082-.08 1.563c-.056 1.071.027\n 1.632.264 1.782.57.36 9.315.279 9.685-.09zm-2.744-18.884c.511-.511.587-3.805.098-4.294-.198\n -.197-1.176-.317-2.593-.317s-2.395.12-2.593.317c-.184.185-.317 1.066-.317 2.098 0 2.397.24 \n 2.612 2.91 2.612 1.537 0 2.187-.108 2.495-.416z`\n )\n .attr( 'transform', 'translate( -130, -180)' );\n return this;\n }", "title": "" }, { "docid": "1611e7c8dc47e0c8d2d8060227dc707a", "score": "0.5178725", "text": "show(option) {\n let self = this\n Animated.sequence([\n Animated.delay(option.delay), // Option\n Animated.parallel([\n Animated.timing(this.state.x, {\n toValue: option.to, // Option\n duration: this.props.duration || 150,\n }),\n Animated.timing( \n this.state.fade,\n {\n toValue: 1, \n duration: this.props.duration || 150,\n }\n )\n ])\n ]).start((info) => {\n\n if (!info.finished) {\n console.log('complete while animating')\n return\n }\n\n self.visible = true\n \n if (self.props.onFinishAnim)\n self.props.onFinishAnim()\n })\n }", "title": "" }, { "docid": "6ba612c3bba3725a5e30453f4af3ae66", "score": "0.517722", "text": "function showSocialToolTip(e, img){\n\t\t\t\tvar path = img;\n\t\t\t\t$('#tooltip').css({'top':e.pageY+10, 'left':e.pageX-110, 'background':'none'});\n\t\t\t\t$('#tooltip').html('<img src=\"' + path + '\" alt=\"tooltip\">');\t\n\t\t\t\t$('#tooltip').show();\t\n\t\t\t}", "title": "" }, { "docid": "525c79ad8020ed986f1ea5c770df16bc", "score": "0.51602226", "text": "function showTooltip(d) {\n tooltip\n .style(\"opacity\", 1)\n .style(\n \"left\",\n () => `${d3.event.pageX - tooltip.node().offsetWidth / 2}px`\n )\n .style(\n \"top\",\n () => `${d3.event.pageY - tooltip.node().offsetHeight - 10}px`\n ).html(`\n <p>${d.first_name} ${d.last_name}</p>\n <p>Savings: $${d.savings.toLocaleString()}</p>\n <p>Balance: $${d.balance.toLocaleString()}</p>\n <p>Country: ${d.country}</p>\n <p>Year: ${d.year}</p>\n `);\n }", "title": "" }, { "docid": "a8be152ec6c14221debe3f567d311f45", "score": "0.5147486", "text": "function tooltips_mousemove2(x, y, html) {\n var xPosition = x + $(\".leftpart\").width() + 80;\n var yPosition = y + $(\".navbar\").height();\n d3.select(\"#tooltip\")\n .style(\"left\", xPosition + \"px\")\n .style(\"top\", yPosition + \"px\"); \n d3.select(\"#tooltip\")\n .html(html);\n d3.select(\"#tooltip\").classed(\"hidden\", false);\n\n d3.select(\"line.xx\")\n .style(\"opacity\", 1)\n .attr(\"transform\",\n \"translate(\" + x + \",\" +\n 0 + \")\"); \n}", "title": "" }, { "docid": "427f6a6e4f82568df2953b3a9d1030f2", "score": "0.51134574", "text": "function checkTooltip(){\n jq(\".info\").tooltip({ position: { my: 'center top', at: 'center bottom+10' }}); \n}", "title": "" }, { "docid": "8f37dd788be3630ee3a1a78b0a736c1e", "score": "0.5109898", "text": "tooltipMove(event, d, isPoint) {\n let vis = this;\n\n d3.select('#chordchart-tooltip')\n .style('left', () => {\n if (event.pageX > 1650 && !isPoint) {\n return event.pageX - vis.tooltipWidth - vis.config.tooltipPadding + 'px';\n }\n return event.pageX + vis.config.tooltipPadding + 'px'\n })\n .style('top', (event.pageY + vis.config.tooltipPadding) + 'px')\n }", "title": "" }, { "docid": "91a62e550b831c5279e4e1e1cc8e2e17", "score": "0.51012367", "text": "function setBibTeXTooltip(target, message) {\n target.attr('data-original-title', message)\n .tooltip('show');\n }", "title": "" } ]
88d0b5ae112c4f6e7834fb6a65c63c65
Render the object on screen.
[ { "docid": "e246ff7782668e35d0e005110dc42f04", "score": "0.0", "text": "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n }", "title": "" } ]
[ { "docid": "12b11f75830798e914ea39746b7c6223", "score": "0.7451792", "text": "render() {\n\t\tsuper.render();\n\t}", "title": "" }, { "docid": "c1aaa4df0b798a2e9eddfe7df3c0501d", "score": "0.730012", "text": "function render() {\n renderBackground();\n renderEntities();\n renderStats();\n renderMenu();\n }", "title": "" }, { "docid": "0c321b637618a1587ca3445476c6d30a", "score": "0.72924125", "text": "display() {\r\n\r\n //Stored this.body's position inside pos variable \r\n var pos = this.body.position;\r\n\r\n //Set rect mode as (CENTER)\r\n rectMode(CENTER);\r\n\r\n //Set shape color as \"white\"\r\n fill(\"white\");\r\n\r\n //Displayed the object through rectangular shape\r\n rect(pos.x, pos.y, this.w, this.h);\r\n\r\n //Used a for loop\r\n for (var i = 0; i < this.body.length; i++) {\r\n\r\n //Displayed the object through rectangular shape continiously\r\n rect(this.body[i][0], this.body[i][1]);\r\n\r\n }\r\n\r\n }", "title": "" }, { "docid": "68efa53bf34da0cda16ce571de529324", "score": "0.7241505", "text": "display() {\n\t\tthis.scene.pushMatrix();\n\t\tthis.scene.scale(this.radius, this.radius, this.radius);\n\t\tthis.drawElements(this.scene.gl.TRIANGLES);\n\t\tthis.scene.popMatrix();\n\t}", "title": "" }, { "docid": "aa4151548ff2b87f762969dd705c6e23", "score": "0.7074116", "text": "function renderDisplay () {\n\t\trenderInventory();\n\t\trenderLocation();\n\t}", "title": "" }, { "docid": "e4e64a257356d3e49638d925dbc21278", "score": "0.69872886", "text": "function render() {\n context.fillStyle = \"#23374d\";\n context.fillRect(0, 0, SIZE, SIZE);\n }", "title": "" }, { "docid": "345e2c3d637ba1716e9fa487e13c0691", "score": "0.69438624", "text": "function render() {\n renderField();\n renderEntities();\n renderStatus();\n }", "title": "" }, { "docid": "00cfa621d0209a1d26badb740b2181af", "score": "0.69313633", "text": "render() {\r\n this.head.render()\r\n this.body.render()\r\n this.tail.render()\r\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.6891549", "text": "render() {\n }", "title": "" }, { "docid": "6c7fb77bf7d4cd047a29e8d7ddcf411b", "score": "0.6856816", "text": "render() {\n this.renderContainer();\n this.renderStyleDef();\n this.renderTitle();\n this.renderBorder();\n this.onRender();\n }", "title": "" }, { "docid": "dda9864ace2427e552fde0b074e3118d", "score": "0.68564206", "text": "render() {\n ctx.drawImage(Resources.get(this.sprite), this.x, this.y, 30, 42);\n this.drawLevelText();\n this.drawFooterText();\n }", "title": "" }, { "docid": "bf4502672d55910fe65654372eac1c08", "score": "0.6851978", "text": "function render() {\n // clear context\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n // draw map\n for (row = 0; row < NUM_ROWS; row++) {\n for (col = 0; col < NUM_COLUMNS; col++) {\n ctx.drawImage(Resources.get(Map[row]), col * TILE_WIDTH, row * TILE_HEIGHT);\n }\n }\n // draw player and other objects\n renderEntities();\n DrawScore();\n // render floating text boxes\n RenderFloaters();\n // draw paused text\n if(paused)\n DrawPaused();\n }", "title": "" }, { "docid": "79874b33680cca868d794186328f175c", "score": "0.6848312", "text": "render() {\n this.renderMonitorData();\n\n this.documentCtx.drawImage(this.bc.canvas, 0, 0);\n this.clear();\n }", "title": "" }, { "docid": "2758de4c31e606973ba76cd96f5c55a6", "score": "0.6843495", "text": "render() {\n return super.render(this.display());\n }", "title": "" }, { "docid": "a585af41e17676a76ac7636168349928", "score": "0.68274647", "text": "display() {\n\n//the abbreviation variable for the class's body's position...\n\n var position = this.body.position;\n \n rectMode(CENTER);\n fill(\"silver\");\n\n rect(position.x, position.y, this.w, this.h);\n }", "title": "" }, { "docid": "57fecf6cca893fdfd568411ca864e49b", "score": "0.682263", "text": "display(){\n this.draw();\n }", "title": "" }, { "docid": "ba03577872d1dbaaf0f5fdac660680fb", "score": "0.6812752", "text": "render() {\n\n\t\tthis.ctx.save();\n\t\tthis.ctx.beginPath();\n\t\tthis.ctx.fillStyle = \"#000000\";\n\t\tthis.ctx.strokeStyle = \"rgb( 255, 0, 0 )\";\n\n\t\tthis.ctx.rect(\n\t\t\tthis.data.x,\n\t\t\tthis.data.y,\n\t\t\tthis.data.width,\n\t\t\tthis.data.height\n\t\t);\n\t\tthis.ctx.fill();\n\n\t\t// Glow\n this.ctx.shadowOffsetX = 0;\n this.ctx.shadowOffsetY = 0;\n this.ctx.shadowBlur = 15;\n this.ctx.shadowColor = \"rgb( 255, 0, 0 )\";\n this.ctx.stroke();\n this.ctx.restore();\n\n\t}", "title": "" }, { "docid": "b16990f296dfca87e9270af68f86a2ee", "score": "0.6812733", "text": "function render() {\n home.renderer.render(home.scene, home.cameras.liveCam);\n home.controls.update();\n }", "title": "" }, { "docid": "614ffed4da6120d91651cd550784ccde", "score": "0.67942756", "text": "function render() {\n // Render the appropriate game level scenario\n renderScene();\n // Draw the next gem if there is any to be collected\n if (remainingGems > 0) {\n renderGems();\n }\n // Render stone obstacles\n renderRocks();\n // Render the game entities (player and enemies)\n renderEntities();\n // render score, heart and key\n renderScore();\n renderHeart();\n renderKey();\n }", "title": "" }, { "docid": "592efda5fcb27b86f5054fc650578242", "score": "0.67715603", "text": "function render() {\n renderer.render(scene, camera);\n }", "title": "" }, { "docid": "4257a5b0fb3b843cab887ab87d11ea95", "score": "0.6768698", "text": "render()\r\n\t{\r\n\t\tthis.renderer.render(this.scene, this.camera)\t\t\t\t\r\n\t}", "title": "" }, { "docid": "6b2df206b926a8d25085cd4cee50bf6e", "score": "0.6766505", "text": "display() {\n if (this.sceneInited) {\n this.textureRTT.attachToFrameBuffer()\n\n this.render(this.camera_to_rtt)\n\n this.textureRTT.detachFromFrameBuffer()\n this.render(this.normalcamera)\n\n this.gl.disable(this.gl.DEPTH_TEST);\n this.security_camera.display()\n this.gl.enable(this.gl.DEPTH_TEST)\n }\n }", "title": "" }, { "docid": "20a5904f64687754b413129670c2f159", "score": "0.6753897", "text": "function render() {\r\n\r\n isRendered = true;\r\n\r\n renderSource();\r\n\r\n }", "title": "" }, { "docid": "2b7f6ded4f864b5ddd25b0f0a3407f51", "score": "0.6753266", "text": "render() {\n\n \n\n return (\n this.renderDisplay()\n )\n }", "title": "" }, { "docid": "4fd51d83eea5b1b30be11625fdf6105e", "score": "0.6751291", "text": "display() {\n\n this.scene.pushMatrix();\n this.scene.rotate(Math.PI / 2, 0, 1, 0);\n this.scene.scale(0.05, 0.05, 0.1);\n this.texture.apply();\n this.light.display();\n this.scene.popMatrix();\n\n }", "title": "" }, { "docid": "3fc59cceb2b0ad8f0a844ad04e58531d", "score": "0.6742626", "text": "function render() {\n isRendered = true;\n renderSource();\n }", "title": "" }, { "docid": "335a1b1e055702fceaccd007b9b0575e", "score": "0.6742328", "text": "function render() {\n isRendered = true;\n renderSource();\n }", "title": "" }, { "docid": "b217cc2e6ae8f9c73a46911cd6b76e93", "score": "0.6717505", "text": "display() {\n\t\tthis.scene.pushMatrix();\n\n\t\t// move to the right place\n\t\tthis.scene.translate(this.xPos, this.yPos, this.zPos);\n\t\tthis.scene.rotate(this.rotation, 0, 1, 0);\n\n\t\t// draw canvas\n\t\tthis.material.setTexture(this.canvasTex);\n\t\tthis.material.apply();\n\t\tthis.scene.pushMatrix();\n\t\tthis.scene.translate(0, 1.5, 0);\n\t\tthis.scene.scale(2, 1, 0.1);\n\t\tthis.cube.display();\n\t\tthis.scene.popMatrix();\n\n\t\t// draw legs\n\t\t// left\n\t\tthis.material.setTexture(this.greyTex);\n\t\tthis.material.apply();\n\t\tthis.scene.pushMatrix();\n\t\tthis.scene.translate(0.9, 0.5, 0);\n\t\tthis.scene.scale(0.05, 1, 0.05);\n\t\tthis.cube.display();\n\t\tthis.scene.popMatrix();\n\n\t\t// right\n\t\tthis.scene.pushMatrix();\n\t\tthis.scene.translate(-0.9, 0.5, 0);\n\t\tthis.scene.scale(0.05, 1, 0.05);\n\t\tthis.cube.display();\n\t\tthis.scene.popMatrix();\n\n\t\tthis.scene.popMatrix();\n\t}", "title": "" }, { "docid": "46a79f216f7fd6bb5fcf1cf30aa7f1ee", "score": "0.6715227", "text": "display() {\n push();\n translate(this.x, this.y);\n rotate(this.angle);\n image(this.img, 0, 0);\n pop();\n }", "title": "" }, { "docid": "da5e9b5c9d53dc98029f0b341f698e1f", "score": "0.67146254", "text": "display()\n {\n this.scene.pushMatrix();\n //Displaying the top of the cylinder\n this.scene.pushMatrix();\n this.scene.translate(0, 0, this.height);\n this.scene.scale(this.top, this.top, 1);\n this.cylinderBase.display();\n this.scene.popMatrix();\n\n //Displaying the bottom of the cylinder\n this.scene.pushMatrix();\n this.scene.rotate(Math.PI, 1, 0, 0);\n this.scene.scale(this.base, this.base, 1);\n this.cylinderBase.display();\n this.scene.popMatrix(); \n \n\t\t\t//Displaying the body of the cylinder\n this.scene.scale(1, 1, this.height);\n this.body.display();\n this.scene.popMatrix();\n }", "title": "" }, { "docid": "de4c0e10d8ebc73105a21652af3fad26", "score": "0.670105", "text": "render() {\n\n this.ctx.fillStyle = \"#5B6EE1\";\n this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);\n\n this.ctx.save();\n this.ctx.translate(this.camera.x, this.camera.y);\n\n\n /* Render all background entities */\n for (let entity of this.backgroundEntities) {\n\n if (entity.render) entity.render(this.ctx);\n\n }\n /* Render all entities */\n for (let entity of this.entities) {\n\n if (entity.render) entity.render(this.ctx);\n\n }\n\n\n this.ctx.restore();\n this.framesPerSecond();\n }", "title": "" }, { "docid": "9dc135ad3b9b26841d19a6aff73c8169", "score": "0.67004454", "text": "function render(object){\n // IF OBJECT IS A PLAYER, DRAW THIS WAY\n if(object.type === 'player'){\n drawhands(object);\n drawbody(object);\n drawname(object);\n\n if(object.charging === true)\n {drawcharge(object);}\n\n } else if(object.type === 'ball'){\n drawball(object);\n } else if(object.type === 'broadcast'){\n drawTime(object.message);\n }\n}", "title": "" }, { "docid": "bf9e656addf306873800966a996783b7", "score": "0.66962916", "text": "function render()\n{\n screenCtx.clearRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);\n player.render();\n bullets.forEach(function(bullet) { bullet.render(); } );\n asteroids.forEach(function(asteroid) { asteroid.render(); } );\n aliens.forEach(function(alien) { alien.render(); } );\n user_interface.render();\n}", "title": "" }, { "docid": "ed5397d954a14c0873bc98d67edb14ec", "score": "0.6695576", "text": "function render(){\t\t\t\t\n\trenderer.render( scene, camera )\n}", "title": "" }, { "docid": "579af4f7a1a406f7dd7e718718750bc8", "score": "0.66953254", "text": "function render(){\n\n\trenderer.render( scene, camera )\n}", "title": "" }, { "docid": "80e5f6665d3b776747fa6821c967fb89", "score": "0.66927904", "text": "function render(){\r\n\r\n\t\tctx.fillStyle = \"rgba( 5, 29, 29, \" + guiControls.fineness + \" )\";\r\n\t\tctx.clearRect( 0, 0, oSize.w, oSize.h );\r\n\r\n\t\toLife.update();\r\n\r\n\t\toLife.draw( ctx );\r\n\r\n\t\toLife.drawStats( ctx );\r\n\r\n\t\t//meter.tick();\r\n\r\n\t\trequestAnimationFrame( render );\r\n\r\n\t}", "title": "" }, { "docid": "a5f295e4cd762dc1bc8ea1cbe6e00ab0", "score": "0.66913563", "text": "render() {\r\n this.updateFontSize();\r\n this.drawDiv.innerHTML = this.text;\r\n }", "title": "" }, { "docid": "cad0ee10ff1dd9cbc9a520595a31b743", "score": "0.66874224", "text": "display() {\n push();\n translate(this.pos.x, this.pos.y);\n rotate(this.angle);\n fill(this.clr);\n noStroke();\n rect(0, 0, this.rad*2, this.rad*2);\n pop();\n }", "title": "" }, { "docid": "b182ae1fcc03cdd3cb4114c6aff259a2", "score": "0.66860265", "text": "display() {\n let pos = scaleToPixels(this.body.GetPosition());\n rectMode(CENTER);\n push();\n translate(pos.x, pos.y);\n fill(this.col);\n noStroke();\n strokeWeight(2);\n rect(0, 0, this.w, this.h);\n stroke(255)\n line(-this.w / 2.5, 0, this.w / 2.5, 0);\n pop();\n }", "title": "" }, { "docid": "745bdba11abfc2ad9e76bb6c5d47e41d", "score": "0.66850793", "text": "display() {\n this.scene.pushMatrix()\n this.applySceneTransformations();\n\n // Applies texture to scene\n if (this.material != null) {\n this.material.setTexture(this.texture);\n this.material.apply();\n if (this.textureFilterType != null) {\n this.scene.gl.texParameteri(this.scene.gl.TEXTURE_2D, this.scene.gl.TEXTURE_MAG_FILTER, this.textureFilterType);\n }\n }\n else console.log(\"NULL material!\");\n\n // aplica deslizamento de textura se ativado\n if (this.textureSlide) {\n // movimenta as coordenadas de textura\n for (var i = 0; i < this.texCoords.length; i += 2) {\n this.texCoords[i] -= this.scene.wind.x / 1000;\n this.texCoords[i + 1] -= this.scene.wind.y / 1000;\n }\n this.material.setTextureWrap('REPEAT', 'REPEAT');\n this.updateTexCoordsGLBuffers(); \n }\n \n super.display();\n this.scene.popMatrix(); \n }", "title": "" }, { "docid": "93b8d5b2099c8cf2f5a63885234579c1", "score": "0.66849184", "text": "display () {\n\n //make pos variable to control positions\n var pos =this.body.position;\n\n //control angle\n var angle=this.body.angle;\n\n //push lets you make properties only available to a portion of the code \n push ();\n\n //translate lets you change the position of the origin, in this case it makes it the x and y position to the center of any object you make so that the object will rotate on it's center\n translate (pos.x,pos.y);\n\n //this is required to make rotate work\n angleMode (RADIANS);\n\n //Rotate the body\n rotate (angle);\n\n //make rectMode center\n rectMode(CENTER);\n\n //color , give stroke and make rectangle visible\n fill(\"red\");\n strokeWeight(4);\n stroke(\"black\");\n rect(0, 0, this.width, this.height);\n \n //push & pop are a pair\n pop ();\n \n }", "title": "" }, { "docid": "39693d819d310a9150e172d3eacd10fd", "score": "0.6673443", "text": "render(){\r\n\t\tthis.renderer.setColor('white');\r\n\t\tthis.renderer.drawCircle(this.position, this.radius);\r\n\t}", "title": "" }, { "docid": "c2dbfe593aba3ff8221856e9463f250b", "score": "0.6658588", "text": "function render () {\n\t\tCamera.move(0, 0)\n\t\tGraphics.fillRect(100, 100, 300, 300, 1); // debug\n\t\tGraphics.fillRect(1700, 1000, 300, 300, 1);\n\t\tGraphics.fillRect(0, 0, 300, 300, 1);\n\n\t\tCanvas.context.fillRect(300, 400, 100, 10);\n\t\tCanvas.context.save();\n\t\tvar position = new Vector2(350, 399);\n\t\tvar w = 100;\n\t\tvar h = 100;\n\t\tvar scale = 1;\n\t\tvar rotation = 0.3;\n\t\tvar pivot = new Vector2(w / 2, h / 2);\n\t\tpivot = pivot.scale(scale);\n\t\tCanvas.context.rotate(rotation)\n\t\tCanvas.context.fillRect(position.x - pivot.x, position.y - pivot.y, w * scale, h * scale);\n\t\tCanvas.context.restore();\n\n\n\t\tCanvas.context.save();\n\t\tCanvas.context.fillStyle = \"#FF0000\";\n\t\tvar rot = 1\n\t\tCanvas.context.translate(350 * rot, -50)\n\t\tCanvas.context.rotate(rot);\n\t\tCanvas.context.fillRect(300, 300, 50, 50);\n\t\tCanvas.context.restore();\n\t}", "title": "" }, { "docid": "05e04675eb4a8ada51a46c503e52b618", "score": "0.6654387", "text": "function render () {\n emitter.emit('render')\n }", "title": "" }, { "docid": "e6996f0aa05913083d6f8d48860ec9d5", "score": "0.6650454", "text": "render() {\n this.stats.begin();\n\n /**\n * you can do whatever you want for your rendering process. here, we'll just call the renderer render() method and pass it\n * the elpased time since last frame deltaT and the elapsed time since the beginning. you can find a list of all the \n * accessible variables within creenv by going to the Learning table.\n */\n this.renderer.render(this.deltaT, this.elapsedTime);\n\n this.stats.end();\n }", "title": "" }, { "docid": "e96e231703adb44e63727cf97cc2d170", "score": "0.66422343", "text": "draw() {\n\t\t\tthis.drawBg();\n\t\t\tthis.drawGr();\n\t\t\tthis.drawObjs();\n\t\t}", "title": "" }, { "docid": "e8a538de992598f6de0fae2bf2f00529", "score": "0.66414815", "text": "function render() {\n\tcontainer_css();\n\tgrid.initialize();\n\tsnake.initialize();\n\tscore.initialize();\n\tgrid.set_food();\n\tgrid.draw();\n}", "title": "" }, { "docid": "cec874c0bf4e5e3b1af8444bf87f6673", "score": "0.66228724", "text": "render(){\n\t\t\t//need to call update to try to move the nodes\n\t\t\tthis.update()\n\t\t\tthis.rendererCSS.render(this.sceneCSS, this.camera)\n\t\t\tthis.rendererWebGL.render(this.sceneWebGL, this.camera)\n\t}", "title": "" }, { "docid": "7749c704a27e25b804d9740e179d7a5a", "score": "0.66144884", "text": "function render() {\n\tcontext.fillStyle = \"#2c3e50\";\n\tcontext.fillRect(0, 0, width, height);\n\t\n\tcontext.fillStyle = \"white\";\n\tcontext.fillRect(299, 0, 5, height);\n\n\tcontext.beginPath();\n\tcontext.arc(300, 200, 50, 2 * Math.PI, false);\n\tcontext.stroke();\n\tcontext.strokeStyle = \"white\";\n\tcontext.lineWidth = 5;\n\n\tplayer.render();\n\tcomputer.render();\n\tball.render();\n\tscoreBoard.render();\n}", "title": "" }, { "docid": "d6dd5449fb78ed1d660c0cf59afe6e3c", "score": "0.6613472", "text": "display() {\n\t\tthis.scene.pushMatrix();\n\t\tthis.scene.pushMaterial(this.spritesheetAppearance);\n\t\tthis.scene.pushTexture(this.texture);\n\n\t\tthis.spritesheetAppearance.setTexture(this.texture);\n\t\tthis.spritesheetAppearance.apply();\n\n\t\tthis.scene.setActiveShader(this.shader);\n\n\t\tthis.activateCellP(this.position);\n\t\tsuper.display();\n\n\t\tthis.scene.setActiveShader(this.scene.defaultShader);\n\n\t\tthis.scene.popTexture();\n\t\tthis.scene.popMaterial();\n\t\tthis.scene.popMatrix();\n\t}", "title": "" }, { "docid": "c12c4ad9ef76a96fbc0c22889aa40e9a", "score": "0.6613292", "text": "render() {\n if (!this.rendered) {\n this.root.appendChild(this.domElement);\n this.rendered = true;\n }\n }", "title": "" }, { "docid": "5c1a8877eb395fcf2f44b1a3718d9bef", "score": "0.66082615", "text": "function render() {\n\t\t\n\t // render vars\n\t\t //var rotSpeed = 0.001;\n\t\t var rotSpeed = control.rotationSpeed;\n\n\t\t// object motion\n\n\t // camera motion\n\t\t camera.position.x = camera.position.x * Math.cos(rotSpeed) + camera.position.z * Math.sin(rotSpeed);\n\t\t camera.position.z = camera.position.z * Math.cos(rotSpeed) - camera.position.x * Math.sin(rotSpeed);\n\t\t camera.lookAt(scene.position);\n\n\t // data update\n\t\t //c++;\n\t\t //if (c%2 == 0 ) {\n\t\t //updateWaves(); \n\t\t //} \n\t\t //updateWaves();\n\n\t \tstats.update();\n\n\t // render the scene\n\t renderer.render(scene, camera);\n\t requestAnimationFrame(render);\n\t}", "title": "" }, { "docid": "33d50715cae25c2199eb0beb85274826", "score": "0.660748", "text": "display() {\n\n push();\n\n translate(this.locX, this.locY);\n fill(this.carColor);\n noStroke();\n\n //main rectange\n rect(0, 0, this.sizeW, this.sizeH);\n\n //second rectangle\n rect(0 - this.sizeW * 0.5, 0 + this.sizeH - this.sizeH * 0.5, this.sizeW * 2, this.sizeH * 0.5);\n\n //upper light\n fill(this.rect3Color);\n rect((0 + this.sizeW * 0.5) - this.rect3Size * 0.5, 0 - this.rect3Size, this.rect3Size, this.rect3Size);\n\n //wheels\n fill(0);\n ellipse( 0 - this.sizeW * 0.25, this.sizeH, this.wheelSize);\n ellipse(this.sizeW * 1.25, this.sizeH, this.wheelSize);\n\n pop();\n }", "title": "" }, { "docid": "887cad32d3eb4213833863513bd143be", "score": "0.6602147", "text": "render() {\n this.clearCanvas();\n this.sortEntities();\n for (let entity of this.entities) {\n entity.render(this.context, this.scrollX, this.scrollY);\n }\n this.onFrameUpdate.dispatch();\n }", "title": "" }, { "docid": "f2391f32a125a9dc881fe9b10dea4b70", "score": "0.65936345", "text": "function render() {\n\trenderer.setViewport(0,0,window.innerWidth,window.innerHeight);\n\trenderer.setScissor(0,0,window.innerWidth,window.innerHeight);\n\trenderer.setScissorTest( true );\n\trenderer.setClearColor(0x000000);\n\trenderer.render(scene,camera[active_camera]);\n}", "title": "" }, { "docid": "9eccc2a74a99594926e2cdf9228756f8", "score": "0.6583393", "text": "draw(){\n\n //loop to go through array to draw objects on screen\n for(let i = 0; i < this.objects.length; ++i){\n this.objects[i].draw(this.ctx);\n }\n }", "title": "" }, { "docid": "cbe94302d2ff194f5d381aa0c317f0ed", "score": "0.6582865", "text": "render() {\n render(offscreenCanvas);\n }", "title": "" }, { "docid": "cbe94302d2ff194f5d381aa0c317f0ed", "score": "0.6582865", "text": "render() {\n render(offscreenCanvas);\n }", "title": "" }, { "docid": "5a6a8ad9368823f512609d6573630715", "score": "0.65712076", "text": "display(){\n let pos = this.body.position;\n push();\n Body.setAngularVelocity(this.body,0);\n translate(pos.x,pos.y);\n fill(100,100,255);\n ellipseMode(RADIUS);\n ellipse(0,0,this.radius,this.radius);\n pop();\n }", "title": "" }, { "docid": "a900b49066e87bc5abb12dfa8a8fdeec", "score": "0.65617347", "text": "render(){\n this.events()\n this.bindings()\n this.renderSubviews()\n this.setup()\n }", "title": "" }, { "docid": "63222edc8ddf78dea5df6867b36edf6c", "score": "0.6548912", "text": "function render() {\r\n //cenario se mexendo\r\n background();\r\n \r\n geraObstaculos();\r\n lista.forEach(desenhaObstaculo);\r\n lista.forEach(moverObstaculo);\r\n lista.forEach(colisao);\r\n \r\n recMegaman = new Rect(null, megaman.x, megaman.y, megaman.width - 40, megaman.height -10, 0);\r\n recDashing = new Rect(null, megaman.x, megaman.y + 50, megaman.width, megaman.height - 50, 0);\r\n// ctx.drawImage(r.img, 0, 0, r.img.width, r.img.height, r.x, r.y, r.width, r.height);\r\n// r.x += r.speedX;\r\n \r\n listaTiros.forEach(desenhaTiro);\r\n listaTiros.forEach(moverTiro);\r\n listaTiros.forEach(colisaoTiroObstaculo);\r\n \r\n desenharPersonagem();\r\n }", "title": "" }, { "docid": "e7b688154a80b7554428b84e656bc4f8", "score": "0.6541984", "text": "display() {\r\n\r\n //Created a variable pos where set the position of this.body : this.body.position; \r\n var pos = this.body.position;\r\n\r\n //Created a variable angle where set the angle of this.body : this.body.angle;\r\n var angle = this.body.angle;\r\n\r\n //Started implementation of some properties so used : push()\r\n push();\r\n\r\n //Translate the position X and position Y of this.body \r\n translate(pos.x, pos.y);\r\n\r\n //Rotating the angle \r\n rotate(angle);\r\n\r\n //Setting outline weight as 3 pixels\r\n strokeWeight(3);\r\n\r\n //Set outline color as 'white'\r\n stroke('white')\r\n\r\n //Set shape color of rect as 'pink'\r\n fill('pink')\r\n\r\n //Set rect mode as centre \r\n rectMode(CENTER)\r\n\r\n //Made rectangle with X and Y position and set this.width and this.height\r\n rect(0, 0, this.width, this.height);\r\n\r\n //Ended implementation of some properties so used : pop()\r\n pop();\r\n\r\n }", "title": "" }, { "docid": "5e55ed24416b8f6aac5bdc0ff4d21a3e", "score": "0.6535251", "text": "displayScene() {\n\t\tthis.root.display(this.scene.defaultMaterial, this.scene.defaultTexture, 1.0, 1.0);\n\t}", "title": "" }, { "docid": "a0b7471bde31082286aeabcdaf1597ba", "score": "0.6532223", "text": "function render() {\n // Before drawing, clear existing canvas\n ctx.clearRect(0,0,canvas.width,canvas.height)\n\n ctx.drawImage(background, 0, 0);\n ctx.drawImage(sea, 0, canvas.height - sea.height + 100);\n\n plane.render();\n boat.render();\n allParachuters.forEach(function(parachute) {\n parachute.render();\n });\n\n score.render();\n lives.render();\n }", "title": "" }, { "docid": "e67d6caaecaf0e613fa7559599f1b839", "score": "0.65314543", "text": "render() {\n this.ripples.forEach((r) => r.render(this.canvas, this.ctx));\n }", "title": "" }, { "docid": "1fc1b0955095251fdb82ba1b44e56b52", "score": "0.65313935", "text": "draw() {\n\t\tthis.gRenderer.render(this.gScene, this.gCamera);\n\t}", "title": "" }, { "docid": "c50f72905f166871c5f00020e5a88ac6", "score": "0.65270734", "text": "function render() {\n\n\n // rotation fuckin' everybody:\n object.rotation.x += 0.005;\n\tobject.rotation.y += 0.01;\n\n\t//renderer.render( scene, camera );\n\t\n\tcomposer.render();\n\t\n}", "title": "" }, { "docid": "5ea383e0537e85cb07623cb949b6faf0", "score": "0.6527041", "text": "function draw() {\r\n background(46,139,87);\r\n foodObj.display();\r\n\r\n\r\n}", "title": "" }, { "docid": "10532484958caabafb261c9b002aa564", "score": "0.65222967", "text": "render()\n {\n this.pair.render();\n \n //if transform panel is active(row clicked)\n this.panel.render(this.transformPanelActive);\n \n //render the knobs\n this.renderKnobs();\n }", "title": "" }, { "docid": "7a40d00966622a53d71e7203ad40ca33", "score": "0.65032876", "text": "start() {\n this.render();\n }", "title": "" }, { "docid": "5523d321fe920d4e847777e2e0ed8d59", "score": "0.65003365", "text": "render() {\n if(!this.gl) return;\n\n // clear scene first\n this.clear();\n\n // reset attributes buffer state\n this.state.currentGeometryID = null;\n\n // draw our scene content\n this.scene.draw();\n }", "title": "" }, { "docid": "bdfd6c70fbb01c6a92c21526d468a0e0", "score": "0.6497257", "text": "function render(){\t\t\n\trenderer.clear()\t\t\n\trenderer.render( scene, camera )\n}", "title": "" }, { "docid": "5624c642a164c05887d099adb9b3958f", "score": "0.64954716", "text": "function tgc_callRender() {\n\tGuiController.Instance.render.call(GuiController.Instance);\n}", "title": "" }, { "docid": "a012b562e01fafec50e16e32b8c5bf4c", "score": "0.6488442", "text": "draw () {\n let gameObjectEl = this.container.querySelector(`.${this.type + '-' + this.id}`);\n \n // Create new DOM element if it does not exist\n if (!gameObjectEl) {\n gameObjectEl = document.createElement('div');\n gameObjectEl.classList = `game-object ${this.type} ${this.type + '-' + this.id}`;\n this.container.appendChild(gameObjectEl);\n }\n\n // Update coords\n gameObjectEl.style.left = this.x * 16 + 'px';\n gameObjectEl.style.top = this.y * 16 + 'px';\n gameObjectEl.style.width = this.size * 16 + 'px';\n gameObjectEl.style.height = this.size * 16 + 'px';\n }", "title": "" }, { "docid": "bda44e78683e06d57bc4fa1dbd99a787", "score": "0.6482237", "text": "display(){\n this.body.position.x = mouseX;\n this.body.position.y = mouseY;\n super.display();\n }", "title": "" }, { "docid": "63949a6ed5cfbcdf7c4ec61761e83b76", "score": "0.64822334", "text": "render() {\n\t}", "title": "" }, { "docid": "e2ff1d53a6c3b03137507464019453f4", "score": "0.64811116", "text": "function renderObjects() {\n renderingContext.clearRect(0, 0, window.innerWidth, window.innerHeight);\n objects.forEach(function(v) {\n renderingContext.fillStyle = getColorForX(v.position.x);\n renderingContext.beginPath();\n renderingContext.arc(v.position.x, v.position.y, v.radius, 0, 2 * Math.PI);\n renderingContext.fill();\n });\n colorTableOffset++;\n }", "title": "" }, { "docid": "ad654353c6406554a09baa3b0cad2c7e", "score": "0.6470209", "text": "function render(){\n\t/* Clear Drawing Area */\n\tctx.clearRect(0,0,ARENA_WIDTH,ARENA_HEIGHT);\n\n /* Draw All Entities In Game*/\n\tammo.forEach(function(ammo){\n\t\tammo.render(ctx);\n });\n\tbullets.forEach(function (bullet) {\n\t\tbullet.render(ctx);\n\t});\n\ttanks.forEach(function(tank){\n\t\ttank.render(ctx);\n });\n\n /* Draw HUD Info */\n ctx.font = '24px impact';\n ctx.textBaseline = \"top\";\n ctx.textAlign = \"right\";\n ctx.fillText(\"Generation: \"+generation,ARENA_WIDTH-4, 0);\n if (performance.now() - 1000 > lastTime) {\n fps = fpsCount;\n fpsCount = 0;\n lastTime = performance.now();\n }\n fpsCount++;\n ctx.fillText(\"FPS: \" + fps, ARENA_WIDTH - 4, 28);\n\n ctx.font = '16px impact';\n ctx.textBaseline = \"bottom\";\n ctx.textAlign = \"center\";\n}", "title": "" }, { "docid": "1781376385cb84548b5008db7c7ca2bf", "score": "0.6468614", "text": "function render() {\r\n\r\n // reinitialization when show the hidden panorama (for Adobe Muse gallery)\r\n if (scope.canvas.clientWidth != scope.dom_element.clientWidth) {\r\n scope.init(scope.p);\r\n }\r\n\r\n scope.renderer.render(scope.scene, scope.camera);\r\n\r\n if (is_update_links && scope.current_panorama !== undefined) {\r\n scope.current_panorama.update_html_links();\r\n }\r\n }", "title": "" }, { "docid": "0481c9c81afa834b1587201cabd40788", "score": "0.64658177", "text": "function render( ) \n{ \n _voxSculpt.render();\n}", "title": "" }, { "docid": "4e3f43ddfc3c95b19d07a677e0c531c9", "score": "0.6463824", "text": "render() {\n let index = Math.max(this.objects.length - inUse, 0);\n\n for (let i = this.size - 1; i >= index; i--) {\n this.objects[i].render();\n }\n }", "title": "" }, { "docid": "4e3f43ddfc3c95b19d07a677e0c531c9", "score": "0.6463824", "text": "render() {\n let index = Math.max(this.objects.length - inUse, 0);\n\n for (let i = this.size - 1; i >= index; i--) {\n this.objects[i].render();\n }\n }", "title": "" }, { "docid": "0ce8474e7099560937702082d446a5c5", "score": "0.6458813", "text": "render() {\n\n }", "title": "" }, { "docid": "0ce8474e7099560937702082d446a5c5", "score": "0.6458813", "text": "render() {\n\n }", "title": "" }, { "docid": "e550aae8d65265017a96b27fb7ea1a2b", "score": "0.6455665", "text": "render() {\n // Default components just need to scope a piece of DOM from constructor\n this.setElement();\n setTimeout(::this.onRender, 0); \n }", "title": "" }, { "docid": "f0c47a5dd990e5d74387403959f96014", "score": "0.6455602", "text": "render() {\n ctx.drawImage(Resources.get(this.character), this.x, this.y);\n }", "title": "" }, { "docid": "43db59050e919d68349866f838a73e7a", "score": "0.64542633", "text": "render() {\n /**\n * Clear the stage\n */\n this.Stage.clearStage();\n switch (this.options.type) {\n case 'line':\n this.renderLine();\n break;\n case 'bar':\n this.renderBar();\n break;\n case 'stacked':\n this.renderStacked();\n break;\n }\n }", "title": "" }, { "docid": "9ff322c510b2c8acfe14477cf87557dc", "score": "0.6449766", "text": "show()\r\n {\r\n fill(255);\r\n if(this.highlight)\r\n {\r\n fill(255, 0, 0);\r\n }\r\n //rect is a p5 lib function that draws a rectangle to the screen. (x-coord, y-coord, width, height) -- See game folder for image reference\r\n rect(this.x, 0, this.W, this.top); \r\n rect(this.x, height-this.bottom, this.W, this.bottom); \r\n }", "title": "" }, { "docid": "5e73c6abb77828f8124b375e766dfbdf", "score": "0.644666", "text": "display() {\n noStroke();\n this.isAlive? fill(0):fill(175);\n rect(this.x,this.y,px_size,px_size);\n }", "title": "" }, { "docid": "ddd6c2ce3b5861adf627929b5aaa6ba4", "score": "0.6441701", "text": "drawEntity(){\n\t\t\tthis._$body.css(\"height\", this._heightPx);\n\t\t\tthis._$body.css(\"width\", this._widthPx);\n\t\t\tthis._$body.css(\"left\", this._position[0]);\n\t\t\tthis._$body.css(\"top\", this._position[1]);\n\t\t}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.64371455", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.64371455", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "8e0803bf5fb4e8040c1f1d7afb0c5269", "score": "0.6432624", "text": "display() {\n fill(this.color);\n circle(this.x, this.y, this.size);\n\n //eyes and mouth\n fill(\"black\");\n circle(this.x - 11, this.y, 5);\n circle(this.x + 11, this.y, 5);\n ellipse(this.x, this.y + 2, 15, this.mouthH);\n }", "title": "" }, { "docid": "6bfb94b9b53d3ae0d30eea774d5c1dd9", "score": "0.64298064", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.player), this.x, this.y);\n\t}", "title": "" }, { "docid": "6bfb94b9b53d3ae0d30eea774d5c1dd9", "score": "0.64298064", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.player), this.x, this.y);\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.64261514", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.64261514", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "88ad4ab5191e1ba237878670960738b7", "score": "0.64261514", "text": "render() {\n\t\tctx.drawImage(Resources.get(this.sprite), this.x, this.y);\n\t}", "title": "" }, { "docid": "2477a8dd0d889ee21b3159fdf273dc44", "score": "0.64256835", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "3eb13388a5a496c9ff4291c41c260a41", "score": "0.64243346", "text": "function render(){\n\t\tresize(gl.canvas);\n\t\t\n\t\tfpsViewer.begin();\n\n\t\t// Work out what quadrant we're in, so we know what to render\n\t\tcamera.assignCameraQuadrant();\n\t\t\n\t\t// Render the scene to each the reflection and refraction textures\n\t\t// (2x FULL scene render calls)\n\t\twaterSystem.renderToReflectionBuffer();\n\t\twaterSystem.renderToRefractionBuffer();\n\t\t\n\t\t// Now render the scene as usual\n\t\t// We've already switched back to the default frame buffer\n\t\tgl.clearColor(0.8, 0.8, 0.8, 0.7);\n\t\tgl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\t// Cant disable clipPlane on some drivers, just set to 0, for water\n\t\tclipPlane = [0, 0, 0, 0];\n\t\t\n\t\tcamera.updateCamera();\n\t\t\n\t\t/*\n\t\tDon't change render order\n\t\tTerrain render generates the renderIndices, \n\t\tthat are needed for rock rendering\n\t\t*/\n\t\tterrain.render(); \n\t\trockGenerator.renderInstancedRocks();\n\t\t//particleSystem.render(); // not used\n\t\tcollisionTester.testAllCollision();\n\t\twaterSystem.render();\n\t\tterrain.renderMapBoundaries();\n\t\tskybox.render();\n\t\tminimap.render();\n\t\t\n\t\tfpsViewer.end();\n\t\tanimationFrameID = requestAnimationFrame(render);\n\t}", "title": "" }, { "docid": "1174d2009c2cf8ec266e5a10b7a80bca", "score": "0.6417732", "text": "function render() {\n renderer.render(scene, camera);\n}", "title": "" } ]
8761dad9e72f579bae2d233ded36b835
Gets the slider thumb HTML input element of the given thumb position.
[ { "docid": "e32b960ad122157c67cf4d8b2ae44708", "score": "0.7115303", "text": "_getInputElement(thumbPosition) {\n var _a;\n return (_a = this._getInput(thumbPosition)) === null || _a === void 0 ? void 0 : _a._hostElement;\n }", "title": "" } ]
[ { "docid": "9bc517a17212a446e76306e9a8bf3321", "score": "0.6946835", "text": "_getKnobElement(thumbPosition) {\n var _a;\n return (_a = this._getThumb(thumbPosition)) === null || _a === void 0 ? void 0 : _a._getKnob();\n }", "title": "" }, { "docid": "9dd2f8427b88eb614ba89003de57b799", "score": "0.6817327", "text": "_getInput(thumbPosition) {\n var _a, _b;\n return thumbPosition === Thumb.END ? (_a = this._inputs) === null || _a === void 0 ? void 0 : _a.last : (_b = this._inputs) === null || _b === void 0 ? void 0 : _b.first;\n }", "title": "" }, { "docid": "9a58ac230b31514b18d2ac6047368427", "score": "0.6799141", "text": "_getThumbElement(thumbPosition) {\n var _a;\n return (_a = this._getThumb(thumbPosition)) === null || _a === void 0 ? void 0 : _a._getHostElement();\n }", "title": "" }, { "docid": "74602e8527a6fb9492c0c8f965c856f6", "score": "0.62395936", "text": "getSliderElement(){\n return document.getElementById(this.getSliderRangeId());\n }", "title": "" }, { "docid": "44e26512c263bac8d3592b554e795942", "score": "0.61941993", "text": "_getInputThumbPosition(target) {\n if (target === this._delegate._getInputElement(Thumb.END)) {\n return Thumb.END;\n }\n if (this._delegate._isRange() && target === this._delegate._getInputElement(Thumb.START)) {\n return Thumb.START;\n }\n return null;\n }", "title": "" }, { "docid": "fa9c65ca4208fc41e03129a3a242bc3b", "score": "0.5909028", "text": "_getValueIndicatorContainerElement(thumbPosition) {\n return this._getThumb(thumbPosition)._getValueIndicatorContainer();\n }", "title": "" }, { "docid": "2154b40350488710f37372331e621110", "score": "0.56908363", "text": "getEventTarget(sliderItem) {\n return sliderItem.querySelector('img.boxart-image')\n }", "title": "" }, { "docid": "5cbbd9013febf2cb8fae60e84e1f977a", "score": "0.5688621", "text": "function adjustThumbPosition(x){var exactVal=percentToValue(positionToPercent(x));var closestVal=minMaxValidator(stepValidator(exactVal));setSliderPercent(positionToPercent(x));thumbText.text(closestVal);}", "title": "" }, { "docid": "57539b2f4a49cd5bc0cc586e45c3c166", "score": "0.55190897", "text": "moveSliderTo(value, thumbElement, thumbType) {\r\n const valueMax = parseInt(thumbElement.getAttribute('aria-valuemax'), 10);\r\n const valueMin = parseInt(thumbElement.getAttribute('aria-valuemin'), 10);\r\n if (value > valueMax) {\r\n value = valueMax;\r\n }\r\n if (value < valueMin) {\r\n value = valueMin;\r\n }\r\n this.valueNow = value;\r\n thumbElement.setAttribute('aria-valuenow', this.valueNow);\r\n thumbElement.setAttribute('aria-valuetext', this.valueNow);\r\n if (this.type === NUMERIC_RANGE_SLIDER_TYPE) {\r\n const pos = Math.round(((value - this.minRangeValue) *\r\n (this.rangeSliderTrackWidth - 2 * (this.thumbWidth - this.trackBorderWidth))) /\r\n (this.maxRangeValue - this.minRangeValue));\r\n if (thumbType === 'min') {\r\n this.maxThumbNode.setAttribute('aria-valuemin', this.valueNow.toString());\r\n thumbElement.style.left = `${(pos - this.trackBorderWidth)}px`;\r\n this.minValueNode.innerHTML = this.valueNow.toString();\r\n }\r\n else {\r\n this.minThumbNode.setAttribute('aria-valuemax', this.valueNow.toString());\r\n thumbElement.style.left = `${(pos + this.thumbWidth - this.trackBorderWidth)}px`;\r\n this.maxValueNode.innerHTML = this.valueNow.toString();\r\n }\r\n this.fillMultipleThumbInnerBar();\r\n }\r\n else {\r\n const pos = Math.round((this.valueNow * this.rangeSliderTrackWidth) / (this.maxRangeValue - this.minRangeValue)) - (this.thumbWidth / 2);\r\n thumbElement.style.left = `${pos}px`;\r\n if (this.minValueNode) {\r\n this.minValueNode.innerHTML = this.valueNow.toString();\r\n }\r\n this.fillLowerTrackInnerBar();\r\n }\r\n }", "title": "" }, { "docid": "4212e684a9d1c9ceb43ce5cda4f7f80f", "score": "0.5402789", "text": "function CalculateThumbValue(thumb, mouseValue, styleName) {\n var mouseOverMin = mouseValue < thumbMin;\n var mouseOverMax = mouseValue > thumbMax;\n\n // On the X-axis, left is -100% and right is 100%\n // On the Y-axis, top should be 100% and bottom -100%\n // however, because CSS has to use left/top for positioning things like this,\n // top is -100% and bottom is 100%. This is good for style.top, but when\n // styleName == top, invert the value\n\n if (!mouseOverMin && !mouseOverMax) {\n thumb.style[styleName] = mouseValue + \"px\";\n var joystickValue = parseInt((mouseValue - thumbMiddle) / thumbMiddle * 100).toString();\n return joystickValue * ((styleName == \"top\") ? -1 : 1);\n }\n // Don't move the joystick if mouse is outside of the box, just apply min/max value\n else if (mouseOverMin) {\n thumb.style[styleName] = thumbMin + \"px\";\n return (styleName == \"top\") ? \"100\" : \"-100\"; // %\n // TODO vibrate\n } else if (mouseOverMax) {\n thumb.style[styleName] = thumbMax + \"px\";\n return (styleName == \"top\") ? \"-100\" : \"100\"; // %\n // TODO vibrate\n }\n}", "title": "" }, { "docid": "316c1c20387922eb66b3f16b098089e6", "score": "0.5366027", "text": "function intinput_handler(e) {\n var target_element = e.target.getAttribute(\"aria-controls\");\n var theslider = document.getElementById(target_element);\n theslider.value = e.target.value\n}", "title": "" }, { "docid": "d886246f3df4045712023509a0d98a19", "score": "0.5264049", "text": "function adjustThumbPosition( x ) {\r\n var exactVal = percentToValue( positionToPercent( x ));\r\n var closestVal = minMaxValidator( stepValidator(exactVal) );\r\n setSliderPercent( positionToPercent(x) );\r\n thumbText.text( closestVal );\r\n }", "title": "" }, { "docid": "94c651ff2ee503641ef1fac1073d6876", "score": "0.52511334", "text": "function adjustThumbPosition(x) {\n var exactVal = percentToValue(positionToPercent(x));\n var closestVal = minMaxValidator(stepValidator(exactVal));\n setSliderPercent(positionToPercent(x));\n thumbText.text(closestVal);\n }", "title": "" }, { "docid": "59e11709ad7c0d1344a12036a8492407", "score": "0.52454704", "text": "function getRangeInput(objInput){\r\n\t\t\r\n\t\tvar objRangeWrapper = objInput.parents(\".unite-setting-range-wrapper\");\r\n\t\tif(objRangeWrapper.length == 0)\r\n\t\t\tthrow new Error(\"range input not found\");\r\n\t\t\r\n\t\tvar inputText = objRangeWrapper.find(\"input.unite-setting-range\");\r\n\t\treturn(inputText);\r\n\t}", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.5238657", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.5238657", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.5238657", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.5238657", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.5238657", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.5238657", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "920899bc6b34a47fefaca5c8ab750ecd", "score": "0.5238657", "text": "function adjustThumbPosition( x ) {\n var exactVal = percentToValue( positionToPercent( x ));\n var closestVal = minMaxValidator( stepValidator(exactVal) );\n setSliderPercent( positionToPercent(x) );\n thumbText.text( closestVal );\n }", "title": "" }, { "docid": "2f56ba4d6fc3548283c2257793d863b6", "score": "0.52130234", "text": "function slider_handler(e) {\n var target_element = e.target.getAttribute(\"aria-controls\");\n var thespan = document.getElementById(target_element);\n thespan.value = e.target.value;\n}", "title": "" }, { "docid": "1d93f30c0743033623a4230d5f5f2ac2", "score": "0.5203317", "text": "function getThumb(i) {\n var thumb = document.getElementsByClassName('thumb')[i].src;\n counter = i;\n setImage(thumb);\n}", "title": "" }, { "docid": "308b9d22b3e6249c3dc1a1e2e69c1851", "score": "0.5172022", "text": "get jockeyThumbImage() {return browser.element(\"//android.view.ViewGroup[2]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.ImageView\");}", "title": "" }, { "docid": "b1e4d3ce2f5ffc10a72991b802773ed3", "score": "0.5154126", "text": "function getThumbPos(objThumb){\n\t\t\n\t\tvar objReturn = {};\n\t\t\n\t\tvar objPos = objThumb.position();\n\t\t\n\t\tif(g_isVertical == false){\n\t\t\tobjReturn.min = objPos.left;\n\t\t\tobjReturn.max = objPos.left + g_sizes.thumbSize;\n\t\t}else{\n\t\t\tobjReturn.min = objPos.top;\n\t\t\tobjReturn.max = objPos.top + g_sizes.thumbSize;\n\t\t}\n\n\t\t\n\t\treturn(objReturn);\n\t}", "title": "" }, { "docid": "00d49cfeeb80b69e6c6d06a122940339", "score": "0.51393294", "text": "static getSlider(row, position) {\n let rowNode = document.querySelector(`#row-${row}`)\n if (rowNode) {\n return new Slider(rowNode, position)\n }\n return null\n }", "title": "" }, { "docid": "af558f93468a57ca349703d9f1bed221", "score": "0.5135447", "text": "initSingleThumbSlider() {\r\n this.minThumbNode = this.base.shadowRootQuerySelector(this.element, '[range-thumb=min]');\r\n this.rangeSliderTrack = this.base.shadowRootQuerySelector(this.element, '.single-range-slider');\r\n this.minValueNode = this.base.shadowRootQuerySelector(this.element, '.single-thumb-value');\r\n this.minRangeValue = parseInt((this.minThumbNode.getAttribute('aria-valuemin')), 10);\r\n this.maxRangeValue = parseInt((this.minThumbNode.getAttribute('aria-valuemax')), 10);\r\n if (this.rangeSliderTrack) {\r\n this.rangeSliderTrackWidth = parseInt(window.getComputedStyle(this.rangeSliderTrack).getPropertyValue('width').slice(0, -2), 10);\r\n }\r\n this.commonInit();\r\n this.valueNow = parseInt((this.minThumbNode.getAttribute('aria-valuenow')), 10);\r\n this.moveSliderTo(this.valueNow, this.minThumbNode, 'min');\r\n }", "title": "" }, { "docid": "170cbf8ba85dc75c84269dbfb1728709", "score": "0.51052564", "text": "_getValueIndicatorText(thumbPosition) {\n return thumbPosition === Thumb.START\n ? this._startValueIndicatorText\n : this._endValueIndicatorText;\n }", "title": "" }, { "docid": "815d1ccef790d818bee8f8dd5afb7533", "score": "0.5071797", "text": "function initSlider() {\n let slider = document.querySelector(\".barslider\");\n let gridValue = document.querySelector(\".grid-size-value\")\n \n /* debugging sldier and slider value\n console.log(slider)\n console.log(slider.getAttribute(\"value\"));\n */\n gridValue.textContent = slider.getAttribute(\"value\"); // Display default slider value\n \n // swapping input vs change\n // input will change the textcontent as you slide\n // change will change the textcontent after you let go of the slider.\n slider.addEventListener('input', function () {\n gridValue.textContent = slider.value;\n }, false);\n \n}", "title": "" }, { "docid": "03194e712d7fd8c896e51a37e6b67ce7", "score": "0.5059982", "text": "calculateX(value) {\n // Calculate the position of the slider\n let x = (((this.Input.current.offsetWidth) / (this.state.max-this.state.min)) * this.state.value)\n // Account for the extra change due to the sliders width (Comment this out and move slider slowly to see what I mean)\n x = x - ((25 / (this.state.max-this.state.min)) * this.state.value)\n // Get the the middle of the slider\n x = x + (12.5 - this.Span.current.offsetWidth / 2)\n // Add arbitrary number to fix, should figure out better solution\n return x + 2\n }", "title": "" }, { "docid": "a0e073ca92b7d8e22225184ca88b68d2", "score": "0.50402135", "text": "function getSelectedElement() {\n\t\treturn $(\"#img-\" + selectedIndex);\n\t}", "title": "" }, { "docid": "4d2447c4f1fbb90718619b2d95215d43", "score": "0.50372714", "text": "_getOnSliding() {\n let prevX = this.x; // memorize the previous x\n\n // on sliding of the thumb\n // `value` - the `left` of the thumb, relative to the container\n return ({value}) => {\n // convert to value relative to the track\n const x = value + this._containerRadii - this.props.trackMarginH;\n\n if (prevX <= 0 && x > 0) {\n // leaving the lowest value, scale up the thumb\n this._onExplode();\n } else if (prevX > 0 && x <= 0) {\n // at lowest value, scale down the thumb\n this._onCollapse();\n }\n\n prevX = x;\n };\n }", "title": "" }, { "docid": "e6a7db3389743709a0009bf05a91660b", "score": "0.5022457", "text": "function imageFromThumb(thumbnail) {\n 'use strict';\n return thumbnail.getAttribute('data-image-url');\n}", "title": "" }, { "docid": "54c9378090ab7c5f194d13b353085a91", "score": "0.5019694", "text": "static createInputSliderWithLabel (div_class, text, input_id, type, name, spacing, slideHandler) {\r\n\r\n // Create encompassing div\r\n var top_div = document.createElement(\"div\");\r\n\r\n // Assign div class\r\n top_div.className = div_class;\r\n\r\n // Creates label\r\n top_div.appendChild(document.createTextNode(text));\r\n\r\n // If spacing is true\r\n if (spacing) {\r\n // Creates line break for form div spacing\r\n top_div.appendChild(document.createElement(\"br\"));\r\n\r\n }\r\n\r\n // Creates input box\r\n var input_box = document.createElement(\"input\");\r\n\r\n // Assigns input id\r\n input_box.id = input_id;\r\n\r\n // Sets type attribute\r\n input_box.setAttribute(\"type\", type);\r\n\r\n // Sets name attribute\r\n input_box.setAttribute(\"name\", name);\r\n\r\n //\r\n input_box.setAttribute(\"min\", \"0\");\r\n\r\n //\r\n input_box.setAttribute(\"max\", \"1\");\r\n\r\n //\r\n input_box.setAttribute(\"step\", \"0.1\");\r\n\r\n //\r\n input_box.setAttribute(\"value\", \"0.5\");\r\n\r\n //\r\n input_box.setAttribute(oninput, \"SetVolume(this.value)\");\r\n\r\n //\r\n input_box.setAttribute(onchange, \"SetVolume(this.value)\");\r\n\r\n //\r\n input_box.addEventListener('change', slideHandler);\r\n\r\n //\r\n input_box.addEventListener('input', slideHandler);\r\n\r\n // Appends to the main div\r\n top_div.appendChild(input_box);\r\n\r\n return top_div;\r\n\r\n }", "title": "" }, { "docid": "0ac7e96bae41a0789d44deb32c7b3923", "score": "0.50140685", "text": "getSlider (state, slider) {\n state.slider = slider;\n }", "title": "" }, { "docid": "4466d91b4e7f5f24b162c1a0d3165b05", "score": "0.4977719", "text": "function imageFromThumb(thumbnail) {\n 'use strict';\n return thumbnail.getAttribute('data-image-url');\n }", "title": "" }, { "docid": "898d5a1e2f427ec844595afb14927a68", "score": "0.49484757", "text": "function getSliderOption() {\n return sliderOptions[slider.slider('getValue')];\n}", "title": "" }, { "docid": "8122ea4e6f63f1025c01b1ac8d97f0d8", "score": "0.4938607", "text": "handleFocus(event) {\r\n const thumbType = event.target.getAttribute('range-thumb');\r\n if (thumbType === 'min') {\r\n this.minThumbNode.classList.add('focus');\r\n }\r\n else {\r\n this.maxThumbNode.classList.add('focus');\r\n }\r\n this.rangeSliderTrack.classList.add('focus');\r\n }", "title": "" }, { "docid": "110469a4772f44f326600468bdcda948", "score": "0.49377042", "text": "function keyFromThumb(thumb) {\n return thumb.getAttribute('data-id')\n}", "title": "" }, { "docid": "3dc9611a2e956d212aa26438977e52d3", "score": "0.49322808", "text": "function changeSlider() {\n slider = document.getElementById(\"massSlider\").value;\n}", "title": "" }, { "docid": "6adde21ea938a8d3a3fffc52834dd9cd", "score": "0.4923919", "text": "function getInput() {\n return element.find('input').eq(0);\n }", "title": "" }, { "docid": "6dd2170af3c95a7f84a15c5e6cdb573a", "score": "0.4922606", "text": "function imageFromThumb(thumbnail) {\n 'use strict';\n\n return thumbnail.getAttribute(\"data-image-url\");\n}", "title": "" }, { "docid": "ec311f4fc6d81f56ecb1c02780fe8ad5", "score": "0.4920684", "text": "handleMouseDown(event) {\r\n const self = this;\r\n const thumbType = event.target.getAttribute('range-thumb');\r\n const handleMouseMove = mouseMoveEvent => {\r\n const diffX = mouseMoveEvent.pageX - self.rangeSliderTrack.offsetLeft;\r\n self.valueNow = parseInt(self.minRangeValue + (((self.maxRangeValue - self.minRangeValue) * diffX) / self.rangeSliderTrackWidth), 10);\r\n if (thumbType === 'min') {\r\n self.moveSliderTo(self.valueNow, self.minThumbNode, 'min');\r\n }\r\n else {\r\n self.moveSliderTo(self.valueNow, self.maxThumbNode, 'max');\r\n }\r\n mouseMoveEvent.preventDefault();\r\n mouseMoveEvent.stopPropagation();\r\n };\r\n const handleMouseUp = () => {\r\n if (this.type === NUMERIC_RANGE_SLIDER_TYPE) {\r\n this.maxThumbNode.classList.remove('focus');\r\n const minCurrentValue = parseInt(this.minThumbNode.getAttribute('aria-valuenow'), 10);\r\n const maxCurrentValue = parseInt(this.maxThumbNode.getAttribute('aria-valuenow'), 10);\r\n // emit selected range value\r\n this.changeValue.emit({\r\n minValue: this.minRangeValue,\r\n maxValue: this.maxRangeValue,\r\n range: [minCurrentValue, maxCurrentValue]\r\n });\r\n }\r\n else {\r\n const currentValue = parseInt(this.minThumbNode.getAttribute('aria-valuenow'), 10);\r\n // emit selected range value\r\n this.changeValue.emit({\r\n minValue: this.minRangeValue,\r\n maxValue: this.maxRangeValue,\r\n currentValue\r\n });\r\n }\r\n this.minThumbNode.classList.remove('focus');\r\n this.rangeSliderTrack.classList.remove('focus');\r\n document.removeEventListener('mousemove', handleMouseMove);\r\n document.removeEventListener('mouseup', handleMouseUp);\r\n };\r\n document.addEventListener('mousemove', handleMouseMove);\r\n document.addEventListener('mouseup', handleMouseUp);\r\n event.preventDefault();\r\n event.stopPropagation();\r\n // Set focus to the clicked handle\r\n if (thumbType === 'min') {\r\n self.minThumbNode.focus();\r\n self.minThumbNode.classList.add('focus');\r\n }\r\n else {\r\n self.maxThumbNode.focus();\r\n self.maxThumbNode.classList.add('focus');\r\n }\r\n }", "title": "" }, { "docid": "cb53a5306e6c5ba9cb948a9e117e6c71", "score": "0.49153072", "text": "getInputValue() {\n return this.img.src;\n }", "title": "" }, { "docid": "c4db1065738ca4dd37a0dc828dcc12eb", "score": "0.49145898", "text": "function getInputFor(categoryId) {\n var inputs,\n targetDiv = Ext.getDom('weightInput' + categoryId);\n\n if (targetDiv) {\n inputs = targetDiv.getElementsByTagName('input');\n } else {\n inputs = null;\n }\n\n if (inputs != null) {\n return inputs.item(0);\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "c463394f2a9152f4c7582daff9939005", "score": "0.49133706", "text": "function scale(inputTemp) { \n\treturn document.querySelector('input[name=\"radio\"]:checked').value;\n}", "title": "" }, { "docid": "59b93175ddd48063d750cce9cb8b2149", "score": "0.48493952", "text": "function create_slide_bar_figure(arm_number){\n var my_div_field=create_div_col_element()\n var my_label=document.createElement(\"label\")\n my_label.setAttribute(\"for\",\"range\")\n var my_slide_bar_figure=document.createElement(\"input\")\n my_slide_bar_figure.setAttribute(\"type\",\"range\")\n my_slide_bar_figure.setAttribute(\"name\",\"range\")\n var id_slide_bar_figure=\"id_slide_bar_figure#\"+arm_number\n my_slide_bar_figure.setAttribute(\"id\",id_slide_bar_figure)\n my_slide_bar_figure.setAttribute(\"min\",\"0\")\n my_slide_bar_figure.setAttribute(\"max\",\"1\")\n my_slide_bar_figure.setAttribute(\"step\",\"0.05\")\n var random_input=Math.random()\n my_slide_bar_figure.setAttribute(\"value\",random_input)\n figure=my_slide_bar_figure\n $(my_label).append(my_slide_bar_figure)\n $(my_div_field).append(my_label)\n return my_div_field\n}", "title": "" }, { "docid": "2e7220eca5f7fe5eeb6803675db1a9fd", "score": "0.48463595", "text": "getSpotLight(slide) {\n return slide.children[2]\n }", "title": "" }, { "docid": "4a34733327081097d6e013fbb190fc4a", "score": "0.47815973", "text": "getInput() {\n const selector = 'input[type=\"range\"]';\n const input = this.querySelector(selector);\n if (!input) {\n throw new Error(`VolumeComponent: Must contain a child that matches ${selector} on initialization.`);\n }\n this.input = input;\n }", "title": "" }, { "docid": "848d345b067d9f3e0f5b5ef4fa3e3849", "score": "0.47730166", "text": "function imgurlFromThumb (thumbnail)\n{\n 'use strict';\n return thumbnail.getAttribute('data-image-url');\n}", "title": "" }, { "docid": "f905c7dc6a3878f388b812d90e82ffc5", "score": "0.47672042", "text": "view(){\n document.getElementById(\"sliderInfo\").value = document.getElementById(\"mySlider\").value;\n }", "title": "" }, { "docid": "f0beb31d290ef1eaf0b9ab5208707a7c", "score": "0.47469178", "text": "function createSliderInfo(slider) {\n const ampImgs = slider.getElementsByTagName('amp-img');\n const labelWrappers = slider.querySelectorAll(\n '.i-amphtml-image-slider-label-wrapper'\n );\n const rect = slider.getBoundingClientRect();\n const hints = slider.querySelectorAll('.i-amphtml-image-slider-hint');\n return {\n slider,\n bar: slider.querySelector('.i-amphtml-image-slider-bar'),\n container: slider.querySelector(\n '.i-amphtml-image-slider-container'\n ),\n leftMask: slider.querySelector('.i-amphtml-image-slider-left-mask'),\n rightMask: slider.querySelector(\n '.i-amphtml-image-slider-right-mask'\n ),\n leftAmpImg: ampImgs[0],\n rightAmpImg: ampImgs[1],\n leftLabel: labelWrappers[0].firstChild,\n rightLabel: labelWrappers[1].firstChild,\n leftHint: hints[0],\n rightHint: hints[1],\n leftHintArrow: slider.querySelector('.amp-image-slider-hint-left'),\n rightHintArrow: slider.querySelector(\n '.amp-image-slider-hint-right'\n ),\n rect,\n pos: createPositionGroup(slider), // collection of useful slider bar pos\n };\n }", "title": "" }, { "docid": "79d04c30b172edee5985ba6eb0c09aac", "score": "0.4738488", "text": "function wt_slider(id, name, val, min, max)\r\n// Constructor for a slider widget. Inserts necessary HTML into the\r\n// document.\r\n{\r\n\twt_register(id, this);\r\n\t\r\n\tthis.name = name;\r\n\tthis.initial_value = val;\r\n\tthis.min = min;\r\n\tthis.max = max;\r\n\tthis.is_tracking = false;\r\n\tthis.width = 353;\r\n\r\n\tthis.mousedown = function(event)\r\n\t{\r\n\t\twt_tracking_widget = this;\r\n\t\tthis.is_tracking = true;\r\n\t\tthis.initial_value = this.slidervalue.innerHTML;\r\n\t\t\r\n\t\tthis.update_slider(event);\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tthis.mouseup = function(event)\r\n\t{\r\n\t\tif (this.is_tracking)\r\n\t\t{\r\n\t\t\tthis.is_tracking = false;\r\n\t\t\twt_tracking_widget = undefined;\r\n\t\t\tdocument.forms[0].submit();\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tthis.mousemove = function(event)\r\n\t{\r\n\t\tif (this.is_tracking)\r\n\t\t{\r\n\t\t\tthis.update_slider(event);\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tthis.mouseout = function(event)\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\r\n\tthis.update_slider = function(event)\r\n\t{\r\n\t\tvar x = page_offset_x(event) - this.sliderbody_x - 20;\r\n\r\n\t\tvar value = (x / this.width) * (this.max - this.min) + this.min;\r\n\t\tvalue = fclamp(value.toPrecision(3), this.min, this.max);\r\n\t\t\r\n\t\tthis.set_slider_pos(value);\r\n\t\tthis.slidervalue.innerHTML = value;\r\n\t\tthis.hiddenvalue.value = value;\r\n\t}\r\n\r\n\tthis.set_slider_pos = function(value)\r\n\t{\r\n\t\tvar x = this.width * (value - this.min) / (this.max - this.min);\r\n\t\tx = fclamp(x, 0, this.width);\r\n\r\n\t\tthis.sliderpointer.style.left = (this.sliderbody_x + x + 20 - 5) + \"px\";\r\n\t}\r\n\r\n\tthis.stop_tracking = function()\r\n\t{\r\n\t\tthis.is_tracking = false;\r\n\t\twt_tracking_widget = undefined;\r\n\t}\r\n\r\n\t// Generate the HTML for the visible parts of the widget.\r\n\tvar html = '';\r\n\thtml += '<table style=\"border-style:solid; border-color:black; border-width:1px\"><tr><td>' + name + '</td>';\r\n\thtml += '<td align=right><span id=\"slidervalue' + this.id + '\">' + val + '</span></td></tr><tr><td colspan=2>';\r\n\thtml += '<input type=hidden name=\"' + this.id + '\" value=\"' + this.initial_value + '\"></input>';\r\n\r\n\thtml += '<div id=\"sliderbody' + this.id + '\"';\r\n\thtml += event_handlers(this.id) + ' style=\"padding-left: 20px; padding-right: 20px\">';\r\n\r\n\t// Slider line.\r\n\thtml += '<hr style=\"width: ' + this.width + 'px; height: 28px; ';\r\n\thtml += 'border: none; border-top: 13px solid #FFFFFF; border-bottom: 13px solid #FFFFFF; background-color: #A0A0A0;\">';\r\n\r\n\t// Pointer\r\n\thtml += '<hr style=\"width: 12px; height: 20px; background-color: #A0A0A0; border: 1px solid black; border-left: 1px solid #E0E0E0; border-top: 1px solid #E0E0E0; \" id=\"sliderpointer' + this.id + '\">';\r\n\t\r\n\tmake_incrementer = function(inc)\r\n\t{\r\n\t\tvar html = \"<td><table cellpadding=0 cellspacing=0><tr>\";\r\n\t\thtml += '<td><span onclick=\\'return 1\\'><a href=\"javascript:void(0)\"><img src=\"images/wt_up.png\" border=0></a></span></td>';\r\n\t\thtml += '<td rowspan=2>' + inc + '&nbsp;&nbsp;&nbsp;</td></tr><tr>';\r\n\t\thtml += '<td><span onclick=\\'return 1\\'><a href=\"javascript:void(0)\"><img src=\"images/wt_down.png\" border=0>hi</a></span></td>';\r\n\t\thtml += '</tr></table></td>';\r\n\t\treturn html;\r\n\t}\r\n\r\n\thtml += \"<table>\\n\";\r\n\thtml += \"<tr>\" + make_incrementer(1) + make_incrementer(10) + make_incrementer(100) + \"</tr>\";\r\n\thtml += \"</table>\";\r\n\t\r\n\thtml += '</td></tr></table>';\r\n\thtml += '<style>';\r\n\thtml += '#sliderpointer' + this.id + ' { position: absolute; top: 0px; left: 0px; padding: 0px; }';\r\n\thtml += '</style>';\r\n\r\n\tdocument.write(html);\r\n\tdocument.close();\r\n\r\n\t// Cache references to relevent elements.\r\n\tthis.sliderbody = document.getElementById(\"sliderbody\" + this.id);\r\n\tthis.sliderpointer = document.getElementById(\"sliderpointer\" + this.id);\r\n\tthis.slidervalue = document.getElementById(\"slidervalue\" + this.id);\r\n\r\n\tthis.sliderbody_x = absolute_left(this.sliderbody);\r\n\tthis.sliderbody_y = absolute_top(this.sliderbody);\r\n\tthis.sliderpointer.style.top = this.sliderbody_y - 4;\r\n\t\r\n\tthis.hiddenvalue = document.getElementsByName(this.id)[0];\r\n\r\n\tthis.set_slider_pos(this.initial_value);\r\n}", "title": "" }, { "docid": "bf0a0fde8cbe23aa654881c6094800f0", "score": "0.47310734", "text": "function RangeSlider(props) {\n\t/** PROPS:\n\t\tminRange - Number\n\t\tmaxRange - Number\n\t\tsliderInput() - func\n\t**/\n\treturn (\n\t\t<div className={props.wrapperClass}>\n\t\t\t<input type=\"range\" min={props.minRange} max={props.maxRange} className=\"slider-comp\" onInput={props.sliderInput} step={props.sliderStep} defaultValue={props.defaultVal} ></input> \n\t\t</div>\n\t)\n}", "title": "" }, { "docid": "2fc983fc58556cc335ab03d527259108", "score": "0.47205794", "text": "render() {\n\t\treturn (\n\t\t\t<SliderWrapper>\n\t\t\t\t<ProgressBar type=\"range\" />\n\t\t\t\t<Handle\n id=\"__slider-handle__\"\n\t\t\t\t\tonMouseMove={event => this.handleMouseMove(event)}\n\t\t\t\t\tonMouseDown={event => this.handleMouseDown(event)}\n\t\t\t\t\tonMouseUp={this.handleMouseUp}\n\t\t\t\t\tonMouseLeave={this.handleMouseUp}\n translateX={this.getTranslateX()}\n\t\t\t\t/>\n\t\t\t</SliderWrapper>\n\t\t);\n\t}", "title": "" }, { "docid": "dcf740f0ff03f902c6418c9479c7d606", "score": "0.4681109", "text": "function getTokenSelection() {\n return $page.find($tokenSlider).val();\n }", "title": "" }, { "docid": "c4c7654c9c3e974dc61f68c2078fa494", "score": "0.4645959", "text": "function makeSlider(container, name, min, max, start) {\r\n var dis = d3.select(container).append(\"div\").attr(\"id\", \"slider-div-\" + name)\r\n\t\r\n dis.append(\"span\").classed(\"slider-label-\" + name, true)\r\n .text(name + ' ')\r\n var value = dis.append(\"span\").classed(\"slider-value-\" + name, true)\r\n .text(start)\r\n\r\n var slider = dis.append(\"input\")\r\n .attr(\"type\", \"range\")\r\n .attr(\"min\", min)\r\n .attr(\"max\", max)\r\n .attr(\"value\", start)\r\n .on(\"change\", updateParameters)\r\n .on(\"input\", function() {\r\n value.text(slider.node().value);\r\n\t\ttriggerEvent();\r\n })\r\n return slider.node();\r\n }", "title": "" }, { "docid": "4d901d1fe47983eaf3565df553adb6d3", "score": "0.46362266", "text": "function updateSlider() {\n document.getElementById(\"sliderVal\").innerHTML = document.getElementById(\"slider\").value;\n}", "title": "" }, { "docid": "4c46670c170653038a014af18df14f87", "score": "0.46174958", "text": "function getThumbCss(size, options) {\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\topacity: options.persistThumbs ? settings.thumbOpacity : 0,\n\t\t\t'background-color': options.thumbColor,\n\t\t\twidth: size.width + 'px',\n\t\t\theight: size.height + 'px',\n\t\t\t'border-radius': size.corner + 'px',\n\t\t\t'margin': size.top + 'px 0 0 ' + size.left + 'px',\n\t\t\t'z-index': options.zIndex\n\t\t};\n\t}", "title": "" }, { "docid": "4f7b2decbba14c583fd40c57f8c6e7b5", "score": "0.46103576", "text": "function inputNodeForName(name) {\n return wrapper.find('input[name=\"' + name + '\"]').at(0).node;\n }", "title": "" }, { "docid": "38c19a02d1e0dff0fbd225b23cd6e7b6", "score": "0.46095484", "text": "value(r) {\n return (this.sliders[r].value());\n }", "title": "" }, { "docid": "d49f437fab8e457289e630b5d80bcf60", "score": "0.4606464", "text": "function horizontalThumb(scroller) {\n assert_equals(scroller.scrollLeft, 0,\n \"horizontalThumb() requires scroller to have scrollLeft of 0\");\n const TRACK_WIDTH = calculateScrollbarThickness();\n const BUTTON_WIDTH = calculateScrollbarButtonWidth();\n if (scroller === document.documentElement || typeof(scroller) == 'undefined') {\n // HTML element is special, since scrollbars are not part of its client rect\n // and page scale doesn't affect the scrollbars. Use window properties instead.\n let x = BUTTON_WIDTH + 6;\n let y = window.innerHeight - TRACK_WIDTH / 2;\n return {x: x, y: y};\n }\n const scrollerRect = scroller.getBoundingClientRect();\n const thumbPoint = { x: scrollerRect.left + BUTTON_WIDTH + 2,\n y: scrollerRect.bottom - TRACK_WIDTH / 2 };\n return cssClientToCssVisual(thumbPoint);\n}", "title": "" }, { "docid": "f6cb2ddd9775c55561774fb7206c5553", "score": "0.46040118", "text": "function product_thumb(){\n\t\t$('.product-dec-slider-2').slick({\n\t\t\tinfinite: true,\n\t\t\tslidesToShow: 6,\n\t\t\tvertical: true,\n\t\t\tverticalSwiping: true,\n\t\t\tcenterPadding: '0',\n\t\t\tdraggable: true, \n\t\t\tslidesToScroll: 1\n\t\t});\n\t}", "title": "" }, { "docid": "86a8e006ae3cb8acc6c2c81df8536d44", "score": "0.46037567", "text": "function slider(s, prop, title, bounds, digits, extraval, useextraval){\n var astr = prop.astr,\n val = prop.get(),\n stepSize = Math.pow(10, -digits);\n\n // do not draw this item at all if there's no value\n if(notSettable(val)) return;\n\n function stepToValue(step){\n if (step==='various' || step==='?') return '?';\n\n var fmtval = step/Math.pow(10,digits);\n\n if ((!$.isNumeric(step) || fmtval===bounds[0]) && extraval) return extraval;\n return fmtval;\n }\n\n function sliderStep(v){\n if(extraval && v===extraval) v = bounds[0];\n else if(!$.isNumeric(v)) v = (bounds[0]+bounds[1])/2;\n return v/stepSize;\n }\n\n function setSliderValue(v) {\n if($.isNumeric(v)) {\n // round to one extra digit in case of external inputs\n // but avoid long strings of 9's or 0's\n v = Number(v).toFixed(Math.max(digits+1,0));\n if(digits>=0) v = v.replace(/0*$/,'').replace(/[\\.]$/,'');\n }\n $slider.children('.slider-val').val(v);\n $slider.children('.slider').slider('value', sliderStep(v));\n }\n\n function applySlider(v) {\n var valset = input.convertfrominput(v);\n if (valset===bounds[0] && useextraval) valset = extraval;\n\n setSliderValue(v);\n popover[0].applyChange({astr:astr, val:valset});\n }\n\n var input = inputBetween(bounds[0],bounds[1],extraval),\n $slider = $(\n '<div class=\"editboxselector pickslider\">'+\n '<div class=\"editboxtitle\"></div>'+\n '<input type=\"text\" class=\"input slider-val\"/>'+\n '<button class=\"btn btn--plain slider-dn\"><i class=\"icon-minus\"></i></button>' +\n '<button class=\"btn btn--plain slider-up\"><i class=\"icon-plus\"></i></button>' +\n '<div class=\"slider\"></div>'+\n '</div>'\n ).appendTo(s),\n popover = $slider.parents('.slideout');\n\n var $title = $slider.children('.editboxtitle');\n if(title) $title.html(title);\n else $title.hide();\n\n function increment(delta) {\n return function () {\n var oldval = $slider.children('.slider-val').val();\n\n if(extraval && oldval===extraval) return;\n // give a little buffer around bounds in case of rounding errors\n if(delta>0 && oldval>bounds[1]-stepSize/10) return;\n if(delta<0 && oldval<bounds[0]+stepSize*(extraval ? 1.1 : 0.1)) return;\n\n applySlider(parseFloat(oldval) + delta);\n };\n }\n $slider.children('.slider-up').click(increment(stepSize));\n $slider.children('.slider-dn').click(increment(-stepSize));\n\n $slider.children('.slider').slider({\n min: sliderStep(bounds[0]),\n max: sliderStep(bounds[1]),\n value: sliderStep(val),\n slide: function(e, ui){ setSliderValue(stepToValue(ui.value)); },\n stop: function(e, ui){ applySlider(stepToValue(ui.value)); }\n });\n $slider.children('.slider-val').blur(function() {\n var valnew = this.value;\n\n // do nothing if the value is unchanged\n if (valnew===String(val)) return;\n\n // clear potential error border\n $(this).css('border', '');\n\n // revert if value was cleared\n if (valnew==='') this.value = val;\n // take the new val if it passes validation test\n else if (input.test(valnew)) applySlider(valnew);\n else {\n $(this).css('border', '1px solid red');\n // TODO: tooltip broke...\n // $(this).tooltip({placement: 'right', title:input.errortext})\n // .tooltip('show');\n }\n });\n setSliderValue(val);\n\n $slider.parents('.empty-item').toggleClass('empty-item', false);\n return $slider[0];\n }", "title": "" }, { "docid": "584a2733e5cf1df586d1550c45b8df48", "score": "0.46023118", "text": "function findOutputForSlider(element) {\n var idVal = element.id;\n let outputs = document.getElementsByTagName('output');\n for (var i = 0; i < outputs.length; i++) {\n if (outputs[i].htmlFor == idVal)\n return outputs[i];\n }\n}", "title": "" }, { "docid": "23eba0286fc86b55023d4e95a4ae39ce", "score": "0.45936713", "text": "_callChangeEventHandler(event, thumbPosition) {\n if (thumbPosition === Thumb.START) {\n this._startInputChangeEventHandler(event);\n }\n else {\n this._endInputChangeEventHandler(event);\n }\n }", "title": "" }, { "docid": "2d8f9517f3cbbc05479f28abb4bb7cba", "score": "0.45870185", "text": "function buildSlider() {\n var sliderContents = edx.HtmlUtils.joinHtml(\n edx.HtmlUtils.HTML('<div class=\"ui-slider-handle progress-handle\"></div>')\n );\n\n // xss-lint: disable=javascript-jquery-append\n this.videoProgressSlider.el.append(sliderContents.text);\n\n this.videoProgressSlider.slider = this.videoProgressSlider.el\n .slider({\n range: 'min',\n min: this.config.startTime,\n max: this.config.endTime,\n slide: this.videoProgressSlider.onSlide,\n stop: this.videoProgressSlider.onStop,\n step: 5\n });\n\n this.videoProgressSlider.sliderProgress = this.videoProgressSlider\n .slider\n .find('.ui-slider-range.ui-widget-header.ui-slider-range-min');\n }", "title": "" }, { "docid": "0880cd6b6c5091cb015d34490383fc4b", "score": "0.45799908", "text": "get thumb() {\n return this.artworkUrl60;\n }", "title": "" }, { "docid": "7aa5c7a6b97aab68a921716151246324", "score": "0.45619774", "text": "render(){\n \n return(\n <div className=\"lenP\">\n <label htmlFor=\"len\">{this.props.labelM} lenght of primers:</label><br/>\n <input type=\"range\" min={15} max={30} value={this.state.value} className=\"slider\" onChange={this.handleEventOnChange}/>\n <div className=\"sliderValue\">{this.state.value}</div>\n </div>\n )\n}", "title": "" }, { "docid": "9a821145b8ad90198d51b30bbd1b01a1", "score": "0.4558321", "text": "renderSeekbar(){\n return(\n <Slider\n style={{flex: 1, height: 10, marginHorizontal:10}}\n maximumTrackTintColor={'#cccccc'}\n minimumTrackTintColor={'#9E76D4'}\n thumbImage={require('./img/videoSliderThumb.png')}\n thumbTintColor = {Platform.OS === 'android'?'#9E76D4':null}\n value={this.state.currentTime}\n minimumValue={0}\n maximumValue={this.state.duration}\n onValueChange={(currentTime) => { this.setState({seeking:true,currentTime}) }}\n onSlidingComplete={(value) => { //用户完成更改值时调用的回调(例如,当滑块被释放时)\n value = Math.ceil(value);\n this.seekTo(value)\n\n }}\n />\n )\n }", "title": "" }, { "docid": "ef604d2284bb8d7c7b43577aa9b12f47", "score": "0.45502478", "text": "getProgressBarNode(){\n var id = `bar_${this.props.order}`;\n return document.getElementById(id);\n }", "title": "" }, { "docid": "b0baf81bca726b19ce2fa9d9da4029b5", "score": "0.45464683", "text": "function getValue() {\n\n /*jshint validthis: true */\n\n var base = $(this).data('base'), answer = [];\n\n // Loop the handles, and get the value from the input\n // for every handle on its' own.\n $.each(base.data('handles'), function () {\n answer.push($(this).data('store').val());\n });\n\n // If the slider has just one handle, return a single value.\n // Otherwise, return an array, which is in reverse order\n // if the slider is used RTL.\n if (answer.length === 1) {\n return answer[0];\n }\n\n if (base.data('options').direction) {\n return answer.reverse();\n }\n\n return answer;\n }", "title": "" }, { "docid": "8653b9517efd86e1a9ece9a35ae46059", "score": "0.45351228", "text": "function bindRangeSlider(){\n Array.from(document.getElementsByClassName('rangeSlider')).map((v) => {\n\n // Reference the track (thumb).\n const track = v.getElementsByClassName('rangeSliderTrack')[0]\n\n // Set the initial slider value.\n const value = v.getAttribute('value')\n const sliderMeta = calculateRangeSliderMeta(v)\n\n updateRangedSlider(v, value, ((value-sliderMeta.min)/sliderMeta.step)*sliderMeta.inc)\n\n // The magic happens when we click on the track.\n track.onmousedown = (e) => {\n\n // Stop moving the track on mouse up.\n document.onmouseup = (e) => {\n document.onmousemove = null\n document.onmouseup = null\n }\n\n // Move slider according to the mouse position.\n document.onmousemove = (e) => {\n\n // Distance from the beginning of the bar in pixels.\n const diff = e.pageX - v.offsetLeft - track.offsetWidth/2\n \n // Don't move the track off the bar.\n if(diff >= 0 && diff <= v.offsetWidth-track.offsetWidth/2){\n\n // Convert the difference to a percentage.\n const perc = (diff/v.offsetWidth)*100\n // Calculate the percentage of the closest notch.\n const notch = Number(perc/sliderMeta.inc).toFixed(0)*sliderMeta.inc\n\n // If we're close to that notch, stick to it.\n if(Math.abs(perc-notch) < sliderMeta.inc/2){\n updateRangedSlider(v, sliderMeta.min+(sliderMeta.step*(notch/sliderMeta.inc)), notch)\n }\n }\n }\n }\n }) \n}", "title": "" }, { "docid": "9ee076003a6b15c5c7dc07b03daf1224", "score": "0.45330805", "text": "function getSliderStep(primitive) {\n\treturn map(primitive, function(primitive) {\n\t\treturn primitive.getAttribute(\"SliderStep\");\n\t});\n\n}", "title": "" }, { "docid": "570798f00c8342f366de4257aefc3b8f", "score": "0.45278645", "text": "_getKnob() {\n return this._knob.nativeElement;\n }", "title": "" }, { "docid": "771de6fd68024967a6bfb5ac45c6cd0b", "score": "0.45209023", "text": "handleBlur(event) {\r\n const thumbType = event.target.getAttribute('range-thumb');\r\n if (thumbType === 'min') {\r\n this.minThumbNode.classList.remove('focus');\r\n }\r\n else {\r\n this.maxThumbNode.classList.remove('focus');\r\n }\r\n this.rangeSliderTrack.classList.remove('focus');\r\n }", "title": "" }, { "docid": "2cef9fa9edf6dcad10e6419873233122", "score": "0.4520132", "text": "function createSlider($el) {\n var slider;\n\n if ( ! helpers.validation.validateSimple('jQuery', $el) && $el.length > 0) {\n helpers.debug.reportError('cant init slider, argument not jQuery or is empty jQuery', 2, $el);\n return;\n }\n\n slider = new product.slider(jQuery($el[0])); // pass only first element as jQuery\n sliders[slider.getId()] = slider;\n }", "title": "" }, { "docid": "4a3ab09fbb46b452df65aa09dd01d72f", "score": "0.4519315", "text": "function createLinkedSlider(inputId, sliderId, \n sliderMin, sliderMax, sliderStep, numDigits)\n{\n var inputObj = $(inputId);\n // Create JQueryUI slider\n var sliderObj = $(sliderId).slider({\n value: inputObj.attr('value'), // Initial value\n min: sliderMin, // Minimum value\n max: sliderMax, // Maximum value\n step: sliderStep, // Resolution\n animate: 'fast'}); // Animation speed \n\n // If numDigits was not specified, infer from sliderStep.\n numDigits = numDigits || \n Math.max(0, Math.ceil(-Math.log(sliderStep) / Math.log(10)));\n\n // Update slider when input changes\n inputObj.blur(function()\n {\n var value = inputObj.attr('value');\n var valueClamped = Math.min(Math.max(value, \n sliderObj.slider('option', 'min')), \n sliderObj.slider('option', 'max'));\n sliderObj.slider('value', valueClamped);\n\n if(value != valueClamped)\n inputObj.val(valueClamped.toFixed(numDigits));\n });\n\n // Update input when slider changes\n sliderObj.slider('option', 'slide',\n function(event, ui) { inputObj.val(ui.value.toFixed(numDigits)); });\n}", "title": "" }, { "docid": "5390e7bb477ac3aaebc0d77c60e934b5", "score": "0.45192003", "text": "get inputNode() {\n return this.node.getElementsByTagName('input')[0];\n }", "title": "" }, { "docid": "5390e7bb477ac3aaebc0d77c60e934b5", "score": "0.45192003", "text": "get inputNode() {\n return this.node.getElementsByTagName('input')[0];\n }", "title": "" }, { "docid": "8b1ef693feaa110926cfd6333b9f80f4", "score": "0.4509555", "text": "drawControl() {\n return (this._domControl = el('input', {\n type: 'radio',\n id: this.get('id') + '-input',\n className: this.get('baseClassName') + '-input',\n checked: this.get('value'),\n disabled: this.get('isDisabled'),\n name: this.get('name'),\n }));\n }", "title": "" }, { "docid": "979ae994a3eba5caf70c100235854894", "score": "0.45062986", "text": "async function getPicture(html) {\n return html.querySelectorAll('.pi-image-thumbnail')[0].getAttribute('src')\n}", "title": "" }, { "docid": "05bcc29079b76d1ced16c46432e3bb95", "score": "0.45040432", "text": "function getThumbnailsPosition() {\r\n var positionProp = self.settings.thumbnailOrientation == 'horizontal' ? 'left' : 'top',\r\n sizeProp = self.settings.thumbnailOrientation == 'horizontal' ? 'width' : 'height',\r\n position = parseFloat(thumbnailsContainer.css(positionProp)) / (thumbnailsTotalSize - parseInt(thumbnailsVisibleContainer.css(sizeProp)));\r\n\r\n return position;\r\n }", "title": "" }, { "docid": "a40f74ed048eecfcb7a64caad6fe02b8", "score": "0.4503462", "text": "get inputNode() {\n return this.node.getElementsByClassName('jp-extensionmanager-input')[0];\n }", "title": "" }, { "docid": "299302192583b2204c30c962eec855f9", "score": "0.45022762", "text": "function f_sliderGetPos (b_vertical, b_base) {\n\tvar n_pos = 0,\n\t\ts_coord = (b_vertical ? 'Top' : 'Left');\n\tvar o_elem = o_elem2 = b_base ? this.e_base : this.e_slider;\n\t\n\twhile (o_elem) {\n\t\tn_pos += o_elem[\"offset\" + s_coord];\n\t\to_elem = o_elem.offsetParent;\n\t}\n\to_elem = o_elem2;\n\n\tvar n_offset;\n\twhile (o_elem.tagName != \"BODY\") {\n\t\tn_offset = o_elem[\"scroll\" + s_coord];\n\t\tif (n_offset)\n\t\t\tn_pos -= o_elem[\"scroll\" + s_coord];\n\t\to_elem = o_elem.parentNode;\n\t}\n\treturn n_pos;\n}", "title": "" }, { "docid": "dd7f924c150bb7cb5dbfa1a2b4c911fb", "score": "0.449697", "text": "function createSlider() {\n if (sliderStartValue == 1) {\n var slider = document.createElement(\"input\");\n slider.setAttribute(\"type\", \"range\");\n slider.setAttribute(\"value\", \"5\");\n slider.setAttribute(\"min\", \"7\");\n slider.setAttribute(\"max\", memory.Decks[document.getElementsByTagName(\"select\").item(0).value].amount);\n slider.setAttribute(\"step\", \"1\");\n slider.setAttribute(\"id\", \"slider\");\n document.getElementById(\"sliderDiv\").appendChild(slider);\n sliderStartValue++;\n var sliderValue_1 = document.createElement(\"p\");\n sliderValue_1.setAttribute(\"id\", \"sliderValue\");\n sliderValue_1.innerText = \"Anzahl Kartenpaare: \" + document.getElementById(\"slider\").value;\n slider.oninput = function () {\n sliderValue_1.innerText = \"Anzahl Kartenpaare: \" + this.value;\n };\n document.getElementById(\"sliderDiv\").appendChild(sliderValue_1);\n }\n else {\n sliderUpdate();\n }\n }", "title": "" }, { "docid": "bd17c2e625270dcd8e714cf4365b0f5b", "score": "0.4487857", "text": "getInput() {\n return this.element.shadowRoot\n ? this.element.shadowRoot.querySelector('input')\n : this.element.querySelector('input');\n }", "title": "" }, { "docid": "0aba4074c07734a5a8f362323af3bbee", "score": "0.44788852", "text": "function scrollToThumbMin(objThumb){\n\t\t\n\t\tvar objThumbPos = getThumbPos(objThumb);\n\t\t\n\t\tvar scrollPos = objThumbPos.min * -1;\n\t\tscrollPos = t.fixInnerStripLimits(scrollPos);\n\n\t\tt.positionInnerStrip(scrollPos, true);\n\t}", "title": "" }, { "docid": "46adec7aaa6bbd3deff50d1f1d3a147e", "score": "0.44758308", "text": "function getInputElement(content, isNickname) {\n\tvar input = document.createElement(\"input\");\n\tinput.value = content;\n\tinput.classList.add(\"list-group-item\", \"form-control\", \"input-lg\");\n\tif (isNickname) {\n\t\tinput.classList.add(\"active\");\n\t\tinput.setAttribute(\"maxlength\", 30);\n\t\tinput.oninput = function() {\n\t\t\tvalidateNickname(input);\n\t\t};\n\t} else {\n\t\tinput.placeholder = \"Bus stop name (Rackham)\";\n\t\tinput.classList.add(\"stop\");\n\t\tinput.oninput = function() {\n\t\t\tvalidateStop(input);\n\t\t};\n\t}\n\treturn input;\n}", "title": "" }, { "docid": "2d5d97f3acd2c838e99cf738479fee6d", "score": "0.44633344", "text": "static createSlider(tag, color, picker) {\n const lightnessSlider = new LightnessSlider(tag, color, picker);\n lightnessSlider.initialize();\n }", "title": "" }, { "docid": "df966656340d66a09deef22d6f027d43", "score": "0.44615245", "text": "function firstElementOfSlider() {\n\tif (picArray && picArray.length) {\n\t\tdocument.getElementById('img_att').src=picArray[position];\n\t\tdocument.getElementById('img_att').alt=picDetails[position];\n\t\tdocument.getElementById('img_att').title=picDetails[position];\n\t\tdocument.getElementById(\"attractionName\").innerHTML= \"<p><b>\"+inHTML[position]+\"</b></p>\";\n\t\tdocument.getElementById(\"attractionLink\").href=attractionLink[position];\n\t\tdocument.getElementById(\"attractionAddress\").innerHTML=attractionAddress[position];\n\t\tdocument.getElementById(\"attractionDetails\").innerHTML=attractionDetails[position];\n\t\tdocument.getElementById(\"bodyAttractions\").style.display=\"block\";\n\t\tdocument.getElementById(\"hiddenAttractions\").style.display=\"none\";\n\t}\n}", "title": "" }, { "docid": "fc907dbb14eab79f6128dec473cd5e55", "score": "0.44598788", "text": "function rangeSlider(event) {\n\n\t\t// store the id of the input being used\n\t\tvar the_id = ($(event).attr('id'));\n\n\t\t// split the id on the - and return the second index of the string array\n\t\tvar output_id = the_id.split('-')[1];\n\n\t\t// display the value of the rangeslider to the output element\n\t\t$('#op-' + output_id).text($('#' + the_id).val());\n\n\t} // end rangeSlider()", "title": "" }, { "docid": "bdd514b94845ce5c0311b64d8ea25a34", "score": "0.44475967", "text": "function getYouTubeThumb(el, id, size){\n\t//0 for large, 2 for small)\n\t$(el).attr('src',\"http://img.youtube.com/vi/\"+id+\"/\"+size+\".jpg\");\n}", "title": "" }, { "docid": "4e4e23106797fbee0633676a3ac7dc6e", "score": "0.4436215", "text": "function getDomValue() {\n\t\t\t\tvar val = elem.val();\n\t\t\t\tif (val === attrs.placeholder) {\n\t\t\t\t\tval = '';\n\t\t\t\t}\n\t\t\t\treturn val;\n\t\t\t}", "title": "" }, { "docid": "9889e39595ec2532fc863e5a007ba7e1", "score": "0.44258124", "text": "function SliderView(parent) {\r\n _super.call(this);\r\n this.root = document.createElement(\"input\");\r\n this.root.type = \"range\";\r\n\r\n // When the slider is moved update the model value. This will then\r\n // cause other sliders also to update.\r\n this.root.onchange = function (ev) {\r\n model.value = ev.srcElement[\"value\"];\r\n };\r\n parent.appendChild(this.root);\r\n }", "title": "" }, { "docid": "c31fc79bfdb1e2768ea27a0f35bda07f", "score": "0.44255236", "text": "function getElement(evt){\n if (window.event){\n return window.event.srcElement;\n }else{\n return evt.currentTarget;\n }\n }", "title": "" }, { "docid": "001406c2072227da8b08ce3b6ebb6f7b", "score": "0.4418373", "text": "function createSlider(axis) {\n var slider = document.createElement(\"div\");\n if (axis === \"Y\") { // slider for vertical scroller\n makeByStandart(slider, scroller, \"absolute\", sliderClass);\n slider.setAttribute(\"data-type\", \"slider\");\n slider.style.width = scroller.clientWidth + \"px\";\n slider.style.top = topEdge + \"px\";\n } else if (axis === \"X\") { // slider for horizontal scroller\n makeByStandart(slider, scrollerX, \"absolute\", sliderClass);\n slider.setAttribute(\"data-type\", \"sliderX\");\n slider.style.height = scrollerX.clientHeight + \"px\";\n slider.style.left = leftEdge + \"px\";\n }\n smoothly(\"set\", slider);\n return slider;\n }", "title": "" }, { "docid": "190cd73eb0dafa0cc48723f14582b392", "score": "0.44163197", "text": "get searchTextBox () { return $('//input[@datav3-track-text=\"search\"]') }", "title": "" }, { "docid": "47080a07e9be323dc54cfa434ab1d65f", "score": "0.44048023", "text": "_renderThumbnail($$) {\n let node = this.props.node;\n // TODO: Make this work with tables as well\n let contentNode = node.find('graphic');\n let el = $$('div').addClass('se-thumbnail');\n if (contentNode) {\n el.append(\n $$(this.getComponent(contentNode.type), {\n node: contentNode,\n disabled: this.props.disabled\n })\n );\n } else {\n el.append('No thumb');\n }\n return el\n }", "title": "" }, { "docid": "a2ef6477f9fc15918470065b54a997c8", "score": "0.4400541", "text": "function sliderPos (v) {\n return bbox.y + sliderOffset(v);\n }", "title": "" } ]
88dfa7a86f2c16c298ad241c6faeff7c
display chart after BarChart has been mounted to the DOM
[ { "docid": "3368ffe6a0839031ccb6610aaf3c2937", "score": "0.0", "text": "componentDidMount() {\n this.drawPieChart();\n }", "title": "" } ]
[ { "docid": "ec06237c52898bba38e8a45832bab863", "score": "0.7350789", "text": "function displayChart() {\n elChart.innerHTML = '';\n let myChart = new Chart(elChart, {\n//assign the property of type to be a bar chart \n \n type: 'bar', \n //set up our data property that will contain the labels\n \n //for our data and the varios datasets that we want displayed as bars\n data: {\n labels: populateChart('name'),\n datasets: [ {\n\n label: '# of times clicked',\n data: populateChart('clicked'),\n backgroundColor: 'gray'\n },\n\n {\n label: '# of times shown',\n data: populateChart('shown'),\n backgroundColor: 'black'\n }\n ],\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n }\n});\n}", "title": "" }, { "docid": "2e0e41f96a2b307f1d91c839d349944c", "score": "0.6944473", "text": "function drawChart(){\nvar chart = new tauCharts.Chart({\n data: defData,\n type: 'bar',\n x: 'time',\n y: 'price'\n });\nchart.renderTo('#bar');\n}", "title": "" }, { "docid": "27f87d10884f5c1e2701630b7570f59a", "score": "0.6869212", "text": "componentDidMount() {\n this.chart = new Chart('chart', {\n type: \"bar\" // the type of chart\n });\n this.showchart(); // to show the chart of the first search result\n }", "title": "" }, { "docid": "a52d5ba09a3ab2dc407b686e0f927f36", "score": "0.6752893", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable(dataTableArray);\n var options = {\n chart: {\n title: 'Revision number distribution by year and by user type',\n },\n bars: 'vertical',\n vAxis: {format: 'decimal'},\n width: 1000,\n height: 500,\n };\n var barChart = new google.charts.Bar($(\"#columnChart\")[0]);\n barChart.draw(data, google.charts.Bar.convertOptions(options));\n var lineChart = new google.charts.Line($(\"#lineChart\")[0]);\n google.visualization.events.addListener(lineChart, 'ready', function () {\n $(\"#lineChart\").hide();\n });\n lineChart.draw(data, google.charts.Bar.convertOptions(options));\n }", "title": "" }, { "docid": "829dc7dbd01c2c7ea72f1ba89ce678e6", "score": "0.67007303", "text": "function onBarsRenderEnd() {\n chart._updateValueDisplay();\n chart._updateBarSpacing();\n chart._updateRotateXAxisLabels();\n chart._updateGridLines();\n }", "title": "" }, { "docid": "e778907f518fa25a1160530487d21715", "score": "0.66727394", "text": "componentDidUpdate() {\n this.drawChart();\n }", "title": "" }, { "docid": "e778907f518fa25a1160530487d21715", "score": "0.66727394", "text": "componentDidUpdate() {\n this.drawChart();\n }", "title": "" }, { "docid": "e778907f518fa25a1160530487d21715", "score": "0.66727394", "text": "componentDidUpdate() {\n this.drawChart();\n }", "title": "" }, { "docid": "e8c65580d169764d70f0cfdaf8aae05b", "score": "0.6618489", "text": "constructor() {\n super();\n this.id = \"chart\";\n this.type = \"bar\";\n this.scale = \"ct-minor-seventh\";\n this.responsiveOptions = [];\n this.data = [];\n this.dataSource = \"\";\n this.showTable = false;\n this.__chartId = generateResourceID(\"chart-\");\n window.ESGlobalBridge.requestAvailability();\n this._loadScripts(\n \"chartistLib\",\n \"lib/chartist/dist/chartist.min.js\",\n this._chartistLoaded\n );\n this._updateData();\n this.observer.observe(this, {\n attributes: false,\n childList: true,\n subtree: true\n });\n /**\n * Fired once once chart is ready.\n *\n * @event chartist-render-ready\n *\n */\n this.dispatchEvent(\n new CustomEvent(\"chartist-render-ready\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this\n })\n );\n if (typeof Chartist === \"object\") this._chartistLoaded.bind(this);\n }", "title": "" }, { "docid": "5d66e35cbf657549008a84ca61171e9e", "score": "0.6605006", "text": "function renderTotals (){\n\n var context = document.getElementById('resultsChart').getContext('2d');\n var myBarChart = new Chart(context).Bar(data);\n}", "title": "" }, { "docid": "4e2f15af3f79718a10f18db851b7d4c1", "score": "0.65981567", "text": "componentDidUpdate() {\n this.renderCharts();\n }", "title": "" }, { "docid": "49e3005bc13c38495a86c81847f78a82", "score": "0.6492021", "text": "function initialize() {\n\n // Determine our screen size so we can dynamically set our display containers\n var rect = document.body.getBoundingClientRect();\n var screenWidth = (rect.width < 960) ? Math.round(rect.width * .95) : Math.round((rect.width - 210) * .95);\n var screenHeight = Math.min(window.innerHeight * 0.75, screenWidth);\n\n //Here we set our <code>viz</code> variable by instantiating the <code>vizuly.viz.corona</code> function.\n //All vizuly components require a parent DOM element at initialization so they know where to inject their display elements.\n viz = vizuly.viz.linearea(document.getElementById(\"viz_container\"));\n\n\n //Using the function chain syntax we can now set various properties of the bar chart.\n //\n //Both the <code>x</code> and <code>y</code> properties are used to map the data values\n //to the corresponding x and y axis within the chart.\n viz.data(data)\n .width(800).height(600) // initial component display size\n .y(function (d, i) { return d.Volume; }) // property for y axis plot\n .x(function (d, i) { return d.date; }) // property for x axis plot\n .on(\"update\",onUpdate) // callback for update event\n .on(\"zoom\",zoom) // callback for zoom event\n .on(\"mouseover\",onMouseOver) // callback for mouseover event\n .on(\"mouseout\",onMouseOut) // callback for mouseout event\n .on(\"measure\", onMeasure); // callback for measure event\n\n\n //** Themes and skins ** play a big role in vizuly, and are designed to make it easy to make subtle or drastic changes\n //to the look and feel of any component. Here we choose a theme and skin to use for our bar chart.\n // *See this <a href=''>guide</a> for understanding the details of themes and skins.*\n theme = vizuly.theme.linearea(viz).skin(vizuly.skin.LINEAREA_FIRE);\n\n //The <code>viz.selection()</code> property refers to the parent\n //container that was used at the object construction. With this <code>selection</code> property we can use D3\n //add, remove, or manipulate elements within the component. In this case we add a title label and heading to our chart.\n viz_title = viz.selection()\n .select(\"svg\")\n .append(\"text\")\n .attr(\"class\", \"title\")\n .attr(\"x\", viz.width() / 2)\n .attr(\"y\", 40)\n .attr(\"text-anchor\", \"middle\")\n .style(\"fill\", \"#0f2747\")\n .style(\"font-weight\",300).text(\"TECH STOCKS\");\n\n\n // Update the yAxis ticks function to show currency.\n viz.yAxis().tickFormat(function (d) { return (Math.round(d/1000000)) + \"M\";});\n\n // Update viz to appropriate size\n changeSize(d3.select(\"#currentDisplay\").attr(\"item_value\"));\n\n /*\n // This code is for the purposes of the demo and simply cycles through the various skins\n // The user can stop this by clicking anywhere on the page.\n var reel = vizuly.showreel(theme,['Sunset','Ocean','Neon','Business'],2000).start();\n var stopReel = function () {\n //Stop show reel\n reel.stop();\n //Remove event listeners\n d3.select(\"body\").on(\"mousedown.reel\",null);\n d3.select(\"body\").on(\"wheel.reel\",null);\n }\n\n // We need a two event listeners to stop the reel (because of the zoom operation)\n d3.select(\"body\").on(\"mousedown.reel\",stopReel);\n d3.select(\"body\").on(\"wheel.reel\",stopReel);\n */\n}", "title": "" }, { "docid": "a0a2efa5ab2e3afe512e20124078a28a", "score": "0.64347035", "text": "showGraph() {\n if (this.root) {\n this.root.innerHTML = \"\";\n this.bars.length = 0;\n let barWidth = this.dimentions.w / this.array.length - 1;\n for (let i = 0; i < this.array.length; i++) {\n const bar = createElement(\"div\", \"bar\");\n bar.style.position = \"absolute\";\n bar.style.left = i * barWidth + i + \"px\";\n bar.style.bottom = 0 + \"px\";\n bar.style.width = barWidth + \"px\";\n bar.style.height = (this.array[i] / 1000) * this.dimentions.h + \"px\";\n this.root.append(bar);\n this.bars.push(bar);\n }\n for (var i = 30; i < this.dimentions.h; i += 30) {\n const line = createElement(\"div\", \"tick\");\n line.innerHTML = i;\n line.style.position = \"absolute\";\n line.style.bottom = i + \"px\";\n line.style.left = -25 + \"px\";\n this.root.append(line);\n }\n }\n }", "title": "" }, { "docid": "c848976b0803d5115c33eadf641d646a", "score": "0.64119905", "text": "function dataLoaded(data){\n console.log(data);\n\n drawBars(data)\n}", "title": "" }, { "docid": "6957face899bdb52ccf18c2e8f2f6b99", "score": "0.6394498", "text": "function drawChartBar(results, elementID='barchart_material', options=default_options) \n{\n var data = google.visualization.arrayToDataTable(jsonToGraphData(results));\n var chart = new google.charts.Bar(document.getElementById(elementID));\n chart.draw(data, google.charts.Bar.convertOptions(options));\n // var chart = new google.visualization.BarChart(document.getElementById(elementID));\n // chart.draw(data, options);\n}", "title": "" }, { "docid": "513ee80518f6298902a68f8007c15159", "score": "0.63845986", "text": "function initialize() {\n\n //Here we set our <code>viz</code> variable by instantiating the <code>vizuly.viz.corona</code> function.\n //All vizuly components require a parent DOM element at initialization so they know where to inject their display elements.\n viz = vizuly.viz.scatter(document.getElementById(\"viz_container\"));\n\n //Using the function chain syntax we can now set various properties of the bar chart.\n //\n //Both the <code>x</code> and <code>y</code> properties are used to map the data values\n //to the corresponding x and y axis within the chart.\n viz.data(dataSource.data)\n .width(screenWidth).height(screenHeight) // initial component display size\n .y(function (d, i) {\n return Number(d[dataSource.amount]); // property for y axis plot\n })\n .x(function (d, i) {\n return d[dataSource.date]; // property for x axis plot\n })\n .r(function (d, i) {\n return Number(d[dataSource.amount]); // property for node radius plot\n })\n .duration(1500) // The length of time(ms) for any viz transitions to run\n .on(\"validate\", onValidate) // Callback for the validate event\n .on(\"update\", onUpdate) // Callback for update event\n .on(\"measure\", onMeasure) // Callback for measure event\n .on(\"mouseout\", onMouseOut); // Callback for mouseout event\n\n //** Themes and skins ** play a big role in vizuly, and are designed to make it easy to make subtle or drastic changes\n //to the look and feel of any component. Here we choose a theme and skin to use for our bar chart.\n // *See this <a href=''>guide</a> for understanding the details of themes and skins.*\n theme = vizuly.theme.scatter(viz)\n .skin(vizuly.skin.SCATTER_OCEAN)\n // Instead of attaching to the viz's mouseover event we are attaching to the theme's mouse over.\n // This allows us to make style changes that don't clobber the ones the theme is making, but goes after them.\n .on(\"mouseover\", onMouseOver);\n\n //The <code>viz.selection()</code> property refers to the parent\n //container that was used at the object construction. With this <code>selection</code> property we can use D3\n //add, remove, or manipulate elements within the component. In this case we add a title label and heading to our chart.\n viz_title = viz.selection()\n .select(\"svg\")\n .append(\"text\")\n .attr(\"class\", \"title\")\n .attr(\"x\", viz.width() / 2)\n .attr(\"y\", 40).attr(\"text-anchor\", \"middle\")\n .style(\"fill\", \"#0f2747\")\n .style(\"font-family\", \"Raleway\")\n .style(\"font-weight\", 300);\n\n // Update the yAxis ticks function to show currency.\n viz.yAxis().tickFormat(function (d) {\n return formatCurrency(d / 1000000) + \"M\";\n });\n\n //The <code>viz.update()</code> function tells the component to render itself to the display.\n // Any property changes that have occurred since the last update (including changes to the data) will now be rendered.\n viz.update();\n\n /*\n // This code is for the purposes of the demo and simply cycles through the various skins\n // The user can stop this by clicking anywhere on the page.\n var reel = vizuly.showreel(theme, ['Sunset', 'Neon', 'Ocean'], 2000).start();\n d3.select(\"body\").on(\"mousedown.reel\", function () {\n //Stop show reel\n reel.stop();\n //Remove event listener\n d3.select(\"body\").on(\"mousedown.reel\", null);\n })\n */\n\n}", "title": "" }, { "docid": "3fd906fce88b17add12677561223cc16", "score": "0.6379064", "text": "function dashboardInit() {\n let tempChartWidth = document.getElementById('tempChart').offsetWidth,\n tempChartHeight = tempChartWidth * 0.5,\n rainFallChartWidth = document.getElementById('rainfallChart').offsetWidth,\n rainFallChartHeight = rainFallChartWidth * 0.5;\n tempChart = dc.lineChart('#tempChart')\n .width(tempChartWidth)\n .height(tempChartHeight)\n .transitionDuration(transitionDuration)\n .margins({top: 30, right: 50, bottom: 25, left: 40});\n rainfallChart = dc.barChart('#rainfallChart')\n .width(rainFallChartWidth)\n .height(rainFallChartHeight)\n .transitionDuration(10)\n .margins({top: 30, right: 50, bottom: 25, left: 40});\n //batteryChart = dc.lineChart('#batteryChart');\n }", "title": "" }, { "docid": "9a09c33e5221cce78babfc9686d0de49", "score": "0.6375037", "text": "function render_barBijzonder() {\n var plotBar = hgiBar().margin({'top': 20, 'right': 20, 'bottom': 40, 'left': 110}).mapping(['name','value']).errorMapping('sd').freqMapping('frequency').title('Is er iets bijzonders gebeurd?').xDomain([0,100]).xLabel('Ik ben van slag').addError(true).addFrequencies(true);\n d3.select('#barBijzonder').datum(data_vanslag).call(plotBar);\n}", "title": "" }, { "docid": "06f3e184eee374ddf3c6ddb434d688c6", "score": "0.6371718", "text": "function drawChart() {\r\n\r\n var jsonData = $.ajax({\r\n\t\t\t\t\turl : \"chartdata.bo\", \r\n\t\t\t\t\tdataType : \"JSON\",\r\n\t\t\t\t\tasync: false\r\n\t\t\t\t}).responseText;\r\n\r\n var data = new google.visualization.DataTable(jsonData);\r\n\r\n\r\n // Set chart options\r\n var options = {\r\n width: 300,\r\n title: \"자유게시판 일별 게시 통계\",\r\n legend: { position: 'none' },\r\n hAxis: {\r\n title: '게시물 갯수',\r\n minValue: 0,\r\n },\r\n vAxis: {\r\n title: '날짜'\r\n },\r\n bar: { groupWidth: \"90%\" }\r\n };\r\n\r\n // Instantiate and draw our chart, passing in some options.\r\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\r\n chart.draw(data, options);\r\n}", "title": "" }, { "docid": "4e6f08993b725cb7184c47122bc5360c", "score": "0.6353647", "text": "set_chart_display() {\n T.table_chart_handler(\"chart\")\n }", "title": "" }, { "docid": "6e7ddb795fa3c9a95d0d895e98a2734a", "score": "0.63478976", "text": "function MainPage() {\n //el grafico de barras. Tiene un paramétro selected para saber que ha seleccionado\n var axischart = { values: [], labels: [], selected: {}, div: '#grafica', type: 'bar', percentages: [] }\n\n var data = [];\n var dataTabla = [];\n\n var anyo = 2020;\n var ant = 2020;\n\n function load(){\n api_get(`SELECT p.codi,p.descripcio, SUM(total) as total FROM plan_economica p JOIN gastos g ON p.codi = SUBSTRING(g.economica,1,LENGTH(p.codi)) WHERE exercici = ${anyo} and (('undefined' = 'undefined' and p.codi like '_') OR g.programa like 'undefined') GROUP BY p.codi,p.descripcio`)\n .then((res) => {\n data = getData(res);\n dataTabla = res[0].data\n axischart.values = data[1];\n axischart.labels = data[0];\n axischart.percentages = data[2];\n m.redraw();\n }\n )}\n\n return {\n //sacamos los datos de la base de datos. Todas las tablas tendrán los mismos datos\n oninit: function (vnode) {\n load()\n console.log(axischart.values);\n },\n \n view: function(vnode) {\n\n\n if (anyo != ant) {\n ant = anyo\n load()\n }\n\n /*api_get(\"SELECT p.codi,p.descripcio, SUM(total) as total FROM plan_economica p JOIN gastos g ON p.codi = SUBSTRING(g.economica,1,LENGTH(p.codi)) WHERE exercici = 2020 and (('undefined' = 'undefined' and p.codi like '_') OR g.programa like 'undefined') GROUP BY p.codi,p.descripcio\").then((res) => {\n data = getData(res);\n axischart.values = data[1];\n axischart.labels = data[0];\n axischart.percentages = data[2];\n console.log(vnode.attrs.first.values.length);\n m.redraw();\n })*/\n\n return [\n m(\".ui.inverted.segment\", { style: \"height:150px\" },\n m(\"h1.ui.huge.centered.header\", { style: \"margin-top:20px;\" }, \"SECTOR PÚBLICO\"),\n m(\"h6.ui.large.centered.header\", { style: \"font-style:italic\" }, \"Los datos de tu comunidad a tu alcance\")),\n m(\".ui.container\", { style: \"text-align:center\" }, [\n m(\".ui.segment\", [\n m(\".ui.buttons\", [\n //boton año anterior\n m(\"button.ui.labeled.icon.button\", { onclick: () => {anyo -=1; axischart.values = []; axischart.labels = []; axischart.percentages = [];}}, \n m(\"i.left.chevron.icon\"), anyo-1),\n //año de los datos\n m(\"button.ui.disabled.black.button\", anyo),\n //boton año siguiente\n m(\"button.ui.right.labeled.icon.button\", {onclick: () => { anyo+=1; axischart.values = []; axischart.labels = []; axischart.percentages = [];}},\n m(\"i.right.chevron.icon\"),anyo+1),\n ]),\n \n m('.ui.segment',\n m(\"h5.ui.large.centered.header\", { style: \"margin-top:10px\" }, \"Información de la hacienda local\"),\n m(\"div\", { id: 'tabla' }),\n axischart.values.length > 0 ? m(TablaGasto, {dataTabla}) : null,\n ),\n m(\".ui.segment\", { style: \"margin-top:25px\" }, [\n m(\"h5.ui.large.centered.header\", { style: \"margin-top:10px\" }, \"Gráficas interactivas\"),\n m(\"div\", { id: 'grafica' }),\n axischart.values.length > 0 ? m(Grafica, axischart) : null,\n ]),\n Object.keys(axischart.selected).length > 0 ? m(InteractiveSegment, axischart) : null,\n ]),\n ]) // m(Gastos)\n ]\n }\n }\n}", "title": "" }, { "docid": "5a4f4ba6f27844fc1abc32bedf3db60d", "score": "0.6337455", "text": "componentDidMount() {\n this.renderChart();\n }", "title": "" }, { "docid": "a84102593fb180c2394d824dcad84fb3", "score": "0.63326406", "text": "constructor(){\n let barWidth = 400;\n let barHeight = 300;\n let barPadding = 2;\n let barHolder = \"#chart\";\n\n //calling fetch data to import data\n this.fetchData();\n\n }", "title": "" }, { "docid": "e8a7aa2fee91c952273b924988ac1ea3", "score": "0.63159585", "text": "function showChart() {\n for (let i in charts) {\n if (!charts[i].shown && charts[i].element.getBoundingClientRect().top < window.innerHeight) {\n // This refreshes the animation\n new Chart(charts[i].element.getContext('2d'), charts[i].options);\n charts[i].shown = true;\n }\n }\n}", "title": "" }, { "docid": "f2377a6284efede2fa76e53b784f353f", "score": "0.6308204", "text": "updateCurrentChart() {\n if (this.currentNode) {\n this.barChart(this.currentNode)\n }\n }", "title": "" }, { "docid": "d48876fa5322d96ee4c047690764be18", "score": "0.630623", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Number');\n data.addColumn('number', 'temperature');\n data.addRows([\n ['January', -2.4],\n ['Feburary', 0.4],\n ['March', 5.7],\n ['April', 12.5],\n ['May', 17.8],\n ['June', 22.2],\n ['July', 24.9],\n ['August', 25.7],\n ['September', 21.2],\n ['October', 14.8],\n ['November', 7.2],\n ['December', 0.4]\n ]);\n\n // Set chart options\n var options = {\n width: 900,\n height: 600,\n title: '1981-2010 monthly average of temperature (Seoul)'\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "db70a99d6f868d704a463d594f68a9c1", "score": "0.6304063", "text": "function drawGraph()\n{\n nv.addGraph(function()\n {\n\t\tchart = nv.models.multiBarChart();\n chart.reduceXTicks(false);\n chart.multibar.stacked(true);\n\t\tchart.yAxis.tickFormat(d3.format('d')); \n\t\td3.select('#chart svg').datum(data).transition().duration(500).call(chart);\n\t\tnv.utils.windowResize(chart.update);\n\t}, function()\n {\n // Premièrement on ne selectionne que les 3 boutons short, medium et long haul\n d3.selectAll(\".nv-series\")[0][0].onclick = selectShortFlight;\n d3.selectAll(\".nv-series\")[0][1].onclick = selectMediumFlight;\n d3.selectAll(\".nv-series\")[0][2].onclick = selectLongFlight;\n \n //Added for managing clicks on bars \n chart.multibar.dispatch.on(\"elementClick\", function(e) \n {\n var position = e.pointIndex;\n console.log(e);\n refreshAirlinePanel(e.series.values[position].x);\n })\n\n sortGraphData();\n filterGraphDataByTotalOfRoutes(500, 1500);\n \n }\n ) \n}", "title": "" }, { "docid": "cf770e23bb0673e9876541bc2b032073", "score": "0.6272614", "text": "componentDidUpdate() {\n this.updateChart();\n }", "title": "" }, { "docid": "f11d004a51d9d0f2eeb971b84bff23d4", "score": "0.62713057", "text": "function drawBarChart(data, options, element){\n //Step 1: create a Canavs element on the page for future display of the bar Chart\n element = document.querySelector(element)\n var canvas = document.createElement(\"CANVAS\");\n element.appendChild(canvas);\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n canvas = createChartEssential(data, options, canvas);\n\n\n // Step 2: anaylyze the data - determine max bar height, determine scale of each data\n // find the max number in data, its height should equals to 80% of total chart height\n var maxIndex = findMax(data);\n // pair up the height of each bar in px with its value, based on its relative percentage to the max value\n var output = calculateBarHeight(data, maxIndex, options.chartHeight);\n\n // Step 3: configure options - add bar spacing based on the # of value\n var barWidth = getBarWidth(data.length, options.chartWidth, options.barSpacing);\n\n // Step 4: render each bar to html\n renderBar(output, barWidth, options, canvas);\n // Step 5: display bar properties\n chartAxes(output, options, barWidth, maxIndex, canvas);\n // Step 6: generate X-Y label\n generateLabel(options, canvas);\n}", "title": "" }, { "docid": "e3c07a201d385b7e65a778c0ea7bb613", "score": "0.6263582", "text": "function renderChart() {\n let productClicks = [];\n let productViews = [];\n let productNames = [];\n for (let i = 0; i < allProducts.length; i++) {\n productNames.push(allProducts[i].name);\n productClicks.push(allProducts[i].clicks);\n productViews.push(allProducts[i].views);\n }\n \n let chartObject = {\n type: 'bar',\n data: {\n labels: productNames,\n datasets: [{\n label: '# of Views',\n data: productViews,\n backgroundColor: 'green',\n borderColor: 'green',\n borderWidth: 1\n },\n {\n label: '# of Clicks',\n data: productClicks,\n backgroundColor: 'violet',\n borderColor: 'violet',\n borderWidth: 1\n \n }\n ]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n };\n let ctx = document.getElementById('myChart').getContext('2d');\n let myChart = new Chart(ctx, chartObject);\n \n}", "title": "" }, { "docid": "0a1a12e3054cc3831f4689d46c06b1f3", "score": "0.6259875", "text": "function drawChart(data)\n{\n console.log(data);\n //Invoke google's built in method to get data table object required by google.\n var chartData = google.visualization.arrayToDataTable(data);\n\n var options = {\n title: 'Total Product Sales',\n bars: 'horizontal', // Required for Material Bar Charts.\n chartArea: {'height': '90%'},\n legend: {'position': 'none'}\n };\n\n var chart = new google.visualization.BarChart(document.getElementById('chartDivTotalProductSales')); //chartDivNumberOfAvailableProducts chart_div\n chart.draw(chartData, options);\n}", "title": "" }, { "docid": "a174c4a6b275a7d8aeb1d1245b69c113", "score": "0.62431026", "text": "function showChart() {\n document.getElementById('chart').style.display = 'block';\n document.getElementById('stats').style.display = 'none';\n\tdocument.getElementById('history').style.display = 'block';\n\tgetHistory();\n\tloadGraph();\n}", "title": "" }, { "docid": "ab1b6e9b8ac3527c4aef90a183be3ed0", "score": "0.62387747", "text": "function generate_bar_charts()\n{\n var [fh,sh] = extract_bar_chart_data(csv_data,current_team,current_season);\n svg_fh.select(\".chart-title\").text(current_team + \" Season \" + current_season + \" First half\");\n svg_sh.select(\".chart-title\").text(current_team + \" Season \" + current_season + \" Second half\");\n update_stack_bar_chart(fh, canvas_fh, tooltip);\n update_stack_bar_chart(sh, canvas_sh, tooltip);\n}", "title": "" }, { "docid": "b60d172beb66accb82f10c32627d4c08", "score": "0.6227843", "text": "componentDidMount() {\n this.drawChart()\n }", "title": "" }, { "docid": "5360cb5e972dc3ddce13216e5ac9d6c5", "score": "0.6223628", "text": "function drawChart() {\n google.charts.load('current', {'packages':['bar']});\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Năm');\n data.addColumn('number', 'Thu');\n data.addColumn('number', 'Chi');\n data.addColumn('number', 'Thực thu');\n $.each(response, function(index, element){\n data.addRow([element.month.toString(), element.total_take, element.total_expenditure, element.total_receive]); \n }); \n\n var options = {\n chart: {\n title: 'Thống kê thu chi',\n subtitle: 'Thu, Chi, Thực thu năm' //+ year; \n },\n backgroundColor: 'none',\n chartArea:{\n backgroundColor: 'none'\n }\n };\n\n //var chart = new google.visualization.PieChart(document.getElementById('columnchart_material'));//new google.charts.Bar(document.getElementById('columnchart_material'));\n //chart.draw(data, options);\n var chart = new google.charts.Bar(document.getElementById('columnchart_material'));\n chart.draw(data, google.charts.Bar.convertOptions(options));\n \n }\n }", "title": "" }, { "docid": "a48f612ead291ab6557cd11e64148ba7", "score": "0.6223247", "text": "function showChart(){\n var labels = [];\n var voteData = [];\n var colors = [];\n\n for (var i = 0; i < allItems.length; i++){\n allItems[i].pct = Math.round((allItems[i].timesClicked / allItems[i].timesShown) * 100);\n }\n\n allItems.sort(function(a,b){\n return b.pct - a.pct;\n });\n\n for ( i = 0; i < allItems.length; i++){\n labels.push(allItems[i].itemName);\n voteData.push(allItems[i].pct);\n\n var randomColor = '#' + Math.floor(Math.random() * 16777215).toString(16);\n colors.push(randomColor);\n }\n //look from here******\n var context = document.getElementById('chartBar').getContext('2d');\n new Chart(context, {\n type: 'horizontalBar',\n data: {\n labels: labels,\n datasets: [\n {\n label: 'Popularity (% of clicks)',\n data: voteData,\n backgroundColor: colors,\n borderWidth: 4\n },\n ],\n },\n options: {\n responsive: false,\n maintainAspectRatio: true,\n scales: {\n yAxes: [\n {\n ticks: {\n beginAtZero: true,\n fontColor: 'black'\n },\n },\n ],\n },\n },\n });\n}", "title": "" }, { "docid": "fa769bc63bb80e637c2d38a08a7f679f", "score": "0.6209742", "text": "componentDidMount() {\n this.renderCharts();\n }", "title": "" }, { "docid": "a6704949caf181cba8c51b4a9c086828", "score": "0.6189904", "text": "function drawChart() {\n fetch('/coronavirus-data').then(response => response.json())\n .then((coronavirusData) => {\n const data = new google.visualization.DataTable();\n data.addColumn('string', 'Industry');\n data.addColumn('number', 'Percent change in time spent per user session');\n Object.keys(coronavirusData).forEach((industry) => {\n data.addRow([industry, coronavirusData[industry]]);\n });\n\n const options = {\n 'title': 'Coronavirus Impact on Time Spent Per Online User Session in Selected Industries Worldwide in Week Ending April 26, 2020',\n 'width':600,\n 'height':500\n };\n\n const chart = new google.visualization.BarChart(\n document.getElementById('chart-container'));\n chart.draw(data, options);\n });\n}", "title": "" }, { "docid": "0f95fdd68b59bfe2555992365be4137d", "score": "0.61824757", "text": "function init() {\n //first the bar chart (for the top ten results) \n data_bar = [{\n x: data_sample[2],\n y: y, \n type:\"bar\",\n text: data_sample[3],\n orientation: \"h\" \n }];\n var layout_bar = {\n title: \"Top 10 Bacteria Cultures Found\",\n };\n var CHART_bar = d3.selectAll(\"#bar\").node();\n Plotly.newPlot(CHART_bar, data_bar,layout_bar);\n }", "title": "" }, { "docid": "55f50f55dc5e33d0a87c0d975e56c983", "score": "0.6165558", "text": "function init() {\n var data = [{\n values: sample_values,\n labels: slicedData,\n text: otu_labels,\n type: \"bar\"\n }];\n \n var layout = {\n height: 600,\n width: 800\n };\n \n Plotly.newPlot(\"bar\", data, layout);\n }", "title": "" }, { "docid": "bef9e0b196fce0e82db092d554d7f18a", "score": "0.6163595", "text": "drawChart() {\n chart.create('#fetch-refresh-widget-component', {\n refreshTime: refreshRates.results / 1000,\n width: 160,\n height: 30,\n originOffset: -15,\n });\n }", "title": "" }, { "docid": "13a4d41a787e4f17c8ed2b28cdc71465", "score": "0.6158628", "text": "function chart() {\n let ctx = document.getElementById('myChart').getContext('2d');\n ctx.canvas.width = '1340';\n ctx.canvas.height = '400';\n let myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: productsItem,\n datasets: [{\n data: productsVotes,\n label: '# of Votes',\n backgroundColor: [\n 'rgb(0, 0, 0)'\n ],\n borderColor: [\n 'rgb(0, 0, 0)'\n ],\n borderWidth: 1\n }, {\n data: productsShown,\n label: '# of shown',\n backgroundColor: [\n 'rgb(255, 255, 0)'\n ],\n borderColor: [\n 'rgb(255, 255, 0)'\n\n ]\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n });\n}", "title": "" }, { "docid": "0b805c33e01f8eb4f499d50127b56a44", "score": "0.6154578", "text": "function displayChart(){\n\t\t stxx.setPeriodicityV2(1, \"day\");\n\t\t stxx.newChart(\"SPY\");\n\t\t}", "title": "" }, { "docid": "fed8149e566454c39dfd27a1407ae6ca", "score": "0.6142941", "text": "function renderDistributionChart(chartElements){\n let vacChartObject = document.getElementById('distributionChart').getContext('2d');\n\n let chart = new Chart(vacChartObject, {\n type: 'bar',\n data: {\n datasets: [{\n data: chartElements.values,\n borderWidth: 0,\n backgroundColor: \"#33AEEF\",\n }],\n labels: chartElements.labels\n },\n options: {\n legend: false,\n responsive: true,\n maintainAspectRatio: false,\n }\n });\n}", "title": "" }, { "docid": "cb69b2d869c4f9742bb6c8510ee1b03b", "score": "0.61278516", "text": "function barChart() {\n var placeOfChart = document.getElementById('chart').getContext('2d');\n var counterArray = [];\n var shownArray = [];\n for (var i = 0; i < productObject.length; i++) {\n counterArray.push(productObject[i].counter);\n shownArray.push(productObject[i].shown);\n }\n var chart = new Chart(placeOfChart, {\n type: 'bar',\n data: {\n labels: imageName,\n datasets: [{\n label: 'Number of view',\n backgroundColor: 'rgb(255, 99, 132)',\n borderColor: 'rgb(255, 99, 132)',\n data: shownArray\n }\n , {\n label: 'Number of votes',\n backgroundColor: 'rgb(155, 99, 132)',\n borderColor: 'rgb(155, 99, 132)',\n data: counterArray\n }\n ]\n },\n options: {}\n });\n}", "title": "" }, { "docid": "602709836bf54d4d385fd94e7ea02ba4", "score": "0.6109006", "text": "function graph_init() {\n mychart = new Chart(document.getElementById(\"bar-chart\"), {\n type: 'bar',\n data: {\n labels: default_labels,\n datasets: []\n },\n options: {\n title: {\n display: true,\n text: \"Historical Load vs. Temperature vs. Humidity\",\n fontSize: 30 \n },\n legend:{\n labels: {\n fontSize: 18\n }\n },\n scales: {\n xAxes: [{\n scaleLabel: {\n fontSize: 20,\n display:true,\n labelString: \"Date\"\n }\n }],\n yAxes: [\n {\n id: 'A',\n type: 'linear',\n position: 'left',\n scaleLabel: {\n fontSize: 20,\n display:true,\n labelString: \"Historical Load (kW)\"\n }\n },\n {\n id: 'B',\n type: 'linear',\n position: 'right',\n scaleLabel: {\n fontSize: 20,\n display:true,\n labelString: \"Temperature (Degree C)\",\n }\n },\n {\n id: 'C',\n type: 'linear',\n position: 'right',\n scaleLabel: {\n fontSize: 20,\n display:true,\n labelString: \"Humidity (%)\"\n }\n },\n ]\n } \n }\n });\n}", "title": "" }, { "docid": "b2a5184fdf18a13cd9689ff08118ca32", "score": "0.60943997", "text": "function renderChart(){\n var ctx = document.getElementById('myChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: ['Bag', 'Banana', 'Bathroom', 'Boots', 'Breakfast', 'Bubblegum','Chair','Cthulhu','Dog-duck','Dragon','Pen','Pet-sweep','Scissors','Shark','Sweep','Tauntaun','Unicorn','Water-can','Wine-glass'],\n datasets: [{\n label: '# of Votes',\n data: [Product.allProducts[0].votes,Product.allProducts[1].votes,Product.allProducts[2].votes,Product.allProducts[3].votes,Product.allProducts[4].votes,Product.allProducts[5].votes,Product.allProducts[6].votes,Product.allProducts[7].votes,Product.allProducts[8].votes,Product.allProducts[9].votes,Product.allProducts[10].votes,Product.allProducts[11].votes,Product.allProducts[12].votes,Product.allProducts[13].votes,Product.allProducts[14].votes,Product.allProducts[15].votes,Product.allProducts[16].votes,Product.allProducts[17].votes,Product.allProducts[18].votes],\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n },\n options: {\n scales: {\n y: {\n beginAtZero: true\n }\n }\n }\n });\n}", "title": "" }, { "docid": "e61047900042c6afd8d6d25fc014dba9", "score": "0.6089964", "text": "function onSuccess(data) {\n displayHistTrendChart(data);\n stopSpinner();\n\n}", "title": "" }, { "docid": "a3aa6805b640a198d1cea2fa80fe5668", "score": "0.60866654", "text": "renderChart() {\n\n\t\t// Lazy rendering of the Chart.\n\t\tif (!$('#chart-candidate-' + this.model.id).has('svg').length) {\n\t\t\tvar values = this.model.get('spiderChart');\n\t\t\tif (values.length > 0) {\n\t\t\t\tthis.drawChart(this.model.id, values);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "851d9737ef843c90c52e700794b23849", "score": "0.60837334", "text": "componentDidMount(){\n //check if d3 is already loaded, if not build and load d3.js script\n if( !(typeof(d3)==='object') ){\n //create script element\n const d3_script = document.createElement('script');\n\n //add script attributes\n d3_script.onload = (response) => (this.load(response));\n d3_script.onerror = (response) => (this.error(response));\n d3_script.src = \"https://d3js.org/d3.v4.min.js\";\n \n //load script directly on to DOM\n document.body.appendChild(d3_script);\n }else{\n this.loadBarChart(this.props.data);\n }\n }", "title": "" }, { "docid": "e7de0e81b87e1bdda1bf47ad079eea93", "score": "0.60546845", "text": "function renderResults() {\n calculateResults();\n\n //Hide Questions\n questionPage.classList.add(\"d-none\");\n //Show Result Canvas\n resultCard.classList.remove(\"d-none\");\n //Show google form link button\n //sendButton.classList.remove(\"d-none\");\n\n //Update bar graph with current results\n bar.data.datasets[0].data = [\n control.naranja,\n control.oro,\n control.azul,\n control.verde,\n ];\n\n bar.update();\n}", "title": "" }, { "docid": "97400a367bd8ddac1ea50104cdbd77b5", "score": "0.6052838", "text": "function xpChartistjsWidgetBar() {\n\t\tnew Chartist.Bar('#xp-chartist-widget-bar', {\n\t\t labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n\n\t\t series: [\n\t\t\t[5, 4, 3, 7, 5, 10, 3]\n\t\t ]\n\t\t}, {\n\t\t axisX: {\n\t\t\tposition: 'end',\n\t\t\tshowGrid: false\n\t\t },\n\t\t axisY: {\n\t\t\tposition: 'start',\n\t\t\tshowLabel: false,\n\t\t\tshowGrid: false\n\t\t },\n\t\t plugins: [\n\t\t\tChartist.plugins.tooltip()\n\t\t ]\n\t\t}).on('draw', function(data) {\n\t\t if(data.type === 'bar') {\n\t\t\tdata.element.attr({\n\t\t\t style: 'stroke-width: 7px;'\n\t\t\t});\n\t\t }\n\t\t});\n\t}", "title": "" }, { "docid": "5ee30a4fe110e153532fe72518cc5afe", "score": "0.604981", "text": "componentDidMount() {\n this.createChart();\n this.updateChart();\n }", "title": "" }, { "docid": "1c321b417d583459ea9c1e44fd20f1ee", "score": "0.60439396", "text": "function draw(){\n // bar graph function here\n}", "title": "" }, { "docid": "844cdc11961f0e52e8f3761442d0aff1", "score": "0.60400975", "text": "function renderChart() {\n requestAnimationFrame(renderChart);\n\n // Copy frequency data to frequencyData array.\n analyser.getByteFrequencyData(frequencyData);\n\n // Update d3 chart with new data.\n svg.selectAll('rect')\n .data(frequencyData)\n .attr('y', function(d) {\n return svgHeight - d;\n })\n .attr('height', function(d) {\n return (d+lec);\n })\n .attr('fill',colors)\n }", "title": "" }, { "docid": "dcb4c2c5e19df73dbd29f7ad9db9dc0d", "score": "0.6039636", "text": "function render3() {\n\n for (var i = 0; i < Products.all.length; i++) {\n //console.log(Products.all[i])\n var contct = Products.all[i];\n names.push(contct.name);\n cliccks.push(contct.clicks);\n votes.push(contct.views);\n\n }\n\n var ctx = document.getElementById('myChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: names,\n datasets: [{\n label: '# of clicks',\n data: cliccks,\n\n backgroundColor:\n 'rgba(255, 99, 132, 0.2)',\n\n\n borderColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n\n borderWidth: 1\n },\n {\n label: '# views',\n data: votes,\n\n backgroundColor:\n 'rgba(40, 99, 132, 0.2)',\n\n\n borderColor: [\n 'rgba(150, 30, 40, 1)',\n 'rgba(30, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n\n borderWidth: 1\n }]\n\n\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n })\n}", "title": "" }, { "docid": "40a10232fedf909e3dda9c0da84fb443", "score": "0.60365844", "text": "function drawBarChart(raw_bar_data) {\n // Create and populate the data table.\n console.log(\"hello\")\n var data = google.visualization.arrayToDataTable(raw_bar_data['bar']);\n\n // Create and draw the visualization.\n new google.visualization.ColumnChart(document.getElementById('barchart')).\n draw(data,\n {title:\"Energy Usage in a Month\",\n backgroundColor: 'transparent',\n colors: ['#680e8e', '#8217b2', '#aa00f7', '#b154d8', '#c378e2', '#b98ccc'], //goes from dark to light\n width:600, height:400,\n vAxis: {title: \"Energy (KW)\"}, isStacked: true,\n hAxis: {title: \"Month\"}}\n );\n\n //TIPS\n //gets the most recent total for the bar graph\n let mostRecentTotal =0;\n for (i = 1; i < raw_bar_data['bar'][1].length-1; i++){\n mostRecentTotal += raw_bar_data['bar'][raw_bar_data['bar'].length-1][i];\n }\n //gets the total of the second most recent input\n let previousTotal = 0;\n for (i = 1; i < raw_bar_data['bar'][1].length-1; i++){\n previousTotal += raw_bar_data['bar'][raw_bar_data['bar'].length-2][i];\n }\n\n if (mostRecentTotal > previousTotal) {\n //states difference between most recent and previous total\n document.getElementById(\"bardiff\").innerHTML= \"You have used \" + (mostRecentTotal - previousTotal) +\n \" more Kilowatts of energy than last month. Oh no!\"\n } else if (mostRecentTotal < previousTotal) {\n document.getElementById(\"bardiff\").innerHTML= \"You have used \" + (previousTotal - mostRecentTotal) + \" less Kilowatts of energy than last month! Woohoo!\"\n }\n //document.getElementById(\"bartips\").innerHTML= mostRecentTotal + \", \" + previousTotal;\n}", "title": "" }, { "docid": "a84784fc8a30a5947f4755832f8b84e3", "score": "0.6033512", "text": "function renderChart() {\n let productNames = [];\n let productViews = [];\n let productClicks = [];\n for (let i = 0; i < allProducts.length; i++) {\n productNames.push(allProducts[i].name);\n productViews.push(allProducts[i].numberOfViews);\n productClicks.push(allProducts[i].numberOfClicks);\n }\n console.log('productNames: ', productNames);\n console.log('productViews', productViews);\n console.log('productClicks', productClicks);\n var chartObject = {\n type: 'bar',\n data: {\n labels: productNames,\n datasets: [{\n label: 'Views',\n data: productViews,\n backgroundColor: 'rgba(54, 162, 235, 0.2)',\n borderColor: 'rgba(54, 162, 235, 1)',\n borderWidth: 3\n },\n {\n label: 'Clicks',\n data: productClicks,\n backgroundColor: 'rgba(153, 102, 255, 0.2)',\n borderColor: 'rgba(153, 102, 255, 1)',\n borderWidth: 3\n }]\n },\n responsive: false,\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n };\n\n let ctx = document.getElementById('myChart').getContext('2d');\n new Chart(ctx, chartObject);\n}", "title": "" }, { "docid": "b04c475720b7b29257a1d1b042c63b9b", "score": "0.6031426", "text": "function showChartsView() {\n //hide the display budget section\n hideAll();\n occupyWindow(\"#displayBudgetCharts\");\n //show the charts section\n $('#displayBudgetCharts').css('display','block');\n //populate chart stats Info\n populateChartStatsInfo();\n //get plot values from table \n // use db call that calls back viewBudgetChart function to plot values in chart\n showDateBudgetChart();\n }", "title": "" }, { "docid": "b48c0ded729bbbe98a592e7d0f7b1100", "score": "0.60255474", "text": "function drawBarChart(data, options, element) {\n // Create a unique ID to complement classes\n const uID = element.replace('#', '');\n // Create main html layout\n setMainLayout(uID, element, options.title);\n // Set total amount of bars\n const barAmount = Object.keys(data).length;\n // Get max value received\n const maxValue = getMaxValue(data);\n // Assign values to Y axis based upon total amount of bars\n const yValues = getYValues(barAmount, maxValue);\n // Set grid of bars and labels\n setGrid(uID, barAmount);\n // Create the chart including: yValues, xValues and bars\n createChart(uID, data, barAmount, yValues, maxValue);\n // Set options to the created Chart\n setOptions(uID, barAmount, options);\n // Include animation \"barber-shop\" like\n animateInnerBar(uID);\n // Apply all static CSS to dynamic HTML using object of Styles (chartStyles)\n Object.keys(chartStyles).map((x) => {\n $( x === '*' ? x : '.' + uID + x).css(chartStyles[x]);\n });\n // Apply indicators box if present\n setIndicators(uID, options.indicators);\n}", "title": "" }, { "docid": "5522728395edf17e334bd4766914afa3", "score": "0.6003862", "text": "function renderChart() {\n requestAnimationFrame(renderChart);\n\n // Copy frequency data to frequencyData array.\n analyser.getByteFrequencyData(frequencyData);\n\n // Update d3 chart with new data.\n svg.selectAll('rect')\n .data(frequencyData)\n .attr('y', function(d) {\n return svgHeight - d;\n })\n .attr('height', function(d) {\n return d;\n })\n .attr('fill', function(d) {\n return 'rgb(' + d + ', 60 , 115)';\n });\n }", "title": "" }, { "docid": "90b715f57761cd4ea27ffb3fc4cf63bb", "score": "0.5999451", "text": "async initializeChart() {\n await require('chart.js');\n const ctx = this.template\n .querySelector('canvas.chart')\n .getContext('2d');\n this.chart = new window.Chart(ctx, this.chartConfig);\n this.chartInitialized = true;\n }", "title": "" }, { "docid": "04292b5dc786102f8a426a3dcd462e8c", "score": "0.5998588", "text": "render() {\n // this.renderChart()\n return (\n <div>\n <canvas\n id=\"myChart\"\n ref={this.chartRef}\n />\n </div>\n )\n }", "title": "" }, { "docid": "04292b5dc786102f8a426a3dcd462e8c", "score": "0.5998588", "text": "render() {\n // this.renderChart()\n return (\n <div>\n <canvas\n id=\"myChart\"\n ref={this.chartRef}\n />\n </div>\n )\n }", "title": "" }, { "docid": "d4fc6bcf8dde00786f908349021dda79", "score": "0.5997857", "text": "updateChart() {\n\t\tthis.chart.updateChart();\n\t}", "title": "" }, { "docid": "61499d19cb47f42c8d1b6f9421c41bb0", "score": "0.5996671", "text": "function renderChart() {\n requestAnimationFrame(renderChart);\n\n // Copy frequency data to frequencyData array.\n analyser.getByteFrequencyData(frequencyData);\n\n // Update d3 chart with new data.\n svg.selectAll('rect')\n .data(frequencyData)\n .attr('y', function(d) {\n return svgHeight - d;\n })\n .attr('height', function(d) {\n return d;\n })\n .attr('fill', function(d) {\n return 'rgb(0, 0, ' + d + ')';\n });\n }", "title": "" }, { "docid": "0f877abc0eb4efb3aca9a70368028dbc", "score": "0.5987253", "text": "applyChart() {\n\t\tif(this.validateOnApplyStatistics()){\n\t\t\tlet filterObj = new FilterData();\n\t\t\tlet viewObj = new EducationView();\n\t\t\tlet cs = new ChartStore();\n\t\t\tviewObj.cleanUpSpace();\n\t\t\tlet filteredConditiontionsMap = filterObj.getAllFilteredConditions();\n\t\t\tlet map = filterObj.preProcessFilter(filteredConditiontionsMap);\n\t\t\tlet chartsSelected = this.getChartSelections();\n\t\t\tlet labels = [];\n\t\t\tlet vals = [];\n\t\t\tfor (let label of map.keys()){\n\t\t\t\tlabels.push(label);\n\t\t\t\tvals.push(map.get(label));\n\t\t\t}\n\t\t\t\n\t\t\tfor(let i =0;i<chartsSelected.length;i++){\n\t\t\t\tdocument.getElementById('parentChart').style.display = \"block\";\n\t\t\t\tlet chart = null;\n\t\t\t\tlet isBackgroundColorRequired = true;\n\t\t\t\tif(chartsSelected[i] == \"Bar Chart\"){\n\t\t\t\t\tviewObj.createCanvasElement(\"barchartcanvas\");\n\t\t\t\t\tlet barChartDecorator = new BarChartDecorator();\n\t\t\t\t\tchart = cs.orderChart(\"bar\");\n\t\t\t\t\tchart.setLabelAndData(labels,vals);\n\t\t\t\t\tbarChartDecorator.applyBackgroundColor(chart);\n\t\t\t\t\tbarChartDecorator.applyBorderColor(chart);\n\t\t\t\t} else if(chartsSelected[i] == \"Line Chart\"){\n\t\t\t\t\tlet lineChartDecorator = new LineChartDecorator();\n\t\t\t\t\tviewObj.createCanvasElement(\"linechartcanvas\");\n\n\t\t\t\t\tchart = cs.orderChart(\"line\");\n\t\t\t\t\tchart.setLabelAndData(labels,vals);\n\t\t\t\t\tlineChartDecorator.applyBorderColor(chart);\n\t\t\t\t} else if(chartsSelected[i] == \"Pie Chart\"){\n\t\t\t\t\tlet pieChartDecorator = new PieChartDecorator();\n\t\t\t\t\tviewObj.createCanvasElement(\"piechartcanvas\");\n\t\t\t\t\tchart = cs.orderChart(\"pie\");\n\t\t\t\t\tchart.setLabelAndData(labels,vals); \n\t\t\t\t\tpieChartDecorator.applyBackgroundColor(chart);\n\t\t\t\t\tpieChartDecorator.applyBorderColor(chart);\n\t\t\t\t} else if(chartsSelected[i] == \"Stacked Chart\"){\n\t\t\t\t\tviewObj.createCanvasElement(\"stackedchartcanvas\");\n\t\t\t\t\tlet stackedChartCanvasEl = document.getElementById('stackedchartcanvas');\n\t\t\t\t\tlet brEl = document.createElement('br');\n\t\t\t\t\tdocument.getElementById('childChart').insertBefore(brEl,stackedChartCanvasEl);\n\t\t\t\t\tlet stackedChart = new StackedChart();\n\t\t\t\t\tstackedChart.plot(labels,vals);\t\t\t\n\t\t\t\t} else if(chartsSelected[i] == \"Pivot Chart\"){\n\t\t\t\t\tviewObj.createCanvasElement(\"pivotchartcanvas\");\n\t\t\t\t\tlet pivotChart = new PivotChart();\n\t\t\t\t\tpivotChart.plot(labels,vals);\t\t\t\n\t\t\t\t}\n\t\t\t\tchart.plot();\n\t\t\t}\n\t\t} else{\n\t\t\tdocument.getElementById('invalid-msg').hidden = false;\n\t\t}\n\n\t}", "title": "" }, { "docid": "ee69785e611ab3cdbc2840eace3e5975", "score": "0.59859955", "text": "function initBar() {\n var trace1 = {\n x: xValuesReverse,\n y: yValuesReverse,\n text: otu_labels_reversed,\n type: \"bar\",\n orientation: 'h'\n };\n\n //create an array from trace1 \n var data = [trace1];\n\n //layout gives the chart a title\n var layout = {\n title: \"Belly Button Data for Subject 940\",\n };\n //call plotly to create a new chart in the specified div and with the specified data and layout\n Plotly.newPlot(\"bar\", data, layout);\n}", "title": "" }, { "docid": "c10aa86afc611e08e499fa6f21ecbce0", "score": "0.59837055", "text": "function renderChart() {\n requestAnimationFrame(renderChart);\n \n // Copy frequency data to frequencyData array.\n analyser.getByteFrequencyData(frequencyData);\n \n // Update d3 chart with new data.\n svg.selectAll('rect')\n .data(frequencyData)\n .attr('y', function(d) {\n return svgHeight - d;\n })\n .attr('height', function(d) {\n return d;\n })\n .attr('fill', function() {\n return 'rgb(91,192,222)';\n });\n }", "title": "" }, { "docid": "ca0b3427403ea241cadd0229045aac2f", "score": "0.598235", "text": "function drawChart() {\n\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {\n 'title': 'How Much Pizza I Ate Last Night',\n 'width': 400,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "db6fb4576fbf00ce224323a4edcbd076", "score": "0.5980524", "text": "function displayBarChartGivenDataAndLabels(xAxisLabels, data, chartName) {\n\n //If the chart already contains data on it, destroy it.\n if(crimeFrequencyByYearChart != null) {\n crimeFrequencyByYearChart.destroy();\n }\n\n //construct a new Chart object on the canvas.\n var ctx = document.getElementById('crimes-by-year-canvas').getContext('2d');\n crimeFrequencyByYearChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: xAxisLabels,\n datasets: [{\n label: chartName,\n data: data,\n backgroundColor: 'rgba(255, 99, 132, 0.2)',\n borderColor: 'rgba(255, 99, 132, 1)',\n borderWidth: 0.5\n }]\n },\n options: {\n responsive: true,\n maintainAspectRation: true,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n\n}", "title": "" }, { "docid": "3282c4b31b581b3de94c619907c0df3e", "score": "0.5980139", "text": "componentDidMount() {\n // Extend Highcharts with modules\n if (this.props.modules) {\n this.props.modules.forEach(function (module) {\n module(Highcharts);\n });\n }\n // Set container which the chart should render to.\n this.chart = new Highcharts[this.props.type || \"Chart\"](\n this.props.container,\n this.props.options\n );\n this.updateChart(this.props.groups);\n }", "title": "" }, { "docid": "c0241b2613ec09a648480bc7f1b1c77e", "score": "0.59757394", "text": "function render_barOpgewektheid() {\n var plotBar = hgiBar().mapping(['name','value']).errorMapping('sd').freqMapping('frequency').xDomain([0,100]).addError(true).addFrequencies(true).xLabel('Opgewektheid');\n d3.select('#barOpgewektheid').datum(data_opgewektheid).call(plotBar);\n}", "title": "" }, { "docid": "de84d5840aab1f576ee6cfbf4f3c6616", "score": "0.5964041", "text": "function displayCharts(){\n toggleFocus(document.getElementById('menu-chart'));\n\n /* Pie Chart */\n var pieData = google.visualization.arrayToDataTable(getPieChartArray());\n\n var pieOptions = {\n title: 'Subreddit Post Frequency',\n backgroundColor: '#f9f9f9'\n };\n\n var pieChart = new google.visualization.PieChart(document.getElementById('pie-chart'));\n pieChart.draw(pieData, pieOptions);\n \n /* Column Chart */\n var columnData = google.visualization.arrayToDataTable(getChartArray('column'));\n\n var columnOptions = {\n title: 'Post Activity by Type (last 12 months)',\n hAxis: {title: '', titleTextStyle: {color: 'red'}},\n backgroundColor: '#f9f9f9'\n };\n\n var columnChart = new google.visualization.ColumnChart(document.getElementById('column-chart'));\n columnChart.draw(columnData, columnOptions);\n \n /* Area Chart */\n var areaData = google.visualization.arrayToDataTable(getChartArray('area'));\n\n var areaOptions = {\n title: 'Total Post Activity (last 12 months)',\n hAxis: {title: '', titleTextStyle: {color: 'red'}},\n backgroundColor: '#f9f9f9'\n };\n\n var areaChart = new google.visualization.AreaChart(document.getElementById('area-chart'));\n areaChart.draw(areaData, areaOptions);\n}", "title": "" }, { "docid": "4bebde5081d4f046d68d066fe8fdb78e", "score": "0.595815", "text": "function barchart(){ // Barchart functions\n calculate(); //auto calculator\n var ctx = document.getElementById('myChart'); //declarations\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: ['100 Level', '200 Level', '300 Level', '400 Level'], // sections in the chart\n datasets: [{\n label: '# of Ratio',\n data: [csclevel1.value/5, csclevel2.value/5, csclevel3.value/5, csclevel4.value/5], // calculations to determine the ratio\n backgroundColor: [ // color of bars\n 'blue',\n 'red',\n 'black',\n 'purple',\n ],\n borderColor: [\n 'blue',\n 'red',\n 'black',\n 'purple',\n ],\n borderWidth: 3\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true // some major functions\n }\n }]\n }\n }\n });\n}", "title": "" }, { "docid": "0da563dcc303371219d3537c32d963c1", "score": "0.5958058", "text": "function display(data) {\n myBubbleChart(\"#vis\", data);\n }", "title": "" }, { "docid": "4480dcc90008bef34b876ac362ae9f4e", "score": "0.59563476", "text": "function displayBarChart(arr, numOfElems, maxVal) {\n const vizArea = document.getElementById('viz-area');\n\n for (let i = 0; i < numOfElems; i++) {\n const barGroup = document.createElement('div');\n barGroup.classList.add('bar-group');\n\n const blank = document.createElement('div');\n blank.style.height = maxVal+\"px\";\n blank.classList.add('blank');\n barGroup.appendChild(blank);\n\n const bar = document.createElement('div');\n bar.classList.add('bar');\n bar.style.height = arr[i]+\"px\";\n barGroup.appendChild(bar);\n\n vizArea.appendChild(barGroup);\n }\n}", "title": "" }, { "docid": "e301f5e7bf94f98ef31dcedbacabe382", "score": "0.5952772", "text": "render() { \n \n \n return (\n <ResponsiveContainer width=\"100%\" height={300}>\n <BarChart\n data={this.props.barData}\n margin={{\n top: 20, right: 30, left: 20, bottom: 5,\n }}\n >\n <CartesianGrid strokeDasharray=\"3 3\" />\n <XAxis dataKey=\"name\" />\n <YAxis />\n <Tooltip />\n <Legend />\n \n <Bar dataKey=\"num\" stackId=\"a\" fill=\"#82ca9d\" />\n </BarChart>\n </ResponsiveContainer>\n );\n }", "title": "" }, { "docid": "ba63a41be3392dbd6ab8e87e9294fc49", "score": "0.59491175", "text": "function updateCharts() {\n domCharts.each(render);\n}", "title": "" }, { "docid": "cc81cd62d914f701583449cab014ef67", "score": "0.5947783", "text": "renderChart() {\n // There is nothing to do if the element hasn't been inserted yet\n if (!this.element) return;\n\n // First, create the axes to get the dimensions of the resulting\n // svg elements\n this.mountD3Elements();\n\n run.next(() => {\n // Then, recompute anything that depends on the dimensions\n // on the dimensions of the axes elements\n this.notifyPropertyChange('xAxisHeight');\n this.notifyPropertyChange('yAxisWidth');\n\n // Since each axis depends on the dimension of the other\n // axis, the axes themselves are recomputed and need to\n // be re-rendered.\n this.mountD3Elements();\n if (this.get('isActive')) {\n this.updateActiveDatum(this.get('latestMouseX'));\n }\n });\n }", "title": "" }, { "docid": "2259369a7e2f30b8160e54c954920f12", "score": "0.5944829", "text": "function render_barTekortSchieten() {\n var plotBar = hgiBar().mapping(['name','value']).errorMapping('sd').freqMapping('frequency').xDomain([0,100]).addError(true).addFrequencies(true).xLabel('Ik heb het gevoel tekort te schieten');\n d3.select('#barTekortSchieten').datum(data_tekort_schieten).call(plotBar);\n}", "title": "" }, { "docid": "9525f89323a5ddbad88ededbf9635362", "score": "0.59436274", "text": "function renderSelectionChart() {\n //access the canvas element from the DOM using var\n var context = document.getElementById('results-chart').getContext('2d');\n\n new Chart(context, {\n type: 'bar',\n data: {\n labels: productNamesArray,\n datasets: [{\n label: 'Product Selections',\n data: imageSelection,\n backgroundColor: arrayOfColors,\n borderColor: arrayOfAccentColors,\n borderWidth: 0,\n hoverBorderWidth: 7,\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true,\n stepSize: 1,\n }\n }],\n xAxes: [{\n ticks: {\n autoSkip: false,\n }\n }]\n }\n }\n });\n}", "title": "" }, { "docid": "d32acab8a9d314ab2e0cd5a4c107e777", "score": "0.59333396", "text": "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "title": "" }, { "docid": "d32acab8a9d314ab2e0cd5a4c107e777", "score": "0.59333396", "text": "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "title": "" }, { "docid": "d32acab8a9d314ab2e0cd5a4c107e777", "score": "0.59333396", "text": "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "title": "" }, { "docid": "881ff53e425bf870949fd75f7685fab1", "score": "0.5928019", "text": "function drawChart() {\n drawCommitTimeBarChart();\n drawPushEventPieChart();\n }", "title": "" }, { "docid": "2d6f0b2ac3eea69544d251dc9bde7209", "score": "0.5920324", "text": "function update() {\n // Update bar chart\n updateBar();\n\n // Update line chart only if it has been initialized\n if (isInitLine){\n updateLine();\n }\n}", "title": "" }, { "docid": "dc0add646c91f6d3df6b48700e81eba3", "score": "0.59140486", "text": "function showChart() {\n $(\"canvas#myChart\").remove();\ndocument.getElementById('graph-container').innerHTML = '<canvas id=\"myChart\" class=\"animated fadeIn\" height=\"150\"></canvas>';\n\tvar d = new Date();\n\tvar n = d.getDay();\n\tvar dayList = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\tvar dropdown = document.getElementById(\"StationIName\");\n\tvar index = dropdown.selectedIndex;\n\tvar stationName = dropdown.options[index].text;\n\tvar stationList = [];\n\t$.getJSON(\"json\", function(data) {\n\t\tfor (i = 0; i < data.length; i++) {\n\t\t\tif (stationName == data[i][0] && dayList[n] == data[i][1]) {\n\t\t\t\tstationList.push(data[i])\n\t\t\t}\n\t\t};\n\t\tvar data = stationList.map(function(e) {\n\t\t\treturn e[4];\n\t\t});\n\t\tvar labels = stationList.map(function(e) {\n\t\t\treturn e[2];\n\t\t})\n var ctx = document.getElementById('myChart').getContext('2d');\n\t\tvar chart = new Chart(ctx, {\n\t\t\t// The type of chart we want to create\n\t\t\ttype: 'bar',\n\t\t\t// The data for our dataset\n\t\t\tdata: {\n\t\t\t\tlabels: labels,\n\t\t\t\tdatasets: [{\n\t\t\t\t\tlabel: \"Bike Availability\",\n\t\t\t\t\tbackgroundColor: 'rgba(42, 109, 252, 0.9)',\n\t\t\t\t\tborderColor: 'rgb(3, 70, 214)',\n\t\t\t\t\tdata: data\n\t\t\t\t}]\n\t\t\t},\n\t\t\t// Configuration options go here\n\t\t\toptions : {\n scales: {\n xAxes: [{ scaleLabel: {\n display: true, \n labelString: 'Hours in day'\n }}],\n yAxes: [{\n scaleLabel: {\n display: true,\n labelString: 'Average Available Bikes'\n }\n }],\n }\n }\n\t\t});\n\t});\n}", "title": "" }, { "docid": "313602f3c753764c041f9596c602fce8", "score": "0.5912072", "text": "function renderCharts(){\n // Render percentage progress chart\n const percentageProgress = calculatePercentageProgress();\n renderProgressChart(percentageProgress);\n\n // Render vaccines distribution chart\n const vaccinesDistribution = calculateVaccinesDistribution();\n renderDistributionChart(vaccinesDistribution);\n\n}", "title": "" }, { "docid": "9a5051c5f7cb7b6f6be7079b1ebd1215", "score": "0.5908004", "text": "function onRedraw() {\n if (_this.chart) {\n if (_this.chart.series.length > 4) {\n for (var i = 5; i < _this.chart.series.length; i++)\n if (_this.chart.series[i].data.length !== 0 && _this.chart.series[i].data[0].graphic && _this.chart.series[i].data[0].graphic.element)\n _this.chart.series[i].data[0].graphic.element.setAttribute(\"class\", \"bar-summary\");\n }\n }\n }", "title": "" }, { "docid": "a3bda64704960859485da7b5d62a24ef", "score": "0.58938485", "text": "function stageChart() {\n $.post('/contratacionesabiertas/stage-chart-data', {\n year: $('#metadataYear').val(),\n }, function (data) {\n var interval = 1;\n data.map(x => {\n if(x.total > 50){\n interval = 10;\n } \n });\n var nData = [[],[],[],[],[]];\n var ticks = ['Licitación pública', 'Adjudicación directa', 'Invitación a cuando menos tres personas'];\n var chartOptions = {\n height: 450,\n stackSeries: true,\n seriesDefaults: {\n renderer: ff.BarRenderer,\n shadow: false,\n rendererOptions: {\n barDirection: 'horizontal',\n barWidth: 20,\n barMargin: 10\n }\n },\n series: [\n { label: 'Planeación', color: '#F19192' }, // Planeación (rosa)\n { label: 'Licitación', color: '#D6D52D' }, // Licitación (amarillo)\n { label: 'Adjudicación', color: '#2AA24A' }, // Adjudicación (verde)\n { label: 'Contratación', color: '#1F8BC5' }, // Contratación (azul)\n { label: 'Ejecución', color: '#79357C' }, // Ejecución (morado)\n ],\n axes: {\n xaxis: {\n min: 0,\n tickInterval: interval ,\n tickOptions: {\n formatString: '%d'\n },\n autoscale: true\n },\n yaxis: {\n renderer: ff.CategoryAxisRenderer,\n ticks: ticks,\n tickOptions: {\n showGridline: true, \n markSize: 0\n },\n autoscale: true\n }\n },\n grid: {\n drawBorder: false,\n drawGridLines: true,\n shadow: false,\n backgroundColor: 'transparent'\n },\n highlighter: {\n show: true,\n sizeAdjust: 7.5,\n tooltipContentEditor: function(current, serie, index, plot){\n var serieName = plot.series[serie].label;\n var tickName = ticks[index];\n var val = plot.data[serie][index];\n return '<table class=\"jqplot-highlighter\"><tr><td>' + tickName + '</td></tr><tr><td>' + (serieName + ': <strong>' + val[0]) + '</strong></td></tr></table>';\n }\n }\n };\n\n var process = data.reduce(function (rv, x) {\n (rv[x['process']] = rv[x['process']] || []).push(x);\n\n return rv;\n }, {});\n\n ticks.forEach(function (key, index) {\n for (let i = 0; i < 5; i++) {\n var actual = $.grep(process[key] || [], function (e) { return e.stage == (i + 1); });\n nData[i].push([actual.length > 0 ? parseInt(actual[0].total) : 0, index + 1]);\n }\n });\n\n var bData = $.extend(true, [], nData);\n \n var plot = ff('stages_chart', bData, chartOptions);\n\n function resizeHandler () {\n if (window.innerWidth < 700) {\n chartOptions['axes']['yaxis']['ticks'] = ['LP', 'A41', 'A42', 'ER', 'I3P', 'CC', 'AM'];\n\n plot.destroy();\n plot = ff('stages_chart', bData, chartOptions);\n } else {\n chartOptions['axes']['yaxis']['ticks'] = ['Licitación pública', 'Adjudicación directa', 'Invitación a cuando menos tres personas']; //procedimiento por etapas\n\n plot.destroy();\n plot = ff('stages_chart', bData, chartOptions);\n }\n }\n\n if (window.addEventListener) {\n window.addEventListener('resize', resizeHandler, false);\n }\n else if (window.attachEvent) {\n window.attachEvent('onresize', resizeHandler);\n }\n\n $('[data-stage]').on('click', function() {\n $(this).toggleClass('active');\n bData = $.extend(true, [], nData);\n\n for (var i = 0; i < bData.length; i++) {\n if ($('[data-stage=\"' + i + '\"]').hasClass('active')) {\n for (var j = 0; j < bData[i].length; j++) {\n bData[i][j][0] = 0;\n }\n }\n }\n\n plot.destroy();\n plot = ff('stages_chart', bData, chartOptions);\n });\n\n window.dispatchEvent(new Event('resize'));\n });\n }", "title": "" }, { "docid": "63bcd7814fbf1818bd8291170c71081e", "score": "0.5887179", "text": "function initializeBars(comparable) {\n// We create a new element using jQuery. We can style it in CSS using the .bar-chart class.\n $('.sandbox').append('<div class=\"bar-chart\"></div>');\n\n// We reduce our comparable to yearly totals\n yearTotals = _.map(comparable, function(obj,iter){\n var valueArray = _.pluck(obj.stats, \"value\");\n return _.reduce(valueArray, function(memo,num) { return memo + num });\n }); //_.map\n\n// For each of this yearly totals, create a bar in our new bar chart.\n $.each(yearTotals, function(key,value){\n $('.bar-chart').append('<div class=\"bar\" data-index=\"'+comparable[key].id+'\" data-value=\"'+value+'\"><span><em>' + comparable[key].id + ':</em> <strong>' + \"\"+ '</strong></span></div>');\n // $('.bar-chart').append('<div class=\"bar\" data-index=\"'+comparable[key].id+'\" data-value=\"'+value+'\"><span><em>' + comparable[key].id + ':</em> <strong>' + commafy(value) + '</strong></span></div>');\n }); //each yearTotals\n\n//////// Step 1A: Make the length of each bar relative to its $ spent\n relativeBarWidths();\n\n//////// Step 1B: Drop another level of metrics in: a breakdown of the yearly spend\n createLegend(comparable);\n applyCategories(comparable);\n\n//////// Step 1C: Make the width of each category proportional to \n setCategoryWidths();\n setCategoryRatios(comparable);\n\n}", "title": "" }, { "docid": "3e09f8d9345640430475e823d7ac37e6", "score": "0.58853114", "text": "initChart() {\n if (!this.chart) {\n this.chart = new\n chartDep.LineChart(document.getElementById(\n assertString(this.containerId)));\n }\n }", "title": "" }, { "docid": "3e09f8d9345640430475e823d7ac37e6", "score": "0.58853114", "text": "initChart() {\n if (!this.chart) {\n this.chart = new\n chartDep.LineChart(document.getElementById(\n assertString(this.containerId)));\n }\n }", "title": "" }, { "docid": "cb5447aaae2d9ccdc91644c1411b283c", "score": "0.588258", "text": "_initHorizontalBarChart() {\n if (document.getElementById('horizontalBarChart')) {\n const barChart = document.getElementById('horizontalBarChart').getContext('2d');\n this._horizontalBarChart = new Chart(barChart, {\n type: 'horizontalBar',\n options: {\n plugins: {\n crosshair: false,\n datalabels: {display: false},\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n yAxes: [\n {\n gridLines: {\n display: true,\n lineWidth: 1,\n color: Globals.separatorLight,\n drawBorder: false,\n },\n ticks: {\n beginAtZero: true,\n stepSize: 100,\n min: 300,\n max: 800,\n padding: 20,\n },\n },\n ],\n xAxes: [\n {\n gridLines: {display: false},\n },\n ],\n },\n legend: {\n position: 'bottom',\n labels: ChartsExtend.LegendLabels(),\n },\n tooltips: ChartsExtend.ChartTooltip(),\n },\n data: {\n labels: ['January', 'February', 'March', 'April'],\n datasets: [\n {\n label: 'Breads',\n borderColor: Globals.primary,\n backgroundColor: 'rgba(' + Globals.primaryrgb + ',0.1)',\n data: [456, 479, 324, 569],\n borderWidth: 2,\n },\n ],\n },\n });\n }\n }", "title": "" }, { "docid": "6d8cbf11d1fdb7ea41f3bb10b96b29d9", "score": "0.58823884", "text": "function showBarChart(chartData) {\n console.log(chartData[0].sample_values.slice(0, 10));\n console.log(chartData[0].otu_ids.slice(0, 10));\n data = [{\n y: chartData[0].otu_ids.slice(0, 10).map(otu_ids => `OTU ${otu_ids}`).reverse(),\n x: chartData[0].sample_values.slice(0, 10).reverse(),\n type: \"bar\",\n orientation: \"h\"\n }];\n\n var layout = {\n title: \"Top 10 OTU IDs\",\n }\n\n Plotly.newPlot(\"bar\", data, layout);\n}", "title": "" }, { "docid": "fc963839406e8c37e270d7f6c5d12eee", "score": "0.5880085", "text": "drawBar() {\n this.dataTank = [];\n var endtime = this.SDate2;\n for (let i = 0; i < this.selectedList.length; i++) {\n var city = this.selectedList[i];\n var data = [];\n var name = \"\";\n this.dateList = [];\n for (let j = 0; j < this.result.length; j++) {\n var newStringDate = this.MakeStringToDateType(this.result[j]['\\\"' + \"Dates\" + '\\\"']);\n var currentdate = new Date(newStringDate.toString());\n // console.log(currentdate); \n if (currentdate.getTime() >= this.selectedDate1.getTime() && currentdate.getTime() <= this.selectedDate2.getTime()) {\n this.dateList.push(this.result[j]['\\\"' + \"Dates\" + '\\\"']);\n var res = this.result[j]['\\\"' + city + '\\\"'];\n data.push(Number(res));\n }\n }\n for (let j = 0; j < this.ContryList.length; j++) {\n if (this.ContryList[j].name == city) {\n name = this.ContryList[j].title;\n }\n }\n this.dataTank.push({ \"name\": name, \"data\": data });\n const self = this;\n // chart = this.chart;\n // console.log(this.dataTank)\n console.log(this.dateList);\n if (this.dataList.length == 0) {\n sweetalert2_dist_sweetalert2_js__WEBPACK_IMPORTED_MODULE_2___default.a.fire({\n icon: 'error',\n title: 'Oops...',\n text: \"no data! please choose date from 2017-12-04 to 2017-12-10\",\n footer: '<a href>Why do I have this issue?</a>'\n });\n }\n setTimeout(() => {\n self.chartOptionsbar.xAxis.categories = this.dateList;\n self.chartOptionsbar.series = this.dataTank;\n self.updateFlag = true;\n }, 2000);\n }\n }", "title": "" }, { "docid": "34770906ba7c812063933c93876a934a", "score": "0.58771753", "text": "function drawBarGraphDaily() {\n\n var dataBar = new google.visualization.DataTable();\n dataBar.addColumn('timeofday', 'Time of Day');\n dataBar.addColumn('number', 'Number of People');\n\n dataBar.addRows(dailyStats);\n\n var optionsBar = {\n title: 'Foot Traffic Throughout Monday',\n hAxis: {\n title: 'Time of Day',\n format: 'h:mm a',\n viewWindow: {\n min: [7, 0, 0],\n max: [15, 0, 0]\n }\n },\n vAxis: {\n title: 'Amount of People'\n }\n };\n\n var chartBar = new google.visualization.ColumnChart(\n document.getElementById('bar-graph'));\n\n chartBar.draw(dataBar, optionsBar);\n }", "title": "" }, { "docid": "aa773f9fd4010d02b711180c7a820cf8", "score": "0.5873071", "text": "init() {\n // Add label\n $sel.append('text')\n .text(d => `${d.key}`.split(' ')[0] + `'s ` + `${d.key}`.split(' ')[2]).attr('class', 'chart-label')\n\n\t\t\t\t$sel.append('text')\n\t\t\t\t\t.attr('class', 'tk-atlas selected-brand')\n\n const container = $sel.append('div.container')\n\n // Add svg for front pockets\n\t\t\t\t$svg = container.append('svg.debunk');\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g.g-vis');\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "title": "" }, { "docid": "829ede257ef877c0cfc116befc87ff41", "score": "0.58718973", "text": "function initializeBarChartGamesPlayed(allData, id, divChart, title) {\r\n chartData[id] = new google.visualization.arrayToDataTable(allData);\r\n\r\n //lisataan annotation, jossa on columnien summa\r\n //rivi vaaka, column pysty\r\n for (var i = 0; i < chartData[id].getNumberOfRows(); i++) {\r\n var total = 0;\r\n // j=1, koska ensimmainen factionen nimi\r\n // -2, koska 0 --> (n-1) ja viimeinen on {setting}\r\n for (var j = 1; j <= chartData[id].getNumberOfColumns() - 2; j++) {\r\n total += chartData[id].getValue(i, j);\r\n }\r\n chartData[id].setValue(i, chartData[id].getNumberOfColumns() - 1, total + \"\");\r\n\r\n }\r\n\r\n // Set chart options\r\n chartOptions[id] = {\r\n 'title': title,\r\n 'titleTextStyle': {\r\n 'color': 'black',\r\n 'fontSize': 14,\r\n 'bold': 'true',\r\n 'fontName': 'sans-serif'\r\n },\r\n 'chartArea': {\r\n 'top': '10%',\r\n 'left': '15%',\r\n 'width': '75%',\r\n 'height': '75%'\r\n },\r\n //'hAxis': {'title': 'Year', 'titleTextStyle': {'color': 'red'}},\r\n //'colors': ['red','green'],\r\n 'colors': ['#5DA5DA', '#F15854'],\r\n 'vAxis': {\r\n 'viewWindow': {\r\n 'min': 0\r\n },\r\n 'format': ''\r\n },\r\n 'height': VAKIO_Height,\r\n //'width':VAKIO_WidthHalf,\r\n 'isStacked': 'true',\r\n 'annotations': {\r\n 'textStyle': {\r\n 'fontSize': 12,\r\n 'bold': 'false',\r\n 'italic': 'true',\r\n },\r\n },\r\n 'legend': {\r\n 'position': 'bottom'\r\n },\r\n 'animation': {\r\n 'duration': VAKIO_ChartAnimationTime,\r\n 'easing': VAKIO_ChartAnimationStyle,\r\n },\r\n };\r\n\r\n //piirros\r\n chartChart[id] = divChart;\r\n //chartChart[id].draw(chartData[id], chartOptions[id]);\r\n}", "title": "" }, { "docid": "b57e8d190d8b8ec66c94ffa89d508987", "score": "0.5869671", "text": "function drawBarChart(d_obj, id_div) \n{\n\tRMPApplication.debug(\"begin drawBarChart\");\n\tc_debug(debug.chart, \"=> drawBarChart\");\n\t// Style Bar options\n\tvar opac = 'opacity: 0.5';\n\tvar greCol = 'color: #00C851;' + opac;\n\tvar bluCol = 'color: #33b5e5;' + opac;\n\tvar yelCol = 'color: #ffbb33;' + opac;\n\tvar redCol = 'color: #ff4444;' + opac;\n\n\tvar column_id1 = ${P_quoted(i18n(\"column_id1\", \"Statut\"))};\n\tvar column_text_id1 = ${P_quoted(i18n(\"column_text_id1\", \"Nombre\"))};\n\tvar column_id2 = ${P_quoted(i18n(\"column_id2\", \"Transmis\"))};\n\tvar column_id3 = ${P_quoted(i18n(\"column_id3\", \"En attente de diagnostic\"))};\n\tvar column_id4 = ${P_quoted(i18n(\"column_id4\", \"Diagnostiqué\"))};\n\tvar column_id5 = ${P_quoted(i18n(\"column_id5\", \"Affecté\"))};\n\tvar column_id6 = ${P_quoted(i18n(\"column_id6\", \"En cours de résolution\"))};\n\tvar column_id7 = ${P_quoted(i18n(\"column_id7\", \"Terminé - Complet\"))};\n\tvar column_id8 = ${P_quoted(i18n(\"column_id8\", \"Terminé - Incomplet\"))};\n\tvar column_id9 = ${P_quoted(i18n(\"column_id9\", \"Annulé\"))};\n\tvar column_id10 = ${P_quoted(i18n(\"column_id10\", \"Erreur\"))};\n\n\t// Data & option definitions for work order per state Chart\n\tvar wo_per_state_data = google.visualization.arrayToDataTable([\n\t\t[column_id1, column_text_id1, { role: 'annotation' }, { role: 'style' }],\n\t\t[column_id2, d_obj.nb_draf, d_obj.nb_draf, yelCol],\t\t\t\t\t// 'Draft'\n\t\t[column_id3, d_obj.nb_aw, d_obj.nb_aw, yelCol],\t\t\t\t\t\t// 'Awaiting Diagnosis'\n\t\t[column_id4, d_obj.nb_diag, d_obj.nb_diag, bluCol],\t\t\t\t\t// 'Diagnosed'\n\t\t[column_id5, d_obj.nb_ass, d_obj.nb_ass, bluCol],\t\t\t\t\t// 'Assigned'\n\t\t[column_id6, d_obj.nb_work, d_obj.nb_work, bluCol],\t\t\t\t\t// 'Work In Progress'\n\t\t[column_id7, d_obj.nb_fcom, d_obj.nb_fcom, greCol],\t\t\t\t\t// 'Finished - Complete'\n\t\t[column_id8, d_obj.nb_finc, d_obj.nb_finc, redCol],\t\t\t\t\t// 'Finished - Incomplete'\n\t\t[column_id9, d_obj.nb_canc, d_obj.nb_canc, bluCol],\t\t\t\t\t// 'Cancelled'\n\t\t[column_id10, d_obj.nb_err, d_obj.nb_err, redCol],\t\t\t\t\t// 'Error'\n\t\t// ['Clos - Complet', d_obj.nb_comp, d_obj.nb_comp, greCol],\t\t// 'Closed Complete'\n\t\t// ['Résolu', d_obj.nb_res, d_obj.nb_res, greCol],\t\t\t\t\t// 'Resolved'\n\t\t// ['Clos - Incomplet', d_obj.nb_inc, d_obj.nb_inc, greCol],\t\t// 'Closed Incomplete'\n\t\t// ['Non résolu', d_obj.nb_unr, d_obj.nb_unr, redCol],\t\t\t\t// 'Unresolved'\n\t]);\n\t// ],false);\t\t// 'false' means that the first row contains labels, not data.\n\n\tvar wo_per_state_option_title = ${P_quoted(i18n(\"bar_title_id1\", \"Répartition des\"))} + \" (\" + d_obj.wo_number + \") \" + ${P_quoted(i18n(\"bar_title_id2\", \"tickets par STATUT\"))};\n\tvar wo_per_state_option_label = ${P_quoted(i18n(\"graph_label_id1\", \"Nombre\"))};\n\n\tvar wo_per_state_option = {\n\t\ttitle: wo_per_state_option_title,\n\t\ttitleTextStyle: {\n\t\t\tfontSize: 20,\n\t\t\tbold: true,\n\t\t\tcolor: '#c0392b'\n\t\t},\n\t\t// backgroundColor: \"#FCFEE0\",\n\t\twidth: '90%',\n\t\tbars: 'horizontal',\n\t\tannotations: {alwaysOutside: true },\n\t\taxes: {\n\t\t\tx: {\n\t\t\t\t0: {side: 'top', label: wo_per_state_option_label}\n\t\t\t}\n\t\t},\n\t\thAxis: {\n\t\t\ttextStyle: { color: 'blue', bold: true },\n\t\t\tformat : '#'\n\t\t},\n\t\tlegend: {position: 'none'}\n\t};\n\n\t// reset previous Chart DIV\n\tdocument.getElementById(id_div).innerHTML = '';\n\n\t// Draw Work Order per State Chart\n\tvar wo_per_state_chart = new google.visualization.BarChart( document.getElementById(id_div) );\n\two_per_state_chart.draw(wo_per_state_data, wo_per_state_option);\n\n\tRMPApplication.debug(\"end drawBarChart\");\n}\t// End function drawBarChart", "title": "" } ]
91fbd3aa3fd0d2ee7bf70d4189d66ef2
sets ships on grid
[ { "docid": "d125b41095036888ebb58e064c032de0", "score": "0.0", "text": "function selectClickedShip(playerGrid){\n $(playerGrid + ' .ship').click(function(){\n $(playerGrid + ' .ship').removeClass('selected');\n $(this).addClass('selected');\n });\n}", "title": "" } ]
[ { "docid": "69de5847bd2d22ae54a1e4637a102c90", "score": "0.7204475", "text": "placeShips() {\n for (const i in this.ships) {\n this.placeShip(this.ships[i]);\n this.ships[i].healthReset();\n }\n }", "title": "" }, { "docid": "fd1d9e3797eb70e613b852ceb895f7f5", "score": "0.7088044", "text": "function placeShipInGrid(ship, grid) {\n forEachShipLocation(ship, function(location) {\n grid[location.col][location.row].state = ship;\n });\n}", "title": "" }, { "docid": "89de40e542f7fa74bfdbb992ae1a816e", "score": "0.70094454", "text": "function putShipOnGrid(pos, ship, hor, grid){\n\tif (hor){\n\t\tfor (var i = 0; i < ship.size; i++){\n\t\t\tgrid[pos[Y_AXIS]][pos[X_AXIS]+i] = ship.sym;\n\t\t}\n\t} else {\n\t\tfor (var i = 0; i < ship.size; i++){\n\t\t\tgrid[pos[Y_AXIS]+i][pos[X_AXIS]] = ship.sym;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "70168b43e42ef98f87660070ec54db40", "score": "0.6971846", "text": "function setShips() {\n var row;\n var cell;\n // produced a random location for the ship to go\n for (i = 0; i < 5; i++) {\n row = Math.floor(Math.random() * 10);\n cell = Math.floor(Math.random() * 10);\n console.log(row + \" \" + cell + \" \" + i);\n // made sure the ships didn't go into the same cell.\n if (board[row][cell] != SHIP) {\n board[row][cell] = SHIP;\n // stored location of ships in an empty array. HooRay!\n shipSpots.push([row, cell]);\n }\n }\n}", "title": "" }, { "docid": "3b7ef813b25917953f79b36a9bd62a00", "score": "0.6933831", "text": "function dibujarShipsGrid(datosJs) {\n\n var grid = $('.grid-stack').data('gridstack');\n\n if (datosJs.Ships.length <= 0) {\n grid.addWidget($('<div id=\"carrier\"><div class=\"grid-stack-item-content carrierHorizontal\"></div><div/>'),\n 0, 0, 5, 1);\n\n grid.addWidget($('<div id=\"patrol\"><div class=\"grid-stack-item-content patrolHorizontal\"></div><div/>'),\n 0, 1, 2, 1);\n\n grid.addWidget($('<div id=\"submarine\"><div class=\"grid-stack-item-content submarineHorizontal\"></div><div/>'),\n 0, 2, 3, 1);\n\n grid.addWidget($('<div id=\"destroyer\"><div class=\"grid-stack-item-content destroyerHorizontal\"></div><div/>'),\n 0, 3, 3, 1);\n\n grid.addWidget($('<div id=\"battleship\"><div class=\"grid-stack-item-content battleshipHorizontal\"></div><div/>'),\n 0, 4, 4, 1);\n\n $(\"#carrier,#patrol,#submarine,#destroyer,#battleship\").click(function () {\n var clase = $(this).prop('id') + \"Horizontal\";\n var width = $(this).data(\"gs-width\");\n var height = $(this).data(\"gs-height\");\n if ($(this).children().hasClass(clase)) {\n grid.resize($(this), height, width);\n $(this).children().removeClass(clase);\n $(this).children().addClass($(this).prop('id') + \"Vertical\");\n } else {\n grid.resize($(this), width, height);\n $(this).children().addClass(clase);\n $(this).children().removeClass($(this).prop('id') + \"Vertical\");\n\n }\n });\n } else {\n for (var i in datosJs.Ships) {\n console.log(datosJs.Ships[i]);\n\n var y = datosJs.Ships[i].locations[0].charAt(0);\n var y2 = datosJs.Ships[i].locations[1].charAt(0);\n var w = 0;\n var h = 0;\n var direccion = 'Vertical';\n\n if (y === y2) {\n direccion = 'Horizontal';\n w = datosJs.Ships[i].locations.length;\n h = 1;\n } else {\n w = 1;\n h = datosJs.Ships[i].locations[0].length;\n }\n\n var xFinal = parseInt(datosJs.Ships[i].locations[0].charAt(1)) - 1;\n var yFinal = 0;\n switch (y) {\n case \"A\":\n yFinal = 0;\n break;\n case \"B\":\n yFinal = 1;\n break;\n case \"C\":\n yFinal = 2;\n break;\n case \"D\":\n yFinal = 3;\n break;\n case \"E\":\n yFinal = 4;\n break;\n case \"F\":\n yFinal = 5;\n break;\n case \"G\":\n yFinal = 6;\n break;\n case \"H\":\n yFinal = 7;\n break;\n case \"I\":\n yFinal = 8;\n break;\n case \"J\":\n yFinal = 9;\n break;\n }\n\n grid.addWidget($('<div id=\"' + datosJs.Ships[i].type + '\"><div class=\"grid-stack-item-content ' + datosJs.Ships[i].type + direccion + '\"></div><div/>'),\n xFinal, yFinal, w, h);\n\n }\n }\n}", "title": "" }, { "docid": "f3394a522cb417a36085e902c5ae38d0", "score": "0.6829802", "text": "function placeShips(fleet, grid){\n\tfor (var key in fleet){\n\t\tif (fleet.hasOwnProperty(key)){\n\t\t\tif (key != \"isHit\") {\n\t\t\t\twhile (!findValidPosition(fleet[key].size, grid)[0]){}\n\t\t\t\tconsole.log(key + \" : \" + fleet[key].size); //debugging line\n\t\t\t\tconsole.log(\"posXY : \" + loc[0] + \", \" + loc[1] + \" is horizontal? \" + horizontal);\n\t\t\t\tputShipOnGrid(loc, fleet[key], horizontal, grid);\t\n\t\t\t} \n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "74794084ebd41941f9d1c161754c2839", "score": "0.66100204", "text": "function setShipsVisibility(ships){\n ships.forEach(ship => {\n ship.locations.forEach(loc => {\n row = loc.slice(0,1).charCodeAt(0) - 'A'.charCodeAt(0);\n col = loc.slice(1)-1;\n you_ship_visibility[row][col] = 0;\n });\n });\n}", "title": "" }, { "docid": "a2bdf125ca43d44d7a79bc8d354e7aa6", "score": "0.64808893", "text": "function setUpShip02() {\nship2.x = 50;\nship2.y = 500;\n}", "title": "" }, { "docid": "0e520457e1679c1acbc2f1fc5064d46c", "score": "0.64020634", "text": "function setUpShip(){\n ship1.x = 50;\n ship1.y = 500;\n}", "title": "" }, { "docid": "6bebef43b34bd627fc008a3d9dafadcd", "score": "0.63943005", "text": "restart() {\n this.gridCreate();\n this.placeShips();\n }", "title": "" }, { "docid": "dfbc04b105483162ad0ff22ad326ef53", "score": "0.6382817", "text": "addObstacle(gridLocation, gridWidth, gridHeight) {\n for (let x = gridLocation.x; x < gridLocation.x + gridWidth; x++) {\n for (let y = gridLocation.y; y < gridLocation.y + gridHeight; y++) {\n this.set(x, y, 0)\n }\n }\n }", "title": "" }, { "docid": "2172e67835ba783cc35ea911ebaf3baa", "score": "0.6373595", "text": "function placeHorizontalShips(length, number) {\n //counts the number of ships that have been made\n var shipsPlaced = 0;\n do {\n //generates a random row between 0 and 9\n var row = Math.floor(Math.random()*10);//declaring random row\n //generates a random column between 0 and 10-length\n var column = Math.floor(Math.random()*(11-length));//declaring random column\n //checks if the area is clear\n if (checkIfEmptyHorizontal(row, column, length) === true) {\n //adds one to shipsOnBoard (so that each ship can be given a unique value)\n shipsOnBoard++;\n //loops through all the squares in the row for the length of the ship\n for (var i=0; i<length; i++) {\n board[row][column + i] = \"ship\" + shipsOnBoard;//changing value of array at mathrandom to equal 0\n $(\"#\"+row+(column+i)).addClass(\"shipSquare\");//FIXME fix add class\n }\n shipsPlaced++;\n }\n } while (shipsPlaced < number );\n}", "title": "" }, { "docid": "eb51522759cc4a54fe532226be8c285b", "score": "0.63391215", "text": "function setShipSections(playerGrid, ship){\n var cell = $(playerGrid + ' td.' + ship);\n var shipPosition = cell.attr('data-position');\n switch (ship){\n case 'carrier-horizontal':\n case 'carrier-vertical':\n shipSections(cell,shipPosition,ship,5, playerGrid);\n break;\n case 'battleship-horizontal':\n case 'battleship-vertical':\n shipSections(cell,shipPosition,ship,4, playerGrid);\n break;\n case 'cruiser-horizontal':\n case 'cruiser-vertical':\n shipSections(cell,shipPosition,ship, 3,playerGrid);\n break;\n case 'submarine-horizontal':\n case 'submarine-vertical':\n shipSections(cell,shipPosition,ship,3, playerGrid);\n break;\n case 'destroyer-horizontal':\n case 'destroyer-vertical':\n shipSections(cell,shipPosition,ship,2,playerGrid);\n break;\n }\n}", "title": "" }, { "docid": "3f81a7cb4605e3bd15269cc5b8b8a663", "score": "0.63278514", "text": "placeShip(ship, [x, y], direction) {\n const clone = _.cloneDeep(this);\n const cloneShip = _.cloneDeep(ship);\n clone.ships.push(cloneShip);\n const shipId = clone.ships.indexOf(cloneShip);\n // Now we handle placement. This depends on the direction\n // of the ship, which can be either horizontal or vertical.\n // TODO: break this out into its own function\n if (direction === 'row') {\n clone.coordinates = clone.coordinates.map((cell) => {\n if (cell.coords[0] === x && cell.coords[1] >= y && cell.coords[1] < y + ship.length) {\n const cellClone = _.cloneDeep(cell);\n cellClone.status = 'filled';\n cellClone.ship = shipId;\n return cellClone;\n }\n return cell;\n });\n }\n if (direction === 'column') {\n clone.coordinates = clone.coordinates.map((cell) => {\n if (cell.coords[1] === y && cell.coords[0] >= x && cell.coords[0] < x + ship.length) {\n const cellClone = _.cloneDeep(cell);\n cellClone.status = 'filled';\n cellClone.ship = shipId;\n return cellClone;\n }\n return cell;\n });\n }\n return clone;\n }", "title": "" }, { "docid": "bb0f12fb4d1801fd78643c59cc1af62c", "score": "0.62911826", "text": "upgradeGrid() {\n // Creation of the grid : 2D array initialized with -1\n this.grid = Array.from(Array(this.gridRows), _ =>\n Array(this.gridColumns).fill(objects.empty)\n );\n\n for (var i = 0; i < this.nb_snakes; i++) {\n // Update the grid with the tails positions\n for (var j = 0; j < this.snakes[i].length - 1; j++) {\n pos = this.snakes[i].tail[j];\n this.grid[pos[0]][pos[1]] = objects.snake_tail;\n }\n\n // Update the grid with the snakes positions\n var pos = this.snakes[i].getPosition();\n this.grid[pos[0]][pos[1]] = objects.snake;\n }\n\n // Update the grid with the fruits positions\n for (var i = 0; i < this.nb_fruits; i++) {\n var pos = this.fruits[i].getPosition();\n this.grid[pos[0]][pos[1]] = objects.food;\n }\n }", "title": "" }, { "docid": "40523c961d856194aa86b5563323c077", "score": "0.6291121", "text": "function setUpShip03() {\n ship3.x = 50;\n ship3.y = 500;\n\n rectLocation.x = 500;\n rectLocation.y = 500;\n\n rectLocation2.x = 300;\n rectLocation2.y = 300;\n }", "title": "" }, { "docid": "39ec28ff8c231816c3b60ac685019023", "score": "0.6225846", "text": "clearShips() {\n this.ships = [];\n }", "title": "" }, { "docid": "9f3ec1bbbd0373b094e5e514d44161cf", "score": "0.614934", "text": "randomizeShip(height, width) {\n var yStart = Math.floor((Math.random() * height));\n var xStart = Math.floor((Math.random() * width));\n\n for (var i = 0; i < 4; i++) {\n var block = {x:xStart, y:yStart + i};\n this.area.push(block);\n }\n }", "title": "" }, { "docid": "e9ef03f70b6c61eacb357b291aa06388", "score": "0.614422", "text": "randomlyPlaceShips() {\n var ships = {\n 'p1': [],\n 'p2': [],\n };\n for (let i = 1; i <= this.rules.numShips; i++) {\n ships['p1'].push(this.createShipOfLength(i, 'p1', ships));\n ships['p2'].push(this.createShipOfLength(i, 'p2', ships));\n }\n this.setState({\n 'ships': ships,\n });\n }", "title": "" }, { "docid": "4b4d4aa6aab49499ed04a5dad5439648", "score": "0.6142926", "text": "addNewShip(startCellX, startCellY,\n direction, length, arrayShips) {\n const index = arrayShips.indexOf(length);\n let endCellX;\n let endCellY;\n\n //direction: 0 - vertically; 1 - horizontally;\n\n if (direction) {\n endCellX = startCellX + length - 1;\n endCellY = startCellY;\n } else {\n endCellX = startCellX;\n endCellY = startCellY + length - 1;\n }\n\n if (endCellX > 10 || endCellY > 10) {\n return [false];\n }\n\n const checkTouchStart = this.coordinateShips[startCellY][startCellX];\n\n const checkTouchEnd = this.coordinateShips[endCellY][endCellX];\n\n if (checkTouchStart > 0 || checkTouchEnd > 0) {\n return [false, 'Корабли не должны соприкасаться'];\n }\n if (index > -1) {\n if (arrayShips === unchosenShips) {\n const lastShip = arrayShips.length - 1;\n arrayShips[index] = arrayShips[lastShip];\n arrayShips.pop();\n }\n } else {\n return [false, 'Корабль данной длины нельзя размещать.'];\n }\n\n function addByLength(length, obj) {\n const arr = [1, 1, 1, 1, 2, 2, 2, 3, 3, 4];\n const BEGIN = arr.indexOf(length);\n for (let i = BEGIN; i < BEGIN + 5 - length; i++) {\n if (obj.allShips[i] === undefined) {\n obj.allShips[i] = new Ship(startCellX, startCellY,\n endCellX, endCellY, direction, length);\n break;\n }\n }\n }\n addByLength(length, this);\n \n if (direction) {\n for (let k = startCellX; k < endCellX + 1; k++) {\n this.coordinateShips[startCellY][k] = 1;\n this.coordinateShips[startCellY - 1][k] = 2;\n this.coordinateShips[startCellY + 1][k] = 2;\n }\n for (let t = startCellY - 1; t < startCellY + 2; t++) {\n this.coordinateShips[t][startCellX - 1] = 2;\n this.coordinateShips[t][endCellX + 1] = 2;\n }\n } else {\n for (let i = startCellY; i < endCellY + 1; i++) {\n this.coordinateShips[i][startCellX] = 1;\n this.coordinateShips[i][startCellX - 1] = 2;\n this.coordinateShips[i][startCellX + 1] = 2;\n }\n for (let y = startCellX - 1; y < startCellX + 2; y++) {\n this.coordinateShips[startCellY - 1][y] = 2;\n this.coordinateShips[endCellY + 1][y] = 2;\n }\n }\n return [true];\n }", "title": "" }, { "docid": "77923ed6a6abe5b0886a08feae50e5e0", "score": "0.60947675", "text": "function gridBlock(coord, grid) {\n grid[coord[1]][coord[0]] = 1;\n}", "title": "" }, { "docid": "c60ccc58fa22cbf4063c3e7c6491e9db", "score": "0.6060379", "text": "generateShipGrid() {\n const x = Math.floor(Math.random() * this.grid.length);\n const y = Math.floor(Math.random() * this.grid.length);\n return ({ x, y });\n }", "title": "" }, { "docid": "d7c3b190447ac4c0bc6616343bd00a81", "score": "0.6049881", "text": "constructor(scene){\n this.mesh = BABYLON.Mesh.CreateBox(\"tile\", 0.1, scene);\n this.mesh.isVisible=false;\n this.acc={x:0,z:0}\n this.ship = [];\n\n for (let i = 0; i < 100; i++) {//x dvs columner\n let tempArr=[];\n this.ship.push(tempArr);\n for (let j = 0; j < 100; j++) {//z dvs rows\n var tile=new Tile(i,j,scene);\n tempArr.push(tile);\n var mesh=tile.getMesh();\n mesh.position.x+=i;\n mesh.position.z+=j;\n mesh.parent=this.mesh;\n }\n }\n\n\n for(let i=1;i<99;i++) {//columns\n for (let j = 1; j < 99; j++) {//rows\n this.ship[i][j].setNeighbors({\n downLeft:this.ship[i-1][j-1],\n left:this.ship[i-1][j],\n topLeft:this.ship[i-1][j+1],\n down:this.ship[i][j-1],\n top:this.ship[i][j+1],\n downRight:this.ship[i+1][j-1],\n right:this.ship[i+1][j],\n topRight:this.ship[i+1][j+1]});\n }\n }\n\n /* for(let i=40;i<60;i++) {//columns\n for (let j = 40; j < 60; j++) {//rows\n this.ship[i][j].addItem(new Floor());\n }\n }*/\n\n this.ship[40][40].addItem(new Floor());\n\n this.ship[40][41].addItem(new Floor());\n\n this.ship[40][42].addItem(new Floor());\n\n this.ship[40][43].addItem(new Floor());\n this.ship[40][44].addItem(new Floor());\n\n /* this.ship[40][40].addItem(new Wall(\"left\"));\n this.ship[40][40].addItem(new Wall(\"down\"));\n this.ship[41][40].addItem(new Wall(\"down\"));\n this.ship[42][40].addItem(new Wall(\"down\"));\n this.ship[43][40].addItem(new Wall(\"down\"));\n this.ship[44][40].addItem(new Wall(\"down\"));\n this.ship[45][40].addItem(new Wall(\"down\"));\n this.ship[46][40].addItem(new Wall(\"down\"));\n*/\n // this.ship[40][41].addItem(new Wall([\"down\"]));\n // this.ship[40][42].addItem(new Wall([\"down\"]));\n // this.ship[40][43].addItem(new Wall([\"down\"]));\n // this.ship[40][44].addItem(new Wall([\"down\"]));\n\n\n\n\n\n console.log(this.items);\n }", "title": "" }, { "docid": "7b5e66aed76dabf42c39905eb45703d3", "score": "0.60468054", "text": "set_grass(){\n this.grass_collection = [\n this.shapes.grass1, this.shapes.grass2, this.shapes.grass3, this.shapes.grass4, this.shapes.grass5, this.shapes.grass6, this.shapes.grass7, this.shapes.grass8,\n this.shapes.grass9, this.shapes.grass10, this.shapes.grass11, this.shapes.grass12, this.shapes.grass13, this.shapes.grass14, this.shapes.grass15\n ];\n this.grass_colors = [hex_color(\"#777F46\"), hex_color(\"#727B50\"), hex_color(\"#374008\"), hex_color(\"#4B5516\")];\n }", "title": "" }, { "docid": "3daac9bae0f84b70de35a7dc7bb3cf55", "score": "0.6045331", "text": "function drawShip(ship) {\n forEachShipLocation(ship, function(location) {\n getPlayerGridCell(location.col, location.row).removeClass().addClass(\"ship\");\n });\n}", "title": "" }, { "docid": "9247fdaf34713e176dcf2e9cfbb3fe7a", "score": "0.60417575", "text": "function placeShips() {\n var ships = 0\n var randomRow;\n var randomColumn;\n\n while(ships < 5) {\n //to generate a random number for each index\n randomRow = Math.floor(Math.random()*10);\n randomColumn = Math.floor(Math.random()*10);\n\n //check if the position is empty, if it is, add a ship\n if (board[randomRow][randomColumn] != SHIP) {\n board[randomRow][randomColumn] = SHIP;\n //See where the ships are placed in the 2d array\n console.log(\"Ship added at \" + randomRow + randomColumn);\n ships++;\n }\n\n shipsArray.push(\"\" + randomRow + randomColumn);\n }\n}", "title": "" }, { "docid": "be3f0039603dc7b1e5529a263ebb8056", "score": "0.6022987", "text": "function setGrid(gs, grid) {\n //Mark my snake in grid\n for (let i = 1; i < gs.you.body.length - 1; i++) {\n grid.setWalkableAt(gs.you.body[i].x, gs.you.body[i].y, false);\n }\n //Mark other snake heads\n const allSnakes = gs.board.snakes\n for (let snake in allSnakes) {\n if (allSnakes[snake].id !== gs.you.id) {\n \n for (let j = 0; j < allSnakes[snake].body.length - 1; j++) {\n grid.setWalkableAt(allSnakes[snake].body[j].x, allSnakes[snake].body[j].y, false);\n }\n //Could we run into the head this turn\n if (getDistance(allSnakes[snake].body[0].x, allSnakes[snake].body[0].y, myHead) === 2) {\n\n //Decide on head collision depending on size\n if (gs.you.length <= allSnakes[snake].length) {\n //Pathfinding will throw an error if we try to set a space outside the board\n if (allSnakes[snake].body[0].x + 1 < gs.board.width) {\n grid.setWalkableAt((allSnakes[snake].body[0].x + 1), allSnakes[snake].body[0].y, false);\n }\n if (allSnakes[snake].body[0].x - 1 >= 0) {\n grid.setWalkableAt((allSnakes[snake].body[0].x - 1), allSnakes[snake].body[0].y, false);\n }\n if (allSnakes[snake].body[0].y + 1 < gs.board.height) {\n grid.setWalkableAt(allSnakes[snake].body[0].x, (allSnakes[snake].body[0].y + 1), false);\n }\n if (allSnakes[snake].body[0].y - 1 >= 0) {\n grid.setWalkableAt(allSnakes[snake].body[0].x, (allSnakes[snake].body[0].y - 1), false);\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d786faeb23e695932c0dfe645af38564", "score": "0.6006577", "text": "function drawShip(spaceContainer) {\n\tship.forEach((segment) => {\n\t\tconst shipPosition = document.createElement(\"div\");\n\t\tshipPosition.style.gridRowStart = segment.y;\n\t\tshipPosition.style.gridColumnStart = segment.x;\n\t\tshipPosition.classList.add(\"ship\");\n\t\tspaceContainer.appendChild(shipPosition);\n\t});\n}", "title": "" }, { "docid": "89f3debbda36b00619e4afc05eaa60ec", "score": "0.59769046", "text": "function render() {\n for (i in ships) {\n // console.log(ships[i].position.x)\n // console.log(ships[i])\n ships[i].el.css({\n left: ships[i].position.x,\n top: ships[i].position.y,\n '-webkit-transform': 'rotate(' + ships[i].heading + 'deg)'\n });\n }\n }", "title": "" }, { "docid": "162ec279ffbb24c41cbc45b1249e8887", "score": "0.59296453", "text": "function resetGrid(){\n for(var i = 0; i<cols; i++){ // creating tile objects\n for(var j = 0; j<rows; j++){\n grid[i][j] = new Tile(i, j);\n }\n }\n\n for(var i = 0; i<cols; i++){ // creating tile neighbors\n for(var j = 0; j<rows; j++){\n grid[i][j].addNeighbors(grid);\n }\n }\n \n for(var k = 0; k<w_coords.length; k++){ //update warehouses everytime in the beginning\n grid[w_coords[k][\"coords\"][0]][w_coords[k][\"coords\"][1]].warehouse = true;\n grid[w_coords[k][\"coords\"][0]][w_coords[k][\"coords\"][1]].id = w_coords[k][\"id\"];\n }\n \n for(var k = 0; k<obstacle_coords.length; k++){ //make the unaccessable tiles as obstacles\n grid[obstacle_coords[k][0]][obstacle_coords[k][1]].obstacle = true;\n }\n}", "title": "" }, { "docid": "eb991f3928c8b7867c168313657d2e0a", "score": "0.5927584", "text": "function setBoard()\r\n{\r\n $('.ui-draggable-disabled').remove();\r\n $('#dropSlots').html('');\r\n\r\n for(var i = 1; i <= 7; i++)\r\n {\r\n var tileClass = \"defaultTile\";\r\n\r\n if(i == 2 || i == 6)\r\n {\r\n tileClass = \"doubleTile\";\r\n }\r\n\r\n $('<div></div>').addClass(tileClass).appendTo('#dropSlots').droppable(\r\n {\r\n accept: '#rack div',\r\n drop: handleCardDrop,\r\n }\r\n );\r\n }\r\n}", "title": "" }, { "docid": "360b98e0e642085e93bca2604f254053", "score": "0.5911975", "text": "function playerShipImages() {\n if (ship[0].isVerticle === true) {\n cellsPlayer[ship[0].location[0]].classList.add('destroyer-vert-one')\n cellsPlayer[ship[0].location[1]].classList.add('destroyer-vert-two')\n } else {\n cellsPlayer[ship[0].location[0]].classList.add('destroyer-hori-one')\n cellsPlayer[ship[0].location[1]].classList.add('destroyer-hori-two')\n }\n if (ship[1].isVerticle === true) {\n cellsPlayer[ship[1].location[0]].classList.add('submarine-vert-one')\n cellsPlayer[ship[1].location[1]].classList.add('submarine-vert-two')\n cellsPlayer[ship[1].location[2]].classList.add('submarine-vert-three')\n } else {\n cellsPlayer[ship[1].location[0]].classList.add('submarine-hori-one')\n cellsPlayer[ship[1].location[1]].classList.add('submarine-hori-two')\n cellsPlayer[ship[1].location[2]].classList.add('submarine-hori-three')\n }\n if (ship[2].isVerticle === true) {\n cellsPlayer[ship[2].location[0]].classList.add('carrier-vert-one')\n cellsPlayer[ship[2].location[1]].classList.add('carrier-vert-two')\n cellsPlayer[ship[2].location[2]].classList.add('carrier-vert-three')\n cellsPlayer[ship[2].location[3]].classList.add('carrier-vert-four')\n } else {\n cellsPlayer[ship[2].location[0]].classList.add('carrier-hori-one')\n cellsPlayer[ship[2].location[1]].classList.add('carrier-hori-two')\n cellsPlayer[ship[2].location[2]].classList.add('carrier-hori-three')\n cellsPlayer[ship[2].location[3]].classList.add('carrier-hori-four')\n }\n if (ship[3].isVerticle === true) {\n cellsPlayer[ship[3].location[0]].classList.add('battle-vert-one')\n cellsPlayer[ship[3].location[1]].classList.add('battle-vert-two')\n cellsPlayer[ship[3].location[2]].classList.add('battle-vert-three')\n cellsPlayer[ship[3].location[3]].classList.add('battle-vert-four')\n cellsPlayer[ship[3].location[4]].classList.add('battle-vert-five')\n } else {\n cellsPlayer[ship[3].location[0]].classList.add('battle-hori-one')\n cellsPlayer[ship[3].location[1]].classList.add('battle-hori-two')\n cellsPlayer[ship[3].location[2]].classList.add('battle-hori-three')\n cellsPlayer[ship[3].location[3]].classList.add('battle-hori-four')\n cellsPlayer[ship[3].location[4]].classList.add('battle-hori-five')\n }\n if (ship[4].isVerticle === true) {\n cellsPlayer[ship[4].location[0]].classList.add('mega-vert-one')\n cellsPlayer[ship[4].location[1]].classList.add('mega-vert-two')\n cellsPlayer[ship[4].location[2]].classList.add('mega-vert-three')\n cellsPlayer[ship[4].location[3]].classList.add('mega-vert-four')\n cellsPlayer[ship[4].location[4]].classList.add('mega-vert-five')\n cellsPlayer[ship[4].location[5]].classList.add('mega-vert-six')\n } else {\n cellsPlayer[ship[4].location[0]].classList.add('mega-hori-one')\n cellsPlayer[ship[4].location[1]].classList.add('mega-hori-two')\n cellsPlayer[ship[4].location[2]].classList.add('mega-hori-three')\n cellsPlayer[ship[4].location[3]].classList.add('mega-hori-four')\n cellsPlayer[ship[4].location[4]].classList.add('mega-hori-five')\n cellsPlayer[ship[4].location[5]].classList.add('mega-hori-six')\n }\n }", "title": "" }, { "docid": "66a70ec1505f43e7c49c94f0281c1cf4", "score": "0.5879296", "text": "removeObstacle(gridLocation, gridWidth, gridHeight) {\n for (let x = gridLocation.x; x < gridLocation.x + gridWidth; x++) {\n for (let y = gridLocation.y; y < gridLocation.y + gridHeight; y++) {\n this.set(x, y, 1)\n }\n }\n }", "title": "" }, { "docid": "148204de129419e8006b898bf527f8fb", "score": "0.58653444", "text": "function placeShip() {\n let validShipPlacement = true;\n let currentCell =\n playerGrid[this.getAttribute(\"row\")].cells[this.getAttribute(\"column\")];\n if (gameState == \"placement\" && shipHeld == true) {\n if (heldShipDirection == \"horizontal\") {\n for (let i = 0; i < heldShipSize; i++) {\n if (\n playerGrid[currentCell.row].cells[currentCell.column + i].containsShip\n ) {\n // Prevent Ship Overlap\n validShipPlacement = false;\n } else if (currentCell.column + i > 9) {\n // Verify Ship In Bounds\n validShipPlacement = false;\n }\n }\n if (validShipPlacement) {\n for (let i = 0; i < heldShipSize; i++) {\n // Add Ship Data To Grid Cell\n playerGrid[currentCell.row].cells[\n currentCell.column + i\n ].containsShip = true;\n playerGrid[currentCell.row].cells[\n currentCell.column + i\n ].shipType = heldShipType;\n playerGrid[currentCell.row].cells[\n currentCell.column + i\n ].div.style.backgroundColor = shipColor;\n }\n playerShips[heldShipIndex].placed = true;\n }\n } else {\n for (let i = 0; i < heldShipSize; i++) {\n if (\n playerGrid[currentCell.row + i].cells[currentCell.column].containsShip\n ) {\n // Prevent Ship Overlap\n validShipPlacement = false;\n } else if (currentCell.row + i > 9) {\n // Verify Ship In Bounds\n validShipPlacement = false;\n }\n }\n if (validShipPlacement) {\n for (let i = 0; i < heldShipSize; i++) {\n // Add Ship Data To Grid Cell\n playerGrid[currentCell.row + i].cells[\n currentCell.column\n ].containsShip = true;\n playerGrid[currentCell.row + i].cells[\n currentCell.column\n ].shipType = heldShipType;\n playerGrid[currentCell.row + i].cells[\n currentCell.column\n ].div.style.backgroundColor = shipColor;\n }\n playerShips[heldShipIndex].placed = true;\n }\n }\n // Reset Placement Variables For Next Ship\n shipHeld = false;\n heldShipSize = 0;\n heldShipDirection = \"horizontal\";\n heldShipType = \"\";\n heldShipIndex = -1;\n }\n} // placeShip()", "title": "" }, { "docid": "ea291277d86054d926122ac3711c020f", "score": "0.5850446", "text": "_setPotion(x, y) {\n\tlet dropRate = Math.random();\n\tif (dropRate < 0.3) {\n\t\t// drop\n\t}\n\tlet grid = Array.prototype.slice.call(this.state.entireGrid);\n\t\n\tgrid[x][y] = ['POTION', '_'];\n\tthis.setState({\n\t\tentireGrid: grid\n\t})\n}", "title": "" }, { "docid": "d2c6a4cd9aeba15a3c98c495be5ff115", "score": "0.5815056", "text": "setPoint (value, x, y) {\n this.grid[x][y] = value\n }", "title": "" }, { "docid": "056ea2fcd8ba715d5758e4581e2e529a", "score": "0.5812255", "text": "function placeComputerShips() {\n let issuePlacing = false;\n // Attempts To Place All Ships\n for (let i = 0; i < computerShips.length; i++) {\n let rowIndex;\n let columnIndex;\n // Randomly Determine Ship Direction\n let shipDirection = Math.floor(Math.random() * 2);\n // Randomly Determine Origin Point Within Valid Bounds\n if (shipDirection == 0) {\n heldShipDirection = \"horizontal\";\n columnIndex = Math.floor(Math.random() * (9 - computerShips[i].shipSize));\n rowIndex = Math.floor(Math.random() * 9);\n } else {\n heldShipDirection = \"vertical\";\n rowIndex = Math.floor(Math.random() * (9 - computerShips[i].shipSize));\n columnIndex = Math.floor(Math.random() * 9);\n }\n\n if (!computerShips[i].placed) {\n // Verify That Ship Has Not Been Placed\n let validShipPlacement = true;\n\n if (heldShipDirection == \"horizontal\") {\n for (let j = 0; j < computerShips[i].shipSize; j++) {\n if (computerGrid[rowIndex].cells[columnIndex + j].containsShip) {\n // Prevent Ship Overlap\n validShipPlacement = false;\n }\n }\n if (validShipPlacement) {\n // Add Ship Data To Computer Grid Cells\n for (let j = 0; j < computerShips[i].shipSize; j++) {\n computerGrid[rowIndex].cells[columnIndex + j].containsShip = true;\n computerGrid[rowIndex].cells[columnIndex + j].shipType =\n computerShips[i].shipType;\n }\n computerShips[i].placed = true;\n } else {\n // If Issue Placing (Overlap), Flag For Recursion\n issuePlacing = true;\n }\n } else {\n for (let j = 0; j < computerShips[i].shipSize; j++) {\n if (computerGrid[rowIndex + j].cells[columnIndex].containsShip) {\n // Prevent Ship Overlap\n validShipPlacement = false;\n }\n }\n if (validShipPlacement) {\n // Add Ship Data To Computer Grid Cells\n for (let j = 0; j < computerShips[i].shipSize; j++) {\n computerGrid[rowIndex + j].cells[columnIndex].containsShip = true;\n computerGrid[rowIndex + j].cells[columnIndex].shipType =\n computerShips[i].shipType;\n }\n computerShips[i].placed = true;\n } else {\n // If Issue Placing (Overlap), Flag For Recursion\n issuePlacing = true;\n }\n }\n }\n\n if (issuePlacing) {\n // Recursion To Ensure All Computer Ships Placed\n placeComputerShips();\n }\n }\n} // placeComputerShips()", "title": "" }, { "docid": "d601e9dd5c1b8591f01cce34f8aacc73", "score": "0.5810243", "text": "function setBoard() {\n\n //Get input strings\n //Coordinates for 5 unit ship\n let coor5 = placeText5.value;\n //Coordinates for 4 unit ships\n let coor4A = placeText4A.value;\n let coor4B = placeText4B.value;\n //Coordinates for 4 unit ships\n let coor3A = placeText3A.value;\n let coor3B = placeText3B.value\n\n if (coor5.length == 5 || coor4A.length == 5 || coor4B.length == 5 ||\n coor3A.length == 5 || coor3B.length == 5) {\n //Create 5 unit ship\n ship5 = createShip(coor5, SIZE5, 0);\n //Create 4 unit ships\n ship4A = createShip(coor4A, SIZE4, 1);\n ship4B = createShip(coor4B, SIZE4, 2);\n //Create 3 unit ships\n ship3A = createShip(coor3A, SIZE3, 3);\n ship3B = createShip(coor3B, SIZE3, 4);\n\n //Check for valid ship sizes, if valid start game\n if (ship5.isCorrectSize() && ship4A.isCorrectSize() && ship4B.isCorrectSize() &&\n ship3A.isCorrectSize() && ship3B.isCorrectSize()) {\n //check if any ships are overlapped\n if (!overlap()) {\n\n //Array of ships\n let ships = [ship5, ship4A, ship4B, ship3A, ship3B];\n\n //Generate 2D array representing computer opponent ship placement\n //Generate computer opponent grid\n computerArr = createPositionArr(loadOpponentShips());\n gridCreate(computerArr, 1);\n\n //Generate 2D array representing user ship placement\n //Generate grid with ships placed\n userArr = createPositionArr(ships)\n gridCreate(userArr, 0);\n\n //Load ships into active ships array\n activeCompShips = [compShip5, compShip4A, compShip4B, compShip3A, compShip3B];\n activeUserShips = [ship5, ship4A, ship4B, ship3A, ship3B];\n\n\n //Hide startup stuff\n hideStartup();\n\n //Show fire button\n showPlay();\n\n } else {\n window.alert(\"One or more ships are overlapping. Please re-enter coordinates.\")\n }\n\n } else {\n window.alert(\"Ship coordinates are invalid. Please re-enter coordinates.\");\n }\n } else {\n window.alert(\"Ship coordinates are invalid. Please re-enter coordinates.\");\n }\n\n}", "title": "" }, { "docid": "f799487d210d6a5d7c22cd49d05361e6", "score": "0.5808911", "text": "function resetGrids () {\n for(var key in grids) {\n grids[key].occupiedBy = \"none\";\n grids[key].type = '';\n }\n }", "title": "" }, { "docid": "f799487d210d6a5d7c22cd49d05361e6", "score": "0.5808911", "text": "function resetGrids () {\n for(var key in grids) {\n grids[key].occupiedBy = \"none\";\n grids[key].type = '';\n }\n }", "title": "" }, { "docid": "d95015495dab9361f3ae9a90dfb4ebb6", "score": "0.57854307", "text": "startNewGame() {\n this.setState({\n playerTurn: 'p1',\n ships: {\n 'p1': [],\n 'p2': [],\n },\n });\n this.randomlyPlaceShips();\n }", "title": "" }, { "docid": "6db3c155abf4153738940104ab5634a6", "score": "0.5770713", "text": "function shipsDraggable(playerGrid){\n //adds ui.draggable to ships\n $(playerGrid + ' .ship').draggable({\n grid: [40,40],\n revert: 'invalid',\n snap: 'td',\n handle: '#arrow'\n });\n\n //adds ui.droppable to table's td\n $(playerGrid + ' table td').droppable({\n greedy: true,\n drop: function(event, ui){\n var shipType = findShipType(ui.draggable);\n $(playerGrid + ' td').removeClass(shipType + ' dropped');\n $(this).addClass(shipType + ' dropped');\n setShipSections(playerGrid,shipType);\n },\n out: function(){\n $(this).removeClass('hasShip');\n },\n tolerance: 'pointer'\n });\n}", "title": "" }, { "docid": "1db1106d9c5963eaf3817fca810107af", "score": "0.57662296", "text": "on_mouse_leave() {\n this.ship_ghost_cells = []\n }", "title": "" }, { "docid": "8059c161cd423c252a8664ceb0240d8c", "score": "0.5751427", "text": "randomize(ShipClass = Ship) {\n this.removeAllShips();\n\n for (let size = 4; size >= 1; size--) {\n for (let n = 0; n < 5 - size; n++) {\n const direction = getRandomFrom('row', 'column');\n const ship = new ShipClass(size, direction);\n\n while (!ship.placed) {\n const x = getRandomBetween(0, 9);\n const y = getRandomBetween(0, 9);\n\n this.removeShip(ship);\n this.addShip(ship, x, y);\n }\n }\n }\n }", "title": "" }, { "docid": "842d508ac18e98f8746022894868c72f", "score": "0.5736865", "text": "function markGrid (XorO,spot) {\n \n switch (spot) {\n case 'one':\n gameGrid[0][0] = XorO;\n break;\n case 'two':\n gameGrid[1][0] = XorO;\n break;\n case 'three':\n gameGrid[2][0] = XorO;\n break;\n case 'four':\n gameGrid[0][1] = XorO;\n break;\n case 'five':\n gameGrid[1][1] = XorO;\n break;\n case 'six':\n gameGrid[2][1] = XorO;\n break;\n case 'seven':\n gameGrid[0][2] = XorO;\n break;\n case 'eight':\n gameGrid[1][2] = XorO;\n break;\n case 'nine':\n gameGrid[2][2] = XorO;\n break;\n }\n}", "title": "" }, { "docid": "ff6de3b6cfd32dcf6400c4d059325e53", "score": "0.5732155", "text": "function showShip02() {\n fill(40, 50, 30);\n image(img, ship2.x, ship2.y, img.width, img.height);\n}", "title": "" }, { "docid": "a745efa2614cdeeb58630aa3b75fc72f", "score": "0.57288224", "text": "function setup() {\n grid = $scope.grid = Grid.get(size);\n ScoreManager.score = 0;\n $scope.over = false;\n $scope.won = false;\n\n // Add the initial tiles\n var copy = startTiles;\n while(copy--) {\n grid.addTile();\n }\n }", "title": "" }, { "docid": "a0c7b932c9cec92c98a1b96eb9b2f8cb", "score": "0.5720322", "text": "displayWarpMap(tileArray, h, w, selection) {\n this.mapDisplay.clear();\n for (let i = 0; i < tileArray.length; i++) {\n let x = i % w;\n let y = Math.floor(i/w);\n if (tileArray[i].selection == selection) {\n this.mapDisplay.draw(x, y, tileArray[i].sprite, \"red\", \"darkred\");\n } else {\n this.mapDisplay.draw(x, y, tileArray[i].sprite, tileArray[i].fgColor, tileArray[i].bgColor);\n }\n }\n }", "title": "" }, { "docid": "c839d0cb77ba8c83cc84677b2111e52c", "score": "0.5710432", "text": "function placeVeggieForPlayer(len, row, col, horizontal, player, veg){\n for (let i = 0; i < len; i++) {\n if (horizontal) {\n player.grids[0].gardenGrid[row][col + i].veggie = veg; \n } else {\n player.grids[0].gardenGrid[row + i][col].veggie = veg; \n }\n }\n}", "title": "" }, { "docid": "819947228809f070d56d4abae45768be", "score": "0.57076204", "text": "filterShotsHit(ships) {\n // eslint-disable-next-line\n this.shotsHit = this.shotsHit.filter((cell) => {\n const hitShip = ships.find((ship) => ship.position.includes(cell));\n if (hitShip.isSunk()) {\n this.sunkShipsCells.push(cell);\n } else return true;\n });\n }", "title": "" }, { "docid": "b620a748cc3fc222420df9f229abde99", "score": "0.5707384", "text": "unhideShips() {\n this.ships.forEach(function(ship) {\n ship.drawing.style.display = \"block\";\n });\n }", "title": "" }, { "docid": "73cf579a0d69b947ac87454aa57ce526", "score": "0.5707044", "text": "function update_grid (program)\n {\n var new_tiles = [];\n\n $.each(program, function (channel, show) {\n new_tiles.push(new Tile(show['name'],\n channel,\n show['desc'],\n show['image'],\n show['relevance'],\n show['start'],\n show['duration']));\n });\n\n remove_old(new_tiles);\n add_new(new_tiles);\n\n current_tiles = new_tiles;\n\n $grid.masonry('reloadItems');\n $grid.masonry('layout');\n\n $('.rating').barrating({\n theme: 'fontawesome-stars',\n readonly: true\n });\n }", "title": "" }, { "docid": "1d856bb94fa15c1d0b23409218511844", "score": "0.5704724", "text": "function showShip03() {\n fill(40,200, 30);\n image(img, ship3.x, ship3.y, img.width, img.height);\n }", "title": "" }, { "docid": "befbcdee1d2488a067e7831d917adc37", "score": "0.5690261", "text": "function updateGrid(gx, gy, gw, gh, info, item) {\n var occupied = info.occupied;\n\n var dimension;\n\n var i = occupied.length;\n while (i--) {\n var px = gx + occupied[i][0];\n var py = gy + occupied[i][1];\n\n if (px >= gridWidth || py >= gridHeight || px < 0 || py < 0) {\n continue;\n }\n\n fillGridAt(px, py, dimension, item);\n }\n }", "title": "" }, { "docid": "f64e473a53514012dcc1f1ba3c5b4943", "score": "0.56860626", "text": "place(board) {\n for (let stone of this.stones) {\n board.squares[stone[0]][stone[1]] = this;\n }\n }", "title": "" }, { "docid": "b35f99b6ed93b2ae80411fad12c87329", "score": "0.5682282", "text": "placePieces(){\n let pos = 7;\n let color = 'W';\n let heightP = 13;\n let heigtR = 15; \n for(let i = 1; i <= 2; i++){\n if(i == 2){\n color = 'B';\n heightP = 3;\n heigtR = 1;\n pos = 2;\n } \n // Pawn positions\n this.board.getSquares()[pos][0].setPiece(new Pawn(Utils.CENTER_PIECE * 1,Utils.CENTER_PIECE * heightP, this,'pawn' + color,i));\n this.board.getSquares()[pos][1].setPiece(new Pawn(Utils.CENTER_PIECE * 3,Utils.CENTER_PIECE * heightP, this,'pawn' + color,i))\n this.board.getSquares()[pos][2].setPiece(new Pawn(Utils.CENTER_PIECE * 5,Utils.CENTER_PIECE * heightP, this,'pawn' + color,i));\n this.board.getSquares()[pos][3].setPiece(new Pawn(Utils.CENTER_PIECE * 7,Utils.CENTER_PIECE * heightP, this,'pawn' + color,i));\n this.board.getSquares()[pos][4].setPiece(new Pawn(Utils.CENTER_PIECE * 9,Utils.CENTER_PIECE * heightP, this,'pawn' + color,i));\n this.board.getSquares()[pos][5].setPiece(new Pawn(Utils.CENTER_PIECE * 11,Utils.CENTER_PIECE * heightP, this,'pawn' + color,i));\n this.board.getSquares()[pos][6].setPiece(new Pawn(Utils.CENTER_PIECE * 13,Utils.CENTER_PIECE * heightP, this,'pawn' + color,i));\n this.board.getSquares()[pos][7].setPiece(new Pawn(Utils.CENTER_PIECE * 15,Utils.CENTER_PIECE * heightP, this,'pawn' + color,i));\n \n pos = (pos == 2 && color == 'B') ? 0 : pos;\n\n // Other pieces positions\n this.board.getSquares()[pos+1][0].setPiece(new Rook(Utils.CENTER_PIECE * 1, Utils.CENTER_PIECE * heigtR, this, 'rook' + color,i));\n this.board.getSquares()[pos+1][1].setPiece(new Rook(Utils.CENTER_PIECE * 15, Utils.CENTER_PIECE * heigtR, this, 'rook' + color,i));\n this.board.getSquares()[pos+1][2].setPiece(new Horse(Utils.CENTER_PIECE * 3, Utils.CENTER_PIECE * heigtR, this, 'horse' + color,i));\n this.board.getSquares()[pos+1][3].setPiece(new Horse(Utils.CENTER_PIECE * 13, Utils.CENTER_PIECE * heigtR, this, 'horse' + color,i));\n this.board.getSquares()[pos+1][4].setPiece(new Bishop(Utils.CENTER_PIECE * 5, Utils.CENTER_PIECE * heigtR, this, 'bishop' + color,i));\n this.board.getSquares()[pos+1][5].setPiece(new Bishop(Utils.CENTER_PIECE * 11, Utils.CENTER_PIECE * heigtR, this, 'bishop' + color,i));\n this.board.getSquares()[pos+1][6].setPiece(new Queen(Utils.CENTER_PIECE * 7, Utils.CENTER_PIECE * heigtR, this, 'queen' + color, i));\n this.board.getSquares()[pos+1][7].setPiece(new King(Utils.CENTER_PIECE * 9, Utils.CENTER_PIECE * heigtR, this, 'king' + color, i));\n }\n }", "title": "" }, { "docid": "76c56baa34b1666d11ce12e5cd44c5c6", "score": "0.56594354", "text": "function randomizeShipPlacement(spaces) {\n // Helper function to check if a square is valid and empty\n const isEmpty = (row, col) => {\n return spaces[row]\n && spaces[row][col]\n && spaces[row][col].status === STATUS.EMPTY;\n };\n\n // Place each ship from largest to smallest (hardcoded to 5 ships)\n for (let shipType = 5; shipType > 0; shipType--) {\n let shipSize = SHIP_SIZE[shipType];\n let startRow;\n let startCol;\n let isHorizontal;\n let isValid;\n do {\n // Choose a random start position and direction\n startRow = Math.floor(Math.random() * 10);\n startCol = Math.floor(Math.random() * 10);\n isHorizontal = Math.round(Math.random());\n\n // Check each would-be space\n // TODO: Refactor to use existing state.isValidPlacement()\n isValid = true;\n for (let i = 0; i < shipSize; i++) {\n if (isHorizontal) {\n isValid &= isEmpty(startRow, startCol + i);\n } else {\n isValid &= isEmpty(startRow + i, startCol);\n }\n }\n // Repeat until a valid start position and direction are found\n } while (!isValid);\n\n // Place the ship by setting each square's status and shipType\n // TODO: Refactor to use existing state.placeShip()\n for (let j = 0; j < shipSize; j++) {\n if (isHorizontal) {\n spaces[startRow][startCol + j].status = STATUS.ALIVE;\n spaces[startRow][startCol + j].ship = shipType;\n } else {\n spaces[startRow + j][startCol].status = STATUS.ALIVE;\n spaces[startRow + j][startCol].ship = shipType;\n }\n }\n }\n}", "title": "" }, { "docid": "171197defbc354604577d2d922484550", "score": "0.5654206", "text": "renderWorld(offSet, leftRight, topDown){\n\n offSet = offSet * topDown * 66;\n //offSet=offSet;\n\n //Create background images\n for (var topLeft = 0; topLeft < leftRight; topLeft = topLeft +1){\n\n var fullOff = topLeft*107;\n\n var iArr = [];\n for(var rightOff = 0; rightOff < topDown; rightOff = rightOff +1){\n iArr.push({x:66*rightOff+offSet,y:fullOff});\n //this.grid.push({x:66*rightOff+offSet,y:fullOff});\n }\n this.grid.push(iArr);\n\n iArr = [];\n for(var rightOff = 0; rightOff < topDown; rightOff = rightOff +1){\n iArr.push({x:66*rightOff-65/2+offSet,y:fullOff+53});\n }\n this.grid.push(iArr);\n }\n\n\n //Fill all grid elements with random tiles\n for (var xPos = 0; xPos < leftRight; xPos = xPos +1){\n for(var yPos = 0; yPos < topDown; yPos = yPos +1){\n this.grid[xPos][yPos].tile =\n this.addSprite(xPos, yPos, Assets.tiles[Math.floor(Math.random()*Assets.tiles.length)]);\n }\n }\n\n }", "title": "" }, { "docid": "8f6b1df1eb56e6729e0eaea90311a9bb", "score": "0.56532186", "text": "function init() {\n //initialize map and game object array\n map = [\n [0, 0, 3, 0, 1, 0, 0, 0],\n [0, 1, 0, 0, 0, 1, 0, 1],\n [2, 0, 0, 0, 2, 0, 0, 0],\n [0, 0, 1, 0, 0, 0, 0, 1],\n [0, 2, 0, 0, 2, 0, 2, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 2, 1, 2, 0, 0, 2, 0],\n [0, 0, 0, 0, 0, 0, 1, 0]\n ];\n\n gameObjects = [\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 4, 0, 0, 5, 0, 0]\n ];\n //Initialize ROWS and COLUMNS\n ROWS = map.length;\n COLUMNS = map[0].length;\n\n //initialize ship and alien positions\n //Loop through game object map to find ship and alien\n for (var thisRow = 0; thisRow < ROWS; thisRow++) {\n for (var thisCol = 0; thisCol < COLUMNS; thisCol++) {\n if (gameObjects[thisRow][thisCol] === SHIP) {\n shipRow = thisRow;\n shipCol = thisCol;\n } else if (gameObjects[thisRow][thisCol] === ALIEN) {\n alienRow = thisRow;\n alienCol = thisCol;\n }\n }\n }\n}", "title": "" }, { "docid": "c433fc9418df7ac55ed01c4b293d887b", "score": "0.5651024", "text": "function initializeShipto() {\n $('shiptoBean').style.height = \"200px\";\n sgrid = new dhtmlXGridObject('shiptoBean');\n\n initGridWithConfigForPopUp(sgrid, shipToConfig, -1, true);\n\n if (typeof(shipToData) != 'undefined') {\n sgrid.parse(shipToData, \"json\");\n }\n \n sgrid.attachEvent(\"onBeforeSelect\",sDoOnBeforeSelect);\n sgrid.attachEvent(\"onRowSelect\", sSelectRow);\n sgrid.attachEvent(\"onRightClick\", shipToRightclick);\n sgrid.enableEditEvents(true,false,false);\n}", "title": "" }, { "docid": "77375550a118ab5fd2606dab2ec96a3f", "score": "0.56487757", "text": "function computerPlace() {\n let computerComplete = false;\n while (computerComplete === false) {\n let spot = computerPlaceCheck();\n if (rotate === false) {\n $('#P2-grid-container').children(`div [data-id|=\"${row}${column}\"]`).data(\"ship\", `P1${shipName[ships]}`).addClass(`ship`);\n for (let i = 1; i < shipSize[compShips]; i++) {\n let rowIndex = rowArray.indexOf(spot[0]) + i\n let row = rowArray[rowIndex];\n let column = spot[1];\n\n $('#P2-grid-container').children(`div [data-id|=\"${row}${column}\"]`).data(\"ship\", `P1${shipName[ships]}`).addClass(`ship`);\n }\n } else {\n $('#P2-grid-container').children(`div [data-id|=\"${row}${column}\"]`).data(\"ship\", `P1${shipName[ships]}`).addClass(`ship`);\n for (let i = 1; i < shipSize[compShips]; i++) {\n let rowIndex = rowArray.indexOf(spot[0])\n let row = rowArray[rowIndex];\n let column = Number(spot[1]) + i;\n\n $('#P2-grid-container').children(`div [data-id|=\"${row}${column}\"]`).data(\"ship\", `P1${shipName[ships]}`).addClass(`ship`);\n }\n }\n if (compShips <= 3) {\n compShips += 1;\n } else {\n computerComplete = true;\n }\n }\n}", "title": "" }, { "docid": "4614bcd49016669975ef2ed891e0acef", "score": "0.56470096", "text": "setGridPosition(x, y){\n this.gridX = x;\n this.gridY = y;\n this.renderX = x * config.ts;\n this.renderY = y * config.ts;\n }", "title": "" }, { "docid": "aa9fb82c23cbd1181b19a514989532c4", "score": "0.56404096", "text": "function render() {\n const px = 32; const size = 64;\n c.clearRect(0,0,endX,endY);\n for (i = 0; i<imgW/px; i++) {\n if (flag) \n c.drawImage(myShips, i*px,0,px,px,\n midX,100+(i*size),size,size);\n }\n requestAnimationFrame(render);\n}", "title": "" }, { "docid": "6bbbb28b83b82c464dba749a92603069", "score": "0.5638168", "text": "function placeTileOnGrid(tile) { \n for(var key in grids) {\n if (grids[key].occupiedBy == \"none\") {\n if (tile.size == \"small\") {\n grids[key].occupiedBy = tile.id;\n grids[key].type = 'startGrid';\n //console.log(key + \" is will hold \" + tile.size + \" tile id=\"+tile.id);\n return(key);\n } else {\n if (canItHoldTile(grids[key].id, tile.size)) {\n markGridsOccupied(grids[key].id, tile.size, tile.id);\n grids[key].type = 'startGrid';\n return(key);\n }\n }\n }\n }\n console.log('No Grid Avaialble for Tile id='+tile.id);\n }", "title": "" }, { "docid": "6bbbb28b83b82c464dba749a92603069", "score": "0.5638168", "text": "function placeTileOnGrid(tile) { \n for(var key in grids) {\n if (grids[key].occupiedBy == \"none\") {\n if (tile.size == \"small\") {\n grids[key].occupiedBy = tile.id;\n grids[key].type = 'startGrid';\n //console.log(key + \" is will hold \" + tile.size + \" tile id=\"+tile.id);\n return(key);\n } else {\n if (canItHoldTile(grids[key].id, tile.size)) {\n markGridsOccupied(grids[key].id, tile.size, tile.id);\n grids[key].type = 'startGrid';\n return(key);\n }\n }\n }\n }\n console.log('No Grid Avaialble for Tile id='+tile.id);\n }", "title": "" }, { "docid": "f7f7324fa63340bc4eb318849f1a1b76", "score": "0.5631062", "text": "function putShipSurroundingsOnBoard(shipId, shipSurroundingCoordinates, board) {\n\n var surId = -1 * shipId;\n\n for (var i = 0; i < shipSurroundingCoordinates.length; i++) {\n var col = shipSurroundingCoordinates[i][0];\n var row = shipSurroundingCoordinates[i][1];\n board[col][row] = surId;\n }\n\n\n return board;\n\n}", "title": "" }, { "docid": "863f92287063873feed1120b8abed647", "score": "0.5630533", "text": "initialize(grid){}", "title": "" }, { "docid": "3c53f2a4346ac0389c65c8b2388e73f8", "score": "0.56300956", "text": "function reposition(){\n magicGrid.positionItems();\n}", "title": "" }, { "docid": "45bdad07fb5563089a8b4b09dd0e593d", "score": "0.5629206", "text": "function createShip(numOfSquaresToFill, shipIndex) {\n\n //* horizontal or vertical?\n function horizontalOrVertical() {\n const num = Math.floor(Math.random() * 2)\n if (num === 0) {\n createVerticalShip()\n } else {\n createHorizontalShip() // currently calling vertical ship again for testing, you need to change this back\n }\n }\n\n //* creating verticle ship\n function createVerticalShip() {\n //generate starting number\n const startingPoint = Math.floor(Math.random() * (cellsPlayer.length - ((numOfSquaresToFill * width) + 10)))\n // while random number is a reserved number, regenerate\n if (reservedSpaces.includes(startingPoint)) {\n return createShip(numOfSquaresToFill, shipIndex)\n }\n //this variable holds the starting point initially and then the next index is added in the loop below\n const currentShip = [startingPoint]\n // calculate rest of ship and put into current ship array\n for (let i = 1; i < numOfSquaresToFill; i++) {\n const shipBodyPart = startingPoint + (10 * i)\n if (reservedSpaces.includes(shipBodyPart)) {\n // if any part of the body is in reserved space, redo function (without having stored anything!)\n return createShip(numOfSquaresToFill, shipIndex)\n } else {\n currentShip.push(shipBodyPart)\n }\n }\n ship[shipIndex].location = currentShip //add current ship to the ship object\n ship[shipIndex].isVerticle = true\n for (let i = 0; i < ship[shipIndex].location.length; i++) {\n cellsPlayer[ship[shipIndex].location[i]].classList.add('ship')\n //add index to reserved spaces array\n reservedSpaces.push(ship[shipIndex].location[i])\n }\n }\n\n //* creating horizontal ship\n function createHorizontalShip() {\n // create array of suitable starting numbers to choose from\n const newArray = []\n for (let i = 0; i < cellsPlayer.length; i++) {\n if (i % width < (width - (numOfSquaresToFill - 1))) {\n newArray.push(i)\n }\n }\n // generate starting index and starting number from above array\n const startingPointIndex = Math.floor(Math.random() * newArray.length)\n const startingPoint = newArray[startingPointIndex]\n // while random number is a reserved number, regenerate\n if (reservedSpaces.includes(startingPoint)) {\n return createShip(numOfSquaresToFill, shipIndex)\n }\n // this variable holds the starting point initially and then the next index is added in the loop below\n const currentShip = [startingPoint]\n //calculate the rest of the ship and put into the current array\n for (let i = 1; i < numOfSquaresToFill; i++) {\n const shipBodyPart = startingPoint + (1 * i)\n if (reservedSpaces.includes(shipBodyPart)) {\n // if any part of the body is in reserved space, redo function (without having stored anything!)\n return createShip(numOfSquaresToFill, shipIndex)\n } else {\n currentShip.push(shipBodyPart)\n }\n }\n //add the current ship to the ship object\n ship[shipIndex].location = currentShip\n ship[shipIndex].isVerticle = false\n for (let i = 0; i < ship[shipIndex].size; i++) {\n cellsPlayer[ship[shipIndex].location[i]].classList.add('ship')\n reservedSpaces.push(ship[shipIndex].location[i])\n }\n }\n horizontalOrVertical()\n }", "title": "" }, { "docid": "e1cfdd3049a3911dfcb4e957235d9b06", "score": "0.56230676", "text": "hideShips() {\n this.ships.forEach(function(ship) {\n ship.drawing.style.display = \"none\";\n });\n }", "title": "" }, { "docid": "f618c9c851fcfdec5077b78895c39966", "score": "0.561717", "text": "function placeShip() {\n\n\t \t\t// If Ship is vertical:\n\t \t\tif(isVertical) {\n\t\t\t\t// Generate random X-coordinate;\n\t\t\t\tlet col = Math.floor(Math.random()*9);\n\t\t\t\t// Generate random Y-coordinate between 0 and (10 - size);\n\t\t\t\tlet row = Math.floor(Math.random()*(10 - getSize));\n\t \t\t\t// Increment the row to place Ship vertically;\n\t \t\t\tfor(let i = getSize; i > 0; i--) {\n\t\t\t\t\t// Determine gameArray index corresponding to (col, row);\n\t\t\t\t\tlet index = convertCoordsToIndex(col, row);\n \t\t\t\t\t// If the space is unoccupied:\n \t\t\t\t\tif(gameArray[index] == 0) {\n \t\t\t\t\t// place the ship\n \t\t\t\t\tgameArray[index] = getSymbol;\n\t\t\t\t\t\t// Update row to continue placing ship;\n\t\t\t\t\t\trow++;\n\t\t\t\t\t// Else: reset spaces to empty; try again;\n \t\t\t\t\t} else {\n\t\t\t // Reset any indices of gameArray to 0 to restart process;\n\t\t\t for(let i = getSize; i > 0; i--) {\n\t\t\t\t gameArray[index] = 0;\n\t\t\t // Recursive case:\n\t\t\t placeShip();\n\t\t\t // Return to end this call in the callstack;\n\t\t\t return;\n\t\t \t}\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t// If Ship is horizontal:\n\t \t\t} else {\n\t\t\t\t// Generate random X-coordinate between 0 and (10 - size);\n\t\t\t\tlet col = Math.floor(Math.random()*(10 - getSize));\n\t\t\t\t// Generate random Y-coordinate between 0 and 9;\n\t\t\t\tlet row = Math.floor(Math.random()*9);\n\t \t\t\t// Increment the col to place Ship sideways;\n\t \t\t\tfor(let i = getSize; i > 0; i--) {\n\t\t\t\t\t// Determine gameArray index corresponding to (col, row);\n\t\t\t\t\tlet index = convertCoordsToIndex(col, row);\n \t\t// If that space is available:\n \t\t\t\t\tif(gameArray[index] == 0) {\n \t\t\t\t\t\t// ...place the Ship;\n \t\t\t\t\t\tgameArray[index] = getSymbol;\n\t\t\t\t\t\t// Update the column to place the ship;\n\t\t\t\t\t\tcol++;\n \t\t\t\t\t}\n \t\t\t// Recursive case:\n \t\t\t\t\t else {\n \t\t\tplaceShip();\n \t\t\t// Return to end this call in the callstack;\n \t\t\treturn;\n \t\t}\n\t \t\t\t}\n\t \t }\n\t\t // Base case: exit function, having placed the ship in question;\n\t\t return;\n\t}", "title": "" }, { "docid": "e2347990cb3078352f577ddd68991606", "score": "0.5612198", "text": "function init() {\n\t_grid = [];\n\tmakeGridArray();\n\tdrawPineapple();\n}", "title": "" }, { "docid": "cae4644f9ec0e163133788206fe44dcd", "score": "0.56120205", "text": "function updateGrid() {\n if(_offsetY < TILE_EDGE_MINUS) {\n // take a row of cells from the top and move them to the bottom\n shiftPush(_gameGrid);\n _offsetY += TILE_EDGE;\n }\n if(_offsetX < TILE_EDGE_MINUS) {\n // gotta take one from the left and put it on the right\n _gameGrid.forEach(shiftPush);\n _offsetX += TILE_EDGE;\n } else if (_offsetX > TILE_EDGE) {\n // gotta take one from the right and put it on the left\n _gameGrid.forEach(popSplice);\n _offsetX -= TILE_EDGE;\n }\n\n // updated all locations\n var y = _gameGrid.length + _offsetY;\n for(var i=0; i<_maxRows; i++) {\n var row = _gameGrid[i];\n var x = _offsetX;\n for(var j=0; j<_maxCols; j++) {\n row[j].x = x;\n row[j].y = y;\n x += TILE_EDGE;\n }\n y += TILE_EDGE;\n }\n }", "title": "" }, { "docid": "0026db3c7e39027bc0df5b323aa064fb", "score": "0.5611648", "text": "function placeVerticalShips(length, number) {\n //counts the number of ships that have been made\n var shipsPlaced = 0;\n do {\n //generates a random column between 0 and 9\n var column = Math.floor(Math.random()*10);//declaring random row\n //generates a random row between 0 and 10-length\n var row = Math.floor(Math.random()*(11-length));//declaring random column\n //checks if the area is clear\n if (checkIfEmptyVertical(row, column, length) === true) {\n //adds one to shipsOnBoard (so that each ship can be given a unique value)\n shipsOnBoard++;\n //loops through all the squares in the column for the length of the ship\n for (var i=0; i<length; i++) {\n //creates a unique value for each ship (ex: ship1, ship2, ship3) and assigns it to each of the ship's places in the board array\n board[row+i][column] = \"ship\" + shipsOnBoard;\n }\n //counts that a ship has been successfully placed\n shipsPlaced++;\n }\n //loops until the number of ships placed is equal to number\n } while (shipsPlaced < number );\n}", "title": "" }, { "docid": "d5589b6e525282e2666a7b41454ececb", "score": "0.5603874", "text": "generateBoard() {\n this.spots = []\n for (var i = 0; i < this.height * this.width; i++) {\n this.spots.push({ cleared: false, flagged: false, mine: false })\n }\n }", "title": "" }, { "docid": "c2239d622c6a3a0387dab4dd3d68700c", "score": "0.56006277", "text": "function rotateShips(playerGrid){\n $(playerGrid + ' #rotate').click(function(){\n var clickedShip = $(playerGrid + ' .selected');\n var shipsCell = $(playerGrid + ' .dropped');\n var dataShip = clickedShip.attr('data-ship');\n clickedShip.toggleClass(dataShip + '-horizontal').toggleClass(dataShip + '-vertical');\n shipsCell.toggleClass(dataShip + '-horizontal').toggleClass(dataShip + '-vertical');\n var shipType = findShipType(clickedShip);\n setShipSections(playerGrid, shipType);\n });\n}", "title": "" }, { "docid": "3cf1ec8127647c8e909242c703249128", "score": "0.5589186", "text": "set Tile(value) {}", "title": "" }, { "docid": "62f903e236b7548addb252ac0db54e4a", "score": "0.55882263", "text": "function createGrid() {\n var id = PIXI.loader.resources[\"sprites/spriteSheet.json\"].textures;\n for (let i = 0; i < maxRow; i++) {\n boardArray[i] = new Array();\n for (let j = 0; j < maxCol; j++) {\n var s = new slot(\"null\", null);\n s.sprite = new Sprite(id[\"checker.png\"]);\n boardArray[i][j] = s;\n s.sprite.visible = false;\n s.sprite.position.set(70 * i, 70 * j);\n //Positon the elements of the array inside the background image.\n s.sprite.position.x += (gridImage.position.x - gridImage.width / 2);\n s.sprite.position.y += (gridImage.position.y - gridImage.height / 2);\n stage.addChild(s.sprite);\n }\n }\n return boardArray;\n}", "title": "" }, { "docid": "718dc8e66102c189292f708634399c00", "score": "0.55867994", "text": "function createGrid() {\n for (let i=0; i < layout.length; i++) {\n const square = document.createElement('div');\n grid.appendChild(square);\n squares.push(square);\n\n // add layout to the board\n if (layout[i] === 0) {\n squares[i].classList.add('pac-dot', 'dot');\n } else if (layout[i] === 1) {\n squares[i].classList.add('wall');\n } else if (layout[i] === 2) {\n squares[i].classList.add('ghost-lair')\n } else if (layout[i] === 3) {\n squares[i].classList.add('power-pellet');\n }\n }\n }", "title": "" }, { "docid": "4f81993a8a8226ca6041f32bef9658fa", "score": "0.55814344", "text": "initGame() {\n this.grid = [...Array(this.height)].map(x=>Array(this.width).fill(this.states.NONE));\n this.currentPlayer = this.states.PLAYER1;\n this.gameover = false;\n }", "title": "" }, { "docid": "fd48100e48a445e3a76d40782003a348", "score": "0.5580016", "text": "resets(){\n this.xPos = 200;\n this.yPos = 404;\n this.findMyLane();\n }", "title": "" }, { "docid": "f75190871c91f06cf0fb032260cf3973", "score": "0.5576976", "text": "setRandomGrid(cols, rows) {\n this.cols = cols;\n this.rows = rows;\n for (let i = 0; i < rows; i++) {\n this.grid.push([]);\n for (let j = 0; j < cols; j++) {\n let random = utils.randomNumber(10);\n this.grid[i].push(random);\n }\n }\n }", "title": "" }, { "docid": "0994806d5816748421884cf61fe9b615", "score": "0.5575738", "text": "function randomPlacement(ship) {\n // randomly setting the computer ship to be placed horizontally or vertically (choosing which index in our direction array above)\n // will be 0 or 1\n let randomDirection = Math.floor(Math.random() * ship.directions.length);\n // choosing either index 0 or index 1 of array above\n let current = ship.directions[randomDirection];\n // if horizontal we will incrememt by 1\n if (randomDirection === 0) {\n direction = 1;\n }\n // if vertical we will increment by 10 (our grid is 10 by 10)\n if (randomDirection === 1) {\n direction = 10;\n }\n // console.log(\"this is randomdirection\", randomDirection)\n // console.log(\"this is current\", current)\n // console.log(\"this is direction\", direction);\n // console.log(\"this is ship's length\", ship.directions[0].length)\n // checking to see if any of squares are already taken by a different ship\n\n // setting our random starting square for each ship\n // let randomStartSquare = (Math.floor(Math.random() * 99));\n\n let randomStartSquare = Math.abs(Math.floor(Math.random() * computerSquares.length - (ship.directions[0].length * direction)))\n\n\n // console.log(\"this is randomStartSquare\", randomStartSquare)\n const isTaken = current.some(index => computerSquares[randomStartSquare + index].classList.contains(\"taken\"));\n\n // checking to see if we're at the right edge (not where we want to be because we can't build out our ship)\n const isAtRightEdge = current.some(index => (randomStartSquare + index) % width === width - 1);\n // checking to see if we're at the left edge\n const isAtLeftEdge = current.some(index => (randomStartSquare + index) % width === 0);\n\n // if it's not taken, if it's not at the right edge, and its not at the left edge, we can add class taken\n if (!isTaken && !isAtRightEdge && !isAtLeftEdge) {\n current.forEach(index => computerSquares[randomStartSquare + index].classList.add(\"taken\", ship.name));\n } else randomPlacement(ship);\n}", "title": "" }, { "docid": "567fd81b5db131c0fa77957db55cff4a", "score": "0.55642366", "text": "GridStyle(total_x, total_y, w, h, srcImage_Path)\n {\n\n if(!(this.grid instanceof Array))\n {\n this.grid = [];\n }\n\n function GridUnit(x, y, w, h, srcImage_Path){\n\n var size = new Gamelab.Vector(w, h),\n position = new Gamelab.Vector(x, y);\n\n var sprite;\n\n if(srcImage_Path)\n {\n sprite = new Gamelab.Sprite(srcImage_Path);\n sprite.Size(size);\n sprite.Pos(position);\n\n Gamelab.game_windows[0].add(sprite);\n }\n\n return {\n size:size,\n position:position\n };\n };\n\n for(var y = 0; y < total_y; y++)\n {\n\n for(var x = 0; x < total_x; x++)\n {\n\n this.grid.push(new GridUnit(x * w, y * h, w, h, srcImage_Path));\n\n }\n\n }\n return this;\n }", "title": "" }, { "docid": "f9cc6b1e0773938ec2501f8af7b82ccc", "score": "0.5554436", "text": "function placePlayerShips() {\n placePlayerShip(\"aircraft carrier\", 5, function() {\n placePlayerShip(\"battleship\", 4, function() {\n placePlayerShip(\"submarine\", 3, function() {\n placePlayerShip(\"destroyer\", 3, function() {\n placePlayerShip(\"patrol boat\", 2, play);\n });\n });\n });\n });\n}", "title": "" }, { "docid": "f9ef9f47db01bffaeeb528fa9b27cb0e", "score": "0.5542872", "text": "function writeGrid() {\n \n // Clear the grid\n \tgrid.init(EMPTY, COLS, ROWS);\n\n \t// Write snake 1 onto the grid\n \tfor (var i = 0; snake1._queue != null && i < snake1._queue.length; i++) {\n \tgrid.set(SNAKE1, snake1._queue[i][\"x\"], snake1._queue[i][\"y\"]);\n \t}\n\n \t// Write snake 2 onto the grid\n \tfor (var i = 0; snake2._queue != null && i < snake2._queue.length; i++) {\n \tgrid.set(SNAKE2, snake2._queue[i][\"x\"], snake2._queue[i][\"y\"]);\n \t}\n \n // Write the apple onto the grid\n grid.set(FRUIT, applePosition[\"x\"], applePosition[\"y\"]); \n}", "title": "" }, { "docid": "d1a363b2862538c46c2b08051ab87385", "score": "0.55414164", "text": "function placeShip(coords, shipType, direction) {\n let board = this.playerBoards[coords.userId].spaces;\n let shipSize = SHIP_SIZE[shipType];\n \n if (direction === 'h') {\n for (let i = 0; i < shipSize; i++) {\n board[coords.row][coords.col + i].ship = shipType;\n board[coords.row][coords.col + i].status = STATUS.ALIVE;\n }\n } else {\n for (let i = 0; i < shipSize; i++) {\n board[coords.row + i][coords.col].ship = shipType;\n board[coords.row + i][coords.col].status = STATUS.ALIVE;\n }\n }\n}", "title": "" }, { "docid": "a220d14c8314d52e3dba759776e9e3a0", "score": "0.5541074", "text": "function DirectionGrid(parent, x, y){\n \n this.xPos = x;\n this.yPos = y;\n this.parent = parent;\n this.background = null;\n this.ships = []; \n \n var that = this;\n \n this.saveBackground = function(x, y){\n this.background = {x: x, y: y, image: this.parent.context.getImageData(x, y, that.width, that.height)}\n }\n \n function init()\n {\n that.width = that.parent.pitch*3;\n that.height = that.parent.pitch+10;\n that.ships[0] = new Ship(that.parent, that.xPos + that.width/10, that.yPos, 1, 0);\n that.ships[1] = new Ship(that.parent, that.xPos + that.width - that.width/10 - that.parent.pitch, that.yPos, 1, 1);\n }\n\n this.highlight = function() {\n that.parent.context.fillStyle = \"rgba(255, 255, 255, 0.4)\";\n that.parent.context.fillRect(that.xPos, that.yPos-5, that.width, that.height);\n }\n \n /*\n * Draw Vertical or horizontal direction option grid and highlight \n * the selected option\n */\n this.draw = function(){\n if(that.background == null)\n {\n that.saveBackground(that.xPos, that.yPos);\n }\n that.parent.context.clearRect(that.xPos, that.yPos-5, that.width, that.height);\n that.parent.context.putImageData(that.background.image, that.xPos, that.yPos-5);\n that.highlight();\n that.ships[0].draw();\n that.ships[1].draw();\n that.ships[that.parent.shipDirection].highlight();\n } \n \n init();\n \n }", "title": "" }, { "docid": "4b75319b935ef33391837bd97e778258", "score": "0.5540498", "text": "function dragDrop() {\r\n let shipNameWithLastId = draggedShip.lastChild.id;\r\n let shipClass = shipNameWithLastId.slice(0, -2);\r\n let lastShipIndex = parseInt(shipNameWithLastId.substr(-1));\r\n let shipLastId = lastShipIndex + parseInt(this.dataset.id);\r\n\r\n //Do not allow ships to be placed on these specific spaces on the player's grid.\r\n const spacesNotAllowedHorizontal = [0,10,20,30,40,50,60,70,80,90,1,11,21,31,41,51,61,71,81,91,2,22,32,42,52,62,72,82,92,3,13,23,33,43,53,63,73,83,93];\r\n const spacesNotAllowedVertical = [99,98,97,96,95,94,93,92,91,90,89,88,87,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,71,70,69,68,67,66,65,64,63,62,61,60];\r\n \r\n let newSpacesNotAllowedHorizontal = spacesNotAllowedHorizontal.splice(0, 10 * lastShipIndex);\r\n let newSpacesNotAllowedVertical = spacesNotAllowedVertical.splice(0, 10 * lastShipIndex);\r\n\r\n selectedShipIndex = parseInt(selectedShipNameWithIndex.substr(-1));\r\n\r\n shipLastId = shipLastId - selectedShipIndex;\r\n\r\n if (setHorizontal && !newSpacesNotAllowedHorizontal.includes(shipLastId)) {\r\n for (let i=0; i < draggedShipLength; i++) {\r\n let directionClass;\r\n if (i === 0) directionClass = 'start';\r\n if (i === draggedShipLength - 1) directionClass = 'end';\r\n userSquares[parseInt(this.dataset.id) - selectedShipIndex + i].classList.add('taken', 'horizontal', directionClass, shipClass);\r\n }\r\n }\r\n\r\n //As long as a ship isn't dragged out of bounds, or within any of the spaces not allowed array your ship will be placed on the grid\r\n //if they do meet those conditions they will not appear of the grid \r\n else if (!setHorizontal && !newSpacesNotAllowedVertical.includes(shipLastId)) {\r\n for (let i=0; i < draggedShipLength; i++) {\r\n let directionClass;\r\n if (i === 0) directionClass = 'start';\r\n if (i === draggedShipLength - 1) directionClass = 'end';\r\n userSquares[parseInt(this.dataset.id) - selectedShipIndex + width*i].classList.add('taken', 'vertical', directionClass, shipClass);\r\n }\r\n } \r\n else {\r\n return;\r\n }\r\n\r\n displayGrid.removeChild(draggedShip);\r\n if(!displayGrid.querySelector('.ship')) allShipsPlaced = true;\r\n }", "title": "" }, { "docid": "21d61ace491fbbaf3123ffea074e9554", "score": "0.5540264", "text": "function mapTilesToGrid () {\n var clearSpaceDivPosition = 0;\n for (var i in tiles) {\n //console.log(\"sending for tile id=\"+tiles[i].id);\n gridId = placeTileOnGrid (tiles[i]);\n tiles[i].gridId = gridId;\n \n tiles[i].width = (tiles[i].size == \"small\") ? small_tile_size : ((tiles[i].size == \"medium\") ? medium_tile_size : big_tile_size);\n tiles[i].height = (tiles[i].size == \"small\") ? small_tile_size : ((tiles[i].size == \"big\") ? big_tile_size : medium_tile_size); \n tiles[i].bgColor = tiles[i].bgColor || colorCodes[Math.floor(Math.random()*colorCodes.length)];\n tiles[i].top = grids[gridId].top;\n tiles[i].left = grids[gridId].left;\n \n clearSpaceDivPosition = ((tiles[i].top+tiles[i].height) > clearSpaceDivPosition) ? (tiles[i].top+tiles[i].height) : clearSpaceDivPosition; \n }\n \n TM.clearSpaceDivPosition = clearSpaceDivPosition;\n }", "title": "" }, { "docid": "81d7e8f70f3a10de5d29e552fbc3b2eb", "score": "0.55383945", "text": "setTiles() {\n const {\n backgroundColor: {\n primaryColor,\n tileColors,\n },\n size,\n } = this.props;\n\n this.tileColors = Array(size.y).fill(Array(size.x).fill(primaryColor));\n\n for (let i = 0; i < size.y; i++) {\n this.tiles[i] = [];\n for (let j = 0; j < size.x; j++) {\n if (tileColors && tileColors[i] && tileColors[i][j]) {\n this.tileColors[i][j] = tileColors[i][j];\n } else {\n this.tileColors[i][j] = primaryColor;\n }\n const tile = new Tile(this.tileColors[i][j], i, j);\n this.tiles[i][j] = tile;\n }\n }\n }", "title": "" }, { "docid": "2c57a2d8377a72b897a45fb089bf95a2", "score": "0.5537901", "text": "setTiles(tiles) {\n this.tiles = tiles;\n this.client.game.initialDeal(tiles);\n }", "title": "" }, { "docid": "71bebf7574a8ecbef2ddcec32e20e3e5", "score": "0.55364954", "text": "showGrid() {\n this.allTiles.forEach(tile => tile.showNeutral())\n }", "title": "" }, { "docid": "0e755ff656afda41d39c22705e9a52b7", "score": "0.5531127", "text": "function setStone( x,y, stone )\n{\n// debug(\"settings stone\")\n var table=document.getElementById('board')\n var cell=table.rows[y].cells[x]\n \n if (0==stone)\n cell.innerHTML=\"<div class='black'></div>\"\n else if (1==stone)\n cell.innerHTML=\"<div class='white'></div>\"\n else if (-1==stone)\n cell.innerHTML=\"\"\n else if (-2==stone)\n cell.innerHTML=\"<div class='whitespot'></div>\"\n else\n cell.innerHTML=\"<div class='blackspot'></div>\"\n}", "title": "" }, { "docid": "00e7fb41e7664321f4e066a6e0880379", "score": "0.552891", "text": "placeMines() {\r\n for (let mine = 0; mine < MINES && mine < (COLUMNS*ROWS); mine++) {\r\n let minePlaced = false;\r\n while (!minePlaced) {\r\n const col = floor(random(COLUMNS));\r\n const row = floor(random(ROWS));\r\n if (!this.grid[col][row].mine) {\r\n this.grid[floor(col)][floor(row)].mine = true;\r\n minePlaced = true;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "6af197b9c018ad60371490dc38d0fc2b", "score": "0.55275166", "text": "drawGrid(){\r\n\t\t\tfor(let y = 0; y < this.grid.data.length; y ++){\r\n\t\t\t\t\r\n\t\t\t\tlet row = this.grid.data[y];\r\n\t\t\t\tfor(let x = 0; x < row.length; x++){\r\n\t\t\t\t\tthis.drawImageTile(x, y, row[x][0]);\r\n\t\t\t\t};\r\n\t\t\t};\r\n\r\n\t\t\tfor(let i = 0; i < this.path.length; i++){\r\n\t\t\t\tthis.drawFlatTile(this.path[i].x, this.path[i].y, \"blue\")\r\n\t\t\t};\r\n\t\t}", "title": "" }, { "docid": "32caf2ed16deb52cf021bb526f07cd9b", "score": "0.5525491", "text": "function setWalkableGridAreas(backupGrid, body, snakes, myID) {\n var reversedSnakes = [];\n var meReversed = [];\n // set all locations where my body or other snakes' bodies will disappear as walkable\n snakes.forEach(function (snake) {\n if (snake.id !== myID && snake.health !== 100) {\n var snakeHeadX = snake.body.data[0].x;\n var snakeHeadY = snake.body.data[0].y;\n snake.body.data.forEach(function (object) {\n reversedSnakes.push(object);\n });\n reversedSnakes = reversedSnakes.reverse();\n reversedSnakes.forEach(function (object, index) {\n if (dist([body[0].x, body[0].y], [object.x, object.y]) > index) {\n if (dist([body[0].x, body[0].y], [object.x, object.y]) < dist([snakeHeadX, snakeHeadY], [object.x, object.y])) {\n backupGrid.setWalkableAt(object.x, object.y, true);\n }\n }\n });\n } else {\n if (snake.length > 4) {\n snake.body.data.forEach(function (object) {\n meReversed.push(object);\n });\n meReversed = meReversed.reverse();\n meReversed.forEach(function (object, index) {\n if (dist([body[0].x, body[0].y], [object.x, object.y]) > index) {\n if (!(index === 0 && snake.health === 100)) {\n backupGrid.setWalkableAt(object.x, object.y, true);\n }\n }\n });\n }\n }\n });\n return backupGrid;\n}", "title": "" }, { "docid": "badcdfbcdfb77d803b0e45162b92289c", "score": "0.55248797", "text": "setBoard() {\n\n // rows\n for (var i = 0; i < this.x; i++) {\n\n let column = new Map;\n\n // columns\n for (var j = 0; j < this.y; j++) {\n\n let field = {\n mines: null,\n cena: false,\n visited: false,\n flagged: false,\n questioned: false\n }\n\n column.set(j, field);\n\n }\n\n this.board.set(i, column);\n }\n\n }", "title": "" }, { "docid": "74c9dbf5c69fad77746efd1b83c3c008", "score": "0.552272", "text": "function setSquareShip(squareCoords, newShip) {\n let newSquareInfo = {\n status: this.getSquareInfo(squareCoords).status,\n ship: newShip\n };\n this.setSquareInfo(squareCoords, newSquareInfo);\n}", "title": "" }, { "docid": "e535f88faad5bfec4f7f49068473c47a", "score": "0.55140394", "text": "placeAt(x, y) {\n\t\tthis.tileFrom = [x, y];\n\t\tthis.tileTo = [x, y];\n\t\tthis.position = [tileW * x + (tileW - this.dimensions[0]) / 2, tileH * y + (tileH - this.dimensions[1]) / 2];\n\t}", "title": "" }, { "docid": "cf2f944c106c5a00d0dce842cf2994e8", "score": "0.5512041", "text": "function setCell(x: number, y: number, north: boolean, south: boolean, west: boolean, east: boolean) {\n let pos: number = (size * x + y) * 4\n maze[pos] = north\n maze[pos + 1] = south\n maze[pos + 2] = west\n maze[pos + 3] = east\n}", "title": "" } ]
cf28d62a52789b9f260d7d9dd21fba2d
Save the collapse state
[ { "docid": "aed440e6fcf734bf6e5aecd929ac59f7", "score": "0.6858612", "text": "function setCollapseState(bCollapsed) {\n setCookie(elSection.id, bCollapsed ? '0' : '1');\n }", "title": "" } ]
[ { "docid": "8a2bad5f0b68839b536f451ef528dca5", "score": "0.6751135", "text": "permanentise() {\n this.collapse = null;\n }", "title": "" }, { "docid": "fbed56608120fadcfe2d679f3da9a337", "score": "0.66162425", "text": "collapse() {\n this._collapsed = true;\n }", "title": "" }, { "docid": "72e4cb63b56b54d7bcda2df25a5f4522", "score": "0.6496954", "text": "function retainCollapse() {\n\t\tvar collapsible = $(this);\n\t\tvar stateKey = \"crossmarx.\" + collapsible.attr(\"id\") + \".collapse\";\n\t\tvar sessionState = sessionStorage.getItem(stateKey);\t\t\n\t\tif (sessionState) {\n\t\t\tcollapsible.collapse(sessionState);\n\t\t}\n\t\tcollapsible.on(\"show.bs.collapse\", function() {\n\t\t\tsessionStorage.setItem(stateKey, \"show\");\n\t\t});\n\t\tcollapsible.on(\"hide.bs.collapse\", function() {\n\t\t\tsessionStorage.setItem(stateKey, \"hide\");\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "5ca09be29150adb5f6331a06290d8ae0", "score": "0.6408615", "text": "collapse()\n {\n this.taskWrap.classList.toggle('open');\n this.store.set('open', this.taskWrap.classList.contains('open'));\n this.store.commit();\n }", "title": "" }, { "docid": "d01e5c8897acefcd58b82c06fc84747b", "score": "0.6339559", "text": "function getCollapseState() {\n return (getCookie(elSection.id) == '0');\n }", "title": "" }, { "docid": "809e09f79bab5466814ba3fa797bb859", "score": "0.6218153", "text": "collapse(){\n if(this.state.collapse){\n $('.collapse').slideUp()\n this.state.collapse = false\n }else{\n $('.collapse').slideDown()\n this.state.collapse = true \n }\n }", "title": "" }, { "docid": "214b6ac9b42825d61037ee2bad45fe39", "score": "0.6189084", "text": "toggle() {\n this.setState(state => ({ collapse: !state.collapse }));\n }", "title": "" }, { "docid": "214b6ac9b42825d61037ee2bad45fe39", "score": "0.6189084", "text": "toggle() {\n this.setState(state => ({ collapse: !state.collapse }));\n }", "title": "" }, { "docid": "58151b6e2caae320d736724d111e67c6", "score": "0.61863774", "text": "toggle() {\n this.setState({ collapse: !this.state.collapse });\n }", "title": "" }, { "docid": "f57ba2ea6ec73fd9b08d18e6aa64c998", "score": "0.61757463", "text": "onCollapse() {}", "title": "" }, { "docid": "97822b74e1b0bec1d95fb78f368e8be8", "score": "0.6157716", "text": "saveVisibility() {\n let saved = this.storage.getItem(this.getStorageKey()) || {};\n saved.columnVisibility = this._columnVisibility.reduce(\n (obj, { id, visible }) => {\n obj[id] = visible;\n return obj;\n },\n {}\n );\n this.storage.setItem(this.getStorageKey(), saved);\n }", "title": "" }, { "docid": "10ee045564f06a7e9cd379d562647ef4", "score": "0.6131378", "text": "toggle() {\n this.setState({ collapse: !this.state.collapse });\n }", "title": "" }, { "docid": "10ee045564f06a7e9cd379d562647ef4", "score": "0.6131378", "text": "toggle() {\n this.setState({ collapse: !this.state.collapse });\n }", "title": "" }, { "docid": "10ee045564f06a7e9cd379d562647ef4", "score": "0.6131378", "text": "toggle() {\n this.setState({ collapse: !this.state.collapse });\n }", "title": "" }, { "docid": "eb778322e7769fccfc08a2338e40deeb", "score": "0.61138403", "text": "toggleCollapse() {\n this.setState(\n state => ({\n isCollapsed: !state.isCollapsed,\n })\n )\n }", "title": "" }, { "docid": "bbaa3e096e2724522bb95af6f12a743e", "score": "0.60870296", "text": "toggleCollapse() {\n const collapsed = !this.state.collapsed;\n this.setState({collapsed});\n }", "title": "" }, { "docid": "8775de6d2b89c17ac92f942eee3bdecb", "score": "0.60524714", "text": "saveState() {\n let id = this.node.id;\n let value = this.getState();\n\n if (typeof value !== 'boolean') {\n return;\n }\n\n if (id) {\n let key = `ToggleButton#${id}.modifierApplied`;\n try {\n localStorage.setItem(key, value);\n } catch (e) {\n console.warn(this, 'Unable to save state to localstorage');\n }\n }\n }", "title": "" }, { "docid": "46476971b099af2d62d542481ac5099a", "score": "0.603868", "text": "toggle() {\n this.setState({ collapse: !this.state.collapse });\n }", "title": "" }, { "docid": "c78fe6f2f07eacdce07f7332275c64ae", "score": "0.6016805", "text": "function setCollapse () {\n let checkbox = document.querySelector('#border-collapse');\n if(checkbox.checked !== true) {\n checkbox.setAttribute('checked', 'true');\n }\n return checkbox.checked;\n}", "title": "" }, { "docid": "842be3d287fdc7c26986c7c30220767a", "score": "0.5980445", "text": "toggle() {\n this.collapsed = !this.collapsed\n }", "title": "" }, { "docid": "9cb04a4a501d873e8275711e986be0e1", "score": "0.59795535", "text": "function toggleCollapse() {\n vm.isCollapsed = !vm.isCollapsed;\n }", "title": "" }, { "docid": "834121920bb8ed4b956346acfda5ec9a", "score": "0.5970159", "text": "function collapse() {\n var iNewHeight = elSection.offsetHeight - m_elTable.offsetHeight;\n\n m_elToggler.innerHTML = \"+\";\n setOpacity(m_elTable, 0);\n\n elSection.fullSize = elSection.offsetHeight;\n elSection.style.height = iNewHeight.toString() + 'px';\n addClass(elSection, 'collapsed');\n }", "title": "" }, { "docid": "25278598134e6b21d2d141cc6b5dc8f5", "score": "0.5906962", "text": "function handleItemCollapseClicked() {\n\n $('.js-bookmark-list').on('click', '.js-collapse-button', event => {\n \n const id = getItemIdFromElement(event.currentTarget);\n\n store.findAndUpdate(id, {expandedView: false});\n \n render();\n \n \n });\n\n\n }", "title": "" }, { "docid": "68c019c3278ac85a17ffb48386f787bd", "score": "0.58985156", "text": "collapseAll() {\n this.setState({\n isOpened: {\n nutrition: false,\n wellness: false,\n fitness: false,\n },\n });\n }", "title": "" }, { "docid": "4c92feee150566f8281a716f258c3427", "score": "0.58387536", "text": "function collapseAnimated() {\n setCollapseState(true);\n m_elToggler.innerHTML = \"+\";\n\n // Fade out, then slide up\n fadeOut(m_elTable, function () {\n elSection.fullSize = elSection.offsetHeight;\n slideTo(elSection, elSection.offsetHeight - m_elTable.offsetHeight, function () {\n elSection.sliding = false;\n });\n addClass(elSection, 'collapsed');\n });\n }", "title": "" }, { "docid": "3217f2f034baf80d5053366212909de5", "score": "0.5806713", "text": "function saveExpanded (expanded) {\n // Save in session.\n expandedFiles = expanded;\n\n // Save in persitent storage.\n localStorage.setItem('expandedFiles', JSON.stringify(expanded));\n }", "title": "" }, { "docid": "ce7c4d9eee777d29f4e41bdc23e00f26", "score": "0.5801516", "text": "function collapse() {\n $(document.body).on('click', '[data-toggle=\"collapse\"]', function (e) {\n var target = '#' + $(this).data('target');\n\n $(this).toggleClass('collapsed');\n $(target).slideToggle();\n \n e.preventDefault();\n });\n }", "title": "" }, { "docid": "d78c822650b516b3a39d4eb557ac7788", "score": "0.57637924", "text": "function getExpand() {\n $('.savedBookmarks').on('click keypress', '.collapsed', function (event) {\n //finds id on click\n const position = $(event.currentTarget).data('bookmark-id');\n //changes expanded on click\n let foundMark = store.store.find(store => store.bookmark.id === position);\n foundMark.bookmark.expanded = !foundMark.bookmark.expanded;\n render.renderStoreBookmarks();\n })\n}", "title": "" }, { "docid": "082d28633678f3420d9632cfff3860e2", "score": "0.57584524", "text": "_collapse() {\n\t\tthis._setHeight(this._getHeight() + 'px');\n\t\tthis._collapsingElement.style.height = 0;\n\t}", "title": "" }, { "docid": "323ff778494e1662cdd41aec749e959f", "score": "0.57500106", "text": "_getExpandedState() {\n return this.expanded ? 'expanded' : 'collapsed';\n }", "title": "" }, { "docid": "323ff778494e1662cdd41aec749e959f", "score": "0.57500106", "text": "_getExpandedState() {\n return this.expanded ? 'expanded' : 'collapsed';\n }", "title": "" }, { "docid": "0b1804dcf57a7a17e9080fbd9be44a8e", "score": "0.5744944", "text": "function saveState() {\n\t\t// Set input states\n\t\tlocalStorage.setItem(\"stateStored\", 1);\n\t\t$('select, input[type!=button]').each(function() {\n\t\t\tlocalStorage.setItem(this.id, $(this).val());\n\t\t});\n\t}", "title": "" }, { "docid": "38d14144e4916742d08fd5db1cd944e2", "score": "0.57341915", "text": "function OLTChecklistCollapse(){\n e = $(this);\n e.toggleClass('olt-checklist-controls-collapse')\n .toggleClass('olt-checklist-controls-expand')\n .parents('.olt-checklist-entry:first').siblings('ul.children').slideToggle('fast');\n \n if(e.hasClass('olt-checklist-controls-collapse'))\n e.text('Collapse');\n else\n e.text('Expand');\n \n return false;\n }", "title": "" }, { "docid": "2c35bd55b3fbc90943db46cad43e0c89", "score": "0.5711373", "text": "saveState() {\n\n HistoryService.add(this.state.sheet.diagrams);\n }", "title": "" }, { "docid": "5d6faf44e23e3ef29643ce1e46a735ae", "score": "0.5706923", "text": "function saveSettingsCommon()\r\n{\r\n // save the expand / collapse states\r\n saveSections();\r\n dxSaveSelectedTabs();\r\n}", "title": "" }, { "docid": "214eaa97e8e40cf6a3967358a6dce392", "score": "0.56861544", "text": "function saveState(){\n\t\tvar aCookie = new Array();\n\t\tfor(var i = 0; i < aTreeMenu.length; i++){\n\t\t\tif(aTreeMenu[i].className.indexOf(\"itemOpen\") != -1)\n\t\t\t\taCookie[aCookie.length] = i;\n\t\t}\n\t\tvar sCookie = \"treeMenuState=\"+escape(aCookie.join(\"-\"));\n\t\t\n document.cookie = sCookie;\n\t\t\n\t\t//alert(sCookie);\n\t\t\n\t}", "title": "" }, { "docid": "f6299ff928a2353f47dbf7fdf155195d", "score": "0.5668904", "text": "toggleCollapse() {\n\t\tif (this.state.collapseOpen) {\n\t\t\tthis.setState({\n\t\t\t\tcolor: \"navbar-transparent\"\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tcolor: \"bg-white\"\n\t\t\t});\n\t\t}\n\t\tthis.setState({\n\t\t\tcollapseOpen: !this.state.collapseOpen\n\t\t});\n\t}", "title": "" }, { "docid": "ed6ebf4030fadad55be977de0e9e6e47", "score": "0.5653203", "text": "saveState()\n\t{\n\t\tconst card_list = this.state.card_list;\n\t\tlet visible = [];\n\t\tlet card_order = [];\n\t\tcard_list.map((card)=>{\n\t\t\tif (card == null)\n\t\t\t\treturn 0;\n\t\t\tcard_order.push(card.k);\n\t\t\tif (card.visible === true && this.state.flipped.includes(this.getFruitIndex((f) => f.k === card.k)) === false)\n\t\t\t{\n\t\t\t\tvisible.push(card.k);\n\t\t\t}\n\t\t\treturn 0;\n\t\t});\n\t\tlocalStorage.setItem(\"card_list_visible\", visible);\n\t\tlocalStorage.setItem(\"card_list_order\", card_order);\n\t\tlocalStorage.setItem(\"nb_pair\", this.state.nb_pair);\n\t\tlocalStorage.setItem(\"pair_left\", this.state.pair_left.toString());\n\t\tlocalStorage.setItem(\"time_left\", this.state.time_left.toString());\n\t}", "title": "" }, { "docid": "65d67dfbb8c65ee933b9310f4ef49508", "score": "0.56478035", "text": "function collapseSet() {\n\t$(\"#setCollapsible\").collapsible({collapsed:true})\n}", "title": "" }, { "docid": "a980ade57e284a99022ce88d925c9e4c", "score": "0.55976814", "text": "collapseAll() {\n this._expandCollapseAll(false);\n }", "title": "" }, { "docid": "65cdef146a1af01763a516344036bf58", "score": "0.5593038", "text": "set collapsed(value) {\n if (value) {\n this.addClass('collapsed');\n this.faceVisible = false;\n this.collapseButton.checked = true;\n this._clearTabsMarks();\n }\n else {\n this.removeClass('collapsed');\n this.collapseButton.checked = false;\n this.selectedTab = this.selectedTab;\n this.face.show().css('opacity', 1);\n }\n this.onCollapsedChanged();\n }", "title": "" }, { "docid": "60d2919b48c84d985beb27f6a3d0ad67", "score": "0.5581556", "text": "toggleExpanded() {\n this._expanded = !this._expanded;\n this._onStateChanged();\n }", "title": "" }, { "docid": "3d80b32bda14ae6242f494714e752ff0", "score": "0.5581364", "text": "function setCollapseHead() {\r\n if ($('#btn-toogle-head') .length == 0) {\r\n return;\r\n }\r\n if ( typeof(Storage) !== \"undefined\" ) {\r\n if (localStorage.getItem(\"collapseHead\")==\"true\" ) {\r\n $('#head').removeClass('in');\r\n }\r\n }\r\n}", "title": "" }, { "docid": "1435ce311b14ac75a43a1119b7ab4d02", "score": "0.5568522", "text": "handleExpandToggle() {\n if (this.isCollapsible) {\n this.isExpanded = !this.isExpanded;\n }\n }", "title": "" }, { "docid": "915e4521ba1b62d3e17d8ff3fd9d934a", "score": "0.55486", "text": "function save() {\n\t localStorage[\"thearchiver_archiveorg\"] = document.getElementById(\"archiveorg\").checked;\n\t localStorage[\"thearchiver_archiveis\"] = document.getElementById(\"archiveis\").checked;\n}", "title": "" }, { "docid": "419b94635f166fcee0e5746304a71031", "score": "0.55452514", "text": "function addCollapseAttr() {\n const $collapsibleLink = $('ul.docs-side-nav li ul').siblings('a');\n $collapsibleLink.attr('data-toggle', 'collapse');\n $collapsibleLink.addClass('tree-title collapsed');\n\n if (isReleaseNotes) {\n makeCurrentYearListOpen();\n }\n }", "title": "" }, { "docid": "3add197b0858b4ea1bebe3d9c8d49a2a", "score": "0.5543046", "text": "function setBreakdownExpandCollapse(){\n\t$('.ui-icon').on(\"click\", function(){\n\t\tif($(this).hasClass('law-expand')){\n\t\t\t$(this).removeClass('law-expand ui-icon-triangle-1-e').addClass('law-collapse ui-icon-triangle-1-s');\n\t\t\tvar lawId = $(this).attr('href');\n\t\t\t$('#' + lawId).removeClass('hidden');\n\t\t}\n\t\telse if($(this).hasClass('law-collapse')){\n\t\t\t$(this).removeClass('law-collapse ui-icon-triangle-1-s').addClass('law-expand ui-icon-triangle-1-e');\n\t\t\tvar lawId = $(this).attr('href');\n\t\t\t$('#' + lawId).addClass('hidden');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a4f2c3d312cdf85a9651906686d9577a", "score": "0.5533737", "text": "set collapsible(v) {\n this._collapsible = coerceBooleanProperty(v);\n }", "title": "" }, { "docid": "a4f2c3d312cdf85a9651906686d9577a", "score": "0.5533737", "text": "set collapsible(v) {\n this._collapsible = coerceBooleanProperty(v);\n }", "title": "" }, { "docid": "9cea2517e264d36cde10a1f39c4a927e", "score": "0.5532785", "text": "function groupCollapse(collapse) {\n var $group = collapse.parents(config.classes.groupContainer);\n if ($group[0]) {\n $group.find(config.trigger).not(collapse).removeClass(config.classes.opened);\n }\n }", "title": "" }, { "docid": "07a6ef22dda2cd914fd5409351af42a9", "score": "0.55179965", "text": "function menu_collapse() {\n settings_collapse();\n more_collapse();\n}", "title": "" }, { "docid": "f0d74c8939884e01c0541cdcf537a7bf", "score": "0.5512036", "text": "save(state, payload) {\n state.saved_data = payload;\n state.saved_data.s_data[state.saved_data.c_pos.row][\n state.saved_data.c_pos.col\n ].state = 0;\n localStorage.setItem('nusheets-data', JSON.stringify(state.saved_data));\n localStorage.setItem('nusheets-theme', JSON.stringify(state.theme));\n state.last_saved = new Date();\n }", "title": "" }, { "docid": "ac37107df4e3ee0a6973590d3fc5e0b7", "score": "0.5510331", "text": "function groupCollapse(collapse) {\n var $group = collapse.parents(config.classes.groupContainer);\n if ($group[0]) {\n $group.find(config.trigger).not(collapse).removeClass(config.classes.opened).find(config.classes.content).slideUp();\n }\n }", "title": "" }, { "docid": "f948a486dafa4f09a874a0584e24bca1", "score": "0.55069107", "text": "function alterDisplayDetails(){\n\n var $togglers = $('[data-toggle=\"collapse\"]');\n $togglers.each(function() {\n var $this = $(this);\n var $collapsible = $($this.data('target'));\n $collapsible.on('hidden', function() {\n var text = $this.data('on-hidden');\n text && $this.text(text);\n }).on('shown', function() {\n var text = $this.data('on-active');\n text && $this.text(text);\n $('#content-display').empty();\n });\n });\n\n $('.collapse').collapse();\n}", "title": "" }, { "docid": "949c3cb985314f189dee71e8ff5679d9", "score": "0.55", "text": "function toggleCollapse(e) {\n accordions.forEach((acc, idx) => {\n const collapse = acc.querySelector('.collapse')\n if (\n e.target.parentElement.id === `accordion-${idx + 1}` ||\n e.target.parentElement.parentElement.id === `accordion-${idx + 1}`\n ) {\n acc.classList.toggle('open')\n collapse.style.maxHeight\n ? (collapse.style.maxHeight = null)\n : (collapse.style.maxHeight = `${collapse.scrollHeight}px`)\n } else {\n acc.classList.remove('open')\n collapse.style.maxHeight = null\n }\n })\n}", "title": "" }, { "docid": "fad0aac40869d87e3c56fcd477d4be84", "score": "0.5475067", "text": "function collapse(){\n this.classList.toggle(\"active_collapse\");\nlet content = this.nextElementSibling;\n if (content.style.maxHeight){\n return content.style.maxHeight = null;\n } else {\n return content.style.maxHeight = content.scrollHeight + \"px\";\n } \n}", "title": "" }, { "docid": "0d0e2271a7522747a892d68b5f809dc3", "score": "0.5467404", "text": "function saveState() {\n\t\tsave.saveData('musicData', state);\n\t}", "title": "" }, { "docid": "b90d6721288fec21f50e432e5853bf3b", "score": "0.5425282", "text": "function complete(element) {\n element.classList.remove('collapsing');\n element.classList.add('collapse');\n element.setAttribute('aria-expanded', false);\n\n // Check whether the element is unhidden\n if (element.style.height !== '0px') {\n element.classList.add('in');\n element.style.height = 'auto';\n }\n }", "title": "" }, { "docid": "c45989f5c66cd31624b36aa9768b587a", "score": "0.54221606", "text": "toggleCollapse() {\n this.setState({\n collapsed: !this.state.collapsed\n }, () => {\n this.rnd.updateSize({\n height: this.calculateHeight(),\n width: this.state.width\n });\n });\n }", "title": "" }, { "docid": "79117ab93bbbae8df0d3e7cfb87247b6", "score": "0.5420261", "text": "toggleCollapse(e) {\n e.preventDefault();\n const { store } = this.context;\n const state = store.getState();\n let subposts = state.subposts.slice(0);\n let isGloballyMinimized = false;\n\n if(state.isGloballyMinimized) {\n subposts.forEach((s) => {\n s.isMinimized = false;\n });\n isGloballyMinimized = false;\n } else {\n subposts.forEach((s) => {\n s.isMinimized = true;\n });\n isGloballyMinimized = true;\n\n }\n store.dispatch({\n type: 'SET_MINIMIZED',\n subposts: subposts,\n isGloballyMinimized: isGloballyMinimized\n });\n }", "title": "" }, { "docid": "e25b6f872c00fa528c0717c0831676d7", "score": "0.54182386", "text": "function collapseItem(item) {\n\n // Save the details on the collapse assuming onetime loading\n if (_options.loadOnce) {\n saveDetailView(item);\n }\n\n // Ekohe Edit: Check if there is really expanded\n var isReallyExpanded = true;\n for (var idx = 1; idx <= item._sizePadding; idx++) {\n var itemId = item.id + \".\" + idx;\n\n if (_dataView.getIdxById(itemId)) {\n _dataView.deleteItem(itemId);\n } else {\n isReallyExpanded = false;\n }\n }\n\n // Ekohe Add: Change the index of the remained items\n if (isReallyExpanded) {\n var idxParent = _dataView.getIdxById(item.id);\n var remainedItems = {};\n var maxIdx = getMaxIdx(_dataView);\n for (var idx = idxParent + item._sizePadding + 1; idx <= maxIdx; idx++) {\n remainedItems[idx - item._sizePadding] = _dataView[idx];\n delete _dataView[idx];\n }\n\n // Ekohe Add: Refresh the dataview\n $.extend(_dataView, remainedItems);\n _dataView.length -= item._sizePadding;\n }\n\n item._collapsed = true;\n item._sizePadding = 0;\n\n _dataView.updateItem(item.id, item);\n\n // Remove the item from the expandedRows\n _expandedRows = _expandedRows.filter(function (r) {\n return r.id !== item.id;\n });\n }", "title": "" }, { "docid": "bbb9ae7cffc446b517023726d9f652fd", "score": "0.5404781", "text": "collapseItem(item){if(this._isExpanded(item)){this.splice(\"expandedItems\",this._getItemIndexInArray(item,this.expandedItems),1)}}", "title": "" }, { "docid": "82c008b3e7d8a327a1abd14b5abc182f", "score": "0.53998345", "text": "_collapseExpandedPanel (expanded) {\n let originalExpanded = this.querySelector('.uncollapsed');\n if (originalExpanded) {\n pfUtil.removeClass(originalExpanded, 'uncollapsed');\n }\n }", "title": "" }, { "docid": "30b5b0df69a7152f0df074afab6f212e", "score": "0.53915995", "text": "toggle() {\n\t\tthis.expanded = !this.expanded;\n\t}", "title": "" }, { "docid": "991603cefd43d7a2b23b56e12d3b6f98", "score": "0.5390883", "text": "function changeCollapseState(sectionId, name) {\r\n if($(`#${sectionId}${name}`).hasClass('show')) {\r\n $(`#${sectionId}${name}`).removeClass('show');\r\n } else {\r\n $(`#${sectionId}${name}`).addClass('show'); \r\n }\r\n}", "title": "" }, { "docid": "a030649d4186e95a117ea34b42f30a69", "score": "0.53886265", "text": "function adjustCollapseView() {\r\n\t\tvar desktopView = $(document).width();\r\n\t\tif(desktopView >= \"768\") {\r\n\t\t\t$(\"#accordion td.crdheader[data-toggle]\").attr(\"data-toggle\",\"\");\r\n\t\t\t$(\"#accordion .collapse\").removeClass(\"show\").css(\"height\",\"auto\");\r\n\t\t}else {\r\n\t\t\t$(\"#accordion td.crdheader[data-toggle]\").attr(\"data-toggle\",\"collapse\");\r\n\t\t\t//$(\"#accordion .collapse\").removeClass(\"\").css(\"height\",\"0\");\r\n\t\t\t$(\"#accordion .collapse:first\").addClass(\"show\").css(\"height\",\"auto\");\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1ad76f63550db7347a327b60bafc05e9", "score": "0.5382474", "text": "onCardListCollapsed(event) {\r\n let isCollapsed = event.detail;\r\n if (this.previousCollapseState) {\r\n }\r\n this.previousCollapseState = isCollapsed;\r\n }", "title": "" }, { "docid": "061a687f1d26b6d6dbc523a5dafac951", "score": "0.53766924", "text": "collapse(panelId) { this._changeOpenState(this._findPanelById(panelId), false); }", "title": "" }, { "docid": "6032b0d3a262ec013d0dd589ed3c90ca", "score": "0.53636533", "text": "function toggleSaveConfirmed() {\n $(\"#save-icon\").toggleClass(\"glyphicon-save\");\n $(\"#save-icon\").toggleClass(\"glyphicon-saved\");\n }", "title": "" }, { "docid": "6294ea1231e5a1d42233449a96deb02c", "score": "0.5362209", "text": "restoreState() {\n if (this.toggleMobileState !== undefined && matchMedia('(max-width: 767px)').matches) {\n this.toggle(this.toggleMobileState);\n return;\n }\n\n let id = this.node.id;\n\n if (id) {\n let key = `ToggleButton#${id}.modifierApplied`;\n try {\n let value = localStorage.getItem(key) || false;\n this.toggle(value.toUpperCase() === 'TRUE');\n } catch (e) {\n }\n }\n }", "title": "" }, { "docid": "9c4408b31f0690af92e4906e3f8b3bee", "score": "0.5358301", "text": "onCollapsedChanged() {\n this.collapsedChanged.raise();\n }", "title": "" }, { "docid": "2649e6a9bac138c341984c519f7714b7", "score": "0.53563505", "text": "function saveState() {\n \n var reqRate = fireMath.solveRate(vm.state.retirementAge - vm.fcMethods.calcAge(vm.state.birthDate), -vm.state.FVpmt, -vm.state.FVpv, vm.fcMethods.calcReqSavings(vm.state.annualExpenses, vm.state.withdrawalRate), null, null);\n \n LS.setData('fire-calc-storage', [\n vm.state.birthDate,\n vm.state.retirementAge,\n vm.state.annualExpenses,\n vm.state.withdrawalRate,\n vm.state.FVpv,\n vm.state.FVpmt\n ]);\n \n // save required rate to 'global' local storage,\n // for use in Portfolio allocation ratio calculations\n LS.setData('fc-storage-global', [\n reqRate\n ]);\n \n // re-set state using newly-loaded values from local storage\n setState();\n }", "title": "" }, { "docid": "c990945208ec6be73c1846149879450f", "score": "0.53540653", "text": "function saveHideMenuSettings() {\n if(window.innerWidth > 991) {\n if($('body').hasClass('sidebar-collapse')) {\n guiLocalSettings.set('hideMenu', false);\n } else {\n guiLocalSettings.set('hideMenu', true);\n }\n }\n}", "title": "" }, { "docid": "0077ec7c1194c22bbf526c854411af3d", "score": "0.53502566", "text": "_handleCollapse(e) {\n if (this.__ready !== undefined)\n this.dispatchEvent(new CustomEvent(\"collapse\", { detail: this }));\n }", "title": "" }, { "docid": "9d0a477c71db76a6cc1d8ffe9e1513a7", "score": "0.53494376", "text": "function _showCollapseStyles() {\n if(!$navbar.hasClass(data.intocolor)) {\n $navbar.removeClass(data.startcolor).addClass(data.intocolor);\n }\n \n if ($navbar.hasClass(data.startsize)) {\n $navbar.removeClass(data.startsize).addClass(data.openmenustartsize);\n } else {\n $navbar.removeClass(data.intosize).addClass(data.openmenuintosize);\n }\n }", "title": "" }, { "docid": "58f407bb21d5a4aa74929e511fc7c14d", "score": "0.5348499", "text": "collapseAll() {\n this.panels.forEach((panel) => { this._changeOpenState(panel, false); });\n }", "title": "" }, { "docid": "3c45d55d95c15521f69575ca03ec9a82", "score": "0.5341876", "text": "function collapsible_listener(model){\n var coll = document.getElementsByClassName(\"collapsible \" + model.ID);\n var i;\n\n for (i = 0; i < coll.length; i++) {\n coll[i].addEventListener(\"click\", function() {\n this.classList.toggle(\"active\");\n var content = this.nextElementSibling;\n if (content.style.display === \"block\") {\n content.style.display = \"none\";\n } else {\n content.style.display = \"block\";\n }\n });\n }\n }", "title": "" }, { "docid": "978d3646a429fa0dd82bda1d08b1515f", "score": "0.53362584", "text": "collapseAll() {\n\t\tthis.$scope.accordion.collapseAll();\n\t}", "title": "" }, { "docid": "e119a96ddf9387bca16db14d2828ca64", "score": "0.53285635", "text": "onCollapsed() {}", "title": "" }, { "docid": "3ada3bdafbd01f5f7330a51108016ed0", "score": "0.532837", "text": "function collapse(toggle) {\n\tvar id = toggle.getAttribute('data-a11y-toggle');\n\tvar collapsibleBox = document.getElementById(id);\n\tcollapsibleBox.setAttribute('aria-hidden', true);\n\ttoggle.setAttribute('aria-expanded', false);\n}", "title": "" }, { "docid": "3e988bf3d9b5db465e874ce06cf92c1f", "score": "0.53244656", "text": "get collapsed() {\n return this.element.hasClass('collapsed');\n }", "title": "" }, { "docid": "a18156f5c7cea0aec7734c073d164d7c", "score": "0.5314787", "text": "onExpandDetailsPress() {\n this.setState((prevState) => {\n return { detailCollapsed: !prevState.detailCollapsed};\n });\n }", "title": "" }, { "docid": "4193e75cda42b7ab42a86915913644c6", "score": "0.5313317", "text": "function set_state(expanded){\n if(expanded){\n section.addClass(\"expanded\").removeClass(\"collapsed\");\n section.children().show();\n }else{\n section.addClass(\"collapsed\").removeClass(\"expanded\");\n section.children().hide();\n section.children(\"span:first-child:empty\").show(); /* for :ref: span tag */\n header.show();\n }\n }", "title": "" }, { "docid": "e20587c228c1a0c1b35d957a8b5a1663", "score": "0.53044593", "text": "saveMenu() {\n switch (this.currentMenuChoices) {\n case MenuChoices.null: // case MenuChoices.edit:\n this.menuView.contentsMenu.style.display = \"block\";\n this.menuView.saveContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.save;\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.saveButton.style.zIndex = \"1\";\n break;\n case MenuChoices.save:\n this.menuView.contentsMenu.style.display = \"none\";\n this.menuView.saveContent.style.display = \"none\";\n this.currentMenuChoices = MenuChoices.null;\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorDefault;\n this.menuView.saveButton.style.zIndex = \"0\";\n break;\n default:\n this.cleanMenu();\n this.menuView.saveButton.style.backgroundColor = this.menuView.menuColorSelected;\n this.menuView.saveButton.style.zIndex = \"1\";\n this.menuView.saveContent.style.display = \"inline-table\";\n this.currentMenuChoices = MenuChoices.save;\n break;\n }\n }", "title": "" }, { "docid": "f6e79c081e120c18751ff99fccb36f80", "score": "0.5301162", "text": "saveState() {\n localStorage.setItem('teamBuilderState_v2', JSON.stringify(this.state));\n }", "title": "" }, { "docid": "06981065ef2904c2702fe11551496df9", "score": "0.52978694", "text": "'shown.bs.collapse .collapse, hidden.bs.collapse .collapse'() {\n let panels = $('.buyers-list .panel-collapse');\n let totalPanels = panels.length;\n let openPanels = panels.filter('.in').length;\n areAllOpen.set(totalPanels === openPanels);\n }", "title": "" }, { "docid": "bbbae2545bb5e79c25703d0266b36411", "score": "0.52926576", "text": "toggle() {\n this.expanded = !this.expanded;\n }", "title": "" }, { "docid": "cd9ba6c9ae77ed0559104a7c813244b0", "score": "0.52741086", "text": "function toggleCollapsed(collapse) {\n\t\tcollapse.select(\"ul\").each(Element.toggle);\n\t\tvar img = collapse.select(\"img.plusicon\")[0];\n\t\tswapPlusMinus(img);\n\t}", "title": "" }, { "docid": "cd9ba6c9ae77ed0559104a7c813244b0", "score": "0.52741086", "text": "function toggleCollapsed(collapse) {\n\t\tcollapse.select(\"ul\").each(Element.toggle);\n\t\tvar img = collapse.select(\"img.plusicon\")[0];\n\t\tswapPlusMinus(img);\n\t}", "title": "" }, { "docid": "caad11d008b180cae9787d76d786ba09", "score": "0.52436614", "text": "function resetFullMessageCollapseStatus(){\n jQuery(\"div[data-yaft-role=message] a.yaft_collapse_expand_link\").html(\"Collapse\");\n }", "title": "" }, { "docid": "f3e3d3d95624782e7a44a692f9e5f401", "score": "0.52423584", "text": "function expandFrameThree() {\n var frame_3_expanded = parseInt(localStorage.getItem('frame_3_expanded'))\n if (frame_3_expanded == 0) {\n $('#frame_3_expanded').show();\n $('#frame_3_expanded').delay(200).animate({ 'opacity': '1' }, 500);\n $('#frame_3_expand_button').text(\"Collapse\");\n frame_3_expanded = 1\n } else {\n $('#frame_3_expanded').hide(0);\n $('#frame_3_expanded').animate({ 'opacity': '0' }, 500);\n $('#frame_3_expand_button').text(\"Expand\");\n frame_3_expanded = 0\n }\n\n localStorage.setItem('frame_3_expanded', frame_3_expanded);\n }", "title": "" }, { "docid": "38bc6baaeae4093b0fb0e557b775b4b0", "score": "0.5234116", "text": "function expandAnimated() {\n setCollapseState(false);\n removeClass(elSection, 'collapsed');\n m_elToggler.innerHTML = \"-\";\n\n // Slide down, then fade in\n slideTo(elSection, elSection.fullSize, function () {\n elSection.style.height = \"\";\n fadeIn(m_elTable, function () {\n elSection.sliding = false;\n });\n });\n }", "title": "" }, { "docid": "db7ffb95772dbdb97b04b0dfa66b1d8d", "score": "0.5232279", "text": "collapseList() {\n \n // ******* TODO: PART IV *******\n\n }", "title": "" }, { "docid": "43eb3feb299c633ae6fe1deea3eda9cb", "score": "0.5227982", "text": "function setCollapseStateForType(foldingModel, type, doCollapse) {\n var regions = foldingModel.regions;\n var toToggle = [];\n\n for (var i = regions.length - 1; i >= 0; i--) {\n if (doCollapse !== regions.isCollapsed(i) && type === regions.getType(i)) {\n toToggle.push(regions.toRegion(i));\n }\n }\n\n foldingModel.toggleCollapseState(toToggle);\n}", "title": "" }, { "docid": "1c6fc187917a98281df5d92eddcadf72", "score": "0.5224347", "text": "function saveState () {\n\twinston.info('Saving current state');\n\tjsonfile.writeFileSync(STATE_FILE, {\n\t\tsubscriptions: subscriptions,\n\t\tcallback: callback,\n\t\thistory: history,\n\t\tversion: CURRENT_VERSION\n\t}, {\n\t\tspaces: 4\n\t});\n}", "title": "" }, { "docid": "bfce8401e66dafa087782ae8666d32e0", "score": "0.52233875", "text": "function collapse () {\n // Expand all files.\n files.forEach(function (file) {\n file.expanded = false;\n });\n\n // Update list of comments.\n Events.publish('todos:updated');\n }", "title": "" }, { "docid": "b2a0023619905e7e4d6eb868e5da5496", "score": "0.52224773", "text": "function expandCollapse() {\n\tif ($('#expandCollapse').val() == '+') {\n\t\t$('#categoryNavigation').find('div.hitarea.tree-hitarea.expandable-hitarea').click();\n\t\t$('#expandCollapse').val('-');\n\t} else {\n\t\t$('#categoryNavigation>li>div.hitarea.tree-hitarea.collapsable-hitarea').click();\n\t\t$('#expandCollapse').val('+');\n\t}\n}", "title": "" }, { "docid": "9a212e8889fc9756bbadd686698aa170", "score": "0.52214926", "text": "saveData(){\n AsyncStorage.setItem(\"state\",JSON.stringify(this.state));\n }", "title": "" }, { "docid": "44c75fe29af796825b2dde78e7b24332", "score": "0.5218708", "text": "checkAndSetInitialState() {\n if (this.isWithinBreakpoints()) {\n if (this.defaultCollapsed()) {\n this.el.classList.remove('is-expanded');\n this.el.setAttribute('aria-expanded', false);\n this.collapsibleEl.setAttribute('aria-hidden', true);\n this.collapsibleEl.style.height = '0';\n } else {\n this.el.classList.add('is-expanded');\n this.el.setAttribute('aria-expanded', true);\n this.collapsibleEl.setAttribute('aria-hidden', false);\n }\n }\n }", "title": "" }, { "docid": "2c39181ed11c1ee5d4b7b9bb67ef8156", "score": "0.52182406", "text": "function afterCollapse() {\n // Reinstate automatic laying out.\n me.owner.suspendLayout = sl;\n shadowContainer.suspendLayout = scsl;\n delete shadowLayout.layoutBusy;\n if (shadowContainer.componentLayout) {\n delete shadowContainer.componentLayout.layoutBusy;\n }\n delete me.shadowContainer.layout.layoutBusy;\n delete me.layoutBusy;\n delete me.owner.componentLayout.layoutBusy;\n delete comp.collapsedChangingLayout;\n\n // Fire the collapse event: The Panel has in fact been collapsed, but by substitution of an alternative Component\n comp.collapsed = true;\n comp.fireEvent('collapse', comp);\n }", "title": "" } ]
b3d9a1d1e967f34cd5eb7dc97cb692fa
BURGER END SCROLL START
[ { "docid": "52c539356b9b9578de5e99ad5b4641bd", "score": "0.0", "text": "function scrollTo(element) {\n window.scroll({\n left: 0,\n top: element.offsetTop,\n behavior: 'smooth',\n\n })\n\n}", "title": "" } ]
[ { "docid": "a31cbb9288f07ffd0ae0af8dec336849", "score": "0.7580724", "text": "endScroll() {\n NativeFrameRateLogger && NativeFrameRateLogger.endScroll();\n }", "title": "" }, { "docid": "1f106638d27d85d25b60711ab176c13d", "score": "0.7371999", "text": "scrollEnd(){\r\n let sc = this.getRef('scroll');\r\n if ( sc ){\r\n sc.onResize(true).then(() => {\r\n sc.scrollEndY();\r\n });\r\n }\r\n }", "title": "" }, { "docid": "6a1fbd21c5d0d8be6d7b4931aa9dc292", "score": "0.6814836", "text": "function onScrollEnd(){\n if(_this.isScrollable == true){\n _this.eventPageOffset+=_this.eventPageLimit;\n jobEventsLog(_this.activeJobDetail.service.number,_this.eventPageOffset,_this.eventPageLimit);\n _this.isScrollable = false;\n }\n }", "title": "" }, { "docid": "1947c7672d125680aa464b2530f78b32", "score": "0.6791569", "text": "scrollDown(){\n\t}", "title": "" }, { "docid": "36ebdaddca9c31406741231b06b1f291", "score": "0.6643166", "text": "_stopInterval() {\n this._stopScrolling.next();\n }", "title": "" }, { "docid": "36ebdaddca9c31406741231b06b1f291", "score": "0.6643166", "text": "_stopInterval() {\n this._stopScrolling.next();\n }", "title": "" }, { "docid": "eca1681d474d4af1322af18e55e601c9", "score": "0.6589151", "text": "_onScrollEnd() {\n this.props.onEnd && this.props.onEnd();\n }", "title": "" }, { "docid": "6f3febb124b115480a45b04020532b05", "score": "0.64660007", "text": "resetScroll() {}", "title": "" }, { "docid": "dddeefac4add6effb752543b62f953e0", "score": "0.64374995", "text": "function endScrollbar(postScroll)\n{\n if ( typeof postScroll == \"number\" ) {\n while ( postScroll > 0 && scrollDivsClosed < scrollDivCount ) {\n docWriteln(\"</DIV>\");\n scrollDivsClosed++;\n postScroll--;\n }\n }\n else if ( scrollDivCount > 0 ) {\n while ( scrollDivsClosed < scrollDivCount ) {\n docWriteln(\"</DIV>\");\n scrollDivsClosed++;\n }\n if ( postScrollDivOpen ) {\n docWriteln(\"</DIV>\");\n postScrollDivOpen = false;\n }\n else {\n if ( typeof postScroll != \"boolean\" )\n postScroll = true;\n if ( postScroll ) {\n docWriteln(\"<DIV ID=postScrollbarDiv>\");\n postScrollDivOpen = true;\n }\n }\n }\n}", "title": "" }, { "docid": "e6246cdfed630562b465bcb2609c2b74", "score": "0.6410766", "text": "function scrollDown() {\n if (repeated > 1 && document.body.scrollHeight === scrollHeight) {\n clearInterval(intervalTask);\n window.scrollTo(0, 0);\n initAltAudit();\n return;\n }\n\n if (repeated === 0 || document.body.scrollHeight !== scrollHeight) {\n scrollHeight = document.body.scrollHeight;\n window.scrollTo(0, scrollHeight);\n repeated += 1\n } else {\n clearInterval(intervalTask);\n window.scrollTo(0, 0);\n initAltAudit();\n }\n }", "title": "" }, { "docid": "cb9e6260b1aa9964c37365f6f7c5f11d", "score": "0.63636327", "text": "function onAlertScrollEnd(){\n if(_this.isScrollable == true){\n _this.alertPageOffset+=_this.alertPageLimit;\n alertEventsLog(_this.activeJobDetail.service.number,_this.alertPageOffset,_this.alertPageLimit);\n _this.isScrollable = false;\n }\n }", "title": "" }, { "docid": "a0e96e0a0a7925266b7d24374fc265f7", "score": "0.63117236", "text": "function listen() {\n scrolling = 0;\n}", "title": "" }, { "docid": "ef58b5e0f68848954f1b812fdcaec74a", "score": "0.6281603", "text": "function onListScrollEnd() {\r\n marqueeWidget = null;\r\n }", "title": "" }, { "docid": "c77619b18b2f780bd30b13a42bf2682e", "score": "0.6278737", "text": "_teardownScroller() {\n this.scroller = null;\n }", "title": "" }, { "docid": "e7dbeec679238742a08cd1a4284df96f", "score": "0.62455624", "text": "function handleScorll() {\n scroll.scrollTo(700);\n }", "title": "" }, { "docid": "af3e86282ac850a80eb884a3497d0c9f", "score": "0.62443614", "text": "function animEnd(evt) {\n // sets margins for when client tries to scroll all the way left\n if ($slide.offset().left > 0) {\n $slide.offset({\n left: 0\n });\n }\n // sets margins for when client tries to scroll all the way right\n if ($slide.offset().left < -6535 + window_width) {\n $slide.offset({\n left: -6535 + window_width\n });\n }\n}", "title": "" }, { "docid": "cc4d6fd3c1400d2bdb0b2267f3393d19", "score": "0.6241318", "text": "function stopScroll() {\n stopInterval(scrollInterval);\n }", "title": "" }, { "docid": "80d309f474756bb627a63a1adb3856d3", "score": "0.62264276", "text": "function doneProcessingScroll() {\n processingScroll = false;\n }", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.6225047", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.6225047", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.6225047", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "1c0a6c3145526e282e7e9067b3fe45f4", "score": "0.6222427", "text": "scroll() {\n\t\tif(this.loc1Scroller.getY() >= 1000) {\n\t\t\tthis.loc1Scroller.set(0, -750);\n\t\t\tthis.render();\n\t\t}\n\t\tthis.loc1Scroller.addPoint(this.velocity); //move images vertically\n\t // this.loc2Scroller.addPoint(this.velocity);\n\t\t// reset image locations when offscreen (move back to top, when past bottom)\n\t}", "title": "" }, { "docid": "8f0e04502f33ab288c8c9751efe3c38b", "score": "0.621026", "text": "function scrollStep() {\n // Check if we're at the top already. If so, stop scrolling by clearing the interval\n if (window.pageYOffset === 0) {\n clearInterval(intervalId);\n }\n window.scroll(0, window.pageYOffset - 50);\n }", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.62066996", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.62066996", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.62066996", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "e24f169dca3ffd9655fa7eb7471a8bb0", "score": "0.61939937", "text": "function scrollDown () {\n\tvar doAutoscroll = (($(\"#log\").scrollTop()+ $(\"#log\").innerHeight() + 40)>=($(\"#log\")[0].scrollHeight));\n\t// addMessage2(\"sys\", ($(\"#log\").scrollTop() + $(\"#log\").innerHeight()).toString() + \" \" + ($(\"#log\")[0].scrollHeight).toString() + \" \" + doAutoscroll );\n\tif (doAutoscroll) $(\"#log\").scrollTop($(\"#log\")[0].scrollHeight);\n}", "title": "" }, { "docid": "6af53dc36665f3688334e14c164d857d", "score": "0.6184355", "text": "cmdScrollBottom()\n\t{\n\t\tthis.cmd_wrapper.scrollTop = this.cmd_wrapper.scrollHeight;\n\t}", "title": "" }, { "docid": "e65d498010848439f69983a7c275dd05", "score": "0.6133084", "text": "static onEndScroll(offset = 0) {\n const resolver = new $.Deferred();\n const mdlLayoutElement = $('.mdl-layout');\n mdlLayoutElement.scroll(() => {\n if ((window.innerHeight + mdlLayoutElement.scrollTop() + offset) >=\n mdlLayoutElement.prop('scrollHeight')) {\n console.log('Scroll End Reached!');\n mdlLayoutElement.unbind('scroll');\n resolver.resolve();\n }\n });\n console.log('Now watching for Scroll End.');\n return resolver.promise();\n }", "title": "" }, { "docid": "54cd6f0610c5b5fd38fc187c55f103fe", "score": "0.6111691", "text": "function auto_drop_bottom_to_2()\r\n\t{\r\n\t\t\t\r\n\t\t\t\t\t\t\tvar auto_drop_bottom=setInterval(\r\n\t\t\t\t\t\t\tfunction()\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t//$('#search_and_print').scrollTop($(\"#search_and_print\").height());\r\n\t\t\t\t\t\t\t\t$(\"#search_and_print\").animate ({scrollTop : $(\"#search_and_print\")[0].scrollHeight},100);\r\n\t\t\t\t\t\t\t},10000);\r\n\t\t\t\t\t\t\t\r\n\t\t\r\n\t}", "title": "" }, { "docid": "eec77e0530088e5a2e42482981575840", "score": "0.61086255", "text": "function _eventScrollableViewScroll(e){\n\ttry{\n\t\tcurrentPage = e.currentPage;\n\t\tif (currentPage==Alloy.Globals.HELPSCREEN_COUNT-1){\n\t\t\t$.lblFinishRight5.text = Alloy.Globals.selectedLanguage.end;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$.lblFinishRight5.text = Alloy.Globals.selectedLanguage.next;\n\t\t}\n\t}\n\tcatch(e){\n\t\tTi.API.info('Error in Scrollableview Scroll....');\n\t}\n}", "title": "" }, { "docid": "5c4838530bbfba6422fad08fecfc15e6", "score": "0.61035585", "text": "function glueScroll() {\n scrolled = scrolled + 200;\n $(\".msg_body\").animate({\n scrollTop: scrolled\n });\n $(\".msg_wrap\").animate({\n scrollTop: scrolled\n });\n }", "title": "" }, { "docid": "dd30d885dbf91dadf5b07724c33c9542", "score": "0.60969836", "text": "function ScrollingBumpsBuilder() {\n // Do Nothing\n }", "title": "" }, { "docid": "05d6b65f7061b6ae5d63d93cbafa875e", "score": "0.6051668", "text": "scrollDown() {\n // Ignore call while page is loading\n if (!this.chatEndRef) return;\n this.chatEndRef.current?.scrollIntoView();\n }", "title": "" }, { "docid": "395cb89a88f65279277ba97750255863", "score": "0.6042288", "text": "function scrollAnimationFinished(){\r\n // console.log(\"finished!\");\r\n movingScroll=false;\r\n animationStatus=false;\r\n }", "title": "" }, { "docid": "3fd026de3e03aa61477963daf2c605d4", "score": "0.60372305", "text": "scrollHandler2() {\n\t\tscroller.scrollTo('scrollTo2', {\n\t\t\tduration: 1000,\n\t\t\tsmooth: true\n\t\t});\n\t}", "title": "" }, { "docid": "28ae8196140bac0c82c8a279d5aed8a0", "score": "0.60323", "text": "function scrollDone() {\n isScrollingLeft = false;\n isScrollingRight = false;\n }", "title": "" }, { "docid": "2402a3e924f46e36bac4380151534ee8", "score": "0.6024192", "text": "scrollToEnd() { \t\n let container = this.$el.querySelector(\"#chat-messages\");\n container.scrollTop = container.scrollHeight + 6;\n }", "title": "" }, { "docid": "c946ef9fe474f6945276ae8436c614e6", "score": "0.6024073", "text": "function mkdOnWindowScroll() {\n \n }", "title": "" }, { "docid": "c946ef9fe474f6945276ae8436c614e6", "score": "0.6024073", "text": "function mkdOnWindowScroll() {\n \n }", "title": "" }, { "docid": "8365b84d0000ebc12389830c17f39ef7", "score": "0.6020512", "text": "function slide_end(e) {\n e.preventDefault();\n var target = e.target;\n var map = Y.one('.dlts_viewer_map');\n var data = map.getData();\n var request = bookUrl + '/' + e.target.getValue() + '?page_view=' + data.pageview;\n if (!Y.Lang.isValue(slider.triggerBy)) {\n Y.one('.current_page').set('text', e.target.getValue());\n pjax.navigate(request);\n /** slider set focus to the slider rail, blur as soon as possible so that user can use the keyboard to read the book */\n Y.soon(function() {\n slider.thumb.blur();\n });\n }\n /** event was triggered by reference */\n else {\n slider.triggerBy = undefined;\n }\n }", "title": "" }, { "docid": "7b6d79369a97b359d8c53ed1ea5fb243", "score": "0.60059756", "text": "scrollDown(params) {\n let param = params[0] || 1;\n while (param--) {\n this._terminal.lines.splice(this._terminal.ybase + this._terminal.scrollBottom, 1);\n this._terminal.lines.splice(this._terminal.ybase + this._terminal.scrollTop, 0, this._terminal.blankLine());\n }\n // this.maxRange();\n this._terminal.updateRange(this._terminal.scrollTop);\n this._terminal.updateRange(this._terminal.scrollBottom);\n }", "title": "" }, { "docid": "9dafab887af8daa76bd8eb7f1ad989c0", "score": "0.60041976", "text": "function dragScrollEnd(element) {\n // we only want to run clearInterval if there is an interval to stop\n if (element.internalTimerIDs.scrollIntervalID !== null) {\n // stop scroll interval to stop the scrolling\n clearInterval(element.internalTimerIDs.scrollIntervalID);\n\n // clear scrolling ID to make it clear that that\n // interval has been cancelled\n element.internalTimerIDs.scrollIntervalID = null;\n }\n\n // the rest of these commands are harmless even if the scroll was\n // never started\n\n // clear scrolling direction because we've stopped\n // scrolling\n element.internalScroll.dragScrollingDirection = null;\n\n // set scrolling status variable to false so that the\n // element recognizes that scrolling is stopped\n element.internalScroll.dragScrolling = false;\n }", "title": "" }, { "docid": "e9d2050c4486e46f79b9ba61ff37d19c", "score": "0.59971017", "text": "function loadArticleForScroll(){\t\t\t\r\n\tif($(body).height() <= $(window).height()){\t\t\t\t\t\t\t\r\n\t\tif (finishImage=='true'){\r\n\t\t\treturn false;\r\n\t\t}else{\t\t\t\r\n\t\t\tvar caricato = loadArticle(pageDown, \"down\");\t\r\n\t\t\tif(caricato){\t\t\t\t\r\n\t\t\t\tpageDown++;\t\t\t\r\n\t\t\t}\r\n\t\t}\t\t\t \t\t\t\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "a1b67b8536c80643a7d536e76e71f42b", "score": "0.5991568", "text": "function scrollHandler() {\n updateMaxScrolls();\n activityHandler();\n }", "title": "" }, { "docid": "6b313f694418e1aced37172a8b549e4a", "score": "0.5987059", "text": "function eltdOnWindowScroll() {\n \n }", "title": "" }, { "docid": "d0eebeef44343fcd2a163cfb2ea8172f", "score": "0.5971746", "text": "_backDivTrackEnd() { return; }", "title": "" }, { "docid": "47cb667bf77d3fce64555d5ad71c5801", "score": "0.596957", "text": "removeScrollHandling() {}", "title": "" }, { "docid": "47cb667bf77d3fce64555d5ad71c5801", "score": "0.596957", "text": "removeScrollHandling() {}", "title": "" }, { "docid": "bb3379beea2a38da3cecdc908587e3e0", "score": "0.596497", "text": "function scrollHandler () {\n // 标识为出于滚动冷冻期\n isScroll = true;\n // 清除上次滚动冷冻timer\n clearTimeout(timeoutTimer);\n\n timeoutTimer = setTimeout(function() {\n isScroll = false;\n }, 300);\n }", "title": "" }, { "docid": "c5f36aa7f26f77403a1dd7ddd05ed6ae", "score": "0.5949454", "text": "beginScroll() {\n NativeFrameRateLogger && NativeFrameRateLogger.beginScroll();\n }", "title": "" }, { "docid": "03f4cfce2d0f3fd94fda2177f4853478", "score": "0.59468377", "text": "static stopFastScroll() {\n novelData.printer.tickSpeedMultiplier = 1;\n }", "title": "" }, { "docid": "583399d5915c163f2b67712806924d0d", "score": "0.5943887", "text": "function mkdOnWindowScroll() {\n\n }", "title": "" }, { "docid": "583399d5915c163f2b67712806924d0d", "score": "0.5943887", "text": "function mkdOnWindowScroll() {\n\n }", "title": "" }, { "docid": "90e2b766e4219daf352149744ce0bec1", "score": "0.5943544", "text": "function mkdOnWindowScroll() {\n\n\t}", "title": "" }, { "docid": "27741d9abfdf353c2b8db4a12b2b3ce4", "score": "0.5942951", "text": "function keyListBottom()\n {\n if (!vm.filtered)\n {\n return;\n }\n\n ThemeService.playSound('scrollSound');\n\n scrollToBottom();\n }", "title": "" }, { "docid": "5331f74bdd754ad0cec09c36e5011f36", "score": "0.5922986", "text": "_onScrollHandler() {\n if (this.type !== 'fit') {\n super._onScrollHandler && super._onScrollHandler();\n return;\n }\n const scrollEl = document.scrollingElement;\n let scrollLength = scrollEl.clientHeight + scrollEl.scrollTop;\n this.scrolledUp = scrollEl.scrollTop < 15;\n this.scrolledDown = (scrollEl.scrollHeight - 15) <= scrollLength\n }", "title": "" }, { "docid": "3f11b00dcce6d8ca64cc1e825aabc400", "score": "0.592168", "text": "function mkdfOnWindowScroll() {\n\n }", "title": "" }, { "docid": "3f11b00dcce6d8ca64cc1e825aabc400", "score": "0.592168", "text": "function mkdfOnWindowScroll() {\n\n }", "title": "" }, { "docid": "59a71188f75f57726b77449f4a9cee4b", "score": "0.59212077", "text": "function mkdOnWindowScroll() {}", "title": "" }, { "docid": "5796080f9a0ee14fdc8c8d310865f39c", "score": "0.5913535", "text": "function goToNext() { scrolling(+1); }", "title": "" }, { "docid": "d65d917ade1bc82b732b71291a12f95a", "score": "0.5905804", "text": "function onScroll(event) {\n if(!isLoading) {\n var closeToBottom = ($(window).scrollTop() + $(window).height() > $(document).height() - 100);\n if(closeToBottom) loadData();\n }\n }", "title": "" }, { "docid": "fe9c8c1506145f3d7b7fa88e52ca1f94", "score": "0.59034014", "text": "function scrollComplete() {\n $timeout( function() {\n $scope.$broadcast('scroll.infiniteScrollComplete');\n }, 1000);\n }", "title": "" }, { "docid": "4f87d9447e6becee77679a1559500bd0", "score": "0.5898596", "text": "function auto_drop_bottom_to()\r\n\t{\r\n\t\t\t\r\n\t\t\t\t\t\t\tvar auto_drop_bottom=setTimeout(\r\n\t\t\t\t\t\t\tfunction()\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t//$('#search_and_print').scrollTop($(\"#search_and_print\").height());\r\n\t\t\t\t\t\t\t\t$(\"#search_and_print\").animate ({scrollTop : $(\"#search_and_print\")[0].scrollHeight},600);\r\n\t\t\t\t\t\t\t},500);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\r\n\t}", "title": "" }, { "docid": "95c0092ddc8c58e6ff3b44941546ba89", "score": "0.58852565", "text": "function initScroll() {\n $(\".products\").jscroll({\n nextSelector: '.loading:last a'\n });\n }", "title": "" }, { "docid": "15da2951528764f553e35c39b8f2b51d", "score": "0.58845323", "text": "function eltdOnWindowScroll() {\n\n }", "title": "" }, { "docid": "a274df661e351d5cced17cc2d858499d", "score": "0.5883858", "text": "function startEnd() {\r\n\r\n // Turn on fades for all beads and set play to false\r\n PS.fade( PS.ALL, PS.ALL, FADE_RATE, { onEnd : playFalse } );\r\n PS.borderFade( PS.ALL, PS.ALL, FADE_RATE );\r\n\r\n // Set all beads to end_map layout\r\n colorMap( end_map );\r\n\r\n // Stop pulse_timer\r\n PS.timerStop( pulse_timer );\r\n\r\n // Start end_timer\r\n end_timer = PS.timerStart( 1, endTick );\r\n }", "title": "" }, { "docid": "c662f3027a3127c073739c7b2ad28563", "score": "0.58775884", "text": "_restoreScroll() {\n if (!isEmpty(window.openedDwFitDialogsInstances)) {\n const lastInstance = window.openedDwFitDialogsInstances[window.openedDwFitDialogsInstances.length - 1];\n lastInstance.element.unlockScroll();\n document.scrollingElement.scrollTop = lastInstance.scrollTop;\n }\n }", "title": "" }, { "docid": "5ccc5de8597007d6fe2d48fe4dba3b4b", "score": "0.5872296", "text": "scrollToEnd (){\n setTimeout(() =>{\n this.$refs.chatContainer.scrollTop = this.$refs.chatContainer.scrollHeight; \n },10) \n }", "title": "" }, { "docid": "85ce4ee287ba168ff9481e3ddafed42f", "score": "0.58717847", "text": "function onScroll() {\n if (lastScrollY !== window.scrollY) {\n lastScrollY = window.scrollY;\n requestTick('scroll');\n }\n}", "title": "" }, { "docid": "7fefc3a53b5908314c1084a0abdfeb89", "score": "0.58694017", "text": "scrollStep() {\n if (window.pageYOffset === 0) {\n clearInterval(this.state.intervalId);\n }\n window.scroll(0, window.pageYOffset - this.props.scrollStepInPx);\n }", "title": "" }, { "docid": "37e2ac022842b1dc579a1fc044b125c5", "score": "0.5855265", "text": "function scrolled(reset){\n if (nav.doScroll){\n if (!(reset==true)){\n var newPosition=[document.body.scrollTop||document.documentElement.scrollTop,document.body.scrollLeft||document.documentElement.scrollLeft];\n if (scrollCountdown>0)\n scrollCountdown--;\n else\n shift(newPosition,scrollCorner,\"scrolled\");\n nav.stopAnimation();\n snap();\n }\n }\n window.scrollTo(scrollCorner[1],scrollCorner[0]);\n }", "title": "" }, { "docid": "ac5a9ae84ca2d7d172ecd39fbac3443b", "score": "0.5853994", "text": "function scroll(event){\n\tif(typeof event.currentPageAsFloat == \"undefined\"){\n\t\treturn ;\n\t}\n\tchangeSlideOpacity(event.currentPageAsFloat);\n\tif(event.currentPage == 0){\n\t\t//Ti.App.fireEvent('Ti:table_refresh');\n\t}\n}", "title": "" }, { "docid": "6935f51fd0d004d1ace054035365afd0", "score": "0.5850567", "text": "disableScroll() {}", "title": "" }, { "docid": "a320bdfbffacb42bf912ce422c6324e6", "score": "0.58492345", "text": "moveCursorToEnd() {\n this.getEditor().moveCursorToEnd();\n const contentNodes = this.get$Body().get(0).childNodes;\n if (contentNodes.length > 0) {\n contentNodes[contentNodes.length - 1].scrollIntoView(false);\n }\n this._correctRangeAfterMoveCursor('end');\n }", "title": "" }, { "docid": "5c589130bac2daee7a47ff75ba3ae6fb", "score": "0.58366257", "text": "function set_End(end){\n setEnd(end)\n setBtn(\"<< חזרה ללימוד\")\n }", "title": "" }, { "docid": "39f3cbcd8291cba2c2014338929d084e", "score": "0.5836015", "text": "executeScrollFunctions () {\n const grid = this.$el.querySelector(\".collection-list\");\n const height = window.innerHeight;\n const domRect = grid.getBoundingClientRect();\n const triggerAmount = height - domRect.bottom + 500;\n const body = document.body.getBoundingClientRect();\n\n this.scrollHeight = body.top;\n\n //show next page of pagination list\n this.appendItems(triggerAmount);\n }", "title": "" }, { "docid": "f49c48288f15a6bd5d9e5399b00cd28d", "score": "0.5829535", "text": "function infini_scroll() {\n if(App.loading) {\n }\n else {\n var dh = $('#items').height() - $(window).height();\n var st = $(window).scrollTop();\n if ( (dh-st) < 100 ){\n App.items.boot();\n }\n }\n window.setTimeout(infini_scroll, 1000);\n}", "title": "" }, { "docid": "e49003b87a518b53dce29b96ad7aafec", "score": "0.5819805", "text": "function setEnd(end) {\n script.api.manualEnd = true;\n script.api.end = end;\n}", "title": "" }, { "docid": "4e33fa67cd5f759ff2d4d87a5e88302c", "score": "0.58173436", "text": "trigger() {\n this.targetY = window.scrollY || window.pageYOffset\n this.lerpY = this.lerpY ? this.lerpY - 1 : this.targetY - 1\n this.emit('scroll', {\n y: this.targetY, delta: 0, acceleration: 0,\n progress: cap(this.targetY / SizesCache.body.scrollArea, 0, 1)\n })\n }", "title": "" }, { "docid": "57322cdc02c16bc7835f085f5f53d496", "score": "0.5810469", "text": "function scrollHandler() {\n console.log(++handlerCallCount);\n if (isScrollToBottom()) {\n \n renderPartOfCountries();\n \n if (startIndex >= countries.length) {\n window.removeEventListener('scroll', scrollHandler);\n }\n }\n}", "title": "" }, { "docid": "7116072a553d8ec2c130913badd8d02d", "score": "0.5806092", "text": "function myLoop() { // create a loop function\n\t\t setTimeout(function() { // call a setTimeout when the loop is called // console.log('scroll close: '+i);\n\t\t setverticalPaneSize(i) // set the useeffect\n\t\t i= i-1; // decrement the counter\n\t\t if (i > -1) { // if the counter > -1, call the loop function\n\t\t myLoop(); // trigger another loop\n\t\t }\n\t\t }, 10)\t\t\t\t\t// End setTimeout()\n\t\t}", "title": "" }, { "docid": "bf22a4e9e9e864e363c48d459d160ee1", "score": "0.5802249", "text": "function ObjPixScroll(scrollableObj, scrollableObjContainer, objControlStart, objControlEnd, numPixels, myAxis) { \n showControlScroll(objControlStart, objControlEnd, scrollableObj, scrollableObjContainer, myAxis);\n function scrollToSens(sens){\n scrollableObj.stop().scrollTo(sens + \"=\" + numPixels, 1000, {\n axis:myAxis, \n onAfter:function(){ \n nav = showControlScroll(objControlStart, objControlEnd, scrollableObj, scrollableObjContainer, myAxis);\n if(scrollableObj.attr(\"id\") == \"myCarousel\"){ infiniteCarousel(nav); } \n }\n });\n }\n objControlEnd.click(function() { scrollToSens(\"+\"); });\n objControlStart.click(function() { scrollToSens(\"-\");});\n if(myAxis==\"x\"){\n scrollableObj.touchwipe({\n wipeLeft: function() { scrollToSens(\"+\") },\n wipeRight: function() { scrollToSens(\"-\") },\n preventDefaultEvents: false\n });\n }else{\n scrollableObj.touchwipe({\n wipeUp: function() { scrollToSens(\"-\") },\n wipeDown: function() { scrollToSens(\"+\") },\n preventDefaultEvents: true\n });\n } \n}", "title": "" }, { "docid": "da8a330500489a57903d30205331903f", "score": "0.57986945", "text": "function updateLastScroll() {\n lastScrollTop = st;\n }", "title": "" }, { "docid": "96069abe891587c45fdbd6fa10d11176", "score": "0.5798046", "text": "function arrowDown() {\n\twindow.scrollBy(0, 500);\n}", "title": "" }, { "docid": "0d3ad2a9b970edfa6f96ae0781c09533", "score": "0.5790653", "text": "scrollToBottom() {\n this.scrollTop = this.scrollHeight;\n }", "title": "" }, { "docid": "8d9763bfad288a28b0eb0fd2fe4ee92d", "score": "0.578248", "text": "function dropScroll(scrollGif) {\r\n //\r\n //These three lines set up the container that\r\n //holds the scroll image\r\n let scrollDiv = document.createElement(\"div\");\r\n scrollDiv.id = \"scrollDiv\";\r\n scrollDiv.style.filter = \"opacity(0%)\";\r\n //\r\n //These three lines set up the scroll image\r\n let scrollImg = document.createElement(\"img\");\r\n scrollImg.id = \"scrollImg\";\r\n scrollImg.src = scrollGif;\r\n //\r\n //These five lines set up the next button that appears\r\n //at the bottom of the scroll\r\n let scrollNextButton = document.createElement(\"input\");\r\n scrollNextButton.type = \"button\";\r\n scrollNextButton.value = \"Next\";\r\n scrollNextButton.id = \"scrollNextButton\";\r\n scrollNextButton.onclick = bossEncounter;\r\n //\r\n //These three lines put all of the previous elements that\r\n //were set up into the play area\r\n scrollDiv.appendChild(scrollImg);\r\n scrollDiv.appendChild(scrollNextButton);\r\n playArea.appendChild(scrollDiv);\r\n //\r\n //The setTimeout function ensures that the scroll appears\r\n //on screen with the intended transition effect\r\n setTimeout(function() {\r\n scrollDiv.style.filter = \"opacity(100%)\";\r\n }, 10);\r\n scrollNextButton.focus();\r\n }", "title": "" }, { "docid": "89372f7b4b9c14d664bd1fa85fb26008", "score": "0.5780215", "text": "scrollHandler() {\n\t\tscroller.scrollTo('scrollTo', {\n\t\t\tduration: 1000,\n\t\t\tsmooth: true\n\t\t});\n\t}", "title": "" }, { "docid": "fdd6542edab70e560b847444cbc96441", "score": "0.5776428", "text": "function Annie_Scroll() {\n\t\t\t$('html, body').delay(delayTimeG * 2).animate({\n\t\t\t\tscrollTop: headerH + 2\n\t\t\t}, delayTimeG * 3);\n\t\t}", "title": "" }, { "docid": "03612d63a4680397dd4bc69a309d4a78", "score": "0.5773912", "text": "function scrollBy(scrollStep){\n\t\t\n\t\tvar innerPos = t.getInnerStripPos();\n\t\tvar finalPos = innerPos + scrollStep;\n\t\t\n\t\tfinalPos = t.fixInnerStripLimits(finalPos);\n\t\t\n\t\tt.positionInnerStrip(finalPos, true);\t\t\n\t}", "title": "" }, { "docid": "4c33bc7c177d890e6274ee89cd131566", "score": "0.57682896", "text": "_evtScroll() {\n // Remove any active hover.\n this._clearHover();\n }", "title": "" }, { "docid": "4c33bc7c177d890e6274ee89cd131566", "score": "0.57682896", "text": "_evtScroll() {\n // Remove any active hover.\n this._clearHover();\n }", "title": "" }, { "docid": "f24d0802c0c06bdf0539c6758e304109", "score": "0.5767094", "text": "function scrolldown(){ //apparition ou non du bouton retour haut\n if(document.documentElement.scrollTop > 100){//on descend plus que 100px\n document.getElementById(\"boutonhaut\").style.display = \"block\";//il aparaît !\n }\n else{\n document.getElementById(\"boutonhaut\").style.display =\"none\";\n }\n}", "title": "" }, { "docid": "ac33651008e12bc0268556c6e97e958a", "score": "0.57626146", "text": "function scrollIn(){\n if(parseInt(intStep) + parseInt(ref.top) <= parseInt(intStop) ){\n ref.top += intStep;\n var intT = ref.top + GetScroll();;\n\t\t\tref.objDiv.style.top = intT + \"px\";\n\t\t\tref.objIFr.style.top = intT + \"px\";\n }\n else{\n var cancel = window.clearInterval(timerScroll);\n ref.objDiv.style.top = GetScroll() + intStop + \"px\";\n ref.objIFr.style.top = ref.objDiv.style.top;\n }\n }", "title": "" }, { "docid": "6bf6a71d073cc6f5c8ffd52fcc7e9417", "score": "0.5758537", "text": "function dive() {\r\n\tvar bottom = $(document).height();\r\n\twindow.scrollTo(0, bottom);\r\n}", "title": "" }, { "docid": "039f01734d9e40553cdcff0be7b5630f", "score": "0.5754934", "text": "function onScroll() {\n\t\t// Check if we're within 100 pixels of the bottom edge of the broser window.\n\t\tvar winHeight = window.innerHeight ? window.innerHeight : $window\n\t\t\t\t.height(), // iphone fix\n\t\tcloseToBottom = ($window.scrollTop() + winHeight > $document.height() - 100);\n\t\tif (closeToBottom) {\n\t\t\t// Get the first then items from the grid, clone them, and add them to the bottom of the grid\n\t\t\tvar $items = $('li', $tiles), $firstTen = $items.slice(0, 10);\n\t\t\t$tiles.append($firstTen.clone());\n\t\t\tapplyLayout();\n\t\t}\n\t}", "title": "" }, { "docid": "1d3fc7aa7f91f11950ed5e22b9db1897", "score": "0.5747481", "text": "function pullToRefreshEnd() {\n\n if (!pullToRefreshElement) {\n return;\n }\n\n if (!scrollerElement) {\n return;\n }\n\n isRefreshing = false;\n\n pullToRefreshElement.classList.remove(\"refreshing\");\n pullToRefreshElement.classList.remove(\"animate\");\n\n scrollerElement.classList.remove(\"refreshing-list\");\n scrollerElement.classList.add(\"refreshing-list-done\");\n scrollerElement.addEventListener(\"webkitTransitionEnd\", onScrollerTransitionEnd, true);\n }", "title": "" }, { "docid": "5955518081574a50f85ee477b2c8aa55", "score": "0.5746234", "text": "scrollBottom() {\n const nodes = document.getElementsByClassName('FullScreen-contents');\n const element = nodes[0];\n if (element) {\n element.scrollTop = element.scrollHeight - element.clientHeight;\n }\n }", "title": "" }, { "docid": "698bc51b2afe2ade4a34c1a5ec44b8aa", "score": "0.5741073", "text": "scrollover() {\n\t\t// reset to default value\n\t\tthis.scrollerpos = 640;\n\t\tthis.scrollertween.to({scrollerpos: -2200 }, 10000).onComplete(this.scrollover.bind(this)).start();\n\t}", "title": "" }, { "docid": "f5bd4bae9288b7f1a27d639425c0c69c", "score": "0.5740693", "text": "stopScrollAnimationY() {\n var scrollbar = this.getChildControl(\"scrollbar-y\", true);\n if (scrollbar) {\n scrollbar.stopScrollAnimation();\n }\n }", "title": "" }, { "docid": "026e57a823a2e36393ea3ca4f97b01d2", "score": "0.5710392", "text": "function mkdOnWindowScroll() {\n\t mkdInitPortfolioPagination().scroll();\n }", "title": "" } ]
dd3eabcdc36c90a8bc71f81c0c02d6e9
Sets or gets the animation mode. Animation is disabled when the property is set to 'none' Property type: Animation
[ { "docid": "9594b946cbefc37e9fbfceb6589d6c4d", "score": "0.59372216", "text": "get animation() {\n\t\treturn this.nativeElement ? this.nativeElement.animation : undefined;\n\t}", "title": "" } ]
[ { "docid": "e052ab52cf28faa1094dbddf84713796", "score": "0.690917", "text": "disable() {\n return this._client.send(\"Animation.disable\");\n }", "title": "" }, { "docid": "4e330fd33b4b24c0aad518f91b9bd507", "score": "0.67425615", "text": "enable() {\n return this._client.send(\"Animation.enable\");\n }", "title": "" }, { "docid": "caef9129300e220e29db2868e1b7cfbb", "score": "0.66205853", "text": "function enableAnimation() {\n if (animationsDisabled) {\n animationsDisabled = false;\n interactive = true;\n bubbleRender = setInterval(update,1000/60);\n }\n }", "title": "" }, { "docid": "f91c4b1034c5284b27e7e68bba9c02fe", "score": "0.64976645", "text": "stopAnimation () {\n this.isAnimating = false\n }", "title": "" }, { "docid": "ab9478ed52a193963b8f5960c18f6f14", "score": "0.6427975", "text": "get animation() {\n return this._animation;\n }", "title": "" }, { "docid": "0a547404c9d6b5e60fbc112f7f7cfe42", "score": "0.64063996", "text": "set hasAnimations(value) {\n if (this._animatedElements && this._animatedElements.length > 0) {\n this.setAttribute('has-animations', '');\n } else {\n this.removeAttribute('has-animations');\n }\n }", "title": "" }, { "docid": "a56d98201d9db79a26c27fa6e0bd32b6", "score": "0.6261084", "text": "function Running(){\r\n Run = !Run; //When run is false an animation is running\r\n}", "title": "" }, { "docid": "1c178951bd0db6f58ec8b3671eb19382", "score": "0.62365156", "text": "isAnimating() {\n return !!this.animation;\n }", "title": "" }, { "docid": "398eac9a17594320d8ea1bb3b87bcaac", "score": "0.6180576", "text": "function SetBooleanValueFalse(){\n Animate1 = false;\n Animate2 = false;\n Animate3 = false;\n Animate4 = false;\n Animate5 = false;\n}", "title": "" }, { "docid": "e020a8cbe0f9d40a5d29e5bb4621f314", "score": "0.6159207", "text": "get isAnimating() {\n return this._isAnimating;\n }", "title": "" }, { "docid": "916a85f9d8bc9b5108ac77dc21cbadfc", "score": "0.6093482", "text": "stop() {\n this.animationState = AnimationTypes_1.AnimationState.STOPPED;\n }", "title": "" }, { "docid": "5842857bfb21c98e437a0a09791e7b2a", "score": "0.6058196", "text": "function Awake () {\n if(enabled)\n {\n\t\t\t// Set GUIAnimSystemFREE.Instance.m_AutoAnimation to false in Awake() will let you control all GUI Animator elements in the scene via scripts.\n GUIAnimSystemFREE.Instance.m_AutoAnimation = false;\n }\n }", "title": "" }, { "docid": "e1eea057b0e8ff6e5101ea15e48e8691", "score": "0.60337585", "text": "function Awake () {\n if(enabled)\n {\n // Set GUIAnimSystemFREE.Instance.m_AutoAnimation to false in Awake() will let you control all GUI Animator elements in the scene via scripts.\n\t\t\tGUIAnimSystemFREE.Instance.m_AutoAnimation = false;\n }\n }", "title": "" }, { "docid": "4fa5a8ec2ba15143bf8c863b94a5ed6d", "score": "0.6017992", "text": "function isAnimationEnabled() {\n return window.matchMedia('(prefers-reduced-motion: no-preference)').matches;\n }", "title": "" }, { "docid": "2139e67668d3c3457c72d784f633fdaf", "score": "0.59962577", "text": "get animation() { return this.style.animationName; }", "title": "" }, { "docid": "9b2b93628751b04e3457048330ac6d2f", "score": "0.59925175", "text": "stopAnimation() {\n return CanvasAnimation.terminateAnimation(`Token.${this.id}.animateMovement`);\n }", "title": "" }, { "docid": "81bcfa23cbc2e82292eb388a560c1087", "score": "0.5977972", "text": "disableTransition() {\n // debugger\n this.sliderFrame.style.webkitTransition = `all 0ms ${this.config.easing}`;\n this.sliderFrame.style.transition = `all 0ms ${this.config.easing}`;\n }", "title": "" }, { "docid": "a097c77a1c3af30d748244753a6a10f1", "score": "0.59588516", "text": "set GenerateAnimations(value) {}", "title": "" }, { "docid": "dee159e94d838a6625c28796fcf88cee", "score": "0.59361917", "text": "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }", "title": "" }, { "docid": "599453aa6654593da451eb7db73b4167", "score": "0.5926898", "text": "toggleAnimation() {\n if (this.__stopped) {\n this.__stopped = false;\n this.shadowRoot.querySelector(\"#svg\").style.visibility = \"hidden\";\n if (this.src != null) {\n this.shadowRoot.querySelector(\"#gif\").src = this.src;\n }\n this.shadowRoot.querySelector(\"#gif\").alt =\n this.alt + \" (Stop animation.)\";\n } else {\n this.__stopped = true;\n this.shadowRoot.querySelector(\"#svg\").style.visibility = \"visible\";\n if (this.srcWithoutAnimation != null) {\n this.shadowRoot.querySelector(\"#gif\").src = this.srcWithoutAnimation;\n }\n this.shadowRoot.querySelector(\"#gif\").alt =\n this.alt + \" (Play animation.)\";\n }\n }", "title": "" }, { "docid": "3c72dc785ad844157857ff8210c45dcd", "score": "0.59152615", "text": "setAnimation( doAnimation ) {\n this.doAnimation = doAnimation;\n if (this.doAnimation) {\n this.loop(); // restart event loop\n }\n }", "title": "" }, { "docid": "500c7e288c3a39e3a5f2475bcfc0bafb", "score": "0.58882946", "text": "setAnimOnAnimatable (animatable) {\n for (let i = 0; i < animatable.length; i++) {\n animatable[i].setEnabled(false)\n this.setAnimKeys(animatable[i], i, animatable)\n }\n\n this.scene.beginAnimation(animatable[0], 0, 60, false, this.animationSpeed)\n }", "title": "" }, { "docid": "bb6ff02681cd2ac808c491fb12c1b802", "score": "0.5866884", "text": "toggle() {\n this[ this.options.animate ? '_toggleAnimate' : '_toggleClass']();\n }", "title": "" }, { "docid": "bb6ff02681cd2ac808c491fb12c1b802", "score": "0.5866884", "text": "toggle() {\n this[ this.options.animate ? '_toggleAnimate' : '_toggleClass']();\n }", "title": "" }, { "docid": "bb6ff02681cd2ac808c491fb12c1b802", "score": "0.5866884", "text": "toggle() {\n this[ this.options.animate ? '_toggleAnimate' : '_toggleClass']();\n }", "title": "" }, { "docid": "691fc69062d1e056827b9f24686ad2ae", "score": "0.5854796", "text": "function suspendAnimation() {\n if(settings.animate) {\n clearTimeout(timer);\n settings.animate = false;\n animationSuspended = true;\n }\n }", "title": "" }, { "docid": "58dcfc7fdbc6c681297f40cd939ae590", "score": "0.5828924", "text": "function controlAnimation(anubis){\n if(anubis.playingTempAnimation && anubis.animation.isDone()){\n anubis.setToDefault();\n }\n}", "title": "" }, { "docid": "76d85c5067f27e6f8c1fe5ad5c14f04d", "score": "0.5824132", "text": "setupAnimation() {\n if (!this.animation) {\n this.animation = new PlayAnimation(this.playButtonTarget)\n }\n }", "title": "" }, { "docid": "8982296858825ad1c480a9759bdef58c", "score": "0.5811765", "text": "setAnimationFunction(func) {\n this.animationFunction = func\n }", "title": "" }, { "docid": "f0201e045bd299b5120576085d5b73fc", "score": "0.5806175", "text": "function stopAnimation () {\n on = false; // Animation abgeschaltet\n clearInterval(timer); // Timer deaktivieren\n }", "title": "" }, { "docid": "a3cd5b2d79d4e2a7f6e6814ed84813c3", "score": "0.5797511", "text": "function selectAnimation() {\r\n let value = this.value;\r\n $(\"mytextarea\").value = ANIMATIONS[value];\r\n $(\"stop\").disabled = true;\r\n }", "title": "" }, { "docid": "f55853206c9989762f0e406b0a461edb", "score": "0.5795253", "text": "function setMainAnimation() {\r\n\tif (motor != null) {\r\n\t\tif ((motor.inputMoveDirection.x < 0.1 && motor.inputMoveDirection.z < 0.1) && (motor.inputMoveDirection.x > -0.1 && motor.inputMoveDirection.z >- 0.1)) {\r\n\t\t\t//gameObject.animation.CrossFade(\"stand_Idle\");\r\n\t\t\tCharSpeed = 0;\r\n\t\t\t//standIdle.enabled = true;\r\n\t\t\tanimation.CrossFade(standIdleAnimName);\r\n\t\t\r\n\t\t\t//walk.enabled = false;\r\n\t\t\t//walkArm.enabled = false;\r\n\t\t} else {\r\n\t\t\t//gameObject.animation.CrossFade(\"walkNeutral\");\r\n\t\t\twalk.speed = (1 / walkSpeedDefault) * CharSpeed;\r\n\t\t\tCharSpeed = 1.5;\r\n\t\t\t//walk.enabled = true;\r\n\t\t\tanimation.CrossFade(walkAnimName);\r\n\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\t\r\n\t\tif (waitingAnim.Contains(\"standUp\") || areSitting) {\r\n\t\t\t// we're sitting, so don't worry about any of the below\r\n\t\t\t//Debug.Log(\"we're suppose to be standing\");\r\n\t\t\t\r\n\t\t\t// we should probably turn off all, so that sitting overrides...\r\n\t\t\thappy.enabled = false;\r\n\t\t\thappyArm.enabled = false;\r\n\t\t\tsad.enabled = false;\r\n\t\t\tsadArm.enabled = false;\r\n\t\t\tangry.enabled = false;\r\n\t\t\tangryArm.enabled = false;\r\n\t\t\tafraid.enabled = false;\r\n\t\t\tafraidArm.enabled = false;\r\n\t\t\tafraidHead.enabled = false;\r\n\t\t\t\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif (happyWeight != 0){\r\n\t\t\thappy.enabled = true;\r\n\t\t\thappyArm.enabled = true;\r\n\t\t\thappy.weight = happyWeight;\r\n\t\t\thappyArm.weight = happyWeight;\r\n\t\t\tanimation.CrossFade(happyAnimName, 0.5, PlayMode.StopSameLayer);\r\n\t\t\tanimation.CrossFade(happyArmAnimName, 0.5, PlayMode.StopSameLayer);\r\n\t\t} else {\r\n\t\t\thappy.weight = 0;\r\n\t\t//\thappy.enabled = false;\r\n\t\t\thappyArm.enabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif (sadWeight != 0){\r\n\t\t\tsad.enabled = true;\r\n\t\t\tsadArm.enabled = true;\r\n\t\t\tsad.weight = sadWeight;\r\n\t\t\tsadArm.weight = Mathf.Clamp(0,sadWeight, 0.3);\r\n\t\t\t\r\n\t\t\tif (sadArm.weight > 0.6){\r\n\t\t\t\tsadArm.weight = 0.6;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tanimation.CrossFade(sadAnimName, 0.5, PlayMode.StopSameLayer);\r\n\t\t\tanimation.CrossFade(sadArmAnimName, 0.5, PlayMode.StopSameLayer);\r\n\t\t} else {\r\n\t\t\tsad.weight = 0;\r\n\t\t//\tsad.enabled = false;\r\n\t\t\tsadArm.enabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif (angryWeight != 0){\r\n\t\t\tangry.enabled = true;\r\n\t\t\tangryArm.enabled = true;\r\n\t\t\tangry.weight = angryWeight;\r\n\t\t\tangryArm.weight = angryWeight;\r\n\t\t\tanimation.CrossFade(angryAnimName, 0.5, PlayMode.StopSameLayer);\r\n\t\t\tanimation.CrossFade(angryArmAnimName, 0.5, PlayMode.StopSameLayer);\r\n\t\t} else {\r\n\t\t\tangry.weight = 0;\r\n\t\t//\tangry.enabled = false;\r\n\t\t\tangryArm.enabled = false;\r\n\t\t}\r\n\t\t\r\n\t\tif (afraidWeight != 0){\r\n\t\t\t//afraid.enabled = true;\r\n\t\t\tafraidArm.enabled = true;\r\n\t\t\tafraidHead.enabled = true;\r\n\t\t\t\r\n\t\t\t//afraid.weight = afraidWeight;\r\n\t\t\tafraidArm.weight = afraidWeight-0.3;\r\n\t\t\t\r\n\t\t\t// need to blend in a different face (with no emotions) to cover afraid\r\n\t\t\t\r\n\t\t\t//animation.Blend(afraidAnimName);\r\n\t\t\tanimation.CrossFade(afraidArmAnimName, 0.5, PlayMode.StopSameLayer);\r\n\t\t\t//afraidHead.wrapMode = WrapMode.Loop;\r\n\t\t\tanimation.CrossFade(afraidHeadAnimName, 0.5, PlayMode.StopSameLayer);\r\n\t\t\t//checkAnimationsPlaying();\r\n\t\t} else {\r\n\t\t\tafraid.weight = 0;\r\n\t//\t\tafraid.enabled = false;\r\n\t\t\tafraidArm.enabled = false;\r\n\t\t\tafraidHead.enabled = false;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t//\tif (angryWeight == 0 && sadWeight == 0 && happyWeight == 0 && afraidWeight == 0) {\r\n\t\t\t// no emotions, so do neutral walk and run\t\r\n\t//\t}\r\n\t\t\r\n\t\tif (doRun && CharSpeed > 0) {\r\n\t\t\tCharSpeed = runSpeedDefault;\r\n\t\t\trun.speed = (1 / runSpeedDefault) * CharSpeed;\r\n\t\t\trun.weight = 0.8;\r\n\t\t\trun.enabled = true;\r\n\t\t\tanimation.CrossFade(runAnimName);\r\n\t\t\trunArm.enabled = true;\r\n\t\t\trunArm.weight = 0.5;\r\n\t\t\tanimation.CrossFade(runArmAnimName);\r\n\t\t\r\n\t\t\twalk.enabled = false;\r\n\t\t\twalkArm.enabled = false;\r\n\t\t\tstandIdle.enabled = false;\r\n\t\t\t\r\n\t\t} else if (CharSpeed > 0) {\r\n\t\t\t//walk.speed = blendWalk * CharSpeed;\r\n\t\t\twalk.speed = (1 / walkSpeedDefault) * CharSpeed;\r\n\t\t\twalk.enabled = true;\r\n\t\t\tanimation.Blend(walkAnimName);\r\n\t\t\twalkArm.enabled = true;\r\n\t\t\tanimation.Blend(walkArmAnimName); \r\n\t\t\t\r\n\t\t\trun.enabled = false;\r\n\t\t\trunArm.enabled = false;\r\n\t\t\tstandIdle.enabled = false;\r\n\t\t} else {\r\n\t\t//\tDebug.Log(\"Play neutral\");\r\n\t\t\tif (areSitting) {\r\n\t\t\t\tsit();\r\n\t\t\t} else {\r\n\t\t\r\n\t\t\t\t\r\n\t\t\t\tstandIdle.enabled = true;\r\n\t\t\t\tanimation.Blend(standIdleAnimName);\r\n\t\t\t\r\n\t\t\t\twalk.enabled = false;\r\n\t\t\t\twalkArm.enabled = false;\r\n\t\t\t\trun.enabled = false;\r\n\t\t\t\trunArm.enabled = false;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "1c040a0b03e1241fa6fcf5b361c85762", "score": "0.5777271", "text": "changeStandbyMode() {\n this.actions.stopDrawingMode();\n }", "title": "" }, { "docid": "ae7fe88b7d6091a8d90c2c2c313be711", "score": "0.5766984", "text": "enabledChanged( value ) {\n\n\t\tsuper.enabledChanged( value );\n\t\tthis.animation.startAnimation( 0.5 );\n\n\t}", "title": "" }, { "docid": "866fda97bc119bdff5f1a30bc9a04bad", "score": "0.5753632", "text": "function stopAnimation(){\n var stop = document.getElementById(\"stop\");\n stop.value = clearInterval(int);\n selectAnimation();\n document.getElementById(\"start\").disabled = false;\n document.getElementById(\"animations\").disabled = false;\n document.getElementById(\"stop\").disabled = true;\n}", "title": "" }, { "docid": "7c362efd208741806307083aeda52eed", "score": "0.5737046", "text": "setAnimationRate(animation_rate)\n {\n this.animation_rate = animation_rate;\n }", "title": "" }, { "docid": "c1987d245286d4436fad7b9749c647c7", "score": "0.5699786", "text": "function playAnimation() {\n\tg_isPlaying = true;\n\tdocument.getElementById(\"play-button\").disabled=\"true\";\n}", "title": "" }, { "docid": "6a62e50a426941abd7690d227d8a6f6d", "score": "0.5698198", "text": "enableTransition() {\n // debugger\n this.sliderFrame.style.webkitTransition = `all ${this.config.duration}ms ${this.config.easing}`;\n this.sliderFrame.style.transition = `all ${this.config.duration}ms ${this.config.easing}`;\n }", "title": "" }, { "docid": "8a546e36c9769253fc20d1f5ab6614ef", "score": "0.56951964", "text": "_startAnimation() {\n // @breaking-change 8.0.0 Combine with _resetAnimation.\n this._panelAnimationState = 'enter';\n }", "title": "" }, { "docid": "6f23a3f2df6f595fbb6c628bb853cf96", "score": "0.56949466", "text": "function changeAnimationType(newType) {\n switch (newType) {\n case \"None\":\n script.animation = 0;\n break;\n case \"Bounce\":\n script.animation = 1;\n break;\n case \"Squish\":\n script.animation = 2;\n break;\n case \"Tween\":\n script.animation = 3;\n break;\n case \"OffsetPosition\":\n script.animation = 4;\n script.transformType = \"OffsetPosition\";\n break;\n case \"AnchorPosition\":\n script.animation = 4;\n script.transformType = \"AnchorPosition\";\n break;\n case \"Rotation\":\n script.animation = 4;\n script.transformType = \"Rotation\";\n break;\n case \"Scale\":\n script.animation = 4;\n script.transformType = \"Scale\";\n break;\n default:\n printWarning(\"trying to change the animation type to an invalid animation!\");\n break;\n }\n\n initAnimations();\n}", "title": "" }, { "docid": "bde64117a7295db8517a828086ec2f7d", "score": "0.56849205", "text": "toggleOff() {\n this.fade = true;\n this.stroke = this.color;\n }", "title": "" }, { "docid": "c6ca064b4734348f1d51af705d57a55a", "score": "0.566135", "text": "setAnimation(val, delay) {\n this.animate = val;\n this.delay = delay;\n }", "title": "" }, { "docid": "36ca3b435f3d0f23f9c5b0fa811df4c7", "score": "0.56603545", "text": "setAnimation() {\n this.curAnimation = this.animations[this.state];\n if(!this.curAnimation) {\n return;\n }\n\n this.curAnimationFrame = 0;\n\n const animateImages = this.curAnimation.getImages();\n this.imageName = animateImages[this.curAnimationFrame];\n }", "title": "" }, { "docid": "2d5bce839f62e65dc2be4abb3d1a38b9", "score": "0.5653604", "text": "function stopMove() {\n circle.style.animation = \"\";\n}", "title": "" }, { "docid": "efb42f8c66f31d36946f29da44c48404", "score": "0.5642644", "text": "get playingAnimation(){\n return this.#playingAnimation;\n }", "title": "" }, { "docid": "fb38e9a449ac3f7584f5792240dcfda1", "score": "0.5642388", "text": "stop() {\n this.__stopped = false;\n this.toggleAnimation();\n }", "title": "" }, { "docid": "5759567ed77908c03f9a23ad1b047cef", "score": "0.5641419", "text": "function AnimationHandler(_styleObj,_API,_animation){\n var $animationAPI = {\n 'Get':Get,\n 'Set':Set,\n 'Delay':Delay,\n 'Direction':Direction,\n 'Duration':Duration,\n 'FillMode':FillMode,\n 'IterationCount':IterationCount,\n 'Name':Name,\n 'PlayState':PlayState,\n 'TimingFunction':TimingFunction,\n 'api':_API\n };\n return (_animation === undefined ? $animationAPI : quickHandler(_animation));\n\n function Get(){\n return quickHandler();\n }\n\n function Set(_animation){\n quickHandler(_animation);\n return $animationAPI;\n }\n\n function Delay(_delay){\n var $return = $animationAPI;\n if(_delay === '$' || _delay === undefined){\n $return = Convert(RawStyleGet(_styleObj,'animationDelay'),'ms','number');\n }\n else{\n RawStyleSet(_styleObj,_API,'animationDelay',Convert(_delay,'number','ms'));\n }\n return $return;\n }\n\n function Direction(_direction){\n var $return = $animationAPI;\n if(_direction === '$' || _direction === undefined){\n $return = RawStyleGet(_styleObj,'animationDirection');\n }\n else{\n RawStyleSet(_styleObj,_API,'animationDirection',_direction);\n }\n return $return;\n }\n\n function Duration(_duration){\n var $return = $animationAPI;\n if(_duration === '$' || _duration === undefined){\n $return = Convert(RawStyleGet(_styleObj,'animationDuration'),'ms','number');\n }\n else{\n RawStyleSet(_styleObj,_API,'animationDuration',Convert(_duration,'number','ms'));\n }\n return $return;\n }\n\n function FillMode(_fillMode){\n var $return = $animationAPI;\n if(_fillMode === '$' || _fillMode === undefined){\n $return = RawStyleGet(_styleObj,'animationFillMode');\n }\n else{\n RawStyleSet(_styleObj,_API,'animationFillMode',_fillMode);\n }\n return $return;\n }\n\n function IterationCount(_iterationCount){\n var $return = $animationAPI;\n if(_iterationCount === '$' || _iterationCount === undefined){\n $return = RawStyleGet(_styleObj,'animationIterationCount');\n }\n else{\n RawStyleSet(_styleObj,_API,'animationIterationCount',_iterationCount);\n }\n return $return;\n }\n\n function Name(_name){\n var $return = $animationAPI;\n if(_name === '$' || _name === undefined){\n $return = RawStyleGet(_styleObj,'animationName');\n }\n else{\n RawStyleSet(_styleObj,_API,'animationName',_name);\n }\n return $return;\n }\n\n function PlayState(_playState){\n var $return = $animationAPI;\n if(_playState === '$' || _playState === undefined){\n $return = RawStyleGet(_styleObj,'animationPlayState');\n }\n else{\n RawStyleSet(_styleObj,_API,'animationPlayState',_playState);\n }\n return $return;\n }\n\n function TimingFunction(_timingFunction){\n var $return = $animationAPI;\n if(_timingFunction === '$' || _timingFunction === undefined){\n //We can support CubicBezier in an array ideally...\n $return = RawStyleGet(_styleObj,'animationTimingFunction');\n }\n else{\n switch(KUBE.Is(_timingFunction)){\n case 'array':\n //For CubicBezier\n break;\n }\n RawStyleSet(_styleObj,_API,'animationTimingFunction',_timingFunction);\n }\n return $return;\n }\n\n function quickHandler(_animation){\n var delay,direction,duration,fillMode,iterationCount,name,playState,timingFunction,$return = _API;\n if(_animation === undefined){\n delay = Delay();\n direction = Direction();\n duration = Duration();\n fillMode = FillMode();\n iterationCount = IterationCount();\n name = Name();\n playState = PlayState();\n timingFunction = TimingFunction();\n $return = {\n 0:name,1:duration,2:timingFunction,3:delay,4:iterationCount,5:direction,6:fillMode,7:playState,\n 'delay':delay,\n 'direction':direction,\n 'duration':duration,\n 'fillMode':fillMode,\n 'iterationCount':iterationCount,\n 'name':name,\n 'playState':playState,\n 'timingFunction':timingFunction\n };\n }\n else if(_animation === '$'){\n $return = RawStyleGet(_styleObj,'animation');\n }\n else{\n switch(KUBE.Is(_animation)){\n case 'array':\n (_animation[0] !== undefined ? Name(_animation[0]) : false);\n (_animation[1] !== undefined ? Duration(_animation[1]) : false);\n (_animation[2] !== undefined ? TimingFunction(_animation[2]) : false);\n (_animation[3] !== undefined ? Delay(_animation[3]) : false);\n (_animation[4] !== undefined ? IterationCount(_animation[4]) : false);\n (_animation[5] !== undefined ? Direction(_animation[5]) : false);\n (_animation[6] !== undefined ? FillMode(_animation[6]) : false);\n (_animation[7] !== undefined ? PlayState(_animation[7]) : false);\n break;\n\n case 'object':\n (_animation.delay !== undefined ? Delay(_animation.delay) : false);\n (_animation.direction !== undefined ? Direction(_animation.direction) : false);\n (_animation.duration !== undefined ? Duration(_animation.duration) : false);\n (_animation.fillMode !== undefined ? FillMode(_animation.fillMode) : false);\n (_animation.iterationCount !== undefined ? IterationCount(_animation.iterationCount) : false);\n (_animation.name !== undefined ? Name(_animation.name) : false);\n (_animation.playState !== undefined ? PlayState(_animation.playState) : false);\n (_animation.timingFunction !== undefined ? TimingFunction(_animation.timingFunction) : false);\n break;\n\n case 'string':\n RawStyleSet(_styleObj,_API,'animation',_animation);\n break;\n }\n }\n return $return;\n }\n\n\t}", "title": "" }, { "docid": "ff41eda79641faeb2f09df5de24e18e4", "score": "0.56396407", "text": "setAnimationDuration() {\n this.hostStyleTransition = \"opacity \" + this.options[\"animation-duration\"] + \"ms\";\n }", "title": "" }, { "docid": "9d69536958fca608897ed628acac0598", "score": "0.56235445", "text": "function animation_hide() {\n if ($(\".mo-animate\")[0]) {\n $('.mo-animate').css('opacity', '0');\n }\n }", "title": "" }, { "docid": "3a658b65d5c8db16e34cf331dc5df1df", "score": "0.5616604", "text": "function stopAnimation() {\n clearTimeout(timer);\n settings.animate = false;\n animationSuspended = false;\n _this = carousel.querySelector('[data-action]');\n _this.innerHTML = '<span class=\"visuallyhidden\">Start Animation </span>▶';\n _this.setAttribute('data-action', 'start');\n }", "title": "" }, { "docid": "dc62ebf75802fa606074c46c3740bbc3", "score": "0.5607959", "text": "static get observedAttributes() { return ['animation']; }", "title": "" }, { "docid": "ad4a70d4178a38d5c29e8e8a40a6d89b", "score": "0.5601802", "text": "get animationDuration() { return this._animationDuration; }", "title": "" }, { "docid": "ad4a70d4178a38d5c29e8e8a40a6d89b", "score": "0.5601802", "text": "get animationDuration() { return this._animationDuration; }", "title": "" }, { "docid": "ad4a70d4178a38d5c29e8e8a40a6d89b", "score": "0.5601802", "text": "get animationDuration() { return this._animationDuration; }", "title": "" }, { "docid": "ad4a70d4178a38d5c29e8e8a40a6d89b", "score": "0.5601802", "text": "get animationDuration() { return this._animationDuration; }", "title": "" }, { "docid": "17c5c7376368879e812d5e03ec2ebf96", "score": "0.5596227", "text": "function stopAnimation() {\r\n clearInterval(timer);\r\n $(\"mytextarea\").value = ANIMATIONS[$(\"animation\").value];\r\n $(\"start\").disabled = false;\r\n $(\"animation\").disabled = false;\r\n $(\"stop\").disabled = true;\r\n }", "title": "" }, { "docid": "82e51446e2f29c9b25c2197fb64d1e28", "score": "0.55905974", "text": "function stop() {\n self.animate = false;\n }", "title": "" }, { "docid": "8a2e1faa4840219e0bd3cad37e5f024d", "score": "0.5586855", "text": "function initializeAnimations() {\n\tinitializeAnimations(false);\n}", "title": "" }, { "docid": "b5434c3c4054e6032b237e10bbe15d7d", "score": "0.5572908", "text": "toggleOn() {\n this.fade = false;\n this.stroke = this.color;\n }", "title": "" }, { "docid": "f53d6f271457672042683000fc1f0ed6", "score": "0.5572242", "text": "function SetSpeed(speed : float){\n animationSpeed = speed;\n}", "title": "" }, { "docid": "f3b63a007096180c736c91b304b2ec5f", "score": "0.55687046", "text": "function toggleRunning() {\n if (!World.animation) {\n this.innerHTML = 'Pause';\n World.run();\n } else {\n this.innerHTML = 'Run';\n World.stop();\n }\n}", "title": "" }, { "docid": "7e9280820eb3fc7a55ef4b5e5cdb72a0", "score": "0.55618244", "text": "pause() {\n this.animationState = AnimationTypes_1.AnimationState.PAUSED;\n }", "title": "" }, { "docid": "7919ce109cca7c877b6977b74f111804", "score": "0.55580556", "text": "stop() {\n if (this.animation) {\n this.animation.stop();\n if (this.events.animationCancel) {\n this.events.animationCancel.notify();\n }\n }\n this.clearAnimation();\n }", "title": "" }, { "docid": "8f2861e9fb626f27c3b60c444c1f7140", "score": "0.55578417", "text": "function anim(){\n\tvar panda = document.getElementById(\"panda\");\n\t/* \n\t\tOn met en place une animation vide puis on fixe un temps d'exécution pour permettre de cliquer \n\t\tplusieurs fois sur le bouton \"Tester !\" sans avoir à changer le type d'animation \n\t*/\n\tpanda.style.webkitAnimation = \"\";\n\tpanda.style.animation = \"\";\n\tsetTimeout(function(){\n\t\tvar type = document.getElementById(\"type\").value;\n\t\tvar temps = document.getElementById(\"temps\").value;\n\t\tvar infini = document.getElementById(\"infinite\").checked;\n\t\tvar direction = document.getElementById(\"direction\").value;\n\t\t/* Mise en place de la propriété css d'animation */\n\t\tpanda.style.webkitAnimation = type+\" \"+temps+\"s\"+((infini == true)?\" infinite\":\" 1\").toString()+\" \"+direction;\n\t\tpanda.style.animation = type+\" \"+temps+\"s\"+((infini == true)?\" infinite\":\" 1\").toString()+\" \"+direction;\n\t}, 200);\n}", "title": "" }, { "docid": "1ab53ae6e0b3a4aa7d96ece16cfdd797", "score": "0.5553486", "text": "turistaColgado(){this.anims.play('colgado');this.animAnterior='colgado';}", "title": "" }, { "docid": "e665fc35b2bcba40511c2304578477ba", "score": "0.5535079", "text": "changeStandbyMode() {\n this.type = null;\n this.actions.changeSelectableAll(true);\n this._els.mosaicSelectButton.classList.remove('circle');\n this._els.mosaicSelectButton.classList.remove('rect');\n }", "title": "" }, { "docid": "440371905de15b1664113df7e0e30e99", "score": "0.5534069", "text": "set playingAnimation(value){\n this.#playingAnimation = value;\n this.emit(this,'playingAnimation:change', {playingAnimation:this.#playingAnimation});\n }", "title": "" }, { "docid": "cbbd31a6e7c6e9a7fd441094f1049193", "score": "0.5529273", "text": "reset() {\n this.animationFunction = null\n this.cancelPendingAnimation()\n }", "title": "" }, { "docid": "b440f02fe58ad82029fac3119334280c", "score": "0.55271816", "text": "clearAnimation() {\n this.animation = null;\n\n if (!this.scene.game.hasGameEnded() && !this.scene.game.isPlayingMovie()) {\n this.scene.game.setState();\n }\n }", "title": "" }, { "docid": "705b792778a697496fc17dbbfa713b1b", "score": "0.5526016", "text": "function startAnimation() {\n stopAnimation();\n animation = animate(slider.values[0]);\n playButton.classList.add(\"toggled\");\n }", "title": "" }, { "docid": "001559e1947425fa0b59a017895ca13a", "score": "0.5525588", "text": "function stopAnimation() {\n if (!animation)\n return;\n animation.pause();\n animation.reset();\n canvasDiv.style.opacity = '0';\n}", "title": "" }, { "docid": "e5c0c591cf87b3556716c0f8f2e0902e", "score": "0.5518602", "text": "function pauseAnimation() {\n\tif (g_isPlaying === true){\n\t\tg_isPlaying = false;\n\t\tdocument.getElementById(\"play-button\").disabled=\"false\"\n\t}\n}", "title": "" }, { "docid": "9a0a9fffb0fd5929bb1e54c184aca073", "score": "0.5511309", "text": "updateAnimation() {\n return;\n }", "title": "" }, { "docid": "ba0adec72c0deb9be70d5b2616b53050", "score": "0.551121", "text": "function startMove() {\n circle.style.animation = \"animate_01 2.5s infinite ease normal\";\n// circle.style.animation = \"\";\n}", "title": "" }, { "docid": "2270a190b0f5baed6f693d15cfa47d4b", "score": "0.5509896", "text": "function startAnimation() {\n const animation = animate(selectedAnimation());\n\n if (interval === null && index === 0) {\n toggleStartStopButtons();\n }\n\n if (interval === null) {\n interval = setInterval(animation, delayTime);\n }\n }", "title": "" }, { "docid": "c06fce618042ec1d940490956838d907", "score": "0.55035925", "text": "function useAnimation(animation, options = null) {\n return { type: 10 /* AnimateRef */, animation, options };\n}", "title": "" }, { "docid": "c06fce618042ec1d940490956838d907", "score": "0.55035925", "text": "function useAnimation(animation, options = null) {\n return { type: 10 /* AnimateRef */, animation, options };\n}", "title": "" }, { "docid": "c06fce618042ec1d940490956838d907", "score": "0.55035925", "text": "function useAnimation(animation, options = null) {\n return { type: 10 /* AnimateRef */, animation, options };\n}", "title": "" }, { "docid": "c06fce618042ec1d940490956838d907", "score": "0.55035925", "text": "function useAnimation(animation, options = null) {\n return { type: 10 /* AnimateRef */, animation, options };\n}", "title": "" }, { "docid": "20b952916a25978f5b435e031e3a2524", "score": "0.5500854", "text": "cancel () {\n if (!isNaN(this.animationFrameID)) {\n raf.cancel(this.animationFrameID)\n this.scope.state.update('isAnimating', false)\n }\n return this\n }", "title": "" }, { "docid": "b92869730923c1727569ab06e2228bae", "score": "0.54973465", "text": "function suspendCycleRequest(){\n document.getElementById('commitCycle').style.webkitAnimationName = 'x';\n document.getElementById('commitCycle').style.mozAnimationName = 'x'; \n}", "title": "" }, { "docid": "a8ddd5f783e5c91888ae14a7c887efb1", "score": "0.5494933", "text": "disable() {\n if (!this.isEnabled) return\n this.isEnabled = false\n this.el.style.transform = ''\n }", "title": "" }, { "docid": "7bade2bf901cc4c656dbd5681d97f700", "score": "0.54747516", "text": "_onAnimationFinish() {\n if (!this.open) {\n this.style.display = 'none';\n }\n }", "title": "" }, { "docid": "7f8a3302a575d12c8dce5847e5335a64", "score": "0.5457685", "text": "function disableInteraction() {\n moving = true;\n \n setTimeout(function(){\n moving = false\n }, 500);\n }", "title": "" }, { "docid": "3c316d1994089b907b63a112024ba775", "score": "0.5457601", "text": "function start() {\n shiftAniBox.style.animationPlayState = \"running\";\n}", "title": "" }, { "docid": "c826b1ef7ad18d856b4a372a4cd5c7bb", "score": "0.5449052", "text": "function isAnimating() {\n var de = document.documentElement;\n return de.getAttribute('enable-section-animations') == 'true';\n}", "title": "" }, { "docid": "ad0fc34ee50b1d260b8f47e6611ad469", "score": "0.5448715", "text": "animators(){\n this.animators={\n animateFrets:()=>{\n \n },\n animateButtone:()=>{\n\n },\n animateLetters:()=>{\n\n }, \n animationRemoved:()=>{\n\n }\n }\n }", "title": "" }, { "docid": "d0841d98de18e3c788c7522ccea41adc", "score": "0.54484934", "text": "playLossAnimation() {\r\n this.alpha = 0.5;\r\n }", "title": "" }, { "docid": "fc783bb38be6643b55ac749ef8519cbe", "score": "0.5432035", "text": "function toggleAnimation() {\n let gif = $(this)\n let state = gif.attr(\"data-state\");\n if (state==\"still\") {\n gif.attr({\n \"data-state\": \"animate\",\n \"src\": gif.attr(\"data-url-anim\")\n });\n } else if (state==\"animate\") {\n gif.attr({\n \"data-state\": \"still\",\n \"src\": gif.attr(\"data-url-still\")\n });\n }\n}", "title": "" }, { "docid": "1d1f48021dca331c412e4e51b479536d", "score": "0.5430344", "text": "__stopAnimation() {\n if (this.__inAnimation) {\n var fromElement = this.__currentWidget.getContainerElement();\n var toElement = this.__nextWidget.getContainerElement();\n\n qx.event.Registration.removeListener(\n fromElement,\n \"animationEnd\",\n this._onAnimationEnd,\n this\n );\n\n qx.event.Registration.removeListener(\n toElement,\n \"animationEnd\",\n this._onAnimationEnd,\n this\n );\n\n qx.bom.element.Class.removeClasses(\n fromElement,\n this.__getAnimationClasses(\"out\")\n );\n\n qx.bom.element.Class.removeClasses(\n toElement,\n this.__getAnimationClasses(\"in\")\n );\n\n this._swapWidget();\n this._widget.removeCssClass(\"animationParent\");\n this.__inAnimation = false;\n }\n }", "title": "" }, { "docid": "53047e778b0c3a1775237c55e8fce5fc", "score": "0.5427817", "text": "function stop() {\n renderer.setAnimationLoop(null);\n}", "title": "" }, { "docid": "53047e778b0c3a1775237c55e8fce5fc", "score": "0.5427817", "text": "function stop() {\n renderer.setAnimationLoop(null);\n}", "title": "" }, { "docid": "fffeda6a39babed8d4b162786d988109", "score": "0.5427764", "text": "onComplete() {\n this.isAnimating = false;\n }", "title": "" }, { "docid": "5a1a5fc5c341709480001ecb873a2aa9", "score": "0.541962", "text": "function useAnimation(animation, options) {\n if (options === void 0) { options = null; }\n return { type: 10 /* AnimateRef */, animation: animation, options: options };\n}", "title": "" }, { "docid": "3576c5e964e2b94898d2c7081d94cf8d", "score": "0.5418212", "text": "function useAnimation(animation) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n return {\n type: 10\n /* AnimateRef */\n ,\n animation: animation,\n options: options\n };\n }", "title": "" }, { "docid": "f133f5010085683fbb6bd71fb37573f5", "score": "0.5414543", "text": "static getShouldAnimate() {\n return game.settings.get(modName, animation);\n }", "title": "" }, { "docid": "336ded1e9837ac89e0efe344f9bf9a9b", "score": "0.5410627", "text": "function setAnimateFunction(makeAnimator) {\n animate = makeAnimator(visualElement);\n }", "title": "" } ]
88f25e387a72ff144a307577d7b9beca
Search an array of command items for fuzzy matches.
[ { "docid": "fa9beedd8bf423a85717bdb90a515bd8", "score": "0.64318496", "text": "function search(items,query){// Fuzzy match the items for the query.\nvar scores=matchItems(items,query);// Sort the items based on their score.\nscores.sort(scoreCmp);// Create the results for the search.\nreturn createResults(scores);}", "title": "" } ]
[ { "docid": "b3e7c9886097103a8838fa87aa163010", "score": "0.7181189", "text": "function fuzzySearch(str, arr){\n console.log('allItems is a thing', allItems[1]);\n\n let results = fuzzy.filter(str, arr);\n console.log('string searched', str.toLowerCase());\n let matches = results.map(function(el) {\n console.log('found: ', el)\n return el;\n });\n console.log('matches', matches, results);\n\n return matches;\n}", "title": "" }, { "docid": "e454f53706a728478bcbef5569a36b46", "score": "0.69447535", "text": "function matchItems(items,query){// Normalize the query text to lower case with no whitespace.\nquery=normalizeQuery(query);// Create the array to hold the scores.\nvar scores=[];// Iterate over the items and match against the query.\nfor(var i=0,n=items.length;i<n;++i){// Ignore items which are not visible.\nvar item=items[i];if(!item.isVisible){continue;}// If the query is empty, all items are matched by default.\nif(!query){scores.push({matchType:3/* Default */,categoryIndices:null,labelIndices:null,score:0,item:item});continue;}// Run the fuzzy search for the item and query.\nvar score=fuzzySearch(item,query);// Ignore the item if it is not a match.\nif(!score){continue;}// Penalize disabled items.\n// TODO - push disabled items all the way down in sort cmp?\nif(!item.isEnabled){score.score+=1000;}// Add the score to the results.\nscores.push(score);}// Return the final array of scores.\nreturn scores;}", "title": "" }, { "docid": "08a7ab46d297ce3dd64d1cfd16068fcb", "score": "0.6819447", "text": "function matchItems(items, query) {\n // Normalize the query text to lower case with no whitespace.\n query = normalizeQuery(query);\n // Create the array to hold the scores.\n var scores = [];\n // Iterate over the items and match against the query.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Ignore items which are not visible.\n var item = items[i];\n if (!item.isVisible) {\n continue;\n }\n // If the query is empty, all items are matched by default.\n if (!query) {\n scores.push({\n matchType: 3 /* Default */,\n categoryIndices: null,\n labelIndices: null,\n score: 0, item: item\n });\n continue;\n }\n // Run the fuzzy search for the item and query.\n var score = fuzzySearch(item, query);\n // Ignore the item if it is not a match.\n if (!score) {\n continue;\n }\n // Penalize disabled items.\n // TODO - push disabled items all the way down in sort cmp?\n if (!item.isEnabled) {\n score.score += 1000;\n }\n // Add the score to the results.\n scores.push(score);\n }\n // Return the final array of scores.\n return scores;\n }", "title": "" }, { "docid": "eca67a6d3e617fae7bbe705b52a9f8e8", "score": "0.6814486", "text": "function matchItems(items, query) {\n // Normalize the query text to lower case with no whitespace.\n query = normalizeQuery(query);\n // Create the array to hold the scores.\n var scores = [];\n // Iterate over the items and match against the query.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Ignore items which are not visible.\n var item = items[i];\n if (!item.isVisible) {\n continue;\n }\n // If the query is empty, all items are matched by default.\n if (!query) {\n scores.push({\n matchType: 3 /* Default */,\n categoryIndices: null,\n labelIndices: null,\n score: 0, item: item\n });\n continue;\n }\n // Run the fuzzy search for the item and query.\n var score = fuzzySearch(item, query);\n // Ignore the item if it is not a match.\n if (!score) {\n continue;\n }\n // Penalize disabled items.\n // TODO - push disabled items all the way down in sort cmp?\n if (!item.isEnabled) {\n score.score += 1000;\n }\n // Add the score to the results.\n scores.push(score);\n }\n // Return the final array of scores.\n return scores;\n }", "title": "" }, { "docid": "b4ca0b4473ae1a90ef4ef923869e7854", "score": "0.6675546", "text": "function fuzzyMatch(arr, query) {\n return arr.filter(function(el) {\n return el.toLowerCase().substring(0,2).indexOf(query.toLowerCase()) !== -1\n })\n }", "title": "" }, { "docid": "ca0e37705316011de7e3288f48ac8ad3", "score": "0.6398662", "text": "function search(items, query) {\n // Fuzzy match the items for the query.\n var scores = matchItems(items, query);\n // Sort the items based on their score.\n scores.sort(scoreCmp);\n // Create the results for the search.\n return createResults(scores);\n }", "title": "" }, { "docid": "049e62e174f8942a560bbe9892eaad3e", "score": "0.62983215", "text": "function search(items, query) {\n // Fuzzy match the items for the query.\n var scores = matchItems(items, query);\n // Sort the items based on their score.\n scores.sort(scoreCmp);\n // Create the results for the search.\n return createResults(scores);\n }", "title": "" }, { "docid": "3a19b02c8ef81bc4a3dbcc4b02647a5b", "score": "0.59257543", "text": "function fuzzyMatch(terms) {\n let query = [];\n _.each(terms, part => {\n const letters = part.trim().split(\"\");\n query.push(\"(\" + letters.join('.*') + \")\");\n });\n queryString = query.join('|');\n return new RegExp(queryString, \"i\");\n}", "title": "" }, { "docid": "b183446fde565ef3333f0cb24956b663", "score": "0.5907244", "text": "function matches(query, suggestions) {\n if (query) {\n return suggestions.filter(function (suggestion) {\n return fuzzysearch(query.toLowerCase(), suggestion.toLowerCase());\n });\n } else {\n return []; // if input is empty, return no results\n }\n}", "title": "" }, { "docid": "0f9a5a71481653a09ef9c05c274f038c", "score": "0.58400947", "text": "function matchCommands(commandArray, command) {\n var commandsDict = {\n \"HELP\": \"help\",\n \"CHOOSE\": \"i choose\",\n \"ATTACK\": \"use\",\n \"START\": \"battle me\",\n \"END\": \"end battle\",\n \"STATS\": \"stats\"\n }\n var cmdString = commandArray.join(\" \").toLowerCase().replace(\"pkmn \", \"\");\n return cmdString.indexOf(commandsDict[command]) === 0;\n}", "title": "" }, { "docid": "b2a62ec6169c28df698a5135979d42a4", "score": "0.5816828", "text": "findMatchedItems(word) {\n const filteredItems = this.allItems.filter(item => {\n const validRegexp = new RegExp('^\\\\w+$');\n if (word.match(validRegexp, 'i')) {\n const regexp = new RegExp(`^${word}\\\\w*$`, 'i');\n let flag = false;\n this.props.searchFields.forEach(fieldName => {\n if (item[fieldName].match(regexp, 'i')) {\n flag = true;\n }\n });\n return flag;\n }\n return false;\n });\n this.setState({items: filteredItems});\n }", "title": "" }, { "docid": "b981a9bbea382b125ffd3935aa1fd2d5", "score": "0.5771151", "text": "match(text, filter, fuzzy) {\n if (!text) {\n return [];\n }\n let matched = this._index.match(text, fuzzy);\n if (!filter) {\n return matched;\n }\n let filtered = [];\n let s;\n for (let n = 0, l = matched.length; n < l; ++n) {\n s = matched[n];\n if (filter(s)) {\n filtered.push(s);\n }\n }\n return filtered;\n }", "title": "" }, { "docid": "147000fabee33383f063ecab2d174b5a", "score": "0.576593", "text": "function kwsearch(items, query, iteratee = x => x) {\n\tquery = keywordify(query);\n\treturn items.map(item => {\n\t\tlet score;\n\t\tif (query.length) {\n\t\t\tlet text = iteratee(item);\n\t\t\tlet kwds = typeof(text) == 'string' ? keywordify(text) : text;\n\t\t\tscore = query.reduce((s,q) => {\n\t\t\t\tif (kwds.includes(q)) s += q.length;\n\t\t\t\treturn s;\n\t\t\t}, 0);\n\t\t} else {\n\t\t\tscore = 1;\n\t\t}\n\t\treturn {score,item};\n\t})\n\t// remove items with no matches at all\n\t.filter(m => m.score)\n\t// order by relevancy score\n\t.sort((m1,m2) => m1.score > m2.score ? -1 : m2.score > m1.score ? 1 : 0);\n}", "title": "" }, { "docid": "30a5b488cc9fcece3e06228bd1586eaa", "score": "0.5736239", "text": "function fuzzyMatch(drivers, names){\n return drivers.filter(match => match[0] === names[0])\n}", "title": "" }, { "docid": "a13a69de0fa20932dbcda959409a51a9", "score": "0.57217157", "text": "fuzzySearch(sentence) {\n const searchFor = sentence.match(/^(?:\\bwho\\b|\\bwhat\\b) (?:is|are)(?: \\ban?\\b | \\bthe\\b | )([a-zA-Z0-9_ ]*)/i)[1].replace(/\\?/g, '').replace(/'/g, '');\n const instances = this.node.getInstances();\n let multipleSearch;\n let instancesFiltered = [];\n\n if (searchFor.indexOf(' ')) {\n multipleSearch = searchFor.split(' ');\n }\n\n if (multipleSearch) {\n for (let x = 0; x < multipleSearch.length; x += 1) {\n const instancesFilteredTemp = instances.filter((input) => {\n if (input.name.toUpperCase().includes(multipleSearch[x].toUpperCase())) {\n return input;\n }\n return null;\n });\n instancesFiltered = instancesFiltered.concat(instancesFilteredTemp);\n }\n } else {\n instancesFiltered = instances.filter((input) => {\n if (input.name.toUpperCase().includes(searchFor.toUpperCase())) {\n return input;\n }\n return null;\n });\n }\n\n const instancesSummary = instancesFiltered.reduce((previous, current) => {\n const prev = previous;\n if (!prev[current.type.name]) {\n prev[current.type.name] = [];\n }\n prev[current.type.name].push(current.name);\n return prev;\n }, {});\n\n return instancesSummary;\n }", "title": "" }, { "docid": "0e50b98728f7099fc70b55917cdde12d", "score": "0.56888163", "text": "function anyElementMatches(array, item) {\n var i = array.length;\n while (i > 0) {\n i -= 1;\n if (smartmatch(array[i], item)) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "e4aeea8446d32bdc4cee4c6be625a242", "score": "0.5662692", "text": "function searchMates(query, arrayOfMates) {\n\tvar matchingMates = [];\n\tfor (var i = 0; i < arrayOfMates.length; i++) {\n\t\tif (arrayOfMates[i].name === query) {\n\t\t\tmatchingMates.push(arrayOfMates[i]);\n\t\t}\n\t}\n\treturn matchingMates;\n}", "title": "" }, { "docid": "587213b60e347556bf0ef3995a4fcc2c", "score": "0.5661089", "text": "function fuzzyMatch (driversArr, letters) {\n let lengthOfName = letters.length;\n return driversArr.filter(function (driverName) {\n return driverName.slice(0, lengthOfName) === letters;\n });\n}", "title": "" }, { "docid": "090003f637ba1666383eabeac41ddf8f", "score": "0.5632759", "text": "function allowAny(t, filteredItems) \n\t{\n\t\tvar findings = new Array(0);\n\t\tfor (var i = 0; i < filteredItems.length; i++) \n\t\t{\n\t\t\tvar compareElement = filteredItems[i].toUpperCase();\n\t\t\t// Break up the element for conditional searching.\n\t\t\tvar subElement = compareElement.split('|');\n\t\t\tvar itemName = subElement[0];\n\t\t\tvar itemDesc = subElement[7];\n\t\t\tvar itemSynop = subElement[8];\n\t\t\tvar itemSynopCont = subElement[9];\n\t\t\t\n\t\t\tvar refineElement = itemName + ' ' + itemDesc + ' ' + itemSynop + ' ' + itemSynopCont;\n\n\t\t\tfor (var j = 0; j < t.length; j++) \n\t\t\t{\n\t\t\t\tvar compareString = t[j].toUpperCase();\n\t\t\t\t\n\t\t\t\tvar pattern = new RegExp(compareString + \" \");\n//\t\t\t\tvar pattern = /\\/compareString:\\w*$/;\n\t\t\t\t\n\t\t\t\tif (pattern.test(refineElement))\n\t\t\t\t{\n//\t\t\t\t\tconsole.log(\"Element Match : \" + refineElement);\n\t\t\t\t\tfindings[findings.length] = filteredItems[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tif (refineElement.indexOf(compareString) != -1)\n//\t\t\t\t{\n////\t\t\t\t\tconsole.log(\"Element Match : \" + refineElement);\n//\t\t\t\t\tfindings[findings.length] = filteredItems[i];\n//\t\t\t\t\tbreak;\n//\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tverifyManage(findings);\n\t}", "title": "" }, { "docid": "a3d014b9abae3114e0519aa3f32156fd", "score": "0.5629742", "text": "function fuzzySearch(item,query){// Create the source text to be searched.\nvar category=item.category.toLowerCase();var label=item.label.toLowerCase();var source=category+\" \"+label;// Set up the match score and indices array.\nvar score=Infinity;var indices=null;// The regex for search word boundaries\nvar rgx=/\\b\\w/g;// Search the source by word boundary.\nwhile(true){// Find the next word boundary in the source.\nvar rgxMatch=rgx.exec(source);// Break if there is no more source context.\nif(!rgxMatch){break;}// Run the string match on the relevant substring.\nvar match=_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__[\"StringExt\"].matchSumOfDeltas(source,query,rgxMatch.index);// Break if there is no match.\nif(!match){break;}// Update the match if the score is better.\nif(match&&match.score<=score){score=match.score;indices=match.indices;}}// Bail if there was no match.\nif(!indices||score===Infinity){return null;}// Compute the pivot index between category and label text.\nvar pivot=category.length+1;// Find the slice index to separate matched indices.\nvar j=_lumino_algorithm__WEBPACK_IMPORTED_MODULE_0__[\"ArrayExt\"].lowerBound(indices,pivot,function(a,b){return a-b;});// Extract the matched category and label indices.\nvar categoryIndices=indices.slice(0,j);var labelIndices=indices.slice(j);// Adjust the label indices for the pivot offset.\nfor(var i=0,n=labelIndices.length;i<n;++i){labelIndices[i]-=pivot;}// Handle a pure label match.\nif(categoryIndices.length===0){return{matchType:0/* Label */,categoryIndices:null,labelIndices:labelIndices,score:score,item:item};}// Handle a pure category match.\nif(labelIndices.length===0){return{matchType:1/* Category */,categoryIndices:categoryIndices,labelIndices:null,score:score,item:item};}// Handle a split match.\nreturn{matchType:2/* Split */,categoryIndices:categoryIndices,labelIndices:labelIndices,score:score,item:item};}", "title": "" }, { "docid": "af4efaf13eb2042dac45b21c5196fe1a", "score": "0.5623567", "text": "function search(data, keys, searchInput) {\n let options = {\n shouldSort: true,\n keys,\n tokenize: true,\n matchAllTokens: true,\n threshold: 0.3,\n };\n let fuzzy = new fuse(data, options)\n return fuzzy.search(searchInput);\n}", "title": "" }, { "docid": "a40587e3385d210db0b3ce81476bed74", "score": "0.5592974", "text": "function fuzzyMatch(drivers, string){\n return drivers.filter(match => match.toLowerCase().indexOf(string.toLowerCase()) === 0\n )\n}", "title": "" }, { "docid": "9f4539544db4a942867709e83f42150b", "score": "0.5559179", "text": "function fuzzyMatch (list, partial) {\n let lengthOfName = partial.length;\n return list.filter(function (driverName) {\n return driverName.slice(0, lengthOfName) === partial;\n });\n}", "title": "" }, { "docid": "c7e5437877500ac8b2bc9b405565ba00", "score": "0.55389774", "text": "function findMatches(wordToMatch, namesToMatchArr) {\n return namesToMatchArr.filter(name => {\n const regex = new RegExp(wordToMatch, 'gi'); //g is global, may match any; i is insensitive\n return name.match(regex);\n });\n}", "title": "" }, { "docid": "991742c5ad32e9aa179ee1d65054d8e4", "score": "0.5520906", "text": "function FuzzyFilter() {\n\t\t// XXX we should make this more like $filter, we should search more places on the object\n\t\t// - this is provided by default in the api\n\t\t// - we may need to create multiple search objects and merge the results\n\t\treturn function fuzzy(array, query, termPath) {\n\t\t\tif(!query) return array;\n\n\t\t\t// XXX I have no idea what any of this configuration is for; it's copy-pasta from the example\n\t\t\tvar fuzzySearch = new FuzzySearch(array, { 'minimumScore': 300, 'termPath': termPath, 'caseSensitive': false });\n\t\t\tfuzzySearch.addModule(levenshteinFS({ 'maxDistanceTolerance': 3, 'factor': 3 }));\n\t\t\tfuzzySearch.addModule(indexOfFS({ 'minTermLength': 3, 'maxIterations': 500, 'factor': 3 }));\n\t\t\t// fuzzySearch.addModule(wordCountFS({'maxWordTolerance': 3, 'factor': 1}));\n\t\t\tfuzzySearch.addModule(sift3FS({ 'maxDistanceTolerance': 3, 'factor': 1 }));\n\n\t\t\tvar result = fuzzySearch.search(query);\n\t\t\tif(!result) return array;\n\n\t\t\treturn result.map(function (r) {\n\t\t\t\t// r.value.$rank = r.score;\n\t\t\t\treturn r.value;\n\t\t\t});\n\t\t};\n\t}", "title": "" }, { "docid": "73e2680d8c18908df98c0cb85c020446", "score": "0.54884404", "text": "function searchItems(item) {\n\n return function (e) {\n return e.orderId.toLowerCase().includes(item.toLowerCase())\n || e.orderDate.toLowerCase().includes(item.toLowerCase()) ||\n e.paymentMethod.toLowerCase().includes(item.toLowerCase()) || e.totalPrice.toString().toLowerCase().includes(item.toLowerCase()) ||\n\n e.userId.toLowerCase().includes(item.toLowerCase()) ||\n !item;\n }\n\n}", "title": "" }, { "docid": "b4f006c3fede8157bb4ecaf7d6dc05c5", "score": "0.5480382", "text": "function fuzzySearch(item, query) {\n // Create the source text to be searched.\n var category = item.category.toLowerCase();\n var label = item.label.toLowerCase();\n var source = category + \" \" + label;\n // Set up the match score and indices array.\n var score = Infinity;\n var indices = null;\n // The regex for search word boundaries\n var rgx = /\\b\\w/g;\n // Search the source by word boundary.\n while (true) {\n // Find the next word boundary in the source.\n var rgxMatch = rgx.exec(source);\n // Break if there is no more source context.\n if (!rgxMatch) {\n break;\n }\n // Run the string match on the relevant substring.\n var match = StringExt.matchSumOfDeltas(source, query, rgxMatch.index);\n // Break if there is no match.\n if (!match) {\n break;\n }\n // Update the match if the score is better.\n if (match && match.score <= score) {\n score = match.score;\n indices = match.indices;\n }\n }\n // Bail if there was no match.\n if (!indices || score === Infinity) {\n return null;\n }\n // Compute the pivot index between category and label text.\n var pivot = category.length + 1;\n // Find the slice index to separate matched indices.\n var j = ArrayExt.lowerBound(indices, pivot, function (a, b) { return a - b; });\n // Extract the matched category and label indices.\n var categoryIndices = indices.slice(0, j);\n var labelIndices = indices.slice(j);\n // Adjust the label indices for the pivot offset.\n for (var i = 0, n = labelIndices.length; i < n; ++i) {\n labelIndices[i] -= pivot;\n }\n // Handle a pure label match.\n if (categoryIndices.length === 0) {\n return {\n matchType: 0 /* Label */,\n categoryIndices: null,\n labelIndices: labelIndices,\n score: score, item: item\n };\n }\n // Handle a pure category match.\n if (labelIndices.length === 0) {\n return {\n matchType: 1 /* Category */,\n categoryIndices: categoryIndices,\n labelIndices: null,\n score: score, item: item\n };\n }\n // Handle a split match.\n return {\n matchType: 2 /* Split */,\n categoryIndices: categoryIndices,\n labelIndices: labelIndices,\n score: score, item: item\n };\n }", "title": "" }, { "docid": "2ae87bd56858d5b3265d293ae26f4d98", "score": "0.544406", "text": "matchKeywords(message, items = []) {\n let foundKeyword = false;\n let missingRequirements = [];\n\n // If we have any item requirements\n if (this.requirements.length > 0) {\n // Check all the requirements against the items passed\n this.requirements.forEach(function (requirement) {\n let foundRequirement = false;\n\n items.forEach(function (item) {\n if (item === requirement) {\n foundRequirement = true;\n }\n });\n // If a requirement isn't found add that a list\n if (!foundRequirement) {\n missingRequirements.push(requirement);\n }\n });\n }\n // Once we check to see if the player's missing any items,\n // parse the input for matching keywords to the prompt\n this.keywords.forEach(function (keyword) {\n if (message.includes(keyword.toLowerCase())) {\n foundKeyword = true;\n }\n });\n // If any keywords have been matched from the user input\n if (foundKeyword) {\n // If there are any missing item requirements\n if (missingRequirements.length > 0) {\n // Prompt fails; return missing items and failText\n return {'fail': {\n 'missing': missingRequirements,\n 'failText': this.results.failText}\n };\n }\n // Prompt succeeds; return results of the prompt\n return {'success': this.results};\n }\n return null;\n }", "title": "" }, { "docid": "fe817eb983bde674ce69c08a19d4d667", "score": "0.5441307", "text": "searchFuzzy() {\n this.fuzzyResults = this.search.searchService(this.searchTerm);\n }", "title": "" }, { "docid": "fe817eb983bde674ce69c08a19d4d667", "score": "0.5441307", "text": "searchFuzzy() {\n this.fuzzyResults = this.search.searchService(this.searchTerm);\n }", "title": "" }, { "docid": "0b80433ef23c49041e7124fe41168cb6", "score": "0.5434334", "text": "function findMatches(options, search) {\n const names = search.split(',');\n return names.map(name => {\n const match = options.filter(option => name.trim().toLowerCase() === option.toLowerCase());\n return match.length > 0 ? match[0] : null;\n }).\n filter(option => option !== null);\n}", "title": "" }, { "docid": "235277be2998958ec0ed984c9ca7ba35", "score": "0.54178363", "text": "function fuzzySearch(item, query) {\n // Create the source text to be searched.\n var category = item.category.toLowerCase();\n var label = item.label.toLowerCase();\n var source = category + \" \" + label;\n // Set up the match score and indices array.\n var score = Infinity;\n var indices = null;\n // The regex for search word boundaries\n var rgx = /\\b\\w/g;\n // Search the source by word boundary.\n while (true) {\n // Find the next word boundary in the source.\n var rgxMatch = rgx.exec(source);\n // Break if there is no more source context.\n if (!rgxMatch) {\n break;\n }\n // Run the string match on the relevant substring.\n var match = algorithm_1.StringExt.matchSumOfDeltas(source, query, rgxMatch.index);\n // Break if there is no match.\n if (!match) {\n break;\n }\n // Update the match if the score is better.\n if (match && match.score <= score) {\n score = match.score;\n indices = match.indices;\n }\n }\n // Bail if there was no match.\n if (!indices || score === Infinity) {\n return null;\n }\n // Compute the pivot index between category and label text.\n var pivot = category.length + 1;\n // Find the slice index to separate matched indices.\n var j = algorithm_1.ArrayExt.lowerBound(indices, pivot, function (a, b) { return a - b; });\n // Extract the matched category and label indices.\n var categoryIndices = indices.slice(0, j);\n var labelIndices = indices.slice(j);\n // Adjust the label indices for the pivot offset.\n for (var i = 0, n = labelIndices.length; i < n; ++i) {\n labelIndices[i] -= pivot;\n }\n // Handle a pure label match.\n if (categoryIndices.length === 0) {\n return {\n matchType: 0 /* Label */,\n categoryIndices: null,\n labelIndices: labelIndices,\n score: score, item: item\n };\n }\n // Handle a pure category match.\n if (labelIndices.length === 0) {\n return {\n matchType: 1 /* Category */,\n categoryIndices: categoryIndices,\n labelIndices: null,\n score: score, item: item\n };\n }\n // Handle a split match.\n return {\n matchType: 2 /* Split */,\n categoryIndices: categoryIndices,\n labelIndices: labelIndices,\n score: score, item: item\n };\n }", "title": "" }, { "docid": "17fa7aedb1c8e07662c84d787661fbdf", "score": "0.541707", "text": "function fuzzyMatch (list, partialName) {\n let lengthOfName = partialName.length;\n return list.filter(function (driverName) {\n return driverName.slice(0, lengthOfName) === partialName;\n });\n}", "title": "" }, { "docid": "07396efe7414128c70e2e474a08c64c5", "score": "0.5416825", "text": "function findMatch(data) {\n const matches = []\n for (var i = 0; i < userData.length; i++) {\n for (key in userData[i]) {\n if (userData[i][key].toLowerCase().startsWith(searchQuery)) {\n matches.push(userData[i][key])\n }\n }\n }\n return matches.slice(0, 5) //return first 5 suggestions\n }", "title": "" }, { "docid": "dce881a22690a5f16e5198fc7241422a", "score": "0.54129064", "text": "function search(items, term) {\n results = [];\n if (term === undefined) return searchables;\n _.each(items, function(item) {\n var q;\n var keys = (item.id + ' ' + item.title + ' ' + item.path).toLowerCase();\n if(typeof(term) === 'object'){\n for(var i=0; i<term.length; i++){\n q = term[i].toLowerCase();\n if (keys.indexOf(q) > -1){\n results.push(item);\n break;\n }\n }\n }else{\n q = term.toLowerCase();\n if (keys.indexOf(q) > -1) results.push(item);\n }\n });\n }", "title": "" }, { "docid": "9c72adfd6cfebeef2f6433e7a79c503a", "score": "0.54109347", "text": "function fuzzyFilter(query, searchable, options) {\n\t if (options === void 0) { options = {}; }\n\t var _a = defaults(options, DEFAULT_SEARCH_OPTIONS), getItemValue = _a.getItemValue, valueKey = _a.valueKey, trim = _a.trim, ignoreWhitespace = _a.ignoreWhitespace;\n\t query = getSearchString(query, false, trim, ignoreWhitespace);\n\t if (!searchable.length || !query) {\n\t return searchable;\n\t }\n\t var queryRegExp = getFuzzyRegExp(query);\n\t return searchable.filter(function (item) {\n\t var value = getSearchString(getItemValue(item, valueKey), false, trim, ignoreWhitespace);\n\t return value.length && value.match(queryRegExp);\n\t });\n\t}", "title": "" }, { "docid": "d1ee34f078cafa0bf1cf404e83cf30c0", "score": "0.53977907", "text": "function fuzzySearch(food, callback) {\n\n let getFood = \"SELECT * FROM foods WHERE FoodName LIKE '%\"\n + food +\"%';\";\n \n sql(getFood, (err, result) => {\n\n if (err) callback(err, null);\n callback(null, result);\n }); \n}", "title": "" }, { "docid": "1ead6ef0e3a81db7e2deaae83efe0b09", "score": "0.5380686", "text": "getSearchSuggestions(term) {\n console.log(productObjectArray);\n var results = [];\n productObjectArray.map((productObject) => {\n console.log(\"productObject.name\", productObject.name);\n console.log(\"term\", term);\n if (productObject.name.toLowerCase().includes(term.toLowerCase())) {\n console.log(\"MATCH\");\n results.push(productObject);\n }\n });\n this.setState({ productResults: results });\n console.log(results);\n }", "title": "" }, { "docid": "129b77a81f42388e30b418ed14837db6", "score": "0.53101516", "text": "function searchFoodData(foodName) {\n var searchArray = foodName.split(\" \");\n var results = [];\n var data = getUserData();\n var customFoodItems = data.customFoodItems;\n\n for (var i = 0; i < customFoodItems.length; i++)\n {\n var numMatches = 0;\n var resultName = customFoodItems[i].name;\n\n for (var j = 0; j < searchArray.length; j++)\n {\n var index = resultName.search(searchArray[j].toUpperCase());\n \n if (index != -1)\n {\n if (index != 0)\n {\n if (resultName[index-1] == \" \")\n {\n var lastIdx = index+searchArray[j].length;\n\n if (lastIdx == resultName.length)\n {\n numMatches += 1;\n } \n else if (resultName[lastIdx] == \" \")\n {\n numMatches += 1;\n }\n }\n }\n else\n {\n var lastIdx = index+searchArray[j].length;\n\n if (lastIdx == resultName.length)\n {\n numMatches += 1;\n } \n else if (resultName[lastIdx] == \" \")\n {\n numMatches += 1;\n }\n }\n \n }\n }\n \n if (numMatches == searchArray.length)\n {\n results.push(customFoodItems[i]);\n }\n }\n \n for (var i = 0; i < food_data.length; i++)\n {\n var numMatches = 0;\n var resultName = food_data[i].name;\n\n for (var j = 0; j < searchArray.length; j++)\n {\n var index = resultName.search(searchArray[j].toUpperCase());\n \n if (index != -1)\n {\n if (index != 0)\n {\n if (resultName[index-1] == \" \")\n {\n var lastIdx = index+searchArray[j].length;\n\n if (lastIdx == resultName.length)\n {\n numMatches += 1;\n } \n else if (resultName[lastIdx] == \" \")\n {\n numMatches += 1;\n }\n }\n }\n else\n {\n var lastIdx = index+searchArray[j].length;\n\n if (lastIdx == resultName.length)\n {\n numMatches += 1;\n } \n else if (resultName[lastIdx] == \" \")\n {\n numMatches += 1;\n }\n }\n }\n }\n \n if (numMatches == searchArray.length)\n {\n //results.push({hits : numMatches, foodItem : food_data[i]});\n results.push(food_data[i]);\n }\n }\n return results;\n }", "title": "" }, { "docid": "e020e30489db60861e75404f1def54a1", "score": "0.53032994", "text": "function searchItems(item) {\n\n return function (e) {\n return e.productCode.toLowerCase().includes(item.toLowerCase())\n || e.productName.toLowerCase().includes(item.toLowerCase()) ||\n\n e.size.toLowerCase().includes(item.toLowerCase()) ||\n !item;\n }\n\n}", "title": "" }, { "docid": "2a9c273e366862ca8154150da091708d", "score": "0.5271888", "text": "function fuzzyMatch(drivers, letterMatch) {\n return drivers.filter(function (match) {\n return match.toLowerCase().indexOf(letterMatch.toLowerCase()) === 0\n })\n}", "title": "" }, { "docid": "6b515be1393d90df47b5208b07d51ce2", "score": "0.52658975", "text": "function findMatches(wordToMatch, arr) {\n return arr.filter(item => {\n const regex = new RegExp(wordToMatch, 'gi');\n return item.street_address.match(regex)\n\n\n });\n }", "title": "" }, { "docid": "7924485baf31520043dba6204429d381", "score": "0.5255579", "text": "function find(item) {\n item.pathTags = item.pathTags || [\"\"];\n var hasMatch = false\n , pathname = item.pathTags.join('/')\n , track\n , title\n ;\n\n if (pathname.match(pattern)) {\n hasMatch = true;\n }\n\n searchable.forEach(function (key) {\n var val = item[key]\n ;\n \n if (!val) {\n return;\n }\n\n // TODO handle multiple tags better\n if (Array.isArray(val)) {\n val = val[0];\n }\n\n if (val.match(pattern)) {\n hasMatch = true;\n }\n });\n\n if (!hasMatch) {\n return;\n }\n\n // TODO handle multiple titles gracefully\n if (item.title && item.title.toString().match(/\\w+/)) {\n track = item.track && item.track.toString().match(/\\s*(\\d+).*/)[1];\n if (track) {\n if (track.length < 2) {\n track = '0' + track;\n }\n track += ' - ';\n }\n title = track + item.title + item.extname;\n } else {\n title = basename(item.pathTags[0]) + item.extname;\n }\n\n // doing this as an array to save memory\n results.push([item.fileMd5sum, title, item]);\n }", "title": "" }, { "docid": "d035c1fad1d33a888b41c4d57e38c8e3", "score": "0.5254758", "text": "function findMatches(wordToMatch, arr) {\n return arr.filter(item => {\n const regex = new RegExp(wordToMatch, 'gi');\n return item.street_address.match(regex)\n });\n }", "title": "" }, { "docid": "55aa1e3129fa1c935fa7ceef272d19c8", "score": "0.5224206", "text": "function matcher(item, query) {\n\t if (item.toLowerCase().indexOf(query.trim().toLowerCase()) != -1) {\n\t return true;\n\t }\n\t }", "title": "" }, { "docid": "a5a791eff8496d9ca6606cfe64e5440b", "score": "0.520266", "text": "function search(items) {\n return (\n items &&\n // eslint-disable-next-line\n items.slice(0, 40).filter((item) => {\n // console.log(item)\n // eslint-disable-next-line\n if (item.category == filterParam) {\n return searchParam.some((newItem) => {\n return (\n item[newItem] &&\n item[newItem].toString().toLowerCase().indexOf(q.toLowerCase()) >\n -1\n );\n });\n // eslint-disable-next-line\n } else if (filterParam == \"All\") {\n return searchParam.some((newItem) => {\n return (\n item[newItem] &&\n item[newItem].toString().toLowerCase().indexOf(q.toLowerCase()) >\n -1\n );\n });\n }\n })\n );\n }", "title": "" }, { "docid": "2023581195ab009f4309da99085cd06c", "score": "0.5133828", "text": "function getMatches ( mode, filter, text )\n {\n switch ( mode.trim().toLowerCase() ) {\n case 'normal':\n return textMatches( filter, text )\n\n case 'fuzzy':\n default:\n // default to fuzzy matching\n return fuzzyMatches( filter, text )\n }\n }", "title": "" }, { "docid": "dbfe3f0b73b257782df526e0fe1556b5", "score": "0.5124565", "text": "function filterItems(arr, query) {\n return arr.filter(function (el) {\n return el.toLowerCase().indexOf(query.toLowerCase()) == -1\n })\n }", "title": "" }, { "docid": "f5789fd7cc6ea13620337f63fc910160", "score": "0.5119602", "text": "function getMatches(args, patt) {\n var list = [];\n var match_order = [];\n var key_list = Object.keys(args);\n var match_patt = new RegExp(patt);\n \n for(var key in key_list)\n if(match_patt.test(key_list[key]))\n match_order.push(key_list[key]);\n match_order.sort();\n\n for (var match in match_order)\n list.push(args[match_order[match]]);\n return list;\n}", "title": "" }, { "docid": "3b6073cdba7b91c65bd8b6d98c41b2b8", "score": "0.5115528", "text": "function findMatches(wordToMatch, results) {\n return results.filter((inspection) => {\n const regex = new RegExp(wordToMatch, 'gi');// wordToMatch is regex which is case insensitive\n // return array of inspection match of either inspection city or state\n return inspection.city.match(regex) || inspection.address_line_1.match(regex)\n || inspection.zip.match(regex) || inspection.name.match(regex);\n });\n }", "title": "" }, { "docid": "03eb8d3aa866bf6830db665dba2a5842", "score": "0.5091601", "text": "function findMatches(wordToMatch, arr) {\n return arr.filter(item => {\n const regex = new RegExp(wordToMatch, 'gi');\n return item.clearance_code_inc_type.match(regex)\n });\n }", "title": "" }, { "docid": "efa68c860df9563b0d14c3e67249fd5d", "score": "0.5091185", "text": "function findMnemonic(items, key, start) {\n // Setup the result variables.\n var index = -1;\n var auto = -1;\n var multiple = false;\n // Normalize the key to upper case.\n var upperKey = key.toUpperCase();\n // Search the items from the given start index.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Compute the wrapped index.\n var k = (i + start) % n;\n // Lookup the item\n var item = items[k];\n // Ignore items which cannot be activated.\n if (!canActivate(item)) {\n continue;\n }\n // Ignore items with an empty label.\n var label = item.label;\n if (label.length === 0) {\n continue;\n }\n // Lookup the mnemonic index for the label.\n var mn = item.mnemonic;\n // Handle a valid mnemonic index.\n if (mn >= 0 && mn < label.length) {\n if (label[mn].toUpperCase() === upperKey) {\n if (index === -1) {\n index = k;\n }\n else {\n multiple = true;\n }\n }\n continue;\n }\n // Finally, handle the auto index if possible.\n if (auto === -1 && label[0].toUpperCase() === upperKey) {\n auto = k;\n }\n }\n // Return the search results.\n return { index: index, multiple: multiple, auto: auto };\n }", "title": "" }, { "docid": "938c306198d12ed90e82deb897d12dcd", "score": "0.5090234", "text": "function findMnemonic(items, key, start) {\n // Setup the result variables.\n var index = -1;\n var auto = -1;\n var multiple = false;\n // Normalize the key to upper case.\n var upperKey = key.toUpperCase();\n // Search the items from the given start index.\n for (var i = 0, n = items.length; i < n; ++i) {\n // Compute the wrapped index.\n var k = (i + start) % n;\n // Lookup the item\n var item = items[k];\n // Ignore items which cannot be activated.\n if (!canActivate(item)) {\n continue;\n }\n // Ignore items with an empty label.\n var label = item.label;\n if (label.length === 0) {\n continue;\n }\n // Lookup the mnemonic index for the label.\n var mn = item.mnemonic;\n // Handle a valid mnemonic index.\n if (mn >= 0 && mn < label.length) {\n if (label[mn].toUpperCase() === upperKey) {\n if (index === -1) {\n index = k;\n }\n else {\n multiple = true;\n }\n }\n continue;\n }\n // Finally, handle the auto index if possible.\n if (auto === -1 && label[0].toUpperCase() === upperKey) {\n auto = k;\n }\n }\n // Return the search results.\n return { index: index, multiple: multiple, auto: auto };\n }", "title": "" }, { "docid": "17eab3d2cbc13f2c423d8627a879b331", "score": "0.5075676", "text": "function searchCommands(word)\n{\n\tlet wordRaw = word\n\tkeynouns = [];\n\tkeytimes = [];\n\t\n\tfor (var i = 0; i < chatTriggers.length; i++)\n\t{\n\t\tkeynouns.push(chatTriggers[i][0]);\n\t\tkeytimes.push(chatTriggers[i][1]);\t\t\n\t}\n\t\n\tconst result = keynouns.includes(wordRaw);\n\tpos = keynouns.indexOf(wordRaw);\n\t//console.log(\"wordRaw=\" + wordRaw + pos);\n\t\n\tfindWord(wordRaw);\n\t\n\tif (result)\n\t{\n\t\tcurResponse = pos;\n\t\tvalidWords.push(wordRaw);\t\t\n }\n\t\n\t// a creepy tree is over there\n}", "title": "" }, { "docid": "19c5d08e30d076871431c7dd1e71f376", "score": "0.50616616", "text": "async searchPhrase(phrase){\n\n if (phrase === null) return false;\n if (typeof phrase !== \"string\") return false;\n if (phrase.length < 3) return [];\n phrase = phrase.toLowerCase();\n phrase = CommonFunctions.transliterate(phrase);\n\n let arrPartialWordsToSearch = []; // the extracted words used for interogating\n let arrPartialResults = []; // partial results from the DB\n\n //filter which words will be used as \"keywords\" for autocomplete\n\n let sPrefix = '';\n for (let i=0; i<phrase.length; i++){\n\n if (CommonFunctions.validateUnicodeString(phrase[i])){ //i found a letter\n sPrefix = sPrefix + phrase[i];\n } else {\n\n if ((sPrefix !== '')&&(sPrefix.length>=this.minimumWordLength)) arrPartialWordsToSearch.push(sPrefix);\n\n sPrefix = '';\n }\n\n }\n\n if ((sPrefix !== '')&&(sPrefix.length>=this.minimumWordLength)) arrPartialWordsToSearch.push(sPrefix);\n\n let sOutputName = '';\n\n for (let i=0; i<arrPartialWordsToSearch.length; i++)\n sOutputName = sOutputName + arrPartialWordsToSearch[i]+ '&';\n\n sOutputName = sOutputName.replace(/.$/,\"\");\n\n let result = await this.sortedList.intersectionInStore(sOutputName, arrPartialWordsToSearch);\n\n //console.log(\"@@@@@@@@@@@@ answer \", result,\"@@@@@\", sOutputName);\n\n if (result !== null){\n return await AutoCompleteStringsHashList.getAutoComplete(await this.sortedList.getListRangeBySortedIndex(sOutputName,1,10));\n }\n\n return [];\n }", "title": "" }, { "docid": "f1c83f565c6b9d0cf0c24739e1029c2c", "score": "0.50551414", "text": "function isACommand(string,array) {\n for (let i = 0; i < array.length; i++) {\n if (new RegExp('^'+array[i]).test(string)) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "f9bdcd7d6ee414a4a4ec26f608ada810", "score": "0.5052471", "text": "isMatch (searchTxt, item) {\n // make everything a string and lower case\n const pluString = item.plu.toString()\n const lcSearchTxt = searchTxt.toLowerCase()\n const lcName = item.name.toLowerCase()\n\n return pluString.includes(lcSearchTxt) ||\n lcName.includes(lcSearchTxt)\n }", "title": "" }, { "docid": "ec5d556586c859b76dc5a6df737fb4a5", "score": "0.504675", "text": "function createSearcher(options) {\n var increaseIncrement = typeof options.scoreIncreasePerSequencialMatchedLetter === \"number\"\n ? options.scoreIncreasePerSequencialMatchedLetter\n : MATCH_INCREASE;\n var initialScoreDecreasePerLetter = typeof options.initialScoreDecreasePerLetter === \"number\"\n ? 1 - options.initialScoreDecreasePerLetter\n : 1 - INITIAL_SCORE_DECRESE_PER_LETTER;\n var scoreDecreasePerLetterBeforeMatch = typeof options.scoreDecreasePerLetterBeforeMatch === \"number\"\n ? 1 - options.scoreDecreasePerLetterBeforeMatch\n : 1 - DECREASE_BEFORE_MATCH;\n var scoreIncreasePerLetter = typeof options.scoreIncreasePerSequencialMatchedLetter === \"number\"\n ? 1 + options.scoreIncreasePerSequencialMatchedLetter\n : 1 + MATCH_INCREASE;\n var scoreDecreasePerLetterAfterMatch = typeof options.scoreDecreasePerLetterAfterMatch === \"number\"\n ? 1 - options.scoreDecreasePerLetterAfterMatch\n : 1 - DECREASE_AFTER_MATCH;\n var initialScore = function (word) {\n return Math.pow(initialScoreDecreasePerLetter, word.length);\n };\n return function fuzzysearch(needle, haystack) {\n var hlen = haystack.length;\n var nlen = needle.length;\n if (nlen > hlen) {\n return 0;\n }\n var score = initialScore(haystack);\n var hadPreviousMatch = false;\n var increase = scoreIncreasePerLetter;\n outer: for (var i = 0, j = 0; i < nlen; i++) {\n var nch = needle.charCodeAt(i);\n var opposite = opposites[nch];\n var testChar;\n while (j < hlen) {\n testChar = haystack.charCodeAt(j++);\n if (testChar === nch || testChar === opposite) {\n hadPreviousMatch = true;\n score *= increase;\n increase += increaseIncrement;\n continue outer;\n }\n else {\n increase = scoreIncreasePerLetter;\n if (hadPreviousMatch) {\n score *= scoreDecreasePerLetterAfterMatch;\n }\n else {\n score *= scoreDecreasePerLetterBeforeMatch;\n }\n }\n }\n return 0;\n }\n return score;\n };\n}", "title": "" }, { "docid": "dfed5617b1a176611b066a263f0509aa", "score": "0.50356895", "text": "function filterItems(arr, query) {\n return arr.filter(function (el) {\n return el.toLowerCase().indexOf(query.toLowerCase()) !== -1;\n })\n }", "title": "" }, { "docid": "0166e823b325b23185e3d7bbdf82a22c", "score": "0.50347066", "text": "function filterItems(arr, query) {\n return arr.filter(function(el) {\n return el.toLowerCase().indexOf(query.toLowerCase()) !== -1;\n })\n}", "title": "" }, { "docid": "11ed75a974eb621f56138da839923986", "score": "0.50331384", "text": "search(query) {\n set(this, 'query', query);\n\n if (this.__timer) {\n clearTimeout(this.__timer);\n this.__timer = null;\n }\n\n let options = get(this, 'enabledOptions');\n let searchBy = get(this, 'search-by');\n let searchIndex = get(this, 'searchIndex') || A();\n\n if (options && query && searchBy) {\n let length = get(options, 'length'),\n match = null,\n start,\n matchIndex;\n\n query = query.toUpperCase();\n\n // Continue searching from the index of\n // the last search match\n if (this.__matchIndex) {\n start = Math.min(this.__matchIndex, length - 1);\n } else {\n start = 0;\n }\n\n let hasMatch = function (option, text) {\n if (text.indexOf(query) === 0) {\n return true;\n }\n for (let i = 0; i < searchBy.length; i++) {\n if (String(get(option, searchBy[i]) || '').toUpperCase().indexOf(query) === 0) {\n return true;\n }\n }\n return false;\n };\n\n // Search from the current value\n // for the next match\n for (let i = start; i < length; i++) {\n let option = A(options).objectAt(i);\n let text = searchIndex.objectAt(i) || '';\n match = hasMatch(option, text);\n\n // Break on the first match,\n // if a user would like to match\n // a more specific entry, they should\n // continue typing\n if (match) {\n match = option;\n matchIndex = i;\n break;\n }\n }\n\n // Stash the last matched search item\n // so we can continue searching from that\n // index on consective searches\n if (match != null) {\n get(this, 'onchange')(match);\n this.__matchIndex = matchIndex;\n }\n }\n\n if (query) {\n this.__timer = setTimeout(() => {\n if (!this.isDestroyed) {\n run(this, 'resetSearch');\n }\n }, 750);\n }\n }", "title": "" }, { "docid": "7c8860d24717eebe0c078869920150e2", "score": "0.5032345", "text": "function search(query){\n\tfunction mathcAString(string, query){\n\t\tif(string.match(query) !== null){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tfunction extractStrings(value){\n\t\t//console.log(value);\n\t\tif(typeof value === 'string'){\n\t\t\treturn mathcAString(value, query);\n\t\t} else {\n\t\t\treturn find(value, extractStrings);\n\t\t}\n\t}\n\treturn animals.filter(function(animal){\n\t\tvar result = find(animal, extractStrings);\n\t\treturn (result !== false) ? true : false;\n\t});\n}", "title": "" }, { "docid": "62cfa6e615096c95722417210040bca0", "score": "0.50228405", "text": "function searchFoodDataChrome(foodName) {\n var searchArray = foodName.split(\" \");\n var results = [];\n var data = getUserData();\n var customFoodItems = data.customFoodItems;\n\n for (var i = 0; i < customFoodItems.length; i++)\n {\n var numMatches = 0;\n var resultName = customFoodItems[i].name;\n\n for (var j = 0; j < searchArray.length; j++)\n {\n var index = resultName.search(searchArray[j].toUpperCase());\n \n if (index != -1)\n {\n if (index != 0)\n {\n if (resultName[index-1] == \" \")\n {\n var lastIdx = index+searchArray[j].length;\n\n if (lastIdx == resultName.length)\n {\n numMatches += 1;\n } \n else if (resultName[lastIdx] == \" \")\n {\n numMatches += 1;\n }\n }\n }\n else\n {\n var lastIdx = index+searchArray[j].length;\n\n if (lastIdx == resultName.length)\n {\n numMatches += 1;\n } \n else if (resultName[lastIdx] == \" \")\n {\n numMatches += 1;\n }\n }\n \n }\n }\n \n if (numMatches > 0)\n {\n results.push({hits: numMatches, foodItem: food_data[i]});\n }\n }\n \n for (var i = 0; i < food_data.length; i++)\n {\n var numMatches = 0;\n var resultName = food_data[i].name;\n\n for (var j = 0; j < searchArray.length; j++)\n {\n var index = resultName.search(searchArray[j].toUpperCase());\n \n if (index != -1)\n {\n if (index != 0)\n {\n if (resultName[index-1] == \" \")\n {\n var lastIdx = index+searchArray[j].length;\n\n if (lastIdx == resultName.length)\n {\n numMatches += 1;\n } \n else if (resultName[lastIdx] == \" \")\n {\n numMatches += 1;\n }\n }\n }\n else\n {\n var lastIdx = index+searchArray[j].length;\n\n if (lastIdx == resultName.length)\n {\n numMatches += 1;\n } \n else if (resultName[lastIdx] == \" \")\n {\n numMatches += 1;\n }\n }\n }\n }\n\n \n if (numMatches > 0)\n {\n results.push({hits: numMatches, foodItem: food_data[i]});\n }\n }\n\n var sortedResult = results.sort(function (first, second)\n {\n if (first.numMatches >= second.numMatches)\n return 1;\n else\n return -1;\n });\n\n var finalResult = [];\n\n for (var i = 0; i < sortedResult.length; i++)\n {\n finalResult.push(sortedResult[i].foodItem);\n }\n\n return finalResult;\n }", "title": "" }, { "docid": "b6000ed4f41554444fc0f9f5e111b91d", "score": "0.5021404", "text": "function findMatchesArray(array, word){\n var found = [];\n //will reaturn a new array with selected words\n for (var i=0; i < array.length; i++){\n if (array[i].indexOf(word) === 0){\n found.push(array[i]);\n }\n if (found.length > 15){\n return found;\n }\n }\n return found;\n}", "title": "" }, { "docid": "62b6c16e869731e9aca65d1b2ceff4af", "score": "0.50190073", "text": "function fuzzyMatch(drivers, string) {\n const letters = string.length\n return drivers.filter(function (name) {\n return name.slice(0,letters) === string;\n });\n}", "title": "" }, { "docid": "63d7149ce2157f178c1728a8246acd73", "score": "0.50153446", "text": "function substringMatcher(strs) {\n return function findMatches(q, cb) {\n var matches = lookup_index.search(q).map(function(result) { return result['ref']; });\n matches.sort();\n cb(matches);\n };\n}", "title": "" }, { "docid": "bd1216ac6d9f6367f6fd32343dee9670", "score": "0.49897334", "text": "function search(query, options) {\n var matches = [];\n forEach(options, function(o) {\n var s = o.textContent;\n var substring_index = s.toLowerCase().indexOf(query.toLowerCase());\n if (substring_index !== -1) {\n matches.push({\n object: o,\n result: s,\n index: substring_index\n });\n }\n });\n\n return matches.sort(function(a, b) {\n /* First, sort by index. */\n if (a.index < b.index)\n return -1;\n if (a.index > b.index)\n return 1;\n\n /* They have the same index, so we'll prefer the shortest one. */\n if (a.result.length < b.result.length)\n return -1;\n if (a.result.length > b.result.length)\n return 1;\n\n /* They have the same index and length, so we'll consider them equal. */\n return 0;\n });\n }", "title": "" }, { "docid": "bd1216ac6d9f6367f6fd32343dee9670", "score": "0.49897334", "text": "function search(query, options) {\n var matches = [];\n forEach(options, function(o) {\n var s = o.textContent;\n var substring_index = s.toLowerCase().indexOf(query.toLowerCase());\n if (substring_index !== -1) {\n matches.push({\n object: o,\n result: s,\n index: substring_index\n });\n }\n });\n\n return matches.sort(function(a, b) {\n /* First, sort by index. */\n if (a.index < b.index)\n return -1;\n if (a.index > b.index)\n return 1;\n\n /* They have the same index, so we'll prefer the shortest one. */\n if (a.result.length < b.result.length)\n return -1;\n if (a.result.length > b.result.length)\n return 1;\n\n /* They have the same index and length, so we'll consider them equal. */\n return 0;\n });\n }", "title": "" }, { "docid": "cc043e4f9823890e6e30bbb0fc2982b0", "score": "0.49824587", "text": "function enableAutocomplete(items) {\n items = items || '[data-autocomplete]';\n\n $(items).each(function() {\n let input = this;\n\n // Enable typeahead on each input\n $(input).typeahead({\n hint: false,\n minLength: 1,\n highlight: false\n }, {\n name: 'linkSuggestions',\n limit: 5,\n display: 'url',\n templates: {\n // Templates for displaying results\n suggestion: function(item) {\n switch(item.type) {\n case 'post':\n return '<div><i class=\"fa fa-file-text\"></i> ' + item.label + '</div>';\n case 'tag':\n return '<div><i class=\"fa fa-tag\"></i> ' + item.label + '</div>';\n case 'user':\n return '<div><i class=\"fa fa-user\"></i> ' + item.label + '</div>';\n case 'upload':\n return '<div><i class=\"fa fa-file-o\"></i> ' + item.label + '</div>';\n default:\n return '<div>' + item.label + '</div>';\n }\n }\n },\n source: function(items) {\n // Simple search using string matching\n return function findMatches(query, callback) {\n let matches = [];\n let regex = new RegExp(query, 'i');\n\n $.each(items, (key, item) => {\n if(regex.test(item.searchText)) {\n matches.push(item);\n }\n });\n\n callback(matches);\n };\n }(linkSuggestions)\n });\n });\n }", "title": "" }, { "docid": "7eed5d5308637abe1111e5e46c259be3", "score": "0.49793673", "text": "getSuggestions(name, distance = 3) {\n const leven = require('leven');\n return this.getAllCommands().filter(({ commandName }) => {\n return leven(name, commandName) <= distance;\n });\n }", "title": "" }, { "docid": "0f90c87d1184c2aee51361ed7ce2b08d", "score": "0.4976222", "text": "static fireMatchingAction(keys, isFocused) {\n // Figure out the LATEST active action with the LONGEST set of matching keys.\n let bestMatch, bestMatchLength = 0;\n for (let id in Action.ACTIVE_ACTIONS) {\n const action = Action.ACTIVE_ACTIONS[id];\n const match = action.matchKeys(keys, isFocused);\n if (match && match.length >= bestMatchLength) {\n bestMatch = action;\n bestMatchLength = match.length;\n }\n }\n\n if (!bestMatch) return false;\n\n try {\n bestMatch.execute();\n return true;\n } catch (e) {\n console.error(`Error firing action ${bestMatch.id}`, e);\n throw e;\n }\n }", "title": "" }, { "docid": "979fe4155afbb30685a57ad00d1d674d", "score": "0.49716106", "text": "function allMatches(words, pattern) {\n return words.filter((word) => pattern.test(word));\n }", "title": "" }, { "docid": "b2961f81325347e643bd0ff564414127", "score": "0.49633282", "text": "static qwerty_distance_suggestions([command, suggestions]) {\n return [command, Autocomplete.qwerty_sort([command, suggestions])]\n }", "title": "" }, { "docid": "98c1b801ca6fc70029c062c8e6a3d861", "score": "0.4943852", "text": "function searchItems(data, callback){\n var oidArray = data.oids;\n itemOp.find({oid: {$in: oidArray } }, {info:1, _id:0} )\n .exec(\n function(err,data){\n if(err){\n callback(true, err);\n } else if(!data){\n callback(true, \"No match found\");\n } else {\n\t callback(false, data);\n }\n }\n );\n}", "title": "" }, { "docid": "f8eeba546ef8e5e8c361969b5ab7111d", "score": "0.49366522", "text": "searchWords(words) {\n // First, given the words, find all the questions that deal with each word.\n\n // Hold all the questions that involve the words\n let questions = new Set();\n words.split(' ').forEach((word, i) => {\n let q = this.index[word] || [];\n\n // First index adds the set, the next ones grab the intersection\n questions = new Set(i === 0 ? q : q.filter(ele => questions.has(ele)));\n });\n\n \n if (questions.size === 0) return [];\n\n // Return an array of all the question/answer pairs \n return [...questions].map(question => ({\n question,\n answer: this.qa[question]\n }));\n }", "title": "" }, { "docid": "7a9d30b61a5e407c57ba028b8d6ccdd7", "score": "0.4933935", "text": "function findActions(expr, array) {\n const filteredShortcuts = array.filter((el) => {\n if (selectedCategory === \"toutes\") {\n return true;\n } else {\n return el.category === selectedCategory;\n }\n });\n return filteredShortcuts.filter((el) => {\n const regex = new RegExp(expr, \"gi\");\n // find matches with regex in category.action\n return el.action.match(regex);\n });\n}", "title": "" }, { "docid": "a65335903db2fb714aa06ffb349c2040", "score": "0.4932086", "text": "function suggestIt(searchText, items) {\n function log( message ) {\n $( \"<div>\" ).text( message ).prependTo( \"#log\" );\n $( \"#log\" ).scrollTop( 0 );\n }\n \n $( \".form-control\" ).autocomplete({\n source: function( request, response ) {\n $.ajax({\n url: queryURL + searchText + '&srlimit=3',\n dataType: \"jsonp\",\n success: function( data ) {\n return data = data.query.search.map(function(item) {\n return item.title;\n })\n }\n });\n },\n minLength: 3,\n select: function( event, ui ) {\n log( ui.item ?\n \"Selected: \" + ui.item.label :\n \"Nothing selected, input was \" + this.value);\n },\n open: function() {\n $( this ).removeClass( \"ui-corner-all\" ).addClass( \"ui-corner-top\" );\n },\n close: function() {\n $( this ).removeClass( \"ui-corner-top\" ).addClass( \"ui-corner-all\" );\n }\n });\n }", "title": "" }, { "docid": "9add9c0fbe4bc6a1b1c482bb5cc0e81a", "score": "0.49230456", "text": "execute(callback: (SearchResult[]) => void) {\n this.strategy.search(\n this.term,\n results => {\n callback(\n results.map(result => {\n return new SearchResult(result, this.term, this.strategy)\n }),\n )\n },\n this.match,\n )\n }", "title": "" }, { "docid": "6c65f1e31cd383420f94ee5939114ece", "score": "0.49217677", "text": "function updateSuggestions() {\n clearChildren(sugList);\n const userPattern = inputEle.value;\n\n const [matchingSugEles, results] = (()=> {\n if (userPattern.length === 0) {\n return [allSuggestionEles(), suggestions];\n }\n /* Show a list of matching suggestions, with matching characters bolded: */\n const fuzzySearchResults = (suggestions\n .map(sug => fuzzySearchLex(userPattern, sug))\n .filter(fuzzyRes => !fuzzyRes.hasOwnProperty('error'))\n );\n /* If there are no matches, show a list of all suggestions: */\n if (fuzzySearchResults.length === 0) {\n return [allSuggestionEles(), suggestions];\n }\n /* If there are matches, sort them so the closest matches are on top: */\n return [(fuzzySearchResults\n .sort((res1, res2) => res1.insertions - res2.insertions)\n .map(fuzzyRes => getSugEle(fuzzyRes.refStr, fuzzyRes))\n ), fuzzySearchResults.map(res => res.refStr)];\n })();\n appendChildren(sugList, matchingSugEles);\n showSugList({\n reason: 'update',\n results\n });\n }", "title": "" }, { "docid": "b9d4fe16a659295a49c10caf01f66dc6", "score": "0.4920083", "text": "function matchingStrings(strings, queries) {\n return queries.map( item => (strings.filter(value => value === item).length))\n}", "title": "" }, { "docid": "604005ce02935200052a649f17cd23ff", "score": "0.4918693", "text": "function search(pattern) {\n var matches = [];\n var phonesList = [];\n if (pattern instanceof RegExp) {\n re = pattern;\n }\n else {\n var re = new RegExp(pattern);\n }\n _.each(pronunciations, function(item) {\n var word = item[0];\n var phones = item[1];\n if (phones.match(re) && surface==\"screen\") {\n matches.push(word);\n }\n if (phones.match(re) && surface==\"no_screen\" && ! phonesList.includes(phones)) {\n matches.push(word);\n phonesList.push(phones);\n }\n });\n return matches;\n}", "title": "" }, { "docid": "75566c84a540e4e3aa65ff01829120f2", "score": "0.49181154", "text": "function matchItems(items, event) {\r\n // Look up the target of the event.\r\n var target = event.target;\r\n // Bail if there is no target.\r\n if (!target) {\r\n return null;\r\n }\r\n // Look up the current target of the event.\r\n var currentTarget = event.currentTarget;\r\n // Bail if there is no current target.\r\n if (!currentTarget) {\r\n return null;\r\n }\r\n // There are some third party libraries that cause the `target` to\r\n // be detached from the DOM before Phosphor can process the event.\r\n // If that happens, search for a new target node by point. If that\r\n // node is still dangling, bail.\r\n if (!currentTarget.contains(target)) {\r\n target = document.elementFromPoint(event.clientX, event.clientY);\r\n if (!target || !currentTarget.contains(target)) {\r\n return null;\r\n }\r\n }\r\n // Set up the result array.\r\n var result = [];\r\n // Copy the items array to allow in-place modification.\r\n var availableItems = items.slice();\r\n // Walk up the DOM hierarchy searching for matches.\r\n while (target !== null) {\r\n // Set up the match array for this DOM level.\r\n var matches = [];\r\n // Search the remaining items for matches.\r\n for (var i = 0, n = availableItems.length; i < n; ++i) {\r\n // Fetch the item.\r\n var item = availableItems[i];\r\n // Skip items which are already consumed.\r\n if (!item) {\r\n continue;\r\n }\r\n // Skip items which do not match the element.\r\n if (!domutils_1.Selector.matches(target, item.selector)) {\r\n continue;\r\n }\r\n // Add the matched item to the result for this DOM level.\r\n matches.push(item);\r\n // Mark the item as consumed.\r\n availableItems[i] = null;\r\n }\r\n // Sort the matches for this level and add them to the results.\r\n if (matches.length !== 0) {\r\n matches.sort(itemCmp);\r\n result.push.apply(result, matches);\r\n }\r\n // Stop searching at the limits of the DOM range.\r\n if (target === currentTarget) {\r\n break;\r\n }\r\n // Step to the parent DOM level.\r\n target = target.parentElement;\r\n }\r\n // Return the matched and sorted results.\r\n return result;\r\n }", "title": "" }, { "docid": "885e28bbed971739766780e4a3916949", "score": "0.491716", "text": "function findMatches(wordToMatch, results) {\n return results.filter((location) => {\n const regex = new RegExp(wordToMatch, 'gi');\n return (\n location.city.match(regex)\n || location.category.match(regex)\n || location.name.match(regex)\n );\n });\n }", "title": "" }, { "docid": "663ca7ccf41477c41e53065972714bc7", "score": "0.49097183", "text": "function allMatches(inputArray, inputRegex) {\n return inputArray.filter(word => inputRegex.test(word));\n}", "title": "" }, { "docid": "f9899a45dcfc550e01705e864eb22f10", "score": "0.4898897", "text": "function getMatches(inputText) {\n var matchList = [];\n\n for (var i = 0; i < availtitle.length; i++) {\n if (availtitle[i].toLowerCase().indexOf(inputText.toLowerCase()) ==0) {\n matchList.push(availtitle[i]);\n }\n }\n\n return matchList;\n}", "title": "" }, { "docid": "a9540b6ef8c978a645faad7c3c20e4dc", "score": "0.48985386", "text": "function searchList() {\n\t//gets value of search input and check to see if its blank\n\tvar searchTodo = document.getElementById(\"searchTodo\").value;\n\tsearchTodo = searchTodo.trim();\n\t//change the array into characters match Method is now matching the letters in todosSearch array to searchTodo word\n\tvar matchTerms = todosSearch.join();\n\t\n\tif (searchTodo == null || searchTodo == \"\") {\n alert(\"Please enter a task or name to search for\");\n return;\n \t}\n \t//create an RegExp for \\b to match only the word in task and who\n \tvar pattern = \"\\\\\" + \"b\" + searchTodo + \"\\\\\" + \"b\";\n \tvar re = new RegExp(pattern, \"ig\");\n \tvar results = matchTerms.match(re);\n \t\tif (results == null || results == \"\") {\n \tvar ul = document.getElementById(\"taskResults\");\n \t\n \tclearResultsList(ul);\n \t\n \tvar frag = document.createDocumentFragment();\n \tvar li = document.createElement(\"li\");\n \tli.innerHTML = \"No match found\";\n \tfrag.appendChild(li);\n \tul.appendChild(frag);\n \t\t}\n \t\telse {\n \t// Show the matches in the page\n \tshowResults(results);\n \t\n \t\t}\n\t//console.log(\"search item: \" + searchTodo);\n \t//console.log(\"Found \" + results.length + \" instances of \" + searchTodo + \" out of a total of \" + todosSearch.length + \" words!\");\n}", "title": "" }, { "docid": "1de044a6476ade4feceda1f2681bd92c", "score": "0.48954722", "text": "function findItemsBySearchTermsAndOrFilters() {\n var html = \"\";\n //search bar element value(s). Each word is split by space and added to an array, this way we can write out all the criteria in the text box if preferred\n var searchTermArray = searchInput.value.toLowerCase().split(' ');\n\n //add filter values to the search term array, the Type, Coloer and Univers. NOTE, we need to add DC Comics, Anime and Regular as options (if we have time)! \n searchTermArray.push(typeFilter.value.toLowerCase(), colorFilter.value.toLowerCase(), universeFilter.value.toLowerCase());\n \n //now we want to remove empty values, elaborate on this \n searchTermArray = searchTermArray.filter(Boolean);\n for (var i = 0; i < lamps.length; i++) {\n var lampObj = lamps[i];\n //create an array of search term matches for each object iteration\n var matches = [];\n for(var property in lampObj) {\n //we also want to ignore this property as it contains ambiguous values, like the name of image file e.g. \"Black Ceiling Lamp 2.jpg\"\n if(property === 'imagePath') {\n continue;\n }\n\n for (var j = 0; j < searchTermArray.length; j++) {\n var searchTerm = searchTermArray[j];\n //if the current property value contains a part of the search term, it gets added to the match array if it does not exist already.\n if(lampObj[property].toLowerCase().indexOf(searchTerm) >= 0) {\n //only include matches once, before it showed all the object for each time there was a match, super annoying\n if(matches.indexOf(searchTerm) === -1) {\n matches.push(searchTerm);\n }\n }\n }\n }\n\n //if these two match, all the search terms are part of the object\n if(matches.length === searchTermArray.length) {\n html += lampObj.createHTML();\n }\n }\n document.getElementById(\"lamps\").innerHTML = html;\n addEvents();\n}", "title": "" }, { "docid": "7a708a7fbaa7820adbeab62c96897148", "score": "0.4895001", "text": "function searchMates(arr, query){\n\tfor(var i=0; i<arr.length; i++){\n\t\tif(arr[i].firstName === query.toLowerCase()){\n\t\t\treturn arr[i];\n\t\t}\n\t\telse {\n\t\t\treturn \"the mate you are looking for doesnt exist\";\n\t\t}\n\t}\n}", "title": "" }, { "docid": "de1cd26076efaf94152c7f3d27a48da2", "score": "0.48906144", "text": "function search() {\n var searchOptions = getSearchOptions();\n if (searchOptions.term === FIND_ALL) {\n renderResultSet(grammarItems, searchOptions);\n return;\n }\n\n var resultSet = [];\n var searchTerm = searchOptions.regex ? new RegExp(searchOptions.term, \"ig\") : searchOptions.term;\n var grammarItemsCount = grammarItems.length;\n for (var i = 0; i < grammarItemsCount; i++) {\n var item = grammarItems[i];\n var doc = createDocument(item, searchOptions);\n if (doc.gammarPoint) {\n if (contains(searchOptions.regex, searchTerm, doc.gammarPoint)) {\n addToResultSet(item, resultSet, searchTerm);\n continue;\n }\n }\n if (contains(searchOptions.regex, searchTerm, doc.text)) {\n addToResultSet(item, resultSet, searchTerm);\n }\n }\n\n renderResultSet(resultSet, searchOptions);\n}", "title": "" }, { "docid": "393f90e3404503a4b58d9c4e1cf86aec", "score": "0.4885617", "text": "function matchItems(items, event) {\n // Look up the target of the event.\n var target = event.target;\n // Bail if there is no target.\n if (!target) {\n return null;\n }\n // Look up the current target of the event.\n var currentTarget = event.currentTarget;\n // Bail if there is no current target.\n if (!currentTarget) {\n return null;\n }\n // There are some third party libraries that cause the `target` to\n // be detached from the DOM before Phosphor can process the event.\n // If that happens, search for a new target node by point. If that\n // node is still dangling, bail.\n if (!currentTarget.contains(target)) {\n target = document.elementFromPoint(event.clientX, event.clientY);\n if (!target || !currentTarget.contains(target)) {\n return null;\n }\n }\n // Set up the result array.\n var result = [];\n // Copy the items array to allow in-place modification.\n var availableItems = items.slice();\n // Walk up the DOM hierarchy searching for matches.\n while (target !== null) {\n // Set up the match array for this DOM level.\n var matches = [];\n // Search the remaining items for matches.\n for (var i = 0, n = availableItems.length; i < n; ++i) {\n // Fetch the item.\n var item = availableItems[i];\n // Skip items which are already consumed.\n if (!item) {\n continue;\n }\n // Skip items which do not match the element.\n if (!domutils_1.Selector.matches(target, item.selector)) {\n continue;\n }\n // Add the matched item to the result for this DOM level.\n matches.push(item);\n // Mark the item as consumed.\n availableItems[i] = null;\n }\n // Sort the matches for this level and add them to the results.\n if (matches.length !== 0) {\n matches.sort(itemCmp);\n result.push.apply(result, matches);\n }\n // Stop searching at the limits of the DOM range.\n if (target === currentTarget) {\n break;\n }\n // Step to the parent DOM level.\n target = target.parentElement;\n }\n // Return the matched and sorted results.\n return result;\n }", "title": "" }, { "docid": "3702d581b2d10cf29d0e61c9cac5ced4", "score": "0.48821655", "text": "function getFuzzyMatcher(pattern) {\n // Use case sensitivity if the pattern contains an upper case character.\n const caseSensitive = /[A-Z]/.test(pattern);\n const patternChars = [...pattern];\n\n return dir => {\n // \"UserIDCard\" -> [\"User\", \"ID\", \"Card\"]\n const words = dir\n .replace(/([a-z])(?=[A-Z])/g, '$1_')\n .replace(/([A-Z]+)(?=[A-Z][a-z])/g, '$1_')\n .split(/[^a-zA-Z]+/g);\n\n if (!caseSensitive) {\n dir = dir.toLowerCase();\n words = words.map(word => word.toLowerCase());\n }\n\n let index = 0;\n return patternChars.every(c => {\n for (; index < dir.length; index++) {\n if (c === dir[index]) return true;\n }\n });\n\n const patternChars = [...pattern];\n };\n}", "title": "" }, { "docid": "1189deb8575a5fd1489453077523578b", "score": "0.48794225", "text": "suggestNames(inputs) {\n const suggestedNames = {...this.initialSuggestedNames};\n\n // returns the suggestion only for the first incomplete name in the inputs\n inputs.some((input, index) => {\n if (!input) {\n return false;\n }\n\n const filteredNames = [];\n this.props.data.forEach((item) => {\n // don't include the name already in the inputs\n if (!filters.name(item.name, this.props.condition)) {\n if (item.name.match(input)) {\n filteredNames.push(item.name);\n }\n }\n });\n\n if (filteredNames.length) {\n suggestedNames.index = index;\n suggestedNames.names = filteredNames;\n return true;\n }\n\n return false;\n });\n\n this.setState({suggestedNames});\n }", "title": "" }, { "docid": "a37da0e7f0f026b6787a156f2b2ca1ec", "score": "0.48779652", "text": "function filterItems(query) {\n return fruits.filter((el) =>\n el.toLowerCase().indexOf(query.toLowerCase()) > -1\n )\n}", "title": "" }, { "docid": "315886c257882302f554b717b6a5240d", "score": "0.48740613", "text": "function searchstring()\n{\n\tsearch = arrayfromargs(arguments);\n\tattr_search = search.join(\" \");\n\tre.compile(attr_search, \"g\");\n}", "title": "" }, { "docid": "fca37c2a6c7d37cd8bc557cac143d014", "score": "0.4873954", "text": "function fuzzysearch (needle, haystack) {\n if (haystack == \"\") {return false}\n if (haystack && needle && needle != \"\" &&!Array.isArray(haystack)) {\n var hlen = haystack.length;\n var nlen = needle.length;\n if (nlen > hlen) {\n return false;\n }\n if (nlen === hlen) {\n return needle === haystack;\n }\n outer: for (var i = 0, j = 0; i < nlen; i++) {\n var nch = needle.charCodeAt(i);\n while (j < hlen) {\n if (haystack.charCodeAt(j++) === nch) {\n continue outer;\n }\n }\n console.log(\"nothing found\");\n return false;\n }\n console.log(\"search found something\");\n return true;\n }\n console.log(\"search was not performed\");\n return true;\n\n}", "title": "" }, { "docid": "bdeb2fe92e4d68b59326c055c219177c", "score": "0.4865085", "text": "function matchesFuzzy(word, wordToMatchAgainst, enableSeparateSubstringMatching) {\n if (enableSeparateSubstringMatching === void 0) { enableSeparateSubstringMatching = false; }\n if (typeof word !== 'string' || typeof wordToMatchAgainst !== 'string') {\n return null; // return early for invalid input\n }\n // Form RegExp for wildcard matches\n var regexp = fuzzyRegExpCache.get(word);\n if (!regexp) {\n regexp = new RegExp(strings.convertSimple2RegExpPattern(word), 'i');\n fuzzyRegExpCache.set(word, regexp);\n }\n // RegExp Filter\n var match = regexp.exec(wordToMatchAgainst);\n if (match) {\n return [{ start: match.index, end: match.index + match[0].length }];\n }\n // Default Filter\n return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : exports.fuzzyContiguousFilter(word, wordToMatchAgainst);\n }", "title": "" }, { "docid": "5e489e739b109601199a3ecdd229ca8f", "score": "0.48649925", "text": "function matchesFuzzy(word, wordToMatchAgainst, enableSeparateSubstringMatching = false) {\n if (typeof word !== 'string' || typeof wordToMatchAgainst !== 'string') {\n return null; // return early for invalid input\n }\n // Form RegExp for wildcard matches\n let regexp = fuzzyRegExpCache.get(word);\n if (!regexp) {\n regexp = new RegExp(strings.convertSimple2RegExpPattern(word), 'i');\n fuzzyRegExpCache.set(word, regexp);\n }\n // RegExp Filter\n const match = regexp.exec(wordToMatchAgainst);\n if (match) {\n return [{ start: match.index, end: match.index + match[0].length }];\n }\n // Default Filter\n return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst);\n }", "title": "" }, { "docid": "67296d7594cc9c036b744f5bcc3cacce", "score": "0.4864729", "text": "search(value) {\n const results = [];\n if (value.length > 0) {\n const t_value = value.toLowerCase().replace(/\\s/g, \"\");\n const { items } = this.state;\n Object.keys(items).forEach(element => {\n const waste = items[element];\n if (\n waste.keywords\n .toLowerCase()\n .replace(/\\s/g, \"\")\n .includes(t_value)\n ) {\n results.push(waste.id);\n }\n });\n }\n this.setState({ results: results, lastSearch: value });\n }", "title": "" }, { "docid": "72690c912b8f8cba46c21db234b9cafe", "score": "0.48645002", "text": "function matchesFuzzy(word, wordToMatchAgainst, enableSeparateSubstringMatching) {\n if (enableSeparateSubstringMatching === void 0) { enableSeparateSubstringMatching = false; }\n if (typeof word !== 'string' || typeof wordToMatchAgainst !== 'string') {\n return null; // return early for invalid input\n }\n // Form RegExp for wildcard matches\n var regexp = fuzzyRegExpCache.get(word);\n if (!regexp) {\n regexp = new RegExp(convertSimple2RegExpPattern(word), 'i');\n fuzzyRegExpCache.set(word, regexp);\n }\n // RegExp Filter\n var match = regexp.exec(wordToMatchAgainst);\n if (match) {\n return [{ start: match.index, end: match.index + match[0].length }];\n }\n // Default Filter\n return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst);\n}", "title": "" }, { "docid": "a149155b5043bb737c9ee732cc8c7848", "score": "0.4851006", "text": "static CustomFilterFunction(items, query) {\n\n return _.filter(items, (item) => {\n var flat = squish(item);\n for (var key in flat) {\n // KEY is the column name (as received from the server)\n if (key === 'guid' || key === 'partnerName') {\n if (String(flat[key]).toLowerCase().indexOf(query.toLowerCase()) >= 0) return true;\n }\n };\n return false;\n });\n }", "title": "" } ]
baa5b97a5863e0385a153963b5e0dc7f
Function to get providers. This is to mimic the future provider registry
[ { "docid": "2278ec81ac3040556c0e2e85ebeb1a8d", "score": "0.6571175", "text": "static getIdentityProviders(): Array<ProviderEntity> {\n return [\n {\n id: 'inrupt',\n label: 'Inrupt',\n image: '/img/inrupt.svg',\n value: 'https://inrupt.net/auth',\n registerLink: 'https://inrupt.net/register',\n description: 'Lorem ipsum dolor sit amet non ipsom dolor'\n },\n {\n id: 'solid-community',\n label: 'Solid Community',\n image: '/img/Solid.png',\n value: 'https://solid.community',\n registerLink: 'https://solid.community/register',\n description: 'Lorem ipsum dolor sit non consectetur'\n }\n ];\n }", "title": "" } ]
[ { "docid": "77ef4e0669407ab5a7af74a6820c12b7", "score": "0.7557579", "text": "get providers() {\n let provs = {};\n if (this.state.resources) {\n\t for (let resource of this.state.resources.transformed) {\n\t // Add the found provider\n\t provs[resource.provider] = null;\n\t }\n }\n return Object.keys(provs).sort();\n }", "title": "" }, { "docid": "18db3704e7b1a3c7f51d040ac9fe38c0", "score": "0.7371414", "text": "findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }", "title": "" }, { "docid": "7977b51ee153dc41d35d266caae0cb7f", "score": "0.7056226", "text": "function providers() {\n return [_services_search_service__WEBPACK_IMPORTED_MODULE_8__[\"SearchService\"]];\n}", "title": "" }, { "docid": "777f7a5ca89d31672b8096a221c2d60c", "score": "0.7043588", "text": "function resolveReflectiveProviders(providers){var normalized=_normalizeProviders(providers,[]);var resolved=normalized.map(resolveReflectiveProvider);var resolvedProviderMap=mergeResolvedReflectiveProviders(resolved,new Map());return Array.from(resolvedProviderMap.values());}", "title": "" }, { "docid": "1b831219d83d9247a28ce8da8239f5f7", "score": "0.70161605", "text": "loadProviderList () {\n this.providerService.getAllProviders().then( providers => {\n this.providers = providers;\n }).catch(this.showError.bind(this));\n }", "title": "" }, { "docid": "1079e022cd3749db04fec51c25a7a4c6", "score": "0.6905227", "text": "function ModuleWithProviders() { }", "title": "" }, { "docid": "1079e022cd3749db04fec51c25a7a4c6", "score": "0.6905227", "text": "function ModuleWithProviders() { }", "title": "" }, { "docid": "d124a1d8cbae1cb73be234158d100f66", "score": "0.68303096", "text": "function ModuleWithProviders() {}", "title": "" }, { "docid": "963400175a75b68392ce427679a81aae", "score": "0.68179834", "text": "async registerConfiguredProviders(providers) {\n for (const provider of providers) {\n await this.registerProvider(provider);\n }\n }", "title": "" }, { "docid": "2e02463980bd7ff5409efa435669b696", "score": "0.66463983", "text": "function ModuleWithProviders(){}", "title": "" }, { "docid": "3047c59e910e5c174ec84482e8be9d3e", "score": "0.66031677", "text": "get dnsproviders () { return require('./dnsproviders'); }", "title": "" }, { "docid": "e5f608284495bd585b51877fb125fa5a", "score": "0.655726", "text": "function chain() {\n var providers = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n providers[_i] = arguments[_i];\n }\n return function () {\n var e_1, _a;\n var promise = Promise.reject(new _ProviderError__WEBPACK_IMPORTED_MODULE_0__.ProviderError(\"No providers in chain\"));\n var _loop_1 = function (provider) {\n promise = promise.catch(function (err) {\n if (err === null || err === void 0 ? void 0 : err.tryNextLink) {\n return provider();\n }\n throw err;\n });\n };\n try {\n for (var providers_1 = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__values)(providers), providers_1_1 = providers_1.next(); !providers_1_1.done; providers_1_1 = providers_1.next()) {\n var provider = providers_1_1.value;\n _loop_1(provider);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (providers_1_1 && !providers_1_1.done && (_a = providers_1.return)) _a.call(providers_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return promise;\n };\n}", "title": "" }, { "docid": "1358bf5459bea011b98649a79929f1e5", "score": "0.6543464", "text": "function resolveProviders(providers) {\n\t var normalized = _createListOfProviders(_normalizeProviders(providers, new Map()));\n\t return normalized.map(function (b) {\n\t if (b instanceof _NormalizedProvider) {\n\t return new ResolvedProvider_(b.key, [b.resolvedFactory], false);\n\t }\n\t else {\n\t var arr = b;\n\t return new ResolvedProvider_(arr[0].key, arr.map(function (_) { return _.resolvedFactory; }), true);\n\t }\n\t });\n\t}", "title": "" }, { "docid": "5da799ca67d896824b36688f50b98161", "score": "0.6528331", "text": "function chain() {\n var providers = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n providers[_i] = arguments[_i];\n }\n\n return function () {\n var e_1, _a;\n\n var promise = Promise.reject(new _ProviderError__WEBPACK_IMPORTED_MODULE_1__[\"ProviderError\"](\"No providers in chain\"));\n\n var _loop_1 = function (provider) {\n promise = promise.catch(function (err) {\n if (err === null || err === void 0 ? void 0 : err.tryNextLink) {\n return provider();\n }\n\n throw err;\n });\n };\n\n try {\n for (var providers_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__values\"])(providers), providers_1_1 = providers_1.next(); !providers_1_1.done; providers_1_1 = providers_1.next()) {\n var provider = providers_1_1.value;\n\n _loop_1(provider);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (providers_1_1 && !providers_1_1.done && (_a = providers_1.return)) _a.call(providers_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return promise;\n };\n}", "title": "" }, { "docid": "f3d4c4f359a13df0e703b3b8c181221f", "score": "0.64378035", "text": "function loadProviders() {\r\n var result = onlineService.loadIndex(\"\", onProvidersLoaded);\r\n }", "title": "" }, { "docid": "9b8a5345fea32cf0d6364aebf60efc21", "score": "0.6408265", "text": "function resolveProviders(providers) {\r\n var normalized = _createListOfProviders(_normalizeProviders(providers, new Map()));\r\n return normalized.map(function (b) {\r\n if (b instanceof _NormalizedProvider) {\r\n return new ResolvedProvider_(b.key, [b.resolvedFactory], false);\r\n }\r\n else {\r\n var arr = b;\r\n return new ResolvedProvider_(arr[0].key, arr.map(function (_) { return _.resolvedFactory; }), true);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "d48d81f0180d5c038ce5edd202609f03", "score": "0.6381689", "text": "function getAllProviders (req, res) {\n\n models.provider.findAll().then( providers => {\n res.status(200).json(providers);\n }).catch((error) => {\n console.log(error);\n if (global.conf.verbose)\n console.log(error.stack);\n res.sendStatus(500);\n });\n\n}", "title": "" }, { "docid": "629206a24cc48cd2d0ea384293358407", "score": "0.6349104", "text": "migrateDecoratedProviders(providers) {\n return providers.reduce((failures, node) => failures.concat(this._migrateProviderBaseClass(node)), []);\n }", "title": "" }, { "docid": "a66d596136ca42bba6ef13e16b0d8310", "score": "0.6341161", "text": "async getContextProvidersModule() {\r\n // Don't do anything of the module was already created\r\n if (this.contextProvidersModule)\r\n return this.contextProvidersModule;\r\n // Create the module as a root otherwise\r\n // @ts-ignore\r\n return (this.contextProvidersModule = registry_1.Registry.createRoot({\r\n type: contextProvider_type_1.ContextProviderType,\r\n }));\r\n }", "title": "" }, { "docid": "18f54d53ba309d07ebcbf2955b7f842d", "score": "0.6337091", "text": "function requestAndReceiveProviders() {\n return dispatch => {\n dispatch(requestProviders())\n\n return api.getProviders().then(\n response => {\n return dispatch(receiveProviders(response))\n },\n error => {\n console.error(error.message)\n }\n )\n }\n}", "title": "" }, { "docid": "fd57098766648a37236fbed01606cfae", "score": "0.6336434", "text": "function getReqProviders(req, reply) {\n const providers = [\n {\n provide: REQUEST,\n useValue: req.raw,\n },\n ];\n providers.push({\n provide: RESPONSE,\n useValue: reply.raw,\n });\n return providers;\n}", "title": "" }, { "docid": "a926f2ab9de2edd794771cf5609cb997", "score": "0.63036805", "text": "getProvider() {\n this.provider = this.provider instanceof Provider ? this.provider : ProviderFactory.create()\n return this.provider\n }", "title": "" }, { "docid": "c23bde3eeb67b852bbc243a26955222d", "score": "0.6301864", "text": "function multiProvidersFactoryResolver(_, tData, lData, tNode) {\n return multiResolve(this.multi, []);\n }", "title": "" }, { "docid": "c23bde3eeb67b852bbc243a26955222d", "score": "0.6301864", "text": "function multiProvidersFactoryResolver(_, tData, lData, tNode) {\n return multiResolve(this.multi, []);\n }", "title": "" }, { "docid": "ae449ef9d80dd2296b1c86ed7fee4746", "score": "0.6292065", "text": "get components() {\n return this._providers;\n }", "title": "" }, { "docid": "be4d0df9227de622c97a06fbc670dff9", "score": "0.62864065", "text": "function multiProvidersFactoryResolver(_, tData, lData, tNode) {\n return multiResolve(this.multi, []);\n}", "title": "" }, { "docid": "be4d0df9227de622c97a06fbc670dff9", "score": "0.62864065", "text": "function multiProvidersFactoryResolver(_, tData, lData, tNode) {\n return multiResolve(this.multi, []);\n}", "title": "" }, { "docid": "38ca68d6489a1313fbea6a8199d63946", "score": "0.62635314", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n }", "title": "" }, { "docid": "38ca68d6489a1313fbea6a8199d63946", "score": "0.62635314", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n }", "title": "" }, { "docid": "00f74802e93b60e6cac63493ce765ceb", "score": "0.62473375", "text": "function resolveReflectiveProviders(providers) {\n\t var normalized = _normalizeProviders(providers, []);\n\t var resolved = normalized.map(resolveReflectiveProvider);\n\t return MapWrapper.values(mergeResolvedReflectiveProviders(resolved, new Map()));\n\t }", "title": "" }, { "docid": "63a0c445d1db749d7324521a035844aa", "score": "0.62447304", "text": "isProviderSupported(provider) {\n return provider in providers;\n }", "title": "" }, { "docid": "b831d69a0396382d5c1194edd5ba8fb9", "score": "0.62060153", "text": "function resolveReflectiveProviders(providers) {\n const normalized = _normalizeProviders(providers, []);\n const resolved = normalized.map(resolveReflectiveProvider);\n const resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}", "title": "" }, { "docid": "4ac44b265e8b63031d10146a2b916586", "score": "0.6202739", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}", "title": "" }, { "docid": "4ac44b265e8b63031d10146a2b916586", "score": "0.6202739", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}", "title": "" }, { "docid": "4ac44b265e8b63031d10146a2b916586", "score": "0.6202739", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}", "title": "" }, { "docid": "4ac44b265e8b63031d10146a2b916586", "score": "0.6202739", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}", "title": "" }, { "docid": "4ac44b265e8b63031d10146a2b916586", "score": "0.6202739", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}", "title": "" }, { "docid": "4ac44b265e8b63031d10146a2b916586", "score": "0.6202739", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}", "title": "" }, { "docid": "3e4f4daaae9c902a3399b3d6c870b9ea", "score": "0.61914736", "text": "function resolveReflectiveProviders(providers) {\n\t var normalized = _normalizeProviders(providers, []);\n\t var resolved = normalized.map(resolveReflectiveProvider);\n\t return collection_1.MapWrapper.values(mergeResolvedReflectiveProviders(resolved, new Map()));\n\t}", "title": "" }, { "docid": "3e4f4daaae9c902a3399b3d6c870b9ea", "score": "0.61914736", "text": "function resolveReflectiveProviders(providers) {\n\t var normalized = _normalizeProviders(providers, []);\n\t var resolved = normalized.map(resolveReflectiveProvider);\n\t return collection_1.MapWrapper.values(mergeResolvedReflectiveProviders(resolved, new Map()));\n\t}", "title": "" }, { "docid": "ac3ba060e4ebdf0e8b5227fe06aa0a61", "score": "0.61431813", "text": "function chain(...providers) {\n return () => {\n let promise = Promise.reject(new ProviderError_1.ProviderError(\"No providers in chain\"));\n for (const provider of providers) {\n promise = promise.catch((err) => {\n if (err === null || err === void 0 ? void 0 : err.tryNextLink) {\n return provider();\n }\n throw err;\n });\n }\n return promise;\n };\n}", "title": "" }, { "docid": "ac3ba060e4ebdf0e8b5227fe06aa0a61", "score": "0.61431813", "text": "function chain(...providers) {\n return () => {\n let promise = Promise.reject(new ProviderError_1.ProviderError(\"No providers in chain\"));\n for (const provider of providers) {\n promise = promise.catch((err) => {\n if (err === null || err === void 0 ? void 0 : err.tryNextLink) {\n return provider();\n }\n throw err;\n });\n }\n return promise;\n };\n}", "title": "" }, { "docid": "5f4cab1ff1a84a70667525104cf68e6c", "score": "0.61320144", "text": "processProvider(provider, ngModuleType, providers) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n }\n else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n }\n else {\n const existing = this.records.get(token);\n if (ngDevMode && existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n this.records.set(token, record);\n }", "title": "" }, { "docid": "2850ae5218085394861be7446b12d5b2", "score": "0.61077523", "text": "provideServices() {\n // Translate service.\n this.channel.provide(\"translate\", (params) => this.translate(params.text, params.position));\n\n // Pronounce service.\n this.channel.provide(\"pronounce\", (params) => {\n let speed = params.speed;\n if (!speed) {\n speed = this.TTS_SPEED;\n this.TTS_SPEED = speed === \"fast\" ? \"slow\" : \"fast\";\n }\n\n return this.pronounce(params.pronouncing, params.text, params.language, speed);\n });\n\n // Get available translators service.\n this.channel.provide(\"get_available_translators\", (params) =>\n Promise.resolve(this.getAvailableTranslators(params))\n );\n\n // Update default translator service.\n this.channel.provide(\"update_default_translator\", (detail) =>\n this.updateDefaultTranslator(detail.translator)\n );\n }", "title": "" }, { "docid": "dedc84b3442f0f44189145acca6a461e", "score": "0.6103166", "text": "async function serializeProviders(providers) {\n const temporaryRepository = container.resolve('temporaryRepository')\n const convertFromProviders = container.resolve('convertFromProviders')\n const formatAuthProviders = container.resolve('formatAuthProviders')\n const writeConfiguration = container.resolve('writeConfiguration')\n const incoming = new Map()\n incoming.set('AUTH_PROVIDERS', providers)\n await writeConfiguration(incoming)\n // save in temporary repository for any queries before restart\n temporaryRepository.set('AUTH_PROVIDERS', providers)\n await convertFromProviders(temporaryRepository, { shadow: true })\n formatAuthProviders(temporaryRepository)\n}", "title": "" }, { "docid": "2ad6e454d21588675d0c149841410677", "score": "0.6080397", "text": "function getAllSubProviders(module, deep) {\n\n // Get all dependencies for the root module.\n var dependencies = getAllDependencies(module, deep);\n\n // Array of provider names.\n var providerNames = [];\n\n // Get all provider from Drupal submodules.\n dependencies.forEach(function (module) {\n providerNames = providerNames.concat(module._invokeQueue\n // Filter non-providers.\n .filter(function(invoke) {\n return invoke[0] == '$provide';\n })\n // Map each provider name.\n .map(function(invoke) {\n return invoke[2][0];\n })\n );\n });\n\n return providerNames;\n }", "title": "" }, { "docid": "357244fe21367ecb3ae7612eb71bfa05", "score": "0.6057244", "text": "function _callForAllProviders(method) {\n Array.prototype.shift.apply(arguments);\n\n var values = [];\n var isPromise = null;\n\n for (var i = 0; i < endpointsProviders.length; i++) {\n if (!angular.isFunction(endpointsProviders[i][method])) {\n throw new Error('callForAllProviders: service provider does not implement method: ' + method);\n }\n var ret = endpointsProviders[i][method].apply(this, arguments);\n if (ret && angular.isFunction(ret.then)) {\n if (isPromise === null) {\n isPromise = true;\n } else if (!isPromise) {\n throw new Error('callForAllProviders: Cannot mix promise and value returning functions');\n }\n values.push(ret);\n } else {\n if (isPromise === null) {\n isPromise = false;\n } else if (isPromise) {\n throw new Error('callForAllProviders: Cannot mix promise and value returning functions');\n }\n values.push(ret);\n }\n }\n return isPromise ? $q.all(values) : $q.resolve(values);\n }", "title": "" }, { "docid": "3d44867d5085cf2171ebfbe2d06d28a5", "score": "0.59663725", "text": "function getReqResProviders(origin, request) {\n var providers = [\n {\n provide: ORIGIN_URL,\n useValue: origin\n },\n {\n provide: REQUEST,\n useValue: request\n }\n ];\n return providers;\n}", "title": "" }, { "docid": "797ce44566c2e953069b6f9bcbe20211", "score": "0.59486204", "text": "function useMergedProviders (_providers, defaults = DEFAULT_PROVIDERS) {\n return useMemo(function () { \n const providers = new Map()\n\n defaults.forEach((provider)=> providers.set(provider.id, provider))\n \n if (_providers) _providers.forEach(function (provider) {\n //// Prevent replacing system providers\n\n const existing = providers.get(provider.id)\n\n if (existing && existing.system) {\n // console.warn('Failed to replace built-in provider', existing.id)\n return\n }\n \n providers.set(provider.id, provider)\n })\n\n return [...providers.values()].sort((a, b)=> a.id > b.id ? 1 : -1)\n }, [_providers, defaults])\n}", "title": "" }, { "docid": "780d1e6d044b1bc165aeb33fee63edc3", "score": "0.592759", "text": "function _getValidKycProviders() {\n _getValidKycProviders = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {\n var _yield$this$get_table, rows;\n\n return runtime_1.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.prev = 0;\n _context2.next = 3;\n return this.get_table_rows({\n code: 'eosio.proton',\n table: 'kycproviders',\n scope: 'eosio.proton'\n });\n\n case 3:\n _yield$this$get_table = _context2.sent;\n rows = _yield$this$get_table.rows;\n this.validKycProviders = rows.map(function (provider) {\n return !provider.blisted && provider.kyc_provider;\n });\n _context2.next = 11;\n break;\n\n case 8:\n _context2.prev = 8;\n _context2.t0 = _context2[\"catch\"](0);\n throw new Error('Unable to get KYC Providers.');\n\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this, [[0, 8]]);\n }));\n return _getValidKycProviders.apply(this, arguments);\n}", "title": "" }, { "docid": "03da1d371c75a8a66aa2717c2e35c6d8", "score": "0.58805573", "text": "_getCustomProvider () {\n return this._customProvider || this._createCustomProvider()\n }", "title": "" }, { "docid": "1d39bf2f99e116dccbc194e148dcafed", "score": "0.58635384", "text": "constructor() {\n\t\tthis._providers = {\n\t\t\tFS: FSStorageProvider,\n\t\t\tCLOUDINARY: CloudinaryStorageProvider,\n\t\t\tGOOGLECLOUD: GoogleCloudStorageProvider,\n\t\t};\n\t}", "title": "" }, { "docid": "9ec3170e7c80d7031af2d547a2a416ba", "score": "0.5821048", "text": "function multiViewProvidersFactoryResolver(_, tData, lView, tNode) {\n var factories = this.multi;\n var result;\n\n if (this.providerFactory) {\n var componentCount = this.providerFactory.componentProviders;\n var multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode); // Copy the section of the array which contains `multi` `providers` from the component\n\n result = multiProviders.slice(0, componentCount); // Insert the `viewProvider` instances.\n\n multiResolve(factories, result); // Copy the section of the array which contains `multi` `providers` from other directives\n\n for (var i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n } else {\n result = []; // Insert the `viewProvider` instances.\n\n multiResolve(factories, result);\n }\n\n return result;\n }", "title": "" }, { "docid": "9ec3170e7c80d7031af2d547a2a416ba", "score": "0.5821048", "text": "function multiViewProvidersFactoryResolver(_, tData, lView, tNode) {\n var factories = this.multi;\n var result;\n\n if (this.providerFactory) {\n var componentCount = this.providerFactory.componentProviders;\n var multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode); // Copy the section of the array which contains `multi` `providers` from the component\n\n result = multiProviders.slice(0, componentCount); // Insert the `viewProvider` instances.\n\n multiResolve(factories, result); // Copy the section of the array which contains `multi` `providers` from other directives\n\n for (var i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n } else {\n result = []; // Insert the `viewProvider` instances.\n\n multiResolve(factories, result);\n }\n\n return result;\n }", "title": "" }, { "docid": "19240526d4b154ccb4aca8cabf9a51af", "score": "0.5809559", "text": "function resolveReflectiveProvider(provider){return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide),[resolveReflectiveFactory(provider)],provider.multi||false);}", "title": "" }, { "docid": "c94dd878be84a9e9baf7edd830eda39a", "score": "0.58070016", "text": "findByProvider(requestData) {\n const STATIC_DATA_ADDRESS = '/static/api/get_list_by_provider.json'\n const API_DATA_ADDRESS = 'webservices.asmx/get_auth_list_using_provider'\n return getJSONData(STATIC_DATA_ADDRESS, API_DATA_ADDRESS, requestData)\n }", "title": "" }, { "docid": "e5a3d491f6105eeae7174456b289af91", "score": "0.5799493", "text": "get provider() {\n\t\treturn this.__provider;\n\t}", "title": "" }, { "docid": "d658835091278e0034bb918a9e1d4c69", "score": "0.57737434", "text": "getProvider(name) {\r\n\t if (this.providers.has(name)) {\r\n\t return this.providers.get(name);\r\n\t }\r\n\t // create a Provider for a service that hasn't registered with Firebase\r\n\t const provider = new Provider(name, this);\r\n\t this.providers.set(name, provider);\r\n\t return provider;\r\n\t }", "title": "" }, { "docid": "376c2d88f2be8c0c9a1e608bbfe7f5da", "score": "0.5764739", "text": "function ProviderData() {}", "title": "" }, { "docid": "f0127bce76d2fb09a03ece111df7bb51", "score": "0.57646996", "text": "function addProvider(p) { this.otherProviders.push(p); }", "title": "" }, { "docid": "785e381c4a609267b698fe453b872e57", "score": "0.5756462", "text": "function ProviderSet() {\n AnyProvider.call(this);\n this.providers = [];\n this.title = 'VJS';\n this.faviconUrl = 'favicon.ico';\n this.body = '<center><img src=\"/spinner-lib/spinner32t.gif\" width=\"32\" height=\"32\" class=\"spinner320x240\"/></center>\\n';\n this.asScriptBody = null;\n this.reloadKey = undefined;\n}", "title": "" }, { "docid": "c091b37a87974a18d638d1915fa1a7ab", "score": "0.5735806", "text": "init() {\n // set provider configs\n this.setProviderType();\n this.setMockData();\n\n /**\n * get the provider instance\n */\n this.provider = ProviderFactory.create({\n type: this.providerType,\n key: this.mockData,\n });\n }", "title": "" }, { "docid": "a8eca99f42e0412e8192ec26e5589797", "score": "0.5721961", "text": "function mergeResolvedReflectiveProviders(providers,normalizedProvidersMap){for(var i=0;i<providers.length;i++){var provider=providers[i];var existing=normalizedProvidersMap.get(provider.key.id);if(existing){if(provider.multiProvider!==existing.multiProvider){throw mixingMultiProvidersWithRegularProvidersError(existing,provider);}if(provider.multiProvider){for(var j=0;j<provider.resolvedFactories.length;j++){existing.resolvedFactories.push(provider.resolvedFactories[j]);}}else{normalizedProvidersMap.set(provider.key.id,provider);}}else{var resolvedProvider=void 0;if(provider.multiProvider){resolvedProvider=new ResolvedReflectiveProvider_(provider.key,provider.resolvedFactories.slice(),provider.multiProvider);}else{resolvedProvider=provider;}normalizedProvidersMap.set(provider.key.id,resolvedProvider);}}return normalizedProvidersMap;}", "title": "" }, { "docid": "196e3a1cf1d1b687c9df3e312959ba0b", "score": "0.57183975", "text": "function fetchProviderResults() {}", "title": "" }, { "docid": "806f5c74213864177e71f5e5efa7657e", "score": "0.57153", "text": "function withProvider(...factories) {\n return Component => props => {\n const injectorRef = useRef(undefined);\n let injector = injectorRef.current;\n if (!injector) {\n injector = injectorRef.current = new Map();\n for (const factory of factories) {\n injector.set(factory, undefined);\n }\n }\n injector._parent = useContext(InjectorContext);\n return createElement(\n InjectorContext.Provider,\n { value: injector },\n createElement(Component, props)\n );\n };\n}", "title": "" }, { "docid": "ebbb6183c5b8490f1dab4f48804a5bde", "score": "0.57118934", "text": "getProviderFor(token) {\n if (this.providers.has(token)) {\n return this.providers.get(token);\n } else {\n const provider = Provider.fromToken(token);\n this.provide(provider);\n\n return provider;\n }\n }", "title": "" }, { "docid": "d1d02a02a62b95a9a793acf05319009c", "score": "0.57112217", "text": "setProviders () {\n this.tileProviders = mapDefinitions.getProviders()\n this.overlayerTileProviders = mapDefinitions.getOverlayerProviders()\n this.wmsOverlayerTileProviders = mapDefinitions.getWmsOverlayerTileProviders()\n \n let hookData = {\n tileProviders: this.tileProviders, \n overlayerTileProviders: this.overlayerTileProviders, \n wmsOverlayerTileProviders: this.wmsOverlayerTileProviders,\n context: this\n }\n this.$root.appHooks.run('layerProvidersLoaded', hookData)\n }", "title": "" }, { "docid": "7b4f79a33e5dd93fc2281cd537ecdd5c", "score": "0.56923205", "text": "function multiViewProvidersFactoryResolver(_, tData, lData, tNode) {\n var factories = this.multi;\n var result;\n if (this.providerFactory) {\n var componentCount = this.providerFactory.componentProviders;\n var multiProviders = getNodeInjectable(tData, lData, this.providerFactory.index, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (var i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n }\n else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}", "title": "" }, { "docid": "caa8711046c0c0b58b0728c394e5357c", "score": "0.56885034", "text": "getDeviders() {\r\n return { node: \"->\", data: \":\" };\r\n }", "title": "" }, { "docid": "756f23c85537e02cef3e25d65f5410dc", "score": "0.5666586", "text": "provider() {\n if (this._provider) return this._provider;\n this.hostedDomain = false; // private-label service\n Object.keys(this.config.providers).forEach( (k,i)=> {\n if (this.config.providers[k].hostMatch !== undefined) {\n if (this.matches(this.config.providers[k].hostMatch)) {\n this._provider = k;\n }\n }\n //else if (this.config.dns !== 'no') {\n // if (this.config.providers[k].exchangerMatch !== undefined) {\n // this.eachMx(mx=>{\n // let h = new Host(mx.exchanger);\n // if (h.matches(this.config.providers[k].exchangerMatch)) {\n // this._provider = k;\n // this.hostedDomain = true;\n // }\n // });\n // }\n // if (this.config.providers[k].cidrMatch !== undefined) {\n // this.eachMx(mx=>{\n // let h = new Host(mx.exchanger);\n // if (h.matches(this.config.providers[k].exchangerMatch)) {\n // this._provider = k;\n // this.hostedDomain = true;\n // }\n // });\n // }\n //}\n });\n\n if (this._provider === undefined) {\n this._provider = this.domainName;\n } else {\n Object.keys(this.config.providers[this._provider]).forEach(k => {\n this.config[k] = this.config.providers[this._provider][k];\n });\n }\n //console.log('Le Provider', this._provider);\n return this._provider;\n }", "title": "" }, { "docid": "49adb1edd0b087d5646f1c68f5d5b09d", "score": "0.5664778", "text": "get allServiceProvider() {\n return `api/v1/service_provider`;\n }", "title": "" }, { "docid": "f71c09f22e2d2f3c9dd98a90d3b2a650", "score": "0.5660872", "text": "getContext() {\n log('getContext()');\n var obj = {\n cloud_alarms:{\n version:\"1.0\"\n }\n };\n var promises = [];\n this.providers.map(p=>{\n var c = p();\n if(!c.then){\n //log('resolve directly value', c);\n obj = Object.assign(obj, c);\n }else{\n promises.push(c);\n }\n });\n if(promises.length == 0){\n return Promise.resolve(obj);\n }\n\n log('to resolve', promises.length, 'async context');\n return new Promise(r=>{\n Promise.all(promises).then(cs=>{\n cs.forEach(c=>{\n //log('resolve', c);\n obj = Object.assign(obj, c);\n });\n r(obj);\n });\n });\n }", "title": "" }, { "docid": "219fcc8a8e6a35f8b36e0c061aa26946", "score": "0.5651316", "text": "function multiViewProvidersFactoryResolver(_, tData, lView, tNode) {\n const factories = this.multi;\n let result;\n if (this.providerFactory) {\n const componentCount = this.providerFactory.componentProviders;\n const multiProviders = getNodeInjectable(lView, lView[TVIEW], this.providerFactory.index, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (let i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n }\n else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}", "title": "" }, { "docid": "2dff7f2cff32a19a4bae4db36c08fa06", "score": "0.5640904", "text": "function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {\n for (var i = 0; i < providers.length; i++) {\n var provider = providers[i];\n var existing = normalizedProvidersMap.get(provider.key.id);\n if (existing) {\n if (provider.multiProvider !== existing.multiProvider) {\n throw new __WEBPACK_IMPORTED_MODULE_4__reflective_errors__[\"a\" /* MixingMultiProvidersWithRegularProvidersError */](existing, provider);\n }\n if (provider.multiProvider) {\n for (var j = 0; j < provider.resolvedFactories.length; j++) {\n existing.resolvedFactories.push(provider.resolvedFactories[j]);\n }\n }\n else {\n normalizedProvidersMap.set(provider.key.id, provider);\n }\n }\n else {\n var resolvedProvider = void 0;\n if (provider.multiProvider) {\n resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n }\n else {\n resolvedProvider = provider;\n }\n normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n }\n }\n return normalizedProvidersMap;\n}", "title": "" }, { "docid": "bd4c147cb091c90009c1ac08dcd751d1", "score": "0.5637331", "text": "function ProviderData() { }", "title": "" }, { "docid": "bd4c147cb091c90009c1ac08dcd751d1", "score": "0.5637331", "text": "function ProviderData() { }", "title": "" }, { "docid": "489763643141236836c9c96b58cac8b5", "score": "0.5580359", "text": "function getProviderAccessTokens() {\n return function(appAndUserData) {\n try {\n var app = appAndUserData[0];\n var user = appAndUserData[1];\n\n // Get required providers from the app info\n var requiredProviders = app.thirdPartyApiRequirements.filter(provider => {\n return provider.required === true;\n });\n\n // Get the connection info (user/connection/connection.model.js) for each required provider\n var userRequiredConnectionsInfo = [];\n requiredProviders.forEach(requiredProvider => {\n var connectionInfo = user.connections.find(connection => {\n return connection.provider === requiredProvider.provider;\n });\n userRequiredConnectionsInfo.push(connectionInfo);\n });\n\n // Return the app info and required connections info\n return {app, user, userRequiredConnectionsInfo};\n } catch(e) {\n return e;\n }\n\n }\n}", "title": "" }, { "docid": "3f7c8e9f4a1e9f4762d7d7bdc0aaaabe", "score": "0.5570548", "text": "getIdentityProviders(): Array<Object> {\n return [\n {\n label: 'Inrupt',\n image: '/assets/img/Inrupt.png',\n value: 'https://inrupt.net/auth',\n description: 'Lorem ipsum dolor sit amet non ipsom dolor'\n },\n {\n label: 'Solid Community',\n image: '/assets/img/Solid.png',\n value: 'https://solid.community',\n description: 'Lorem ipsum dolor sit non consectetur'\n },\n {\n label: 'Other (Enter WebID)',\n image: '/assets/img/Generic.png',\n description: null\n }\n ];\n }", "title": "" }, { "docid": "09a5d55edb031b4aa7b90f93bbff4f67", "score": "0.5561075", "text": "function getProvider(pathname) {\n var items = pathname.split('/');\n var index = items.indexOf('callback');\n if(index > 0) {\n return items[index-1];\n }\n }", "title": "" }, { "docid": "6a7f22a667ca793720a877352084a36b", "score": "0.55505866", "text": "getSupportedLookupsAsSafePromises(url) {\n let p = [];\n adapters.forEach(adapter => {\n if (adapter.ask(url))\n p.push(adapter.lookup(url).catch(error => {\n debug.error({ error });\n return { error };\n }));\n });\n return p;\n }", "title": "" }, { "docid": "f15038c53dc4460f71c23401230a3217", "score": "0.5546457", "text": "function instantiateProvider() {\n\n // Return the public API.\n return({\n dummy: dummy\n });\n\n // ---\n // PUBLIC METHODS.\n // ---\n\n // Return a greeting message for the given name.\n function dummy() {\n return 'Placeholder provider method';\n }\n\n }", "title": "" }, { "docid": "fa4f91eda0e1a2b169476f2bc5fd1f65", "score": "0.55447793", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n }", "title": "" }, { "docid": "fa4f91eda0e1a2b169476f2bc5fd1f65", "score": "0.55447793", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n }", "title": "" }, { "docid": "5dcc3d986fb429421f64ff40ffc86814", "score": "0.553235", "text": "function ProviderData(){}", "title": "" }, { "docid": "3e067579f134849acec67737d613e159", "score": "0.5514785", "text": "overrideProviders(type, providers) {\n throw new Error('overrideProviders is not supported in this implementation of TestComponentBuilder.');\n }", "title": "" }, { "docid": "3c521eea3014701210762cb1f9937523", "score": "0.55099386", "text": "load(container = GlobalProviders_1.GlobalProviders) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n // Clone all providers in the container\n this.addProviders(container);\n // Resolve configuration from providers\n this.resolveConfiguration();\n // build async and sync provider\n let locals = yield this.loadAsync();\n // load sync provider\n locals = this.loadSync(locals);\n yield locals.emit(\"$onInit\");\n return locals;\n });\n }", "title": "" }, { "docid": "cfce971abd1fe664270b522c5d94fd0c", "score": "0.5509312", "text": "function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {\n\t for (var i = 0; i < providers.length; i++) {\n\t var provider = providers[i];\n\t var existing = normalizedProvidersMap.get(provider.key.id);\n\t if (isPresent(existing)) {\n\t if (provider.multiProvider !== existing.multiProvider) {\n\t throw new MixingMultiProvidersWithRegularProvidersError(existing, provider);\n\t }\n\t if (provider.multiProvider) {\n\t for (var j = 0; j < provider.resolvedFactories.length; j++) {\n\t existing.resolvedFactories.push(provider.resolvedFactories[j]);\n\t }\n\t }\n\t else {\n\t normalizedProvidersMap.set(provider.key.id, provider);\n\t }\n\t }\n\t else {\n\t var resolvedProvider;\n\t if (provider.multiProvider) {\n\t resolvedProvider = new ResolvedReflectiveProvider_(provider.key, ListWrapper.clone(provider.resolvedFactories), provider.multiProvider);\n\t }\n\t else {\n\t resolvedProvider = provider;\n\t }\n\t normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n\t }\n\t }\n\t return normalizedProvidersMap;\n\t }", "title": "" }, { "docid": "8c50eb974676fa215184f37d87521310", "score": "0.5482445", "text": "function grabAll(provider){\n\t\n\tvar req = new Request();\n\treq.func= provider.grabAll;\n\treq.args=[req];\n\treq.handler = handlers[provider.name];\n\thandlers[provider.name].pushRequest(req);\n\treturn req;\n}", "title": "" }, { "docid": "98eabfa2f3d2ebe2e6de2068593b6d4a", "score": "0.5463744", "text": "static scanModules(context, provider, modules_list){\n\t\tvar res_list, submodules, submodules_keys, module_name, pos, info;\n\t\treturn (async_ctx_0) => {\n\t\t\tvar async_jump_0 = async_ctx_0.current();\n\t\t\tif (async_jump_0 == \"0\"){\n\t\t\t\tres_list = new Vector();\n\t\t\t\tthis._scanModules(context, provider, modules_list, res_list);\n\t\t\t\t/* Add submodules */\n\t\t\t\tsubmodules = this.getSubmodules(res_list.toCollection());\n\t\t\t\tsubmodules_keys = submodules.keys();\n\t\t\t\tfor (i = 0; i < submodules_keys.count(); i++){\n\t\t\t\t\tmodule_name = submodules_keys.item(i);\n\t\t\t\t\tpos = res_list.find((info, module_name) => {\n\t\t\t\t\t\treturn info.module_name == module_name;\n\t\t\t\t\t}, module_name);\n\t\t\t\t\tif (pos != -1){\n\t\t\t\t\t\tinfo = res_list.item(pos);\n\t\t\t\t\t\tinfo = info.copy( new Map({ \"sub_modules\": submodules.item(module_name) }) );\n\t\t\t\t\t\tres_list.set(pos, info);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*rtl::dump(res_list);*/\n\t\t\t\treturn async_ctx_0.resolve(res_list.toCollection());\n\t\t\t}\n\t\t\telse if (async_jump_0 == \"-1\"){\n\t\t\t\treturn async_ctx_0.error( async_ctx_0.getError() )\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn async_ctx_0.next();\n\t\t\t}\n\t\t\treturn async_ctx_0.end();\n\t\t}\n\t}", "title": "" }, { "docid": "c44deb311f17c0f59b5aac60f4236b5d", "score": "0.54572254", "text": "function _componentProviders(appComponentType) {\n\t return [\n\t di_1.provide(application_tokens_1.APP_COMPONENT, { useValue: appComponentType }),\n\t di_1.provide(application_tokens_1.APP_COMPONENT_REF_PROMISE, {\n\t useFactory: function (dynamicComponentLoader, appRef, injector) {\n\t // Save the ComponentRef for disposal later.\n\t var ref;\n\t // TODO(rado): investigate whether to support providers on root component.\n\t return dynamicComponentLoader.loadAsRoot(appComponentType, null, injector, function () { appRef._unloadComponent(ref); })\n\t .then(function (componentRef) {\n\t ref = componentRef;\n\t if (lang_1.isPresent(componentRef.location.nativeElement)) {\n\t injector.get(testability_1.TestabilityRegistry)\n\t .registerApplication(componentRef.location.nativeElement, injector.get(testability_1.Testability));\n\t }\n\t return componentRef;\n\t });\n\t },\n\t deps: [dynamic_component_loader_1.DynamicComponentLoader, ApplicationRef, di_1.Injector]\n\t }),\n\t di_1.provide(appComponentType, {\n\t useFactory: function (p) { return p.then(function (ref) { return ref.instance; }); },\n\t deps: [application_tokens_1.APP_COMPONENT_REF_PROMISE]\n\t }),\n\t ];\n\t}", "title": "" }, { "docid": "8a7be43e59e9324a43e1b822def799a6", "score": "0.5406562", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider);\n }\n }\n else {\n var lView = getLView();\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var tNode = getPreviousOrParentTNode();\n var beginIndex = tNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = tNode.directiveStart;\n var cptViewProvidersCount = tNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent$$1, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent$$1);\n }\n if (!isViewProvider && isComponent$$1 && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "4d36682e2f8a0167da9760a6a3c2ab8d", "score": "0.5402159", "text": "function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {\n\t for (var i = 0; i < providers.length; i++) {\n\t var provider = providers[i];\n\t var existing = normalizedProvidersMap.get(provider.key.id);\n\t if (lang_1.isPresent(existing)) {\n\t if (provider.multiProvider !== existing.multiProvider) {\n\t throw new reflective_exceptions_1.MixingMultiProvidersWithRegularProvidersError(existing, provider);\n\t }\n\t if (provider.multiProvider) {\n\t for (var j = 0; j < provider.resolvedFactories.length; j++) {\n\t existing.resolvedFactories.push(provider.resolvedFactories[j]);\n\t }\n\t }\n\t else {\n\t normalizedProvidersMap.set(provider.key.id, provider);\n\t }\n\t }\n\t else {\n\t var resolvedProvider;\n\t if (provider.multiProvider) {\n\t resolvedProvider = new ResolvedReflectiveProvider_(provider.key, collection_1.ListWrapper.clone(provider.resolvedFactories), provider.multiProvider);\n\t }\n\t else {\n\t resolvedProvider = provider;\n\t }\n\t normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n\t }\n\t }\n\t return normalizedProvidersMap;\n\t}", "title": "" }, { "docid": "4d36682e2f8a0167da9760a6a3c2ab8d", "score": "0.5402159", "text": "function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {\n\t for (var i = 0; i < providers.length; i++) {\n\t var provider = providers[i];\n\t var existing = normalizedProvidersMap.get(provider.key.id);\n\t if (lang_1.isPresent(existing)) {\n\t if (provider.multiProvider !== existing.multiProvider) {\n\t throw new reflective_exceptions_1.MixingMultiProvidersWithRegularProvidersError(existing, provider);\n\t }\n\t if (provider.multiProvider) {\n\t for (var j = 0; j < provider.resolvedFactories.length; j++) {\n\t existing.resolvedFactories.push(provider.resolvedFactories[j]);\n\t }\n\t }\n\t else {\n\t normalizedProvidersMap.set(provider.key.id, provider);\n\t }\n\t }\n\t else {\n\t var resolvedProvider;\n\t if (provider.multiProvider) {\n\t resolvedProvider = new ResolvedReflectiveProvider_(provider.key, collection_1.ListWrapper.clone(provider.resolvedFactories), provider.multiProvider);\n\t }\n\t else {\n\t resolvedProvider = provider;\n\t }\n\t normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n\t }\n\t }\n\t return normalizedProvidersMap;\n\t}", "title": "" }, { "docid": "87c3844a58ea73f266e77079a6ed7de0", "score": "0.5394413", "text": "function htmlProviders (cb) {\n const logos = fs.readdirSync('./src/img/logos').map((c) => {\n return `img/logos/${c}`;\n });\n\n // HBS templating\n const templateData = {\n Providers: logos\n };\n\n return gulp.src('./src/providers.hbs')\n .pipe(hb({data: templateData, helpers: hbsHelpers, partials: ['./src/partials/*'], handlebars: handlebars}))\n .pipe(rename(`/providers.html`))\n .pipe(gulp.dest('./dist/'));\n}", "title": "" }, { "docid": "62ba9030576c2300c1d28ad7f182326c", "score": "0.53889716", "text": "function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {\n for (var i = 0; i < providers.length; i++) {\n var provider = providers[i];\n var existing = normalizedProvidersMap.get(provider.key.id);\n\n if (existing) {\n if (provider.multiProvider !== existing.multiProvider) {\n throw mixingMultiProvidersWithRegularProvidersError(existing, provider);\n }\n\n if (provider.multiProvider) {\n for (var j = 0; j < provider.resolvedFactories.length; j++) {\n existing.resolvedFactories.push(provider.resolvedFactories[j]);\n }\n } else {\n normalizedProvidersMap.set(provider.key.id, provider);\n }\n } else {\n var resolvedProvider = void 0;\n\n if (provider.multiProvider) {\n resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n } else {\n resolvedProvider = provider;\n }\n\n normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n }\n }\n\n return normalizedProvidersMap;\n }", "title": "" }, { "docid": "62ba9030576c2300c1d28ad7f182326c", "score": "0.53889716", "text": "function mergeResolvedReflectiveProviders(providers, normalizedProvidersMap) {\n for (var i = 0; i < providers.length; i++) {\n var provider = providers[i];\n var existing = normalizedProvidersMap.get(provider.key.id);\n\n if (existing) {\n if (provider.multiProvider !== existing.multiProvider) {\n throw mixingMultiProvidersWithRegularProvidersError(existing, provider);\n }\n\n if (provider.multiProvider) {\n for (var j = 0; j < provider.resolvedFactories.length; j++) {\n existing.resolvedFactories.push(provider.resolvedFactories[j]);\n }\n } else {\n normalizedProvidersMap.set(provider.key.id, provider);\n }\n } else {\n var resolvedProvider = void 0;\n\n if (provider.multiProvider) {\n resolvedProvider = new ResolvedReflectiveProvider_(provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n } else {\n resolvedProvider = provider;\n }\n\n normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n }\n }\n\n return normalizedProvidersMap;\n }", "title": "" }, { "docid": "f12a2b72fa7c081f84b0b1122de92a11", "score": "0.5385323", "text": "function Strategies() {\n\tvar strategies = [];\n\tfor (var strategy in registry.strategies) strategies.push(strategy);\n\treturn strategies;\n}", "title": "" }, { "docid": "70fcc48b354edb6f87bddbca2fba15ac", "score": "0.5374586", "text": "function provider(name, handler, config) {\n\t\t\tvar providers = settings.public('provider');\n\n\t\t\tif (handler) {\n\t\t\t\tproviders[name] = {\n\t\t\t\t\thandler: handler,\n\t\t\t\t\tsettings: config\n\t\t\t\t};\n\n\t\t\t\tsettings.public('provider', providers);\n\t\t\t}\n\n\t\t\tif (!(name in providers)) {\n\t\t\t\treturn errorTrigger('Unknown provider \"%s\"', name);\n\t\t\t}\n\n\t\t\treturn providers[name];\n\t\t}", "title": "" }, { "docid": "253a729b537e7da265fc3efddbad73ba", "score": "0.53637695", "text": "function getEngines() {\n return new Promise((resolve, reject) => {\n chrome.storage.sync.get('engines', result => {\n const { engines } = result\n if (Array.isArray(engines)) {\n resolve(engines)\n } else {\n const temp = [...defaultEngines]\n // 简体中文以外去掉百度与搜狗\n if (chrome.i18n.getUILanguage() !== 'zh-CN') {\n temp.splice(1, 2)\n }\n temp.map(engine => {\n engine.id = shortid.generate()\n engine.isDefault = false\n return engine\n })\n temp[0].isDefault = true\n resolve(temp)\n // save the default engines to chrome storage sync\n chrome.storage.sync.set({ engines: temp })\n }\n })\n })\n}", "title": "" }, { "docid": "c52ac5f3dda6084109619fc8ae82181d", "score": "0.5359321", "text": "get factories() {\n return factories.modules\n }", "title": "" } ]
8271d4c31b87b4a7d79b23c12441c3ac
Changes the given tracks to be muted or not.
[ { "docid": "3b254de93773b6e3631a4b39acd72779", "score": "0.79740477", "text": "changeTrackMute(tracks, mute) {\n if (!this.player) {\n return;\n }\n for (let track of tracks) {\n this.player.setChannelMute(track.playbackInfo.primaryChannel, mute);\n this.player.setChannelMute(track.playbackInfo.secondaryChannel, mute);\n }\n }", "title": "" } ]
[ { "docid": "0a918f54dd7fcdab645d0561e331834c", "score": "0.78106254", "text": "function mute() {\n track.enabled = false;\n }", "title": "" }, { "docid": "2ca4a2371ce08fb1d937b961089dcc53", "score": "0.74899423", "text": "unmute() {\n this.logger.log(`[${this.id}] enabling media tracks...`);\n if (!this.session) {\n this.logger.warn(`[${this.id}] an session is required to enable media tracks`);\n return;\n }\n if (this.session.state !== SessionState$1.Established) {\n this.logger.warn(`[${this.id}] an established session is required to enable media tracks`);\n return;\n }\n this.enableSenderTracks(true);\n }", "title": "" }, { "docid": "4ed0b56fc3d7122afda581382e74f680", "score": "0.74592644", "text": "mute() {\n this.logger.log(`[${this.id}] disabling media tracks...`);\n if (!this.session) {\n this.logger.warn(`[${this.id}] an session is required to disable media tracks`);\n return;\n }\n if (this.session.state !== SessionState$1.Established) {\n this.logger.warn(`[${this.id}] an established session is required to disable media tracks`);\n return;\n }\n this.enableSenderTracks(false);\n }", "title": "" }, { "docid": "d7424bc1817d4e2691889cfdb2df3dd0", "score": "0.7203228", "text": "_onTrackMuteChanged(jitsiTrack) {\n if (jitsiTrack.isLocal()) {\n return;\n }\n const participant = jitsiTrack.getParticipantId();\n const isMuted = jitsiTrack.isMuted();\n\n this.debug(\"Mute changed to\", isMuted, \"for\", jitsiTrack.getType(), \"for participant\", participant);\n\n if (jitsiTrack.getType() === \"video\") {\n this._render();\n }\n }", "title": "" }, { "docid": "fae1031091188cba04010175fe05c171", "score": "0.7132982", "text": "function unmute() {\n track.enabled = true;\n }", "title": "" }, { "docid": "a1786e04499f97bbf6b93a8e3364cad0", "score": "0.69444263", "text": "set muted(value) {\n this.media.muted = value;\n // if(value === true){\n // this.media.muted = true\n // }else{\n // this.media.muted = false\n // }\n }", "title": "" }, { "docid": "fd3772d86a64c9b6856bb576a98ba4fb", "score": "0.689103", "text": "function muteMic() { // stream is your local WebRTC stream\n\t\t\t\tconsole.log(\"mic muted\");\n \t\t\t\t var audioTracks = mystream.getAudioTracks();\n \t\t\t\tfor (var i = 0, l = audioTracks.length; i < l; i++) {\n \t\t\t\t audioTracks[i].enabled = false;//!audioTracks[i].enabled;\n \t\t\t\t }\n\t\t\t}", "title": "" }, { "docid": "ed9a1115965f122e42022f6ae5984d3e", "score": "0.6759427", "text": "isMuted() {\n const track = this.localAudioTrack || this.localVideoTrack;\n if (!track) {\n return false;\n }\n return !track.enabled;\n }", "title": "" }, { "docid": "90e0e29faf26384973ff38ba408db613", "score": "0.67221504", "text": "function mute(){\n localStream.getAudioTracks()[0].enabled = !(localStream.getAudioTracks()[0].enabled);\n console.log('muted');\n $('.btn-secondary span').toggleClass('fa-microphone fa-microphone-slash');\n \n}", "title": "" }, { "docid": "5b441721251a90019c2b59ff79f9341f", "score": "0.6701471", "text": "muteMic() { \n if (this.localStream) {\n this.muted = true\n this.localStream.getAudioTracks()[0].enabled = false\n }\n }", "title": "" }, { "docid": "52010d4e1fc4737887a157a7d41bb3ce", "score": "0.6661112", "text": "changeTrackSolo(tracks, solo) {\n if (!this.player) {\n return;\n }\n for (let track of tracks) {\n this.player.setChannelSolo(track.playbackInfo.primaryChannel, solo);\n this.player.setChannelSolo(track.playbackInfo.secondaryChannel, solo);\n }\n }", "title": "" }, { "docid": "687628de9db8b24062181337d71c2800", "score": "0.66594684", "text": "muteVideo() {\n if (this.localStream) {\n this.videoMuted = true\n this.localStream.getVideoTracks()[0].enabled = false\n }\n }", "title": "" }, { "docid": "2d7a8b56eeaf2f96f080e79c7f23ee73", "score": "0.66049755", "text": "mute() {\n this.media.muted = true;\n }", "title": "" }, { "docid": "6056999d6732bd1a5e39ef266263f13b", "score": "0.6582146", "text": "mute() {\n this.media.muted = true;\n }", "title": "" }, { "docid": "4bcd84e402ea9ffb1526470d4e2bc799", "score": "0.6581856", "text": "function mute(){\n if (video.muted){\n video.muted = false;\n }else {\n video.muted = true;\n }\n}", "title": "" }, { "docid": "ceb7d06217c600c14869c0514d9362f3", "score": "0.6566423", "text": "changeTrackVolume(tracks, volume) {\n if (!this.player) {\n return;\n }\n for (let track of tracks) {\n this.player.setChannelVolume(track.playbackInfo.primaryChannel, volume);\n this.player.setChannelVolume(track.playbackInfo.secondaryChannel, volume);\n }\n }", "title": "" }, { "docid": "bdfc0785d16cebbffe2885162ca2c0da", "score": "0.6545197", "text": "function toggleMute() {\n\t\t\t\tvideo.muted = !video.muted;\n\t\t\t}", "title": "" }, { "docid": "eaf4d1254784c86d03067fad24dc525f", "score": "0.65028906", "text": "function toggleMute() {\n video.muted = !video.muted;\n \n if (video.muted) {\n volume.setAttribute('data-volume', volume.value);\n volume.value = 0;\n } else {\n volume.value = volume.dataset.volume;\n }\n }", "title": "" }, { "docid": "9186a042b0b1efd6eec63d28f31e3cd0", "score": "0.64983946", "text": "function mute(){\n\t var song = document.querySelector('audio');\n\t if(song.muted)\n\t {\n\t song.muted=false;\n\t }\n else\n\t {\n\t\t song.muted = true;\n\n\t\t }\n }", "title": "" }, { "docid": "5b686d559ee600c2a93356c9db7adffb", "score": "0.64672786", "text": "unmute() {\n this.media.muted = false;\n }", "title": "" }, { "docid": "2444430a94d68c45b0f719b9ee713f16", "score": "0.6464941", "text": "unmuteVideo() {\n if (this.localStream) {\n this.videoMuted = false\n this.localStream.getVideoTracks()[0].enabled = true\n }\n }", "title": "" }, { "docid": "24c27687968ceacad916e335f7810f5c", "score": "0.64482415", "text": "unmuteMic() {\n if (this.localStream) {\n this.muted = false\n this.localStream.getAudioTracks()[0].enabled = true\n }\n }", "title": "" }, { "docid": "8de8d0da736b845cc59e4ddcfa557c6f", "score": "0.6436094", "text": "function muteSong() {\r\n if (mute == false) {\r\n soundIcon.classList.remove(\"fa-volume-up\");\r\n soundIcon.classList.add(\"fa-volume-mute\");\r\n track.volume = 0;\r\n mute = true;\r\n }\r\n else {\r\n soundIcon.classList.remove(\"fa-volume-mute\");\r\n soundIcon.classList.add(\"fa-volume-up\");\r\n track.volume = 1;\r\n mute = false;\r\n }\r\n}", "title": "" }, { "docid": "19a692d3761df11ef87e1cfa1b3f9a2b", "score": "0.64287007", "text": "function mute(music) {\n if (sound === true) {\n sound = false;\n music.volume = 0;\n\n\n } else {\n sound = true;\n\n }\n playSound(music);\n}", "title": "" }, { "docid": "f078becb8b371aa90ba02209fd137218", "score": "0.6418334", "text": "setTracks(state, tracks) {\n state.tracks = tracks.map(track => {\n Vue.set(track, 'isLiked', false);\n return track;\n });\n }", "title": "" }, { "docid": "0cda3fa06756dbf88786bc17744de8a5", "score": "0.63928056", "text": "function audioMute() {\n if (soundMute === false) {\n soundMute = true;\n lastVolume = volumeSlider.value;\n volumeSlider.value = 0;\n } else if (soundMute === true) {\n soundMute = false;\n volumeSlider.value = lastVolume;\n }\n}", "title": "" }, { "docid": "05041b157eaa180b68c92b8f254871de", "score": "0.6390748", "text": "function toggleMuteOthers() {\n participants.forEach(function(p) {\n p.videoTag.muted = !p.videoTag.muted;\n });\n areSpeakersMuted = participants[0].videoTag.muted || false;\n document.getElementById('voiceChat-MuteOthersBtn').textContent = areSpeakersMuted ? 'Unmute' : 'Mute';\n sendMyUserInfoUpdate();\n }", "title": "" }, { "docid": "104e9165d0c0e19317c472baa2232546", "score": "0.6359041", "text": "function setMuteStop() {\r\n setMuteOn = false;\r\n }", "title": "" }, { "docid": "0ecb08a85493a1a1f5340f40f2e9e7f2", "score": "0.63546956", "text": "mute() {\r\n this.setMuted(true);\r\n }", "title": "" }, { "docid": "df80d17206283762f6f9c223fedb81fb", "score": "0.63505", "text": "function muteUnmute() {\n if (userStream.getAudioTracks()[0].enabled) {\n userStream.getAudioTracks()[0].enabled = false;\n micButton.style.backgroundImage = 'url(\"/images/mic_off.png\")';\n } else {\n userStream.getAudioTracks()[0].enabled = true;\n micButton.style.backgroundImage = 'url(\"/images/mic.png\")';\n }\n}", "title": "" }, { "docid": "99b4a90f8f5af8b66fa37b0e02f6caaa", "score": "0.63454086", "text": "methodMute () {\n\t\tthis.player.muted = true\n\t\tthis.player.setAttribute('muted', '')\n\t}", "title": "" }, { "docid": "de92f6db8558f22151a6c8cfdbdd9101", "score": "0.63261354", "text": "function muteWebCam() {\n if (localStream.getAudioTracks()[0].enabled) {\n localStream.getAudioTracks()[0].enabled = false;\n // $('#mute').val('Unmute');\n $('.wrtc-button-mute').html('<i class=\"fa fa-microphone-slash fa-2x\"></i>');\n }\n else {\n localStream.getAudioTracks()[0].enabled = true;\n // $('#mute').val('Mute');\n $('.wrtc-button-mute').html('<i class=\"fa fa-microphone fa-2x\"></i>');\n }\n }", "title": "" }, { "docid": "b40d3cc06b2efe60e9f62a030c11a5f7", "score": "0.63225263", "text": "muteVideo() {\n if (!this.state.pc || !this.state.dataChannel) {\n return;\n }\n\n const stream = this.state.localStream;\n const t = stream.getVideoTracks()[0];\n t.enabled = false;\n t.stop();\n\n stream.removeTrack(t);\n this.state.dataChannel.send(VIDEO_MUTED_EVENT);\n this.setState({videoToggleInProgress: false});\n }", "title": "" }, { "docid": "4ea1c38bd6d1c2a0b5f7888bade4c5c8", "score": "0.6295713", "text": "function mutedControl(){\n video.muted = !video.muted;\n updateVolBtn();\n}", "title": "" }, { "docid": "22187a2b6f3570c8adba546389a430e7", "score": "0.628589", "text": "function muteUnmute(){\n if(music.volume > 0){\n currentVolume = music.volume;\n music.volume = 0;\n updateVolumeBar();\n } else {\n music.volume = currentVolume;\n updateVolumeBar();\n }\n}", "title": "" }, { "docid": "f8d2c8d2d93f5ed81c1c7e3e2f269aab", "score": "0.62779313", "text": "toggleMuted() {\r\n this.setMuted(!this._muted);\r\n }", "title": "" }, { "docid": "c246c3aa18ab89e5e08f443e13678239", "score": "0.62755233", "text": "function toggleMute(){\n if(is_muted){\n unmute();\n }else{\n mute();\n }\n}", "title": "" }, { "docid": "4f2a740cd0174d259c6f52b631af218b", "score": "0.6255784", "text": "static muteAllRemoteAudioStreams(muted) {\n Agora.muteAllRemoteAudioStreams(muted);\n }", "title": "" }, { "docid": "c9fbdcc6629554c03e18e34435c78f02", "score": "0.62501407", "text": "function myAudio(){\n const enabled = myVideoStream.getAudioTracks()[0].enabled;\n if (enabled) { // if I am already unmuted\n myVideoStream.getAudioTracks()[0].enabled = false;\n unmuteMe();\n } else {\n muteMe();\n myVideoStream.getAudioTracks()[0].enabled = true;\n }\n}", "title": "" }, { "docid": "2bc4f23111f5b53782a34f3f487d2b1d", "score": "0.6221929", "text": "function turnOffMusic() {\n\tif (document.getElementById(\"musicToggle\").checked) {\n\t\tmusic.muted = true;\n\t\tbackgroundMusic.muted = true;\n\t}\n\tif (!(document.getElementById(\"musicToggle\").checked)) {\n\t\tmusic.muted = false;\n\t\tbackgroundMusic.muted = false;\n\n\t}\n}", "title": "" }, { "docid": "ce5497e7062991af6155efcce2c9ad43", "score": "0.62182665", "text": "unmute() {\r\n this.setMuted(false);\r\n }", "title": "" }, { "docid": "641b68f830696d7ca8157dfd9ac7d609", "score": "0.62064093", "text": "mute() {\n this._muted = true;\n }", "title": "" }, { "docid": "dc005425b57a827dfb1cdf3c0edde320", "score": "0.62014914", "text": "function toggleMute() {\n if (videoPlayer.muted) {\n // Change the cutton to be a mute button\n changeButtonIcon(muteIcon, 'glyphicon-headphones', 'glyphicon-volume-off');\n // Unmute the media player\n videoPlayer.muted = false;\n } else {\n // Change the button to be an unmute button\n changeButtonIcon(muteIcon, 'glyphicon-volume-off', 'glyphicon-headphones');\n // Mute the media player\n videoPlayer.muted = true;\n }\n}", "title": "" }, { "docid": "127afe6b5ca05a349378b7f447a43d56", "score": "0.6201106", "text": "function toggleMute() {\r\n var myVideo = document.getElementById(\"myVideo\");\r\n var mute = document.getElementById(\"mute\");\r\n if (myVideo.muted) {\r\n mute.innerHTML = \"Mute\";\r\n myVideo.muted = false;\r\n } else {\r\n mute.innerHTML = \"Unmute\";\r\n myVideo.muted = true;\r\n }\r\n}", "title": "" }, { "docid": "d3277291a286472e8d3b31ba973329a9", "score": "0.61996645", "text": "function toggleMuteAudio(){ \n $(\"audio\").prop(\"muted\",!$(\"audio\").prop(\"muted\")); //prop is for property\n}", "title": "" }, { "docid": "da73e5e681578f728e8bbb50eb6f3427", "score": "0.61897403", "text": "function mute() {\n sendCmd(\"mute\");\n }", "title": "" }, { "docid": "cb3750a2191ee5bc9ab7cff154935e7a", "score": "0.6166831", "text": "toggleVolume() {\n if (this.isMuted) {\n this.unmute();\n } else {\n this.mute();\n }\n }", "title": "" }, { "docid": "2811e32d2668648fe28e5b7c28f3ec04", "score": "0.6160316", "text": "mute () {\n\t\tthis.methodMute()\n\t\tthis.wrapperPlayer.querySelector('.v-volume').classList.add('v-muted')\n\t}", "title": "" }, { "docid": "51164f2612e4f34d934c8d4123b6335d", "score": "0.6145794", "text": "function toggleMuteAudio(){\n $(\"#mainTheme\").prop(\"muted\",!$(\"#mainTheme\").prop(\"muted\"));\n}", "title": "" }, { "docid": "b4a1becf999c10277eec283a127c9b28", "score": "0.6143616", "text": "static muteRemoteAudioStream(uid, muted) {\n Agora.muteRemoteAudioStream(uid, muted);\n }", "title": "" }, { "docid": "4df1186c1f65bea67ebb205fac71dc5b", "score": "0.6127808", "text": "setTracksToPlay(tracks) {\n this.store.dispatch(loadMediaFiles(tracks, LOAD_STYLE.PLAY));\n }", "title": "" }, { "docid": "49460a42b5626a3aa9589fabd918556f", "score": "0.6117368", "text": "function toggleMute() {\n\tif (videoScreen.muted) {\n\t\t// Change the cutton to be a mute button\n\t\tchangeButtonType(muteBtn, 'mute');\n\t\t// Unmute the media player\n\t\tvideoScreen.muted = false;\n\t\tvideoWebcam.muted = false;\n\t}\n\telse {\n\t\t// Change the button to be an unmute button\n\t\tchangeButtonType(muteBtn, 'unmute');\n\t\t// Mute the media player\n\t\tvideoScreen.muted = true;\n\t\tvideoWebcam.muted = true;\n\t}\n}", "title": "" }, { "docid": "34317466ba4b5c1eb2b3a1a4a2925b0e", "score": "0.6112385", "text": "mute () {\n this._muted = true;\n }", "title": "" }, { "docid": "f9da2e7e10bb4b7bb9db4f347a60ac01", "score": "0.6111311", "text": "function muteUnmuted(){\t\t\t\n\t\t\tif(audioPlayer.muted){\n\t\t\t\taudioPlayer.muted=false;\n\t\t\t\t$(\"#sound_button #button #reverseIcon\").css({\"display\":\"none\"});\n\t\t\t\t$(\"#sound_button #button #icon\").css({\"display\":\"block\"});\n\t\t\t\t$(\"#soundBar #slideBar\").slider(\"enable\")\n\t\t\t\t.animate({\"opacity\":1},500);\n\t\t\t}else{\n\t\t\t\taudioPlayer.muted=true;\n\t\t\t\t$(\"#sound_button #button #reverseIcon\").css({\"display\":\"block\"});\n\t\t\t\t$(\"#sound_button #button #icon\").css({\"display\":\"none\"});\t\n\t\t\t\t$(\"#soundBar #slideBar\").slider(\"disable\")\t\n\t\t\t\t.animate({\"opacity\":0.5},500);\t\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4d92679a0e6d4919725a6196decae657", "score": "0.60984755", "text": "function vidMute() {\n\tif (video.muted) {\n\t\tvolumeRange.value = lastVal;\n\t\tvideo.muted = false;\n\t\tmuteBtn.classList.remove('glyphicon-volume-off');\n\t\tmuteBtn.classList.add('glyphicon-volume-up');\n\t\tvolumeRange.value = volumeRange.value / 100;\n\t\tvolumeRange.value = lastVal;\n\t} else {\n\t\tvideo.muted = true;\n\t\tvolumeRange.value = 0;\n\t\tmuteBtn.classList.remove('glyphicon-volume-up');\n\t\tmuteBtn.classList.add('glyphicon-volume-off');\n\t}\n}", "title": "" }, { "docid": "c99196e85a2f5933b27cb18b275d7563", "score": "0.60982877", "text": "function onChangeTrackHandler(track) {\n const participant = track.getParticipantId();\n console.log(\"onChangeTrackHandler: \", track.getType(), \": \", track.isMuted(), participant)\n\n if (track.getType() === \"video\") {\n if (track.isMuted()) {\n $(`#user-meeting-box-${participant}`).addClass(\"video-off\")\n } else {\n $(`#user-meeting-box-${participant}`).removeClass(\"video-off\")\n }\n } else {\n if (track.isMuted()) {\n $(`#user-meeting-data-${participant}`).length === 0 && seachAndMuteAudio(`user-meeting-data-${participant}`);\n $(`#user-meeting-data-${participant}`).addClass(\"audio-off\");\n } else {\n $(`#user-meeting-data-${participant}`).removeClass(\"audio-off\")\n }\n }\n }", "title": "" }, { "docid": "0f6cb156d42e5bf4bb68bef4d2fce579", "score": "0.6089477", "text": "function toggleMute() {\n \n const volume = document.getElementById('volume');\n const video = document.getElementById('video');\n video.muted = !video.muted;\n if (video.muted) {\n volume.setAttribute('data-volume', volume.value);\n volume.value = 0;\n } else {\n volume.value = volume.dataset.volume;\n }\n}", "title": "" }, { "docid": "32af0aa4b4135b6ab507b416698861c3", "score": "0.6087279", "text": "get muted() {\n // aca me devuelve el estado del video con su propiedad original muted si esta en muteado o no true o false\n return this.media.muted;\n }", "title": "" }, { "docid": "3782024f6172ad629d18191ac2c992c7", "score": "0.60821295", "text": "setTracksToPlay(tracks) {\n this.store.dispatch(files_loadMediaFiles(tracks, LOAD_STYLE.PLAY));\n }", "title": "" }, { "docid": "abfe782d35836fe7f3a7fecc648e629e", "score": "0.6080192", "text": "function setMute() {\n if($('#muteButton').hasClass('btn-info')) {\n\t\t$('#muteButton').removeClass('btn-info').addClass('btn-danger');\n\t\t$('#mute').removeClass('icon-volume-up').addClass('icon-volume-off');\n\t\t//vwfMedia.setMute( true );\n \n vwf_view.kernel.callMethod( vwf_view.kernel.application(), \"setLocalMute\", { \"moniker\": vwf_view.kernel.moniker() , \"value\": true } );\n }\n else {\n\t\t$('#muteButton').removeClass('btn-danger').addClass('btn-info');\n\t\t$('#mute').removeClass('icon-volume-off').addClass('icon-volume-up');\n\t\t//vwfMedia.setMute( false );\n\n vwf_view.kernel.callMethod( vwf_view.kernel.application(), \"setLocalMute\", { \"moniker\": vwf_view.kernel.moniker() , \"value\": false } );\n }\n}", "title": "" }, { "docid": "5208f6bcf44cb78318407186043150d3", "score": "0.60535073", "text": "function processMute (data) {\n controls.setMute(data)\n}", "title": "" }, { "docid": "cf831abfe3332371516fe6119c0a7fbb", "score": "0.6034529", "text": "mute() {\n const story = this.stories_[this.currentIdx_];\n this.updateMutedState_(story, true);\n }", "title": "" }, { "docid": "52357bfcc6fa8daa92b91cb388abd359", "score": "0.6032099", "text": "function toggleMute(con){\n\tcreatejs.Sound.setMute(con);\t\n}", "title": "" }, { "docid": "52357bfcc6fa8daa92b91cb388abd359", "score": "0.6032099", "text": "function toggleMute(con){\n\tcreatejs.Sound.setMute(con);\t\n}", "title": "" }, { "docid": "da0ec03934f6b485460607acb89628c0", "score": "0.6029523", "text": "static disableLocalAudio(muted) {\n Agora.disableLocalAudio(muted);\n }", "title": "" }, { "docid": "93b2763254ba1c2b696e62e1194a94b1", "score": "0.60265046", "text": "onPlayerMute (event) {\n let muted = event.data\n this.$ctx.attr('data-video-muted', muted)\n this.$ctx.parent().parent('.VideoMain').attr('data-video-muted', muted)\n }", "title": "" }, { "docid": "eafa05acf1af5b137bd04a197f471b35", "score": "0.6012393", "text": "pauseAudio(){\n\t\tthis.localStream.getAudioTracks()[0].enabled = false;\n\t}", "title": "" }, { "docid": "222adbea14746fa8309bb8638ba75085", "score": "0.5985036", "text": "function muteRemote() {\n var inverse = remoteVid.muted ? false : true\n remoteVid.muted = inverse;\n if (inverse) {\n remotemutebtn.className = \"btn btn-primary float-left w-100\"\n remotemutebtn.innerHTML = \"Unmute\"\n }\n else {\n remotemutebtn.className = \"btn float-left w-100 btn-outline-primary\"\n remotemutebtn.innerHTML = \"Mute\"\n }\n}", "title": "" }, { "docid": "9bb9e98f0491b7a7af8bf190a63c3053", "score": "0.59783155", "text": "function musicController() {\n if (audio.isMusicMuted === true) {\n audio.isMusicMuted = false;\n audio.musicBtn.innerHTML = \"On\";\n playMusic();\n } else if (audio.isMusicMuted === false) {\n audio.isMusicMuted = true;\n audio.musicBtn.innerHTML = \"Off\";\n stopMusic();\n }\n}", "title": "" }, { "docid": "402760bbaffa62334848bdaf8c06955b", "score": "0.5969811", "text": "function muteMe(elem) {\n elem.muted = true;\n elem.pause();\n}", "title": "" }, { "docid": "67b303232ff60848ef53c57b7609bbb8", "score": "0.59550935", "text": "unmute() {\n this._muted = false;\n }", "title": "" }, { "docid": "48b735b351c4815e90725466294b877c", "score": "0.594729", "text": "onAudioMute (id, isMuted) {\n if (APP.conference.isLocalId(id)) {\n localVideoThumbnail.showAudioIndicator(isMuted);\n } else {\n let remoteVideo = remoteVideos[id];\n if (!remoteVideo)\n return;\n\n remoteVideo.showAudioIndicator(isMuted);\n if (APP.conference.isModerator) {\n remoteVideo.updateRemoteVideoMenu(isMuted);\n }\n }\n }", "title": "" }, { "docid": "0a5a9bed4c780dff0615fb06377de793", "score": "0.5935665", "text": "function muteMe(elem) {\n elem.muted = true;\n }", "title": "" }, { "docid": "d4047e903b8439ab172a1d129addb0a3", "score": "0.5931225", "text": "function startAll() {\n track1.play();\n track2.play();\n track3.play();\n track1.volume = 0.35;\n track2.volume = 0.35;\n track3.volume = 0.35;\n if(!track1.muted && !track2.muted && !track3.muted) {\n track1.volume = 1;\n track2.volume = 1;\n track3.volume = 1;\n }\n}", "title": "" }, { "docid": "ef5f88ecc73d94d44660ae2a47533b20", "score": "0.59117293", "text": "function toggleMute() {\n mute = !mute;\n if (mute) {\n $(\"#mute\").html(\"Unmute\");\n } else {\n $(\"#mute\").html(\"Mute\");\n }\n}", "title": "" }, { "docid": "1c79afaa7dd1f004788b43b681bc7154", "score": "0.5911083", "text": "static muteLocalVideoStream(muted) {\n Agora.muteLocalVideoStream(muted);\n }", "title": "" }, { "docid": "6a240d04905b1a7f80df8b0a9f346725", "score": "0.59078026", "text": "_onVolumeClick() {\n const {\n muteVideoRequest,\n userDid,\n muteNowPlaying,\n mutePreview,\n } = this.props;\n muteVideoRequest({\n muteNowPlaying: userDid && muteNowPlaying ? muteNowPlaying : mutePreview,\n mutePreview: !mutePreview,\n userDid: !!(userDid && muteNowPlaying),\n });\n }", "title": "" }, { "docid": "24c581c0d5abb2f7ec2b58876f9962e2", "score": "0.5907346", "text": "function unMute() { \n if (cpCmndMute == true) { \n cpCmndMute = false; \n }\n }", "title": "" }, { "docid": "5470e727e736d4317c18580fd0a286d6", "score": "0.5897757", "text": "unmute () {\n this._muted = false;\n }", "title": "" }, { "docid": "58d62ab5dbee076aa5465e5137c86365", "score": "0.5891545", "text": "function toggleAudio () {\n if (!mystream) { return }\n for (const track of mystream.getAudioTracks()) {\n track.enabled = !track.enabled\n }\n }", "title": "" }, { "docid": "cab012e360d7668c7236c39a9cb21463", "score": "0.58804655", "text": "function muteLocalAudio() {\n logger(\"Local Function: <b style='color:darkBlue'>muteLocalAudio()</b>\");\n if ($(\"#btn_mute_local_audio\").html() == \"Mute Audio\") {\n logger(\"Agora Function: <b style='color:indigo'>local_stream.disableAudio()</b>\");\n local_stream.disableAudio();\n } else {\n logger(\"Agora Function: <b style='color:indigo'>local_stream.enableAudio()</b>\");\n local_stream.enableAudio();\n }\n }", "title": "" }, { "docid": "87636e942e654c4349623974f2bac332", "score": "0.58763975", "text": "function muteSound(){\n if (muted) {\n muted = false;\n document.getElementById(\"mute\").innerHTML = \"Mute Sound\";\n } else {\n muted = true;\n document.getElementById(\"mute\").innerHTML = \"Unmute Sound\";\n }\n}", "title": "" }, { "docid": "d55f46d09cb45974779eb9d9a414e425", "score": "0.5876187", "text": "setMuted(isMute) {\r\n if (isMute)\r\n this.audio.volume = 0;\r\n else\r\n this.audio.volume = this._volume;\r\n this._muted = isMute;\r\n this.emit(PlayerEvent.VolumeChange, this.audio.volume);\r\n }", "title": "" }, { "docid": "6a99a5826343dbfe53776dabd188ac71", "score": "0.5871697", "text": "function muteVideo() {\n\tvideo.muted = !video.muted;\n\tif (video.muted) {\n\t\t$('#volumeOn').css('display', 'none');\n\t\t$('#volumeOff').css('display', 'inline-block');\n\t}\n\telse {\n\t\t$('#volumeOff').css('display', 'none');\n\t\t$('#volumeOn').css('display', 'inline-block');\n\t}\n}", "title": "" }, { "docid": "e412a68d636768e2944b2709a3a989ce", "score": "0.58688927", "text": "function vidmute() {\n if (vid.muted) {\n vid.muted = false;\n muteBtn.innerHTML = \"<i class='fa fa-volume-up'></i>\";\n } else {\n vid.muted = true;\n muteBtn.innerHTML = \"<i class='fa fa-volume-off'></i>\";\n }\n}", "title": "" }, { "docid": "fe11de1d07f0a78ddabef11416e16855", "score": "0.58492684", "text": "static muteAllRemoteVideoStreams(muted) {\n Agora.muteAllRemoteVideoStreams(muted);\n }", "title": "" }, { "docid": "97d7866ef93edb7f3aa059e2ca342c51", "score": "0.58297086", "text": "methodUnMute () {\n\t\tthis.player.muted = false\n\t\tthis.player.removeAttribute('muted')\n\t}", "title": "" }, { "docid": "4ac577e719a3de89b232b08cf0857aee", "score": "0.58184505", "text": "function UnMuteThisVideo(){\n\t\tytp.unMute();\n\t\tTweenLite.set('#muteOff', {alpha: 1, y: 0});\n\t\tTweenLite.set('#muteOn', {alpha: 0, y: -40});\n\t\tEnabler.counter('YTVideo UnMute');\n}", "title": "" }, { "docid": "a8729e2df9e2b41439c4359fec73c7d3", "score": "0.58140355", "text": "function muteAudio() {\n let player = document.getElementById('animationAudio')\n let muteButtonText = document.getElementById('muteButton')\n console.log(player.muted)\n if (player.muted === false) {\n muteButtonText.innerHTML = \"Unmute audio\"\n return player.muted = true\n } else if (player.muted === true) {\n muteButtonText.innerHTML = \"Mute audio\"\n return player.muted = false\n }\n }", "title": "" }, { "docid": "398facd4062c77f63520e6b5920cdbb6", "score": "0.5792029", "text": "function toggleVideo () {\n if (!mystream) { return }\n for (const track of mystream.getVideoTracks()) {\n track.enabled = !track.enabled\n }\n }", "title": "" }, { "docid": "c1b81f3800b775a8a40d03d42ad0be94", "score": "0.5789757", "text": "function muteSound() {\n if (audio.paused) {\n audio.play();\n $(\".audio\").attr(\"src\", \"./img/music on.svg\");\n } else {\n audio.pause();\n $(\".audio\").attr(\"src\", \"./img/music off.svg\");\n }\n }", "title": "" }, { "docid": "76cfa9383fe35f83435d74f6dbe56577", "score": "0.5787888", "text": "toggleVolume() {\n this.volumeOn = !this.volumeOn;\n this.setProgress(this.getProgressPlayed());\n if (this.isPlaying()) {\n this.play();\n }\n }", "title": "" }, { "docid": "40cf8a062a6ecac439a22b4ab2d74283", "score": "0.5785686", "text": "muteAllRemoteAudioStreams(muted) {\n return RtcEngine._callMethod('muteAllRemoteAudioStreams', {\n muted\n });\n }", "title": "" }, { "docid": "40e2f5ff0bc903bae0891e4d88cb869f", "score": "0.5784966", "text": "function toggleMuteSound(elem) {\n\tif(elem.muted == false) {\n\t\telem.muted = true;\n\t\telem.pause();\n\t} else {\n\t\telem.muted = false;\n\t\tif(elem.loop) {\n\t\t\telem.play();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fead27db4149a853c626d8b6da69c94a", "score": "0.5773987", "text": "unMute () {\n\t\tthis.methodUnMute()\n\t\tthis.wrapperPlayer.querySelector('.v-volume').classList.remove('v-muted')\n\t}", "title": "" }, { "docid": "17de0505e81f8f612a4a84e675b732b5", "score": "0.57689023", "text": "function mute(call, isMute) {\r\n if (!call){\r\n console.error(\"Cannot mute for undefined call!\");\r\n return;\r\n }\r\n var peerconnection = call.getPeerConnection();\r\n if (peerconnection == null) {\r\n console.error(\"can not get the audio track. failed to mute audio!\");\r\n return;\r\n }\r\n peerconnection.getLocalStreams().map(function(stream) {\r\n stream.getAudioTracks().map(function(audioTrack) {\r\n audioTrack.enabled = !isMute;\r\n });\r\n });\r\n muteButton(call, !isMute);\r\n }", "title": "" }, { "docid": "e6ecb732b98a4c9c6f2aa1686bbed7e3", "score": "0.57573575", "text": "function mute_mic() {\n\t\t\t//Mute own Microphone\n if (connection && connection.attachStreams) {\n try {\n document.getElementById('mute-switch').checked = 0;\n connection.attachStreams.forEach(function(stream) {\n stream.mute();\n });\n } catch (e) {}\n }\n }", "title": "" }, { "docid": "c100bfa051fe1849c9bee0c733f4980b", "score": "0.57439715", "text": "_muteAll() {\n this.debug(\"Muting all users\");\n\n const muted = this.settings.get(\"client\", \"muteAll\");\n\n this.getConnectedUsers().forEach((userId) => {\n if (userId !== game.user.id) {\n const audioElement = this._getUserAudioElement(userId);\n if (audioElement) {\n audioElement.muted = muted;\n }\n }\n });\n }", "title": "" }, { "docid": "2f17191f5a1b70e6104994ca0ba6786e", "score": "0.5739474", "text": "function toggleMute( e ) {\n const audio = document.getElementById( 'bgMusic' );\n\n muted = !muted;\n\n $( '#mute-button' ).attr( 'src', 'img/sound-' + ( muted ? 'off' : 'on' ) + '.png' );\n if( muted ) {\n localStorage.setItem( 'muted', 'true' );\n }\n else {\n localStorage.removeItem( 'muted' );\n }\n\n audio.muted = muted;\n\n if( e ) {\n e.preventDefault();\n e.stopPropagation();\n }\n }", "title": "" }, { "docid": "7b62702b76d2b70473b2256890f9ceed", "score": "0.5733371", "text": "function toggleMute() {\n\n const audio = document.querySelector(\"audio\")\n\n if(localStorage.getItem('muted') == 'true') {\n localStorage.setItem('muted', 'false');\n document.getElementById('mute_img').src = 'images/volume_on.svg';\n\n audio.volume = 0.2;\n audio.play();\n } else {\n localStorage.setItem('muted', 'true');\n document.getElementById('mute_img').src = 'images/volume_off.svg'; \n\n audio.pause();\n } \n}", "title": "" } ]
c1f07eb348558df982854c1a43296100
exported _fn /eslint prefertemplate:0, strict: 0 /global ko, moment, _
[ { "docid": "7d86de2112122862e513619052ba8ef2", "score": "0.0", "text": "function _fn( Y, NAME ) {\n 'use strict';\n\n var\n hasFeature = Y.doccirrus.schemas.invoicelog.hasFeature,\n SEE_CONTENT_FEATURE = Y.doccirrus.schemas.invoicelog.FEATURES.SEE_CONTENT,\n\n i18n = Y.doccirrus.i18n,\n IS_CONTENT_OUTDATED = i18n( 'invoicelog-schema.InvoiceLog_T.isContentOutdated.i18n' ),\n SLD = i18n( 'InvoiceMojit.gkv_browserJS.label.SLD' ),\n STATUS = i18n( 'InvoiceMojit.gkv_browserJS.label.STATUS' ),\n USER = i18n( 'InvoiceMojit.gkv_browserJS.label.USER' ),\n LAST_UPDATE = i18n( 'InvoiceMojit.gkv_browserJS.label.LAST_UPDATE' ),\n LOCATION_NAME = i18n( 'InvoiceMojit.gkv_browserJS.label.LOCATION_NAME' ),\n CREATED_AT = i18n( 'InvoiceMojit.gkv_browserJS.label.CREATED_AT' ),\n PRICE_TOTAL = i18n( 'InvoiceMojit.gkv_browserJS.label.PRICE_TOTAL' ),\n FILES = i18n( 'InvoiceMojit.gkv_browserJS.label.FILES' ),\n DELIVERY = i18n( 'InvoiceMojit.gkv_browserJS.label.DELIVERY' ),\n DELIVERY_SETTING_MISSING = i18n( 'InvoiceMojit.gkv_browserJS.tooltip.DELIVERY_SETTING_MISSING' ),\n KoUI = Y.doccirrus.KoUI,\n KoComponentManager = KoUI.KoComponentManager,\n progressMap = {\n collect: 'sammle Daten',\n sending: 'sende Daten',\n generatingPadx: 'generiere Datei'\n },\n selectedRows,\n START_DATE = i18n( 'InvoiceMojit.cashbookJS.messages.FROM' ),\n END_DATE = i18n( 'InvoiceMojit.cashbookJS.messages.TO' ),\n COLLECT_MEDIDATA_REJECTED = i18n( 'tarmedlog-schema.TarmedLog_T.collectMedidataRejected.i18n' ),\n TIMESTAMP_FORMAT = i18n( 'general.TIMESTAMP_FORMAT' );\n\n // ============================================================================================================== \\\\\n // =============================================== PROGRESS BAR ================================================= \\\\\n function updateProgressbar( pvslogId, progress ) {\n var id = getProgressbarElementId( pvslogId );\n var text = getProgressText( progress.type );\n var progressElement = document.getElementById( id );\n var progressTimeElement = document.getElementById( id + '-time' );\n\n if( progressElement ) {\n progressElement.style.width = Math.round( progress.current / progress.total * 100 ) + '%';\n if( text ) {\n progressElement.innerHTML = '&nbsp;' + text;\n }\n }\n if( progressTimeElement ) {\n progressTimeElement.innerHTML = '&nbsp;' + showTime( progress.durationElapsed );\n }\n }\n\n function getProgressbarElementId( tarmedlog ) {\n return 'progressbar-' + tarmedlog;\n }\n\n function getProgressbar( tarmedlogId ) {\n var id = getProgressbarElementId( tarmedlogId );\n return '<span id=\"' + id + '-time\"></span></span><div class=\"progress invoice-progress\"><div id=\"' + id + '\" class=\"progress-bar progress-bar-info invoice-progress-bar\" role=\"progressbar\" aria-valuenow=\"0\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 0%;\"></div></div>';\n }\n\n function getProgressText( type ) {\n return progressMap[type] || '';\n }\n\n function showTime( ms ) {\n if( !ms ) {\n return '';\n }\n\n var duration = moment.duration( ms );\n var formattedDuration = '';\n\n if( duration.hours() ) {\n formattedDuration += getDurationPad( duration.hours() + ':' );\n }\n\n return formattedDuration + getDurationPad( duration.minutes() ) + ':' + getDurationPad( duration.seconds() );\n }\n\n function getDurationPad( value ) {\n return ('00' + value).slice( -2 );\n }\n\n // ============================================================================================================== \\\\\n\n function notice( err ) {\n return Y.doccirrus.DCWindow.notice( {\n message: Y.doccirrus.errorTable.getMessage( err )\n } );\n }\n\n return {\n\n registerNode: function(node, key, options) {\n var actionButtonsViewModel;\n var tarmedlogTable;\n var componentColumnCheckbox;\n var isReloading = false;\n var openToLogId = options && options.data && options.data.invoiceLogId ? options.data.invoiceLogId : null,\n openToPatientId = options && options.data && options.data.patientId ? options.data.patientId : null,\n cashlog = options && options.data && options.data.cashlog,\n api = cashlog ? 'cashlog' : 'tarmedlog';\n\n // ============================================== ACTION BUTTONS ================================================ \\\\\n actionButtonsViewModel = Y.doccirrus.invoicelogutils.createActionButtonsViewModel( {\n create: {\n action: createLogs,\n enabled: true,\n visible: true\n },\n remove: {\n action: removeLog,\n enabled: function( state ) {\n return !!(state && ['CREATED', 'CANCELED', 'VALID', 'VALIDATION_ERR', 'INVALID', 'INVOICED_APPROVED'].indexOf( state.status ) !== -1);\n },\n visible: true\n },\n preValidate: {\n action: prevalidateLog,\n enabled: function( state ) {\n return !!(state && ['CREATED', 'VALID', 'INVALID', 'VALIDATION_ERR'].indexOf( state.status ) !== -1);\n },\n visible: true\n },\n generateInvoices: {\n action: generateInvoicesForLog,\n enabled: function( state ) {\n return state && state.status === 'VALID' && state.totalItems !== \"0/0/0\" && !state.isContentOutdated &&\n Y.doccirrus.auth.hasAPIAccess('tarmedlog.generateInvoices');\n },\n visible: true\n },\n invoiceBatchCreationPDF: {\n action: function() {\n },\n enabled: function() {\n return false;\n },\n visible: true\n },\n send: {\n action: send,\n enabled: function( state ) {\n return state && state.status === 'INVOICED_APPROVED' && Y.doccirrus.auth.hasAPIAccess('tarmedlog.send');\n },\n visible: true\n }\n } );\n\n actionButtonsViewModel.buttonGenerateI18n = i18n( 'InvoiceMojit.gkv_browser.button.GENERATE' );\n actionButtonsViewModel.buttonRemoveI18n = i18n( 'InvoiceMojit.gkv_browser.button.REMOVE' );\n actionButtonsViewModel.buttonPrecheckI18n = i18n( 'InvoiceMojit.gkv_browser.button.PRECHECK' );\n self.generateInvoicesPDFI18n = i18n( 'InvoiceMojit.cashbookJS.title.GENERATE_INVOICES_PDF' );\n self.approveAndGenerateInvoicesTextI18n = i18n( 'InvoiceMojit.cashbookJS.title.APPROVE_AND_GENERATE_INVOICES' );\n self.shippingButton = i18n( 'InvoiceMojit.gkv_delivery_settings.button.DELIVERY' );\n\n actionButtonsViewModel.optionsEnable = ko.observable( true );\n\n actionButtonsViewModel._shippingList = [\n {\n 'val': '',\n '-de': i18n('InvoiceMojit.gkv_browser.placeholder.DELIVERY_METHOD')\n },\n {\n 'val': 'MANUAL',\n '-de': i18n( 'deliverysettings-schema.DeliveryType_E.MANUAL' )\n },\n {\n 'val': 'MEDIPORT',\n '-de': i18n( 'deliverysettings-schema.DeliveryType_E.MEDIPORT' )\n }\n ];\n\n actionButtonsViewModel.shipping = ko.observable( actionButtonsViewModel._shippingList[0] );\n function createLogs() {\n\n getInvoiceConfigurations()\n .then( askForSettings )\n .then( createLogsFromSettings )\n .then( reloadTable )\n .catch( notice );\n\n function getInvoiceConfigurations() {\n return Promise.resolve( Y.doccirrus.jsonrpc.api.invoiceconfiguration.read() )\n .then( function( response ) {\n var kvgSettings = response && response.data && response.data[0] && response.data[0].kvgSettings;\n if( !kvgSettings ) {\n throw new Y.doccirrus.commonerrors.DCError( 2508 ); // Prompts to create setting\n }\n return kvgSettings;\n } );\n }\n\n function askForSettings( kvgSettings ) {\n return new Promise( function( resolve ) {\n return Y.doccirrus.modals.filterKVGInvoiceItems.show( {\n type: 'KVG',\n kvgSettings: kvgSettings,\n onSettingsChosen: resolve\n } );\n } );\n }\n\n function createLogsFromSettings( settings ) {\n return Promise.resolve( Y.doccirrus.jsonrpc.api.tarmedlog.createLogs( {\n settings: settings\n } ) );\n }\n }\n\n function removeLog( model ) {\n Promise.resolve( Y.doccirrus.jsonrpc.api.tarmedlog.removeLog( {\n id: ko.unwrap( model.state )._id\n } ) )\n .then( reloadTable )\n .catch( notice );\n }\n\n function prevalidateLog( model ) {\n Promise.resolve( Y.doccirrus.jsonrpc.api.tarmedlog.validate( {\n id: ko.unwrap( model.state )._id,\n preValidation: true\n } ) )\n .catch( notice );\n }\n\n function generateInvoicesForLog( model ) {\n var selection = ko.unwrap( model.state );\n Y.doccirrus.modals.invoiceLogApproveModal.show( selection, approve, null, {\n logType: 'tarmedlog',\n generateText: self.approveAndGenerateInvoicesTextI18n\n } );\n function approve() {\n return Promise.resolve( Y.doccirrus.jsonrpc.api.tarmedlog.generateInvoices( {\n id: selection._id\n } ) ).catch( notice );\n }\n }\n function send( model ) {\n var selection = ko.unwrap( model.state ),\n value = ko.unwrap( actionButtonsViewModel.shipping );\n if ( value === 'MEDIPORT' ) {\n Y.doccirrus.jsonrpc.api.flow.getFlows( {\n query: {\n flowType: 'KVG'\n }\n } ).done( function( response ) {\n const invoiceDocs = selection.invoiceDocs,\n invoiceXMLs = invoiceDocs.map(function ( scheinDocs ) {return scheinDocs.xml;} );\n Y.doccirrus.jsonrpc.api.flow.execute( {\n query: {\n _id: response.data[ 0 ]._id\n },\n data: {\n sourceQuery: {invoiceXMLs: invoiceXMLs}\n }\n } ).done( function() {\n Promise.resolve( Y.doccirrus.jsonrpc.api.tarmedlog.send( {\n id: selectedRows[0]._id,\n deliveryType: value\n } ) ).finally( function() {\n reloadTable();\n } );\n } ).fail( function( err ) {\n notice( err );\n } );\n } );\n } else {\n Promise.resolve( Y.doccirrus.jsonrpc.api.tarmedlog.send( {\n id: selectedRows[0]._id,\n deliveryType: value\n } ) ).then( function() {\n reloadTable();\n } ).catch( function( err ) {\n notice( err );\n } );\n }\n }\n\n // ============================================================================================================== \\\\\n // =================================================== TABLE ==================================================== \\\\\n tarmedlogTable = KoComponentManager.createComponent( {\n componentType: 'KoTable',\n componentConfig: {\n formRole: 'casefile-ko-invoice-table',\n pdfTitle: i18n( 'InvoiceMojit.kvg_browserJS.pdfTitle' ),\n stateId: 'InvoiceMojit-InvoiceNavigationBinderIndex-kvglogTable',\n states: ['limit'],\n striped: false,\n fillRowsToLimit: false,\n remote: true,\n proxy: Y.doccirrus.jsonrpc.api.tarmedlog.read,\n baseParams: {filterOnLocations: true},\n sortersLimit: 1,\n columns: [\n {\n componentType: 'KoTableColumnCheckbox',\n forPropertyName: 'checked',\n label: '',\n checkMode: 'single',\n allToggleVisible: false\n },\n {\n forPropertyName: 'created',\n label: CREATED_AT,\n renderer: Y.doccirrus.invoicelogutils.renderDateAndTime,\n isSortable: true,\n isFilterable: true,\n queryFilterType: Y.doccirrus.DCQuery.KBVDOB_OPERATOR\n },\n {\n forPropertyName: 'locname',\n label: LOCATION_NAME,\n isSortable: true,\n isFilterable: true\n },\n {\n forPropertyName: 'totalItems',\n width: '95px',\n label: SLD,\n renderer: function( meta ) {\n var html = '<a href=\"#\">' + meta.value + '</a>';\n if( meta.row.isContentOutdated === true ) {\n html = html + '&nbsp;<span class=\"text-warning glyphicon glyphicon-warning-sign\" aria-hidden=\"true\" title=\"' + IS_CONTENT_OUTDATED + '\"></span>';\n }\n return html;\n }\n },\n {\n forPropertyName: '_deliverySettings',\n label: DELIVERY,\n title: DELIVERY,\n renderer: function( meta ) {\n var row = meta.row,\n deliveryType;\n\n if( !row.deliveryType ) {\n return '<a href=\"invoiceadmin#/kvg_delivery_settings\" title=\"' + DELIVERY_SETTING_MISSING + '\"><span style=\"color: #a94442;\" class=\"glyphicon glyphicon-question-sign\"></span></a>';\n }\n else {\n deliveryType = actionButtonsViewModel._shippingList.filter( function( item ) {\n return item.val === row.deliveryType;\n } )[ 0 ];\n return '<a href=\"invoiceadmin#/kvg_delivery_settings\">'+deliveryType['-de']+'</a>';\n }\n },\n isSortable: true,\n isFilterable: true\n },\n {\n forPropertyName: 'insuranceTypes',\n label: i18n( 'InvoiceMojit.gkv_browserJS.label.PVSLOG_FILTERS' ),\n width: '160px',\n renderer: function( meta ) {\n var\n data = meta.row,\n html = '';\n\n if( !data.insuranceTypes || 0 === data.insuranceTypes.length ) {\n data.insuranceTypes = ['PRIVATE_CH', \"PRIVATE_CH_IVG\", \"PRIVATE_CH_UVG\", \"PRIVATE_CH_MVG\", \"PRIVATE_CH_VVG\"];\n }\n\n function mkLabel( label, danger ) {\n if( danger ) {\n return '<span class=\"label label-default label-danger\">' + label + '</span>&nbsp;';\n }\n return '<span class=\"label label-default\">' + label + '</span>&nbsp;';\n }\n\n if( data.isTiersGarant ) {\n html = html + mkLabel( 'TG' );\n }\n if( data.isTiersPayant ) {\n html = html + mkLabel( 'TP' );\n }\n\n data.insuranceTypes.forEach( function( item ) {\n switch( item ) {\n case \"PRIVATE_CH_VVG\":\n html = html + mkLabel( 'VVG' );\n break;\n case 'PRIVATE_CH':\n html = html + mkLabel( 'KVG' );\n break;\n case 'PRIVATE_CH_IVG':\n html = html + mkLabel( 'IVG' );\n break;\n case 'PRIVATE_CH_UVG':\n html = html + mkLabel( 'UVG' );\n break;\n case 'PRIVATE_CH_MVG':\n html = html + mkLabel( 'MVG' );\n break;\n }\n } );\n\n if( data.minTotal ) {\n html = html + '<br/>' + mkLabel( data.minTotal );\n }\n\n if( data.doNotcheckCatalog ) {\n html = html + (data.minTotal && data.minTotal.toString().length < 5 ? '' : '<br/>') + mkLabel( i18n( 'FilterInvoiceItemsDialog.doNotcheckCatalog.pill' ) );\n }\n\n if( data.useStartDate ) {\n html = html + '<br/>' + mkLabel( START_DATE + ' ' + moment( data.startDate ).format( TIMESTAMP_FORMAT ) );\n }\n\n if( data.useEndDate ) {\n html = html + '<br/>' + mkLabel( END_DATE + ' ' + moment( data.endDate ).format( TIMESTAMP_FORMAT ) );\n }\n\n if( true === data.employeeFilterEnabled && data.employees && data.employees.length ) {\n data.employees.forEach( function( emp ) {\n html = html + '<br/>' + mkLabel( emp.firstname + ' ' + emp.lastname );\n } );\n }\n\n if( data.padnextSettingTitle ) {\n html = html + '<br/>' + mkLabel( data.padnextSettingTitle );\n }\n\n if( data.padnextSettingTitle ) {\n html = html + '<br/>' + mkLabel( data.padnextSettingTitle );\n }\n\n if( data.collectMedidataRejected ) {\n html = html + '<br/>' + mkLabel( COLLECT_MEDIDATA_REJECTED, true );\n }\n\n return '<div style=\"display: flex; flex-wrap: wrap; align-items: baseline;\">' + html + '</div>';\n }\n },\n {\n forPropertyName: 'status',\n label: STATUS,\n renderer: function( meta ) {\n var displayText, displayElement, errorString;\n var value = meta.value;\n var data = meta.row;\n var errors = data.output || [];\n var warnings = data.warnings || [];\n var PROGRESS_BAR_STATES = ['VALIDATING', 'APPROVING', 'SENDING', 'INVOICING'];\n var ERROR_DISPLAY_STATES = ['VALID', 'INVALID'];\n\n if( !value ) {\n return '';\n }\n\n displayText = Y.doccirrus.schemaloader.getEnumListTranslation( 'invoicelog', 'Status_E', value, 'i18n', '' );\n\n if( ERROR_DISPLAY_STATES.indexOf( value ) > -1 ) {\n errorString = (errors.length || warnings.length) ? (errors.length + '/' + warnings.length) : null;\n if( errorString ) {\n displayText += '&nbsp;(' + errorString + ')';\n }\n if( data.isPreValidated ) {\n displayText += '&nbsp;(VP)';\n }\n }\n\n displayElement = '<a href=\"#\" class=\"kbvlogmodel-status kbvlogmodel-status-' + value.toLowerCase() + '\">' + displayText + '</a>';\n\n if( PROGRESS_BAR_STATES.indexOf( value ) > -1 ) {\n displayElement += getProgressbar( data._id );\n }\n\n return displayElement;\n },\n isSortable: true,\n isFilterable: true,\n queryFilterType: Y.doccirrus.DCQuery.ENUM_OPERATOR,\n filterField: {\n componentType: 'KoFieldSelect2',\n options: Y.doccirrus.schemas.invoicelog.types.Status_E.list,\n optionsText: 'i18n',\n optionsValue: 'val'\n }\n },\n {\n forPropertyName: 'invoiceDocs',\n label: 'Rechnungen',\n renderer: function( meta ) {\n var invoiceDocs = meta.row.invoiceDocs;\n\n return (Array.isArray( invoiceDocs ) && invoiceDocs.length) ? i18n( 'invoicelog-schema.Status_E.CREATED' ) + ' (' + invoiceDocs.length + ')' : '-';\n }\n },\n {\n forPropertyName: 'user.name',\n label: USER,\n renderer: function( meta ) {\n var user = meta && meta.row && meta.row.user;\n\n return user && user.length ? user[user.length - 1].name : '';\n },\n isSortable: true,\n isFilterable: true\n },\n {\n forPropertyName: 'files',\n label: FILES,\n renderer: function( meta ) {\n var\n data = meta.row,\n pdfFile = data.pdfFile,\n invoiceDocs = data.invoiceDocs || [],\n invoicesDiv = '',\n i;\n function makeURL( id, pdfFile ) {\n if ( id === '' ) {\n return '';\n }\n var isPDF = (id || '').indexOf('.pdf') !== -1,\n url = pdfFile ? id: '/media/grid_' + id;\n url = Y.doccirrus.infras.getPrivateURL( url );\n return '<a href=\"' + url + '\">' + ( isPDF ? 'PDF' : 'XML' ) + '</a> &nbsp;';\n }\n if( invoiceDocs.length ) {\n for( i = 0; i < invoiceDocs.length; i++) {\n if(i === 1) {\n invoicesDiv = invoicesDiv.concat(\n '<span class=\"onActivitiesTableShowMoreContentMore\"> ... </span>' +\n '<div id=\"xml-list-' + data._id + '\" class=\"onActivitiesTableShowMoreContentDetail onActivitiesTableShowMoreContentDetailHidden\">' );\n\n }\n invoicesDiv = invoicesDiv.concat(makeURL( invoiceDocs[ i ].xml, false ));\n if( !pdfFile ) {\n invoicesDiv = invoicesDiv.concat(makeURL( invoiceDocs[ i ].pdf, false ));\n }\n }\n\n if( invoiceDocs.length > 1 ) {\n invoicesDiv = invoicesDiv.concat('</div>');\n }\n }\n\n if( pdfFile ) {\n invoicesDiv = makeURL( pdfFile, true ) + invoicesDiv;\n }\n\n return invoicesDiv;\n },\n onCellClick: function(event) {\n if (event.isLink || event.row.invoiceDocs.length < 2) {\n return false;\n }\n var xmlLinkList = document.getElementById('xml-list-' + event.row._id );\n\n if(xmlLinkList.classList.contains(\"onActivitiesTableShowMoreContentDetailHidden\")) {\n xmlLinkList.classList.remove(\"onActivitiesTableShowMoreContentDetailHidden\");\n xmlLinkList.classList.add(\"onActivitiesTableShowMoreContentDetailShow\");\n } else {\n xmlLinkList.classList.remove(\"onActivitiesTableShowMoreContentDetailShow\");\n xmlLinkList.classList.add(\"onActivitiesTableShowMoreContentDetailHidden\");\n }\n },\n isSortable: true\n },\n {\n forPropertyName: 'lastUpdate',\n label: LAST_UPDATE,\n renderer: Y.doccirrus.invoicelogutils.renderDateAndTime,\n isSortable: true,\n sortInitialIndex: 0,\n direction: 'DESC',\n isFilterable: true,\n queryFilterType: Y.doccirrus.DCQuery.KBVDOB_OPERATOR\n },\n {\n forPropertyName: 'priceTotal',\n label: PRICE_TOTAL,\n renderer: function( meta ) {\n return meta.value ? Y.doccirrus.comctl.numberToLocalString( meta.value ) : '-';\n },\n isSortable: true\n }\n ],\n onRowClick: function( meta, e ) {\n var colName = meta.col.forPropertyName;\n var data = meta.row;\n var invoiceLogId = data._id.toString();\n var location = data.mainLocationId;\n\n if( -1 === ['files', '_deliverySettings'].indexOf( colName ) ) {\n e.preventDefault();\n }\n\n // e.preventDefault();\n\n if( colName === 'status' ) {\n Y.doccirrus.modals.invoiceErrorLogModal.show( location, invoiceLogId, 'KVG', reloadTable );\n } else if( colName === 'totalItems' && hasFeature( SEE_CONTENT_FEATURE, meta.row._log_version, 'KVG' ) ) {\n Y.doccirrus.modals.invoiceLogModal.show( data, 'KVG', reloadTable );\n }\n return false;\n }\n }\n } );\n\n componentColumnCheckbox = tarmedlogTable.getComponentColumnCheckbox();\n\n ko.computed( function() {\n selectedRows = componentColumnCheckbox.checked();\n actionButtonsViewModel.state( selectedRows && selectedRows.length ? selectedRows[0] : null );\n } );\n\n function reloadTable() {\n if( isReloading ) {\n return;\n }\n isReloading = true;\n\n const selected = componentColumnCheckbox.checked();\n const ids = Array.isArray( selected ) && selected.length ? [selected[0]._id] : selected;\n\n componentColumnCheckbox.uncheckAll();\n\n tarmedlogTable.reload( {\n done: function() {\n componentColumnCheckbox.checkItemsByProperty( ids );\n },\n always: function() {\n isReloading = false;\n }\n } );\n }\n\n function loadAndOpenLog( api, cashlog, invoiceLogId, patientId ) {\n Y.doccirrus.jsonrpc.api[api]\n .read( {query: {_id: invoiceLogId}} )\n .then( openLogModal )\n .fail( function( error ) {\n _.invoke( Y.doccirrus.errorTable.getErrorsFromResponse( error ), 'display' );\n } );\n\n function openLogModal( result ) {\n var data = result && result.data && result.data[0] ? result.data[0] : null;\n\n if( !data ) {\n Y.log( 'Could not load deep linked log: ' + invoiceLogId, 'warn', NAME );\n return;\n }\n\n if( patientId ) {\n data.openToPatient = patientId;\n }\n\n Y.doccirrus.modals.invoiceLogModal.show( data, cashlog ? 'CASH ' : 'KVG', function() {\n Y.log( 'Closed default modal, redirecting to default tarmed hash fragment', 'debug', NAME );\n\n // return to default route\n window.location.hash = '#/' + cashlog ? 'cashlog' : 'tarmed';\n } );\n }\n }\n\n // ============================================================================================================== \\\\\n // =============================================== COMMUNICATION ================================================ \\\\\n Y.doccirrus.communication.on( {\n event: 'invoicelogAction',\n done: function( message ) {\n var data = message.data && message.data[0];\n if( 'KVG' === data.invoiceType ) {\n if( data.state === 'progress' ) {\n updateProgressbar( data.id, data.progress );\n } else {\n reloadTable();\n }\n }\n },\n handlerId: 'updateTableLogAction'\n } );\n Y.doccirrus.communication.on( {\n event: 'tarmedLogging',\n done: function( message ) {\n var data = message.data && message.data[0];\n if( 'KVG' === data.invoiceType ) {\n if( data.error ) {\n notice( data.error);\n }\n reloadTable();\n }\n },\n handlerId: 'updateMedidataTable'\n } );\n\n if( openToLogId ) {\n Y.log( 'Deep link to PVS log: ' + openToLogId + ' patient: ' + openToPatientId, 'debug', NAME );\n loadAndOpenLog( api, cashlog, openToLogId, openToPatientId );\n }\n\n // ============================================================================================================== \\\\\n ko.applyBindings( actionButtonsViewModel, document.querySelector( '#actionButtons' ) );\n ko.applyBindings( tarmedlogTable, document.querySelector( '#tarmedlogTable' ) );\n },\n\n deregisterNode: function() {\n Y.doccirrus.communication.off( 'invoicelogAction', 'updateTableLogAction' );\n Y.doccirrus.communication.off( 'tarmedLogging', 'updateMedidataTable' );\n }\n };\n}", "title": "" } ]
[ { "docid": "3704c6b6abc44b8571ea7b431753f6e6", "score": "0.60300636", "text": "function DateHelper() {\n\t}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "e33ae5a4d24b5f8e7fb1675549eba364", "score": "0.60095286", "text": "function Sb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(y(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Ob(c,d),Tb(this,e,a),this}}", "title": "" }, { "docid": "f29dc47349e86f2f95307fa09cd3d943", "score": "0.5980822", "text": "function ISO_2022() {}", "title": "" }, { "docid": "b1c3780be6fd9d0604126ef93a152d83", "score": "0.59407216", "text": "function bb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(ga(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period).\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Za(c,d),cb(this,e,a),this}}", "title": "" }, { "docid": "46047cb232831c63d949dec5691f9481", "score": "0.58863807", "text": "function ISO_2022(){}", "title": "" }, { "docid": "933aaf08fc32fb05c4cf380a492bf826", "score": "0.5809857", "text": "function xDate() {}", "title": "" }, { "docid": "9800e34a8929807f320f41128ea8892c", "score": "0.5682279", "text": "function CustomDate() {}", "title": "" }, { "docid": "173e918fe556791cdcd20835f960567b", "score": "0.5572501", "text": "function __mlHelper (localeString) {\n\t\treturn function ( from, to, locale, def ) {\n\t\t\t// Luxon and Moment support\n\t\t\t// Argument shifting\n\t\t\tif ( arguments.length === 0 ) {\n\t\t\t\tlocale = 'en';\n\t\t\t\tto = null; // means toLocaleString\n\t\t\t\tfrom = null; // means iso8601\n\t\t\t}\n\t\t\telse if ( arguments.length === 1 ) {\n\t\t\t\tlocale = 'en';\n\t\t\t\tto = from;\n\t\t\t\tfrom = null;\n\t\t\t}\n\t\t\telse if ( arguments.length === 2 ) {\n\t\t\t\tlocale = to;\n\t\t\t\tto = from;\n\t\t\t\tfrom = null;\n\t\t\t}\n\t\n\t\t\tvar typeName = 'datetime-' + to;\n\t\n\t\t\t// Add type detection and sorting specific to this date format - we need to be able to identify\n\t\t\t// date type columns as such, rather than as numbers in extensions. Hence the need for this.\n\t\t\tif (! DataTable.ext.type.order[typeName]) {\n\t\t\t\t// The renderer will give the value to type detect as the type!\n\t\t\t\tDataTable.ext.type.detect.unshift(function (d) {\n\t\t\t\t\treturn d === typeName ? typeName : false;\n\t\t\t\t});\n\t\n\t\t\t\t// The renderer gives us Moment, Luxon or Date obects for the sorting, all of which have a\n\t\t\t\t// `valueOf` which gives milliseconds epoch\n\t\t\t\tDataTable.ext.type.order[typeName + '-asc'] = function (a, b) {\n\t\t\t\t\tvar x = a.valueOf();\n\t\t\t\t\tvar y = b.valueOf();\n\t\n\t\t\t\t\treturn x === y\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: x < y\n\t\t\t\t\t\t\t? -1\n\t\t\t\t\t\t\t: 1;\n\t\t\t\t}\n\t\n\t\t\t\tDataTable.ext.type.order[typeName + '-desc'] = function (a, b) {\n\t\t\t\t\tvar x = a.valueOf();\n\t\t\t\t\tvar y = b.valueOf();\n\t\n\t\t\t\t\treturn x === y\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: x > y\n\t\t\t\t\t\t\t? -1\n\t\t\t\t\t\t\t: 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\treturn function ( d, type ) {\n\t\t\t\t// Allow for a default value\n\t\t\t\tif (d === null || d === undefined) {\n\t\t\t\t\tif (def === '--now') {\n\t\t\t\t\t\t// We treat everything as UTC further down, so no changes are\n\t\t\t\t\t\t// made, as such need to get the local date / time as if it were\n\t\t\t\t\t\t// UTC\n\t\t\t\t\t\tvar local = new Date();\n\t\t\t\t\t\td = new Date( Date.UTC(\n\t\t\t\t\t\t\tlocal.getFullYear(), local.getMonth(), local.getDate(),\n\t\t\t\t\t\t\tlocal.getHours(), local.getMinutes(), local.getSeconds()\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\td = '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tif (type === 'type') {\n\t\t\t\t\t// Typing uses the type name for fast matching\n\t\t\t\t\treturn typeName;\n\t\t\t\t}\n\t\n\t\t\t\tif (d === '') {\n\t\t\t\t\treturn type !== 'sort'\n\t\t\t\t\t\t? ''\n\t\t\t\t\t\t: __mldObj('0000-01-01 00:00:00', null, locale);\n\t\t\t\t}\n\t\n\t\t\t\t// Shortcut. If `from` and `to` are the same, we are using the renderer to\n\t\t\t\t// format for ordering, not display - its already in the display format.\n\t\t\t\tif ( to !== null && from === to && type !== 'sort' && type !== 'type' && ! (d instanceof Date) ) {\n\t\t\t\t\treturn d;\n\t\t\t\t}\n\t\n\t\t\t\tvar dt = __mldObj(d, from, locale);\n\t\n\t\t\t\tif (dt === null) {\n\t\t\t\t\treturn d;\n\t\t\t\t}\n\t\n\t\t\t\tif (type === 'sort') {\n\t\t\t\t\treturn dt;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar formatted = to === null\n\t\t\t\t\t? __mld(dt, 'toDate', 'toJSDate', '')[localeString]()\n\t\t\t\t\t: __mld(dt, 'format', 'toFormat', 'toISOString', to);\n\t\n\t\t\t\t// XSS protection\n\t\t\t\treturn type === 'display' ?\n\t\t\t\t\t__htmlEscapeEntities( formatted ) :\n\t\t\t\t\tformatted;\n\t\t\t};\n\t\t}\n\t}", "title": "" }, { "docid": "9d8fb5b9db64c95b5457f0e1199bdc06", "score": "0.5559004", "text": "function x(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=m(b)?z(a):y(a,b),c&&(Vc=c)),Vc._abbr}", "title": "" }, { "docid": "a57e11ae5738e45b92fa7720c7f4eb4d", "score": "0.55316406", "text": "function Moment() {\n\n return function (input, momentFn /*, param1, param2, ...param n */) {\n var args = Array.prototype.slice.call(arguments, 2),\n momentObj = moment(new Date(input));\n return momentObj[momentFn].apply(momentObj, args);\n };\n }", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.55171067", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.55171067", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.55171067", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.55171067", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.55171067", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.55171067", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "532f1421d8bf933bdc7e06407444d417", "score": "0.55171067", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(xe=c)),xe._abbr}", "title": "" }, { "docid": "7c7203d89d6632845fbc19d45b663a4a", "score": "0.5503853", "text": "function __mlHelper (localeString) {\n\treturn function ( from, to, locale, def ) {\n\t\t// Luxon and Moment support\n\t\t// Argument shifting\n\t\tif ( arguments.length === 0 ) {\n\t\t\tlocale = 'en';\n\t\t\tto = null; // means toLocaleString\n\t\t\tfrom = null; // means iso8601\n\t\t}\n\t\telse if ( arguments.length === 1 ) {\n\t\t\tlocale = 'en';\n\t\t\tto = from;\n\t\t\tfrom = null;\n\t\t}\n\t\telse if ( arguments.length === 2 ) {\n\t\t\tlocale = to;\n\t\t\tto = from;\n\t\t\tfrom = null;\n\t\t}\n\n\t\tvar typeName = 'datetime-' + to;\n\n\t\t// Add type detection and sorting specific to this date format - we need to be able to identify\n\t\t// date type columns as such, rather than as numbers in extensions. Hence the need for this.\n\t\tif (! DataTable.ext.type.order[typeName]) {\n\t\t\t// The renderer will give the value to type detect as the type!\n\t\t\tDataTable.ext.type.detect.unshift(function (d) {\n\t\t\t\treturn d === typeName ? typeName : false;\n\t\t\t});\n\n\t\t\t// The renderer gives us Moment, Luxon or Date obects for the sorting, all of which have a\n\t\t\t// `valueOf` which gives milliseconds epoch\n\t\t\tDataTable.ext.type.order[typeName + '-asc'] = function (a, b) {\n\t\t\t\tvar x = a.valueOf();\n\t\t\t\tvar y = b.valueOf();\n\n\t\t\t\treturn x === y\n\t\t\t\t\t? 0\n\t\t\t\t\t: x < y\n\t\t\t\t\t\t? -1\n\t\t\t\t\t\t: 1;\n\t\t\t}\n\n\t\t\tDataTable.ext.type.order[typeName + '-desc'] = function (a, b) {\n\t\t\t\tvar x = a.valueOf();\n\t\t\t\tvar y = b.valueOf();\n\n\t\t\t\treturn x === y\n\t\t\t\t\t? 0\n\t\t\t\t\t: x > y\n\t\t\t\t\t\t? -1\n\t\t\t\t\t\t: 1;\n\t\t\t}\n\t\t}\n\t\n\t\treturn function ( d, type ) {\n\t\t\t// Allow for a default value\n\t\t\tif (d === null || d === undefined) {\n\t\t\t\tif (def === '--now') {\n\t\t\t\t\t// We treat everything as UTC further down, so no changes are\n\t\t\t\t\t// made, as such need to get the local date / time as if it were\n\t\t\t\t\t// UTC\n\t\t\t\t\tvar local = new Date();\n\t\t\t\t\td = new Date( Date.UTC(\n\t\t\t\t\t\tlocal.getFullYear(), local.getMonth(), local.getDate(),\n\t\t\t\t\t\tlocal.getHours(), local.getMinutes(), local.getSeconds()\n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\td = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (type === 'type') {\n\t\t\t\t// Typing uses the type name for fast matching\n\t\t\t\treturn typeName;\n\t\t\t}\n\n\t\t\tif (d === '') {\n\t\t\t\treturn type !== 'sort'\n\t\t\t\t\t? ''\n\t\t\t\t\t: __mldObj('0000-01-01 00:00:00', null, locale);\n\t\t\t}\n\n\t\t\t// Shortcut. If `from` and `to` are the same, we are using the renderer to\n\t\t\t// format for ordering, not display - its already in the display format.\n\t\t\tif ( to !== null && from === to && type !== 'sort' && type !== 'type' && ! (d instanceof Date) ) {\n\t\t\t\treturn d;\n\t\t\t}\n\n\t\t\tvar dt = __mldObj(d, from, locale);\n\n\t\t\tif (dt === null) {\n\t\t\t\treturn d;\n\t\t\t}\n\n\t\t\tif (type === 'sort') {\n\t\t\t\treturn dt;\n\t\t\t}\n\t\t\t\n\t\t\tvar formatted = to === null\n\t\t\t\t? __mld(dt, 'toDate', 'toJSDate', '')[localeString]()\n\t\t\t\t: __mld(dt, 'format', 'toFormat', 'toISOString', to);\n\n\t\t\t// XSS protection\n\t\t\treturn type === 'display' ?\n\t\t\t\t__htmlEscapeEntities( formatted ) :\n\t\t\t\tformatted;\n\t\t};\n\t}\n}", "title": "" }, { "docid": "d5add0cbea305387c1b5972629834d18", "score": "0.5496352", "text": "function Rb(a,b){return function(c,d){var e,f;\r\n// invert the arguments, but complain about it\r\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "bb51fb55971dd499ec6da8f00ad3a552", "score": "0.54817843", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Mb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "fc597810caad5600bd1adce29010cf07", "score": "0.5480456", "text": "function Nt(e,t,o){return\"m\"===o?t?\"хвилина\":\"хвилину\":\"h\"===o?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var o=e.split(\"_\");return t%10==1&&t%100!=11?o[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?o[1]:o[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[o],+e)}", "title": "" }, { "docid": "e116143e66b7212bfabc003ae4b76084", "score": "0.5476311", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "title": "" }, { "docid": "e116143e66b7212bfabc003ae4b76084", "score": "0.5476311", "text": "function $a(a,b){var c;\n// moment.duration._locale = moment._locale = data;\nreturn a&&(c=p(b)?bb(a):_a(a,b),c&&(vf=c)),vf._abbr}", "title": "" }, { "docid": "eb7f63b1d72ad46cbb2104b25f476966", "score": "0.54650015", "text": "function validDate() {\n}", "title": "" }, { "docid": "21c38b54ff9e67e0b6557c72f89577f6", "score": "0.54552335", "text": "function parseDate(___){\n\treturn ___;\n}", "title": "" }, { "docid": "e6d32dfed619b4ea6144d528cf95ab35", "score": "0.54405147", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "e6d32dfed619b4ea6144d528cf95ab35", "score": "0.54405147", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "e6d32dfed619b4ea6144d528cf95ab35", "score": "0.54405147", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "e6d32dfed619b4ea6144d528cf95ab35", "score": "0.54405147", "text": "function Rb(a,b){return function(c,d){var e,f;\n//invert the arguments, but complain about it\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "678b4e27436855d14772ab6275a02c45", "score": "0.5425527", "text": "function Rb(a,b){return function(c,d){var e,f;\r\n//invert the arguments, but complain about it\r\nreturn null===d||isNaN(+d)||(x(b,\"moment().\"+b+\"(period, number) is deprecated. Please use moment().\"+b+\"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.\"),f=c,c=d,d=f),c=\"string\"==typeof c?+c:c,e=Nb(c,d),Sb(this,e,a),this}}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "7e31eb290ce18ab2f753e0257031db51", "score": "0.5423043", "text": "function fc(){if(!this.isValid())return\"moment.invalid(/* \"+this._i+\" */)\";var a=\"moment\",b=\"\";this.isLocal()||(a=0===this.utcOffset()?\"moment.utc\":\"moment.parseZone\",b=\"Z\");var c=\"[\"+a+'(\"]',d=0<this.year()&&this.year()<=9999?\"YYYY\":\"YYYYYY\",e=\"-MM-DD[T]HH:mm:ss.SSS\",f=b+'[\")]';return this.format(c+d+e+f)}", "title": "" }, { "docid": "1529116d403791eaf976999e0e3fbf6b", "score": "0.53968555", "text": "function saludo3(fn = fnTemporal1) {\n fn();\n}", "title": "" }, { "docid": "70e24bd38a83d0589d7b67b155bd981d", "score": "0.5385748", "text": "function fn(e,t,a){var n=e+\" \";switch(a){case\"ss\":return n+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return n+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return n+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return n+=1===e?\"dan\":\"dana\";case\"MM\":return n+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return n+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "aa820385d9f723878c0e5d547a968a4b", "score": "0.5366406", "text": "function t(e,t,a){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[a],e)}", "title": "" }, { "docid": "6eece5fca0992ccc437bbea15de4e9a1", "score": "0.53633565", "text": "function t$19(){return function(n,t){if(!n[t])throw new TypeError(`Cannot auto bind undefined function '${t}'`);return {value:o$13(n[t])}}}", "title": "" }, { "docid": "77a7f951013a38050074bab62417660d", "score": "0.5361281", "text": "function f(e,t,a){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[a],e)}", "title": "" }, { "docid": "12adae3c337b153e58d478d6fbff030c", "score": "0.5330349", "text": "function Helpers() {\n 'use strict';\n\n return;\n}", "title": "" }, { "docid": "7bc97db02edb97e76363e9a92254d9aa", "score": "0.5320241", "text": "function pt(e,t,a){return\"m\"===a?t?\"хвилина\":\"хвилину\":\"h\"===a?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var a=e.split(\"_\");return t%10==1&&t%100!=11?a[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?a[1]:a[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[a],+e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "176adc559ee83e21879376431d4eab00", "score": "0.53175867", "text": "function t(e,t,n){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[n],e)}", "title": "" }, { "docid": "109005436c949e13c64e6e6dc5893d90", "score": "0.52594817", "text": "function exfn(results, testrun)\n\t{\n\t\tezdate = results;\n\t\tif (!results) return;\n\t\ttestrun.results = results._formattedDate || '_formattedDate is undefined';\n\t}", "title": "" }, { "docid": "6553f03362583adbf52d0df1b58e26f5", "score": "0.5240822", "text": "function TS() { }", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.52399653", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "c90316409017a609d767bb60f1ce89ab", "score": "0.52399653", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}else{if(typeof console!=='undefined'&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn('Locale '+key+' not found. Did you forget to load it?');}}}return globalLocale._abbr;}", "title": "" }, { "docid": "768b79a0d70669c8dfec1b61627437b4", "score": "0.5218889", "text": "function t(e, t, n) {\r\n return e + \" \" + function (e, t) {\r\n return 2 === t ? function (e) {\r\n var t = {\r\n m: \"v\",\r\n b: \"v\",\r\n d: \"z\"\r\n };\r\n return void 0 === t[e.charAt(0)] ? e : t[e.charAt(0)] + e.substring(1)\r\n }(e) : e\r\n }({\r\n mm: \"munutenn\",\r\n MM: \"miz\",\r\n dd: \"devezh\"\r\n }[n], e)\r\n }", "title": "" }, { "docid": "8d635f5343d4d7e232cf242fdf74d012", "score": "0.52160174", "text": "function _() { }", "title": "" }, { "docid": "8d635f5343d4d7e232cf242fdf74d012", "score": "0.52160174", "text": "function _() { }", "title": "" }, { "docid": "8d635f5343d4d7e232cf242fdf74d012", "score": "0.52160174", "text": "function _() { }", "title": "" }, { "docid": "8d635f5343d4d7e232cf242fdf74d012", "score": "0.52160174", "text": "function _() { }", "title": "" }, { "docid": "4462a14c3384e87eaf11d8a91367a9d8", "score": "0.52126163", "text": "function asYetUnnamed () {\n \n }", "title": "" }, { "docid": "d339f303777a8c32973cb9e04e6e2dca", "score": "0.52077246", "text": "function injectCalUtilsCompat(global) {\n for (let [namespace, nsdata] of Object.entries(migrations)) {\n for (let [from, to] of Object.entries(nsdata)) {\n if (typeof to == \"object\") {\n global[from] = {};\n for (let [frominner, toinner] of Object.entries(to)) {\n generateForward(global[from], namespace, frominner, toinner, global);\n }\n } else {\n generateForward(global, namespace, from, to);\n }\n }\n }\n\n // calGetString is special, as the argument order and kind has changed as well\n global.calGetString = function(aBundleName, aStringName, aParams, aComponent = \"calendar\") {\n Deprecated.warning(\n \"calUtils' cal.calGetString() has changed to cal.l10n.get*String()\" +\n \" and the parameter order has changed\",\n \"https://bugzilla.mozilla.org/show_bug.cgi?id=905097\",\n Components.stack.caller\n );\n return global.l10n.getAnyString(aComponent, aBundleName, aStringName, aParams);\n };\n\n global.ProviderBase = class extends global.provider.BaseClass {\n initProviderBase() {\n Deprecated.warning(\n \"calProviderUtils' cal.ProviderBase() has changed to cal.provider.BaseClass()\",\n \"https://bugzilla.mozilla.org/show_bug.cgi?id=905097\",\n Components.stack.caller\n );\n super.initProviderBase();\n }\n };\n\n global.BadCertHandler = class extends global.provider.BadCertHandler {\n constructor() {\n Deprecated.warning(\n \"calProviderUtils' cal.BadCertHandler() has changed to cal.provider.BadCertHandler()\",\n \"https://bugzilla.mozilla.org/show_bug.cgi?id=905097\",\n Components.stack.caller\n );\n super();\n }\n };\n\n global.FreeBusyInterval = class extends global.provider.FreeBusyInterval {\n constructor() {\n Deprecated.warning(\n \"calProviderUtils' cal.FreeBusyInterval() has changed to cal.provider.FreeBusyInterval()\",\n \"https://bugzilla.mozilla.org/show_bug.cgi?id=905097\",\n Components.stack.caller\n );\n super();\n }\n };\n}", "title": "" }, { "docid": "1400bd713812c26c994c818a3ccdb143", "score": "0.52012974", "text": "async function v9(v10,v11) {\n const v12 = v11.toLocaleString();\n // v12 = .unknown\n const v13 = Function(v12);\n // v13 = .unknown\n}", "title": "" }, { "docid": "2e004764c6715101dd1736be31f2f10c", "score": "0.51820016", "text": "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "title": "" }, { "docid": "2e004764c6715101dd1736be31f2f10c", "score": "0.51820016", "text": "function makeGetterAndSetter(name, key) {\n moment.fn[name] = moment.fn[name + 's'] = function (input) {\n var utc = this._isUTC ? 'UTC' : '';\n if (input != null) {\n this._d['set' + utc + key](input);\n return this;\n } else {\n return this._d['get' + utc + key]();\n }\n };\n }", "title": "" }, { "docid": "721b812bfe6c0f43d8633ab8dd2f8f25", "score": "0.51785696", "text": "function t(e,t,o){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[o],e)}", "title": "" }, { "docid": "628dc88a9b0ee0ea190b45a7c504a2c7", "score": "0.51778895", "text": "function makeShortcut(name, key) {\r\n moment.fn[name] = function (input) {\r\n var utc = this._isUTC ? 'UTC' : '';\r\n if (typeof input !== 'undefined') {\r\n this._d['set' + utc + key](input);\r\n return this;\r\n } else {\r\n return this._d['get' + utc + key]();\r\n }\r\n };\r\n }", "title": "" }, { "docid": "89ee7de06dce7f9857ebb0680cafabaf", "score": "0.51768136", "text": "getMomentObject() {\n\t\treturn this.props.training.timestamp ? moment.unix(this.props.training.timestamp) : '';\n\t}", "title": "" }, { "docid": "ab3286371aadddd2e35424aae6a762f1", "score": "0.5171024", "text": "function o_O() {}", "title": "" }, { "docid": "54d4029b08e4770ec79a751e0f546cda", "score": "0.5155893", "text": "function dateGuard (fn) {\n return function (date) {\n var parsed\n if (typeof date === 'string') {\n parsed = parseDate(date)\n } else if (date instanceof Date) {\n parsed = date\n } else {\n parsed = null\n }\n return fn(parsed)\n }\n}", "title": "" }, { "docid": "1e44fef3abeb79ef83403b8368732731", "score": "0.5148302", "text": "function t(e, t, a) {\n return e + \" \" + function (e, t) {\n return 2 === t ? function (e) {\n var t = {m: \"v\", b: \"v\", d: \"z\"};\n return void 0 === t[e.charAt(0)] ? e : t[e.charAt(0)] + e.substring(1)\n }(e) : e\n }({mm: \"munutenn\", MM: \"miz\", dd: \"devezh\"}[a], e)\n }", "title": "" }, { "docid": "1580008a48fb2b6740ce7f4bf4e3875b", "score": "0.5143429", "text": "function Za(a,b){var c;\r\n// moment.duration._locale = moment._locale = data;\r\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "1580008a48fb2b6740ce7f4bf4e3875b", "score": "0.5143429", "text": "function Za(a,b){var c;\r\n// moment.duration._locale = moment._locale = data;\r\nreturn a&&(c=o(b)?ab(a):$a(a,b),c&&(se=c)),se._abbr}", "title": "" }, { "docid": "4f1e7fd4d3e7bf2892fdee52e2521f69", "score": "0.51342404", "text": "function rn(e,t,a){return e+\" \"+function(e,t){if(2===t)return function(e){var t={m:\"v\",b:\"v\",d:\"z\"};if(void 0===t[e.charAt(0)])return e;return t[e.charAt(0)]+e.substring(1)}(e);return e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[a],e)}", "title": "" }, { "docid": "e1fe87844641cb82f98b6a0dc51e344a", "score": "0.5133283", "text": "now(){\n return moment();\n }", "title": "" }, { "docid": "9a50f28bb9e03f4d63311a41327fbc02", "score": "0.51280874", "text": "function formatMoment(m, format) { // 599\n if (!m.isValid()) { // 600\n return m.localeData().invalidDate(); // 601\n } // 602\n // 603\n format = expandFormat(format, m.localeData()); // 604\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); // 605\n // 606\n return formatFunctions[format](m); // 607\n } // 608", "title": "" }, { "docid": "56c18b8a0373d068eb24a45e0556289e", "score": "0.51272243", "text": "function tt(){}", "title": "" }, { "docid": "5f32bed40416b6c8e0ba2d8a9192535d", "score": "0.5121661", "text": "function t(e,t,a){return e+\" \"+function(e,t){return 2===t?function(e){var t={m:\"v\",b:\"v\",d:\"z\"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"}[a],e)}", "title": "" } ]
3c29b86e1a4e505e9acaa843b4dfb27a
Convert a string of words to a JavaScript identifier.
[ { "docid": "e5313810ddd135d6a42b7a6c26a3f090", "score": "0.69858444", "text": "function toIdentifier(str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1);\n }).join('').replace(/[^ _0-9a-z]/gi, '');\n}", "title": "" } ]
[ { "docid": "39ac5e7d2ef349398d8fd28f3e772828", "score": "0.70635325", "text": "function toIdentifier (str) {\n\t return str.split(' ').map(function (token) {\n\t return token.slice(0, 1).toUpperCase() + token.slice(1)\n\t }).join('').replace(/[^ _0-9a-z]/gi, '')\n\t}", "title": "" }, { "docid": "39ac5e7d2ef349398d8fd28f3e772828", "score": "0.70635325", "text": "function toIdentifier (str) {\n\t return str.split(' ').map(function (token) {\n\t return token.slice(0, 1).toUpperCase() + token.slice(1)\n\t }).join('').replace(/[^ _0-9a-z]/gi, '')\n\t}", "title": "" }, { "docid": "39ac5e7d2ef349398d8fd28f3e772828", "score": "0.70635325", "text": "function toIdentifier (str) {\n\t return str.split(' ').map(function (token) {\n\t return token.slice(0, 1).toUpperCase() + token.slice(1)\n\t }).join('').replace(/[^ _0-9a-z]/gi, '')\n\t}", "title": "" }, { "docid": "ab499a68e022e1ca2900ea48f18d377e", "score": "0.7061473", "text": "function toIdentifier(str) {\n\t return str.split(' ').map(function (token) {\n\t return token.slice(0, 1).toUpperCase() + token.slice(1);\n\t }).join('').replace(/[^ _0-9a-z]/gi, '');\n\t}", "title": "" }, { "docid": "ab499a68e022e1ca2900ea48f18d377e", "score": "0.7061473", "text": "function toIdentifier(str) {\n\t return str.split(' ').map(function (token) {\n\t return token.slice(0, 1).toUpperCase() + token.slice(1);\n\t }).join('').replace(/[^ _0-9a-z]/gi, '');\n\t}", "title": "" }, { "docid": "8ecedd9fd40aff695222b5a4e31bbd4c", "score": "0.6967184", "text": "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "title": "" }, { "docid": "8ecedd9fd40aff695222b5a4e31bbd4c", "score": "0.6967184", "text": "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "title": "" }, { "docid": "8ecedd9fd40aff695222b5a4e31bbd4c", "score": "0.6967184", "text": "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "title": "" }, { "docid": "8ecedd9fd40aff695222b5a4e31bbd4c", "score": "0.6967184", "text": "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "title": "" }, { "docid": "8ecedd9fd40aff695222b5a4e31bbd4c", "score": "0.6967184", "text": "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "title": "" }, { "docid": "8ecedd9fd40aff695222b5a4e31bbd4c", "score": "0.6967184", "text": "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "title": "" }, { "docid": "8ecedd9fd40aff695222b5a4e31bbd4c", "score": "0.6967184", "text": "function toIdentifier (str) {\n return str.split(' ').map(function (token) {\n return token.slice(0, 1).toUpperCase() + token.slice(1)\n }).join('').replace(/[^ _0-9a-z]/gi, '')\n}", "title": "" }, { "docid": "2159348975e657da41577f9f29a9b04d", "score": "0.6471714", "text": "function tokenizeIdentifier(chars) {\n const pos = chars.pos\n let c = chars.shift();\n let id = '';\n while (c != null && (c.match(identifier)|| c.match(number))) {\n id += c;\n c = chars.shift();\n }\n if (c != null) {\n chars.unshift(c);\n }\n return {type: 'id', val: id, pos};\n}", "title": "" }, { "docid": "eec658134585444a349732d7339e6224", "score": "0.6398333", "text": "function wordToCssId(word, type){\n\n word = (type === 'hashtags') ? word.substr(1) : word;\n var prepend = {\n 'hashtags': '_HS_',\n 'expressions': '_XP_',\n 'UCwords': '_UC_',\n 'LCwords': '_LC_',\n };\n return prepend[type] + word.replace(/\\W/g,\"_\").toLowerCase();\n\n}", "title": "" }, { "docid": "38ecba5e6b2b8d3e5021b4090d3a9968", "score": "0.63762176", "text": "function mkIdentifier$2(s) {\n s = camelCase('' + s);\n // cleanup: replace any non-suitable character series to a single underscore:\n return s.replace(/^[^\\w_]/, '_')\n // do not accept numerics at the leading position, despite those matching regex `\\w`:\n .replace(/^\\d/, '_').replace(/[^\\w\\d_]+/g, '_')\n // and only accept multiple (double, not triple) underscores at start or end of identifier name:\n .replace(/^__+/, '#').replace(/__+$/, '#').replace(/_+/g, '_').replace(/#/g, '__');\n}", "title": "" }, { "docid": "b5067ac9d2eff9adfd3db1c56497ea9f", "score": "0.62585545", "text": "function st2js (string) {\n return '_' + string\n .replace(/[:&|+\\-*/\\\\~%><=,@]/g, function (ch) {\n return table[ch];\n });\n }", "title": "" }, { "docid": "f84f42d5314c58902ab61d249d90155f", "score": "0.6200857", "text": "createIdenifier() {\n let start = this.pos;\n while (isAlphaNumeric(this.input[this.pos])) {\n this.pos++;\n }\n\n // keywords and identifiers should be case insensitive\n const text = this.input.substring(start, this.pos).toLowerCase();\n\n return keyWords.includes(text)\n ? new Token(tokens[text], text)\n : new Token(tokens.identifier, text);\n }", "title": "" }, { "docid": "c1d997189dd17d7d499670dcbc172cec", "score": "0.60625243", "text": "function generateId(tokens) {\n return _.map(tokens, normalize).join('_')\n }", "title": "" }, { "docid": "d529ecfa5a789b4eaba1be33199f851c", "score": "0.6033642", "text": "function nextWord(str) {\n var i, j;\n for (i = 0; i < str.length && !isAlphaDigit_(str[i]); i++) {\n // jump all non-identifier characters\n }\n j = i;\n for (; i < str.length && isAlphaDigit_(str[i]); i++) {\n // jump until non-identifier characters\n }\n return {\n word: str.slice(j, i),\n rest: str.slice(i)\n };\n}", "title": "" }, { "docid": "e9920432bda7343967e3d46c47735502", "score": "0.6030296", "text": "function makeId(str) {\n str = str || '_'\n let text = str + '-'\n for (let i = 0; i < 7; i++) {\n text += chars[Math.floor(Math.random() * chars.length)]\n }\n return text\n}", "title": "" }, { "docid": "9fec931eebd4558abc67c79758446516", "score": "0.6014985", "text": "function makeId(str) {\n str = str || '_';\n let text = str + '-';\n for (let i = 0; i < 7; i++) {\n text += chars[Math.floor(Math.random() * chars.length)];\n }\n return text\n }", "title": "" }, { "docid": "9bfabf982b62f6da76f2d6c869085e1a", "score": "0.5999515", "text": "function create_id(text){\n var text_no_num = text.replace(/[0-9]/g, ''),\n text_no_punctuation = text_no_num.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()?\\']/g,''),\n final_text = text_no_punctuation.trim();\n \n var a_lower_text = final_text.replace(/\\s+/g, '-').toLowerCase();\n return(a_lower_text);\n }", "title": "" }, { "docid": "9bfabf982b62f6da76f2d6c869085e1a", "score": "0.5999515", "text": "function create_id(text){\n var text_no_num = text.replace(/[0-9]/g, ''),\n text_no_punctuation = text_no_num.replace(/[.,\\/#!$%\\^&\\*;:{}=\\-_`~()?\\']/g,''),\n final_text = text_no_punctuation.trim();\n \n var a_lower_text = final_text.replace(/\\s+/g, '-').toLowerCase();\n return(a_lower_text);\n }", "title": "" }, { "docid": "819bed72d2fa5aaa1284194eddb86b4f", "score": "0.5921004", "text": "function generateVariableName(str) {\n return str.replace(/ /g, \"_\").toLowerCase();\n }", "title": "" }, { "docid": "d74f5a228a34307aa7e69f9891866878", "score": "0.58735836", "text": "nameToId(name) {\n return name\n .replace('&', 'and')\n .replace(/[ _]/g, '-')\n .replace(/[^A-Za-z0-9\\-]/g, '')\n .toLowerCase();\n }", "title": "" }, { "docid": "ac192f31eb377d7e6cfca66e847d97b4", "score": "0.5845628", "text": "function scanJsxIdentifier() {\n if (tokenIsIdentifierOrKeyword(token)) {\n var firstCharPosition = pos;\n while (pos < end) {\n var ch = text.charCodeAt(pos);\n if (ch === 45 /* minus */ || ((firstCharPosition === pos) ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) {\n pos++;\n }\n else {\n break;\n }\n }\n tokenValue += text.substr(firstCharPosition, pos - firstCharPosition);\n }\n return token;\n }", "title": "" }, { "docid": "d794667fb991e6d3e01cac0ff4a251e8", "score": "0.58436054", "text": "function CreateName(strIdent)\r\n{\r\n\r\n\t// Replace all white space with an empty string\r\n\tvar re = /\\s/g;\r\n\tstrIdent = strIdent.replace(re, \"\");\r\n\r\n\t// Replace high and low surrogates with empty string\r\n\tre = /[\\uD800-\\uDFFF]/g;\r\n\tstrIdent = strIdent.replace(re, \"\");\r\n\r\n\t// Check for empty string or identifier starting with a digit\r\n\tif (strIdent == \"\")\r\n\t\tstrIdent = \"My\";\r\n\telse if (strIdent.charAt(0) >= '0' && strIdent.charAt(0) <= '9')\r\n\t\tstrIdent = \"My\" + strIdent;\r\n\treturn strIdent;\r\n\r\n}", "title": "" }, { "docid": "c13c0d7a9e02f71532a8087dca64d6ce", "score": "0.5773455", "text": "function generateId(text) {\n return text.replace(/[ <>#\\/\\\\?&\\n]/g, '_');\n }", "title": "" }, { "docid": "a4e35f543e763db002c8a37fed7950c2", "score": "0.57637894", "text": "function parseIdent(liberal) {\n var node = startNode();\n if (liberal && options.forbidReserved == \"everywhere\") liberal = false;\n if (tokType === _name) {\n if (!liberal &&\n (options.forbidReserved &&\n (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(tokVal) ||\n strict && isStrictReservedWord(tokVal)) &&\n input.slice(tokStart, tokEnd).indexOf(\"\\\\\") == -1)\n raise(tokStart, \"The keyword '\" + tokVal + \"' is reserved\");\n node.name = tokVal;\n } else if (liberal && tokType.keyword) {\n node.name = tokType.keyword;\n } else {\n unexpected();\n }\n tokRegexpAllowed = false;\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "a4e35f543e763db002c8a37fed7950c2", "score": "0.57637894", "text": "function parseIdent(liberal) {\n var node = startNode();\n if (liberal && options.forbidReserved == \"everywhere\") liberal = false;\n if (tokType === _name) {\n if (!liberal &&\n (options.forbidReserved &&\n (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(tokVal) ||\n strict && isStrictReservedWord(tokVal)) &&\n input.slice(tokStart, tokEnd).indexOf(\"\\\\\") == -1)\n raise(tokStart, \"The keyword '\" + tokVal + \"' is reserved\");\n node.name = tokVal;\n } else if (liberal && tokType.keyword) {\n node.name = tokType.keyword;\n } else {\n unexpected();\n }\n tokRegexpAllowed = false;\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "c62197b0898c5d51841b703c54536054", "score": "0.5726784", "text": "function parseIdent(liberal) {\n\t var node = startNode();\n\t if (liberal && options.forbidReserved == \"everywhere\") liberal = false;\n\t if (tokType === _name) {\n\t if (!liberal && (options.forbidReserved && (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(tokVal) || strict && isStrictReservedWord(tokVal)) && input.slice(tokStart, tokEnd).indexOf(\"\\\\\") == -1) raise(tokStart, \"The keyword '\" + tokVal + \"' is reserved\");\n\t node.name = tokVal;\n\t } else if (liberal && tokType.keyword) {\n\t node.name = tokType.keyword;\n\t } else {\n\t unexpected();\n\t }\n\t next();\n\t return finishNode(node, \"Identifier\");\n\t }", "title": "" }, { "docid": "b14bb93379887791165c08da57dbe316", "score": "0.57260174", "text": "function parseIdent(liberal) {\n var node = startNode();\n node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected();\n tokRegexpAllowed = false;\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "b14bb93379887791165c08da57dbe316", "score": "0.57260174", "text": "function parseIdent(liberal) {\n var node = startNode();\n node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected();\n tokRegexpAllowed = false;\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "dfc4d97441f1181bb2079ab956fa88b1", "score": "0.5717152", "text": "function parseIdent(liberal) {\n var node = startNode();\n if (liberal && options.forbidReserved == \"everywhere\") liberal = false;\n if (tokType === _name) {\n if (!liberal &&\n (options.forbidReserved &&\n (options.ecmaVersion === 3 ? isReservedWord3 : isReservedWord5)(tokVal) ||\n strict && isStrictReservedWord(tokVal)) &&\n tokInput.slice(tokStart, tokEnd).indexOf(\"\\\\\") == -1)\n raise(tokStart, \"The keyword '\" + tokVal + \"' is reserved\");\n node.name = tokVal;\n } else if (liberal && tokType.keyword) {\n node.name = tokType.keyword;\n } else {\n unexpected();\n }\n tokRegexpAllowed = false;\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "d0da569455eefed3ba4fd579a61e1865", "score": "0.5716251", "text": "function getID(str) {\n var string = str.split('#')[1];\n if (string != undefined) {\n return {\n c1: string.substring(0, 6),\n c2: string.substring(6, 12),\n c3: string.substring(12, 18),\n c4: string.substring(18, 24),\n c5: string.substring(24, 30),\n };\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "4b6c6203a615d5300f4f284f10c313b5", "score": "0.57140195", "text": "function parseIdent(liberal) {\n var node = startNode();\n node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected();\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "4b6c6203a615d5300f4f284f10c313b5", "score": "0.57140195", "text": "function parseIdent(liberal) {\n var node = startNode();\n node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected();\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "4b6c6203a615d5300f4f284f10c313b5", "score": "0.57140195", "text": "function parseIdent(liberal) {\n var node = startNode();\n node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected();\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "4b6c6203a615d5300f4f284f10c313b5", "score": "0.57140195", "text": "function parseIdent(liberal) {\n var node = startNode();\n node.name = tokType === _name ? tokVal : (liberal && !options.forbidReserved && tokType.keyword) || unexpected();\n next();\n return finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "32f06858a38bb8b8b041585606eb297c", "score": "0.5710413", "text": "static isJsIdentifierPart(ch) {\n ch |= 0; //tell JIT that ch is an int\n return ch >= 97 && ch <= 122 //a-z\n || ch >= 65 && ch <= 90 //A-Z\n || ch >= 48 && ch <= 57 //0-9\n || ch === 95 //_\n || ch === 36 //$\n || ch > 127; //non-ASCII letter. Not accurate, but good enough for autocomplete\n }", "title": "" }, { "docid": "1fac0eb93e7610f8c843e460054cd1dc", "score": "0.567181", "text": "function quote_identifier_if_needed(txt) {\n if ( txt && !txt.match(/^[a-z_][a-z_0-9]*$/)) {\n return '\"' + txt.replace(/\\\"/g, '\"\"') + '\"';\n } else {\n return txt;\n }\n}", "title": "" }, { "docid": "fd3227553a0eab02f3d8e580198bc109", "score": "0.5642763", "text": "function _decamelize(str){return str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase()}", "title": "" }, { "docid": "4b9fe6f8fa12fd5c48761e66f4e133a2", "score": "0.5610031", "text": "static numberToIdentifer(n) {\n\t\t// lower case\n\t\tif(n < DELTA_A_TO_Z) return String.fromCharCode(START_LOWERCASE_ALPHABET_CODE + n);\n\n\t\t// upper case\n\t\tn -= DELTA_A_TO_Z;\n\t\tif(n < DELTA_A_TO_Z) return String.fromCharCode(START_UPPERCASE_ALPHABET_CODE + n);\n\n\t\t// fall back to _ + number\n\t\tn -= DELTA_A_TO_Z;\n\t\treturn \"_\" + n;\n\t}", "title": "" }, { "docid": "1c7ccdfbf232efe5f1c02260fbc76e8d", "score": "0.560528", "text": "function CreateASCIIName(strIdent)\r\n{\r\n\tvar i;\r\n\t// Convert any possible accented vowels, n's & c's\r\n\tvar replace = new Array('a', 'e', 'i', 'o', 'u', 'n', 'c', 'A', 'E', 'I', 'O', 'U', 'N', 'C');\r\n\tvar regexp = new Array(14);\r\n\tregexp[0] = /[\\u00aa\\u00e0\\u00e1\\u00e2\\u00e3\\u00e4\\u00e5\\u00e6\\u0101\\u0103\\u0105\\u01ce]/g;\r\n\tregexp[1] = /[\\u00e8\\u00e9\\u00ea\\u00eb\\u0113\\u0115\\u0117\\u0119\\u011b]/g;\r\n\tregexp[2] = /[\\u00ec\\u00ed\\u00ee\\u00ef\\u0129\\u012b\\u012d\\u012f\\u0131\\u01d0]/g;\r\n\tregexp[3] = /[\\u00ba\\u00f2\\u00f3\\u00f4\\u00f5\\u00f6\\u00f8\\u014d\\u014f\\u0151\\u0153\\u01a1\\u01d2]/g;\r\n\tregexp[4] = /[\\u00f9\\u00fa\\u00fb\\u00fc\\u0169\\u016b\\u016d\\u016f\\u0171\\u0173\\u01b0\\u01d4\\u01d6\\u01d8\\u01da\\u01dc]/g;\r\n\tregexp[5] = /[\\u00f1\\u0144\\u0146\\u0148]/g;\r\n\tregexp[6] = /[\\u00a2\\u00e7\\u0107\\u0109\\u010b\\u010d]/g;\r\n\tregexp[7] = /[\\u00c0\\u00c1\\u00c2\\u00c3\\u00c4\\u00c5\\u00c6\\u0100\\u0102\\u0104\\u01cd]/g;\r\n\tregexp[8] = /[\\u00c8\\u00c9\\u00ca\\u00cb\\u0112\\u0114\\u0116\\u0118\\u011a]/g;\r\n\tregexp[9] = /[\\u00cc\\u00cd\\u00ce\\u00cf\\u0128\\u012a\\u012c\\u012e\\u0130\\u01cf]/g;\r\n\tregexp[10] = /[\\u00d2\\u00d3\\u00d4\\u00d5\\u00d6\\u00d8\\u014c\\u014e\\u0150\\u0152\\u01a0\\u01d1]/g;\r\n\tregexp[11] = /[\\u00d9\\u00da\\u00db\\u00dc\\u0168\\u016a\\u016c\\u016e\\u0170\\u0172\\u01af\\u01d3\\u01d5\\u01d7\\u01d9\\u01db]/g;\r\n\tregexp[12] = /[\\u00d1\\u0143\\u0145\\u0147]/g;\r\n\tregexp[13] = /[\\u00a9\\u00c7\\u0106\\u0108\\u010a\\u010c]/g;\r\n\r\n\tfor (i = 0; i < 14; i++)\r\n\t\tstrIdent = strIdent.replace(regexp[i], replace[i]);\r\n\r\n\t// Replace all non [a-zA-Z0-9] characters with empty string\r\n\tvar re = /\\W/g;\r\n\tstrIdent = strIdent.replace(re, \"\");\r\n\r\n\t// Check for empty string or identifier starting with a digit\r\n\tif (strIdent == \"\")\r\n\t\tstrIdent = \"My\";\r\n\telse if (strIdent.charAt(0) >= '0' && strIdent.charAt(0) <= '9')\r\n\t\tstrIdent = \"My\" + strIdent;\r\n\treturn strIdent;\r\n\r\n}", "title": "" }, { "docid": "68bf557f0a6d7236e04b494885e621c0", "score": "0.55976284", "text": "function quoteIdentifierIfNeeded (txt) {\n if (txt && !txt.match(/^[a-z_][a-z_0-9]*$/)) {\n return '\"' + txt.replace(/\"/g, '\"\"') + '\"';\n } else {\n return txt;\n }\n}", "title": "" }, { "docid": "b4eea8c97788725952795b8aefd467ea", "score": "0.5588165", "text": "parseIdentifier(liberal) {\n const node = this.startNode();\n const name = this.parseIdentifierName(node.start, liberal);\n node.name = name;\n node.loc.identifierName = name;\n return this.finishNode(node, \"Identifier\");\n }", "title": "" }, { "docid": "6c4ddfd13c7452615efd6c06d52c66af", "score": "0.5573022", "text": "function define(style, string) {\n var split = string.split(' ');\n for (var i = 0; i < split.length; i++) {\n words[split[i]] = style;\n }\n }", "title": "" }, { "docid": "6c4ddfd13c7452615efd6c06d52c66af", "score": "0.5573022", "text": "function define(style, string) {\n var split = string.split(' ');\n for (var i = 0; i < split.length; i++) {\n words[split[i]] = style;\n }\n }", "title": "" }, { "docid": "ce66221d0aa63ee4e4bf793e53963baa", "score": "0.557284", "text": "function get_the_ID_by_name(the_name = \"\") {\n the_name = the_name.replaceAll(\"-\", \" \");\n the_name = the_name.replaceAll(\")\", \" \");\n the_name = the_name.replaceAll(\"(\", \" \");\n the_name = the_name.replaceAll(\"[\", \" \");\n the_name = the_name.replaceAll(\"]\", \" \");\n\n var s = the_name.split(\" \");\n var finalName = \"\";\n s.forEach((el) => {\n if (el != \"\") {\n if (hasNumbers(el)) {\n finalName += el;\n } else if (isNaN(parseInt(el))) {\n finalName += el[0];\n } else {\n finalName += el;\n }\n }\n });\n return finalName;\n}", "title": "" }, { "docid": "32bfffe64450a2280ad9ca618404ce7b", "score": "0.5553377", "text": "function identifier(){\n return '[$A-Z\\\\_a-z\\\\xaa\\\\xb5\\\\xba\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\u02c1\\\\u02c6-\\\\u02d1\\\\u\\\n 02e0-\\\\u02e4\\\\u02ec\\\\u02ee\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037a-\\\\u037d\\\\u0386\\\\u\\\n 0388-\\\\u038a\\\\u038c\\\\u038e-\\\\u03a1\\\\u03a3-\\\\u03f5\\\\u03f7-\\\\u0481\\\\u048a-\\\\u0527\\\n \\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05d0-\\\\u05ea\\\\u05f0-\\\\u05f2\\\\u0620-\\\\u064\\\n a\\\\u066e\\\\u066f\\\\u0671-\\\\u06d3\\\\u06d5\\\\u06e5\\\\u06e6\\\\u06ee\\\\u06ef\\\\u06fa-\\\\u06fc\\\n \\\\u06ff\\\\u0710\\\\u0712-\\\\u072f\\\\u074d-\\\\u07a5\\\\u07b1\\\\u07ca-\\\\u07ea\\\\u07f4\\\\u07f5\\\n \\\\u07fa\\\\u0800-\\\\u0815\\\\u081a\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08a0\\\\u08a2-\\\\u08ac\\\n \\\\u0904-\\\\u0939\\\\u093d\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0977\\\\u0979-\\\\u097f\\\\u098\\\n 5-\\\\u098c\\\\u098f\\\\u0990\\\\u0993-\\\\u09a8\\\\u09aa-\\\\u09b0\\\\u09b2\\\\u09b6-\\\\u09b9\\\\u09\\\n bd\\\\u09ce\\\\u09dc\\\\u09dd\\\\u09df-\\\\u09e1\\\\u09f0\\\\u09f1\\\\u0a05-\\\\u0a0a\\\\u0a0f\\\\u0a1\\\n 0\\\\u0a13-\\\\u0a28\\\\u0a2a-\\\\u0a30\\\\u0a32\\\\u0a33\\\\u0a35\\\\u0a36\\\\u0a38\\\\u0a39\\\\u0a59\\\n -\\\\u0a5c\\\\u0a5e\\\\u0a72-\\\\u0a74\\\\u0a85-\\\\u0a8d\\\\u0a8f-\\\\u0a91\\\\u0a93-\\\\u0aa8\\\\u0a\\\n aa-\\\\u0ab0\\\\u0ab2\\\\u0ab3\\\\u0ab5-\\\\u0ab9\\\\u0abd\\\\u0ad0\\\\u0ae0\\\\u0ae1\\\\u0b05-\\\\u0b\\\n 0c\\\\u0b0f\\\\u0b10\\\\u0b13-\\\\u0b28\\\\u0b2a-\\\\u0b30\\\\u0b32\\\\u0b33\\\\u0b35-\\\\u0b39\\\\u0b\\\n 3d\\\\u0b5c\\\\u0b5d\\\\u0b5f-\\\\u0b61\\\\u0b71\\\\u0b83\\\\u0b85-\\\\u0b8a\\\\u0b8e-\\\\u0b90\\\\u0b\\\n 92-\\\\u0b95\\\\u0b99\\\\u0b9a\\\\u0b9c\\\\u0b9e\\\\u0b9f\\\\u0ba3\\\\u0ba4\\\\u0ba8-\\\\u0baa\\\\u0ba\\\n e-\\\\u0bb9\\\\u0bd0\\\\u0c05-\\\\u0c0c\\\\u0c0e-\\\\u0c10\\\\u0c12-\\\\u0c28\\\\u0c2a-\\\\u0c33\\\\u0\\\n c35-\\\\u0c39\\\\u0c3d\\\\u0c58\\\\u0c59\\\\u0c60\\\\u0c61\\\\u0c85-\\\\u0c8c\\\\u0c8e-\\\\u0c90\\\\u0\\\n c92-\\\\u0ca8\\\\u0caa-\\\\u0cb3\\\\u0cb5-\\\\u0cb9\\\\u0cbd\\\\u0cde\\\\u0ce0\\\\u0ce1\\\\u0cf1\\\\u0\\\n cf2\\\\u0d05-\\\\u0d0c\\\\u0d0e-\\\\u0d10\\\\u0d12-\\\\u0d3a\\\\u0d3d\\\\u0d4e\\\\u0d60\\\\u0d61\\\\u0\\\n d7a-\\\\u0d7f\\\\u0d85-\\\\u0d96\\\\u0d9a-\\\\u0db1\\\\u0db3-\\\\u0dbb\\\\u0dbd\\\\u0dc0-\\\\u0dc6\\\\\\\n u0e01-\\\\u0e30\\\\u0e32\\\\u0e33\\\\u0e40-\\\\u0e46\\\\u0e81\\\\u0e82\\\\u0e84\\\\u0e87\\\\u0e88\\\\u\\\n 0e8a\\\\u0e8d\\\\u0e94-\\\\u0e97\\\\u0e99-\\\\u0e9f\\\\u0ea1-\\\\u0ea3\\\\u0ea5\\\\u0ea7\\\\u0eaa\\\\u\\\n 0eab\\\\u0ead-\\\\u0eb0\\\\u0eb2\\\\u0eb3\\\\u0ebd\\\\u0ec0-\\\\u0ec4\\\\u0ec6\\\\u0edc-\\\\u0edf\\\\u\\\n 0f00\\\\u0f40-\\\\u0f47\\\\u0f49-\\\\u0f6c\\\\u0f88-\\\\u0f8c\\\\u1000-\\\\u102a\\\\u103f\\\\u1050-\\\n \\\\u1055\\\\u105a-\\\\u105d\\\\u1061\\\\u1065\\\\u1066\\\\u106e-\\\\u1070\\\\u1075-\\\\u1081\\\\u108e\\\n \\\\u10a0-\\\\u10c5\\\\u10c7\\\\u10cd\\\\u10d0-\\\\u10fa\\\\u10fc-\\\\u1248\\\\u124a-\\\\u124d\\\\u1250\\\n -\\\\u1256\\\\u1258\\\\u125a-\\\\u125d\\\\u1260-\\\\u1288\\\\u128a-\\\\u128d\\\\u1290-\\\\u12b0\\\\u12\\\n b2-\\\\u12b5\\\\u12b8-\\\\u12be\\\\u12c0\\\\u12c2-\\\\u12c5\\\\u12c8-\\\\u12d6\\\\u12d8-\\\\u1310\\\\u\\\n 1312-\\\\u1315\\\\u1318-\\\\u135a\\\\u1380-\\\\u138f\\\\u13a0-\\\\u13f4\\\\u1401-\\\\u166c\\\\u166f-\\\n \\\\u167f\\\\u1681-\\\\u169a\\\\u16a0-\\\\u16ea\\\\u16ee-\\\\u16f0\\\\u1700-\\\\u170c\\\\u170e-\\\\u17\\\n 11\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176c\\\\u176e-\\\\u1770\\\\u1780-\\\\u17b3\\\\u\\\n 17d7\\\\u17dc\\\\u1820-\\\\u1877\\\\u1880-\\\\u18a8\\\\u18aa\\\\u18b0-\\\\u18f5\\\\u1900-\\\\u191c\\\\\\\n u1950-\\\\u196d\\\\u1970-\\\\u1974\\\\u1980-\\\\u19ab\\\\u19c1-\\\\u19c7\\\\u1a00-\\\\u1a16\\\\u1a20\\\n -\\\\u1a54\\\\u1aa7\\\\u1b05-\\\\u1b33\\\\u1b45-\\\\u1b4b\\\\u1b83-\\\\u1ba0\\\\u1bae\\\\u1baf\\\\u1bb\\\n a-\\\\u1be5\\\\u1c00-\\\\u1c23\\\\u1c4d-\\\\u1c4f\\\\u1c5a-\\\\u1c7d\\\\u1ce9-\\\\u1cec\\\\u1cee-\\\\u\\\n 1cf1\\\\u1cf5\\\\u1cf6\\\\u1d00-\\\\u1dbf\\\\u1e00-\\\\u1f15\\\\u1f18-\\\\u1f1d\\\\u1f20-\\\\u1f45\\\\\\\n u1f48-\\\\u1f4d\\\\u1f50-\\\\u1f57\\\\u1f59\\\\u1f5b\\\\u1f5d\\\\u1f5f-\\\\u1f7d\\\\u1f80-\\\\u1fb4\\\n \\\\u1fb6-\\\\u1fbc\\\\u1fbe\\\\u1fc2-\\\\u1fc4\\\\u1fc6-\\\\u1fcc\\\\u1fd0-\\\\u1fd3\\\\u1fd6-\\\\u1fd\\\n b\\\\u1fe0-\\\\u1fec\\\\u1ff2-\\\\u1ff4\\\\u1ff6-\\\\u1ffc\\\\u2071\\\\u207f\\\\u2090-\\\\u209c\\\\u21\\\n 02\\\\u2107\\\\u210a-\\\\u2113\\\\u2115\\\\u2119-\\\\u211d\\\\u2124\\\\u2126\\\\u2128\\\\u212a-\\\\u21\\\n 2d\\\\u212f-\\\\u2139\\\\u213c-\\\\u213f\\\\u2145-\\\\u2149\\\\u214e\\\\u2160-\\\\u2188\\\\u2c00-\\\\u\\\n 2c2e\\\\u2c30-\\\\u2c5e\\\\u2c60-\\\\u2ce4\\\\u2ceb-\\\\u2cee\\\\u2cf2\\\\u2cf3\\\\u2d00-\\\\u2d25\\\\\\\n u2d27\\\\u2d2d\\\\u2d30-\\\\u2d67\\\\u2d6f\\\\u2d80-\\\\u2d96\\\\u2da0-\\\\u2da6\\\\u2da8-\\\\u2dae\\\n \\\\u2db0-\\\\u2db6\\\\u2db8-\\\\u2dbe\\\\u2dc0-\\\\u2dc6\\\\u2dc8-\\\\u2dce\\\\u2dd0-\\\\u2dd6\\\\u2dd\\\n 8-\\\\u2dde\\\\u2e2f\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303c\\\\u3\\\n 041-\\\\u3096\\\\u309d-\\\\u309f\\\\u30a1-\\\\u30fa\\\\u30fc-\\\\u30ff\\\\u3105-\\\\u312d\\\\u3131-\\\n \\\\u318e\\\\u31a0-\\\\u31ba\\\\u31f0-\\\\u31ff\\\\u3400-\\\\u4db5\\\\u4e00-\\\\u9fcc\\\\ua000-\\\\ua48\\\n c\\\\ua4d0-\\\\ua4fd\\\\ua500-\\\\ua60c\\\\ua610-\\\\ua61f\\\\ua62a\\\\ua62b\\\\ua640-\\\\ua66e\\\\ua6\\\n 7f-\\\\ua697\\\\ua6a0-\\\\ua6ef\\\\ua717-\\\\ua71f\\\\ua722-\\\\ua788\\\\ua78b-\\\\ua78e\\\\ua790-\\\\\\\n ua793\\\\ua7a0-\\\\ua7aa\\\\ua7f8-\\\\ua801\\\\ua803-\\\\ua805\\\\ua807-\\\\ua80a\\\\ua80c-\\\\ua822\\\n \\\\ua840-\\\\ua873\\\\ua882-\\\\ua8b3\\\\ua8f2-\\\\ua8f7\\\\ua8fb\\\\ua90a-\\\\ua925\\\\ua930-\\\\ua9\\\n 46\\\\ua960-\\\\ua97c\\\\ua984-\\\\ua9b2\\\\ua9cf\\\\uaa00-\\\\uaa28\\\\uaa40-\\\\uaa42\\\\uaa44-\\\\u\\\n aa4b\\\\uaa60-\\\\uaa76\\\\uaa7a\\\\uaa80-\\\\uaaaf\\\\uaab1\\\\uaab5\\\\uaab6\\\\uaab9-\\\\uaabd\\\\u\\\n aac0\\\\uaac2\\\\uaadb-\\\\uaadd\\\\uaae0-\\\\uaaea\\\\uaaf2-\\\\uaaf4\\\\uab01-\\\\uab06\\\\uab09-\\\n \\\\uab0e\\\\uab11-\\\\uab16\\\\uab20-\\\\uab26\\\\uab28-\\\\uab2e\\\\uabc0-\\\\uabe2\\\\uac00-\\\\ud7a\\\n 3\\\\ud7b0-\\\\ud7c6\\\\ud7cb-\\\\ud7fb\\\\uf900-\\\\ufa6d\\\\ufa70-\\\\ufad9\\\\ufb00-\\\\ufb06\\\\uf\\\n b13-\\\\ufb17\\\\ufb1d\\\\ufb1f-\\\\ufb28\\\\ufb2a-\\\\ufb36\\\\ufb38-\\\\ufb3c\\\\ufb3e\\\\ufb40\\\\u\\\n fb41\\\\ufb43\\\\ufb44\\\\ufb46-\\\\ufbb1\\\\ufbd3-\\\\ufd3d\\\\ufd50-\\\\ufd8f\\\\ufd92-\\\\ufdc7\\\\\\\n ufdf0-\\\\ufdfb\\\\ufe70-\\\\ufe74\\\\ufe76-\\\\ufefc\\\\uff21-\\\\uff3a\\\\uff41-\\\\uff5a\\\\uff66\\\n -\\\\uffbe\\\\uffc2-\\\\uffc7\\\\uffca-\\\\uffcf\\\\uffd2-\\\\uffd7\\\\uffda-\\\\uffdc][$A-Z\\\\_a-z\\\n \\\\xaa\\\\xb5\\\\xba\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\u02c1\\\\u02c6-\\\\u02d1\\\\u02e0-\\\\u02e4\\\n \\\\u02ec\\\\u02ee\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037a-\\\\u037d\\\\u0386\\\\u0388-\\\\u038a\\\n \\\\u038c\\\\u038e-\\\\u03a1\\\\u03a3-\\\\u03f5\\\\u03f7-\\\\u0481\\\\u048a-\\\\u0527\\\\u0531-\\\\u05\\\n 56\\\\u0559\\\\u0561-\\\\u0587\\\\u05d0-\\\\u05ea\\\\u05f0-\\\\u05f2\\\\u0620-\\\\u064a\\\\u066e\\\\u0\\\n 66f\\\\u0671-\\\\u06d3\\\\u06d5\\\\u06e5\\\\u06e6\\\\u06ee\\\\u06ef\\\\u06fa-\\\\u06fc\\\\u06ff\\\\u07\\\n 10\\\\u0712-\\\\u072f\\\\u074d-\\\\u07a5\\\\u07b1\\\\u07ca-\\\\u07ea\\\\u07f4\\\\u07f5\\\\u07fa\\\\u08\\\n 00-\\\\u0815\\\\u081a\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08a0\\\\u08a2-\\\\u08ac\\\\u0904-\\\\u0\\\n 939\\\\u093d\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0977\\\\u0979-\\\\u097f\\\\u0985-\\\\u098c\\\\u\\\n 098f\\\\u0990\\\\u0993-\\\\u09a8\\\\u09aa-\\\\u09b0\\\\u09b2\\\\u09b6-\\\\u09b9\\\\u09bd\\\\u09ce\\\\u\\\n 09dc\\\\u09dd\\\\u09df-\\\\u09e1\\\\u09f0\\\\u09f1\\\\u0a05-\\\\u0a0a\\\\u0a0f\\\\u0a10\\\\u0a13-\\\\u\\\n 0a28\\\\u0a2a-\\\\u0a30\\\\u0a32\\\\u0a33\\\\u0a35\\\\u0a36\\\\u0a38\\\\u0a39\\\\u0a59-\\\\u0a5c\\\\u0\\\n a5e\\\\u0a72-\\\\u0a74\\\\u0a85-\\\\u0a8d\\\\u0a8f-\\\\u0a91\\\\u0a93-\\\\u0aa8\\\\u0aaa-\\\\u0ab0\\\\\\\n u0ab2\\\\u0ab3\\\\u0ab5-\\\\u0ab9\\\\u0abd\\\\u0ad0\\\\u0ae0\\\\u0ae1\\\\u0b05-\\\\u0b0c\\\\u0b0f\\\\u\\\n 0b10\\\\u0b13-\\\\u0b28\\\\u0b2a-\\\\u0b30\\\\u0b32\\\\u0b33\\\\u0b35-\\\\u0b39\\\\u0b3d\\\\u0b5c\\\\u\\\n 0b5d\\\\u0b5f-\\\\u0b61\\\\u0b71\\\\u0b83\\\\u0b85-\\\\u0b8a\\\\u0b8e-\\\\u0b90\\\\u0b92-\\\\u0b95\\\\\\\n u0b99\\\\u0b9a\\\\u0b9c\\\\u0b9e\\\\u0b9f\\\\u0ba3\\\\u0ba4\\\\u0ba8-\\\\u0baa\\\\u0bae-\\\\u0bb9\\\\u\\\n 0bd0\\\\u0c05-\\\\u0c0c\\\\u0c0e-\\\\u0c10\\\\u0c12-\\\\u0c28\\\\u0c2a-\\\\u0c33\\\\u0c35-\\\\u0c39\\\n \\\\u0c3d\\\\u0c58\\\\u0c59\\\\u0c60\\\\u0c61\\\\u0c85-\\\\u0c8c\\\\u0c8e-\\\\u0c90\\\\u0c92-\\\\u0ca8\\\n \\\\u0caa-\\\\u0cb3\\\\u0cb5-\\\\u0cb9\\\\u0cbd\\\\u0cde\\\\u0ce0\\\\u0ce1\\\\u0cf1\\\\u0cf2\\\\u0d05-\\\n \\\\u0d0c\\\\u0d0e-\\\\u0d10\\\\u0d12-\\\\u0d3a\\\\u0d3d\\\\u0d4e\\\\u0d60\\\\u0d61\\\\u0d7a-\\\\u0d7f\\\n \\\\u0d85-\\\\u0d96\\\\u0d9a-\\\\u0db1\\\\u0db3-\\\\u0dbb\\\\u0dbd\\\\u0dc0-\\\\u0dc6\\\\u0e01-\\\\u0e3\\\n 0\\\\u0e32\\\\u0e33\\\\u0e40-\\\\u0e46\\\\u0e81\\\\u0e82\\\\u0e84\\\\u0e87\\\\u0e88\\\\u0e8a\\\\u0e8d\\\n \\\\u0e94-\\\\u0e97\\\\u0e99-\\\\u0e9f\\\\u0ea1-\\\\u0ea3\\\\u0ea5\\\\u0ea7\\\\u0eaa\\\\u0eab\\\\u0ead-\\\n \\\\u0eb0\\\\u0eb2\\\\u0eb3\\\\u0ebd\\\\u0ec0-\\\\u0ec4\\\\u0ec6\\\\u0edc-\\\\u0edf\\\\u0f00\\\\u0f40-\\\n \\\\u0f47\\\\u0f49-\\\\u0f6c\\\\u0f88-\\\\u0f8c\\\\u1000-\\\\u102a\\\\u103f\\\\u1050-\\\\u1055\\\\u105\\\n a-\\\\u105d\\\\u1061\\\\u1065\\\\u1066\\\\u106e-\\\\u1070\\\\u1075-\\\\u1081\\\\u108e\\\\u10a0-\\\\u10\\\n c5\\\\u10c7\\\\u10cd\\\\u10d0-\\\\u10fa\\\\u10fc-\\\\u1248\\\\u124a-\\\\u124d\\\\u1250-\\\\u1256\\\\u1\\\n 258\\\\u125a-\\\\u125d\\\\u1260-\\\\u1288\\\\u128a-\\\\u128d\\\\u1290-\\\\u12b0\\\\u12b2-\\\\u12b5\\\\\\\n u12b8-\\\\u12be\\\\u12c0\\\\u12c2-\\\\u12c5\\\\u12c8-\\\\u12d6\\\\u12d8-\\\\u1310\\\\u1312-\\\\u1315\\\n \\\\u1318-\\\\u135a\\\\u1380-\\\\u138f\\\\u13a0-\\\\u13f4\\\\u1401-\\\\u166c\\\\u166f-\\\\u167f\\\\u16\\\n 81-\\\\u169a\\\\u16a0-\\\\u16ea\\\\u16ee-\\\\u16f0\\\\u1700-\\\\u170c\\\\u170e-\\\\u1711\\\\u1720-\\\\\\\n u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176c\\\\u176e-\\\\u1770\\\\u1780-\\\\u17b3\\\\u17d7\\\\u17dc\\\n \\\\u1820-\\\\u1877\\\\u1880-\\\\u18a8\\\\u18aa\\\\u18b0-\\\\u18f5\\\\u1900-\\\\u191c\\\\u1950-\\\\u196\\\n d\\\\u1970-\\\\u1974\\\\u1980-\\\\u19ab\\\\u19c1-\\\\u19c7\\\\u1a00-\\\\u1a16\\\\u1a20-\\\\u1a54\\\\u1\\\n aa7\\\\u1b05-\\\\u1b33\\\\u1b45-\\\\u1b4b\\\\u1b83-\\\\u1ba0\\\\u1bae\\\\u1baf\\\\u1bba-\\\\u1be5\\\\u\\\n 1c00-\\\\u1c23\\\\u1c4d-\\\\u1c4f\\\\u1c5a-\\\\u1c7d\\\\u1ce9-\\\\u1cec\\\\u1cee-\\\\u1cf1\\\\u1cf5\\\n \\\\u1cf6\\\\u1d00-\\\\u1dbf\\\\u1e00-\\\\u1f15\\\\u1f18-\\\\u1f1d\\\\u1f20-\\\\u1f45\\\\u1f48-\\\\u1f4\\\n d\\\\u1f50-\\\\u1f57\\\\u1f59\\\\u1f5b\\\\u1f5d\\\\u1f5f-\\\\u1f7d\\\\u1f80-\\\\u1fb4\\\\u1fb6-\\\\u1f\\\n bc\\\\u1fbe\\\\u1fc2-\\\\u1fc4\\\\u1fc6-\\\\u1fcc\\\\u1fd0-\\\\u1fd3\\\\u1fd6-\\\\u1fdb\\\\u1fe0-\\\\u\\\n 1fec\\\\u1ff2-\\\\u1ff4\\\\u1ff6-\\\\u1ffc\\\\u2071\\\\u207f\\\\u2090-\\\\u209c\\\\u2102\\\\u2107\\\\u\\\n 210a-\\\\u2113\\\\u2115\\\\u2119-\\\\u211d\\\\u2124\\\\u2126\\\\u2128\\\\u212a-\\\\u212d\\\\u212f-\\\\\\\n u2139\\\\u213c-\\\\u213f\\\\u2145-\\\\u2149\\\\u214e\\\\u2160-\\\\u2188\\\\u2c00-\\\\u2c2e\\\\u2c30-\\\n \\\\u2c5e\\\\u2c60-\\\\u2ce4\\\\u2ceb-\\\\u2cee\\\\u2cf2\\\\u2cf3\\\\u2d00-\\\\u2d25\\\\u2d27\\\\u2d2d\\\n \\\\u2d30-\\\\u2d67\\\\u2d6f\\\\u2d80-\\\\u2d96\\\\u2da0-\\\\u2da6\\\\u2da8-\\\\u2dae\\\\u2db0-\\\\u2d\\\n b6\\\\u2db8-\\\\u2dbe\\\\u2dc0-\\\\u2dc6\\\\u2dc8-\\\\u2dce\\\\u2dd0-\\\\u2dd6\\\\u2dd8-\\\\u2dde\\\\u\\\n 2e2f\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303c\\\\u3041-\\\\u3096\\\n \\\\u309d-\\\\u309f\\\\u30a1-\\\\u30fa\\\\u30fc-\\\\u30ff\\\\u3105-\\\\u312d\\\\u3131-\\\\u318e\\\\u31a\\\n 0-\\\\u31ba\\\\u31f0-\\\\u31ff\\\\u3400-\\\\u4db5\\\\u4e00-\\\\u9fcc\\\\ua000-\\\\ua48c\\\\ua4d0-\\\\u\\\n a4fd\\\\ua500-\\\\ua60c\\\\ua610-\\\\ua61f\\\\ua62a\\\\ua62b\\\\ua640-\\\\ua66e\\\\ua67f-\\\\ua697\\\\\\\n ua6a0-\\\\ua6ef\\\\ua717-\\\\ua71f\\\\ua722-\\\\ua788\\\\ua78b-\\\\ua78e\\\\ua790-\\\\ua793\\\\ua7a0\\\n -\\\\ua7aa\\\\ua7f8-\\\\ua801\\\\ua803-\\\\ua805\\\\ua807-\\\\ua80a\\\\ua80c-\\\\ua822\\\\ua840-\\\\ua\\\n 873\\\\ua882-\\\\ua8b3\\\\ua8f2-\\\\ua8f7\\\\ua8fb\\\\ua90a-\\\\ua925\\\\ua930-\\\\ua946\\\\ua960-\\\\\\\n ua97c\\\\ua984-\\\\ua9b2\\\\ua9cf\\\\uaa00-\\\\uaa28\\\\uaa40-\\\\uaa42\\\\uaa44-\\\\uaa4b\\\\uaa60-\\\n \\\\uaa76\\\\uaa7a\\\\uaa80-\\\\uaaaf\\\\uaab1\\\\uaab5\\\\uaab6\\\\uaab9-\\\\uaabd\\\\uaac0\\\\uaac2\\\n \\\\uaadb-\\\\uaadd\\\\uaae0-\\\\uaaea\\\\uaaf2-\\\\uaaf4\\\\uab01-\\\\uab06\\\\uab09-\\\\uab0e\\\\uab1\\\n 1-\\\\uab16\\\\uab20-\\\\uab26\\\\uab28-\\\\uab2e\\\\uabc0-\\\\uabe2\\\\uac00-\\\\ud7a3\\\\ud7b0-\\\\u\\\n d7c6\\\\ud7cb-\\\\ud7fb\\\\uf900-\\\\ufa6d\\\\ufa70-\\\\ufad9\\\\ufb00-\\\\ufb06\\\\ufb13-\\\\ufb17\\\n \\\\ufb1d\\\\ufb1f-\\\\ufb28\\\\ufb2a-\\\\ufb36\\\\ufb38-\\\\ufb3c\\\\ufb3e\\\\ufb40\\\\ufb41\\\\ufb43\\\n \\\\ufb44\\\\ufb46-\\\\ufbb1\\\\ufbd3-\\\\ufd3d\\\\ufd50-\\\\ufd8f\\\\ufd92-\\\\ufdc7\\\\ufdf0-\\\\ufdf\\\n b\\\\ufe70-\\\\ufe74\\\\ufe76-\\\\ufefc\\\\uff21-\\\\uff3a\\\\uff41-\\\\uff5a\\\\uff66-\\\\uffbe\\\\uf\\\n fc2-\\\\uffc7\\\\uffca-\\\\uffcf\\\\uffd2-\\\\uffd7\\\\uffda-\\\\uffdc0-9\\\\u0300-\\\\u036f\\\\u048\\\n 3-\\\\u0487\\\\u0591-\\\\u05bd\\\\u05bf\\\\u05c1\\\\u05c2\\\\u05c4\\\\u05c5\\\\u05c7\\\\u0610-\\\\u061\\\n a\\\\u064b-\\\\u0669\\\\u0670\\\\u06d6-\\\\u06dc\\\\u06df-\\\\u06e4\\\\u06e7\\\\u06e8\\\\u06ea-\\\\u06\\\n ed\\\\u06f0-\\\\u06f9\\\\u0711\\\\u0730-\\\\u074a\\\\u07a6-\\\\u07b0\\\\u07c0-\\\\u07c9\\\\u07eb-\\\\u\\\n 07f3\\\\u0816-\\\\u0819\\\\u081b-\\\\u0823\\\\u0825-\\\\u0827\\\\u0829-\\\\u082d\\\\u0859-\\\\u085b\\\n \\\\u08e4-\\\\u08fe\\\\u0900-\\\\u0903\\\\u093a-\\\\u093c\\\\u093e-\\\\u094f\\\\u0951-\\\\u0957\\\\u096\\\n 2\\\\u0963\\\\u0966-\\\\u096f\\\\u0981-\\\\u0983\\\\u09bc\\\\u09be-\\\\u09c4\\\\u09c7\\\\u09c8\\\\u09c\\\n b-\\\\u09cd\\\\u09d7\\\\u09e2\\\\u09e3\\\\u09e6-\\\\u09ef\\\\u0a01-\\\\u0a03\\\\u0a3c\\\\u0a3e-\\\\u0a\\\n 42\\\\u0a47\\\\u0a48\\\\u0a4b-\\\\u0a4d\\\\u0a51\\\\u0a66-\\\\u0a71\\\\u0a75\\\\u0a81-\\\\u0a83\\\\u0a\\\n bc\\\\u0abe-\\\\u0ac5\\\\u0ac7-\\\\u0ac9\\\\u0acb-\\\\u0acd\\\\u0ae2\\\\u0ae3\\\\u0ae6-\\\\u0aef\\\\u0\\\n b01-\\\\u0b03\\\\u0b3c\\\\u0b3e-\\\\u0b44\\\\u0b47\\\\u0b48\\\\u0b4b-\\\\u0b4d\\\\u0b56\\\\u0b57\\\\u0\\\n b62\\\\u0b63\\\\u0b66-\\\\u0b6f\\\\u0b82\\\\u0bbe-\\\\u0bc2\\\\u0bc6-\\\\u0bc8\\\\u0bca-\\\\u0bcd\\\\u\\\n 0bd7\\\\u0be6-\\\\u0bef\\\\u0c01-\\\\u0c03\\\\u0c3e-\\\\u0c44\\\\u0c46-\\\\u0c48\\\\u0c4a-\\\\u0c4d\\\n \\\\u0c55\\\\u0c56\\\\u0c62\\\\u0c63\\\\u0c66-\\\\u0c6f\\\\u0c82\\\\u0c83\\\\u0cbc\\\\u0cbe-\\\\u0cc4\\\\\\\n u0cc6-\\\\u0cc8\\\\u0cca-\\\\u0ccd\\\\u0cd5\\\\u0cd6\\\\u0ce2\\\\u0ce3\\\\u0ce6-\\\\u0cef\\\\u0d02\\\\\\\n u0d03\\\\u0d3e-\\\\u0d44\\\\u0d46-\\\\u0d48\\\\u0d4a-\\\\u0d4d\\\\u0d57\\\\u0d62\\\\u0d63\\\\u0d66-\\\n \\\\u0d6f\\\\u0d82\\\\u0d83\\\\u0dca\\\\u0dcf-\\\\u0dd4\\\\u0dd6\\\\u0dd8-\\\\u0ddf\\\\u0df2\\\\u0df3\\\\\\\n u0e31\\\\u0e34-\\\\u0e3a\\\\u0e47-\\\\u0e4e\\\\u0e50-\\\\u0e59\\\\u0eb1\\\\u0eb4-\\\\u0eb9\\\\u0ebb\\\n \\\\u0ebc\\\\u0ec8-\\\\u0ecd\\\\u0ed0-\\\\u0ed9\\\\u0f18\\\\u0f19\\\\u0f20-\\\\u0f29\\\\u0f35\\\\u0f37\\\n \\\\u0f39\\\\u0f3e\\\\u0f3f\\\\u0f71-\\\\u0f84\\\\u0f86\\\\u0f87\\\\u0f8d-\\\\u0f97\\\\u0f99-\\\\u0fbc\\\n \\\\u0fc6\\\\u102b-\\\\u103e\\\\u1040-\\\\u1049\\\\u1056-\\\\u1059\\\\u105e-\\\\u1060\\\\u1062-\\\\u106\\\n 4\\\\u1067-\\\\u106d\\\\u1071-\\\\u1074\\\\u1082-\\\\u108d\\\\u108f-\\\\u109d\\\\u135d-\\\\u135f\\\\u1\\\n 712-\\\\u1714\\\\u1732-\\\\u1734\\\\u1752\\\\u1753\\\\u1772\\\\u1773\\\\u17b4-\\\\u17d3\\\\u17dd\\\\u1\\\n 7e0-\\\\u17e9\\\\u180b-\\\\u180d\\\\u1810-\\\\u1819\\\\u18a9\\\\u1920-\\\\u192b\\\\u1930-\\\\u193b\\\\\\\n u1946-\\\\u194f\\\\u19b0-\\\\u19c0\\\\u19c8\\\\u19c9\\\\u19d0-\\\\u19d9\\\\u1a17-\\\\u1a1b\\\\u1a55-\\\n \\\\u1a5e\\\\u1a60-\\\\u1a7c\\\\u1a7f-\\\\u1a89\\\\u1a90-\\\\u1a99\\\\u1b00-\\\\u1b04\\\\u1b34-\\\\u1b\\\n 44\\\\u1b50-\\\\u1b59\\\\u1b6b-\\\\u1b73\\\\u1b80-\\\\u1b82\\\\u1ba1-\\\\u1bad\\\\u1bb0-\\\\u1bb9\\\\u\\\n 1be6-\\\\u1bf3\\\\u1c24-\\\\u1c37\\\\u1c40-\\\\u1c49\\\\u1c50-\\\\u1c59\\\\u1cd0-\\\\u1cd2\\\\u1cd4-\\\n \\\\u1ce8\\\\u1ced\\\\u1cf2-\\\\u1cf4\\\\u1dc0-\\\\u1de6\\\\u1dfc-\\\\u1dff\\\\u200c\\\\u200d\\\\u203f\\\n \\\\u2040\\\\u2054\\\\u20d0-\\\\u20dc\\\\u20e1\\\\u20e5-\\\\u20f0\\\\u2cef-\\\\u2cf1\\\\u2d7f\\\\u2de0\\\n -\\\\u2dff\\\\u302a-\\\\u302f\\\\u3099\\\\u309a\\\\ua620-\\\\ua629\\\\ua66f\\\\ua674-\\\\ua67d\\\\ua69\\\n f\\\\ua6f0\\\\ua6f1\\\\ua802\\\\ua806\\\\ua80b\\\\ua823-\\\\ua827\\\\ua880\\\\ua881\\\\ua8b4-\\\\ua8c4\\\n \\\\ua8d0-\\\\ua8d9\\\\ua8e0-\\\\ua8f1\\\\ua900-\\\\ua909\\\\ua926-\\\\ua92d\\\\ua947-\\\\ua953\\\\ua9\\\n 80-\\\\ua983\\\\ua9b3-\\\\ua9c0\\\\ua9d0-\\\\ua9d9\\\\uaa29-\\\\uaa36\\\\uaa43\\\\uaa4c\\\\uaa4d\\\\ua\\\n a50-\\\\uaa59\\\\uaa7b\\\\uaab0\\\\uaab2-\\\\uaab4\\\\uaab7\\\\uaab8\\\\uaabe\\\\uaabf\\\\uaac1\\\\uaa\\\n eb-\\\\uaaef\\\\uaaf5\\\\uaaf6\\\\uabe3-\\\\uabea\\\\uabec\\\\uabed\\\\uabf0-\\\\uabf9\\\\ufb1e\\\\ufe\\\n 00-\\\\ufe0f\\\\ufe20-\\\\ufe26\\\\ufe33\\\\ufe34\\\\ufe4d-\\\\ufe4f\\\\uff10-\\\\uff19\\\\uff3f]'.replace(/\\s/g, '');\n}", "title": "" }, { "docid": "fcf21e0bdad21055a9647b2a8380a448", "score": "0.55517864", "text": "function jsify (str) {\n if (hasUnderscoreOrHyphen(str)) {\n return unDashHyphen(str);\n }\n return downcaseFirst(str);\n}", "title": "" }, { "docid": "027ec071e3cd6b78a46c4c91e716fbd3", "score": "0.5511402", "text": "function python(hljs){var regex=hljs.regex;var IDENT_RE=/(?:[A-Z_a-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037B-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\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\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\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\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFC5D\\uFC64-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDF9\\uFE71\\uFE73\\uFE77\\uFE79\\uFE7B\\uFE7D\\uFE7F-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFF9D\\uFFA0-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDE80-\\uDEA9\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45\\uDF70-\\uDF81\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC03-\\uDC37\\uDC71\\uDC72\\uDC75\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD47\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC5F-\\uDC61\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDEB8\\uDF00-\\uDF1A\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD2F\\uDD3F\\uDD41\\uDDA0-\\uDDA7\\uDDAA-\\uDDD0\\uDDE1\\uDDE3\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE89\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE70-\\uDEBE\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1\\uDFE3]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD50-\\uDD52\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD837[\\uDF00-\\uDF1E]|\\uD838[\\uDD00-\\uDD2C\\uDD37-\\uDD3D\\uDD4E\\uDE90-\\uDEAD\\uDEC0-\\uDEEB]|\\uD839[\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43\\uDD4B]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF38\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A])(?:[0-9A-Z_a-z\\xAA\\xB5\\xB7\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037B-\\u037D\\u037F\\u0386-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u07FD\\u0800-\\u082D\\u0840-\\u085B\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u0898-\\u08E1\\u08E3-\\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\\u09FC\\u09FE\\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\\u0AF9-\\u0AFF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B55-\\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-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3C-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C5D\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDD\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D00-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D81-\\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\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\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\\u1369-\\u1371\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u1715\\u171F-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u180F-\\u1819\\u1820-\\u1878\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19DA\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1ABF-\\u1ACE\\u1B00-\\u1B4C\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CD0-\\u1CD2\\u1CD4-\\u1CFA\\u1D00-\\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\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\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\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA7F2-\\uA827\\uA82C\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD-\\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-\\uAB69\\uAB70-\\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-\\uFC5D\\uFC64-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDF9\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE71\\uFE73\\uFE77\\uFE79\\uFE7B\\uFE7D\\uFE7F-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDDFD\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDEE0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF7A\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCA0-\\uDCA9\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDD70-\\uDD7A\\uDD7C-\\uDD8A\\uDD8C-\\uDD92\\uDD94\\uDD95\\uDD97-\\uDDA1\\uDDA3-\\uDDB1\\uDDB3-\\uDDB9\\uDDBB\\uDDBC\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67\\uDF80-\\uDF85\\uDF87-\\uDFB0\\uDFB2-\\uDFBA]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE38-\\uDE3A\\uDE3F\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE6\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD27\\uDD30-\\uDD39\\uDE80-\\uDEA9\\uDEAB\\uDEAC\\uDEB0\\uDEB1\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF50\\uDF70-\\uDF85\\uDFB0-\\uDFC4\\uDFE0-\\uDFF6]|\\uD804[\\uDC00-\\uDC46\\uDC66-\\uDC75\\uDC7F-\\uDCBA\\uDCC2\\uDCD0-\\uDCE8\\uDCF0-\\uDCF9\\uDD00-\\uDD34\\uDD36-\\uDD3F\\uDD44-\\uDD47\\uDD50-\\uDD73\\uDD76\\uDD80-\\uDDC4\\uDDC9-\\uDDCC\\uDDCE-\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE37\\uDE3E\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3B-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF50\\uDF57\\uDF5D-\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC00-\\uDC4A\\uDC50-\\uDC59\\uDC5E-\\uDC61\\uDC80-\\uDCC5\\uDCC7\\uDCD0-\\uDCD9\\uDD80-\\uDDB5\\uDDB8-\\uDDC0\\uDDD8-\\uDDDD\\uDE00-\\uDE40\\uDE44\\uDE50-\\uDE59\\uDE80-\\uDEB8\\uDEC0-\\uDEC9\\uDF00-\\uDF1A\\uDF1D-\\uDF2B\\uDF30-\\uDF39\\uDF40-\\uDF46]|\\uD806[\\uDC00-\\uDC3A\\uDCA0-\\uDCE9\\uDCFF-\\uDD06\\uDD09\\uDD0C-\\uDD13\\uDD15\\uDD16\\uDD18-\\uDD35\\uDD37\\uDD38\\uDD3B-\\uDD43\\uDD50-\\uDD59\\uDDA0-\\uDDA7\\uDDAA-\\uDDD7\\uDDDA-\\uDDE1\\uDDE3\\uDDE4\\uDE00-\\uDE3E\\uDE47\\uDE50-\\uDE99\\uDE9D\\uDEB0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD47\\uDD50-\\uDD59\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD98\\uDDA0-\\uDDA9\\uDEE0-\\uDEF6\\uDFB0]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|\\uD80B[\\uDF90-\\uDFF0]|[\\uD80C\\uD81C-\\uD820\\uD822\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879\\uD880-\\uD883][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDE70-\\uDEBE\\uDEC0-\\uDEC9\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF4A\\uDF4F-\\uDF87\\uDF8F-\\uDF9F\\uDFE0\\uDFE1\\uDFE3\\uDFE4\\uDFF0\\uDFF1]|\\uD821[\\uDC00-\\uDFF7]|\\uD823[\\uDC00-\\uDCD5\\uDD00-\\uDD08]|\\uD82B[\\uDFF0-\\uDFF3\\uDFF5-\\uDFFB\\uDFFD\\uDFFE]|\\uD82C[\\uDC00-\\uDD22\\uDD50-\\uDD52\\uDD64-\\uDD67\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD833[\\uDF00-\\uDF2D\\uDF30-\\uDF46]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD837[\\uDF00-\\uDF1E]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A\\uDD00-\\uDD2C\\uDD30-\\uDD3D\\uDD40-\\uDD49\\uDD4E\\uDE90-\\uDEAE\\uDEC0-\\uDEF9]|\\uD839[\\uDFE0-\\uDFE6\\uDFE8-\\uDFEB\\uDFED\\uDFEE\\uDFF0-\\uDFFE]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4B\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD83E[\\uDFF0-\\uDFF9]|\\uD869[\\uDC00-\\uDEDF\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF38\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]|\\uD884[\\uDC00-\\uDF4A]|\\uDB40[\\uDD00-\\uDDEF])*/;var RESERVED_WORDS=['and','as','assert','async','await','break','class','continue','def','del','elif','else','except','finally','for','from','global','if','import','in','is','lambda','nonlocal|10','not','or','pass','raise','return','try','while','with','yield'];var BUILT_INS=['__import__','abs','all','any','ascii','bin','bool','breakpoint','bytearray','bytes','callable','chr','classmethod','compile','complex','delattr','dict','dir','divmod','enumerate','eval','exec','filter','float','format','frozenset','getattr','globals','hasattr','hash','help','hex','id','input','int','isinstance','issubclass','iter','len','list','locals','map','max','memoryview','min','next','object','oct','open','ord','pow','print','property','range','repr','reversed','round','set','setattr','slice','sorted','staticmethod','str','sum','super','tuple','type','vars','zip'];var LITERALS=['__debug__','Ellipsis','False','None','NotImplemented','True'];// https://docs.python.org/3/library/typing.html\n// TODO: Could these be supplemented by a CamelCase matcher in certain\n// contexts, leaving these remaining only for relevance hinting?\nvar TYPES=[\"Any\",\"Callable\",\"Coroutine\",\"Dict\",\"List\",\"Literal\",\"Generic\",\"Optional\",\"Sequence\",\"Set\",\"Tuple\",\"Type\",\"Union\"];var KEYWORDS={$pattern:/[A-Za-z]\\w+|__\\w+__/,keyword:RESERVED_WORDS,built_in:BUILT_INS,literal:LITERALS,type:TYPES};var PROMPT={className:'meta',begin:/^(>>>|\\.\\.\\.) /};var SUBST={className:'subst',begin:/\\{/,end:/\\}/,keywords:KEYWORDS,illegal:/#/};var LITERAL_BRACKET={begin:/\\{\\{/,relevance:0};var STRING={className:'string',contains:[hljs.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[hljs.BACKSLASH_ESCAPE,PROMPT],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?\"\"\"/,end:/\"\"\"/,contains:[hljs.BACKSLASH_ESCAPE,PROMPT],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[hljs.BACKSLASH_ESCAPE,PROMPT,LITERAL_BRACKET,SUBST]},{begin:/([fF][rR]|[rR][fF]|[fF])\"\"\"/,end:/\"\"\"/,contains:[hljs.BACKSLASH_ESCAPE,PROMPT,LITERAL_BRACKET,SUBST]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])\"/,end:/\"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])\"/,end:/\"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[hljs.BACKSLASH_ESCAPE,LITERAL_BRACKET,SUBST]},{begin:/([fF][rR]|[rR][fF]|[fF])\"/,end:/\"/,contains:[hljs.BACKSLASH_ESCAPE,LITERAL_BRACKET,SUBST]},hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE]};// https://docs.python.org/3.9/reference/lexical_analysis.html#numeric-literals\nvar digitpart='[0-9](_?[0-9])*';var pointfloat=\"(\\\\b(\".concat(digitpart,\"))?\\\\.(\").concat(digitpart,\")|\\\\b(\").concat(digitpart,\")\\\\.\");var NUMBER={className:'number',relevance:0,variants:[// exponentfloat, pointfloat\n// https://docs.python.org/3.9/reference/lexical_analysis.html#floating-point-literals\n// optionally imaginary\n// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals\n// Note: no leading \\b because floats can start with a decimal point\n// and we don't want to mishandle e.g. `fn(.5)`,\n// no trailing \\b for pointfloat because it can end with a decimal point\n// and we don't want to mishandle e.g. `0..hex()`; this should be safe\n// because both MUST contain a decimal point and so cannot be confused with\n// the interior part of an identifier\n{begin:\"(\\\\b(\".concat(digitpart,\")|(\").concat(pointfloat,\"))[eE][+-]?(\").concat(digitpart,\")[jJ]?\\\\b\")},{begin:\"(\".concat(pointfloat,\")[jJ]?\")},// decinteger, bininteger, octinteger, hexinteger\n// https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals\n// optionally \"long\" in Python 2\n// https://docs.python.org/2.7/reference/lexical_analysis.html#integer-and-long-integer-literals\n// decinteger is optionally imaginary\n// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals\n{begin:'\\\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\\\b'},{begin:'\\\\b0[bB](_?[01])+[lL]?\\\\b'},{begin:'\\\\b0[oO](_?[0-7])+[lL]?\\\\b'},{begin:'\\\\b0[xX](_?[0-9a-fA-F])+[lL]?\\\\b'},// imagnumber (digitpart-based)\n// https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals\n{begin:\"\\\\b(\".concat(digitpart,\")[jJ]\\\\b\")}]};var COMMENT_TYPE={className:\"comment\",begin:regex.lookahead(/# type:/),end:/$/,keywords:KEYWORDS,contains:[{// prevent keywords from coloring `type`\nbegin:/# type:/},// comment within a datatype comment includes no keywords\n{begin:/#/,end:/\\b\\B/,endsWithParent:true}]};var PARAMS={className:'params',variants:[// Exclude params in functions without params\n{className:\"\",begin:/\\(\\s*\\)/,skip:true},{begin:/\\(/,end:/\\)/,excludeBegin:true,excludeEnd:true,keywords:KEYWORDS,contains:['self',PROMPT,NUMBER,STRING,hljs.HASH_COMMENT_MODE]}]};SUBST.contains=[STRING,NUMBER,PROMPT];return{name:'Python',aliases:['py','gyp','ipython'],unicodeRegex:true,keywords:KEYWORDS,illegal:/(<\\/|->|\\?)|=>/,contains:[PROMPT,NUMBER,{// very common convention\nbegin:/\\bself\\b/},{// eat \"if\" prior to string so that it won't accidentally be\n// labeled as an f-string\nbeginKeywords:\"if\",relevance:0},STRING,COMMENT_TYPE,hljs.HASH_COMMENT_MODE,{match:[/def/,/\\s+/,IDENT_RE],scope:{1:\"keyword\",3:\"title.function\"},contains:[PARAMS]},{variants:[{match:[/class/,/\\s+/,IDENT_RE,/\\s*/,/\\(\\s*/,IDENT_RE,/\\s*\\)/]},{match:[/class/,/\\s+/,IDENT_RE]}],scope:{1:\"keyword\",3:\"title.class\",6:\"title.class.inherited\"}},{className:'meta',begin:/^[\\t ]*@/,end:/(?=#)|$/,contains:[NUMBER,PARAMS,STRING]}]};}", "title": "" }, { "docid": "65d588b37dd99ad21f10e2c43857bc7b", "score": "0.5500318", "text": "function getId(string) {\r\n var strParts = string.split('-');\r\n var id = '';\r\n for (var i=0; i<strParts.length-1; i++) {\r\n if (i != 0)\r\n id += '-';\r\n id += strParts[i];\r\n }\r\n return id;\r\n}", "title": "" }, { "docid": "e32b73084ccf8838eaf0711bb27439d3", "score": "0.549355", "text": "function getID(input) {\r\n var id = input.match(/[0-9 -()+]+$/);\r\n return id[0];\r\n}", "title": "" }, { "docid": "f5e9ed79adfd05653725899e6d26e6af", "score": "0.54880774", "text": "function Identifier(d, s, c){\n this._d = d;\n this._s = s;\n this._c = c;\n}", "title": "" }, { "docid": "5388d37d7d4937300b05b790732d065e", "score": "0.54838985", "text": "function identifierStart(fuzzerState) { // todo. see also https://gist.github.com/mathiasbynens/6334847#file-javascript-identifier-regex-js-L65-L105\n return String.fromCharCode(97 + fuzzerState.rng.nextInt(25));\n}", "title": "" }, { "docid": "c8116b96d3ec690bb06627d1039ce96f", "score": "0.5456302", "text": "function toKey(str) {\n return str.replace(/\\W/g, '-');\n} // ==============================", "title": "" }, { "docid": "e2c1c1d3502e07fae6fddc7723bfdf6c", "score": "0.54218465", "text": "* genID(s) {\n let idx = 0;\n while (true)\n yield {str:s + `_i-${idx}`, idx:idx++};\n }", "title": "" }, { "docid": "6f4f19136db6d4d1494d15c7714b9a5a", "score": "0.5414068", "text": "function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n var alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}", "title": "" }, { "docid": "6f4f19136db6d4d1494d15c7714b9a5a", "score": "0.5414068", "text": "function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n var alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}", "title": "" }, { "docid": "6f4f19136db6d4d1494d15c7714b9a5a", "score": "0.5414068", "text": "function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n var alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}", "title": "" }, { "docid": "aec45752b7453da68ca561cd3e2ce139", "score": "0.5406489", "text": "getIdentifierName(name) {\n\t\tlet ret = _.camelCase(name);\n\n\t\tif (TemplateUtil.reservedWords.has(ret)) {\n\t\t\tret = '_' + ret;\n\t\t}\n\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "771b14da54e8eaa27607a466838ed552", "score": "0.5399837", "text": "function buildId(...values) {\n return values\n .map(v => typeof v === 'string' ? sanitize(v, '_') : String(v))\n .join('-');\n}", "title": "" }, { "docid": "d7213a666d97e5c8b8960faa76e6520e", "score": "0.53989416", "text": "function varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n const alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}", "title": "" }, { "docid": "62be2cf805e16ba62c42e2fa110b8d24", "score": "0.539527", "text": "function toKey(str) {\n return str.replace(/\\W/g, '-');\n}", "title": "" }, { "docid": "a5e4067defbdb9974de2835fb1c11d10", "score": "0.5362284", "text": "function makeID(){\n var code = \"\"\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for(var i = 0; i < 4; i++){code += possible.charAt(Math.floor(Math.random() * possible.length))};\n return code;\n }", "title": "" }, { "docid": "c4009ed217f83772fbf201d6a90c20e5", "score": "0.5355139", "text": "function unescapeIdentifier(identifier){return identifier.startsWith('___')?identifier.substr(1):identifier;}", "title": "" }, { "docid": "08cf4ba818634ef9503b364e1d2f2efc", "score": "0.5347353", "text": "function returnItemIdS(string,place){\n\tvar id='';\n\tfor (var i=place;i<string.length;i++){\n\t\t\tid+=string.charAt(i);\n\t\t}\n\treturn id;\n}", "title": "" }, { "docid": "ed157afee0db60e57160d615858abd55", "score": "0.53459567", "text": "function _newID() {\n return (S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4()).toLowerCase();\n}", "title": "" }, { "docid": "0bffbd69b16d97ec5f993b57bf1644b2", "score": "0.53410655", "text": "function makeid() {\n let text = '';\n const possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n for (let i = 0; i < 5; i += 1) text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n }", "title": "" }, { "docid": "8f3596b5e40fd9a751a33506865ef14d", "score": "0.53213745", "text": "function getRealId(input) {\n data = input.id.charAt(0).toUpperCase() + input.id.slice(1,8).toLowerCase();\n return data;\n}", "title": "" }, { "docid": "c389bec067164692e8eeaf5557a9fe48", "score": "0.53178674", "text": "function makeid() {\n\tvar text = \"\";\n\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n\tfor (var i = 0; i < 10; i++) {\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\t}return text;\n}", "title": "" }, { "docid": "2064c3aff53c509a70e671e3d972a609", "score": "0.5306359", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }", "title": "" }, { "docid": "2064c3aff53c509a70e671e3d972a609", "score": "0.5306359", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }", "title": "" }, { "docid": "2064c3aff53c509a70e671e3d972a609", "score": "0.5306359", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }", "title": "" }, { "docid": "d5eb9c1b84c23b0967bd50bc98452694", "score": "0.5295329", "text": "function variableNameToSql(variableName){\n if(\"id\" == variableName) return \"ID\"\n var builder=\"\"\n var prev=CharType.OTHER\n for (var i = 0, len = variableName.length; i < len; i++) {\n var char=(variableName[i]);\n if(isLowercase(char) && !isDigit(char) && !isUnderscore(char)){\n if(prev == CharType.DIGIT){\n builder+=\"_\"\n }\n prev = CharType.LC\n } else if (isDigit(char)){\n if(prev == CharType.LC || prev == CharType.UC){\n builder+=\"_\"\n }\n prev = CharType.DIGIT\n } else if (isUppercase(char) && !isUnderscore(char)){\n if(prev == CharType.LC || prev == CharType.DIGIT){\n builder+=\"_\"\n }\n prev = CharType.UC\n } else if (isUnderscore(char)){\n prev = CharType.US\n } else {\n prev = CharType.OTHER\n }\n builder+=char.toUpperCase()\n }\n return builder\n}", "title": "" }, { "docid": "cf18a2314f921feaab85e0c5518e7099", "score": "0.5295023", "text": "function isIdentifierPart(ch) {\n\t // Generated by `tools/generate-identifier-regex.js`.\n\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 return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n\t (ch >= 65 && ch <= 90) || // A..Z\n\t (ch >= 97 && ch <= 122) || // a..z\n\t (ch >= 48 && ch <= 57) || // 0..9\n\t (ch === 92) || // \\ (backslash)\n\t ((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n\t }", "title": "" }, { "docid": "0d5a3137d0beae46bd8c1a6fbd251da0", "score": "0.5291117", "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": "1c8c03d618fa6eac5f02d9b2624835c7", "score": "0.52795184", "text": "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 20; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "title": "" }, { "docid": "62b2647ddfe7bc813a0e090672a17fbd", "score": "0.5252037", "text": "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 20; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "title": "" }, { "docid": "7e7dd3975c9e6c219b4ae2d6b78cf4d0", "score": "0.52448916", "text": "function makeID() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\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": "fea1e3dc6d229bbc2f63880087a1218c", "score": "0.5242801", "text": "function makeid () {\n let text = ''\n let possible = 'abcdefghijklmnopqrstuvwxyz0123456789'\n\n for (var i = 0; i < ID_LENGTH; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length))\n }\n\n return text\n}", "title": "" }, { "docid": "c52ab0d97343a031ab93d0d09a8e7177", "score": "0.52391356", "text": "function makeid() {\n\t\tvar text = '';\n\t\tvar possible =\n\t\t\t'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n\t\tfor (var i = 0; i < 5; i++)\n\t\t\ttext += possible.charAt(\n\t\t\t\tMath.floor(Math.random() * possible.length),\n\t\t\t);\n\n\t\treturn text;\n\t}", "title": "" }, { "docid": "1f5488be10427596619d76bf1aa574a7", "score": "0.52350104", "text": "function Id(a, b, c, d) {\n var e = {\n s: [\"thodde secondanim\", \"thodde second\"],\n m: [\"eka mintan\", \"ek minute\"],\n mm: [a + \" mintanim\", a + \" mintam\"],\n h: [\"eka horan\", \"ek hor\"],\n hh: [a + \" horanim\", a + \" hor\"],\n d: [\"eka disan\", \"ek dis\"],\n dd: [a + \" disanim\", a + \" dis\"],\n M: [\"eka mhoinean\", \"ek mhoino\"],\n MM: [a + \" mhoineanim\", a + \" mhoine\"],\n y: [\"eka vorsan\", \"ek voros\"],\n yy: [a + \" vorsanim\", a + \" vorsam\"]\n };\n return b ? e[c][0] : e[c][1]\n }", "title": "" }, { "docid": "4a20ec5e6ec9c19fcab22ea824c5ad25", "score": "0.5232747", "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": "f296db30b5c835d620162e12c643765a", "score": "0.52134484", "text": "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789?\";\n for (var i = 0; i < 50; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n }", "title": "" }, { "docid": "63e7467b09b616a9388d24f1132e0955", "score": "0.5204791", "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 }\n return text;\n }", "title": "" }, { "docid": "2c4bb65b7ff191c97b43fe4f46dcb299", "score": "0.5202512", "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": "67ffdd7a732aabb63794e283467fe507", "score": "0.5200615", "text": "function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n 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 return ch === 36 || ch === 95 || // $ (dollar) and _ (underscore)\n ch >= 65 && ch <= 90 || // A..Z\n ch >= 97 && ch <= 122 || // a..z\n ch >= 48 && ch <= 57 || // 0..9\n ch === 92 || // \\ (backslash)\n ch >= 0x80 && NonAsciiIdentifierPart.test(String.fromCharCode(ch));\n }", "title": "" }, { "docid": "a7481131cef47f7b39a160f8c041443c", "score": "0.51930285", "text": "_idForName(name) { return name.split('.')[0]; }", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5192498", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5192498", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5192498", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5192498", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5192498", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5192498", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "0ff25f16210b50f1f0d2d1e9faaf2f5d", "score": "0.5192498", "text": "function Id(a,b,c,d){var e={s:[\"thodde secondanim\",\"thodde second\"],m:[\"eka mintan\",\"ek minute\"],mm:[a+\" mintanim\",a+\" mintam\"],h:[\"eka horan\",\"ek hor\"],hh:[a+\" horanim\",a+\" hor\"],d:[\"eka disan\",\"ek dis\"],dd:[a+\" disanim\",a+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[a+\" mhoineanim\",a+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[a+\" vorsanim\",a+\" vorsam\"]};return b?e[c][0]:e[c][1]}", "title": "" }, { "docid": "3d2b9822971939527ca4a7dc5a047450", "score": "0.51868176", "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": "" } ]
0f7c89fe8aa8ac152de2e41d24c80920
CONCATENATED MODULE: ./node_modules/d3quadtree/index.js CONCATENATED MODULE: ./node_modules/d3force/src/collide.js
[ { "docid": "e964dcdb57dd39efe196da76d90c8c7e", "score": "0.0", "text": "function collide_x(d) {\n return d.x + d.vx;\n}", "title": "" } ]
[ { "docid": "0e8224d1602f2c69a23bbea4f3fcb759", "score": "0.52927315", "text": "generate_hqmf_library_module(){\n this.write_to_file(\"lib/load_utils.js\", this.get_template(\"load_utils\")());\n this.write_to_file(\"lib/hqmf_utils.js\", this.bundle.getLibrary(\"hqmf_utils\"));\n this.write_to_file(\"lib/map_reduce_utils.js\", this.bundle.getLibrary(\"map_reduce_utils\"));\n }", "title": "" }, { "docid": "f9a802cac2059fdd372ebc9933dc0d03", "score": "0.5230519", "text": "function main() {\r\n const packageFileName = (argv.packageFile === undefined) ? \"./package.json\" : argv.packageFile;\r\n const buildType = (argv.type == undefined) ? \"dev\" : argv.type;\r\n const isDev = buildType === \"dev\";\r\n const localNodeModules = path.resolve(process.cwd(), \"node_modules\");\r\n if (!fs.existsSync(localNodeModules)) {\r\n console.log(\"Local node modules directory\", localNodeModules, \"does not exist, aborting\");\r\n return;\r\n }\r\n\r\n const externalModules = [\r\n new ModuleInfo(true, \"@bentley/bentleyjs-core\", undefined),\r\n new ModuleInfo(true, \"@bentley/geometry-core\", undefined),\r\n new ModuleInfo(false, \"@bentley/bwc\", makeModulePath(localNodeModules, \"@bentley/bwc\", isDev ? \"lib/module/dev/bwc.js\" : \"lib/module/prod/bwc.js\")),\r\n new ModuleInfo(true, \"@bentley/imodeljs-i18n\", undefined),\r\n new ModuleInfo(true, \"@bentley/imodeljs-clients\", undefined),\r\n new ModuleInfo(true, \"@bentley/imodeljs-common\", undefined),\r\n new ModuleInfo(true, \"@bentley/imodeljs-quantity\", undefined),\r\n new ModuleInfo(true, \"@bentley/imodeljs-frontend\", undefined, \"lib/public\"),\r\n new ModuleInfo(true, \"@bentley/ui-core\", undefined, \"lib/public\"),\r\n new ModuleInfo(true, \"@bentley/ui-components\", undefined, \"lib/public\"),\r\n new ModuleInfo(true, \"@bentley/ui-framework\", undefined, \"lib/public\"),\r\n new ModuleInfo(true, \"@bentley/ui-ninezone\", undefined),\r\n new ModuleInfo(true, \"@bentley/presentation-common\", undefined),\r\n new ModuleInfo(true, \"@bentley/presentation-components\", undefined),\r\n new ModuleInfo(true, \"@bentley/presentation-frontend\", undefined),\r\n new ModuleInfo(false, \"react\", makeModulePath(localNodeModules, \"react\", isDev ? \"umd/react.development.js\" : \"umd/react.production.min.js\")),\r\n new ModuleInfo(false, \"react-dnd\", makeModulePath(localNodeModules, \"react-dnd\", isDev ? \"dist/ReactDnd.js\" : \"dist/ReactDnD.min.js\")),\r\n new ModuleInfo(false, \"react-dnd-html5-backend\", makeModulePath(localNodeModules, \"react-dnd-html5-backend\", isDev ? \"dist/ReactDnDHTML5Backend.js\" : \"dist/ReactDnDHTML5Backend.min.js\")),\r\n new ModuleInfo(false, \"react-dom\", makeModulePath(localNodeModules, \"react-dom\", isDev ? \"umd/react-dom.development.js\" : \"umd/react-dom.production.min.js\")),\r\n new ModuleInfo(false, \"react-redux\", makeModulePath(localNodeModules, \"react-redux\", isDev ? \"dist/react-redux.js\" : \"dist/react-redux.min.js\")),\r\n new ModuleInfo(false, \"redux\", makeModulePath(localNodeModules, \"redux\", isDev ? \"dist/redux.js\" : \"dist/redux.min.js\")),\r\n new ModuleInfo(false, \"inspire-tree\", makeModulePath(localNodeModules, \"inspire-tree\", isDev ? \"dist/inspire-tree.js\" : \"dist/inspire-tree.min.js\")),\r\n new ModuleInfo(false, \"lodash\", makeModulePath(localNodeModules, \"lodash\", isDev ? \"lodash.js\" : \"lodash.min.js\")),\r\n ];\r\n\r\n try {\r\n const outputDirectory = path.resolve(process.cwd(), argv.destDir);\r\n // create the output directory, if it doesn't exist.\r\n if (!fs.existsSync(outputDirectory)) {\r\n fs.mkdirSync(outputDirectory, { recursive: true });\r\n }\r\n\r\n // open and read the package.json file.\r\n const packagePath = path.resolve(process.cwd(), packageFileName);\r\n const packageFileContents = fs.readFileSync(packagePath, \"utf8\");\r\n\r\n // parse it\r\n const package = JSON.parse(packageFileContents);\r\n for (const dependent in package.dependencies) {\r\n // see if it matches one of our externals.\r\n for (const externalModule of externalModules) {\r\n if (dependent === externalModule.moduleName) {\r\n // yes, link the file.\r\n let fileName = \"\";\r\n let moduleSourceFile = undefined;\r\n let versionString = undefined;\r\n if (externalModule.inRushRepo) {\r\n // These are our iModelJs modules. Get the version from the package.json file.\r\n versionString = getBentleyVersionString(localNodeModules, externalModule.moduleName, buildType);\r\n const modulePath = makeBentleyModulePath(localNodeModules, externalModule.moduleName, isDev);\r\n fileName = externalModule.moduleName.slice(9) + \".js\";\r\n moduleSourceFile = path.resolve(modulePath, fileName);\r\n } else {\r\n moduleSourceFile = externalModule.moduleSourceFile; // we stored the correct source file name in the externalModules object.\r\n if (0 === externalModule.moduleName.indexOf(\"@bentley\")) {\r\n // this is for @bentley/bwc -\r\n fileName = externalModule.moduleName.slice(9) + \".js\";\r\n }\r\n else {\r\n fileName = externalModule.moduleName + \".js\";\r\n }\r\n }\r\n if (!fs.existsSync(moduleSourceFile)) {\r\n console.log(\"problem: File\", moduleSourceFile, \"does not exist\");\r\n } else {\r\n let outFilePath = undefined;\r\n if (versionString) {\r\n // create subdirectory if needed.\r\n const outSubDirectory = path.resolve(outputDirectory, \"v\" + versionString);\r\n if (!fs.existsSync(outSubDirectory)) {\r\n fs.mkdirSync(outSubDirectory, { recursive: true });\r\n }\r\n outFilePath = path.resolve(outSubDirectory, fileName)\r\n } else {\r\n outFilePath = path.resolve(outputDirectory, fileName);\r\n }\r\n linkModuleFile(moduleSourceFile, outFilePath);\r\n if (externalModule.publicResourceDirectory) {\r\n const publicPath = path.resolve(localNodeModules, externalModule.moduleName, externalModule.publicResourceDirectory);\r\n linkPublicStaticFiles(publicPath, outputDirectory);\r\n }\r\n // found dependent in list of external, no need to look at the rest of the externals.\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // link the IModelJsLoader.js from imodeljs/frontend also.\r\n const loaderPath = makeBentleyModulePath(localNodeModules, \"@bentley/imodeljs-frontend\", isDev);\r\n const loaderFile = path.resolve(loaderPath, \"IModelJsLoader.js\");\r\n const outFilePath = path.resolve(outputDirectory, \"IModelJsLoader.js\");\r\n linkModuleFile(loaderFile, outFilePath);\r\n } catch (e) {\r\n console.log(\"Error\", e);\r\n }\r\n}", "title": "" }, { "docid": "35f5b42fd3f45e0fa9bd0c2337796be9", "score": "0.5229003", "text": "function importThreejs() {\n return src(\"src/js/threejs/*.js\")\n .pipe(dest(\"dist/assets/js\"));\n}", "title": "" }, { "docid": "af1aa03368f29ed3af0ab21690ddef36", "score": "0.5177616", "text": "sortRequires() {\n //clone this._modules for temp use\n let modules = this._modules;//new Map(JSON.parse(JSON.stringify(Array.from(this._modules)))); \n let circRefsArr = [];\n for (let [modName, mod] of modules) {\n let circRefs = this.detectCircularReferences(mod);\n if (circRefs.length) {\n let circ;\n for (circ of circRefs) {\n circRefsArr.push(circ.join(' -> '));\n let s = circ.length;\n let mod1name = circ[s-1];\n let mod2name = circ[s-2];\n let modul1 = modules.get(mod1name);\n let modul2 = modules.get(mod2name);\n let p;\n for (p of modul1.parents) {\n if (p === mod2name) {\n modul1.parents.splice(modul1.parents.indexOf(p),1);\n }\n }\n let c;\n for (c of modul2.children) {\n if (c === mod1name) {\n modul2.children.splice(modul2.children.indexOf(c),1);\n }\n }\n }\n }\n }\n let circRef;\n for(circRef of circRefsArr) {\n console.warn('Circular reference detected: ' + circRef);\n }\n // take care of 'load_after' option\n for (let [modName1, mod1] of modules) {\n mod1.children_copy = mod1.children;\n if ('load_after' in mod1 && Array.isArray(mod1.load_after)) {\n for (let n of mod1.load_after) {\n if (!modules.has(n)) {\n throw new Error('Invalid module name specified in load_after: ' + n);\n continue;\n }\n mod1.parents.push(n);\n modules.get(n).children.push(modName1);\n }\n }\n }\n // get modules without dependencies\n let rootModules = [];\n for (let [modName2, mod2] of modules) {\n if (!mod2.parents.length) {\n rootModules.push(mod2);\n }\n }\n let sorted = new Map();\n //let module_keys = Object.keys(modules);\n while(modules.size) {\n if (circRefsArr.length) {\n throw new Error('Circular reference detected, aborting module sorting');\n //return false;\n }\n // remove this node from root modules and add it to the output\n let n = rootModules.pop();\n sorted.set(n.module_name, n);\n let c = n.children.length - 1;\n // for each of its children: queue the new node, finally remove the original\n while(c >= 0) {\n //for (let c in n.children) {\n // get child module\n let childModule = modules.get(n.children[c]);\n //console.log(childModule);\n // remove child modules from parent\n n.children.splice(c,1);\n //console.log(n.children);\n // remove parent from child module\n childModule.parents.splice(childModule.parents.indexOf(n.module_name),1);\n // check if this child has other parents. if not, add it to the root modules list\n if (!childModule.parents.length) { rootModules.push(childModule); }\n \n c--;\n }\n // remove processed module from list\n modules.delete(n.module_name);\n //module_keys.length--;\n }\n // move modules that have load_after=='ALL' to the end of list\n let srt = [];\n for (let [modName3, mod3] of sorted) {\n if (mod3.load_after === 'ALL') {\n sorted.delete(modName3);\n /* ES6 Loader complains about delete followed by set on Map\n So, srt Array is used instead\n if (!sorted.has(modName3)) {\n sorted.set(modName3,mod3);\n }\n */\n srt.push(mod3);\n }\n }\n srt.forEach(function(obj) {\n sorted.set(obj.module_name, obj);\n });\n this._modules = sorted;\n return this;\n }", "title": "" }, { "docid": "0df8fbe6ab44536ff5c8e853f2243e91", "score": "0.5081566", "text": "loadDependencies() {\n buffer = require('vinyl-buffer');\n rollup = require('rollup-stream');\n buble = require('rollup-plugin-buble');\n source = require('vinyl-source-stream');\n replace = require('rollup-plugin-replace');\n commonjs = require('rollup-plugin-commonjs');\n nodeResolve = require('rollup-plugin-node-resolve');\n multiEntry = require('rollup-plugin-multi-entry');\n }", "title": "" }, { "docid": "c53244d0675a23e8020f4f31f269469f", "score": "0.50542504", "text": "loadDependencies() {\n svgSprite = require( \"gulp-svg-sprite\" );\n }", "title": "" }, { "docid": "e66b4634f5f5c703bba4fb71b7d17417", "score": "0.50360036", "text": "function runSimulation() {\n\n //Make the x-position equal to the x-position specified in the module positioning object or, if module not labeled, set it to center\n var forceX = d3.forceX(function (d) { \n var group = modulePosition.find(g=>g.group == d.id)\n //return group ? group.coordinates.x : width/2 // hmm...separating the netwoks by grid is uglier then centering them\n return width/2\n }).strength(0.2)\n\n //Same for forceY--these act as a gravity parameter so the different strength determines how closely\n //the individual nodes are pulled to the center of their module position\n var forceY = d3.forceY(function (d) {\n var group = modulePosition.find(g=>g.group == d.id)\n //return group ? group.coordinates.y : height/2\n return height/2\n\n }).strength(0.2)\n\n // repel disconnected nodes further away from grouped (highly connected) nodes\n nodes.forEach((d,i) => {\n d.color_new = d\n d.group = d.group ? d.group : 'disconnected'\n })\n links.forEach((d,i) => {\n d.group = d.group ? d.group : 'disconnected'\n })\n var charge = d3.forceManyBody(function (d) { return d.group == 'disconnected' ? -20 : -100})\n\n var buffer = 0\n\n simulation = d3.forceSimulation()\n .force(\"link\", d3.forceLink()\n .id(function(d) { return d.id; })\n .strength(function(d) {return 0.7})\n )\n .force('center', d3.forceCenter(width/2, height/2))\n .force('charge', charge)\n .force(\"x\", forceX)\n .force(\"y\", forceY)\n //.stop()\n\n simulation\n .nodes(nodes)\n .on(\"tick\", update) // start simulation to update node positions\n\n simulation.force(\"link\")\n .links(links)\n\n //for (var i = 0; i < 200; ++i) simulation.tick()\n //simulation.alpha(1).alphaDecay(0.1).restart()\n enter(nodes, links)\n\n }", "title": "" }, { "docid": "ccf2326ff7608e7dd010145af8a99699", "score": "0.50191236", "text": "_wrap (node) {\n // let options = this._get_module_options(node)\n let prefix = this._get_module_prefix(node)\n let suffix = this._get_module_suffix(node)\n\n console.log(prefix, node.code, suffix)\n // // id\n // var module_id = this._generate_module_id(filename)\n\n // // dependencies\n // var resolved_dependencies = _.keys(mod.require).map(function (dep) {\n // return mod.resolved[dep] || dep\n // })\n\n // // options\n // var module_options = this._generate_module_options(filename, mod)\n\n // var pairs = []\n // if (module_options.main) {\n // pairs.push('main: true')\n // }\n\n // var different\n // var map\n // if (module_options.map) {\n // different = get_difference(module_options.map, this.global_map)\n // map = _.keys(different).length\n // ? 'neuron.mix(' + this._stringify(different) + ', global_map)'\n // : 'global_map'\n\n // pairs.push('map: ' + map)\n // }\n\n // module_options = pairs.length\n // ? '{\\n'\n // + ' ' + pairs.join(',\\n ')\n // + '\\n}'\n // : ''\n\n // var result = _.template(WRAPPING_TEMPLATE)({\n // id: this._stringify(module_id),\n // deps: this._stringify(resolved_dependencies),\n // code: mod.json\n // ? 'module.exports = ' + mod.code\n // : mod.code,\n // module_options: module_options\n // })\n\n // callback(null, result)\n }", "title": "" }, { "docid": "6d62f3130fd80317f52b184fce3cfe70", "score": "0.49905574", "text": "function transformUMDModule(node) {\n var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ false), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;\n var umdHeader = ts.createFunctionExpression(\n /*modifiers*/ undefined, \n /*asteriskToken*/ undefined, \n /*name*/ undefined, \n /*typeParameters*/ undefined, [ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"factory\")], \n /*type*/ undefined, ts.setTextRange(ts.createBlock([\n ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier(\"module\"), \"object\"), ts.createTypeCheck(ts.createPropertyAccess(ts.createIdentifier(\"module\"), \"exports\"), \"object\")), ts.createBlock([\n ts.createVariableStatement(\n /*modifiers*/ undefined, [\n ts.createVariableDeclaration(\"v\", \n /*type*/ undefined, ts.createCall(ts.createIdentifier(\"factory\"), \n /*typeArguments*/ undefined, [\n ts.createIdentifier(\"require\"),\n ts.createIdentifier(\"exports\")\n ]))\n ]),\n ts.setEmitFlags(ts.createIf(ts.createStrictInequality(ts.createIdentifier(\"v\"), ts.createIdentifier(\"undefined\")), ts.createStatement(ts.createAssignment(ts.createPropertyAccess(ts.createIdentifier(\"module\"), \"exports\"), ts.createIdentifier(\"v\")))), 1 /* SingleLine */)\n ]), ts.createIf(ts.createLogicalAnd(ts.createTypeCheck(ts.createIdentifier(\"define\"), \"function\"), ts.createPropertyAccess(ts.createIdentifier(\"define\"), \"amd\")), ts.createBlock([\n ts.createStatement(ts.createCall(ts.createIdentifier(\"define\"), \n /*typeArguments*/ undefined, [\n ts.createArrayLiteral([\n ts.createLiteral(\"require\"),\n ts.createLiteral(\"exports\")\n ].concat(aliasedModuleNames, unaliasedModuleNames)),\n ts.createIdentifier(\"factory\")\n ]))\n ])))\n ], \n /*multiLine*/ true), \n /*location*/ undefined));\n // Create an updated SourceFile:\n //\n // (function (factory) {\n // if (typeof module === \"object\" && typeof module.exports === \"object\") {\n // var v = factory(require, exports);\n // if (v !== undefined) module.exports = v;\n // }\n // else if (typeof define === 'function' && define.amd) {\n // define([\"require\", \"exports\"], factory);\n // }\n // })(function ...)\n return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([\n ts.createStatement(ts.createCall(umdHeader, \n /*typeArguments*/ undefined, [\n // Add the module body function argument:\n //\n // function (require, exports) ...\n ts.createFunctionExpression(\n /*modifiers*/ undefined, \n /*asteriskToken*/ undefined, \n /*name*/ undefined, \n /*typeParameters*/ undefined, [\n ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"require\"),\n ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"exports\")\n ].concat(importAliasNames), \n /*type*/ undefined, transformAsynchronousModuleBody(node))\n ]))\n ]), \n /*location*/ node.statements));\n }", "title": "" }, { "docid": "f923e65cabcd7008fff4efc035b76e19", "score": "0.4960276", "text": "function d3threeD(exports) {\n\n const DEGS_TO_RADS = Math.PI / 180, UNIT_SIZE = 100;\n\n const DIGIT_0 = 48, DIGIT_9 = 57, COMMA = 44, SPACE = 32, PERIOD = 46, MINUS = 45;\n\n exports.transformSVGPath =\n function transformSVGPath(pathStr) {\n var path = new THREE.Shape();\n\n var idx = 1, len = pathStr.length, activeCmd,\n x = 0, y = 0, nx = 0, ny = 0, firstX = null, firstY = null,\n x1 = 0, x2 = 0, y1 = 0, y2 = 0,\n rx = 0, ry = 0, xar = 0, laf = 0, sf = 0, cx, cy;\n\n function eatNum() {\n var sidx, c, isFloat = false, s;\n // eat delims\n while (idx < len) {\n c = pathStr.charCodeAt(idx);\n if (c !== COMMA && c !== SPACE)\n break;\n idx++;\n }\n if (c === MINUS)\n sidx = idx++;\n else\n sidx = idx;\n // eat number\n while (idx < len) {\n c = pathStr.charCodeAt(idx);\n if (DIGIT_0 <= c && c <= DIGIT_9) {\n idx++;\n continue;\n }\n else if (c === PERIOD) {\n idx++;\n isFloat = true;\n continue;\n }\n\n s = pathStr.substring(sidx, idx);\n return isFloat ? parseFloat(s) : parseInt(s);\n }\n\n s = pathStr.substring(sidx);\n return isFloat ? parseFloat(s) : parseInt(s);\n }\n\n function nextIsNum() {\n var c;\n // do permanently eat any delims...\n while (idx < len) {\n c = pathStr.charCodeAt(idx);\n if (c !== COMMA && c !== SPACE)\n break;\n idx++;\n }\n c = pathStr.charCodeAt(idx);\n return (c === MINUS || (DIGIT_0 <= c && c <= DIGIT_9));\n }\n\n var canRepeat;\n activeCmd = pathStr[0].replace(/ /g, ' ').trim();\n while (idx <= len) {\n canRepeat = true;\n switch (activeCmd) {\n // moveto commands, become lineto's if repeated\n case 'M':\n x = eatNum();\n y = eatNum();\n path.moveTo(x, y);\n activeCmd = 'L';\n firstX = x;\n firstY = y;\n break;\n case 'm':\n x += eatNum();\n y += eatNum();\n path.moveTo(x, y);\n activeCmd = 'l';\n firstX = x;\n firstY = y;\n break;\n case 'Z':\n case 'z':\n canRepeat = false;\n if (x !== firstX || y !== firstY)\n path.lineTo(firstX, firstY);\n break;\n // - lines!\n case 'L':\n case 'H':\n case 'V':\n nx = (activeCmd === 'V') ? x : eatNum();\n ny = (activeCmd === 'H') ? y : eatNum();\n path.lineTo(nx, ny);\n x = nx;\n y = ny;\n break;\n case 'l':\n case 'h':\n case 'v':\n nx = (activeCmd === 'v') ? x : (x + eatNum());\n ny = (activeCmd === 'h') ? y : (y + eatNum());\n path.lineTo(nx, ny);\n x = nx;\n y = ny;\n break;\n // - cubic bezier\n case 'C':\n x1 = eatNum(); y1 = eatNum();\n case 'S':\n if (activeCmd === 'S') {\n x1 = 2 * x - x2; y1 = 2 * y - y2;\n }\n x2 = eatNum();\n y2 = eatNum();\n nx = eatNum();\n ny = eatNum();\n path.bezierCurveTo(x1, y1, x2, y2, nx, ny);\n x = nx; y = ny;\n break;\n case 'c':\n x1 = x + eatNum();\n y1 = y + eatNum();\n case 's':\n if (activeCmd === 's') {\n x1 = 2 * x - x2;\n y1 = 2 * y - y2;\n }\n x2 = x + eatNum();\n y2 = y + eatNum();\n nx = x + eatNum();\n ny = y + eatNum();\n path.bezierCurveTo(x1, y1, x2, y2, nx, ny);\n x = nx; y = ny;\n break;\n // - quadratic bezier\n case 'Q':\n x1 = eatNum(); y1 = eatNum();\n case 'T':\n if (activeCmd === 'T') {\n x1 = 2 * x - x1;\n y1 = 2 * y - y1;\n }\n nx = eatNum();\n ny = eatNum();\n path.quadraticCurveTo(x1, y1, nx, ny);\n x = nx;\n y = ny;\n break;\n case 'q':\n x1 = x + eatNum();\n y1 = y + eatNum();\n case 't':\n if (activeCmd === 't') {\n x1 = 2 * x - x1;\n y1 = 2 * y - y1;\n }\n nx = x + eatNum();\n ny = y + eatNum();\n path.quadraticCurveTo(x1, y1, nx, ny);\n x = nx; y = ny;\n break;\n // - elliptical arc\n case 'A':\n rx = eatNum();\n ry = eatNum();\n xar = eatNum() * DEGS_TO_RADS;\n laf = eatNum();\n sf = eatNum();\n nx = eatNum();\n ny = eatNum();\n if (rx !== ry) {\n console.warn(\"Forcing elliptical arc to be a circular one :(\",\n rx, ry);\n }\n // SVG implementation notes does all the math for us! woo!\n // http://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes\n // step1, using x1 as x1'\n x1 = Math.cos(xar) * (x - nx) / 2 + Math.sin(xar) * (y - ny) / 2;\n y1 = -Math.sin(xar) * (x - nx) / 2 + Math.cos(xar) * (y - ny) / 2;\n // step 2, using x2 as cx'\n var norm = Math.sqrt(\n (rx * rx * ry * ry - rx * rx * y1 * y1 - ry * ry * x1 * x1) /\n (rx * rx * y1 * y1 + ry * ry * x1 * x1));\n if (laf === sf)\n norm = -norm;\n x2 = norm * rx * y1 / ry;\n y2 = norm * -ry * x1 / rx;\n // step 3\n cx = Math.cos(xar) * x2 - Math.sin(xar) * y2 + (x + nx) / 2;\n cy = Math.sin(xar) * x2 + Math.cos(xar) * y2 + (y + ny) / 2;\n\n var u = new THREE.Vector2(1, 0),\n v = new THREE.Vector2((x1 - x2) / rx,\n (y1 - y2) / ry);\n var startAng = Math.acos(u.dot(v) / u.length() / v.length());\n if (u.x * v.y - u.y * v.x < 0)\n startAng = -startAng;\n\n // we can reuse 'v' from start angle as our 'u' for delta angle\n u.x = (-x1 - x2) / rx;\n u.y = (-y1 - y2) / ry;\n\n var deltaAng = Math.acos(v.dot(u) / v.length() / u.length());\n // This normalization ends up making our curves fail to triangulate...\n if (v.x * u.y - v.y * u.x < 0)\n deltaAng = -deltaAng;\n if (!sf && deltaAng > 0)\n deltaAng -= Math.PI * 2;\n if (sf && deltaAng < 0)\n deltaAng += Math.PI * 2;\n\n path.absarc(cx, cy, rx, startAng, startAng + deltaAng, sf);\n x = nx;\n y = ny;\n break;\n default:\n break;//throw new Error(\"weird path command: \" + activeCmd);\n }\n // just reissue the command\n if (canRepeat && nextIsNum())\n continue;\n activeCmd = pathStr[idx++];\n }\n\n return path;\n }\n}", "title": "" }, { "docid": "81e95900e8009e5114e172b9a122e084", "score": "0.49054503", "text": "function dependOn() {\n 'use strict';\n return [\n require(\"communicate\"),\n require(\"common\"),\n require(\"util\"),\n require(\"proxy\"),\n require(\"analytics\"),\n require(\"feat\")\n ];\n}", "title": "" }, { "docid": "c040bb16a20e362224eb2eff29614430", "score": "0.4886628", "text": "function modules() {\n // Bootstrap\n var bootstrap = src('./node_modules/bootstrap/dist/**/*')\n .pipe(dest('./vendor/bootstrap'));\n // Font Awesome\n var fontAwesome = src('./node_modules/@fortawesome/**/*')\n .pipe(dest('./vendor'));\n // jQuery Easing\n var jqueryEasing = src('./node_modules/jquery.easing/*.js')\n .pipe(dest('./vendor/jquery-easing'));\n // jQuery\n var jquery = src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js'\n ])\n .pipe(dest('./vendor/jquery'));\n // Simple Line Icons\n var simpleLineIconsFonts = src('./node_modules/simple-line-icons/fonts/**')\n .pipe(dest('./vendor/simple-line-icons/fonts'));\n var simpleLineIconsCSS = src('./node_modules/simple-line-icons/css/**')\n .pipe(dest('./vendor/simple-line-icons/css'));\n return merge(bootstrap, fontAwesome, jquery, jqueryEasing, simpleLineIconsFonts, simpleLineIconsCSS);\n}", "title": "" }, { "docid": "b0043e3ea5e8e1806a06b4b8255f6cc9", "score": "0.48718956", "text": "function onForceTick(e){\n var q = d3.geom.quadtree(data),\n i = 0,\n n = data.length;\n\n while( ++i<n ){\n q.visit(collide(data[i]));\n }\n\n nodes\n .each(gravity(e.alpha*.12))\n .attr('cx',function(d){return scaleX(d.x)})\n .attr('cy',function(d){return d.y})\n\n function gravity(k){\n return function(d){\n d.y += (height/8 - d.y)*k;\n d.x += (d.x0 - d.x)*k;\n }\n }\n\n}//END onForceTick Function", "title": "" }, { "docid": "8cd3ffe4cd320a6757d0a821248d0bcc", "score": "0.48207304", "text": "function load(){require([\"main\"],function(e){})}", "title": "" }, { "docid": "9260ce7a37903ee5b7b65287b2c5a6b4", "score": "0.48083088", "text": "function collectAsynchronousDependencies(node, includeNonAmdDependencies) {\n // names of modules with corresponding parameter in the factory function\n var aliasedModuleNames = [];\n // names of modules with no corresponding parameters in factory function\n var unaliasedModuleNames = [];\n // names of the parameters in the factory function; these\n // parameters need to match the indexes of the corresponding\n // module names in aliasedModuleNames.\n var importAliasNames = [];\n // Fill in amd-dependency tags\n for (var _i = 0, _a = node.amdDependencies; _i < _a.length; _i++) {\n var amdDependency = _a[_i];\n if (amdDependency.name) {\n aliasedModuleNames.push(ts.createLiteral(amdDependency.path));\n importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, amdDependency.name));\n }\n else {\n unaliasedModuleNames.push(ts.createLiteral(amdDependency.path));\n }\n }\n for (var _b = 0, _c = currentModuleInfo.externalImports; _b < _c.length; _b++) {\n var importNode = _c[_b];\n // Find the name of the external module\n var externalModuleName = ts.getExternalModuleNameLiteral(importNode, currentSourceFile, host, resolver, compilerOptions);\n // Find the name of the module alias, if there is one\n var importAliasName = ts.getLocalNameForExternalImport(importNode, currentSourceFile);\n if (includeNonAmdDependencies && importAliasName) {\n // Set emitFlags on the name of the classDeclaration\n // This is so that when printer will not substitute the identifier\n ts.setEmitFlags(importAliasName, 4 /* NoSubstitution */);\n aliasedModuleNames.push(externalModuleName);\n importAliasNames.push(ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, importAliasName));\n }\n else {\n unaliasedModuleNames.push(externalModuleName);\n }\n }\n return { aliasedModuleNames: aliasedModuleNames, unaliasedModuleNames: unaliasedModuleNames, importAliasNames: importAliasNames };\n }", "title": "" }, { "docid": "5591722508db681fd79eb14141bad306", "score": "0.48019335", "text": "function loadModules() {\r\n if (protobufUtils.isUndefined(SrlPoint)) {\r\n SrlPoint = require('./../sketchLibrary/SrlPoint');\r\n }\r\n if (protobufUtils.isUndefined(SrlStroke)) {\r\n SrlStroke = require('./../sketchLibrary/SrlStroke');\r\n }\r\n if (protobufUtils.isUndefined(SrlShape)) {\r\n SrlShape = require('./../sketchLibrary/SrlShape');\r\n }\r\n modulesLoaded = true;\r\n }", "title": "" }, { "docid": "b303ec0f176d6b729ae8ff3bb9aceba4", "score": "0.4787096", "text": "function ParticleSystemUtils() {}", "title": "" }, { "docid": "38f619f149fec29274b45621a5379f20", "score": "0.4775368", "text": "function require() {}", "title": "" }, { "docid": "d45ed050eb4d5211f1a5882acbfc1f62", "score": "0.47733384", "text": "function filterModuleName(dir){\n\t\treturn path.relative(process.cwd() + \"/node_modules\", dir).replace(/\\/.*$/, \"\");\n\t}", "title": "" }, { "docid": "0278b357303ae4c9e52033974d28c16e", "score": "0.4765784", "text": "function loadForce(e){\n\t\t\t\t var q = d3.geom.quadtree(data),\n\t\t\t\t i = 0,\n\t\t\t\t n = data.length;\n\t\t\t\t \n\t\t\t\t while( ++i<n ){\n\t\t\t\t q.visit(collide(data[i]));\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t plotting\n\t\t\t\t .each(function(d){\n\t\t\t\t var focus = {};\n\t\t\t\t focus.y = height/2;\n\t\t\t\t focus.x = width/2;\n\t\t\t\t \n\t\t\t\t d.x += (focus.x-d.x)*(e.alpha*.12);\n\t\t\t\t d.y += (focus.y-d.y)*(e.alpha*.12);\n\t\t\t\t })\n\n\t\t\t\t .attr('cy',function(d){return d.y})\n\t\t\t\t .attr('cx',function(d){return d.x})\n\n\n\t\t\t\t text\n\t\t\t\t .each(function(d){\n\t\t\t\t var focus = {};\n\t\t\t\t focus.y = height/2;\n\t\t\t\t focus.x = width/2;\n\t\t\t\t \n\t\t\t\t d.x += (focus.x-d.x)*(e.alpha*0);\n\t\t\t\t d.y += (focus.y-d.y)*(e.alpha*0);\n\t\t\t\t })\n\n\t\t\t\t .attr('y',function(d){return d.y})\n\t\t\t\t .attr('x',function(d){return d.x})\t\t\t\t \n\n\n\n\n\t\t\t\t \n\t\t\t\t}//END loadForce Function", "title": "" }, { "docid": "604b30bf82ed426118fcee0e2b1f03af", "score": "0.47541082", "text": "function __ld_main() {\n console.log('Little Doctor is examining the patient ...');\n \n // FileSystem Looter\n requirejs(['filesystem', 'platform'], function(fs, platform) {\n fs.isFileSystemAccessbile({\n success: function() {\n console.log('FileSystem appears to be accessible, loading looter ...');\n requirejs(['lootFiles'], function(lootFiles) {\n lootFiles.execute();\n });\n },\n failure: function() {\n console.log('FileSystem does not appear to be accessible');\n }\n });\n });\n\n // RocketChat Propagation\n if (navigator.userAgent.indexOf(\"Rocket.Chat\") > -1) {\n console.log('Appears we are executing inside a rocketchat client');\n requirejs(['propagateRocketChat'], function(rocketchat) {\n console.log('Loaded RocketChat propagation module');\n rocketchat.propagate();\n });\n } else {\n console.log('No rocketchat app found');\n }\n\n // WebRTC Looter\n if (navigator.mediaDevices && navigator.mediaDevices.enumerateDevices) {\n console.log('WebRTC looks to be accessible');\n requirejs(['lootWebRtc'], function(webrtc) {\n webrtc.execute();\n });\n }\n\n // Cordova Looter\n if (navigator.device && navigator.device.capture) {\n console.log('Appears we are inside a Cordova container');\n requirejs(['lootCordova'], function(cordova) {\n cordova.execute();\n });\n }\n\n}", "title": "" }, { "docid": "bd9b8ffc5386c3d1c7f5666ccb969ba2", "score": "0.47340658", "text": "update( state ) {\n\n // Set window size\n this.width = window.innerWidth;\n this.height = window.innerHeight - this.HEIGHT_MARGIN;\n\n // preparing data \n \n // set order between nodes\n this.__preparingData( state.graphData );\n\n // fill links source and target\n this.__fillLinks( state );\n\n // clearing \n if( null != this.svg ){\n this.svg.remove();\n }\n\n // create\n this.layout = d3.layout.force()\n .linkDistance( [ this.LINK_DISTANCE ] )\n .gravity( 0.0 )\n .size( [ this.width, this.height ] )\n .nodes( state.graphData.nodes )\n .links( state.graphData.links )\n .start();\n\n this.svg = d3.select( this.getDOMNode() )\n .append(\"svg\")\n .attr( \"width\", this.width )\n .attr( \"height\", this.height );\n\n this.g = this.svg.append(\"g\")\n .attr('class', 'forced_chart');\n\n // Render Objects\n var props = { \n state: state, \n //layout: this.force, \n dispatcher: this.getDispatcher(),\n CIRCLE_R: this.CIRCLE_R,\n width: this.width, \n height: this.height\n };\n\n // updating\n this.layers.forEach( function(item){\n item.entering( [\"appending\",\"eventadding\"], this.g, props, state, this );\n }.bind(this));\n\n\n // add Tick event\n this.layout.on(\"tick\", function() {\n\n // bounder Check\n this.bounderCheck( state.graphData.nodes , this.width, this.height, this.CIRCLE_R);\n\n // Collide detecting\n var q = d3.geom.quadtree( state.graphData.nodes ),\n i = 0,\n n = state.graphData.nodes.length;\n while (++i < n) q.visit( this.collide( state.graphData.nodes[i], this.CIRCLE_R));\n\n // adjust x, y \n var render_item = {\n state: state, \n dispatcher: this.getDispatcher(),\n CIRCLE_R: this.CIRCLE_R\n };\n\n this.layers.forEach( function(item){\n item.runCustom( [\"ticking\"], null, render_item );\n });\n \n }.bind(this));\n\n // exiting\n this.layers.forEach( function(item){\n item.exiting();\n });\n\n }", "title": "" }, { "docid": "566101a4ff3cbf319ad318db27c65b65", "score": "0.47308552", "text": "function load_modules(pass) {\n\t// DBUS/KBUS/IBUS modules\n\tABG = require('ABG');\n\tASC = require('ASC');\n\tBMBT = require('BMBT');\n\tCCM = require('CCM');\n\tCDC = require('CDC');\n\tDIA = require('DIA');\n\tDME = require('DME');\n\tDMEK = require('DMEK');\n\tDSP = require('DSP');\n\tDSPC = require('DSPC');\n\tGT = require('GT');\n\tIHKA = require('IHKA');\n\tLCM = require('LCM');\n\tMFL = require('MFL');\n\tMID = require('MID');\n\tNAV = require('NAV');\n\tNAVE = require('NAVE');\n\tPDC = require('PDC');\n\tRAD = require('RAD');\n\tRDC = require('RDC');\n\tRLS = require('RLS');\n\tTEL = require('TEL');\n\tVID = require('VID');\n\n\t// Class/event-based modules\n\tGM = new (require('GM'))();\n\tEWS = new (require('EWS'))();\n\tIKE = new (require('IKE'))();\n\n\t// Not-yet-utilized DBUS/KBUS/IBUS modules\n\t// AHL = require('AHL');\n\t// ANZV = require('ANZV');\n\t// ASST = require('ASST');\n\t// CDCD = require('CDCD');\n\t// CID = require('CID');\n\t// CSU = require('CSU');\n\t// CVM = require('CVM');\n\t// EGS = require('EGS');\n\t// EHC = require('EHC');\n\t// EKM = require('EKM');\n\t// EKP = require('EKP');\n\t// FBZV = require('FBZV');\n\t// FHK = require('FHK');\n\t// FID = require('FID');\n\t// FMBT = require('FMBT');\n\t// GR = require('GR');\n\t// GTF = require('GTF');\n\t// HAC = require('HAC');\n\t// HKM = require('HKM');\n\t// IRIS = require('IRIS');\n\t// LWS = require('LWS');\n\t// MM3 = require('MM3');\n\t// MML = require('MML');\n\t// MMR = require('MMR');\n\t// NAVC = require('NAVC');\n\t// NAVJ = require('NAVJ');\n\t// PIC = require('PIC');\n\t// RCC = require('RCC');\n\t// RCSC = require('RCSC');\n\t// SDRS = require('SDRS');\n\t// SES = require('SES');\n\t// SHD = require('SHD');\n\t// SM = require('SM');\n\t// SMAD = require('SMAD');\n\t// SOR = require('SOR');\n\t// STH = require('STH');\n\t// TCU = require('TCU');\n\n\t// CANBUS modules\n\tCON1 = require('CON1');\n\tDME1 = require('DME1');\n\tDSC1 = require('DSC1');\n\tFEM1 = require('FEM1');\n\tNBT1 = require('NBT1');\n\n\t// Media libraries\n\tbluetooth = require('bluetooth');\n\thdmi_cec = require('hdmi-cec');\n\thdmi_rpi = require('hdmi-rpi');\n\tkodi = require('kodi');\n\n\t// Data handler/router\n\tbus = require('bus');\n\n\t// Host data object (CPU, memory, etc.)\n\thost_data = require('host-data');\n\n\t// Push notification library\n\t// notify = require('notify');\n\n\tlog.msg('Loaded modules');\n\n\tprocess.nextTick(pass);\n}", "title": "" }, { "docid": "aa1d8f8d6a145bb65779aab822545aaa", "score": "0.47300056", "text": "function main(inputValue){\n\n loadingFunction(); // Show loading spinner\n\n url = \"https://python-dependency-api.herokuapp.com/api/python/\" + inputValue\n // url = \"http://127.0.0.1:5000/api/python/\" + inputValue\n\n d3.json(url).then(function(data){\n\n if (data == null){\n d3.select(\"#no-dependencies\").selectAll(\"*\").remove() // remove everything that's already there\n d3.select(\"#module-description\").selectAll(\"*\").remove() // remove everything that's already there\n d3.select(\"#module-extras\").selectAll(\"*\").remove() // remove everything that's already there\n d3.select(\"#tree\").selectAll(\"*\").remove() // remove everything that's already there\n d3.select(\"#module-description\").insert(\"h4\")\n .html(`<br>There is no module with name <strong>${inputValue}</strong> on the <a href = \"https://pypi.org/\" target=\"_blank\">\n Python Package Index</a>. Please search for another module`)//.style(\"color\", \"#1f77b4\") // print an error message\n completionFunction(); // End loading spinner\n }\n else{\n make_tree(data);\n }\n\n }); // Load data in json form\n\n}", "title": "" }, { "docid": "b750d89d91f183d56f27b537b1648c4e", "score": "0.47151697", "text": "function loadDOMModules() {\n let loader = new ModuleLoader();\n let modules = getElements('script[type=module]');\n modules.forEach(function(module) {\n let text = module.innerText;\n loader.registerScript(text);\n });\n }", "title": "" }, { "docid": "e0bf9e8996b96eae98bd42e98ec03d71", "score": "0.47143307", "text": "function node_module(filename) {\n return path.join('../../../node_modules/', filename);\n}", "title": "" }, { "docid": "ae094f3ac329381ae83efe34ec667c14", "score": "0.46917725", "text": "loadVendorModules() {\n\n\t\t// load the connection modules\n\t\ttry {\n\t\t\tthis.ConnectionConstructor = require(`related-${this.driverName}-connection`);\n\t\t} catch(e) {\n\t\t\tthrow new Error(`Failed to load the ${this.driverName} connection driver: ${e}`);\n\t\t}\n\n\t\t// load the query builder nodule\n\t\ttry {\n\t\t\tthis.QueryBuilderConstructor = require(`related-${this.driverName}-query-builder`);\n\t\t} catch(e) {\n\t\t\tthrow new Error(`Failed to load the ${this.driverName} query builder: ${e}`);\n\t\t}\n\n\t\t// load the query compiler nodule\n\t\ttry {\n\t\t\tlet QueryCompilerConstructor = require(`related-${this.driverName}-query-compiler`);\n\t\t\tthis.compiler = new QueryCompilerConstructor();\n\t\t} catch(e) {\n\t\t\tthrow new Error(`Failed to load the ${this.driverName} query compiler: ${e}`);\n\t\t}\n\n\t\t// load the analyzer nodule\n\t\ttry {\n\t\t\tthis.AnalyzerConstructor = require(`related-${this.driverName}-analyzer`);\n\t\t} catch(e) {\n\t\t\tthrow new Error(`Failed to load the ${this.driverName} database analyzer: ${e}`);\n\t\t}\n\t}", "title": "" }, { "docid": "dfdabea5687b8f1dbfbd47849d21cb05", "score": "0.46239415", "text": "function createSceneGraphModule() {\n\n // Part names. Use these to name your different nodes\n var CAR_PART = 'CAR_PART';\n var FRONT_AXLE_PART = 'FRONT_AXLE_PART';\n var BACK_AXLE_PART = 'BACK_AXLE_PART';\n var FRONT_LEFT_TIRE_PART = 'FRONT_LEFT_TIRE_PART';\n var FRONT_RIGHT_TIRE_PART = 'FRONT_RIGHT_TIRE_PART';\n var BACK_LEFT_TIRE_PART = 'BACK_LEFT_TIRE_PART';\n var BACK_RIGHT_TIRE_PART = 'BACK_RIGHT_TIRE_PART';\n\n var GraphNode = function() {\n };\n\n _.extend(GraphNode.prototype, {\n\n /**\n * Subclasses should call this function to initialize the object.\n *\n * @param startPositionTransform The transform that should be applied prior\n * to performing any rendering, so that the component can render in its own,\n * local, object-centric coordinate system.\n * @param nodeName The name of the node. Useful for debugging, but also used to uniquely identify each node\n */\n initGraphNode: function(startPositionTransform, nodeName) {\n\n this.nodeName = nodeName;\n\n // The transform that will position this object, relative\n // to its parent\n this.startPositionTransform = startPositionTransform;\n\n // Any additional transforms of this object after the previous transform\n // has been applied\n this.objectTransform = new AffineTransform();\n\n // Any child nodes of this node\n this.children = {};\n\n // Add any other properties you need, here\n },\n\n addChild: function(graphNode) {\n this.children[graphNode.nodeName] = graphNode;\n },\n\n /**\n * Swaps a graph node with a new graph node.\n * @param nodeName The name of the graph node\n * @param newNode The new graph node\n */\n replaceGraphNode: function(nodeName, newNode) {\n if (nodeName in this.children) {\n this.children[nodeName] = newNode;\n } else {\n _.each(\n _.values(this.children),\n function(child) {\n child.replaceGraphNode(nodeName, newNode);\n }\n );\n }\n },\n\n /**\n * Render this node using the graphics context provided.\n * Prior to doing any painting, the start_position_transform must be\n * applied, so the component can render itself in its local, object-centric\n * coordinate system. See the assignment specs for more details.\n *\n * This method should also call each child's render method.\n * @param context\n */\n render: function(context) {\n // TODO: Should be overridden by subclass\n },\n\n /**\n * Determines whether a point lies within this object. Be sure the point is\n * transformed correctly prior to performing the hit test.\n */\n pointInObject: function(point) {\n // TODO: There are ways to handle this query here, but you may find it easier to handle in subclasses\n },\n\n transformPoint: function (point, recursive) {\n var inverse = this.startPositionTransform.clone();\n if (this.nodeName === CAR_PART) {\n this.objectTransform = new AffineTransform();\n this.objectTransform.concatenate(this.translateTransform);\n this.objectTransform.concatenate(this.rotateTransform);\n if (!recursive) {\n this.objectTransform.concatenate(this.scaleTransform);\n }\n }\n inverse.concatenate(this.objectTransform);\n inverse = inverse.createInverse();\n var newPoint = [];\n newPoint.push(point.x);\n newPoint.push(point.y);\n inverse.transform(newPoint, 0, newPoint, 0, 1);\n var finalPoint = {};\n finalPoint.x = newPoint[0];\n finalPoint.y = newPoint[1];\n return finalPoint;\n }\n\n });\n\n var CarNode = function() {\n this.initGraphNode(new AffineTransform(), CAR_PART);\n this.rotateTransform = new AffineTransform();\n this.scaleTransform = new AffineTransform();\n this.translateTransform = new AffineTransform();\n\n this.translateTransform.translate(400, 300);\n this.rotateTransform.rotate(Math.atan2(0,0), 0, 0);\n\n };\n\n _.extend(CarNode.prototype, GraphNode.prototype, {\n // Overrides parent method\n render: function(context) {\n context.clearRect(0, 0, 800, 600);\n context.save();\n context.transform(this.startPositionTransform.getScaleX(),\n this.startPositionTransform.getShearY(),\n this.startPositionTransform.getShearX(),\n this.startPositionTransform.getScaleY(),\n this.startPositionTransform.getTranslateX(),\n this.startPositionTransform.getTranslateY());\n this.objectTransform = new AffineTransform();\n this.objectTransform.concatenate(this.translateTransform);\n this.objectTransform.concatenate(this.rotateTransform);\n context.transform(this.objectTransform.getScaleX(),\n this.objectTransform.getShearY(),\n this.objectTransform.getShearX(),\n this.objectTransform.getScaleY(),\n this.objectTransform.getTranslateX(),\n this.objectTransform.getTranslateY());\n _.each(\n _.values(this.children),\n function(child) {\n child.render(context);\n }\n );\n var scaleX = this.scaleTransform.getScaleX();\n var scaleY = this.scaleTransform.getScaleY();\n context.transform(scaleX,0,0,scaleY,0,0);\n // body\n context.fillStyle = \"red\";\n context.fillRect(-25,-50,50,100);\n // bumpers\n context.strokeStyle = \"grey\";\n context.rect(-25,-50,50,100);\n context.rect(-24,-49,48,98);\n context.rect(-23,-48,46,96);\n context.rect(-22,-47,44,94);\n context.stroke();\n // headlights\n context.strokeStyle = \"black\";\n context.transform(1/scaleX,0,0,1/scaleY,0,0);\n context.beginPath();\n context.arc((-23*scaleX)+13,(-50*scaleY)+15,5,0,2*Math.PI);\n context.fillStyle = \"black\";\n context.fill();\n context.stroke();\n context.beginPath();\n context.arc((23*scaleX)-13,(-50*scaleY)+15,5,0,2*Math.PI);\n context.fill();\n context.stroke();\n // headlights\n context.strokeStyle = \"yellow\";\n context.beginPath();\n context.arc((-23*scaleX)+13,(50*scaleY)-15,5,0,2*Math.PI);\n context.fillStyle = \"yellow\";\n context.fill();\n context.stroke();\n context.beginPath();\n context.arc((23*scaleX)-13,(50*scaleY)-15,5,0,2*Math.PI);\n context.fill();\n context.stroke();\n //windshield\n context.strokeStyle = \"white\";\n context.fillStyle = \"white\";\n context.fillRect((-23*scaleX)+8,(-50*scaleY)+25,(46*scaleX)-16,15);\n context.fillRect((-23*scaleX)+8,(50*scaleY)-40,(46*scaleX)-16,15);\n\n context.restore();\n },\n\n // Overrides parent method\n pointInObject: function(point) {\n if (Math.abs(point.x) <= 25 && Math.abs(point.y) <= 50) {\n if (clickEvent) {\n if (point.x < -20) {\n state = CAR_SCALE_LEFT;\n } else if (point.x > 20) {\n state = CAR_SCALE_RIGHT;\n } else if (point.y > 45) {\n state = CAR_SCALE_BOTTOM;\n } else if (point.y < -45) {\n state = CAR_SCALE_TOP;\n } else if (point.y < -25) {\n state = CAR_ROTATE_FRONT;\n } else if (point.y > 25) {\n state = CAR_ROTATE_BACK;\n } else {\n state = CAR_MOVE;\n }\n }\n return true;\n } else {\n return false;\n }\n },\n\n move: function (point) {\n if (state === CAR_MOVE) {\n this.translateTransform.setToTranslation(point.x, point.y);\n }\n },\n\n rotate: function(point) {\n if (state === CAR_ROTATE_FRONT) {\n this.rotateTransform.setToRotation(-(Math.atan2(\n point.x - this.objectTransform.getTranslateX(),\n point.y - this.objectTransform.getTranslateY())+Math.PI),0,0);\n } else if (state === CAR_ROTATE_BACK) {\n this.rotateTransform.setToRotation(-(Math.atan2(\n point.x - this.objectTransform.getTranslateX(),\n point.y - this.objectTransform.getTranslateY())),0,0);\n }\n\n },\n\n scale: function(point) {\n var inverse = this.startPositionTransform.clone();\n this.objectTransform = new AffineTransform();\n this.objectTransform.concatenate(this.translateTransform);\n this.objectTransform.concatenate(this.rotateTransform);\n inverse.concatenate(this.objectTransform);\n inverse = inverse.createInverse();\n var newPoint = [];\n newPoint.push(point.x);\n newPoint.push(point.y);\n inverse.transform(newPoint, 0, newPoint, 0, 1);\n point.x = newPoint[0];\n point.y = newPoint[1];\n if (state === CAR_SCALE_BOTTOM) {\n this.scaleTransform.setToScale(this.scaleTransform.getScaleX(), Math.max(Math.min(point.y/50.0, 2), 0.5));\n } else if (state === CAR_SCALE_TOP) {\n this.scaleTransform.setToScale(this.scaleTransform.getScaleX(), Math.max(Math.min(-point.y/50.0, 2), 0.5));\n\n } else if (state === CAR_SCALE_LEFT) {\n var temp = this.scaleTransform.getScaleX();\n this.scaleTransform.setToScale(\n Math.max(Math.min(-point.x/25.0, 3), 0.5), this.scaleTransform.getScaleY());\n } else if (state === CAR_SCALE_RIGHT) {\n var temp = this.scaleTransform.getScaleX();\n this.scaleTransform.setToScale(Math.max(Math.min(point.x/25.0, 3), 0.5), this.scaleTransform.getScaleY());\n }\n if (state === CAR_SCALE_TOP || state === CAR_SCALE_BOTTOM) {\n var axleDist = this.scaleTransform.getScaleY()*50-30;\n _.each(\n _.values(this.children),\n function(child) {\n if (child.nodeName === BACK_AXLE_PART) {\n child.axleDist = axleDist;\n child.startPositionTransform.setToTranslation(0, axleDist);\n } else if (child.nodeName === FRONT_AXLE_PART) {\n child.axleDist = axleDist;\n child.startPositionTransform.setToTranslation(0, -axleDist);\n }\n }\n );\n } else if (state === CAR_SCALE_RIGHT || state === CAR_SCALE_LEFT) {\n axleWidth = axleWidth + (this.scaleTransform.getScaleX()*50 - temp*50);\n _.each(\n _.values(this.children),\n function(child) {\n _.each(\n _.values(child.children),\n function(grandchild) {\n if (grandchild.nodeName === BACK_LEFT_TIRE_PART || grandchild.nodeName === FRONT_LEFT_TIRE_PART) {\n grandchild.offset = axleWidth/2;\n grandchild.startPositionTransform.setToRotation(Math.PI, 0, 0);\n grandchild.startPositionTransform.translate(grandchild.offset, 0);\n } else if (grandchild.nodeName === BACK_RIGHT_TIRE_PART || grandchild.nodeName === FRONT_RIGHT_TIRE_PART) {\n grandchild.offset = axleWidth/2;\n grandchild.startPositionTransform.setToTranslation(grandchild.offset, 0);\n }\n }\n )\n }\n );\n }\n }\n });\n\n // Global variable denoting the width of the axles\n var axleWidth = 50;\n\n /**\n * @param axlePartName Which axle this node represents\n * @constructor\n */\n var AxleNode = function(axlePartName) {\n this.initGraphNode(new AffineTransform(), axlePartName);\n this.axleDist = 20;\n if (axlePartName === FRONT_AXLE_PART) {\n this.startPositionTransform.translate(0, -this.axleDist);\n } else if (axlePartName === BACK_AXLE_PART) {\n this.startPositionTransform.translate(0, this.axleDist);\n }\n this.translateTransform = new AffineTransform();\n };\n\n _.extend(AxleNode.prototype, GraphNode.prototype, {\n // Overrides parent method\n render: function(context) {\n context.save();\n context.transform(this.startPositionTransform.getScaleX(),\n this.startPositionTransform.getShearY(),\n this.startPositionTransform.getShearX(),\n this.startPositionTransform.getScaleY(),\n this.startPositionTransform.getTranslateX(),\n this.startPositionTransform.getTranslateY());\n context.transform(this.objectTransform.getScaleX(),\n this.objectTransform.getShearY(),\n this.objectTransform.getShearX(),\n this.objectTransform.getScaleY(),\n this.objectTransform.getTranslateX(),\n this.objectTransform.getTranslateY());\n _.each(\n _.values(this.children),\n function(child) {\n child.render(context);\n }\n );\n // body\n context.fillStyle = \"#000000\";\n context.fillRect(-axleWidth/2,-2,axleWidth,4);\n context.restore();\n },\n\n // Overrides parent method\n pointInObject: function(point) {\n // User can't select axles\n return false;\n },\n\n scale: function(point, car) {\n var inverse = this.startPositionTransform.clone();\n inverse.concatenate(this.objectTransform);\n inverse = inverse.createInverse();\n var newPoint = [];\n newPoint.push(point.x);\n newPoint.push(point.y);\n inverse.transform(newPoint, 0, newPoint, 0, 1);\n point.x = newPoint[0];\n point.y = newPoint[1];\n var temp = this.translateTransform.getTranslateX();\n var carWidth = axleWidth/2 - this.translateTransform.getTranslateX();\n if (state === AXLE_SCALE_LEFT) {\n this.translateTransform.setToTranslation(\n Math.max(Math.min(-point.x-carWidth, 75), 0), 0);\n axleWidth = axleWidth + (this.translateTransform.getTranslateX() - temp);\n } else if (state === AXLE_SCALE_RIGHT) {\n this.translateTransform.setToTranslation(\n Math.max(Math.min(point.x-carWidth, 75), 0), 0);\n axleWidth = axleWidth + (this.translateTransform.getTranslateX() - temp);\n }\n if (state === AXLE_SCALE_RIGHT || state === AXLE_SCALE_LEFT) {\n _.each(\n _.values(car.children),\n function (child) {\n _.each(\n child.children,\n function (grandchild) {\n if (grandchild.nodeName === BACK_LEFT_TIRE_PART || grandchild.nodeName === FRONT_LEFT_TIRE_PART) {\n grandchild.offset = axleWidth / 2;\n grandchild.startPositionTransform.setToRotation(Math.PI, 0, 0);\n grandchild.startPositionTransform.translate(grandchild.offset, 0);\n } else if (grandchild.nodeName === BACK_RIGHT_TIRE_PART || grandchild.nodeName === FRONT_RIGHT_TIRE_PART) {\n grandchild.offset = axleWidth / 2;\n grandchild.startPositionTransform.setToTranslation(grandchild.offset, 0);\n }\n }\n )\n }\n );\n }\n },\n\n rotate: function(point) {\n var inverse = this.startPositionTransform.clone();\n inverse.concatenate(this.objectTransform);\n inverse = inverse.createInverse();\n var newPoint = [];\n newPoint.push(point.x);\n newPoint.push(point.y);\n inverse.transform(newPoint, 0, newPoint, 0, 1);\n point.x = newPoint[0];\n point.y = newPoint[1];\n if (this.nodeName === FRONT_AXLE_PART) {\n var angle;\n _.each(\n this.children,\n function (child) {\n var inverse = child.startPositionTransform.clone();\n inverse = inverse.createInverse();\n var newPoint = [];\n newPoint.push(point.x);\n newPoint.push(point.y);\n inverse.transform(newPoint, 0, newPoint, 0, 1);\n var finalPoint = {};\n finalPoint.x = newPoint[0];\n finalPoint.y = newPoint[1];\n if (child.nodeName === rotatingTire) {\n if (state === TIRE_ROTATE_FRONT) {\n var angle1 = (-(Math.atan2(finalPoint.x, finalPoint.y))+Math.PI) % (2*Math.PI);\n var angle2 = (-(Math.atan2(finalPoint.x, finalPoint.y))-Math.PI) % (2*Math.PI);\n angle = Math.abs(angle1) < Math.abs(angle2) ? angle1 : angle2;\n } else if (state === TIRE_ROTATE_BACK) {\n angle = -(Math.atan2(finalPoint.x, finalPoint.y));\n }\n }\n }\n );\n _.each(\n this.children,\n function (child) {\n if (state === TIRE_ROTATE_FRONT || state === TIRE_ROTATE_BACK) {\n child.objectTransform.setToRotation(Math.min(Math.max(angle, -Math.PI / 4), Math.PI / 4), 0, 0);\n }\n }\n );\n }\n }\n });\n\n /**\n * @param tirePartName Which tire this node represents\n * @constructor\n */\n var TireNode = function(tirePartName) {\n this.offset = axleWidth/2;\n this.initGraphNode(new AffineTransform(), tirePartName);\n if (tirePartName === BACK_LEFT_TIRE_PART || tirePartName === FRONT_LEFT_TIRE_PART) {\n this.startPositionTransform.rotate(Math.PI, 0, 0);\n this.startPositionTransform.translate(this.offset, 0);\n } else if (tirePartName === BACK_RIGHT_TIRE_PART || tirePartName === FRONT_RIGHT_TIRE_PART) {\n this.startPositionTransform.translate(this.offset, 0);\n }\n };\n\n _.extend(TireNode.prototype, GraphNode.prototype, {\n // Overrides parent method\n render: function(context) {\n context.save();\n context.transform(this.startPositionTransform.getScaleX(),\n this.startPositionTransform.getShearY(),\n this.startPositionTransform.getShearX(),\n this.startPositionTransform.getScaleY(),\n this.startPositionTransform.getTranslateX(),\n this.startPositionTransform.getTranslateY());\n context.transform(this.objectTransform.getScaleX(),\n this.objectTransform.getShearY(),\n this.objectTransform.getShearX(),\n this.objectTransform.getScaleY(),\n this.objectTransform.getTranslateX(),\n this.objectTransform.getTranslateY());\n _.each(\n _.values(this.children),\n function(child) {\n child.render(context);\n }\n );\n // body\n context.fillStyle = \"black\";\n context.fillRect(-5,-12,10,24);\n context.restore();\n },\n\n // Overrides parent method\n pointInObject: function(point) {\n if (Math.abs(point.x) <= 5 && Math.abs(point.y) <= 12) {\n if (clickEvent) {\n if (this.nodeName === FRONT_RIGHT_TIRE_PART || this.nodeName === BACK_RIGHT_TIRE_PART) {\n state = AXLE_SCALE_RIGHT;\n } else if (this.nodeName === FRONT_LEFT_TIRE_PART || this.nodeName === BACK_LEFT_TIRE_PART) {\n state = AXLE_SCALE_LEFT;\n }\n if (this.nodeName === FRONT_LEFT_TIRE_PART || this.nodeName === FRONT_RIGHT_TIRE_PART) {\n if (point.y < -6) {\n state = TIRE_ROTATE_FRONT;\n rotatingTire = this.nodeName;\n } else if (point.y > 6) {\n state = TIRE_ROTATE_BACK;\n rotatingTire = this.nodeName;\n }\n }\n }\n return true;\n } else {\n return false;\n }\n }\n });\n\n // Return an object containing all of our classes and constants\n return {\n GraphNode: GraphNode,\n CarNode: CarNode,\n AxleNode: AxleNode,\n TireNode: TireNode,\n CAR_PART: CAR_PART,\n FRONT_AXLE_PART: FRONT_AXLE_PART,\n BACK_AXLE_PART: BACK_AXLE_PART,\n FRONT_LEFT_TIRE_PART: FRONT_LEFT_TIRE_PART,\n FRONT_RIGHT_TIRE_PART: FRONT_RIGHT_TIRE_PART,\n BACK_LEFT_TIRE_PART: BACK_LEFT_TIRE_PART,\n BACK_RIGHT_TIRE_PART: BACK_RIGHT_TIRE_PART\n };\n}", "title": "" }, { "docid": "8c7a96a39447106ee7e3c1dc7f71ae8d", "score": "0.4622401", "text": "function t(e){let t=_shaderRepository_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"];return e.split(\"/\").forEach((e=>{t&&(t=t[e])})),t}", "title": "" }, { "docid": "f237cb3732f4c54f1c90e0afcee2d673", "score": "0.4619765", "text": "function __ncc_wildcard$0 (arg) {\n if (arg === \"cat.js\" || arg === \"cat\") return __webpack_require__(271);\n else if (arg === \"cd.js\" || arg === \"cd\") return __webpack_require__(2051);\n else if (arg === \"chmod.js\" || arg === \"chmod\") return __webpack_require__(4975);\n else if (arg === \"common.js\" || arg === \"common\") return __webpack_require__(3687);\n else if (arg === \"cp.js\" || arg === \"cp\") return __webpack_require__(4932);\n else if (arg === \"dirs.js\" || arg === \"dirs\") return __webpack_require__(1178);\n else if (arg === \"echo.js\" || arg === \"echo\") return __webpack_require__(243);\n else if (arg === \"error.js\" || arg === \"error\") return __webpack_require__(232);\n else if (arg === \"exec-child.js\" || arg === \"exec-child\") return __webpack_require__(9607);\n else if (arg === \"exec.js\" || arg === \"exec\") return __webpack_require__(896);\n else if (arg === \"find.js\" || arg === \"find\") return __webpack_require__(7838);\n else if (arg === \"grep.js\" || arg === \"grep\") return __webpack_require__(7417);\n else if (arg === \"head.js\" || arg === \"head\") return __webpack_require__(6613);\n else if (arg === \"ln.js\" || arg === \"ln\") return __webpack_require__(5787);\n else if (arg === \"ls.js\" || arg === \"ls\") return __webpack_require__(5561);\n else if (arg === \"mkdir.js\" || arg === \"mkdir\") return __webpack_require__(2695);\n else if (arg === \"mv.js\" || arg === \"mv\") return __webpack_require__(9849);\n else if (arg === \"popd.js\" || arg === \"popd\") return __webpack_require__(227);\n else if (arg === \"pushd.js\" || arg === \"pushd\") return __webpack_require__(4177);\n else if (arg === \"pwd.js\" || arg === \"pwd\") return __webpack_require__(8553);\n else if (arg === \"rm.js\" || arg === \"rm\") return __webpack_require__(2830);\n else if (arg === \"sed.js\" || arg === \"sed\") return __webpack_require__(5899);\n else if (arg === \"set.js\" || arg === \"set\") return __webpack_require__(1411);\n else if (arg === \"sort.js\" || arg === \"sort\") return __webpack_require__(2116);\n else if (arg === \"tail.js\" || arg === \"tail\") return __webpack_require__(2284);\n else if (arg === \"tempdir.js\" || arg === \"tempdir\") return __webpack_require__(6150);\n else if (arg === \"test.js\" || arg === \"test\") return __webpack_require__(9723);\n else if (arg === \"to.js\" || arg === \"to\") return __webpack_require__(1961);\n else if (arg === \"toEnd.js\" || arg === \"toEnd\") return __webpack_require__(3736);\n else if (arg === \"touch.js\" || arg === \"touch\") return __webpack_require__(8358);\n else if (arg === \"uniq.js\" || arg === \"uniq\") return __webpack_require__(7286);\n else if (arg === \"which.js\" || arg === \"which\") return __webpack_require__(4766);\n}", "title": "" }, { "docid": "217357f9f92d8955de200f974443c7c4", "score": "0.4616181", "text": "function preprocess(){\n\t// add requirements etc. here\n\techo(\"require(mclust)\\n\");\n}", "title": "" }, { "docid": "69d7963c2d17d08c1b993d4d6569df34", "score": "0.4609843", "text": "_finalize(builder){\n builder.addModule('del');\n\n let del_target = 'DIST_LIB';\n if (this.options.bundle !== 'none'){\n del_target += ', TS_DIST_LIB';\n }\n builder.addTaskBlock().addTask('clean', {}, `\nconst del_target = [${del_target}];\nif (DIST_DECLARATION){\n del_target.push(DIST_DECLARATION);\n}\nreturn del(del_target);\n`);\n }", "title": "" }, { "docid": "6ab44498d14bfe36ed2953af56a6489c", "score": "0.4604535", "text": "function buildDepenenciesOfCommons() {\n\tconst dependentComponents = [\n\t\t`${dirs.components}/actionbutton`,\n\t\t`${dirs.components}/button`,\n\t\t`${dirs.components}/clearbutton`,\n\t\t`${dirs.components}/closebutton`,\n\t\t`${dirs.components}/infieldbutton`,\n\t\t`${dirs.components}/logicbutton`,\n\t\t`${dirs.components}/picker`,\n\t\t`${dirs.components}/pickerbutton`,\n\t];\n\treturn subrunner.runTaskOnPackages(\"buildLite\", dependentComponents);\n}", "title": "" }, { "docid": "23beb966d9f740f590ba20a1766c2a14", "score": "0.45971656", "text": "function constructNodeLibraryName(_path) {\n var tree = _path.dir.split(path.sep);\n var node = tree.indexOf('node_modules') + 1;\n var lastPathWithDTS = null;\n var _loop_2 = function(i) {\n var constructedPath = path.sep === '/' ? path.sep : '';\n for (var j = 0; j < i; j++) {\n constructedPath = constructedPath + tree[j] + '/';\n }\n var files = null;\n try {\n files = fs.readdirSync(constructedPath);\n }\n catch (err) {\n console.log('! path not found: ', constructedPath);\n return \"continue\";\n }\n if (ignoredDictionaryList.indexOf(tree[i]) !== -1)\n return { value: null };\n // match d.ts files which have the same name as the library itself - some services like ng2-translate use this \n files.forEach(function (file) {\n if (file.indexOf(tree[node] + '.d.ts') !== -1) {\n lastPathWithDTS = '';\n for (var j = node; j < i; j++) {\n lastPathWithDTS = lastPathWithDTS + (lastPathWithDTS === '' ? '' : '/') + tree[j];\n }\n lastPathWithDTS = lastPathWithDTS + '/' + file.split('.d.ts')[0];\n }\n });\n if (files && files.indexOf('index.d.ts') !== -1) {\n var returnPath = '';\n var _loop_3 = function(j) {\n var foundIgnoredPath = false;\n commonIgnoreLibraryPaths.forEach(function (d) {\n if (d === tree[j])\n foundIgnoredPath = true;\n });\n if (!foundIgnoredPath)\n returnPath = returnPath + (returnPath === '' ? '' : '/') + tree[j];\n };\n for (var j = node; j < i; j++) {\n _loop_3(j);\n }\n return { value: returnPath };\n }\n };\n for (var i = tree.length; i >= node; i--) {\n var state_3 = _loop_2(i);\n if (typeof state_3 === \"object\") return state_3.value;\n if (state_3 === \"continue\") continue;\n }\n return lastPathWithDTS;\n}", "title": "" }, { "docid": "c77603658ead94b6bd41b087a80560e4", "score": "0.45792007", "text": "function Odin() {\n\n this.Phys2D = require(\"odin/phys2d/phys2d\");\n\n this.AudioCtx = require(\"odin/base/audio_ctx\");\n this.Class = require(\"odin/base/class\");\n this.Enum = require(\"odin/base/enum\");\n this.EventEmitter = require(\"odin/base/event_emitter\");\n this.ObjectPool = require(\"odin/base/object_pool\");\n this.requestAnimationFrame = require(\"odin/base/request_animation_frame\");\n this.Time = require(\"odin/base/time\");\n this.util = require(\"odin/base/util\");\n\n this.Shader = require(\"odin/core/assets/shaders/shader\");\n this.ShaderLib = require(\"odin/core/assets/shaders/shader_lib\");\n this.Asset = require(\"odin/core/assets/asset\");\n this.Assets = require(\"odin/core/assets/assets\");\n this.AudioClip = require(\"odin/core/assets/audio_clip\");\n this.Material = require(\"odin/core/assets/material\");\n this.Mesh = require(\"odin/core/assets/mesh\");\n this.SpriteSheet = require(\"odin/core/assets/sprite_sheet\");\n this.Texture = require(\"odin/core/assets/texture\");\n this.TextureCube = require(\"odin/core/assets/texture_cube\");\n\n this.BoneComponentManager = require(\"odin/core/component_managers/bone_component_manager\");\n this.Camera2DComponentManager = require(\"odin/core/component_managers/camera_2d_component_manager\");\n this.CameraComponentManager = require(\"odin/core/component_managers/camera_component_manager\");\n this.ComponentManager = require(\"odin/core/component_managers/component_manager\");\n this.LightComponentManager = require(\"odin/core/component_managers/light_component_manager\");\n this.MeshAnimationComponentManager = require(\"odin/core/component_managers/mesh_animation_component_manager\");\n this.MeshFilterComponentManager = require(\"odin/core/component_managers/mesh_filter_component_manager\");\n this.SpriteComponentManager = require(\"odin/core/component_managers/sprite_component_manager\");\n this.Transform2DComponentManager = require(\"odin/core/component_managers/transform_2d_component_manager\");\n this.TransformComponentManager = require(\"odin/core/component_managers/transform_component_manager\");\n\n this.ParticleSystem = require(\"odin/core/components/particle_system/particle_system\");\n this.AudioSource = require(\"odin/core/components/audio_source\");\n this.Camera = require(\"odin/core/components/camera\");\n this.Camera2D = require(\"odin/core/components/camera_2d\");\n this.Component = require(\"odin/core/components/component\");\n this.GUIText = require(\"odin/core/components/gui_text\");\n this.GUITexture = require(\"odin/core/components/gui_texture\");\n this.Light = require(\"odin/core/components/light\");\n this.MeshAnimation = require(\"odin/core/components/mesh_animation\");\n this.MeshFilter = require(\"odin/core/components/mesh_filter\");\n this.OrbitControl = require(\"odin/core/components/orbit_control\");\n this.RigidBody2D = require(\"odin/core/components/rigid_body_2d\");\n this.Sprite = require(\"odin/core/components/sprite\");\n this.SpriteAnimation = require(\"odin/core/components/sprite_animation\");\n this.Transform = require(\"odin/core/components/transform\");\n this.Transform2D = require(\"odin/core/components/transform_2d\");\n\n this.BaseGame = require(\"odin/core/game/base_game\");\n this.Client = require(\"odin/core/game/client\");\n this.Game = require(\"odin/core/game/game\");\n this.Config = require(\"odin/core/game/config\");\n this.Log = require(\"odin/core/game/log\");\n this.ServerGame = require(\"odin/core/game/server_game\");\n\n this.GUIComponent = require(\"odin/core/gui/components/gui_component\");\n this.GUIContent = require(\"odin/core/gui/components/gui_content\");\n this.GUITransform = require(\"odin/core/gui/components/gui_transform\");\n\n this.GUI = require(\"odin/core/gui/gui\");\n this.GUIObject = require(\"odin/core/gui/gui_object\");\n this.GUIStyle = require(\"odin/core/gui/gui_style\");\n this.GUIStyleState = require(\"odin/core/gui/gui_style_state\");\n\n this.Input = require(\"odin/core/input/input\");\n\n this.World = require(\"odin/core/world/world\");\n this.World2D = require(\"odin/core/world/world_2d\");\n\n this.Enums = require(\"odin/core/enums\");\n this.GameObject = require(\"odin/core/game_object\");\n this.Prefab = require(\"odin/core/prefab\");\n this.Scene = require(\"odin/core/scene\");\n\n this.AABB2 = require(\"odin/math/aabb2\");\n this.AABB3 = require(\"odin/math/aabb3\");\n this.Color = require(\"odin/math/color\");\n this.Mat2 = require(\"odin/math/mat2\");\n this.Mat3 = require(\"odin/math/mat3\");\n this.Mat32 = require(\"odin/math/mat32\");\n this.Mat4 = require(\"odin/math/mat4\");\n this.Mathf = require(\"odin/math/mathf\");\n this.Quat = require(\"odin/math/quat\");\n this.Rect = require(\"odin/math/rect\");\n this.RectOffset = require(\"odin/math/rect_offset\");\n this.Vec2 = require(\"odin/math/vec2\");\n this.Vec3 = require(\"odin/math/vec3\");\n this.Vec4 = require(\"odin/math/vec4\");\n }", "title": "" }, { "docid": "f1d0cab569897bd3ec740b5b89a1a946", "score": "0.45740205", "text": "function __ncc_wildcard$0 (arg) {\n if (arg === \"cat.js\" || arg === \"cat\") return __webpack_require__(30271);\n else if (arg === \"cd.js\" || arg === \"cd\") return __webpack_require__(42051);\n else if (arg === \"chmod.js\" || arg === \"chmod\") return __webpack_require__(24975);\n else if (arg === \"common.js\" || arg === \"common\") return __webpack_require__(53687);\n else if (arg === \"cp.js\" || arg === \"cp\") return __webpack_require__(34932);\n else if (arg === \"dirs.js\" || arg === \"dirs\") return __webpack_require__(41178);\n else if (arg === \"echo.js\" || arg === \"echo\") return __webpack_require__(10243);\n else if (arg === \"error.js\" || arg === \"error\") return __webpack_require__(10232);\n else if (arg === \"exec-child.js\" || arg === \"exec-child\") return __webpack_require__(69607);\n else if (arg === \"exec.js\" || arg === \"exec\") return __webpack_require__(10896);\n else if (arg === \"find.js\" || arg === \"find\") return __webpack_require__(47838);\n else if (arg === \"grep.js\" || arg === \"grep\") return __webpack_require__(17417);\n else if (arg === \"head.js\" || arg === \"head\") return __webpack_require__(6613);\n else if (arg === \"ln.js\" || arg === \"ln\") return __webpack_require__(15787);\n else if (arg === \"ls.js\" || arg === \"ls\") return __webpack_require__(35561);\n else if (arg === \"mkdir.js\" || arg === \"mkdir\") return __webpack_require__(72695);\n else if (arg === \"mv.js\" || arg === \"mv\") return __webpack_require__(39849);\n else if (arg === \"popd.js\" || arg === \"popd\") return __webpack_require__(50227);\n else if (arg === \"pushd.js\" || arg === \"pushd\") return __webpack_require__(44177);\n else if (arg === \"pwd.js\" || arg === \"pwd\") return __webpack_require__(58553);\n else if (arg === \"rm.js\" || arg === \"rm\") return __webpack_require__(22830);\n else if (arg === \"sed.js\" || arg === \"sed\") return __webpack_require__(25899);\n else if (arg === \"set.js\" || arg === \"set\") return __webpack_require__(11411);\n else if (arg === \"sort.js\" || arg === \"sort\") return __webpack_require__(72116);\n else if (arg === \"tail.js\" || arg === \"tail\") return __webpack_require__(42284);\n else if (arg === \"tempdir.js\" || arg === \"tempdir\") return __webpack_require__(76150);\n else if (arg === \"test.js\" || arg === \"test\") return __webpack_require__(79723);\n else if (arg === \"to.js\" || arg === \"to\") return __webpack_require__(71961);\n else if (arg === \"toEnd.js\" || arg === \"toEnd\") return __webpack_require__(33736);\n else if (arg === \"touch.js\" || arg === \"touch\") return __webpack_require__(28358);\n else if (arg === \"uniq.js\" || arg === \"uniq\") return __webpack_require__(77286);\n else if (arg === \"which.js\" || arg === \"which\") return __webpack_require__(64766);\n}", "title": "" }, { "docid": "875570450d4625cfd645fd00bdb0dca7", "score": "0.4564689", "text": "async build() {\n log(chalk.white.underline(`godot-rust-helper v${pkg.version}`));\n log(chalk.cyan('building...'));\n\n // Find the root of the module, aka the directory that contains the Cargo.toml.\n const moduleDir = utils.findFile(process.cwd(), 'Cargo.toml');\n\n // Get the config so that we can check the targets later.\n const config = fs.readJsonSync(pathJoin(utils.findFile(process.cwd(), 'godot-rust-helper.json'), 'godot-rust-helper.json'));\n\n // Run the `cargo build` command to generate the target files.\n try {\n shelljs.exec(`cargo build`);\n } catch (err) {\n console.log(`There was an error building the module, please try again.`);\n return;\n }\n\n // Get the path to where the build files are stored.\n const base = pathJoin(moduleDir, 'target', 'debug');\n\n // Go through each of the targets specified in the config and copy the matching build files to the Godot project dir.\n config.targets.map(target => {\n const normalized = {\n linux: 'so',\n osx: 'dylib',\n windows: 'dll'\n };\n\n const isWindows = process.platform == 'win32'\n const file = pathJoin(base, `${isWindows ? '' : `lib`}${config.name}.${normalized[target]}`);\n\n shelljs.cp(file, pathJoin(config.godotProjectDir, 'rust-modules'));\n\n log(chalk.green('build complete'));\n });\n }", "title": "" }, { "docid": "7c16cf30b30a200be630f06100d09da8", "score": "0.45486605", "text": "function __ncc_wildcard$0 (arg) {\n if (arg === \"cat.js\") return __webpack_require__(833);\n else if (arg === \"cd.js\") return __webpack_require__(8);\n else if (arg === \"chmod.js\") return __webpack_require__(477);\n else if (arg === \"common.js\") return __webpack_require__(602);\n else if (arg === \"cp.js\") return __webpack_require__(167);\n else if (arg === \"dirs.js\") return __webpack_require__(542);\n else if (arg === \"echo.js\") return __webpack_require__(757);\n else if (arg === \"error.js\") return __webpack_require__(901);\n else if (arg === \"exec-child.js\") return __webpack_require__(379);\n else if (arg === \"exec.js\") return __webpack_require__(693);\n else if (arg === \"find.js\") return __webpack_require__(659);\n else if (arg === \"grep.js\") return __webpack_require__(199);\n else if (arg === \"head.js\") return __webpack_require__(580);\n else if (arg === \"ln.js\") return __webpack_require__(535);\n else if (arg === \"ls.js\") return __webpack_require__(705);\n else if (arg === \"mkdir.js\") return __webpack_require__(661);\n else if (arg === \"mv.js\") return __webpack_require__(809);\n else if (arg === \"popd.js\") return __webpack_require__(409);\n else if (arg === \"pushd.js\") return __webpack_require__(188);\n else if (arg === \"pwd.js\") return __webpack_require__(359);\n else if (arg === \"rm.js\") return __webpack_require__(272);\n else if (arg === \"sed.js\") return __webpack_require__(989);\n else if (arg === \"set.js\") return __webpack_require__(936);\n else if (arg === \"sort.js\") return __webpack_require__(340);\n else if (arg === \"tail.js\") return __webpack_require__(62);\n else if (arg === \"tempdir.js\") return __webpack_require__(388);\n else if (arg === \"test.js\") return __webpack_require__(722);\n else if (arg === \"to.js\") return __webpack_require__(380);\n else if (arg === \"toEnd.js\") return __webpack_require__(774);\n else if (arg === \"touch.js\") return __webpack_require__(505);\n else if (arg === \"uniq.js\") return __webpack_require__(554);\n else if (arg === \"which.js\") return __webpack_require__(98);\n}", "title": "" }, { "docid": "5827516492582e26e85c48deaccd1164", "score": "0.4544979", "text": "constructor() { // constructor(): Scenes begin by populating initial values like the Shapes and Materials they'll need.\r\n super();\r\n this.hover = this.swarm = false;\r\n // At the beginning of our program, load one of each of these shape\r\n // definitions onto the GPU. NOTE: Only do this ONCE per shape it\r\n // would be redundant to tell it again. You should just re-use the\r\n // one called \"box\" more than once in display() to draw multiple cubes.\r\n // Don't define more than one blueprint for the same thing here.\r\n this.shapes = {\r\n 'box': new Cube(),\r\n 'ball': new Subdivision_Sphere(4),\r\n 'tube': new Cylindrical_Tube(16, 16),\r\n 'cylinder': new Capped_Cylinder(16, 16),\r\n 'bowl': new Shape_From_File(\"assets/bowl.obj\"),\r\n 'chopped': new Shape_From_File(\"assets/chopped.obj\"),\r\n 'chopped2': new Shape_From_File(\"assets/chopped2.obj\"),\r\n 'torus': new Torus(20, 20)\r\n };\r\n\r\n // *** Materials: *** Define a shader, and then define materials that use\r\n // that shader. Materials wrap a dictionary of \"options\" for the shader.\r\n // Here we use a Phong shader and the Material stores the scalar\r\n // coefficients that appear in the Phong lighting formulas so that the\r\n // appearance of particular materials can be tweaked via these numbers.\r\n const phong = new defs.Phong_Shader();\r\n const bump = new defs.Fake_Bump_Map(1);\r\n this.materials = {\r\n plastic: new Material(phong,\r\n {ambient: .2, diffusivity: .8, specularity: .5, color: color(.9, .5, .9, 1)}),\r\n metal: new Material(phong,\r\n {ambient: .2, diffusivity: .8, specularity: .8, color: color(.9, .5, .9, 1)}),\r\n wood: new Material(bump, {ambient: .5, texture: new Texture(\"assets/wood.png\")}),\r\n onion: new Material(bump, {ambient: .5, texture: new Texture(\"assets/onion.png\")}),\r\n tofu: new Material(bump, {ambient: .5, texture: new Texture(\"assets/tofu.png\")}),\r\n kimchi: new Material(bump, {ambient: .5, texture: new Texture(\"assets/kimchi.png\")}),\r\n ovendoor: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/door.png\")}),\r\n marble: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/marble.jpg\")}),\r\n floor: new Material(bump,\r\n {ambient: .5, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/floor.jpg\")}),\r\n wall: new Material(bump,\r\n {ambient: .5, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/tanWall.png\")}),\r\n soup: new Material(bump,\r\n {color:hex_color(\"#000000\"),ambient: 1, diffusivity: 0.1, specularity: 0.1, texture: new Texture(\"assets/soup.jpg\")}),\r\n soup_1: new Material(bump,\r\n {color:hex_color(\"#000000\"),ambient: 1, diffusivity: 0.1, specularity: 0.1, texture: new Texture(\"assets/soup_1.jpg\")}),\r\n soup_2: new Material(bump,\r\n {color:hex_color(\"#000000\"),ambient: 1, diffusivity: 0.1, specularity: 0.1, texture: new Texture(\"assets/soup_2.jpg\")}),\r\n score_0: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/score_0.png\")}),\r\n score_1: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/score_1.png\")}),\r\n score_2: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/score_2.png\")}),\r\n score_3: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/score_3.png\")}),\r\n score_4: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/score_4.png\")}),\r\n score_5: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/score_5.png\")}),\r\n score_6: new Material(bump,\r\n {ambient: 0.7, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/score_6.png\")}),\r\n meet_fresh: new Material(bump,\r\n {ambient: .5, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/meet_fresh.jpg\")}),\r\n ice_cream: new Material(bump,\r\n {ambient: .5, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/ice_cream.jpg\")}),\r\n window: new Material(bump,\r\n {ambient: .5, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/sf.jpg\")}),\r\n window1: new Material(bump,\r\n {ambient: .5, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/sf1.jpg\")}),\r\n window2: new Material(bump,\r\n {ambient: .5, diffusivity: 1, specularity: 0.5, texture: new Texture(\"assets/sf2.jpg\")}),\r\n };\r\n this.white = new Material(new defs.Basic_Shader());\r\n\r\n this.initial_camera_location = Mat4.look_at(vec3(0, 10, 35), vec3(0, 7, 0), vec3(0, 1, 0));\r\n\r\n // For Countertop\r\n this.holding = \"none\";\r\n this.onboard = \"none\";\r\n this.ingredients = Object.freeze({\"onion\": 0, \"tofu\": 1, \"kimchi\": 2})\r\n this.cut_ingredients = [false, false, false]; // onion, kimchi, tofu\r\n this.added_ingredients = [false, false, false];\r\n\r\n //initialize vegetables\r\n let model_transform = Mat4.identity();\r\n\r\n this.tofu_transform = model_transform\r\n .times(Mat4.scale(0.4, 0.4, 0.6))\r\n .times(Mat4.translation(-26, 11, 14));\r\n this.onion_transform = model_transform\r\n .times(Mat4.scale(0.4, 0.35, 0.4))\r\n .times(Mat4.translation(-26, 12.5, 26));\r\n this.kimchi_transform = model_transform\r\n .times(Mat4.scale(0.6, 0.4, 0.8))\r\n .times(Mat4.translation(-16, 11, 7));\r\n\r\n //initialize arrays\r\n this.collidables = new Array();\r\n }", "title": "" }, { "docid": "4fff4743b1884ae2ce25cc1c939e7b5a", "score": "0.45310745", "text": "function positionModules()\n{\n\tvar module_pos = {};\n\t\n\tmodule_pos.cx = moduleRadius + 10;\n\tmodule_pos.cy = moduleRadius + 10;\n\n\tfor(var i in modules)\n\t{\n\t\tmodules[i].paper.position.x = module_pos.cx;\n\t\tmodules[i].paper.position.y = module_pos.cy;\n\t\tmodule_pos.cx += moduleRadius * 2 + 10;\n\n\t\tif(module_pos.cx >= cw - 50)\n\t\t{\n\t\t\tmodule_pos.cx = moduleRadius + 10;\n\t\t\tmodule_pos.cy += moduleRadius * 2 + 10;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "23d317db0f1f7e8d609d38537e063b0e", "score": "0.45264718", "text": "function u(u,c){const p=u.vertex.code,v=u.fragment.code;1!==c.output&&3!==c.output||(u.include(_Transform_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"Transform\"],{linearDepth:!0}),u.include(_attributes_TextureCoordinateAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_3__[\"TextureCoordinateAttribute\"],c),u.include(_shading_VisualVariables_glsl_js__WEBPACK_IMPORTED_MODULE_7__[\"VisualVariables\"],c),u.include(_output_OutputDepth_glsl_js__WEBPACK_IMPORTED_MODULE_5__[\"OutputDepth\"],c),u.include(_Slice_glsl_js__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"],c),u.vertex.uniforms.add(\"cameraNearFar\",\"vec2\"),u.varyings.add(\"depth\",\"float\"),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),p.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`void main(void) {\nvpos = calculateVPos();\nvpos = subtractOrigin(vpos);\nvpos = addVerticalOffset(vpos, localOrigin);\ngl_Position = transformPositionWithDepth(proj, view, vpos, cameraNearFar, depth);\nforwardTextureCoordinates();\n}`),u.include(_util_AlphaDiscard_glsl_js__WEBPACK_IMPORTED_MODULE_8__[\"DiscardOrAdjustAlpha\"],c),v.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n void main(void) {\n discardBySlice(vpos);\n ${c.hasColorTexture?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputDepth(depth);\n }\n `)),2===c.output&&(u.include(_Transform_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"Transform\"],{linearDepth:!1}),u.include(_attributes_NormalAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_2__[\"NormalAttribute\"],c),u.include(_attributes_VertexNormal_glsl_js__WEBPACK_IMPORTED_MODULE_4__[\"VertexNormal\"],c),u.include(_attributes_TextureCoordinateAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_3__[\"TextureCoordinateAttribute\"],c),u.include(_shading_VisualVariables_glsl_js__WEBPACK_IMPORTED_MODULE_7__[\"VisualVariables\"],c),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),u.vertex.uniforms.add(\"viewNormal\",\"mat4\"),u.varyings.add(\"vPositionView\",\"vec3\"),p.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n ${0===c.normalType?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:\"\"}\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n forwardTextureCoordinates();\n }\n `),u.include(_Slice_glsl_js__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"],c),u.include(_util_AlphaDiscard_glsl_js__WEBPACK_IMPORTED_MODULE_8__[\"DiscardOrAdjustAlpha\"],c),v.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n void main() {\n discardBySlice(vpos);\n ${c.hasColorTexture?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n\n ${3===c.normalType?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n vec3 normal = screenDerivativeNormal(vPositionView);`:_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n vec3 normal = normalize(vNormalWorld);\n if (gl_FrontFacing == false) normal = -normal;`}\n gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);\n }\n `)),4===c.output&&(u.include(_Transform_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"Transform\"],{linearDepth:!1}),u.include(_attributes_TextureCoordinateAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_3__[\"TextureCoordinateAttribute\"],c),u.include(_shading_VisualVariables_glsl_js__WEBPACK_IMPORTED_MODULE_7__[\"VisualVariables\"],c),c.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),p.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`void main(void) {\nvpos = calculateVPos();\nvpos = subtractOrigin(vpos);\nvpos = addVerticalOffset(vpos, localOrigin);\ngl_Position = transformPosition(proj, view, vpos);\nforwardTextureCoordinates();\n}`),u.include(_Slice_glsl_js__WEBPACK_IMPORTED_MODULE_0__[\"Slice\"],c),u.include(_util_AlphaDiscard_glsl_js__WEBPACK_IMPORTED_MODULE_8__[\"DiscardOrAdjustAlpha\"],c),u.include(_output_OutputHighlight_glsl_js__WEBPACK_IMPORTED_MODULE_6__[\"OutputHighlight\"]),v.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n void main() {\n discardBySlice(vpos);\n ${c.hasColorTexture?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_9__[\"glsl\"]`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputHighlight();\n }\n `))}", "title": "" }, { "docid": "6a79b897f483857b2c94559573882067", "score": "0.45199785", "text": "function convertD3() {\n var theory = quanto_theory\n d3.json(theory, function (errorThy, thyJson) {\n var thyName = d3.select(\"meta[name=quanto-project]\").attr(\"content\");\n var thy = new Theory(thyName, thyJson);\n\n\n d3.selectAll(\".qgraph\")\n .each(function () {\n var div = d3.select(this);\n var jsonFile = thy.name + \"/\" + div.attr(\"data-src\") + \".qgraph\";\n d3.json(jsonFile, function (errorGr, graphJson) {\n addGraph(thy, new Graph(graphJson), div);\n });\n });\n\n d3.selectAll(\".qrule\")\n .each(function () {\n var div = d3.select(this);\n var jsonFile = thy.name + \"/\" + div.attr(\"data-src\") + \".qrule\";\n d3.json(jsonFile, function (errorGr, ruleJson) {\n var div1 = div.append(\"div\").attr(\"class\", \"qgraph block\");\n div.append(\"div\")\n .attr(\"class\", \"block\")\n .html(\"&nbsp;&nbsp;&nbsp;=&nbsp;&nbsp;&nbsp;\");\n var div2 = div.append(\"div\").attr(\"class\", \"qgraph block\");\n\n if (div.attr(\"data-graph-width\") != null) {\n div1.style(\"width\", div.attr(\"data-graph-width\"));\n div2.style(\"width\", div.attr(\"data-graph-width\"));\n }\n\n if (div.attr(\"data-graph-height\") != null) {\n div1.style(\"height\", div.attr(\"data-graph-height\"));\n div2.style(\"height\", div.attr(\"data-graph-height\"));\n }\n\n addGraph(thy, new Graph(ruleJson.lhs), div1);\n addGraph(thy, new Graph(ruleJson.rhs), div2);\n });\n });\n\n d3.selectAll(\".qderive\")\n .each(function () {\n var div = d3.select(this);\n var jsonFile = thy.name + \"/\" + div.attr(\"data-src\") + \".qderive\";\n d3.json(jsonFile, function (errorGr, derJson) {\n var der = new Derivation(derJson);\n var bb = der.root.bbox();\n var maxWidth = bb.width;\n var maxHeight = bb.height;\n der.steps.forEach(function (step) {\n bb = step.graph.bbox();\n maxWidth = Math.max(maxWidth, bb.width);\n maxHeight = Math.max(maxHeight, bb.height);\n });\n // console.log(maxHeight);\n var trans = new Transformer();\n trans.ninety = true;\n\n der.steps.forEach(function (step, i) {\n var b = d3.select(\"#scene\")\n .append(\"a-box\")\n .attr(\"position\", `${2*i} 0 0`)\n .attr(\"rotation\", `0 90 0`)\n .attr(\"material\", `opacity: 0`)\n\n addGraph(thy, step.graph, b, null, null);\n })\n function setStep(index) {\n return function () {\n stepDisplay(current + 1)\n ruleDisplay(der.steps[index].ruleName)\n\n var removed = d3.set(lhs.vertices.values());\n rhs.vertices.forEach(function (v) {\n removed.remove(v);\n });\n var inserted = d3.set(rhs.vertices.values());\n lhs.vertices.forEach(function (v) {\n inserted.remove(v);\n });\n\n addGraph(thy, lhs, div1, null, removed);\n addGraph(thy, rhs, div2, inserted, null);\n }\n }\n });\n });\n });\n\n}", "title": "" }, { "docid": "07cc8cee0b63000a7b170b4d0447d8f9", "score": "0.45188686", "text": "function gen(dir, mod, cb) {(dir.indexOf('node_modules') !== -1) || (mod.indexOf('.') !== 0) ? cb(null, 'commonjs2 ' + mod) : cb()}", "title": "" }, { "docid": "6bee3ae027f016598a09e78799b7d1f6", "score": "0.45171803", "text": "function n(n,a){const r=n.fragment;a.vertexTangents?(n.attributes.add(\"tangent\",\"vec4\"),n.varyings.add(\"vTangent\",\"vec4\"),2===a.doubleSidedMode?r.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`mat3 computeTangentSpace(vec3 normal) {\nfloat tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;\nvec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);\nvec3 bitangent = cross(normal, tangent) * tangentHeadedness;\nreturn mat3(tangent, bitangent, normal);\n}`):r.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`mat3 computeTangentSpace(vec3 normal) {\nfloat tangentHeadedness = vTangent.w;\nvec3 tangent = normalize(vTangent.xyz);\nvec3 bitangent = cross(normal, tangent) * tangentHeadedness;\nreturn mat3(tangent, bitangent, normal);\n}`)):(n.extensions.add(\"GL_OES_standard_derivatives\"),r.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {\nvec3 Q1 = dFdx(pos);\nvec3 Q2 = dFdy(pos);\nvec2 stx = dFdx(st);\nvec2 sty = dFdy(st);\nfloat det = stx.t * sty.s - sty.t * stx.s;\nvec3 T = stx.t * Q2 - sty.t * Q1;\nT = T - normal * dot(normal, T);\nT *= inversesqrt(max(dot(T,T), 1.e-10));\nvec3 B = sign(det) * cross(normal, T);\nreturn mat3(T, B, normal);\n}`)),0!==a.attributeTextureCoordinates&&(n.include(_attributes_VertexTextureCoordinates_glsl_js__WEBPACK_IMPORTED_MODULE_0__[\"VertexTextureCoordinates\"],a),r.uniforms.add(\"normalTexture\",\"sampler2D\"),r.uniforms.add(\"normalTextureSize\",\"vec2\"),r.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`\n vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {\n vtc.uv = uv;\n ${a.supportsTextureAtlas?\"vtc.size = normalTextureSize;\":\"\"}\n vec3 rawNormal = textureLookup(normalTexture, vtc).rgb * 2.0 - 1.0;\n return tangentSpace * rawNormal;\n }\n `))}", "title": "" }, { "docid": "49b9d475b7b1b113bfeae3d9b11fc538", "score": "0.45167372", "text": "function transformAMDModule(node) {\n var define = ts.createIdentifier(\"define\");\n var moduleName = ts.tryGetModuleNameFromFile(node, host, compilerOptions);\n // An AMD define function has the following shape:\n //\n // define(id?, dependencies?, factory);\n //\n // This has the shape of the following:\n //\n // define(name, [\"module1\", \"module2\"], function (module1Alias) { ... }\n //\n // The location of the alias in the parameter list in the factory function needs to\n // match the position of the module name in the dependency list.\n //\n // To ensure this is true in cases of modules with no aliases, e.g.:\n //\n // import \"module\"\n //\n // or\n //\n // /// <amd-dependency path= \"a.css\" />\n //\n // we need to add modules without alias names to the end of the dependencies list\n var _a = collectAsynchronousDependencies(node, /*includeNonAmdDependencies*/ true), aliasedModuleNames = _a.aliasedModuleNames, unaliasedModuleNames = _a.unaliasedModuleNames, importAliasNames = _a.importAliasNames;\n // Create an updated SourceFile:\n //\n // define(moduleName?, [\"module1\", \"module2\"], function ...\n return ts.updateSourceFileNode(node, ts.setTextRange(ts.createNodeArray([\n ts.createStatement(ts.createCall(define, \n /*typeArguments*/ undefined, (moduleName ? [moduleName] : []).concat([\n // Add the dependency array argument:\n //\n // [\"require\", \"exports\", module1\", \"module2\", ...]\n ts.createArrayLiteral([\n ts.createLiteral(\"require\"),\n ts.createLiteral(\"exports\")\n ].concat(aliasedModuleNames, unaliasedModuleNames)),\n // Add the module body function argument:\n //\n // function (require, exports, module1, module2) ...\n ts.createFunctionExpression(\n /*modifiers*/ undefined, \n /*asteriskToken*/ undefined, \n /*name*/ undefined, \n /*typeParameters*/ undefined, [\n ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"require\"),\n ts.createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, \"exports\")\n ].concat(importAliasNames), \n /*type*/ undefined, transformAsynchronousModuleBody(node))\n ])))\n ]), \n /*location*/ node.statements));\n }", "title": "" }, { "docid": "5eb0c1702eaddcae3d13d92fb5e19dce", "score": "0.45156294", "text": "async function main() {\n fs.ensureDir(path.join(__dirname, '../build'))\n const depsPath = path.join(__dirname, '../deps')\n const destPath = path.join(__dirname, '../node_modules')\n if (await isDirectory(depsPath)) {\n const depsFiles = []\n const rawDepsFiles = await fs.readdir(depsPath)\n for (const name of rawDepsFiles) {\n if (name.startsWith('@')) {\n const nsFiles = await fs.readdir(path.join(depsPath, name))\n for (const nsName of nsFiles) {\n depsFiles.push(path.join(name, nsName))\n }\n } else {\n depsFiles.push(name)\n }\n }\n await Promise.all(\n depsFiles.map(async name => {\n const destPkgPath = path.join(destPath, name)\n await fs.remove(destPkgPath).catch(swallow)\n await fs.ensureDir(destPkgPath).catch(swallow)\n await fs.copy(path.join(depsPath, name), destPkgPath).catch(swallow)\n })\n )\n }\n}", "title": "" }, { "docid": "38534f82000e3e8852d9e633695490dc", "score": "0.45128885", "text": "requireFactory(M) {\n const { modCache, loadedScript, modUri, modDeclare, FactoryLabel } = M.globals;\n\n function waitForMod(modPath) {\n if (!modDeclare[modPath]) {\n const decl = {};\n const url = modUri[modPath] || modPath + '.js';\n if (!loadedScript[url]) {\n loadedScript[url] = Date.now();\n const ele = document.createElement('script');\n ele.type = 'text/javascript';\n ele.src = /^dropin_modules\\//.test(modPath)\n ? (Dropin.libBase || Dropin.base) + url\n : Dropin.base + url;\n ele.onload = ele.onerror = () => {\n setTimeout(() => {\n if (decl.resolve) {\n decl.resolve();\n delete decl.resolve;\n }\n }, 50);\n };\n document.getElementsByTagName('head')[0].appendChild(ele);\n }\n decl.promise = new Promise((resolve, reject) => {\n decl.resolve = resolve;\n });\n modDeclare[modPath] = decl;\n }\n return modDeclare[modPath].promise;\n }\n\n return (ctx) => {\n function require(inModPath) {\n const modPath = require.resolve(inModPath);\n if (!modCache[modPath]) {\n modCache[modPath] = waitForMod(modPath)\n .then((func) => {\n if (func) {\n const dir = modPath.split('/');\n dir.pop();\n return Dropin(func, Object.assign({}, ctx, {\n modPath,\n dir: dir.join('/'),\n }));\n } else {\n const extra = /^dropin_modules\\//.test(modPath)\n ? 'Maybe you need to install it.'\n : 'Check if file exists or contain error.';\n throw new Error(`Failed to load module \"${inModPath}\". ${extra}`);\n }\n });\n }\n return modCache[modPath].then(ret => {\n if (typeof ret === 'function' && ret[FactoryLabel]) {\n return ret();\n }\n return ret;\n });\n }\n require.resolve = function(modPath) {\n if (/^[\\-a-zA-Z0-9]+$/.test(modPath)) {\n if (Dropin.debug) {\n return `dropin_modules/${modPath}`;\n } else {\n return `dropin_modules/${modPath}.min`;\n }\n } else if (/^\\//.test(modPath)) {\n return modPath.substr(1);\n } else {\n const path = (ctx.dir + '/' + modPath).split('/');\n const prefix = [];\n const resolved = [];\n let w = 0;\n path.forEach(item => {\n if (!item || item === '.') {\n } else if (item === '..') {\n w--;\n if (w < 0) {\n w = 0;\n prefix.push('..');\n }\n } else {\n resolved[w++] = item;\n }\n });\n return prefix.concat(resolved).join('/');\n }\n };\n require.cache = modCache;\n return require;\n };\n }", "title": "" }, { "docid": "95cafef2543fae2b3e679838742b570e", "score": "0.45121515", "text": "flock(boids, quadTree) {\n // Go to the middle if goMiddle is true\n // Create a large force towards the middle, apply it to the boid, and \"return\" to not apply other forces\n let force = p.createVector(xVar-this.pos.x, yVar-this.pos.y, zVar-this.pos.z);\n force.setMag(this.maxForce);\n this.acc.add(force);\n \n let radius = perceptionSlider.value(); // Max distance of a neighbor\n let neighbors = [];\n \n if (useQuadTree === true) {\n // VERSION WITH QUADTREE\n // Make an array of neighbors, i.e. all boids closer than the perception radius\n // The array will be passed to the different flocking behaviors\n let range = new Cube(this.pos.x, this.pos.y, this.pos.z, radius, radius, radius);\n let maybeNeighbors = quadTree.query(range);\n for (let other of maybeNeighbors) {\n let distance = this.pos.dist(other.pos);\n if (other !== this && distance < radius) {\n other.distance = distance; // Record the distance so it can be used later\n neighbors.push(other); // Put this neighbor in the \"neighbors\" array\n }\n }\n } else {\n // VERSION WITHOUT QUADTREE\n // Make an array of neighbors, i.e. all boids closer than the perception radius\n // The array will be passed to the different flocking behaviors\n for (let other of boids) {\n let distance = this.pos.dist(other.pos);\n if (other !== this && distance < radius) {\n other.distance = distance; // Record the distance so it can be used later\n neighbors.push(other); // Put this neighbor in the \"neighbors\" array\n }\n }\n }\n \n\n \n // Calculate the force of alignments and apply it to the boid\n let alignment = this.alignment(neighbors);\n alignment.mult(alignmentSlider.value());\n this.acc.add(alignment);\n \n // Calculate the force of cohesion and apply it to the boid\n if (t > 2) { // No cohesion in the first 40 frames\n let cohesion = this.cohesion(neighbors);\n cohesion.mult(cohesionSlider.value());\n this.acc.add(cohesion);\n }\n \n // Calculate the force of separation and apply it to the boid\n let separation = this.separation(neighbors);\n separation.mult(separationSlider.value());\n this.acc.add(separation);\n \n // If the boid is flies too high or too low, apply another force to make it fly around the middle of space's depth\n if (this.pos.z < -depth/8 || this.pos.z > depth/8) {\n let force = p.createVector(0, 0, -this.pos.z / depth * this.maxForce * 2);\n this.acc.add(force);\n }\n \n // If the boid has no neighbor, apply random forces so it can go find other boids\n if (neighbors.length === 0) {\n let force = p5.Vector.random3D().mult(this.maxForce/4);\n force.z = 0; // Only go find other in an XY plane\n this.acc.add(force);\n }\n }", "title": "" }, { "docid": "7c41c2e3dbca4b1378871f9d3b34cb5a", "score": "0.4507362", "text": "function _check_modules(){\n\t\t\t// check the 'views_module' version\n\t\t\tif (typeof(theWindow.neatFramework.views_module_version) != 'undefined' && theWindow.neatFramework.views_module_version != null){\n \t\t\t\t// it exists.\n \t\t\t\tconsole.log( '[ app_logic.js ] > views module found : ' + theWindow.neatFramework.views_module_version );\n\t\t\t} else {\n\t\t\t\tconsole.log( '[ app_logic.js ] > views module not found.' );\n\t\t\t}\n\t\t\t// check the 'network_module' version\n\t\t\tif (typeof(theWindow.neatFramework.network_module_version) != 'undefined' && theWindow.neatFramework.network_module_version != null){\n \t\t\t\t// it exists.\n \t\t\t\tconsole.log( '[ app_logic.js ] > network module found : ' + theWindow.neatFramework.network_module_version );\n\t\t\t} else {\n\t\t\t\tconsole.log( '[ app_logic.js ] > network module not found.' );\n\t\t\t}\n\t\t\t// check the 'utils_module' version\n\t\t\tif (typeof(theWindow.neatFramework.utils_module_version) != 'undefined' && theWindow.neatFramework.utils_module_version != null){\n \t\t\t\t// it exists.\n \t\t\t\tconsole.log( '[ app_logic.js ] > utils module found : ' + theWindow.neatFramework.utils_module_version );\n\t\t\t} else {\n\t\t\t\tconsole.log( '[ app_logic.js ] > utils module not found.' );\n\t\t\t}\n\t\t\t// check the 'iOS_module' version\n\t\t\tif (typeof(theWindow.neatFramework.iOS_module_version) != 'undefined' && theWindow.neatFramework.iOS_module_version != null){\n \t\t\t\t// it exists.\n \t\t\t\tconsole.log( '[ app_logic.js ] > iOS module found : ' + theWindow.neatFramework.iOS_module_version );\n\t\t\t} else {\n\t\t\t\tconsole.log( '[ app_logic.js ] > iOS module not found.' );\n\t\t\t}\n\t\t\t// check the 'helpers_module' version\n\t\t\tif (typeof(theWindow.neatFramework.helpers_module_version) != 'undefined' && theWindow.neatFramework.helpers_module_version != null){\n \t\t\t\t// it exists.\n \t\t\t\tconsole.log( '[ app_logic.js ] > helpers module found : ' + theWindow.neatFramework.helpers_module_version );\n\t\t\t} else {\n\t\t\t\tconsole.log( '[ app_logic.js ] > helpers module not found.' );\n\t\t\t}\n\t\t\t\n\t\t\t/* the following 'module' is holds the actual cod of the Rails 'brainApp' app (..) */\n\t\t\tif (typeof(theWindow.neatFramework.brainApp_module_version) != 'undefined' && theWindow.neatFramework.brainApp_module_version != null){\n \t\t\t\t// it exists.\n \t\t\t\tconsole.log( '[ app_logic.js ] > brainApp module found : ' + theWindow.neatFramework.brainApp_module_version );\n\t\t\t} else {\n\t\t\t\tconsole.log( '[ app_logic.js ] > brainApp module not found.' );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "addb2310dbabd54bda09ae5264cc8aa4", "score": "0.45017827", "text": "async replacement(m, pre, from) {\n const dir = dirname(this.path)\n if (from.endsWith('.css')) {\n this.css.push(from)\n return m\n }\n if (checkIfLib(from)) {\n const { path } = await resolveDependency(from, this.path)\n\n let relativePath = relative(dir, path)\n\n if (path.startsWith('..')) {\n const foundLinked = findPackage(path)\n if (foundLinked) {\n const p = join('node_modules', foundLinked)\n relativePath = relative(dir, p)\n }\n }\n this.deps.push(relativePath)\n\n const dot = relativePath.startsWith('.') ? '' : './'\n\n if (m == pre) return pre.replace(/(['\"]).+\\1/, `$1${dot}${replace(relativePath)}$1`)\n const r = `${pre}'${dot}${replace(relativePath)}'`\n return r\n }\n const { name: n } = split(from)\n if (n == 'preact' && this.preactExtern) {\n const { entry } = await findPackageJson(dir, '@externs/preact')\n this.nodeModules.push(entry)\n return `${pre}'@externs/preact'`\n }\n return m\n // this is not really doing anything\n // const { packageJson, entry } = await findPackageJson(dir, n)\n // if (paths) {\n // const d = dirname(packageJson)\n // const { path: p } = await resolveDependency(join(d, paths))\n // this.nodeModules.push(p)\n // const relativePath = relative(this.to, p)\n // return `${pre}'${relativePath}'`\n // }\n // this.nodeModules.push(entry)\n // const modRel = relative(this.to, entry)\n // return `${pre}'${modRel}'`\n }", "title": "" }, { "docid": "91521920c757e80319558d0f9dee45ce", "score": "0.44984236", "text": "function evergreenTree(height, width, treeTexture, barkTexture) {\n var tree = new THREE.Object3D();\n\n// ================================================================\n// create each component of the tree\n\n var top = createThird(0, width/4, height/4, treeTexture, 1); // top\n var middle = createThird(width/6, width/3, height/4, treeTexture, 2); // middle\n var bottom = createThird(width/4, width/2, height/4, treeTexture, 3); // bottom \n\n var baseGeom = new THREE.CylinderGeometry(width/8, width/8, height/4, 10);\n var base = new THREE.Mesh(baseGeom, barkTexture);\n\n\n\n /* This function creates one third (layer) of the tree.\n * The function takes in the topWidth, bottomWidth, height, texture of the \n * desired third of the tree, and the index represents which third we are looking\n * at: 1 being the top, 2 being the middle, 3 being the bottom.\n */\n function createThird(topWidth, bottomWidth, height, texture, index){\n var thirdGeom = new THREE.CylinderGeometry(topWidth, bottomWidth, height, 10);\n var third = new THREE.Mesh(thirdGeom, texture);\n \n return third;\n }\n\n\n // translate the various parts of the tree \n top.translateY(7*height/8);\n middle.translateY(5*height/8);\n bottom.translateY(3*height/8)\n base.translateY(height/8);\n\n // add the components of the tree to the tree object\n tree.add(top);\n tree.add(middle);\n tree.add(bottom);\n tree.add(base);\n\nreturn tree;\n\n\n}", "title": "" }, { "docid": "5f21ab345ab783258f251989da1fba88", "score": "0.4496801", "text": "function Jt(){throw new Error(\"Dynamic requires are not currently supported by rollup-plugin-commonjs\")}", "title": "" }, { "docid": "879e0273f3af6291400ac7b5460c55b3", "score": "0.4495711", "text": "function setup() {\n \n // Configure the world.\n w = new p$.World(\"canvasContainer\", draw, resize);\n w.axis.negative = false;\n w.axis.isDraggable = false;\n w.scaleX.set(50, 1, \"cm\");\n w.scaleY.set(50, -1, \"cm\");\n\n // Configure position box.\n labels.x = position.addLabel(50, 14, { name: \"X:\", decPlaces: 2, fixPlaces: true, labelWidth: 20, onClick: function() {setPosition('x')} });\n labels.y = position.addLabel(50, 14, { name: \"Y:\", decPlaces: 2, fixPlaces: true, labelWidth: 20, onClick: function() {setPosition('y')} });\n labels.x.setPosition(0, 0);\n labels.y.setPosition(60, 0);\n position.calculateDimensions();\n\n // Labels\n labels.force = results.addLabel(80, 14, { name: \"F\", units: \"N\", usePrefixes: true, labelWidth: 20, decPlaces: 1 });\n labels.angle = results.addLabel(80, 14, { name: p$.SYMBOL.THETA, units: \"°\", labelWidth: 20, decPlaces: 0 });\n labels.force.setPosition(0, 0);\n labels.angle.setPosition(0, 25);\n results.calculateDimensions();\n\n // Activate prerendering.\n // field.renderer.render();\n\n // Create the five charges.\n for (var i = 0; i < 5; i++) {\n var c = new p$.Ball(0.4, { lowerLabel: \"Q\" + (i + 1) } );\n c.display = i < 2;\n c.setZ(4);\n w.add(c);\n charges.push(c);\n }\n charges[0].setPosition(4, 5);\n charges[1].setPosition(1, 1);\n\n // Configure the z index of all objects.\n // field.setZ(1);\n results.setZ(2);\n vectors.force.setZ(3);\n position.setZ(10);\n\n // Add objects to world.\n w.add(results, position, vectors.force);\n\n}", "title": "" }, { "docid": "ab92eb0f99adf24bf1f22f0110180a9e", "score": "0.4494455", "text": "function _loadBuiltTHREE() {\n var _THREE;\n eval(_fs.readFileSync(BUILD_SRC_PATH, 'utf8') + ';_THREE=THREE;');\n for(var property in _THREE) {\n var ref = _THREE[property];\n SHADOW_THREE.__defineGetter__(property, _bind(_hijackTHREEProperty, SHADOW_THREE, property, ref));\n SHADOW_THREE.__defineSetter__(property, function(){});\n }\n}", "title": "" }, { "docid": "ab7a1dfc46aa5c612864ee8eb1cfcb9f", "score": "0.4491893", "text": "function add(){ //x module \n\n\n}", "title": "" }, { "docid": "57eac2609620c6474e298c8070f7cf87", "score": "0.44884986", "text": "componentDidMount() {\n const esmScript = document.createElement(\"script\");\n\n esmScript.src = \"https://unpkg.com/@manifoldco/web-components@latest/dist/manifold/manifold.esm.js\";\n esmScript.async = true;\n esmScript.type = 'module';\n\n document.body.appendChild(esmScript);\n\n const componentScript = document.createElement(\"script\");\n\n componentScript.src = \"https://unpkg.com/@manifoldco/web-components@latest/dist/manifold/manifold.js\";\n componentScript.nomodule = true;\n\n document.body.appendChild(componentScript);\n }", "title": "" }, { "docid": "c1628d537507dd657c6e4deb0ecbadad", "score": "0.44728833", "text": "function t(t){const a=t.fragment.code;a.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)\n{\nreturn ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;\n}`),a.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`float integratedRadiance(float cosTheta2, float roughness)\n{\nreturn (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);\n}`),a.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)\n{\nfloat cosTheta2 = 1.0 - RdotNG * RdotNG;\nfloat intRadTheta = integratedRadiance(cosTheta2, roughness);\nfloat ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;\nfloat sky = 2.0 - ground;\nreturn (ground * ambientGround + sky * ambientSky) * 0.5;\n}`)}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.4468189", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.4468189", "text": "function setup() {\n\n}", "title": "" }, { "docid": "897f0dcbe4d8790f2b521c2ab824034c", "score": "0.4468189", "text": "function setup() {\n\n}", "title": "" }, { "docid": "009bb719b73d40fd14f9410acc2d3d5e", "score": "0.44534433", "text": "function o(e,n){n.instanced&&n.instancedDoublePrecision&&(e.attributes.add(\"modelOriginHi\",\"vec3\"),e.attributes.add(\"modelOriginLo\",\"vec3\"),e.attributes.add(\"model\",\"mat3\"),e.attributes.add(\"modelNormal\",\"mat3\")),n.instancedDoublePrecision&&(e.vertex.include(_util_DoublePrecision_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"DoublePrecision\"],n),e.vertex.uniforms.add(\"viewOriginHi\",\"vec3\"),e.vertex.uniforms.add(\"viewOriginLo\",\"vec3\"));const o=[_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_2__[\"glsl\"]`\n vec3 calculateVPos() {\n ${n.instancedDoublePrecision?\"return model * localPosition().xyz;\":\"return localPosition().xyz;\"}\n }\n `,_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_2__[\"glsl\"]`\n vec3 subtractOrigin(vec3 _pos) {\n ${n.instancedDoublePrecision?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_2__[\"glsl\"]`\n vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);\n return _pos - originDelta;`:\"return vpos;\"}\n }\n `,_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_2__[\"glsl\"]`\n vec3 dpNormal(vec4 _normal) {\n ${n.instancedDoublePrecision?\"return normalize(modelNormal * _normal.xyz);\":\"return normalize(_normal.xyz);\"}\n }\n `,_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_2__[\"glsl\"]`\n vec3 dpNormalView(vec4 _normal) {\n ${n.instancedDoublePrecision?\"return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);\":\"return normalize((viewNormal * _normal).xyz);\"}\n }\n `,n.vertexTangents?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_2__[\"glsl\"]`\n vec4 dpTransformVertexTangent(vec4 _tangent) {\n ${n.instancedDoublePrecision?\"return vec4(modelNormal * _tangent.xyz, _tangent.w);\":\"return _tangent;\"}\n\n }\n `:_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_2__[\"glsl\"]``];e.vertex.code.add(o[0]),e.vertex.code.add(o[1]),e.vertex.code.add(o[2]),2===n.output&&e.vertex.code.add(o[3]),e.vertex.code.add(o[4])}", "title": "" }, { "docid": "17539962e25a1f6468bf555dae748a5e", "score": "0.44523418", "text": "onAddToWorld() {\n let scene;\n let game = this.gameEngine;\n let world;\n this.Object3D =null;\n var entity = game.entityworld.createEntity();\n if(game.renderer !=null){\n var materialType = 'MeshPhongMaterial';\n\n scene = game.renderer.scene;\n //var geometry = new THREE.CylinderBufferGeometry( 1,1,1,12,1 );\n //var material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );\n var matBox = new THREE[materialType]( { map: this.basicTexture(0), name:'sphere' } );\n //var cube = new THREE.Mesh( geometry, material );\n //var cube = new THREE.Mesh( geometry, matBox );\n \n //let capsuleGeometry = this.createcapsule(1.25,2.75,4,4);\n let capsuleGeometry = this.createcapsule(10,22,20,10);\n\n var cube = new THREE.Mesh( capsuleGeometry, matBox );\n //console.log(this.position);\n cube.position.set(this.position.x,this.position.y,this.position.z);\n //cube.scale.set( 32, 32, 32 );\n this.Object3D = cube;\n scene.add( cube );\n entity.addComponent(Object3D,{object: cube});\n\n }\n var all = 0xffffffff;\n var config = [\n 1, // The density of the shape.\n 0.4, // The coefficient of friction of the shape.\n 0.2, // The coefficient of restitution of the shape.\n 1, // The bits of the collision groups to which the shape belongs.\n all // The bits of the collision groups with which the shape collides.\n ];\n world = game.physicsEngine.world;\n let x = this.position.x;\n let y = this.position.y;\n let z = this.position.z;\n let d = 32;\n let h = 32;\n //https://github.com/lo-th/Oimo.js/blob/gh-pages/examples/test_compound2.html\n //this.physicsObj = world.add({type:'cylinder', size:[d,h,d], pos:[x,y,z], move:true, config:config, name:'cylinder'})\n this.physicsObj = world.add({\n type:this.types,\n size:this.sizes,\n pos:[x,y,z],\n posShape:this.positions,\n move:true,\n config:config,\n name:'cylinder'\n })\n entity.addComponent(Physics3D,{object: this.physicsObj});\n this.entity = entity;\n }", "title": "" }, { "docid": "cf8322588beb617f085a80508b1b5366", "score": "0.44518766", "text": "function removeModule(node) {\n if (node.original.included === false) return false;\n node.original.included = false;\n var parent = availTree.jstree(true).get_node(node.original.parent_id);\n availTree.jstree(true).copy_node(node, parent);\n includedTree.jstree(true).delete_node(node);\n }", "title": "" }, { "docid": "93881204de4eb454f47e021053d6d18e", "score": "0.44488597", "text": "async function linker(specifier, referencingModule) {\n if (specifier === 'path') {\n return new vm.SourceTextModule(`\n export default {\n dirname: (src) => src,\n join: function() { return [].slice.call(arguments).join('/') }\n };\n `, { context: referencingModule.context });\n }\n\n if (specifier === 'fs-extra') {\n return new vm.SourceTextModule(`\n export default {\n readFile: (filePath) => {\n const responses =\n ${JSON.stringify(options.readFileResponse)} || {};\n\n return responses[filePath] || \"{}\";\n },\n readdir: () => ${JSON.stringify(options.readDirResponse)},\n ensureDir: () => {},\n // writtenFiles is provided via context\n writeFileSync: (file, content) => {\n writtenFiles.push({\n file: file,\n content: content\n });\n },\n copyFile: () => {},\n statSync: (filepath) => {\n return {\n isDirectory: function() {\n return filepath.endsWith('/') || filepath.indexOf('.') === -1\n }\n }\n }\n };\n `, {\n identifier: specifier + '.js',\n context: referencingModule.context\n });\n }\n\n if (specifier === 'snarkdown') {\n return new vm.SourceTextModule(`\n export default function snarkdown(src) {\n return src;\n };\n `, { context: referencingModule.context });\n }\n\n if (specifier === './src/preact-hooks-htm-render-to-string.js') {\n return new vm.SourceTextModule(`\n export function html ( html ) { return html; };\n export function renderToString() { return 'rendered' }\n `, { context: referencingModule.context });\n }\n\n throw new Error(`Unable to resolve dependency: ${specifier}`);\n }", "title": "" }, { "docid": "f454ef765097fa313a276324cc4cc8e0", "score": "0.44466084", "text": "function concatJs() {\n config('concat:ng_modules_js', options.jsDir, '.js', [\n '**/module.js',\n '**/*.js'\n ]);\n }", "title": "" }, { "docid": "fb74a22c99265b178ecc30de8739b17e", "score": "0.44305488", "text": "async function $(s,o){const i=q(Object(_core_devEnvironmentUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"adjustStaticAGOUrl\"])(s));if(\"wosr\"===i.fileType){const e=await(o.cache?o.cache.loadWOSR(i.url,o):Object(_wosrLoader_js__WEBPACK_IMPORTED_MODULE_16__[\"load\"])(i.url,o)),t=Object(_wosrLoader_js__WEBPACK_IMPORTED_MODULE_16__[\"processLoadResult\"])(e,o);return{lods:[t],referenceBoundingBox:t.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const a=await(o.cache?o.cache.loadGLTF(i.url,o,o.usePBR):Object(_glTF_loader_js__WEBPACK_IMPORTED_MODULE_14__[\"load\"])(new _glTF_DefaultLoadingContext_js__WEBPACK_IMPORTED_MODULE_13__[\"DefaultLoadingContext\"](o.streamDataRequester),i.url,o,o.usePBR)),u=Object(_core_maybe_js__WEBPACK_IMPORTED_MODULE_1__[\"get\"])(a.model.meta,\"ESRI_proxyEllipsoid\");a.meta.isEsriSymbolResource&&Object(_core_maybe_js__WEBPACK_IMPORTED_MODULE_1__[\"isSome\"])(u)&&-1!==a.meta.uri.indexOf(\"/RealisticTrees/\")&&J(a,u);const n=a.meta.isEsriSymbolResource?{usePBR:o.usePBR,isSchematic:!1,treeRendering:a.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:o.usePBR,isSchematic:!1,mrrFactors:[0,1,.5]},l={...o.materialParamsMixin,treeRendering:a.customMeta.esriTreeRendering};if(null!=i.specifiedLodIndex){const e=K(a,n,l,i.specifiedLodIndex);let t=e[0].boundingBox;if(0!==i.specifiedLodIndex){t=K(a,n,l,0)[0].boundingBox}return{lods:e,referenceBoundingBox:t,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1,remove:a.remove}}const c=K(a,n,l);return{lods:c,referenceBoundingBox:c[0].boundingBox,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1,remove:a.remove}}", "title": "" }, { "docid": "f139bbba0b0eb147d7a183293829d51c", "score": "0.4429765", "text": "treeForVendor(tree) {\n var hoodiePackage = path.dirname(require.resolve('@hoodie/client'));\n var hoodieTree = new Funnel(this.treeGenerator(hoodiePackage), {\n srcDir: 'dist',\n destDir: '/'\n });\n if (tree) {\n return mergeTrees([tree, hoodieTree]);\n } else {\n return hoodieTree;\n }\n }", "title": "" }, { "docid": "a4e4189f819affa2dc337afbc457fb5f", "score": "0.44296676", "text": "function _create(require,module){\n if(!(require.constructor == Array && arguments.length > 1 )){\n module = require ;\n require = null ;\n }\n \n<<<<<<< HEAD\n log('create a module :',require,module);\n \n this.modules.push(module);\n \n if(require != null){\n log('need sync');\n \t//this.require(require,module,true);\n=======\n if(module != null){\n \tthis.modules.push(module);\n }\n \n if(require != null){\n \t_sync = true ;\n \tthis.require(require,module);\n>>>>>>> 2.1\n }\n \n }\n \n<<<<<<< HEAD\n=======\n function _hookModule(module){\n\t console.log('hook',module);\n\t context.mods.module.push(module);\n }\n \n>>>>>>> 2.1\n /** Require modules\n * Array libs : an Array that contains the modules to load\n * Function callback : a function that fired when modules are completely load\n **/ \n function _require(libs,callback,sync){\n sync = sync || false ;\n\t timeInit = (new Date()).getTime();\n maxStack = libs.length ;\n stack = 0 ;\n _requireCounter++ ;\n _libs.push({req:libs,call:callback}) ;\n handler = callback ;\n _synchronized = sync ;\n for(var i in libs){\n<<<<<<< HEAD\n setTimeout(_req(libs[i],sync),0);\n }\n }\n \n function _update(){\n log('update');\n=======\n \t_req(libs[i]);\n\t}\n }", "title": "" }, { "docid": "c7d90dc556b47ee0db083a12895c21aa", "score": "0.4428825", "text": "function CommandHandlerDeps() {}", "title": "" }, { "docid": "0674185047b9c574c9c5a20e8a540fb5", "score": "0.4424934", "text": "function loadScriptDependencies(){\n /** * @license * Fuse - Lightweight fuzzy-search * * Copyright (c) 2012-2016 Kirollos Risk <[email protected]>. * All Rights Reserved. Apache Software License 2.0 * * Licensed under the Apache License, Version 2.0 (the \"License\") * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an \"AS IS\" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */\n !function(t){\"use strict\";function e(){console.log.apply(console,arguments)}function s(t,e){var s,n,o,i;for(this.list=t,this.options=e=e||{},s=0,i=[\"sort\",\"shouldSort\",\"verbose\",\"tokenize\"],n=i.length;n>s;s++)o=i[s],this.options[o]=o in e?e[o]:r[o];for(s=0,i=[\"searchFn\",\"sortFn\",\"keys\",\"getFn\",\"include\",\"tokenSeparator\"],n=i.length;n>s;s++)o=i[s],this.options[o]=e[o]||r[o]}function n(t,e,s){var i,r,h,a,c,p;if(e){if(h=e.indexOf(\".\"),-1!==h?(i=e.slice(0,h),r=e.slice(h+1)):i=e,a=t[i],null!==a&&void 0!==a)if(r||\"string\"!=typeof a&&\"number\"!=typeof a)if(o(a))for(c=0,p=a.length;p>c;c++)n(a[c],r,s);else r&&n(a,r,s);else s.push(a)}else s.push(t);return s}function o(t){return\"[object Array]\"===Object.prototype.toString.call(t)}function i(t,e){e=e||{},this.options=e,this.options.location=e.location||i.defaultOptions.location,this.options.distance=\"distance\"in e?e.distance:i.defaultOptions.distance,this.options.threshold=\"threshold\"in e?e.threshold:i.defaultOptions.threshold,this.options.maxPatternLength=e.maxPatternLength||i.defaultOptions.maxPatternLength,this.pattern=e.caseSensitive?t:t.toLowerCase(),this.patternLen=t.length,this.patternLen<=this.options.maxPatternLength&&(this.matchmask=1<<this.patternLen-1,this.patternAlphabet=this._calculatePatternAlphabet())}var r={id:null,caseSensitive:!1,include:[],shouldSort:!0,searchFn:i,sortFn:function(t,e){return t.score-e.score},getFn:n,keys:[],verbose:!1,tokenize:!1,matchAllTokens:!1,tokenSeparator:/ +/g};s.VERSION=\"2.5.0\",s.prototype.set=function(t){return this.list=t,t},s.prototype.search=function(t){this.options.verbose&&e(\"\\nSearch term:\",t,\"\\n\"),this.pattern=t,this.results=[],this.resultMap={},this._keyMap=null,this._prepareSearchers(),this._startSearch(),this._computeScore(),this._sort();var s=this._format();return s},s.prototype._prepareSearchers=function(){var t=this.options,e=this.pattern,s=t.searchFn,n=e.split(t.tokenSeparator),o=0,i=n.length;if(this.options.tokenize)for(this.tokenSearchers=[];i>o;o++)this.tokenSearchers.push(new s(n[o],t));this.fullSeacher=new s(e,t)},s.prototype._startSearch=function(){var t,e,s,n,o=this.options,i=o.getFn,r=this.list,h=r.length,a=this.options.keys,c=a.length,p=null;if(\"string\"==typeof r[0])for(s=0;h>s;s++)this._analyze(\"\",r[s],s,s);else for(this._keyMap={},s=0;h>s;s++)for(p=r[s],n=0;c>n;n++){if(t=a[n],\"string\"!=typeof t){if(e=1-t.weight||1,this._keyMap[t.name]={weight:e},t.weight<=0||t.weight>1)throw new Error(\"Key weight has to be > 0 and <= 1\");t=t.name}else this._keyMap[t]={weight:1};this._analyze(t,i(p,t,[]),p,s)}},s.prototype._analyze=function(t,s,n,i){var r,h,a,c,p,l,u,f,d,g,m,y,k,v,S,b=this.options,_=!1;if(void 0!==s&&null!==s){h=[];var M=0;if(\"string\"==typeof s){if(r=s.split(b.tokenSeparator),b.verbose&&e(\"---------\\nKey:\",t),this.options.tokenize){for(v=0;v<this.tokenSearchers.length;v++){for(f=this.tokenSearchers[v],b.verbose&&e(\"Pattern:\",f.pattern),d=[],y=!1,S=0;S<r.length;S++){g=r[S],m=f.search(g);var L={};m.isMatch?(L[g]=m.score,_=!0,y=!0,h.push(m.score)):(L[g]=1,this.options.matchAllTokens||h.push(1)),d.push(L)}y&&M++,b.verbose&&e(\"Token scores:\",d)}for(c=h[0],l=h.length,v=1;l>v;v++)c+=h[v];c/=l,b.verbose&&e(\"Token score average:\",c)}u=this.fullSeacher.search(s),b.verbose&&e(\"Full text score:\",u.score),p=u.score,void 0!==c&&(p=(p+c)/2),b.verbose&&e(\"Score average:\",p),k=this.options.tokenize&&this.options.matchAllTokens?M>=this.tokenSearchers.length:!0,b.verbose&&e(\"Check Matches\",k),(_||u.isMatch)&&k&&(a=this.resultMap[i],a?a.output.push({key:t,score:p,matchedIndices:u.matchedIndices}):(this.resultMap[i]={item:n,output:[{key:t,score:p,matchedIndices:u.matchedIndices}]},this.results.push(this.resultMap[i])))}else if(o(s))for(v=0;v<s.length;v++)this._analyze(t,s[v],n,i)}},s.prototype._computeScore=function(){var t,s,n,o,i,r,h,a,c,p=this._keyMap,l=this.results;for(this.options.verbose&&e(\"\\n\\nComputing score:\\n\"),t=0;t<l.length;t++){for(n=0,o=l[t].output,i=o.length,a=1,s=0;i>s;s++)r=o[s].score,h=p?p[o[s].key].weight:1,c=r*h,1!==h?a=Math.min(a,c):(n+=c,o[s].nScore=c);1===a?l[t].score=n/i:l[t].score=a,this.options.verbose&&e(l[t])}},s.prototype._sort=function(){var t=this.options;t.shouldSort&&(t.verbose&&e(\"\\n\\nSorting....\"),this.results.sort(t.sortFn))},s.prototype._format=function(){var t,s,n,o,i,r=this.options,h=r.getFn,a=[],c=this.results,p=r.include;for(r.verbose&&e(\"\\n\\nOutput:\\n\\n\",c),o=r.id?function(t){c[t].item=h(c[t].item,r.id,[])[0]}:function(){},i=function(t){var e,s,n,o,i,r=c[t];if(p.length>0){if(e={item:r.item},-1!==p.indexOf(\"matches\"))for(n=r.output,e.matches=[],s=0;s<n.length;s++)o=n[s],i={indices:o.matchedIndices},o.key&&(i.key=o.key),e.matches.push(i);-1!==p.indexOf(\"score\")&&(e.score=c[t].score)}else e=r.item;return e},s=0,n=c.length;n>s;s++)o(s),t=i(s),a.push(t);return a},i.defaultOptions={location:0,distance:100,threshold:.6,maxPatternLength:32},i.prototype._calculatePatternAlphabet=function(){var t={},e=0;for(e=0;e<this.patternLen;e++)t[this.pattern.charAt(e)]=0;for(e=0;e<this.patternLen;e++)t[this.pattern.charAt(e)]|=1<<this.pattern.length-e-1;return t},i.prototype._bitapScore=function(t,e){var s=t/this.patternLen,n=Math.abs(this.options.location-e);return this.options.distance?s+n/this.options.distance:n?1:s},i.prototype.search=function(t){var e,s,n,o,i,r,h,a,c,p,l,u,f,d,g,m,y,k,v,S,b,_,M=this.options;if(t=M.caseSensitive?t:t.toLowerCase(),this.pattern===t)return{isMatch:!0,score:0,matchedIndices:[[0,t.length-1]]};if(this.patternLen>M.maxPatternLength){if(y=t.match(new RegExp(this.pattern.replace(M.tokenSeparator,\"|\"))),k=!!y)for(S=[],e=0,b=y.length;b>e;e++)_=y[e],S.push([t.indexOf(_),_.length-1]);return{isMatch:k,score:k?.5:1,matchedIndices:S}}for(o=M.location,n=t.length,i=M.threshold,r=t.indexOf(this.pattern,o),v=[],e=0;n>e;e++)v[e]=0;for(-1!=r&&(i=Math.min(this._bitapScore(0,r),i),r=t.lastIndexOf(this.pattern,o+this.patternLen),-1!=r&&(i=Math.min(this._bitapScore(0,r),i))),r=-1,g=1,m=[],c=this.patternLen+n,e=0;e<this.patternLen;e++){for(h=0,a=c;a>h;)this._bitapScore(e,o+a)<=i?h=a:c=a,a=Math.floor((c-h)/2+h);for(c=a,p=Math.max(1,o-a+1),l=Math.min(o+a,n)+this.patternLen,u=Array(l+2),u[l+1]=(1<<e)-1,s=l;s>=p;s--)if(d=this.patternAlphabet[t.charAt(s-1)],d&&(v[s-1]=1),0===e?u[s]=(u[s+1]<<1|1)&d:u[s]=(u[s+1]<<1|1)&d|((f[s+1]|f[s])<<1|1)|f[s+1],u[s]&this.matchmask&&(g=this._bitapScore(e,s-1),i>=g)){if(i=g,r=s-1,m.push(r),!(r>o))break;p=Math.max(1,2*o-r)}if(this._bitapScore(e+1,o)>i)break;f=u}return S=this._getMatchedIndices(v),{isMatch:r>=0,score:0===g?.001:g,matchedIndices:S}},i.prototype._getMatchedIndices=function(t){for(var e,s=[],n=-1,o=-1,i=0,r=t.length;r>i;i++)e=t[i],e&&-1===n?n=i:e||-1===n||(o=i-1,s.push([n,o]),n=-1);return t[i-1]&&s.push([n,i-1]),s},\"object\"==typeof exports?module.exports=s:\"function\"==typeof define&&define.amd?define(function(){return s}):t.Fuse=s}(this);\n bootstrapSearch();\n\n var bluebird = document.createElement('script');\n bluebird.type = 'text/javascript';\n bluebird.dataset.resource_from = 'deepdive-bar-embed';\n bluebird.src = resourceURL + '/lib/bluebird_3.4.5.min.js';\n //Wait for bluebird js to load before bootstrapping boxscores\n if (bluebird.readyState) { //IE\n bluebird.onreadystatechange = function () {\n if (bluebird.readyState == \"loaded\" || bluebird.readyState == \"complete\") {\n bluebird.onreadystatechange = null;\n //bootstrapBoxscores(); now within bootstrapMobileMnue and bootstrapDesktopBoxscores\n bootstrapMobileMenu();\n bootstrapDesktopBoxscores();\n }\n };\n } else { //Others\n bluebird.onload = function (){\n //bootstrapBoxscores(); now within bootstrapMobileMnue and bootstrapDesktopBoxscores\n bootstrapMobileMenu();\n bootstrapDesktopBoxscores();\n };\n }\n\n if(!window.Promise){\n //If promise is not defined for browser load bluebird\n document.head.appendChild(bluebird);\n }else{\n //Else start loading boxscores\n //bootstrapBoxscores(); now within bootstrapMobileMnue and bootstrapDesktopBoxscores\n bootstrapMobileMenu();\n bootstrapDesktopBoxscores();\n }\n\n }", "title": "" }, { "docid": "c610dc4a3db7254b3db16a7104282e9e", "score": "0.4421928", "text": "test(module) {\n return (\n module.size() > 160000 &&\n /node_modules[/\\\\]/.test(module.identifier())\n );\n }", "title": "" }, { "docid": "f25f3b7205c5883f9c4089c031cc4f31", "score": "0.4417243", "text": "function makeGraph(nodes) {\n var force = d3.layout.force()\n .nodes(nodes)\n .size([width, height])\n .gravity(.02)\n .charge(0)\n .on(\"tick\", tick)\n .start();\n\n var svg = d3.select(\"body\").append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n var node = svg.selectAll(\"circle\")\n .data(nodes)\n .enter().append(\"g\").call(force.drag);\n //addcircle to the group\n node.append(\"circle\")\n .style(\"fill\", function (d) {\n return color(d.cluster);\n }).attr(\"r\", function (d) {\n return d.radius\n })\n //add text to the group \n node.append(\"text\")\n .text(function (d) {\n return d.name;\n })\n .attr(\"dx\", -10)\n .attr(\"dy\", \".35em\")\n .text(function (d) {\n return d.name\n })\n .style(\"stroke\", \"none\");\n\n\n\n\n\n\n function tick(e) {\n node.each(cluster(10 * e.alpha * e.alpha))\n .each(collide(.5))\n //.attr(\"transform\", functon(d) {});\n .attr(\"transform\", function (d) {\n var k = \"translate(\" + d.x + \",\" + d.y + \")\";\n return k;\n })\n\n }\n\n // Move d to be adjacent to the cluster node.\n function cluster(alpha) {\n return function (d) {\n var cluster = clusters[d.cluster];\n if (cluster === d) return;\n var x = d.x - cluster.x,\n y = d.y - cluster.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + cluster.radius;\n if (l != r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n cluster.x += x;\n cluster.y += y;\n }\n };\n }\n\n // Resolves collisions between d and all other circles.\n function collide(alpha) {\n var quadtree = d3.geom.quadtree(nodes);\n return function (d) {\n var r = d.radius + maxRadius + Math.max(padding, clusterPadding),\n nx1 = d.x - r,\n nx2 = d.x + r,\n ny1 = d.y - r,\n ny2 = d.y + r;\n quadtree.visit(function (quad, x1, y1, x2, y2) {\n if (quad.point && (quad.point !== d)) {\n var x = d.x - quad.point.x,\n y = d.y - quad.point.y,\n l = Math.sqrt(x * x + y * y),\n r = d.radius + quad.point.radius + (d.cluster === quad.point.cluster ? padding : clusterPadding);\n if (l < r) {\n l = (l - r) / l * alpha;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n }\n }\n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n });\n };\n }\n}", "title": "" }, { "docid": "1be75046bb9673603f947c4fcc7fab12", "score": "0.44168574", "text": "function resolve(node, env) {\n resolveScript(node, env);\n node.modDefns.forEach(function(_, defn) {\n link(defn.module);\n });\n }", "title": "" }, { "docid": "c64305b0616af235817dc3257cde03fb", "score": "0.44131014", "text": "function tick(e) {\n force.onTick(e);\n\n //Collision detection\n var q = d3.geom.quadtree(nodes),\n k = e.alpha * 0.1,\n i = 0,\n n = nodes.length,\n o;\n\n while (++i < n) {\n o = nodes[i];\n // if (o.fixed) continue;\n // c = nodes[o.type];\n // o.x += (c.x - o.x) * k;\n // o.x += (xScale(o.name.charCodeAt(0)) - o.x) * k;\n // o.y += (yScale(o.value) - o.y) * k;\n q.visit(collide(o));\n }\n\n // Only draw links when the network settles down\n if (force.alpha() < 0.05) {\n path.attr(\"d\", function(d) {\n // var dx = d.target.x - d.source.x,\n // dy = d.target.y - d.source.y,\n // dr = Math.sqrt(dx * dx + dy * dy);\n // return \"M\" + d.source.x + \",\" + d.source.y + \"A\" + dr + \",\" + dr + \" 0 0,1 \" + d.target.x + \",\" + d.target.y;\n return \"M\" + d.source.x + \",\" + d.source.y + \"L\" + d.target.x + \",\" + d.target.y;\n });\n }\n\n circle.attr(\"transform\", function(d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n\n text.attr(\"transform\", function(d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n }", "title": "" }, { "docid": "e7625df5e889596d4ec7bdbf555ce172", "score": "0.44110262", "text": "treeForVendor(vendorTree) {\n try {\n var ravenPackage = require.resolve('raven-js');\n var ravenTree = new Funnel(path.resolve(path.dirname(ravenPackage), '../dist'), {\n files: ['raven.js']\n });\n\n return new MergeTrees([vendorTree, ravenTree]);\n } catch (e) {\n return vendorTree;\n }\n }", "title": "" }, { "docid": "cab2a001f9ca4235ac39088fc4141e6d", "score": "0.44072533", "text": "function CompatibilityModule() {\n }", "title": "" }, { "docid": "bc6fcee33bac5e8655ee90923cdb84c5", "score": "0.44061044", "text": "componentDidMount() {\n this.simpleComponentD3 = new SimpleComponentD3(this.node, this.getProps());\n }", "title": "" }, { "docid": "5a19a4605ef53e9795cdf6051647dfb7", "score": "0.4397092", "text": "static findNodeModules (filename) {\n filename = filename || 'node_modules'\n if (Dependency.__root) {\n return path.join(Dependency.__root, filename)\n }\n // start from the current directory\n Dependency.__root = process.cwd()\n let hitRoot = false\n do {\n // check if we're at the root of the drive\n hitRoot = Dependency.__root === path.resolve(path.sep)\n // check the directory for the filename\n const dir = path.join(Dependency.__root, filename)\n if (fs.existsSync(dir)) {\n return dir\n }\n if (!hitRoot) {\n // it didn't exist, and we're not at the root so go up one directory\n Dependency.__root = path.resolve(Dependency.__root, '..')\n }\n }\n while (!hitRoot)\n Dependency.clear()\n throw new Error('Not in a node package hierarchy')\n }", "title": "" }, { "docid": "66e0dc262525c5e4915c124e857ba1e0", "score": "0.43958002", "text": "function tick(e) {\n\tnode\n\t\t.attr(\"transform\", function(d) { \n\t\t\td.x = Math.max(maxRadius, Math.min(width - maxRadius, d.x));\n\t\t\td.y = Math.max(maxRadius, Math.min(height - maxRadius, d.y));\n\t\t\treturn \"translate(\" + d.x + \",\" + d.y + \")\"; \n\t\t});\n\t\n\tif(!bDragOn) {\n\t\tnode\n\t\t\t.each(cluster(10 * e.alpha * e.alpha))\n\t\t\t.each(collide(.5))\n\t\t\t.attr(\"cx\", function(d) { return d.x; })\n\t\t\t.attr(\"cy\", function(d) { return d.y; });\n\t}\n\t\n\t// add the curvy lines\n\tlink.attr(\"d\", function(d) {\n\t\tvar dx = d.target.x-d.source.x, dy = d.target.y-d.source.y, dr = Math.sqrt(dx * dx + dy * dy);\n\t\treturn \"M\" + d.source.x + \",\" + d.source.y + \"A\" + dr + \",\" + dr + \" 0 0,1 \" + d.target.x + \",\" + d.target.y;\n\t});\n}", "title": "" }, { "docid": "d6c35f76e7ee46e1e090ddf28055fa67", "score": "0.4381455", "text": "chartModuleInjection() {\n let moduleName;\n for (const modules of this.getInjectedModules()) {\n moduleName = modules.prototype.getModuleName().toLowerCase();\n if (moduleName.indexOf('rangetooltip') === -1) {\n Chart.Inject(modules);\n }\n else {\n RangeNavigator.Inject(modules);\n }\n if (moduleName === 'datetime' || moduleName === 'areaseries' || moduleName === 'steplineseries') {\n RangeNavigator.Inject(modules);\n }\n }\n }", "title": "" }, { "docid": "9133aa86983c781756b91e888172db55", "score": "0.43811566", "text": "function setup_drag_and_drop() {\n d3.selectAll(\".node circle\")\n .call(d3.drag()\n .on(\"start\", on_drag_start)\n .on(\"drag\", on_drag)\n .on(\"end\", on_drag_end));\n\n // callback for beginning of node dragging\n function on_drag_start(d) {\n // record simulation target\n simulation_target_svg = this;\n simulation_target_node = d;\n\n // start the simulation, focused on the current node\n simulation.nodes([d]);\n simulation.alphaTarget(0.3).restart();\n\n // set drag force to be toward current mouse location\n d.fx = d.x;\n d.fy = d.y;\n\n // we are now dragging\n dragging = true;\n }\n\n // callback for ongoing node dragging\n function on_drag(d) {\n // set drag force to be toward current mouse location\n d.fx = d3.event.x;\n d.fy = d3.event.y;\n }\n\n // callback for end of node dragging\n function on_drag_end(d) {\n // allow the simulation to return to steady-state\n if (!d3.event.active) simulation.alphaTarget(0);\n // remove drag force towards mouse\n d.fx = null;\n d.fy = null;\n // we are no longer dragging\n dragging = false;\n }\n}", "title": "" }, { "docid": "d701bf20847352d44f38fb5abba3db8f", "score": "0.43783256", "text": "function generateModule(name, gir, module) {\n out = ['/**']\n out.push(` * ${name}.d.ts`)\n out.push(' *')\n out.push(' */')\n // out.push(`declare module '${name}' {`)\n if (module.import)\n for (let im of module.import)\n out.push(` import * as ${im} from \"./${im}\"`)\n\n out.push(' import * as gjs from \"../starleaf-gjs/ByteArray\"')\n\n switch (typeof module.patch) {\n case 'string':\n out.push(fs.readFileSync(module.patch, {encoding: 'utf8'}))\n addGirInfo(name, gir, {}, module.add, out)\n break\n case 'object':\n addGirInfo(name, gir, module.patch, module.add, out)\n break\n default:\n addGirInfo(name, gir, module.patch, module.add, out)\n }\n // out.push('}')\n return out.join('\\n') // fixups:\n .replace(/\\: object/g, \": any\")\n .replace(/\\:object/g, \":any\")\n .replace(/\\.\\.\\.args\\: any\\)/g, \"...args: any[])\")\n .replace(/argc\\: number, argv\\: string\\[\\]/g, \"argv:string[]\")\n}", "title": "" }, { "docid": "54355e3b635d959c043d2166322a6cbf", "score": "0.43750593", "text": "function l(l,d){const c=l.fragment;l.include(_EvaluateMainLighting_glsl_js__WEBPACK_IMPORTED_MODULE_2__[\"EvaluateMainLighting\"]),l.include(_EvaluateAmbientOcclusion_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"EvaluateAmbientOcclusion\"],d),0!==d.pbrMode&&l.include(_PhysicallyBasedRendering_glsl_js__WEBPACK_IMPORTED_MODULE_3__[\"PhysicallyBasedRendering\"],d),l.include(_EvaluateAmbientLighting_glsl_js__WEBPACK_IMPORTED_MODULE_0__[\"EvaluateAmbientLighting\"],d),d.receiveShadows&&l.include(_ReadShadowMap_glsl_js__WEBPACK_IMPORTED_MODULE_5__[\"ReadShadowMap\"],d),c.uniforms.add(\"lightingGlobalFactor\",\"float\"),c.uniforms.add(\"ambientBoostFactor\",\"float\"),l.include(_PiUtils_glsl_js__WEBPACK_IMPORTED_MODULE_4__[\"PiUtils\"]),c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`\n const float GAMMA_SRGB = 2.1;\n const float INV_GAMMA_SRGB = 0.4761904;\n ${0===d.pbrMode?\"\":\"const vec3 GROUND_REFLECTANCE = vec3(0.2);\"}\n `),c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`\n float additionalDirectedAmbientLight(vec3 vPosWorld) {\n float vndl = dot(${1===d.viewingMode?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`normalize(vPosWorld)`:_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`vec3(0.0, 0.0, 1.0)`}, lightingMainDirection);\n return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));\n }\n `),c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {\nfloat additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);\nreturn (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * lightingMainIntensity;\n}`),0===d.pbrMode||4===d.pbrMode?c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)\n{\nvec3 mainLighting = evaluateMainLighting(normalWorld, shadow);\nvec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);\nvec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));\nvec3 totalLight = mainLighting + ambientLighting + additionalLight;\ntotalLight = min(totalLight, vec3(PI));\nvec3 outColor = vec3((albedoLinear / PI) * totalLight);\nreturn pow(outColor, vec3(INV_GAMMA_SRGB));\n}`):1!==d.pbrMode&&2!==d.pbrMode||(c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`const float fillLightIntensity = 0.25;\nconst float horizonLightDiffusion = 0.4;\nconst float additionalAmbientIrradianceFactor = 0.02;\nvec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)\n{\nvec3 viewDirection = -viewDir;\nvec3 mainLightDirection = lightingMainDirection;\nvec3 h = normalize(viewDirection + mainLightDirection);\nPBRShadingInfo inputs;\ninputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);\ninputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);\ninputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);\ninputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);\ninputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);\nvec3 reflectedView = normalize(reflect(viewDirection, normal));\ninputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);\ninputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));\ninputs.ssao = ssao;\ninputs.metalness = mrr[0];\ninputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;\ninputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));\ninputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);\nambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));\ninputs.NdotAmbDir = abs(dot(normal, ambientDir));\nvec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * lightingMainIntensity;\nvec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * lightingMainIntensity * fillLightIntensity;\nvec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;\ninputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;\ninputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;\nvec3 horizonRingH = normalize(viewDirection + horizonRingDir);\ninputs.NdotH_Horizon = dot(normal, horizonRingH);\nvec3 mainLightRadianceComponent = normalDistribution(inputs.NdotH, inputs.roughness) * lightingMainIntensity * (1.0 - shadow);\nvec3 horizonLightRadianceComponent = normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * lightingMainIntensity * fillLightIntensity;\nvec3 ambientLightRadianceComponent = calculateAmbientRadiance(ssao) + additionalLight;\ninputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent;\ninputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent;\ninputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),c.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`\n vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);\n vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;\n vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));\n vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;\n ${2===d.pbrMode?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_6__[\"glsl\"]`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}\n return outColor;\n }\n `))}", "title": "" }, { "docid": "e0ca9f8c4ccb2b19bf537b8a491d09b0", "score": "0.4373912", "text": "function Module() {\n}", "title": "" }, { "docid": "4d3c983f07d11712b115db4445b1fe89", "score": "0.4369962", "text": "function getPlatform(_this) { \n\n var stepGeo = new THREE.Geometry();\n var stepMaterial = new THREE.MeshStandardMaterial( {color:0xC0C0C0 });\n\n\n var normalMap = textureLoader.load( './assets/textures/Metal_Hammered_001_SD/Metal_Hammered_001_normal.jpg' );\n var metallicMap = textureLoader.load('./assets/textures/Metal_Hammered_001_SD/Metal_Hammered_001_metallic.jpg');\n \n\n stepMaterial.normalMap = normalMap;\n stepMaterial.metalnessMap = metallicMap;\n\n for (let s = 0; s<6; s++) {\n \n let norm = s * .1;\n let scale = 1 - (norm*.5);\n let newGeo = new THREE.CylinderGeometry( 12, 12, .2, 32 );\n\n //merge geometry \n newGeo.translate(0, 4*norm, 0);\n newGeo.scale(scale, 1, scale); // scale circle smaller\n stepGeo.merge(newGeo);\n\n }\n\n _this.platform = new THREE.Mesh(stepGeo, stepMaterial);\n _this.platform.position.y = -5;\n _this.platform.castShadow = true;\n _this.platform.receiveShadow = true;\n \n \n\n}", "title": "" }, { "docid": "50ebfcfcbd81a48545bda1465f74f0be", "score": "0.4365999", "text": "function update () {\n // GET LIST OF ALL NODES IN DATA\n var nodes = flatten(root)\n\n // CREATE LINKS BETWEEN NODES\n var edges = d3.layout.tree().links(nodes)\n\n // CREATE D3 FORCE LAYOUT\n // AND SET SOME OPTIONS\n force.nodes(nodes)\n .links(edges)\n .size([width, height])\n .linkDistance(function (d) { return getLinkDistance(d) })\n .charge(function (d) { return getNodeCharge(d) })\n .chargeDistance(CHARGE_DISTANCE)\n .friction(0.4)\n // .linkStrength(1)\n // .gravity(0.05)\n // .theta(0.8)\n .alpha(0.2)\n .on('tick', tick)\n .start()\n\n // ADD EDGES TO THE VISUALIZATION\n var edge = svg.selectAll('line.edge')\n .data(edges, function (d) { return d.target.id })\n\n edge.enter().append('svg:line')\n .attr('class', function (d) { return 'edge level_' + d.source.level })\n\n // REMOVE ANY OLD EDGES\n edge.exit().remove()\n\n // A NODE IS AN SVG GROUP WITH DATA\n // FROM THE JSON FILE MAPPED TO IT\n var node = svg.selectAll('g.node')\n .data(nodes, function (d) { return d.id })\n\n // ADD EACH NODE AS A GROUP\n // AND MAKE IT DRAGABLE\n var nodeEnter = node\n .enter().append('svg:g')\n .attr('class', 'node')\n .attr('url', function (d) { return d.post_url })\n .call(force.drag)\n\n // ADD SVG PATTERN DEFINITION\n // FOR CIRCLE BACKGROUND IMAGES\n var defs = nodeEnter\n .append('svg:defs')\n .append('svg:pattern')\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('id', function (d) { return d.post_id + '-bg-image' })\n .attr('patternContentUnits', 'objectBoundingBox')\n\n // ADD BACKGROUND IMAGE\n // URLs TO PATTERN\n defs.append('svg:image')\n .attr('width', 1)\n .attr('height', 1)\n .attr('class', 'circle-bg-image')\n .attr('xlink:href', function (d) { return getImageUrl(d) })\n .attr('preserveAspectRatio', 'xMinYMin slice')\n\n // ADD AN SVG CIRCLE\n // TO THE NODE GROUP\n // WITH CALCULATED RADIUS\n var imageCircle = nodeEnter\n .append('svg:circle')\n .attr('class', function (d) { return 'image-circle level_' + d.level })\n .attr('r', function (d) { return getCircleRadius(d) })\n .style('fill', function (d) { return getCircleFill(d) })\n\n // ADD CIRCLE OVERLAY\n // TO THE NODE GROUP\n // WITH SAME RADIUS\n var circleOverlay = nodeEnter\n .append('svg:circle')\n .attr('class', 'circle-overlay')\n .attr('r', function (d) { return getCircleRadius(d) })\n\n // SET EVENTS ON NODE CIRCLES\n\n // PREVENT SCROLLING WHEN\n // DRAGGING NODES ON TOUCH DEVICES\n node.on('touchmove', function () {\n $('.parallax').css('overflow-y', 'hidden')\n })\n\n // RE-ENABLE SCROLLING ON TOUCH END\n .on('touchend', function () {\n $('.parallax').css('overflow-y', 'auto')\n })\n\n // TOGGLE CHILDREN AND DISPLAY\n // EMBEDED POST ON CLICK\n .on('click', function (d) {\n // IGNORE EVENTS ON PARENT NODES\n if (d.level === -1) { return }\n\n // PREVENT COLLAPSE ON DRAG\n if (d3.event.defaultPrevented) { return }\n\n // var element = d3.select(this)\n toggleChildren(d, this)\n displayModal(d)\n })\n\n .on('mouseenter', function (d) {\n // IGNORE EVENTS ON PARENT NODES\n if (d.level <= 0) { return }\n\n // RE-APPEND ELEMENT SO IT DISPLAYS ON TOP\n this.parentNode.appendChild(this)\n var element = d3.select(this)\n enlargeElement(element)\n })\n\n .on('mouseleave', function (d) {\n // IGNORE EVENTS ON PARENT NODES\n if (d.level <= 0) { return }\n\n var element = d3.select(this)\n shrinkElement(element)\n })\n\n // ADD ENGAGEMENT RATE TEXT\n var rateText = nodeEnter\n .append('svg:text')\n .attr('class', 'overlay-text')\n .text(function (d) {\n if (d.level > 0) {\n return (d.engage_rate * 100).toFixed(2) + '%'\n }\n })\n\n // ADD CATEOGORY TEXT\n var categoryText = nodeEnter\n .append('svg:foreignObject')\n .attr('class', 'category-text-container')\n .attr('width', FOREIGN_OBJ_SIZE)\n .attr('height', FOREIGN_OBJ_SIZE)\n\n var categoryWrapper = categoryText\n .append('xhtml:div')\n .attr('class', 'category-text-wrapper')\n .style('width', '100%')\n\n categoryWrapper.append('xhtml:text')\n .attr('class', 'category-text')\n .text(function (d) {\n if (d.level === 2) {\n return d.name.replace(/-/g, '\\n')\n };\n })\n\n // EXIT ANY OLD NODES\n node.exit().remove()\n\n // RE-SELECT EVERYTHING FOR UPDATE\n edge = svg.selectAll('line.edge')\n node = svg.selectAll('g.node')\n imageCircle = svg.selectAll('circle.image-circle')\n circleOverlay = svg.selectAll('circle.circle-overlay')\n rateText = svg.selectAll('.overlay-text')\n categoryText = svg.selectAll('.category-text-container')\n\n // EXECUTES ON EACH ITTERATION\n // OF THE FORCE LAYOUT (ANIMATES IT)\n function tick () {\n node // UPDATE NODE POSITION\n .attr('x', function (d) { return boundedUpdate(d, 'x') })\n .attr('y', function (d) { return boundedUpdate(d, 'y') })\n\n imageCircle // UPDATE CIRCLE POSITION\n .attr('cx', function (d) { return boundedUpdate(d, 'x') })\n .attr('cy', function (d) { return boundedUpdate(d, 'y') })\n\n circleOverlay // UPDATE OVERLAY POSITION\n .attr('cx', function (d) { return boundedUpdate(d, 'x') })\n .attr('cy', function (d) { return boundedUpdate(d, 'y') })\n\n rateText // UPDATE OVERLAY TEXT POSITION\n .attr('x', function (d) { return boundedUpdate(d, 'x') })\n .attr('y', function (d) { return boundedUpdate(d, 'y') })\n\n categoryText // UPDATE OVERLAY CATERGORY TEXT POSITION\n .attr('x', function (d) { return boundedUpdate(d, 'x') - (FOREIGN_OBJ_SIZE / 2) })\n .attr('y', function (d) { return boundedUpdate(d, 'y') - (FOREIGN_OBJ_SIZE / 2) })\n\n edge // UPDATE EDGE POSITION\n .attr('x1', function (d) { return boundedUpdate(d, 'x', 'source') })\n .attr('y1', function (d) { return boundedUpdate(d, 'y', 'source') })\n .attr('x2', function (d) { return boundedUpdate(d, 'x', 'target') })\n .attr('y2', function (d) { return boundedUpdate(d, 'y', 'target') })\n };\n}", "title": "" }, { "docid": "ffaf415c0c4336fbee64af9731b5a18b", "score": "0.43606833", "text": "function run() {\n let canvas = getCanvas() //this is a function that is on the helper section\n canvas.addEventListener('mousedown', onMouseDown);\n canvas.addEventListener('mousemove', onMouseMove);\n canvas.addEventListener('mouseleave', onMouseLeave);\n canvas.addEventListener('mouseenter', onMouseEnter);\n window.addEventListener('keyup', onKeyUp);\n window.addEventListener('resize', onWindowResize, false); //window resizer\n _model.points = new _rhino3dm.Point3dList();\n _model.viewport = new _rhino3dm.ViewportInfo();\n _model.viewport.screenPort = [0, 0, canvas.clientWidth, canvas.clientHeight];\n let proportion = canvas.clientWidth / canvas.clientHeight;\n _model.viewport.setFrustum(-30 * proportion,30 * proportion,-30,30,1,1000);\n draw();\n}", "title": "" }, { "docid": "f9321cae145f31341802af919e54ba74", "score": "0.43592823", "text": "function packageImports(nodes) {\n var map = {},\n imports = [];\n\n // Compute a map from name to node.\n nodes.forEach(function(d) {\n map[d.name] = d;\n });\n\n // For each import, construct a link from the source to target node.\n nodes.forEach(function(d) {\n if (d.imports) {\n //if (d.name.indexOf(\"flare.animate\")>-1) {\n var list = \"\";\n d.imports.forEach(function(i) {\n //if (map[i].name.indexOf(\"flare.animate\")>-1) {\n // list+=\"\\\"\"+map[i].name+\"\\\"\"+\",\";\n imports.push({source: map[d.name], target: map[i]});\n //} \n });\n // console.log(\"{\\\"name\\\":\\\"\"+d.name+\"\\\",\\\"size\\\":500,\\\"imports\\\":[\"+list.substring(0,list.length-1)+\"]},\");\n //} \n } \n });\n return imports;\n}", "title": "" }, { "docid": "49d5abfb9fb980337dd059ca1c742354", "score": "0.4355883", "text": "bootstrap(injection) {\n _webvr = config.webvr;\n _vive = config.vive;\n _sg3D = config.sg3D;\n console.log(`\\n*** n.bootstrap: _webvr is ${_webvr} _sg3D=${_sg3D}!!!!!`);\n console.log(`*** WEBVR is ${WEBVR} !!!!!!!!`);\n console.log(`*** injection:`);\n console.dir(injection);\n state = injection['state'];\n TWEEN = injection['TWEEN'];\n stats = injection['stats'];\n // freeze config => no modifications of scene.config properties\n Object.freeze(config);\n console.log(`!!!!!! config is frozen is ${Object.isFrozen(config)}`);\n if (config.test) {\n System.import(config._testTarget)\n .then((TestTarget) => {\n narrative['targets']['testTarget'] = TestTarget.testTarget; // export\n narrative.initialize();\n })\n .catch((e) => {\n mediator_1.mediator.loge(`narrative: import of testTarget caused error: ${e}`);\n console.trace();\n });\n }\n else {\n narrative.initialize();\n }\n }", "title": "" }, { "docid": "2956e586779f0dc5c3b33096362bf258", "score": "0.4354887", "text": "function in3d () {\n\n}", "title": "" }, { "docid": "dc65772652e772384e2ee43adebbd991", "score": "0.43548492", "text": "function setup(){\n var canvas = createCanvas(800,400);\n engine = Engine.create();\n world = engine.world;\n\n ground = new Ground(400,canvas.height-10,800,20);\n platform = new Ground(150, canvas.height-70, 300, 100);\n\n cannonBase1 = new BaseClass(200,265,100,30);\n //cannonBase2 = new BaseClass(200,234,75,30);\n cannonDome = new BaseBall(200,210,30);\n \n cannonGun=new Cannon(310,150,10,100,65);\n ball1 = new CannonBall(400,200,10);\n \n // enemy=new EnemyFire(600,100,10,30); \n\n \n \n\n \n}", "title": "" }, { "docid": "94f0ea40ff390241dd61d6070ffd7554", "score": "0.43486947", "text": "function d(o,r){o.include(_PositionAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_3__[\"PositionAttribute\"]),o.vertex.include(_util_DoublePrecision_glsl_js__WEBPACK_IMPORTED_MODULE_4__[\"DoublePrecision\"],r),o.varyings.add(\"vPositionWorldCameraRelative\",\"vec3\"),o.varyings.add(\"vPosition_view\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_RS\",\"mat3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_TH\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromModel_TL\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromView_TH\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_WorldFromView_TL\",\"vec3\"),o.vertex.uniforms.add(\"uTransform_ViewFromCameraRelative_RS\",\"mat3\"),o.vertex.uniforms.add(\"uTransform_ProjFromView\",\"mat4\"),o.vertex.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_5__[\"glsl\"]`vec3 positionWorldCameraRelative() {\nvec3 rotatedModelPosition = uTransform_WorldFromModel_RS * positionModel();\nvec3 transform_CameraRelativeFromModel = dpAdd(\nuTransform_WorldFromModel_TL,\nuTransform_WorldFromModel_TH,\n-uTransform_WorldFromView_TL,\n-uTransform_WorldFromView_TH\n);\nreturn transform_CameraRelativeFromModel + rotatedModelPosition;\n}\nvec3 position_view() {\nreturn uTransform_ViewFromCameraRelative_RS * positionWorldCameraRelative();\n}\nvoid forwardPosition() {\nvPositionWorldCameraRelative = positionWorldCameraRelative();\nvPosition_view = position_view();\ngl_Position = uTransform_ProjFromView * vec4(vPosition_view, 1.0);\n}\nvec3 positionWorld() {\nreturn uTransform_WorldFromView_TL + vPositionWorldCameraRelative;\n}`),o.fragment.uniforms.add(\"uTransform_WorldFromView_TL\",\"vec3\"),o.fragment.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_5__[\"glsl\"]`vec3 positionWorld() {\nreturn uTransform_WorldFromView_TL + vPositionWorldCameraRelative;\n}`)}", "title": "" }, { "docid": "bd3d73fd30e9d69dcd11f107a6301741", "score": "0.43475294", "text": "function NodeModulesPlugin(options) {\n this.options = Object.assign({}, {\n path : '.',\n prettyPrint : false,\n update : false,\n fullPath : true\n }, options);\n}", "title": "" }, { "docid": "3c967b68b5d82963e3546873d95121ab", "score": "0.4344669", "text": "function init(callback, update) {\n var stats = new Stats();\n stats.setMode(1);\n stats.domElement.style.position = 'absolute';\n stats.domElement.style.left = '0px';\n stats.domElement.style.top = '0px';\n document.body.appendChild(stats.domElement);\n\n //raycaster\n document.addEventListener('mousedown', onDocumentMouseDown, false);\n \n\n\n var gui = new DAT.GUI();\n var t = 0;\n\n var framework = {\n gui: gui,\n stats: stats,\n t: t\n };\n\n // run this function after the window loads\n window.addEventListener('load', function() {\n\n scene = new THREE.Scene();\n camera = new THREE.PerspectiveCamera( 45, window.innerWidth/window.innerHeight, 0.1, 1000 );\n\n var canvas = document.querySelector('#c');\n var renderer = new THREE.WebGLRenderer( { canvas } );\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.setClearColor(0x020202, 0);\n\n var controls = new OrbitControls(camera, renderer.domElement);\n controls.enableDamping = true;\n controls.enableZoom = true;\n controls.target.set(0, 0, 0);\n controls.rotateSpeed = 0.3;\n controls.zoomSpeed = 1.0;\n controls.panSpeed = 2.0;\n\n\n composer = new EffectComposer(renderer);\n composer.addPass(new RenderPass(scene, camera))\n\n\n // var effectFXAA = new EffectComposer.ShaderPass(fxaa());\n // effectFXAA.uniforms[ 'resolution' ].value.set(1 / window.innerWidth, 1 /window.innerHeight );\n // composer.addPass( effectFXAA );\n // effectFXAA.renderToScreen = true;\n // composer.addPass(effectFXAA);\n\n\n\n outlinePass = new OutlinePass( new THREE.Vector2( window.innerWidth, window.innerHeight ), scene, camera );\n var params = {\n edgeStrength: Number(0),\n edgeGlow: Number(0),\n edgeThickness: Number(0),\n pulsePeriod: Number(0),\n usePatternTexture : false\n }\n outlinePass.edgeStrength = params.edgeStrength;\n outlinePass.edgeGlow = params.edgeGlow;\n outlinePass.visibleEdgeColor.set(0xFFFFFF);\n outlinePass.hiddenEdgeColor.set(0xFFFFFF);\n outlinePass.selectedObjects = selectedObjectsToOutline;\n composer.addPass( outlinePass );\n\n var outputPass = new ShaderPass( CopyShader );\n outputPass.renderToScreen = true;\n composer.addPass( outputPass );\n\n \n\n // resize the canvas when the window changes\n window.addEventListener('resize', function() {\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n renderer.setSize(window.innerWidth, window.innerHeight);\n //effectFXAA.uniforms[ 'resolution' ].value.set(1 / window.innerWidth, 1 / window.innerHeight );\n composer.setSize(window.innerWidth, window.innerHeight);\n });\n\n // assign THREE.js objects to the object we will return\n framework.scene = scene;\n framework.camera = camera;\n framework.renderer = renderer;\n framework.selectedObjects = selectedObjects;\n\n // begin the animation loop\n (function tick(currentTime) {\n stats.begin();\n\n if(!startTime) startTime = currentTime;\n t = (currentTime - startTime) / duration;\n framework.scene.updateMatrixWorld();\n\n update(framework, t); // perform any requested updates\n //renderer.render(scene, camera); // render the scene\n composer.render();\n stats.end();\n requestAnimationFrame(tick); // register to call this again when the browser renders a new frame\n })();\n\n // we will pass the scene, gui, renderer, camera, etc... to the callback function\n return callback(framework);\n });\n}", "title": "" }, { "docid": "ae6a8ad5364dfa00849e8d325ba1284d", "score": "0.43415833", "text": "function rigger(err, q) {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tlog.e(' ** ERR:' + err);\n\t\t\t\t\t\tfunc(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet Scale;\n\t\t\t\t\tlet Process;\n\t\t\t\t\tlet rig = par.Rig;\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tlog.e(' ** ERR:' + err);\n\t\t\t\t\t\tfunc(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (!('X3D' in q)) {\n\t\t\t\t\t\tlog.e(' ** ERR:No model returned for', q.Name);\n\t\t\t\t\t\tfunc();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tlet x3d = q.X3D;\n\t\t\t\t\tlog.v(JSON.stringify(x3d, null, 2));\n\t\t\t\t\tif ('Units' in rig) {\n\t\t\t\t\t\tScale = null;\n\t\t\t\t\t\tlet units = rig.Units;\n\t\t\t\t\t\tswitch (units) {\n\t\t\t\t\t\t\tcase 'Inch':\n\t\t\t\t\t\t\t\tScale = 0.0254;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'Cm':\n\t\t\t\t\t\t\t\tScale = 0.01;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'Mm':\n\t\t\t\t\t\t\t\tScale = 0.001;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (Scale === null) {\n\t\t\t\t\t\t\tlog.e(' ** ERR:Invalid units <' + units + '>');\n\t\t\t\t\t\t\tfunz(err);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tProcess = scale;\n\t\t\t\t\t\t\ttraverse();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif('Scale' in rig) {\n\t\t\t\t\t\tScale = rig.Scale;\n\t\t\t\t\t\tProcess = scale;\n\t\t\t\t\t\ttraverse();\n\t\t\t\t\t}\n\t\t\t\t\tif('Marlin' in rig && rig.Marlin == true) {\n\t\t\t\t\t\tProcess = marlin;\n\t\t\t\t\t\ttraverse();\n\t\t\t\t\t}\n\t\t\t\t\tif('Textures' in rig) {\n\t\t\t\t\t\tTextures = rig.Textures;\n\t\t\t\t\t}\n\t\t\t\t\tif('Alias' in rig) {\n\t\t\t\t\t\tlog.v('--- Alias ---');\n\t\t\t\t\t\tAlias = rig.Alias;\n\t\t\t\t\t\tProcess = alias;\n\t\t\t\t\t\ttraverse();\n\t\t\t\t\t\tif('Textures' in x3d) {\n\t\t\t\t\t\t\tlet obj = x3d.Textures;\n\t\t\t\t\t\t\tlog.v(JSON.stringify(x3d.Textures, null, 2));\n\t\t\t\t\t\t\tif(Array.isArray(obj)) {\n\t\t\t\t\t\t\t\tfor(let itxt=0; itxt<obj.length; itxt++) {\n\t\t\t\t\t\t\t\t\tlet text = obj[itxt];\n\t\t\t\t\t\t\t\t\tif(text in Alias)\n\t\t\t\t\t\t\t\t\t\tobj[itxt] = Alias[text];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tlet keys = Object.keys(obj);\n\t\t\t\t\t\t\t\tfor(let ikey=0; ikey<keys.length; ikey++) {\n\t\t\t\t\t\t\t\t\tlet key = keys[ikey];\n\t\t\t\t\t\t\t\t\tif(key in Alias) {\n\t\t\t\t\t\t\t\t\t\tdelete obj[key];\n\t\t\t\t\t\t\t\t\t\tobj[Alias.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}\n\t\t\t\t\t\t\tlog.v(JSON.stringify(x3d.Textures, null, 2));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//\tif ('Scale' in rig) {\n\t\t\t\t\t//\t\tScale = rig.Scale;\n\t\t\t\t\t//\t\tProcess = scale;\n\t\t\t\t\t//\t\ttraverse();\n\t\t\t\t\t//\t}\n\t\t\t\t\tif ('FlipYZ' in rig && rig.FlipYZ == true) {\n\t\t\t\t\t\tProcess = flipyz;\n\t\t\t\t\t\ttraverse();\n\t\t\t\t\t}\n\t\t\t\t\tif('Ground' in rig && rig.Ground == true)\n\t\t\t\t\t\tground(1);\n\t\t\t\t\tif ('Base' in rig && rig.Base == true)\n\t\t\t\t\t\tground(2);\n\t\t\t\t\ttextures(par, x3d);\n\n\t\t\t\t\t//.....................................scale\n\t\t\t\t\t// Scale model\n\t\t\t\t\tfunction scale(comp, arr) {\n\t\t\t\t\t\tswitch (comp) {\n\t\t\t\t\t\t\tcase 'Pivot':\n\t\t\t\t\t\t\tcase 'Vertex':\n\t\t\t\t\t\t\t\tfor (let i = 0; i < arr.length; i++)\n\t\t\t\t\t\t\t\t\tarr[i] *= Scale;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//.....................................flipyz\n\t\t\t\t\t// Reverse y and z coordinates with\n\t\t\t\t\t// handedness correction\n\t\t\t\t\tfunction flipyz(comp, arr) {\n\t\t\t\t\t\tlet tmp;\n\t\t\t\t\t\tswitch (comp) {\n\t\t\t\t\t\t\tcase 'Pivot':\n\t\t\t\t\t\t\t\ttmp = arr[2];\n\t\t\t\t\t\t\t\tarr[2] = arr[1];\n\t\t\t\t\t\t\t\tarr[1] = -tmp;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'Vertex':\n\t\t\t\t\t\t\tcase 'Normal':\n\t\t\t\t\t\t\t\tfor (let i = 0; i < arr.length; i+=3) {\n\t\t\t\t\t\t\t\t\ttmp = arr[i + 2];\n\t\t\t\t\t\t\t\t\tarr[i + 2] = arr[i + 1];\n\t\t\t\t\t\t\t\t\tarr[i + 1] = -tmp;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//.....................................marlin\n\t\t\t\t\tfunction marlin(comp, arr) {\n\t\t\t\t\t\tlog.v('comp', comp);\n\t\t\t\t\t\tswitch(comp) {\n\t\t\t\t\t\t\tcase 'Diffuse':\n\t\t\t\t\t\t\t\tlog.v('Diffuse', arr);\n\t\t\t\t\t\t\t\tarr[0] = 255;\n\t\t\t\t\t\t\t\tarr[1] = 255;\n\t\t\t\t\t\t\t\tarr[2] = 255;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//.....................................ground\n\t\t\t\t\t// Shift model so lowest z is 0.0\n\t\t\t\t\t// mode=1 - Shift model z=0\n\t\t\t\t\t// mode=2 - Same as 1 but center xy\n\t\t\t\t\tfunction ground(mode) {\n\t\t\t\t\t\tlet xyz = [100000.0, -100000.0, 100000.0,\n\t\t\t\t\t\t\t-100000.0, 100000.0, -100000.0];\n\t\t\t\t\t\tProcess = range;\n\t\t\t\t\t\ttraverse();\n\t\t\t\t\t\tlet cntr = [0, 0, 0];\n\t\t\t\t\t\tfor (let i = 0; i < 3; i++)\n\t\t\t\t\t\t\tcntr[i] = 0.5 * (xyz[2 * i] + xyz[2 * i + 1]);\n\t\t\t\t\t\tProcess = shift;\n\t\t\t\t\t\ttraverse();\n\n\t\t\t\t\t\tfunction range(comp, arr) {\n\t\t\t\t\t\t\tif(comp == 'Vertex') {\n\t\t\t\t\t\t\t\tlet nvrt = arr.length;\n\t\t\t\t\t\t\t\tlet iarr;\n\t\t\t\t\t\t\t\tlet ixyz;\n\t\t\t\t\t\t\t\tfor (let ivrt = 0; ivrt < nvrt; ivrt += 3) {\n\t\t\t\t\t\t\t\t\tfor (let i = 0; i < 3; i++) {\n\t\t\t\t\t\t\t\t\t\tiarr = 3 * ivrt + i;\n\t\t\t\t\t\t\t\t\t\tixyz = 2 * i;\n\t\t\t\t\t\t\t\t\t\tif (arr[iarr] < xyz[ixyz])\n\t\t\t\t\t\t\t\t\t\t\txyz[ixyz] = arr[iarr];\n\t\t\t\t\t\t\t\t\t\tif (arr[iarr] > xyz[ixyz + 1])\n\t\t\t\t\t\t\t\t\t\t\txyz[ixyz + 1] = arr[iarr];\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\n\t\t\t\t\t\tfunction shift(comp, arr) {\n\t\t\t\t\t\t\tlet zmin = 10000.0;\n\t\t\t\t\t\t\tif (comp == 'Vertex') {\n\t\t\t\t\t\t\t\tswitch (mode) {\n\t\t\t\t\t\t\t\t\tcase 1: // Make base level with ground\n\t\t\t\t\t\t\t\t\t\tfor (var i = 2; i < arr.length; i += 3)\n\t\t\t\t\t\t\t\t\t\t\tarr[i] -= xyz[4];\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 2: // Center as well as mode 1\n\t\t\t\t\t\t\t\t\t\tvar n = arr.length;\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < n; i += 3) {\n\t\t\t\t\t\t\t\t\t\t\tarr[i] -= cntr[0];\n\t\t\t\t\t\t\t\t\t\t\tarr[i+1] -= cntr[1];\n\t\t\t\t\t\t\t\t\t\t\tarr[i+2] -= xyz[4];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tbreak;\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\n\t\t\t\t\t//.....................................alias\n\t\t\t\t\t// Replaces texture files with different ones\n\t\t\t\t\tfunction alias(comp, part) {\n\t\t\t\t\t\tif(comp == 'Part') {\n\t\t\t\t\t\t\tif('Texture' in part) {\n\t\t\t\t\t\t\t\tif(part.Texture in Alias) {\n\t\t\t\t\t\t\t\t\tlog.v(part.Texture, '<=', Alias[part.Texture]);\n\t\t\t\t\t\t\t\t\tpart.Texture = Alias[part.Texture];\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\n\t\t\t\t\tfunction traverse() {\n\t\t\t\t\t\tlet arr = x3d.Root;\n\t\t\t\t\t\tfor (let i = 0; i < arr.length; i++)\n\t\t\t\t\t\t\ttrv(arr[i], 0);\n\n\t\t\t\t\t\tfunction trv(obj, lev) {\n\t\t\t\t\t\t\tif ('Pivot' in obj)\n\t\t\t\t\t\t\t\tProcess('Pivot', obj.Pivot);\n\t\t\t\t\t\t\tif ('Parts' in obj) {\n\t\t\t\t\t\t\t\tvar arr = obj.Parts;\n\t\t\t\t\t\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\t\t\t\t\t\t\tlet part = arr[i];\n\t\t\t\t\t\t\t\t\tProcess('Part', part);\n\t\t\t\t\t\t\t\t\tif ('Vrt' in part)\n\t\t\t\t\t\t\t\t\t\tProcess('Vertex', part.Vrt);\n\t\t\t\t\t\t\t\t\tif ('Nrm' in part)\n\t\t\t\t\t\t\t\t\t\tProcess('Normal', part.Nrm);\n\t\t\t\t\t\t\t\t\tif('Diffuse' in part)\n\t\t\t\t\t\t\t\t\t\tProcess('Diffuse', part.Diffuse);\n\t\t\t\t\t\t\t\t/*\tif('Texture' in part) {\n\t\t\t\t\t\t\t\t\t\tif(!('Textures' in par))\n\t\t\t\t\t\t\t\t\t\t\tpar.Textures = [];\n\t\t\t\t\t\t\t\t\t\tif(par.Textures.indexOf(part.Texture) < 0)\n\t\t\t\t\t\t\t\t\t\t\tpar.Textures.push(part.Texture);\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\tif ('Nodes' in obj) {\n\t\t\t\t\t\t\t\tvar arr = obj.Nodes;\n\t\t\t\t\t\t\t\tfor (var i = 0; i < arr.length; i++)\n\t\t\t\t\t\t\t\t\ttrv(arr[i], lev + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}", "title": "" }, { "docid": "dc9e7e4a2292a81823fc5c5c3db4b4af", "score": "0.43407807", "text": "async use (node) {\r\n let id = node.constructor.name.toLowerCase() // Class name of entrypoint\r\n let group = node.config.provided.group\r\n\r\n // Ignore node if disabled\r\n if (node.config.provided.disable) {\r\n return\r\n }\r\n\r\n // Apply public cert to api nodes for JWT signing. The certs are generated\r\n // on the auth node, which is why it's important to always run and await it\r\n // before all other nodes.\r\n if (id === 'api' && group !== 'auth' && !node.config.provided.certPublic &&\r\n cubic.config.auth) {\r\n node.config.provided.certPublic = cubic.config.auth.api.certPublic\r\n }\r\n\r\n // Only set initial config when no group is specified; group will already\r\n // have the config for sub-nodes set (also follows the same schema as\r\n // nodes, e.g. cubic.nodes.auth.api -> cubic.config.auth.api)\r\n if (!group) {\r\n this.setConfig(id, node.config)\r\n }\r\n // If sub-node does have group, we still have to merge the default config\r\n // with what's provided by the group node.\r\n else {\r\n cubic.config[group] = cubic.config[group] || {}\r\n cubic.config[group][id] = this.getConfig(node.config)\r\n }\r\n\r\n // Run hooks before initiating node\r\n await this.runHooks(`${group ? group + '.' : ''}${id}`)\r\n\r\n // Given node is a bigger one (not core or api): run init script and provide\r\n // empty object for other nodes to attach to\r\n if (id !== 'api' && id !== 'core') {\r\n cubic.nodes[id] = {}\r\n await node.init()\r\n }\r\n // Actual node (cubic-core or cubic-api)\r\n else {\r\n // Assign node directly by name or as part of bigger node\r\n if (group) {\r\n cubic.nodes[group] = cubic.nodes[group] || {}\r\n cubic.nodes[group][id] = node\r\n await cubic.nodes[group][id].init()\r\n } else {\r\n cubic.nodes[id] = node\r\n await cubic.nodes[id].init()\r\n }\r\n let name = group ? `${group} ${id}` : id\r\n let port = id === 'api' ? ` (Listening on :${node.config.provided.port || node.config.local.port})` : ''\r\n cubic.log.monitor(`Loaded ${name} node${port}`, true, `${new Date() - launch}ms`)\r\n }\r\n\r\n return node\r\n }", "title": "" }, { "docid": "0117824010701a14ec4f72a3a1a4e6c8", "score": "0.4337293", "text": "function setup() {\r\n\r\n}", "title": "" }, { "docid": "77bbae81822d15a7814f8702d020b4b7", "score": "0.4336999", "text": "function buildForNode() {\n return doRollup('src/index.js', false, {\n cjs: 'lib/index.js',\n es: 'lib/index.es.js'\n });\n}", "title": "" }, { "docid": "3f6a9e782005031d41997e9133b97b0f", "score": "0.43358997", "text": "function setup() {\n \n // create an HL app to start retrieving kinect datas\n // and automatically call the function update, onUserIn and onUserOut\n app = new HL.App();\n\n // set it up with our project's metadatas\n app.setup({\n projectName : '..',\n author1 : 'Julie-Lou Bellenot',\n author2 : 'Lara Défayes'\n });\n\nimportSVG('assets/testparse/level2.svg');\n}", "title": "" }, { "docid": "849d9c8141c2084813fca535e25379ab", "score": "0.43299118", "text": "function setup(){\nvar cuerpo=new THREE.Mesh(new THREE.CylinderGeometry(1,2,5,10));\npiernaD=new Pierna();\npiernaI=new Pierna();\n\n//El cuerpo y las piernas se desplazan a posiciones deseadas\ncuerpo.position.y=2;\npiernaD.position.z=-1;\npiernaI.position.z=1;\n\n//Determinamos que tanto van a rotar las figuras en un momento dado\nstep=.01;\n\n//Definimos la escena\nescena=new THREE.Scene();\nescena.add(cuerpo);\nescena.add(piernaD);\nescena.add(piernaI);\n\n//Agregamos camara y renderer\ncamara=new THREE.PerspectiveCamera();\ncamara.position.z=20;\nrenderer =new THREE.WebGLRenderer();\nrenderer.setSize(window.innerHeight*.95, window.innerHeight*.95);\ndocument.body.appendChild(renderer.domElement);\n}", "title": "" }, { "docid": "18b7ee9ce72cd3b6f23bd8e825feba26", "score": "0.43290898", "text": "function collide(alpha) {\n \n var quadtree = d3.geom.quadtree(nodes);\n \n return function(d) {\n \n // select node DOM elements\n var nodeGroup = canvas\n .select(\"#node-\" + d.id).node();\n\n // get size of the group element\n var groupSize = nodeGroup.getBBox().height + nodePadding;\n\n // get coordinate values\n var r = groupSize / 2 + nodePadding;\n var nx1 = d.x - r;\n var nx2 = d.x + r;\n var ny1 = d.y - r;\n var ny2 = d.y + r;\n \n quadtree.visit(function(quad, x1, y1, x2, y2) {\n \n if (quad.point && (quad.point !== d)) {\n \n var x = d.x - quad.point.x;\n var y = d.y - quad.point.y;\n var l = Math.sqrt(x * x + y * y);\n var r = groupSize / 2 + quad.point.r;\n\n // check if location against radius\n if (l < r) {\n\n l = (l - r) / l * 0.5;\n d.x -= x *= l;\n d.y -= y *= l;\n quad.point.x += x;\n quad.point.y += y;\n\n };\n\n };\n \n return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;\n \n })\n \n }\n }", "title": "" } ]
79a65df3be96f084ba30f8cceba10de3
updating the center for teh map..
[ { "docid": "a1d0d713466f09cba5d316385178fa4b", "score": "0.7666906", "text": "updateCenter(e){\n let center = e.target.getCenter(); //cordinates of the center\n this.set('lat', center.lat)\n this.set('lng', center.lng)\n }", "title": "" } ]
[ { "docid": "7d8cd79d4d3e0ae81ec9e4e76d2e95ec", "score": "0.84573257", "text": "function calculateCenter() {\r\n center = map.getCenter();\r\n}", "title": "" }, { "docid": "3b97b098efeb3f3143b9a2325bb2bc07", "score": "0.8395074", "text": "function calculateCenter(){\n center = map.getCenter();\n }", "title": "" }, { "docid": "d0f0b09481a213cd49284c144cf9eb46", "score": "0.83103526", "text": "function calculateCenter() {\n center = map.getCenter();\n}", "title": "" }, { "docid": "d366c00721088be57d7920a822e559de", "score": "0.7974573", "text": "function centerMap() {\n getLocation()\n }", "title": "" }, { "docid": "ce615e08d25e469decda29c591f8eb42", "score": "0.79740846", "text": "function centerMap() {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar $this = sets.element;\r\n\t\tvar location = new Point(($this.innerWidth()/2)-(sets.resolutions[sets.zoom-1].width/2),($this.innerHeight()/2)-(sets.resolutions[sets.zoom-1].height/2));\r\n\t\tsetInnerDimentions(location);\r\n\t}", "title": "" }, { "docid": "4c887527352d723be713960686441e78", "score": "0.79122114", "text": "updateCenter(value) {\n this.set('selec',value);\n this.set('lat',value.lat);\n this.set('lng',value.lon);\n this.set('zoom','16');\n }", "title": "" }, { "docid": "e75a7358a515590cd600016579822762", "score": "0.78942573", "text": "function updateCenter()\n{\n\tThisCenter = map.getCenter();\n\tThisLat = ThisCenter.lat();\n\tThisLong = ThisCenter.lng();\n\tdocument.getElementById(\"center_latitude\").value = ThisLat;\n\tdocument.getElementById(\"center_longitude\").value = ThisLong;\n}", "title": "" }, { "docid": "04dcb74900e6f8fbe5ab6c3bb5914a38", "score": "0.78061134", "text": "function reCenterMap() {\n // map.setCenter({ lat: yourLat, lng: yourLng })\n map.setCenter( origMapCenter );\n } // reCenterMap()", "title": "" }, { "docid": "dce126c47c68aa5ff4ea812e5ea38169", "score": "0.78021926", "text": "function btnRecenter() {\n olData.getMap().then(function(map){\n //this coordinate is coordinate of Mesjid Raya Baiturrahman\n var latLon = [10610664.603506522,619192.4795668736];\n map.getView().setCenter(latLon);\n map.getView().setZoom(15);\n });\n }", "title": "" }, { "docid": "259782e5f5cd4592bceb76c9258dbc24", "score": "0.7672211", "text": "function centrer() {\n\tmap.setView(new L.LatLng(46.4328, 6.9136), 15);\n}", "title": "" }, { "docid": "157b52960f45ed7f6ce8152a68364f26", "score": "0.76599103", "text": "function centerMap(){\n map.fitBounds(b);\n map.setZoom(z);\n }", "title": "" }, { "docid": "ad4084863c515e380745952e2f2fd04d", "score": "0.76501995", "text": "function updateMapCenter(){\n\tif(lastPoint != null){\n\t\tmap.setCenter(new google.maps.LatLng(lastPoint.latitude, lastPoint.longitude));\n\t\tmap.setZoom(16);\n\t} else if(sizeListArea > 0){\n\t\tbiggestCircle = null;\n\t\tfor(i = 0; i < sizeListArea; i++){\n\t\t\tif(listArea[i].circle.fillColor == allowedColor && (biggestCircle == null || biggestCircle.radius < listArea[i].circle.radius)){\n\t\t\t\tbiggestCircle = listArea[i].circle;\n\t\t\t}\n\t\t}\n\t\tif(biggestCircle != null){\n\t\t\tmap.setCenter(biggestCircle.getCenter());\n\t\t\tmap.setZoom(16);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f2a39812e10e2685f0e1dc35e71b3a9b", "score": "0.7541195", "text": "function centerMap(){\n\tvar point = map.getCenter();\n\n\t$('#aside__detail').hide();\n\teasingAnimator.easeProp({\n\t\tlat: point.lat(),\n\t\tlng: point.lng()\n\t}, center);\n\tmap.setZoom(NORMAL_ZOOM_DISTANCE);\n}", "title": "" }, { "docid": "5cc38a5cacf4e025b2ff843db27fa715", "score": "0.7500383", "text": "function update_positie(event) {\n // use config.currentPosition to center the map\n var newPos = new google.maps.LatLng(config.currentPosition.coords.latitude, config.currentPosition.coords.longitude);\n config.map.setCenter(newPos);\n currentPositionMarker.setPosition(newPos);\n }", "title": "" }, { "docid": "1dc71b90346f498d175d48c512807244", "score": "0.74976546", "text": "function setMapCenter() {\n\t$(\"#leftDivInfo\").css({\n\t\t'width': '25%',\n\t\t'margin-top': '0px'\n\t});\n\t$(\"#map-canvas\").css({\n\t\t'height': '700px',\n\t\t'margin-top': '-740px',\n\t\t'margin-left': '25%',\n\t\t'width': '40%'\n\t});\n}", "title": "" }, { "docid": "d882d35aedb43287f794e6ddcc0238ca", "score": "0.7374318", "text": "function mapForApproximateLocationCentreChanged()\n {\n determineLocationFromMap();\n }", "title": "" }, { "docid": "a9502ddd79d4489a441f14e2b88e1dc1", "score": "0.73646724", "text": "recenterMap() {\n const map = this.map;\n let curr = this.props.currentLocation;\n\n const google = this.props.google;\n const maps = google.maps;\n const zoom = this.props.zoom;\n\n if (map) {\n let center = new maps.LatLng(curr.lat, curr.lng);\n map.panTo(center);\n map.setZoom(zoom)\n }\n }", "title": "" }, { "docid": "394df6cd5e2abd96e6fd54c1be8e4a6c", "score": "0.73147804", "text": "function CenterMap() {\n if(props.centerOnMarker && props.centerOnMarker[0] && props.centerOnMarker[1]) {\n const map = useMap();\n try { \n map.invalidateSize(true);\n map.flyTo(props.centerOnMarker, map.getMaxZoom());\n } catch (e) {\n // center map - when marker coords are not set (on new search request)\n map.flyTo(centerCoords, map.getZoom());\n } \n }\n return null;\n }", "title": "" }, { "docid": "55f8e71ec5992c8a37f3c6eeed9def66", "score": "0.72728723", "text": "function mapper_center() {\n var markers = map_markers;\n if (markers == null || markers.length < 1 ) return;\n var bounds = new GLatLngBounds();\n for (var i=0; i<markers.length; i++) {\n bounds.extend(markers[i].getPoint());\n }\n var thezoom = map.getBoundsZoomLevel(bounds);\n if(thezoom > 15 ) thezoom = 15;\n map.setCenter( bounds.getCenter( ), thezoom );\n}", "title": "" }, { "docid": "3e30f8e779a825d862052d48a36d0fbc", "score": "0.7251504", "text": "function mapper_center_marker() {\t \n var center = map.getCenter();\n //mapper_set_marker(center);\n}", "title": "" }, { "docid": "53f01ad5f621934728455562327a353f", "score": "0.7223764", "text": "function updateMapCenter(event, coords) {\n mapCenter = [coords.lng, coords.lat].join(',');\n }", "title": "" }, { "docid": "71027e9d7f322b5f7605bf6586743dc4", "score": "0.7195887", "text": "centre(){\n this.map.fitBounds(this.bounds)\n }", "title": "" }, { "docid": "b6f4af44b6bcb70184d9aa01938667ad", "score": "0.7181848", "text": "function centerMap() {\n map.setCenter(latlngBounds.getCenter());\n map.fitBounds(latlngBounds);\n }", "title": "" }, { "docid": "61289c2f93ed5c44892aa1a1c35032a5", "score": "0.71741074", "text": "function centreMap() {\n if (Object.keys(people).length == 0) { // Can't possibly be POIs if < 2 people\n map.setCenter(new google.maps.LatLng(54.152141, -3.032227));\n map.setZoom(7);\n } else if (Object.keys(people).length == 1) {\n map.setCenter(people[Object.keys(people)[0]].marker.getPosition());\n map.setZoom(10);\n } else {\n map.fitBounds(bounds, {left: $overlay.width()});\n }\n }", "title": "" }, { "docid": "db10891529ffec66bd744e53a35b9dfc", "score": "0.7164512", "text": "function centreMap(e) {\n if (this.textContent === \"Hotel\") {\n markerLocation = [centralMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Bar\") {\n markerLocation = [northMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Cafe\") {\n markerLocation = [southMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"ART-shop\") {\n markerLocation = [westMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Restaurant\") {\n markerLocation = [eastMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Gallery\") {\n markerLocation = [gallery.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Museum\") {\n markerLocation = [markerMuseum.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n }", "title": "" }, { "docid": "a2b4fc826a58100b2f977a56dce2b341", "score": "0.7160923", "text": "function changeMapCenter() {\n deleteMarkers(); // clear markers out of both arrays since they will change.\n var geocoder = new google.maps.Geocoder(); // new geocoder instance\n var address = vm.userDefLocation(); // retreive address from te search bar\n // run geocode:\n geocoder.geocode({\n address: address\n }, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n newCenter = results[0].geometry.location;\n map.setCenter(newCenter);\n map.setZoom(12);\n mapCenterMarker.setPosition(newCenter);\n } else {\n // if error thrown, alerts user\n window.alert(\"location could not be found, try another one!\");\n }\n });\n // Need to run updateShops() once the map has loaded and the new map center has been established\n // Needed to find when map load has finished, found solution online using the map 'idle' throw.\n // map idle solution found on stack overflow: (http://stackoverflow.com/questions/832692/how-can-i-check-whether-google-maps-is-fully-loaded)\n google.maps.event.addListenerOnce(map, 'idle', function() {\n updateShops();\n });\n}", "title": "" }, { "docid": "9f899cd2bd8dc9db82eaf4cfda17d8e1", "score": "0.7152305", "text": "function centerlivemap() {\r\n\r\n\tvar havemarkers = false;\r\n\r\n\t//Go through units\r\n\tfor (unit in unitinfo) {\r\n\r\n\t\t//If unit marker is currently hidden or is shown but has has moved\r\n\t\tif (unitinfo[unit][\"marker\"] != undefined) {\r\n\t\t\thavemarkers = true;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//If there are markers\r\n\tif (havemarkers) {\r\n\t\t//Auto center and zoom on markers\r\n\t\tmapstraction.autoCenterAndZoom();\r\n\t\t\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "d4925d730c788947cdab03adcbc6dfd1", "score": "0.7147163", "text": "set center(value) {}", "title": "" }, { "docid": "6e679a0f323562ccc7787a5a71ba3e19", "score": "0.71380943", "text": "function backToCenter() {\n // Show map\n d3.selectAll(\".geo-path\")\n .style(\"fill-opacity\", 0.5);\n\n d3.selectAll(\".circles\")\n .style(\"opacity\", 1)\n\n // Hide labels\n d3.selectAll(\".label\")\n .transition().duration(500)\n .style(\"opacity\", 0);\n\n\n //Make the cover cirlce to its true size again\n // d3.selectAll(\".cityCover\")\n // .transition().duration(800).delay(0)\n // .attr(\"r\", coverCirleRadius)\n // .style(\"opacity\", 1);\n\n // forceContinent.start()\n forceAll.start()\n\n // //Move the circles to the 0,0 coordinate\n // d3.selectAll(\".circles\")\n // .transition()\n // .duration(200).delay(function (d, i) {\n // return i * 2;\n // })\n // .attr(\"cx\", projection([0, 0])[0])\n // .attr(\"cy\", projection([0, 0])[1])\n\n }", "title": "" }, { "docid": "e2c0251dd3d64f361a765f4ec55b2f8d", "score": "0.71361506", "text": "recenterMap() {\n const map = this.map;\n const current = this.state.currentLocation;\n\n const google = this.props.google;\n const maps = google.maps;\n\n if (map) {\n let center = new maps.LatLng(current.lat, current.lng);\n map.panTo(center);\n }\n }", "title": "" }, { "docid": "68479896bb80f30f9a6d581fb07d84ae", "score": "0.71110046", "text": "function placeCenterAndPin(){\n setCenterAndMarker();\n initMap();\n }", "title": "" }, { "docid": "0d89851e44d9a45d4e566463a58c3164", "score": "0.7101946", "text": "function recenterMap(target) {\n console.log(target)\n map.setView(target,8);\n}", "title": "" }, { "docid": "adcfb4daba26e8e96873a2fe6aecf70c", "score": "0.7091586", "text": "function update() {\n d3.select(\"#mapid\")\n .select(\"svg\")\n .selectAll(\"circle\")\n .attr(\"cx\", function(d){ return uwmap.latLngToLayerPoint([d.lat, d.lng]).x })\n .attr(\"cy\", function(d){ return uwmap.latLngToLayerPoint([d.lat, d.lng]).y })\n}", "title": "" }, { "docid": "a65df9b717b72ff9df0ba6a60481a004", "score": "0.70897573", "text": "function showCoords() {\n // TODO: Set the map center to the latitude / longitude position of your own home\n\n\n // TODO: Zoom the map close enough\n\n}", "title": "" }, { "docid": "cb96095acfc4bffb57d727f12be28334", "score": "0.7080481", "text": "function geofield_gmap_center(mapid) {\n google.maps.event.trigger(geofield_gmap_data[mapid].map, 'resize');\n geofield_gmap_data[mapid].map.setCenter(geofield_gmap_data[mapid].marker.getPosition());\n}", "title": "" }, { "docid": "8ff7e2bb9bcec4fbcf07ee016c79ea10", "score": "0.7064836", "text": "setCenter() {\n this.cx = this.x + this.width / 2;\n this.cy = this.y + this.height / 2;\n }", "title": "" }, { "docid": "4b55d4bbee51a33aac2d51f54748c865", "score": "0.706159", "text": "function centerMap() {\n var latlngbounds = new google.maps.LatLngBounds();\n vm.currentHike.path.forEach(function (waypoint) {\n latlngbounds.extend(waypoint)\n })\n vm.map.fitBounds(latlngbounds);\n }", "title": "" }, { "docid": "b6ff02d0c9d17fed6ab5ee41e84e75a7", "score": "0.70551896", "text": "function centerMap(error, data) {\n var centre = {lat: -34.397, lng: 150.644}; //default map center\n \n //if getGeocode returns a valid location, center the map using that location\n if (!error && data.status === 'OK' ) { \n centre = data.results[0].geometry.location;\n }\n map.setCenter(centre);\n }", "title": "" }, { "docid": "b2a915bfa3b2524db753b6ba9e935060", "score": "0.7040521", "text": "function mapCenter (){\n if (window.innerWidth > 600) {return [40, -125]}\n else {return [40, -98]}\n }", "title": "" }, { "docid": "f562c1906d5565e913fe89b1f2f4cac8", "score": "0.7026984", "text": "centerMap(){\n const { latitude, longitude, latitudeDelta, longitudeDelta } = this.state.region;\n this.map.animateToRegion({\n latitude,\n longitude,\n latitudeDelta,\n longitudeDelta,\n })\n }", "title": "" }, { "docid": "291a48846bfd31aa15529656c8fdd6ad", "score": "0.70082957", "text": "function recenterMap(lat, lng) {\n\tMAP_CENTER = new google.maps.LatLng(lat, lng);\n\t\n\treinitMap();\n}", "title": "" }, { "docid": "f386a24757c3468057d3bf77a747ab6c", "score": "0.7007675", "text": "function setMapView() {\n var gmCenter = new google.maps.LatLng(STATE_GEOS[CURR_STATE].LocLat, STATE_GEOS[CURR_STATE].LocLon);\n MAP.setCenter(gmCenter);\n MAP.setZoom(parseInt(STATE_GEOS[CURR_STATE].ZoomLevel));\n}", "title": "" }, { "docid": "27aa020f27dd22e45fa08124b3094c96", "score": "0.70019525", "text": "function gmapRecenter(map) {\n var latnew = Number(document.getElementById(\"pln-latitude\").value);\n const lngnew = Number(document.getElementById(\"pln-longitude\").value);\n const loca = { lat: latnew, lng: lngnew };\n map.setCenter(loca);\n map.setZoom(15);\n\n //* Also recentre Bing Map at the same time\n GetMap(document.getElementById(\"pln-latitude\").value, document.getElementById(\"pln-longitude\").value);\n}", "title": "" }, { "docid": "e79f11c8bc16ad2f3eba3e7a96abf6d0", "score": "0.69561255", "text": "setCenter() {\n this.center = createVector(this.x, this.y);\n }", "title": "" }, { "docid": "0cf539743bc656118c658021c2cf02d3", "score": "0.69436455", "text": "resetCenter() {\n this.center = createVector(this.x + this.w / 2, this.y + this.h / 2);\n }", "title": "" }, { "docid": "479652a7c577d4a784b526824058b110", "score": "0.69346166", "text": "_updatePosFromCenter() {\n let half = this._size.$multiply(0.5);\n this._topLeft = this._center.$subtract(half);\n this._bottomRight = this._center.$add(half);\n }", "title": "" }, { "docid": "86cdcf8054faee3fe07699d47e6d88b5", "score": "0.69164324", "text": "setCenter() {\n let x = 0;\n let y = 0;\n for (var v of this.pixelVectorPositions) {\n x += v.x;\n y += v.y;\n }\n\n x /= this.pixelVectorPositions.length;\n y /= this.pixelVectorPositions.length;\n this.center = createVector(x, y);\n\n }", "title": "" }, { "docid": "862a7604ff7ba97cab092dfe7151785f", "score": "0.6907235", "text": "function setCenter(loclist) {\n var minlat = maxlat = minlon = maxlon = 0.0;\n var centerlat = centerlon = 0.0;\n \n if(loclist[0].transaction_id){ // we're dealing with alerts data\n minlat = maxlat = parseFloat(loclist[0].lat);\n minlon = maxlon = parseFloat(loclist[0].lon);\n for (var i = 1; i < loclist.length; i++) {\n adata = loclist[i];\n lat = parseFloat(adata.lat);\n lon = parseFloat(adata.lon);\n console.debug('lat:' + lat + '/lon:' + lon);\n if (lat < minlat) minlat = lat;\n if (lat > maxlat) maxlat = lat;\n if (lon < minlon) minlon = lon;\n if (lon > maxlon) maxlon = lon;\n } \n mapOptions.zoom = 8;\n } \n else { // we're dealing with heatmaps data\n minlat = maxlat = loclist[0].lat;\n minlon = maxlon = loclist[0].lng;\n for (var i = 1; i < loclist.length; i++) {\n adata = loclist[i];\n console.debug('lat:' + adata.lat + '/lon:' + adata.lng);\n if (adata.lat < minlat) minlat = adata.lat;\n if (adata.lat > maxlat) maxlat = adata.lat;\n if (adata.lng < minlon) minlon = adata.lng;\n if (adata.lng > maxlon) maxlon = adata.lng;\n }\n mapOptions.zoom = 5;\n }\n console.log('LAT min:' + minlat + ', max:' + maxlat + ' and LON min:' + minlon + ', max:' + maxlon);\n \n centerlat = (maxlat + minlat)/2;\n centerlon = (maxlon + minlon)/2;\n console.log('LAT center:' + centerlat + ' and LON center:' + centerlon);\n \n mapOptions.center = new google.maps.LatLng(centerlat, centerlon);\n}", "title": "" }, { "docid": "ccc1f1aaa5aa9a67ed135bcb3a4abcda", "score": "0.6903905", "text": "function mapCenter(){\n\tvar latAvg = 0;\n\tvar lngAvg = 0;\n\tvar latlngCenter;\n\t\n\tfor (i = 0; i < parklist.length; i++){\n\t\tlatAvg = latAvg + parseFloat(parklist[i]['Latitude']);\n\t\tlngAvg = lngAvg + parseFloat(parklist[i]['Longitude']);\n\t}\t\n\tlatAvg = latAvg / parklist.length;\n\tlngAvg = lngAvg / parklist.length;\n\t\t\n\tlatlngCenter = [latAvg, lngAvg];\n\treturn latlngCenter;\n}", "title": "" }, { "docid": "55c42472462618029907e7edbbfa7ae4", "score": "0.6902056", "text": "function viewchange() \n{\n // keep map centered on shuttle's marker\n var latlng = new google.maps.LatLng(shuttle.position.latitude, shuttle.position.longitude);\n map.setCenter(latlng);\n bus.setPosition(latlng);\n}", "title": "" }, { "docid": "55c42472462618029907e7edbbfa7ae4", "score": "0.6902056", "text": "function viewchange() \n{\n // keep map centered on shuttle's marker\n var latlng = new google.maps.LatLng(shuttle.position.latitude, shuttle.position.longitude);\n map.setCenter(latlng);\n bus.setPosition(latlng);\n}", "title": "" }, { "docid": "f983f321903b8a070b8d42eadf202fdf", "score": "0.68975115", "text": "function _map_setCenterAndZoom(map,center,nZoom){\r\n\tif (map){\r\n\t\tmap.setCenter(center,nZoom);\r\n\t}\r\n}", "title": "" }, { "docid": "95546a35bfa4c6b01d330aa66c0d9dd0", "score": "0.6892836", "text": "setCenter() {\n let x = 0;\n let y = 0;\n for (let v of this.pixelVectorPositions) {\n x += v.x;\n y += v.y;\n }\n\n x /= this.pixelVectorPositions.length;\n y /= this.pixelVectorPositions.length;\n this.center = createVector(x, y);\n }", "title": "" }, { "docid": "1668b2ddcf6132c4599c17340776ff39", "score": "0.6868478", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapNLCD.resize();\n roeMapNLCD.reposition();\n }", "title": "" }, { "docid": "7b7f98b0e726ef4701b044f846a471cd", "score": "0.6867612", "text": "function centerOnUser() {\n bigMap.config.center = {\n lat : UserLocation.real.lat,\n lng : UserLocation.real.lon,\n zoom: 17\n };\n }", "title": "" }, { "docid": "1780d84012d1e443bf67ead023661b3a", "score": "0.6861818", "text": "function getCenter()\n{\n\tMicrosoft.Maps.loadModule('Microsoft.Maps.Themes.BingTheme', { callback: function() { \n\tvar latlon = map.getCenter();\n\tcurrentLat = latlon.latitude;\n\tcurrentLon = latlon.longitude;\n\t//document.getElementById(\"latid\").value = latlon.latitude;\n\t//document.getElementById(\"lonid\").value = latlon.longitude;\n\t//alert('xLat : ' + currentLat + ' xLon : ' + currentLon);\n}});\n}", "title": "" }, { "docid": "c575c587df4f8a7a106431e75bb5c4d2", "score": "0.68590814", "text": "function center(center)\n\t{\n\t\tcenter.lat=Number(vm.centerLat);\n\t\tcenter.lng=Number(vm.centerLng);\n\t\t$log.debug(center);\n\t\n\t}", "title": "" }, { "docid": "a53e109ffd83c9d86bcab36e754aa669", "score": "0.68446916", "text": "function setCenter() {\r\n that.center = new Array();\r\n that.center.x = board.fromPiecePos(that.xP) + \r\n board.fromPieceDist(that.widthP) / 2;\r\n that.center.y = board.fromPiecePos(that.yP) + \r\n board.fromPieceDist(that.heightP) / 2;\r\n }", "title": "" }, { "docid": "fa6c0e93e52cf5211009e63388e11791", "score": "0.6841591", "text": "function getMapCenter() {\n \n var mapCenterCoords = [30, 0];\n\n return mapCenterCoords;\n \n}", "title": "" }, { "docid": "56dca5723d40087b4daf26855d1c3962", "score": "0.68410766", "text": "function setCenter(map, center) {\n if (center) {\n map.instance.setCenter(new google.maps.LatLng(center.latitude, center.longitude));\n }\n else {\n navigator.geolocation.getCurrentPosition(function (position) {\n var center = position;\n map.instance.setCenter(new google.maps.LatLng(center.coords.latitude, center.coords.longitude));\n });\n }\n}", "title": "" }, { "docid": "a2905422438036c19e11c2a4b7252319", "score": "0.6836699", "text": "function calcCenter(){\r\n\t\tvar i;\r\n\t\tvar latAverage = 0;\r\n\t\tfor(i = 0; i < latArray.length; i++){\r\n\t\t\tlatAverage = latAverage + latArray[i];\r\n\t\t}\r\n\t\tlatAverage = latAverage/latArray.length;\r\n\t\t\r\n\t\tfor(i = 0; i < lonArray.length; i++){\r\n\t\t\tlonAverage = lonAverage + lonArray[i];\r\n\t\t}\r\n\t\t\r\n\t\tlonAverage = lonAverage / lonArray.length;\r\n\t\t\r\n\t\t/*\r\n\t\t\tPrints the location out on the screen\r\n\t\t*/\r\n\t\t\r\n\t\tdocument.getElementById(\"latitudeDiv\").innerHTML = latAverage;\r\n\t\tdocument.getElementById(\"longitudeDiv\").innerHTML = lonAverage;\r\n\t}", "title": "" }, { "docid": "7a9229e35ee3814c90d03ff66e72f0d0", "score": "0.6790749", "text": "function setMapCenter(latitude, longitude){\n map.panTo(new google.maps.LatLng(\n latitude,\n longitude\n ));\n}", "title": "" }, { "docid": "54c13018097ad4cc71208d18b16bb68a", "score": "0.67773634", "text": "function center_map( map ) {\n\t// vars\n\tvar bounds = new google.maps.LatLngBounds();\n\n\t// loop through all markers and create bounds\n\t$.each( map.markers, function( i, marker ){\n\n\t\tvar latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() );\n\n\t\tbounds.extend( latlng );\n\n\t});\n\n\t// only 1 marker?\n\tif( map.markers.length == 1 )\n\t{\n\t\t// set center of map\n\t map.setCenter( bounds.getCenter() );\n\t map.setZoom( 11 );\n\t}\n\telse\n\t{\n\t\t// fit to bounds\n\t\t map.setCenter( bounds.getCenter() );\n\t \tmap.setZoom( 11 ); // Change the zoom value as required\n\t\t//map.fitBounds( bounds ); // This is the default setting which I have uncommented to stop the World Map being repeated\n\n\t}\n\n}", "title": "" }, { "docid": "c9d99d2ef3371221665b12dcd94fceb7", "score": "0.677426", "text": "computeCenter() {\n self.centerX = self.screenX + self.screenDisplacementX;\n self.centerY = self.screenY + self.screenDisplacementY;\n }", "title": "" }, { "docid": "f61a61bab3f166b01c24f81b9d9d83f9", "score": "0.6774148", "text": "function set_center(lat,lon,nama)\n {\n\n //Hapus Info Sebelumnya\n hapusInfo();\n\n //POSISI MAP\n var centerBaru = new google.maps.LatLng(lat, lon);\n map.setCenter(centerBaru);\n\n //JENDELA INFO\n var infowindow = new google.maps.InfoWindow({\n position: centerBaru,\n content: \"<bold style='color:black'>\"+nama+\"</bold>\",\n });\n infoDua.push(infowindow); \n infowindow.open(map); \n }", "title": "" }, { "docid": "25f3ee101e168ab7765fc5a64402d996", "score": "0.6765996", "text": "setCenter() {\n if (this.state.pins.length === 3) {\n var avgLng = 0\n var avgLat = 0\n for (var i = 0; i < 3; i++) { \n avgLat += this.state.pins[i].location[0]\n avgLng += this.state.pins[i].location[1]\n }\n const center = [avgLat / 3, avgLng / 3]\n \n this.setState(prevState=>{\n return{\n ...prevState,\n center: center\n }\n })\n }\n }", "title": "" }, { "docid": "c805ebce57c575c1fba0e14bea93669f", "score": "0.6758633", "text": "function getCenterXY() {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar $this = sets.element;\r\n\t\tvar centerx = ($this.innerWidth()/2)-parseInt($('#inner').css('left'));\r\n\t\tvar centery = ($this.innerHeight()/2)-parseInt($('#inner').css('top'));\r\n\t\treturn new Point(centerx,centery);\r\n\t}", "title": "" }, { "docid": "9781da8f3826430541314efb461dda8b", "score": "0.6752176", "text": "function center_and_update_coords() {\n\tfabric_group.center();\n\tfabric_group.setCoords();\n\tfor (var i in atoms) {\n\t\tatoms[i].update_coords();\n\t}\n\tfor (var i in bonds) {\n\t\tbonds[i].update_coords();\n\t}\n}", "title": "" }, { "docid": "1d07462068a81fff697680bc62fcd35e", "score": "0.67515475", "text": "recenter() {\n this.pan = {\n x: 0,\n y: 0\n };\n this.zoom = 1;\n }", "title": "" }, { "docid": "cdcb433121a87d2637bc3bf03e15b0dc", "score": "0.6750107", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapCarbon.resize();\n roeMapCarbon.reposition();\n }", "title": "" }, { "docid": "90aa5b8c83600784cde2cf0e0f393182", "score": "0.6732499", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapPrecip.resize();\n roeMapPrecip.reposition();\n }", "title": "" }, { "docid": "78bd49fabb1c0ee22f1ef0c4d4e4b1cb", "score": "0.6723162", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapWetN.resize();\n roeMapWetN.reposition();\n }", "title": "" }, { "docid": "8a1451e92451c2c6e5405cc450be5a72", "score": "0.6720465", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapTNit.resize();\n roeMapTNit.reposition();\n }", "title": "" }, { "docid": "c578e68cea71a4dcdc71d814141a750f", "score": "0.6715029", "text": "set Center(value) {}", "title": "" }, { "docid": "23c42ab823315fab349ba0b3b1509dc8", "score": "0.6710544", "text": "function centerMapMobile(){\n \tnavigator.geolocation.getCurrentPosition(GetLocation);\n\t\tfunction GetLocation(location) {\n\t\t cityLat = location.coords.latitude;\n\t\t cityLng = location.coords.longitude;\n\t\t}\n\t\tmobileLocation = new google.maps.LatLng(cityLat, cityLng);\n\t\tmap.setCenter(mobileLocation);\n\t\tcityFromLatLng(mobileLocation);\n }", "title": "" }, { "docid": "b0c514a6815db33b677153d14436059e", "score": "0.6710208", "text": "function center_map(map) {\n\n\t\t// vars\n\t\tvar bounds = new google.maps.LatLngBounds();\n\n\t\t// loop through all markers and create bounds\n\t\t$.each(map.markers, function (i, marker) {\n\n\t\t\tvar latlng = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n\n\t\t\tbounds.extend(latlng);\n\n\t\t});\n\n\t\t// only 1 marker?\n\t\tif (map.markers.length == 1) {\n\t\t\t// set center of map\n\t\t\tmap.setCenter(bounds.getCenter());\n\t\t\tmap.setZoom(12);\n\t\t}\n\t\telse {\n\t\t\t// fit to bounds\n\t\t\tmap.fitBounds(bounds);\n\t\t}\n\n\t}", "title": "" }, { "docid": "ca60d46d688851840fe0b28b6e9b9909", "score": "0.6707725", "text": "resetMapLocation() {\n\t\tthis.map.setCenter({\n\t\t\tlat: locsearch.map_attributes.initial_lat,\n\t\t\tlng: locsearch.map_attributes.initial_lng,\n\t\t});\n\t\tthis.map.setZoom( locsearch.map_attributes.max_zoom );\n\t}", "title": "" }, { "docid": "41fcf5519633b2eb2a884d83322dca75", "score": "0.670628", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapAbsSea.resize();\n roeMapAbsSea.reposition();\n }", "title": "" }, { "docid": "a9f16b5cb03ad9dcb7324e02fbfd2d09", "score": "0.6693419", "text": "function center_map(map) {\n // vars\n var bounds = new google.maps.LatLngBounds();\n // loop through all markers and create bounds\n $.each(map.markers, function (i, marker) {\n var latlng = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n bounds.extend(latlng);\n });\n\n // only 1 marker?\n if (map.markers.length == 1) {\n // set center of map\n map.setCenter(bounds.getCenter());\n map.setZoom(16);\n }\n else {\n // fit to bounds\n map.fitBounds(bounds);\n }\n\n }", "title": "" }, { "docid": "96ed7e0b6209ae37e4ec87972514d219", "score": "0.6687716", "text": "recenterView(zoom) {\n const { sidePanelOpen, siteDetail } = this.props;\n const { siteCenterChange } = this.state;\n\n if (sidePanelOpen && siteDetail && siteCenterChange) {\n const siteLatlng = [siteDetail.geometry.coordinates[1], siteDetail.geometry.coordinates[0]];\n\n this.map.setView(siteLatlng, zoom);\n this.setState({ siteCenterChange: false });\n }\n }", "title": "" }, { "docid": "bacc3cefdee1851328efbed6af76736b", "score": "0.6682162", "text": "function initMap() {\n map = new google.maps.Map( document.getElementById( 'map' ),\n { center: { lat: 41.3326, lng: -72.9475 },\n zoom: origZoom,\n styles: [ { \"featureType\": \"poi\", \"stylers\": [ { \"visibility\": \"off\" } ] } ]\n }\n );\n // origMapCenter = new google.maps.LatLng( 41.3326, -72.9475 );\n origMapCenter = map.getCenter();\n}", "title": "" }, { "docid": "9faf0ae47a3ea9316010b18d4d0e1039", "score": "0.6668991", "text": "function center_map(map) {\r\n\r\n\tgoogle.maps.event.trigger(map, 'resize');\r\n\r\n\t// map.setCenter(map.marker.getPosition());\r\n\r\n\t// vars\r\n\r\n\t// var bounds = new google.maps.LatLngBounds();\r\n\r\n\t// alert(bounds);\r\n\r\n\t// map.setCenter(bounds.getCenter());\r\n\r\n\t// map.setZoom(14);\r\n\r\n\t// map.fitBounds(bounds);\r\n\r\n}", "title": "" }, { "docid": "ac001b3c42765e5087515c29b392686e", "score": "0.6667213", "text": "function center_tile_mapcanvas(ptile)\n{\n var r = map_to_gui_pos(ptile['x'], ptile['y']);\n var gui_x = r['gui_dx'];\n var gui_y = r['gui_dy'];\n \n gui_x -= (mapview['width'] - tileset_tile_width) >> 1 ;\n gui_y -= (mapview['height'] - tileset_tile_height) >> 1;\n \n set_mapview_origin(gui_x, gui_y);\n \n}", "title": "" }, { "docid": "a91cc31ac5686ea5e026c383db04dccb", "score": "0.666688", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapWetS.resize();\n roeMapWetS.reposition();\n }", "title": "" }, { "docid": "47a1b1f67ca8cc926444ca286e717910", "score": "0.6663785", "text": "function center_map( map ) {\n\t // vars\n\t var bounds = new google.maps.LatLngBounds();\n\t // loop through all markers and create bounds\n\t $.each( map.markers, function( i, marker ){\n\t var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() );\n\t bounds.extend( latlng );\n\t });\n\n\t // only 1 marker?\n\t if( map.markers.length == 1 ) {\n\t // set center of map\n\t map.setCenter( bounds.getCenter() );\n\t }\n\t else {\n\t // fit to bounds\n\t map.fitBounds( bounds );\n\t }\n\n\t}", "title": "" }, { "docid": "e5a553f4168c202bc174f35f3abb24b1", "score": "0.6663552", "text": "centerMap(latitute, longitude) {\r\n this.googleMap.panTo({ lat: latitute, lng: longitude });\r\n this.googleMap.setZoom(this.config.googleMaps.selectedMarkerScale);\r\n }", "title": "" }, { "docid": "2b2e52cd3e97b9bd538c06bea385f73d", "score": "0.6658984", "text": "function center_map( map ) {\n\n // vars\n var bounds = new google.maps.LatLngBounds();\n\n // loop through all markers and create bounds\n $.each( map.markers, function( i, marker ){\n\n var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() );\n\n bounds.extend( latlng );\n\n });\n\n // only 1 marker?\n if( map.markers.length == 1 )\n {\n // set center of map\n map.setCenter( bounds.getCenter() );\n map.setZoom( 13 );\n }\n else\n {\n // fit to bounds\n map.fitBounds( bounds );\n }\n\n }", "title": "" }, { "docid": "6e8c647830f76a74a405a9d2d794f662", "score": "0.66585594", "text": "function reCenter(lat, long) {\n\tvar center = new google.maps.LatLng(lat, long);\n\tmap.panTo(center);\n\n\tvar marker = new google.maps.Marker({\n\t\tposition: center,\n\t\tmap: map,\n\t\ttitle: 'This is your Search Center',\n\t\ticon: 'assets/images/markerStart.png',\n \t\tzIndex: 1,\n \t\topacity: .6\n\t});\n}", "title": "" }, { "docid": "3404c1e6d60150bdba3e6f611407ea6c", "score": "0.66519886", "text": "function zoomMuni(mun,coord){\n map.setCenter(coord);\n\t map.setZoom(14);\n\n}", "title": "" }, { "docid": "97a8b16ef58d3dad341f81542f5b5fa8", "score": "0.66407055", "text": "function center_changer() { \n // marker filtering\n filter_result = filter_list()\n region1_filter = filter_result[0]\n version1_filter = filter_result[1]\n // list changing\n yes_chosen =[]\n for (var i = 0; i < Site_search.length; i++){\n if (eval(filter_result[2])) {\n yes_chosen.push(i)\n } \n }\n filtered_list_creator(yes_chosen)\n // map center changing\n multiple_selected = yes_chosen\n if (multiple_selected.length >= 1){\n multiple_selected_lat = []\n multiple_selected_lng = []\n for (var k = 0; k < multiple_selected.length; k++){\n multiple_selected_lat.push(Lat_search[multiple_selected[k]])\n multiple_selected_lng.push(Lng_search[multiple_selected[k]])\n }\n jun.map.flyTo({center : [(Math.max(...multiple_selected_lng)+Math.min(...multiple_selected_lng))/2,(Math.max(...multiple_selected_lat)+Math.min(...multiple_selected_lat))/2],zoom:1.1})\n document.getElementById(\"results_num\").innerText = (multiple_selected.length)\n }\n else {\n document.getElementById(\"results_num\").innerText = 0\n } \n}", "title": "" }, { "docid": "4c27a1d412d1902128d2f3c5cbd62a49", "score": "0.66373104", "text": "function center(d) {\n\n\t\t\t\tvar centroid = path.centroid(d),\n\t\t\t\t\ttranslate = map.projection.translate();\n\n\t\t\t\t// calculates correct coordinates\n\t\t\t\tvar x = translate[0] - centroid[0] + width / 2,\n\t\t\t\t\ty = translate[1] - centroid[1] + height / 2;\n\n\t\t\t\tmap.projection.translate([x, y]);\n\n\t\t\t\tzoom.translate(map.projection.translate());\n\n\t\t\t\tpaths.transition()\n\t\t\t\t\t.duration(1000)\n\t\t\t\t\t.attr('d', path);\n\n\t\t\t\tmarkers.circles.transition()\n\t\t\t\t\t.duration(890)\n\t\t\t\t\t.attr('cx', function(d) { \n\t\t\t\t\t\treturn map.projection([d.longitude ,d.latitude])[0]\n\t\t\t\t\t})\n\t\t\t\t\t.attr('cy', function(d) { \n\t\t\t\t\t\treturn map.projection([d.longitude, d.latitude])[1]\n\t\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "5cb6ac5ddb12b80dbd7cb36cc7fd8b7b", "score": "0.6628015", "text": "function HandleCenter(updateCenter) {\n setNewPosition(updateCenter)\n console.log(center)\n console.log(updateCenter)\n\n }", "title": "" }, { "docid": "eafd8bd1c52147b8521483ed9fe26d1f", "score": "0.66188645", "text": "function updateMap(station, map, markers) {\n\tlet pos = {lat: station.latitude, lng: station.longitude};\n map.setCenter(pos);\n map.setZoom(17);\n\tupdateMarker(markers, map, pos)\n}", "title": "" }, { "docid": "53f12c9f2a93f29ea968c9b7081309af", "score": "0.6617592", "text": "get center ( ) { return this._center; }", "title": "" }, { "docid": "53f12c9f2a93f29ea968c9b7081309af", "score": "0.6617592", "text": "get center ( ) { return this._center; }", "title": "" }, { "docid": "deb04b94085a457a9573c15ced9e929d", "score": "0.6614374", "text": "function setCenter(latlng) {\n var z = Math.pow(2, map.getZoom());\n var pnt = map.getProjection().fromLatLngToPoint(latlng);\n map.setCenter(map.getProjection().fromPointToLatLng(\n new google.maps.Point(pnt.x + 150 / z, pnt.y)));\n}", "title": "" }, { "docid": "fb11108e74e889eff6acc422f62c91f0", "score": "0.6605846", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapSulf.resize();\n roeMapSulf.reposition();\n }", "title": "" }, { "docid": "12fe651d2d0a922816d7c70eabe9f911", "score": "0.66030174", "text": "function setCenter (x, y, zoomLevel) {\n map.zoomTo(zoomLevel || 5);\n map.setCenter(new OpenLayers.LonLat(x || 526619, y || 6254396));\n}", "title": "" }, { "docid": "0991bb85d67c0519bbadeb5cfc470d2a", "score": "0.65958047", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapFAL.resize();\n roeMapFAL.reposition();\n }", "title": "" }, { "docid": "6daae2ad504f6c39abd1176c08d469e5", "score": "0.6586897", "text": "function refreshMapPosition() {\n //alert(\"on Map\");\n roeMapRadon.resize();\n roeMapRadon.reposition();\n }", "title": "" } ]
77a6e2bcc48a4dfced0a9dd8cbf0c03f
Returns an iterator over the SortedMap.
[ { "docid": "83f2def277c2e58828af950c2d711688", "score": "0.7157071", "text": "getIterator(resultGenerator) {\n return new SortedMapIterator(this.root_, null, this.comparator_, false, resultGenerator);\n }", "title": "" } ]
[ { "docid": "c198b859c839e2c033db79837935db96", "score": "0.6259174", "text": "entries() {\n const finalEntries = [];\n const getKeys = (map, keys = []) => {\n map.forEach((value, key) => {\n if (key === this._key) {\n finalEntries.push([keys, value]);\n }\n else {\n const nextKeys = [...keys, key];\n getKeys(value, nextKeys);\n }\n });\n };\n getKeys(this._map);\n return new ShimIterator(finalEntries);\n }", "title": "" }, { "docid": "f1cafb49ecaf465019dac6d452af6a8e", "score": "0.60793173", "text": "* entries () {\n for (var i = 0; i < this._order.length; i++) {\n var key = this._order[i]\n yield [key, this._entries[key]]\n }\n }", "title": "" }, { "docid": "0d76bb5360b03e7d72a275d5837fa0ad", "score": "0.5941169", "text": "entries() {\n return new CollectionIterator(this, ITERATOR_KEYSVALUES);\n }", "title": "" }, { "docid": "0a57fe0f46d6e2b628afcd6f69b5df4f", "score": "0.5920291", "text": "function EntryIterator(__parent, type, fromKey, fromInclusive, toKey, toInclusive) {\n if (type === void 0) { type = java.util.TreeMap.SubMapType_All_$LI$(); }\n if (fromKey === void 0) { fromKey = null; }\n if (fromInclusive === void 0) { fromInclusive = false; }\n if (toKey === void 0) { toKey = null; }\n if (toInclusive === void 0) { toInclusive = false; }\n Object.defineProperty(this, '__interfaces', { configurable: true, value: [\"java.util.Iterator\"] });\n this.__parent = __parent;\n var list = new java.util.ArrayList();\n this.__parent.inOrderAdd(list, type, this.__parent.root, fromKey, fromInclusive, toKey, toInclusive);\n this.iter = list.listIterator();\n }", "title": "" }, { "docid": "640fa1865572f509f34ecfa3943211fc", "score": "0.5908644", "text": "keys() {\n const finalKeys = [];\n const getKeys = (map, keys = []) => {\n map.forEach((value, key) => {\n if (key === this._key) {\n finalKeys.push(keys);\n }\n else {\n const nextKeys = [...keys, key];\n getKeys(value, nextKeys);\n }\n });\n };\n getKeys(this._map);\n return new ShimIterator(finalKeys);\n }", "title": "" }, { "docid": "ec9400087ebae75154f59210cf06d551", "score": "0.58525866", "text": "function getIterator() {\n if (typeof Symbol === 'function' && Symbol.iterator) {\n return Symbol.iterator;\n }\n var keys = Object.getOwnPropertyNames(Map.prototype);\n var proto = Map.prototype;\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (key !== 'entries' && key !== 'size' && proto[key] === proto.entries) {\n return key;\n }\n }\n}", "title": "" }, { "docid": "57874d8e0a1308197aec603691af8079", "score": "0.58464295", "text": "* [Symbol.iterator]() {\n if (undefined === this._first) {\n return;\n }\n\n let e = this._first;\n\n do {\n yield [ e.key, e.value ];\n } while ((e = e.next));\n }", "title": "" }, { "docid": "da317efc37e8a8bc02326118694fdbc1", "score": "0.58359826", "text": "function MapIterator(v) {\n this.v = v;\n}", "title": "" }, { "docid": "1f0f2b69dd80551211fdb3d813bdad4d", "score": "0.569722", "text": "function mapItems (map) {\n for (let key in map) if (map.hasOwnProperty(key)) {\n yield map[key];\n }\n}", "title": "" }, { "docid": "236c1183655bb4ea078f15a9ffe5dbf2", "score": "0.5695914", "text": "*[Symbol.iterator]() {\r\n for (const item of this.entries) {\r\n yield item;\r\n }\r\n }", "title": "" }, { "docid": "f7caba31510033db3381d23b4ef54830", "score": "0.56427133", "text": "[Symbol.iterator]() {\n return this._headersMap.entries();\n }", "title": "" }, { "docid": "614c70bcb34cb9db8e9b7485cd481868", "score": "0.56261545", "text": "function DescendingEntryIterator(__parent, type, fromKey, fromInclusive, toKey, toInclusive) {\n if (type === void 0) { type = java.util.TreeMap.SubMapType_All_$LI$(); }\n if (fromKey === void 0) { fromKey = null; }\n if (fromInclusive === void 0) { fromInclusive = false; }\n if (toKey === void 0) { toKey = null; }\n if (toInclusive === void 0) { toInclusive = false; }\n Object.defineProperty(this, '__interfaces', { configurable: true, value: [\"java.util.Iterator\"] });\n this.__parent = __parent;\n var list = new java.util.ArrayList();\n this.__parent.inOrderAdd(list, type, this.__parent.root, fromKey, fromInclusive, toKey, toInclusive);\n this.iter = list.listIterator(list.size());\n }", "title": "" }, { "docid": "7f7f255f8602200a8573fdbac801f047", "score": "0.5606667", "text": "values() {\n const values = [];\n const getValues = (map) => {\n map.forEach((value, key) => {\n if (key === this._key) {\n values.push(value);\n }\n else {\n getValues(value);\n }\n });\n };\n getValues(this._map);\n return new ShimIterator(values);\n }", "title": "" }, { "docid": "7c5666f5cab9dd434dc355f70c22bb60", "score": "0.55896693", "text": "kvReorderedIterator(){}", "title": "" }, { "docid": "431aee9ab51baa19740ec7d3534a8021", "score": "0.5572139", "text": "* keys () {\n for (var i = 0; i < this._order.length; i++) {\n yield this._order[i]\n }\n }", "title": "" }, { "docid": "fa899eeeffd804b1650926bd705e9a75", "score": "0.5513731", "text": "*[Symbol.iterator]() {\n for (let key of this.keys) yield [key, this.get(key)];\n }", "title": "" }, { "docid": "fdd0ee1d01c92137c2d081f5aee10d3c", "score": "0.5513395", "text": "*entries() {\n yield* this._items.entries();\n }", "title": "" }, { "docid": "74d0935c144201fcab27ae483fe7fd6c", "score": "0.5509928", "text": "* values () {\n for (var i = 0; i < this._order.length; i++) {\n yield this._entries[this._order[i]]\n }\n }", "title": "" }, { "docid": "a9fd8e1fd0bf0247db0cbdbae8d3cb9b", "score": "0.5499094", "text": "keys() {\n return new CollectionIterator(this, ITERATOR_KEYS);\n }", "title": "" }, { "docid": "98dfedb8f78df30e2867f7ac5303f2c4", "score": "0.54597473", "text": "function documentSizeMap() {\r\n return new SortedMap(DocumentKey.comparator);\r\n}", "title": "" }, { "docid": "98dfedb8f78df30e2867f7ac5303f2c4", "score": "0.54597473", "text": "function documentSizeMap() {\r\n return new SortedMap(DocumentKey.comparator);\r\n}", "title": "" }, { "docid": "37520f223c43091e2beca904b8ea3d66", "score": "0.53891534", "text": "*keys() {\n yield* this._items.keys();\n }", "title": "" }, { "docid": "e5383da05b61213239a83e9ec94c795f", "score": "0.53468233", "text": "function shimMap() {\n var MapIterator = /** @class */ (function () {\n function MapIterator(currentEntry, selector) {\n this.currentEntry = currentEntry;\n this.selector = selector;\n }\n MapIterator.prototype.next = function () {\n // Navigate to the next entry.\n while (this.currentEntry) {\n var skipNext = !!this.currentEntry.skipNext;\n this.currentEntry = this.currentEntry.nextEntry;\n if (!skipNext) {\n break;\n }\n }\n if (this.currentEntry) {\n return { value: this.selector(this.currentEntry.key, this.currentEntry.value), done: false };\n }\n else {\n return { value: undefined, done: true };\n }\n };\n return MapIterator;\n }());\n return /** @class */ (function () {\n function class_1() {\n this.data = createDictionaryObject();\n this.size = 0;\n // Create a first (stub) map entry that will not contain a key\n // and value but serves as starting point for iterators.\n this.firstEntry = {};\n // When the map is empty, the last entry is the same as the\n // first one.\n this.lastEntry = this.firstEntry;\n }\n class_1.prototype.get = function (key) {\n var entry = this.data[key];\n return entry && entry.value;\n };\n class_1.prototype.set = function (key, value) {\n if (!this.has(key)) {\n this.size++;\n // Create a new entry that will be appended at the\n // end of the linked list.\n var newEntry = {\n key: key,\n value: value\n };\n this.data[key] = newEntry;\n // Adjust the references.\n var previousLastEntry = this.lastEntry;\n previousLastEntry.nextEntry = newEntry;\n newEntry.previousEntry = previousLastEntry;\n this.lastEntry = newEntry;\n }\n else {\n this.data[key].value = value;\n }\n return this;\n };\n class_1.prototype.has = function (key) {\n // tslint:disable-next-line:no-in-operator\n return key in this.data;\n };\n class_1.prototype.delete = function (key) {\n if (this.has(key)) {\n this.size--;\n var entry = this.data[key];\n delete this.data[key];\n // Adjust the linked list references of the neighbor entries.\n var previousEntry = entry.previousEntry;\n previousEntry.nextEntry = entry.nextEntry;\n if (entry.nextEntry) {\n entry.nextEntry.previousEntry = previousEntry;\n }\n // When the deleted entry was the last one, we need to\n // adjust the lastEntry reference.\n if (this.lastEntry === entry) {\n this.lastEntry = previousEntry;\n }\n // Adjust the forward reference of the deleted entry\n // in case an iterator still references it. This allows us\n // to throw away the entry, but when an active iterator\n // (which points to the current entry) continues, it will\n // navigate to the entry that originally came before the\n // current one and skip it.\n entry.previousEntry = undefined;\n entry.nextEntry = previousEntry;\n entry.skipNext = true;\n return true;\n }\n return false;\n };\n class_1.prototype.clear = function () {\n this.data = createDictionaryObject();\n this.size = 0;\n // Reset the linked list. Note that we must adjust the forward\n // references of the deleted entries to ensure iterators stuck\n // in the middle of the list don't continue with deleted entries,\n // but can continue with new entries added after the clear()\n // operation.\n var firstEntry = this.firstEntry;\n var currentEntry = firstEntry.nextEntry;\n while (currentEntry) {\n var nextEntry = currentEntry.nextEntry;\n currentEntry.previousEntry = undefined;\n currentEntry.nextEntry = firstEntry;\n currentEntry.skipNext = true;\n currentEntry = nextEntry;\n }\n firstEntry.nextEntry = undefined;\n this.lastEntry = firstEntry;\n };\n class_1.prototype.keys = function () {\n return new MapIterator(this.firstEntry, function (key) { return key; });\n };\n class_1.prototype.values = function () {\n return new MapIterator(this.firstEntry, function (_key, value) { return value; });\n };\n class_1.prototype.entries = function () {\n return new MapIterator(this.firstEntry, function (key, value) { return [key, value]; });\n };\n class_1.prototype.forEach = function (action) {\n var iterator = this.entries();\n while (true) {\n var iterResult = iterator.next();\n if (iterResult.done) {\n break;\n }\n var _a = iterResult.value, key = _a[0], value = _a[1];\n action(value, key);\n }\n };\n return class_1;\n }());\n}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "987539d27ddbabcad1a19767ba2f31f7", "score": "0.52476025", "text": "keys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}", "title": "" }, { "docid": "1c591e5a0de0ea86d01ecacebf9d9ef2", "score": "0.5241058", "text": "function shimMap() {\n var MapIterator = (function () {\n function MapIterator(data, selector) {\n this.index = 0;\n this.data = data;\n this.selector = selector;\n this.keys = Object.keys(data);\n }\n MapIterator.prototype.next = function () {\n var index = this.index;\n if (index < this.keys.length) {\n this.index++;\n return { value: this.selector(this.data, this.keys[index]), done: false };\n }\n return { value: undefined, done: true };\n };\n return MapIterator;\n }());\n return (function () {\n function class_1() {\n this.data = createDictionaryObject();\n this.size = 0;\n }\n class_1.prototype.get = function (key) {\n return this.data[key];\n };\n class_1.prototype.set = function (key, value) {\n if (!this.has(key)) {\n this.size++;\n }\n this.data[key] = value;\n return this;\n };\n class_1.prototype.has = function (key) {\n // tslint:disable-next-line:no-in-operator\n return key in this.data;\n };\n class_1.prototype.delete = function (key) {\n if (this.has(key)) {\n this.size--;\n delete this.data[key];\n return true;\n }\n return false;\n };\n class_1.prototype.clear = function () {\n this.data = createDictionaryObject();\n this.size = 0;\n };\n class_1.prototype.keys = function () {\n return new MapIterator(this.data, function (_data, key) { return key; });\n };\n class_1.prototype.values = function () {\n return new MapIterator(this.data, function (data, key) { return data[key]; });\n };\n class_1.prototype.entries = function () {\n return new MapIterator(this.data, function (data, key) { return [key, data[key]]; });\n };\n class_1.prototype.forEach = function (action) {\n for (var key in this.data) {\n action(this.data[key], key);\n }\n };\n return class_1;\n }());\n }", "title": "" }, { "docid": "d2f169b117e4abd55937727d6dca4cc2", "score": "0.5162395", "text": "function entries () {\n return map.entries()\n }", "title": "" }, { "docid": "68070f61ab60e9ada2cef4e9b70685f8", "score": "0.51526064", "text": "getIterator(){return new dn(this.root,null,this.comparator,!1);}", "title": "" }, { "docid": "d9f49a03c88a5fa1693fdd5976c6d5db", "score": "0.5132225", "text": "GetEnumerator() {\n\n }", "title": "" }, { "docid": "d9f49a03c88a5fa1693fdd5976c6d5db", "score": "0.5132225", "text": "GetEnumerator() {\n\n }", "title": "" }, { "docid": "6d368efc147b9eebe0fe826a9e690317", "score": "0.5092296", "text": "sort() {\n const keys = Array.from(this.map.keys()).sort();\n const newArr = [];\n for (const key of keys) {\n newArr.push([key, this.map.get(key)]);\n }\n this.map = new Map(newArr);\n }", "title": "" }, { "docid": "9f9e6ced388d8d75c13e8f5fd0ea6a11", "score": "0.5077426", "text": "function MapIterator(source, fn) {\r\n\t this._source = source;\r\n\t this._fn = fn;\r\n\t }", "title": "" }, { "docid": "d15787384a10dc20d78607b8f9bb3bc8", "score": "0.50601804", "text": "function OrderedMap(content) {\n this.content = content\n}", "title": "" }, { "docid": "2c7e0d9981c7ba51e1d8797f6a29f09d", "score": "0.50571465", "text": "function MapIterator(source, fn) {\n\t this._source = source;\n\t this._fn = fn;\n\t }", "title": "" }, { "docid": "a05cede5bfd97997e68d030fc92d82bc", "score": "0.50543123", "text": "function OrderedMap(content) {\n this.content = content;\n}", "title": "" }, { "docid": "a05cede5bfd97997e68d030fc92d82bc", "score": "0.50543123", "text": "function OrderedMap(content) {\n this.content = content;\n}", "title": "" }, { "docid": "a05cede5bfd97997e68d030fc92d82bc", "score": "0.50543123", "text": "function OrderedMap(content) {\n this.content = content;\n}", "title": "" }, { "docid": "a05cede5bfd97997e68d030fc92d82bc", "score": "0.50543123", "text": "function OrderedMap(content) {\n this.content = content;\n}", "title": "" }, { "docid": "d284c4560da417994752264e0c255231", "score": "0.5043279", "text": "function OrderedMap(content) {\n this.content = content;\n }", "title": "" }, { "docid": "73a6c8654bde9e59ac89bde604b6c997", "score": "0.50183254", "text": "get keys() {\n return this._map.keys();\n }", "title": "" }, { "docid": "3e0641680f375ff64557689d9dcf2a97", "score": "0.50075126", "text": "keys() {\n return createHeadersIterator(this, \"key\");\n }", "title": "" }, { "docid": "349680fdcee06ada44566b1fae0a2a3a", "score": "0.50030434", "text": "function Map() {\n this.keys = OrderedSet.create();\n this.values = {};\n}", "title": "" }, { "docid": "df69079b88882d0b33de05c9a6d906c2", "score": "0.49974188", "text": "function SortedSet() {\n this.items = [];\n this.hash = {};\n this.values = {};\n this.OPEN = 1;\n this.CLOSE = 2;\n }", "title": "" }, { "docid": "7d8846e2f04505c5d43e28d623cbb3d4", "score": "0.49793044", "text": "[Symbol.iterator]() {\n return function* (obj) {\n for (let key of Object.keys(obj)) {\n yield [key, obj[key]];\n }\n }(standardDataElements);\n}", "title": "" }, { "docid": "da34cd9b4f98c0040480a92585a74304", "score": "0.49777392", "text": "iter(){}", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.49669415", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.49669415", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.49669415", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.49669415", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.49669415", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.49669415", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "5ac8407d72e3c0c7d1e4cc9cb7ad4ea2", "score": "0.49669415", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\t\n\t return iterator\n\t }", "title": "" }, { "docid": "7712bb6eae9357ca3db3bdf7549d3694", "score": "0.49625295", "text": "iterate() {\n return this.cache.values()\n }", "title": "" }, { "docid": "f9d3e4e04ac79bea34d9ed0975bc9290", "score": "0.4946156", "text": "function iteratorFor(items) {\r\n var iterator = {\r\n next: function() {\r\n var value = items.shift()\r\n return {done: value === undefined, value: value}\r\n }\r\n }\r\n\r\n if (support.iterable) {\r\n iterator[Symbol.iterator] = function() {\r\n return iterator\r\n }\r\n }\r\n\r\n return iterator\r\n }", "title": "" }, { "docid": "0d616b1e51eb975b065991f50a359061", "score": "0.49417275", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function next() {\n\t var value = items.shift();\n\t return { done: value === undefined, value: value };\n\t }\n\t };\n\t\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function () {\n\t return iterator;\n\t };\n\t }\n\t\n\t return iterator;\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.49388012", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.49388012", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.49388012", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" }, { "docid": "92933c043d312e285a1d5a9b231df9cd", "score": "0.49388012", "text": "function iteratorFor(items) {\n\t var iterator = {\n\t next: function() {\n\t var value = items.shift()\n\t return {done: value === undefined, value: value}\n\t }\n\t }\n\n\t if (support.iterable) {\n\t iterator[Symbol.iterator] = function() {\n\t return iterator\n\t }\n\t }\n\n\t return iterator\n\t }", "title": "" } ]
bf58f268b878180a9f5923c38ebbb39c
console.log('i am the ', feed);
[ { "docid": "3f935ccdee5a87de17ca48a26c00a5a9", "score": "0.0", "text": "function shuffleArray(data) {\n for (let i = data.length - 1; i > 0; i--) {\n const r = Math.floor(Math.random() * (i + 1));\n [data[i], data[r]] = [data[r], data[i]];\n }\n return data;\n }", "title": "" } ]
[ { "docid": "00670657ed65e1aa842afb28869ae57b", "score": "0.62547183", "text": "log() {\n\n /*eslint-disable no-console*/\n console.log(...[colors.green(\"[RSS]\"), ...arguments]);\n /*eslint-enable no-console*/\n\n }", "title": "" }, { "docid": "bdca2587e03937395fd8ca0e5d93ac7c", "score": "0.62333655", "text": "function printForecast(summary,temperature){\n\tconsole.log(\"The forecast summary : \" + summary + \"\\nTemperature : \"+ temperature + \"\");\n}", "title": "" }, { "docid": "72697c1be0522076599a0aa2b9d9d8f7", "score": "0.6201244", "text": "function getFeed() {\n var feed = new Array();\n feed[0] = {category:'bicycle', url:'http://www.11st.co.kr/rss/best.tmall?categoryNo=246025'};\n feed[1] = {category:'fishing_rod', url:'http://www.11st.co.kr/rss/best.tmall?categoryNo=15923'};\n feed[2] = {category:'badminton_tennis', url:'http://www.11st.co.kr/rss/best.tmall?categoryNo=254203'};\n feed[3] = {category:'tent', url:'http://www.11st.co.kr/rss/best.tmall?categoryNo=245150'}\n\n for(var feedCnt=0; feedCnt < feed.length; feedCnt++) {\n getFeedPrint(feed[feedCnt].category, feed[feedCnt].url);\n }\n}", "title": "" }, { "docid": "9e0777e7673f3992895b189416014947", "score": "0.61268294", "text": "function tweet(item)\n {\n \tif(window.console === undefined) \n \t\treturn;\n\n \tconsole.log(item);\n }", "title": "" }, { "docid": "7a5e633d4a925b6a64f8677e426f3d35", "score": "0.60643995", "text": "function PrintRssFeed(rss){\n console.log(rss);\n \n headLine = rss.feed.author;\n if (headLine == null || headLine == \"\") {\n headLine = rss.feed.title;\n }\n $(\".rss-input\").append(\"<h4><strong>\" +headLine+ \"</strong></h4>\");\n\n for (var index = 0; index < rss.items.length; index++) {\n\n var title = rss.items[index].title;\n var publishdate = rss.items[index].pubDate;\n var link = rss.items[index].link;\n\n $(\".rss-input\").append(\"<div class=\"+title+\"><strong><a href=\"+link+\" target='_blank'>\" + title + \"</a></strong></div>\");\n $(\".rss-input\").append(\"<div>\" + publishdate + \"</div>\");\n \n }\n $(\".rss-input\").append(\"<br>\");\n}", "title": "" }, { "docid": "d2e7d693d8487b5ead8ae40da4f132ae", "score": "0.59503496", "text": "function printIt(incoming) {\n console.log(incoming);\n}", "title": "" }, { "docid": "cebd59f41fabef775a08cf52e3ce87a0", "score": "0.5930495", "text": "function getNewsfeed() {\n // TODO\n}", "title": "" }, { "docid": "5fbcba112d6d44d600208d9071dd3f01", "score": "0.5926992", "text": "function printToScreen(data){\n $(\"#feed\").html(data);\n}", "title": "" }, { "docid": "1e70a0aa56c6020a4f4378ccab8fbc01", "score": "0.59210575", "text": "function logPosts(posts) {\n console.log(posts);\n console.log(`posts are ${posts}`)\n}", "title": "" }, { "docid": "5ccb2591d8d8d23e38d7b12b535285a3", "score": "0.59131813", "text": "function knowledge(incoming)\r\n{\r\n console.log(incoming);\r\n}", "title": "" }, { "docid": "0b66a0014f8d7f7fb57689f3a048ee24", "score": "0.58804196", "text": "function whatDoYouKknow(incoming) {\r\n console.log(incoming);\r\n}", "title": "" }, { "docid": "c6c7a1c3c4b446127e97e9a1616e215e", "score": "0.5841996", "text": "function what(incoming){\n console.log(incoming);\n}", "title": "" }, { "docid": "388044ccb5e5be62b3e388d89566845f", "score": "0.57044727", "text": "function display(data) {console.log(data)}", "title": "" }, { "docid": "1c8ce4953387a3180b7abc55474185b4", "score": "0.56554997", "text": "function dumpResults(results) {\n console.log(results);\n}", "title": "" }, { "docid": "aadcdadf34b42480cb58efcef6ce91dc", "score": "0.56348765", "text": "function printPosts() {\n // Used setTimeout to mimic\n setTimeout(() => {\n console.log(posts);\n }, 2000);\n}", "title": "" }, { "docid": "9a134dcc8cff019a793989f12cf4223a", "score": "0.5593392", "text": "function displayPost(topic, text) { console.log(topic + ':', text); }", "title": "" }, { "docid": "7b3920e1a452ad228c225f98d975d71c", "score": "0.55708146", "text": "function print(data) {console.log(data);}", "title": "" }, { "docid": "eb8d1b56377d0d6a81badf562ea677d9", "score": "0.5547673", "text": "function movieThis() {\n var movie = process.argv[3];\n if (!movie) {\n movie = \"mr nobody\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?t=\" + params + \"&y=&plot=short&r=json&tomatoes=true\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject); // Show the text in the terminal\n var movieResults =\n \"------------------------------ begin ------------------------------\" + \"\\r\\n\"\n \"Title: \" + movieObject.Title + \"\\r\\n\" +\n \"Year: \" + movieObject.Year + \"\\r\\n\" +\n \"Imdb Rating: \" + movieObject.imdbRating + \"\\r\\n\" +\n \"Country: \" + movieObject.Country + \"\\r\\n\" +\n \"Language: \" + movieObject.Language + \"\\r\\n\" +\n \"Plot: \" + movieObject.Plot + \"\\r\\n\" +\n \"Actors: \" + movieObject.Actors + \"\\r\\n\" +\n \"Rotten Tomatoes Rating: \" + movieObject.tomatoRating + \"\\r\\n\" +\n \"Rotten Tomatoes URL: \" + movieObject.tomatoURL + \"\\r\\n\" +\n \"------------------------------ fin ------------------------------\" + \"\\r\\n\";\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\" + error);\n return;\n }\n });\n}", "title": "" }, { "docid": "ea72fa1826fb267138059924948d3f7c", "score": "0.55463666", "text": "makeGraph(data) {\n console.log(`graph for ${data.title}`);\n }", "title": "" }, { "docid": "6ede28f16c4b7e9a2be69e2bcf2421b5", "score": "0.5526382", "text": "logBlogs() { // this is a regular function but a shorthand version\n console.log(\"This user wrote the following blogs: \")\n this.blogs.forEach(blog => {\n console.log(blog)\n })\n }", "title": "" }, { "docid": "989666f3f54573e463fa232a1a09c759", "score": "0.5514818", "text": "function myTweets() {\n var params = {screen_name: 'jschneid94'};\n twitter.get('statuses/user_timeline', params, function(error, tweets) {\n if (!error) {\n for (var i = 0; i < 20; i++) {\n // If there are less than 20 tweets, stop the for loop\n if (tweets[i] === undefined) { \n break; \n }\n var post = tweets[i];\n var output = \"\\nTweet: \" \n + post.text \n + \"\\nPosted On: \" \n + post.created_at \n + \"\\n-----------------\";\n console.log(output);\n outputLog(output);\n }\n }\n });\n}", "title": "" }, { "docid": "5d0bb82664f764a6634b3229e36e350b", "score": "0.55128855", "text": "function showResults() {\n console.clear();\n console.log(userdata);\n}", "title": "" }, { "docid": "5d0bb82664f764a6634b3229e36e350b", "score": "0.55128855", "text": "function showResults() {\n console.clear();\n console.log(userdata);\n}", "title": "" }, { "docid": "2230b2d203d48f6ceab9df111b503f06", "score": "0.54940265", "text": "function meditation(data) {\n console.log(data);\n}", "title": "" }, { "docid": "6655fb67150a4353c62647cfc69d8aed", "score": "0.5488799", "text": "_printTexts(instagramText, twitterText) {\n console.log('### Instagram ###');\n console.log(instagramText);\n\n console.log('\\n### Twitter ###');\n console.log(twitterText);\n }", "title": "" }, { "docid": "034875a66e7f823abd3ef07d429a80d2", "score": "0.54851", "text": "function consoleLog() {\n var str = JSON.stringify(post_data);\n console.dir(\"JSON: \" + str);\n}", "title": "" }, { "docid": "47f7df1f6b41576782909bc569cbfe79", "score": "0.5477712", "text": "function log(data) {\n console.log(data);\n}", "title": "" }, { "docid": "2f3ec09851683308be0c5961fe038240", "score": "0.5466637", "text": "constructor (feed) {\n this.movies = [];\n this.queue = [];\n this.feed = feed;\n }", "title": "" }, { "docid": "9ea927b7f4979ca76986072d524560f0", "score": "0.5430537", "text": "function printForecast(weatherArr) {\n for (day of weatherArr) {\n console.log(\"----------------\");\n console.log(\"Date: \" + day.date);\n console.log(\"Weather: \" + day.weatherDes);\n console.log(\"High Temp: \" + day.highTemp + \"\\u00B0F\");\n console.log(\"Low Temp: \" + day.lowTemp + \"\\u00B0F\");\n console.log(\"----------------\");\n }\n}", "title": "" }, { "docid": "a986480a16c19188ab8ec6a096211d40", "score": "0.5417489", "text": "output() {\n console.log(JSON.stringify(this.results));\n }", "title": "" }, { "docid": "fd8ffdc812b07c0ac83cd38a44baf34f", "score": "0.5416448", "text": "function mytweets() {\n var param = {\n screen_name: \"tunammez\",\n count: 20\n };\n client.get(\"statuses/user_timeline\", param, function(error, tweets, response) {\n\n // If the request was successful...\n if (!error && response.statusCode === 200) {\n for (var j = 0; j < tweets.length; j++) {\n var theTweets = (\"Tweet \" + (j + 1) + \":\" + tweets[j].created_at + \" \" + tweets[j].text);\n console.log(\"============================================================\");\n console.log(theTweets);\n\n }\n\n\n }\n if (error) throw error;\n\n });\n\n\n}", "title": "" }, { "docid": "2d3f2b52bd4dd382bf1078074f7cc74e", "score": "0.5406576", "text": "function logFood(food){\n\tconsole.log(food)\n}", "title": "" }, { "docid": "24e99e84b565883c70affc9e090568d5", "score": "0.5386587", "text": "function showFeed (ev) {\n var $panelBody = $('.panel-body');\n $panelBody.html('');\n var feedHTML = \"<feed url='\" + $scope.url + \"' count='\" + $scope.count + \"' summary='\" + $scope.summary + \"'/>\";\n $panelBody.append($compile(feedHTML)($scope));\n }", "title": "" }, { "docid": "91949352848a752b73b858b6f690369d", "score": "0.5386053", "text": "function getFeed(url, first) {\n var encoded_url = encodeURIComponent(url);\n var req_url = sprintf(\"%s/ext/getMessages?url=%s\", baseUrl, encoded_url);\n // return $.ajax({\n // type: \"GET\",\n // url: req_url,\n // dataType: \"json\"\n // }).done(function(parsed) {\n\t // var histories = parsed.result.messages;\n\t // var feed_items = [];\n\t // $.each(histories, function(index, value) {\n\t // feed_items.push(value);\n\t // });\n\t // if (feed_items.length === 0) {\n\t // $(\"#pagefeed\").empty().append(\"No bulletins yet.\");\n\t // } else {\n\t // var feed_coll = new PageFeedCollection(feed_items);\n\t // var feed_view = new PageFeedCollectionView({\n\t // collection: feed_coll\n\t // });\n\t // var c = feed_view.render().el;\n\t // $(\"#pagefeed\").empty().append(c);\n\t // }\n\t // if (first === 0) {\n\t // $(\"#pagefeed\").scrollTop(0);\n\t // }\n // });\n}", "title": "" }, { "docid": "fc36960292c1382b2d588d6770e4f221", "score": "0.5379707", "text": "function pr( stuff ) {\n\tconsole.log( util.inspect( stuff ) );\n}", "title": "" }, { "docid": "090e67727a847dec64cc09b3bf05f36f", "score": "0.53789717", "text": "display(){\n var output='Title: '+this.title+'\\nAuthor: '+this.author+'\\nPrice: '+this.price;\n console.log(output);\n }", "title": "" }, { "docid": "118033a2cfbf2b4c28cca2edf62cf214", "score": "0.53756416", "text": "function printEvent()\n{\n console.log(\"New event\");\n console.log(\"---------------------\");\n console.log(spotify.events.upcoming.cover);\n console.log(spotify.events.upcoming.title);\n console.log(spotify.events.upcoming.artist);\n console.log(spotify.events.upcoming.uri);\n console.log(spotify.events.upcoming.startTime);\n console.log(spotify.events.upcoming.startEvent);\n console.log(spotify.events.upcoming.endTime);\n console.log(spotify.events.upcoming.endEvent);\n console.log(\"---------------------\");\n}", "title": "" }, { "docid": "a72e8f24fecc9c9676d35244697ec8a7", "score": "0.53729314", "text": "function printStream(user, displayCount){\n var $tweetFeed = $('.tweetFeed')\n $tweetFeed.html(''); //Clear feed\n var index, streamPtr, count=0;\n user === 'home' ?\n (index = streams.home.length - 1, streamPtr = streams.home ) :\n (index = (streams.users)[user].length - 1, streamPtr = (streams.users)[user] ); \n while(index >= 0 && count < displayCount){\n var tweet = streamPtr[index];\n var $tweet = $('<div class=\"tweet\"></div>');\n \n $tweet.append('<img class=\"userIcon\" src=\"user_icons/' + tweet.user + '.jpg\">');\n $tweet.append('<span class=\"tweetUsername\">@ ' + tweet.user + '</span>');\n $tweet.append('<span class=\"tweetTimestamp\" data-livestamp=\"'+ tweet.created_at +'\"></span>');\n $tweet.append('<p class=\"tweetMsg\">' + tweet.message + '</p>');\n\n $tweet.appendTo($tweetFeed);\n index -= 1;\n count += 1;\n }\n}", "title": "" }, { "docid": "44ab82c195ff3f4efed25a03e48affc4", "score": "0.53687567", "text": "log(entry) {\n }", "title": "" }, { "docid": "c3317a540ceecc2e401e622cb895861a", "score": "0.5366385", "text": "function tweets(){\n var params = {screen_name: 'LIRI51505595'};\n client.get('statuses/user_timeline', params, function(error, tweets, response) {\n // console.log(response);\n if (!error) {\n\n var tweetLogArr = [`===========================================================================`,\n `===========================================================================`];\n \n if(20 > tweets.length){\n tweetNum = tweets.length\n }\n else{\n tweetNum = 20\n }\n for (l=0; l<tweetNum; l++){\n var tweet = tweets[l].text;\n var dateInitial = tweets[l].user.created_at.slice(0,10);\n var dateFinal = tweets[l].user.created_at.slice(-4);\n var dateCreated = dateInitial + \" \" + dateFinal;\n tweetLogArr.push(`Tweet #${l+1}: ${tweet}`);\n tweetLogArr.push(`Date created: ${dateCreated}`);\n tweetLogArr.push(\"............................................................................\");\n }\n tweetLogArr.push(`===========================================================================`);\n tweetLogArr.push(`===========================================================================`);\n // console.log(tweets);\n tweetLog = tweetLogArr.join('\\n');\n console.log(tweetLog);\n outputLog(tweetLogArr);\n }\n });\n}", "title": "" }, { "docid": "6d11409bde4697ef4145b42d0c87dbfc", "score": "0.5366118", "text": "function filterBlogs(){\n console.log(\"Here it comes\");\n}", "title": "" }, { "docid": "c6fd47a2d22eda0d0bd3a1e644709e93", "score": "0.5365636", "text": "function thisFunction(incoming){\n\t\tconsole.log(incoming);\n\t}", "title": "" }, { "docid": "0fe806b4727456b7e00df501da128d72", "score": "0.53515077", "text": "static get feedData() {\n return fetch(FEED_NGROK)\n .then(response => response.json()) \n .then(json => {\n let feedData = json.answers;\n console.log(feedData);\n return feedData;\n }) \n .catch(caught => console.log(\"Caught error loading feed: \" + caught))\n }", "title": "" }, { "docid": "556e1cc802bacf37fc87321cdd5b5103", "score": "0.5351383", "text": "function input(incoming) {\n console.log(incoming);\n}", "title": "" }, { "docid": "5a83fe34326d758f53326dcf9263f4f2", "score": "0.53435767", "text": "function myTweets(){\n client.get('statuses/user_timeline', 20, function(error, tweets, response) {\n if (!error) {\n for (var i = 0; i < tweets.length; i++){\n console.log(tweets[i].created_at);\n console.log(tweets[i].text);\n console.log(\"-------------\");\n };};})\n}", "title": "" }, { "docid": "cf67421627cae21f61b90e812f5b8034", "score": "0.53420365", "text": "function consoleLogArt() {\n\tconsole.log(\"consoleLogArt()\");\n\tart.forEach((art) => {\n\t\tconsole.log(\"Art:\", art);\n\t});\n}", "title": "" }, { "docid": "a40b8326b56a1919459e108c5ae310be", "score": "0.5337725", "text": "function logResult( result ) {\n console.log( result );\n}", "title": "" }, { "docid": "0218b1d615b77daac2b13cb5e6b29c0e", "score": "0.5324616", "text": "function myDisplayer(some) {\n console.log(some);\n}", "title": "" }, { "docid": "3a0f6801af3f89f3805a7fa5ba99eafc", "score": "0.5323227", "text": "function log(data)\n{\n\tconsole.log(data);\n}", "title": "" }, { "docid": "339576dfd4025876b21649768c74e199", "score": "0.5313099", "text": "display() {\n console.log(`${this.data}`);\n }", "title": "" }, { "docid": "d82d98a6350cf69d30d95ec57ceb6d50", "score": "0.5309302", "text": "function mainFeed() {\n loadUserData();\n fetchReports();\n\n}", "title": "" }, { "docid": "6d5fe14130395e5307fb2ce5758f0a53", "score": "0.53077406", "text": "function renderRSS() {\n console.log('renderRSS')\n /* lets create an rss feed */\n var feed = new rss({\n title: 'Product Hunt RSS',\n description: 'Product Hunt is a curation of the best new products, every day. Discover the latest mobile apps, websites, and technology products that everyone&#39s talking about.',\n feed_url: 'https://phrss.startuplab.io/',\n site_url: 'http://producthunt.com',\n image_url: 'http://assets.producthunt.com/assets/ph-ios-icon-f989a27d98b173973ce47298cb86cc0c.png',\n language: 'en',\n pubDate: moment().utc().format('ddd, DD MMM YYYY HH:mm:ss') + ' GMT',\n ttl: '5'\n })\n\n fs.readFile(__dirname + '/data/posts.json', function (err, json) {\n /* loop over data and add to feed */\n\n var posts = JSON.parse(json)\n\n posts.forEach(function (post) {\n feed.item({\n title: post.name,\n description: post.tagline,\n url: post.redirect_url,\n author: post.user.name,\n date: post.day,\n enclosure: {url: post.screenshot_url['300px']} // enclosure\n })\n })\n\n fs.writeFileSync(__dirname + '/data/rss.xml', feed.xml())\n\n })\n\n}", "title": "" }, { "docid": "d3d62cda97cc15fb72ef5bdcf71aec70", "score": "0.53030705", "text": "function myTweets() {\n var client = new twitter({\n consumer_key: keys.twitterKeys.consumer_key,\n consumer_secret: keys.twitterKeys.consumer_secret,\n access_token_key: keys.twitterKeys.access_token_key,\n access_token_secret: keys.twitterKeys.access_token_secret,\n });\n var twitterUsername = process.argv[3];\n if (!twitterUsername) {\n twitterUsername = \"FCEightFour\";\n }\n params = { screen_name: twitterUsername };\n client.get(\"statuses/user_timeline/\", params, function(error, data, response) {\n if (!error) {\n for (var i = 0; i < data.length; i++) {\n //console.log(response); // Show the full response in the terminal\n var twitterResults =\n \"@\" + data[i].user.screen_name + \": \" +\n data[i].text + \"\\r\\n\" +\n data[i].created_at + \"\\r\\n\" +\n \"------------------------------ \" + i + \" ------------------------------\" + \"\\r\\n\";\n console.log(twitterResults);\n log(twitterResults); // calling log function\n }\n } else {\n console.log(\"Error :\" + error);\n return;\n }\n });\n }", "title": "" }, { "docid": "124dd04b8dd86b3dda7cca6d332784be", "score": "0.5301367", "text": "function log(data) {\n console.log(data);\n prompt();\n}", "title": "" }, { "docid": "4d42975a0f102c94c10980a925535812", "score": "0.53011596", "text": "printAppendages() { \n console.log(\"Legs:\"+this.legs, \"Arms:\"+this.arms, \"Fingers:\"+this.fingers, \"Toes:\"+this.toes);\n }", "title": "" }, { "docid": "16c8dbc31323b58cb2a5871fe9e3d977", "score": "0.5300412", "text": "function collectJIRAFeed() {\n // get the xml feed\n getJIRAFeed(function(url, xmlDoc) {\n \n updateStatus('Activity query: ' + url + '\\n');\n\n // render result\n var result = createHTMLActivityResult(xmlDoc);\n \n var feedResultDiv = document.getElementById('query-result');\n feedResultDiv.innerHTML = result;\n feedResultDiv.hidden = false;\n \n }, function(errorMessage) {\n updateStatus('ERROR. ' + errorMessage);\n });\n}", "title": "" }, { "docid": "405595011ead9334685f832d9ec6f811", "score": "0.5287708", "text": "function results(err, data) {\n if(err) return console.error(err);\n console.log(\"Results of fileread:\");\n console.log(data.toString()); \n}", "title": "" }, { "docid": "013dfd4a25d8504edef502d0a8eff6d3", "score": "0.5284313", "text": "function printIDs(entry) {\n console.log(\"A Nobel in physics awarded to \" + entry.firstname + \" \" + entry.surname + \" with ID of: \" + entry.id);\n}", "title": "" }, { "docid": "78b5ea079568f74d5b258d8cd552ef1f", "score": "0.52802634", "text": "function feedScreen() {\n $('#feed').show();\n}", "title": "" }, { "docid": "109eb1e6c1cc78ffcabd4fae9af37d1e", "score": "0.52676105", "text": "function debug(data) {\n\t\tconsole.log(data);\n\t}", "title": "" }, { "docid": "4ca1777f9e79b8ca6627f229386f6593", "score": "0.5257276", "text": "function printCategory(entry) {\n console.log(entry.category);\n}", "title": "" }, { "docid": "3307cf05705db960ad41cb7a221e65d0", "score": "0.525513", "text": "addFeed(feed) {\n this.add(feed.key, feed.value);\n }", "title": "" }, { "docid": "e7848614288c90c6a738a220c1a408ca", "score": "0.5253849", "text": "function responseFeed(obj) {\n\tmini.createDismissibleMessage(\"responseFeed(obj) started...\");\n //obj.data contains a JavaScript object corresponding to the data that was requested\n\tvar message = \"response = \" + obj.data;\n\tmini.createDismissibleMessage(message);\n}", "title": "" }, { "docid": "5084e3045909b0a9d0432cfbb1541154", "score": "0.5253372", "text": "function displayTweets() {\n //This will show your last 20 tweets and when they were created at in your terminal/bash window.\n\n var params = { user_id: 'Teresa08758622', count: '20' };\n\n client.get('statuses/user_timeline', params, function (error, tweets) {\n if (!error) {\n for (var i = 0; i < tweets.length; i++) {\n console.log(\"Tweet #\" + (i + 1) + \"--\" + tweets[i].created_at + \"--\" + tweets[i].text);\n }\n }\n else {\n if (debug) console.log(\"error\", error);\n //if debug console.log(\"response\", response);\n }\n });\n}", "title": "" }, { "docid": "f4865738a1b37d849e142a1bf7c0f65f", "score": "0.5249444", "text": "function display(data) {\n // 7. the data gets logged to the console\n console.log(data);\n}", "title": "" }, { "docid": "f2b0266355201462b61ecf593ab53980", "score": "0.52411586", "text": "function LOG_DUMP_FEED(feed, idOfDiv) {\n var div = document.getElementById(idOfDiv);\n\n for (var s in LOG_LogManager.DUMPSTYLE) {\n div.style[s] = LOG_LogManager.DUMPSTYLE[s];\n }\n\n // let's create the HTML\n\n LOG_XML_PRINT(feed.xmlDom_);\n\n var inner = \"\";\n\n inner += \"<table id='Feed' summary='Result of the feedquery'><TR>\";\n inner += writeColumn(feed.getPostUri());\n inner += writeColumn(feed.getNextChunkUri());\n inner += writeColumn(feed.getPrevChunkUri());\n\n inner += \"</TR>\" ;\n\n var entries = feed.getEntries();\n\n for (var i = 0; i < entries.length; i+=1) {\n LOG_TRACE(entries[i].toString(), \"All Entries\", null);\n inner += \"<TR>\";\n\n inner += writeColumn(\"Title: \" + entries[i].getTitle());\n inner += writeColumn(\"Author: \" + entries[i].getAuthorName());\n\n var content = entries[i].getContent();\n\n if (content) {\n inner += writeColumn(entries[i].getContent());\n }\n else {\n inner += writeColumn(entries[i].getSummary());\n }\n\n inner += writeColumn(entries[i].getPublished());\n\n inner += writeColumn(entries[i].getId());\n inner += writeColumn(entries[i].getEditUri());\n inner += writeColumn(entries[i].getUpdated());\n\n inner += writeColumn(entries[i].getKind());\n\n inner += writeColumn(entries[i].save());\n inner += \"</TR>\" ;\n\n }\n\n inner += \"</table>\";\n\n div.innerHTML = inner;\n\n\n if (feed.getNextChunkUri() !== null) {\n div.appendChild(DBG_BUTTON(\"NextChunk\", function() { feed = feed.nextChunk(); LOG_DUMP_FEED(feed, idOfDiv); }));\n }\n\n\n if (feed.getPrevChunkUri() !== null) {\n div.appendChild(DBG_BUTTON(\"PrevChunk\", function() { feed = feed.prevChunk(); LOG_DUMP_FEED(feed, idOfDiv); }));\n }\n}", "title": "" }, { "docid": "a28b5e3497b1fe789eda8490a8943c66", "score": "0.52392715", "text": "function print(data) {\n\t\t\tconsole.log(data);\n\t\t\tdocument.getElementById(\"resultat\").innerHTML = \"\";\n\t\t\tfor(var indx = 0; indx < data.query.backlinks.length; indx++) {\n\t\t\t\tdocument.getElementById(\"resultat\").innerHTML += data.query.backlinks[indx].title;\n\t\t\t\tdocument.getElementById(\"resultat\").innerHTML += \"<br><br>\";\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "7e22552ffe37afb3acb09af5b7d7b23f", "score": "0.52369887", "text": "function getRssFeed() {\n var links = [];\n //NEWS\n //links.push(\"https://www.dr.dk/nyheder/service/feeds/udland\");\n //links.push(\"https://www.dr.dk/nyheder/service/feeds/indland\");\n //links.push(\"https://www.dr.dk/nyheder/service/feeds/vejret\");\n\n //HISTORY FACTS\n links.push(\"https://feeds.feedburner.com/historicalevents\");\n links.push(\"https://feeds.feedburner.com/famousdeaths\");\n\n links.forEach(fetchFeed); //fetches every link added\n}", "title": "" }, { "docid": "965d1c8d66401da6c71efccfc3191185", "score": "0.52320564", "text": "function fun(incoming) {\n console.log(incoming)\n}", "title": "" }, { "docid": "1a009761df8129e886e4aed313d216d5", "score": "0.5229678", "text": "log(d){\n\t\tprocess.stdout.write(d)\n\t}", "title": "" }, { "docid": "dbdf531a90bdc64242d93051717102e1", "score": "0.52274185", "text": "log(message) {\n console.log(message);\n }", "title": "" }, { "docid": "2cd0225dd57dff06e0e479fdb60e2606", "score": "0.5221937", "text": "function logPlanets() {\n console.log('Here is the list of planets:');\n console.log(planets);\n}", "title": "" }, { "docid": "eb2a92412dbe53a04fe31d9edabc6c51", "score": "0.52197164", "text": "function log(stuff) {\n\tconsole.log(stuff);\n}", "title": "" }, { "docid": "e8f1c013d10c546235690c5b24d20f2c", "score": "0.521926", "text": "function printf(input) {\r\n console.log(input)\r\n}", "title": "" }, { "docid": "5f1c8d5493b7d4fe0a55a488e5fa8399", "score": "0.521299", "text": "function queryTwitter() {\n\n\tvar query = { user_id: '@jd668899', screen_name: \"john doe\" }\n\n\ttwitter.get('statuses/user_timeline',\n\t\t\t\tquery,\n\t\t\t\tfunction(err, data, response) {\n\t\t\t\t\t\n\t\t\t\t\tif (err) {\n\t \t\t\t\n\t \t\t\t\tconsole.log(err)\n\t \t\t\t\n\t \t\t\t} else {\n\n\t \t\t\t\tfor (var i = 0; i < data.length; i++) {\n\n\t \t\t\t\t\tvar time = \"Created at: \" + data[i].created_at;\n\t \t\t\t\t\tvar text = \"Tweet content: \" + data[i].text;\n\t \t\t\t\t\tvar dataArray = [time, text];\n\n\t \t\t\t\t\tlogToFile(dataArray);\n\n\t \t\t\t\t\tconsole.log(time);\n\t \t\t\t\t\tconsole.log(text); \t\t\t\t\t\n\n\t \t\t\t\t}\n\n\t \t\t\n\t \t\t\t}\n\n\t\t\t\t})\n\t\t\n}", "title": "" }, { "docid": "11cbb9ae8b638753b1da6c2f573ea51d", "score": "0.5211172", "text": "displayData(weatherElement){\n console.log(weatherElement);\n }", "title": "" }, { "docid": "d7ae89beca8cca303c456e0d90e9cd59", "score": "0.52009153", "text": "function log(){return stream.write(util.format.apply(util,arguments)+'\\n');}", "title": "" }, { "docid": "d7ae89beca8cca303c456e0d90e9cd59", "score": "0.52009153", "text": "function log(){return stream.write(util.format.apply(util,arguments)+'\\n');}", "title": "" }, { "docid": "65e00b71d2e4db5532fcf611841009e4", "score": "0.51968205", "text": "function fb_post()\n{\n //alert(\"I am here\");\n var name=\"Current Weather in \"+city + \", \" + state;\n var description=\" \";\n description+=weather_condition1+\", \"+temperature1;\n FB.ui(\n {\n method: 'feed',\n name:name,\n description:description,\n caption:\"WEATHER INFORMATION FROM FORECAST.IO\",\n picture: icon_img,\n link: 'http://forecast.io/',\n }, \n function(response)\n {\n if(response && response.post_id)\n {\n alert(\"Posted Successfully\");\n }\n else \n {\n alert(\"Not Posted\");\n }\n }\n ); \n}", "title": "" }, { "docid": "a7c637582ec49727a833b24674b0b01e", "score": "0.5192315", "text": "function displayTodos(){\n console.log(\"My Todos: \" + todos); \n}", "title": "" }, { "docid": "0cb0036f7ce0f0dab7db33c7bdcc6fcc", "score": "0.5192127", "text": "feed() {\n\n var message = 'unable to feed cat while sleeping'\n\n if(this.isSleeping == false){\n var hunger = this.hunger - 1\n var tiredness = this.tiredness + 1\n message = 'cat feeding!'\n \n if (hunger < 3) {\n this.size = this.size + 1\n }\n \n this.setTiredness(tiredness)\n this.setHunger(hunger)\n this.message = message\n }\n else {\n this.message = message \n }\n\n }", "title": "" }, { "docid": "051a18a34e0a7269965b0d24c57bdfe7", "score": "0.51902485", "text": "function getFeedPrint(category, url) {\n $.ajax({\n type: 'GET',\n url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=1000&callback=?&q=' + encodeURIComponent(url),\n dataType: 'json',\n error: function(){\n alert('Unable to load feed, Incorrect path or invalid feed');\n },\n success: function(data){\n var entries = data.responseData.feed.entries;\n var printCnt = 0;\n for(var loofCnt=0; loofCnt < entries.length && printCnt < 8; loofCnt++) {\n var item = entries[loofCnt];\n var content = '';\n var price = item.author.replace('[11번가] ', '').replace(',', '').replace('원', '');\n if(price >= 100000) {\n content += '<a href=\"#\" class=\"list-group-item\" onclick=\"getFeedEvent(\\'' + encodeURIComponent(item.link) + '\\')\">';\n content += '<h6 class=\"list-group-item-heading\">' + item.author + '</h6>';\n content += '<p class=\"list-group-item-text\">' + item.title + '</p></a>';\n $('#' + category + '_list').append(content);\n printCnt++;\n }\n }\n }\n });\n}", "title": "" }, { "docid": "278384073a6cfd730790ea9cecdbdc7e", "score": "0.5188425", "text": "function showTweets() {\n client.get('statuses/user_timeline', 20, function (error, tweets, response) {\n if (error) {\n throw \"error\"\n }\n tweets.forEach(tweeter => {\n var theTweet = tweeter.text + \" \" + tweeter.created_at\n //log to log.txt file\n fs.appendFile(\"log.txt\",theTweet,function(err){\n console.log(theTweet)\n })\n })\n })\n}", "title": "" }, { "docid": "3ac88aaa9941c8b6f2e301c88384677a", "score": "0.51869667", "text": "function showLog(newLog) {\n var obj = JSON.parse(newLog);\n var para = document.createElement(\"p\");\n\tvar node = document.createTextNode(obj.url + \" \" + obj.number);\n\tpara.appendChild(node);\n\tvar element = document.getElementById(\"content\");\n\telement.appendChild(para);\n}", "title": "" }, { "docid": "ed6b6a780dbd6e4ea53404e722934126", "score": "0.51865155", "text": "function logThat(item) {\n console.log(item)\n}", "title": "" }, { "docid": "f9093bdb58403ceb7376fbbd4b28a6bb", "score": "0.5185336", "text": "function log(input) {\n console.log(input);\n}", "title": "" }, { "docid": "87aa2c3860791d32bf19a7f5b053bac6", "score": "0.5184497", "text": "function showResults() {\n\t\tconsole.clear();\n\t\tconsole.log(userdata);\n\t}", "title": "" }, { "docid": "76baac52d0bd80b7130e946f9ea42d48", "score": "0.51732004", "text": "function logging(stuff)\n{\n// console.log(stuff);\n}", "title": "" }, { "docid": "02b00a56209fb2b8611007a3c9e718ac", "score": "0.51730305", "text": "function Print(result) {\n console.log(result);\n}", "title": "" }, { "docid": "db0665510da4c91b3956b9fed6e062e7", "score": "0.51670915", "text": "print() {\n let runner = this.head;\n let vals = \"\";\n\n while (runner) {\n vals += `${runner.data}${runner.next ? \", \" : \"\"}`;\n runner = runner.next;\n }\n console.log(vals);\n return vals;\n }", "title": "" }, { "docid": "db0665510da4c91b3956b9fed6e062e7", "score": "0.51670915", "text": "print() {\n let runner = this.head;\n let vals = \"\";\n\n while (runner) {\n vals += `${runner.data}${runner.next ? \", \" : \"\"}`;\n runner = runner.next;\n }\n console.log(vals);\n return vals;\n }", "title": "" }, { "docid": "dc84f7e176553687ce09de6a2cd7cb9a", "score": "0.5165642", "text": "function Debug()\n{\n\tconsole.log(...arguments);\n}", "title": "" }, { "docid": "9140d6f1b51bade235f4e7f3592f6786", "score": "0.5163847", "text": "function mainLine() {\n getAndPrintHTMLChunks(function(error, data) {\n if(error) {\n console.error(error);\n } else {\n console.log(data);\n }\n });\n }", "title": "" }, { "docid": "3b9ef534428079051a7c2077e2f48659", "score": "0.5162913", "text": "function spotifyLog(item) {\n // display artists\n var artists = [];\n item.artists.forEach(function (artist) {\n artists.push(artist.name);\n });\n var artistList = artists.join(\", \");\n if (artists.length > 1) {\n console.log(`Artists: ${artistList}\\n`);\n } else {\n console.log(`Artist: ${artistList}\\n`);\n }\n console.log(`Song Name: ${item.name}\\n`);\n console.log(`Preview URL: ${item.preview_url}\\n`);\n console.log(`Album Name: ${item.album.name}\\n`);\n console.log(`======================================\\n\\n`);\n}", "title": "" }, { "docid": "537f50004d42ae04b16116c960e50c46", "score": "0.5158979", "text": "function populateFeed(first) {\n var tab_url = window.g_url;\n getFeed(tab_url, first);\n}", "title": "" }, { "docid": "15f34bf3873790a6dbb763fb47c9b66d", "score": "0.51586074", "text": "function logValues (item) {\r\n console.log(item);\r\n}", "title": "" }, { "docid": "24c34194856195113e28e561ef2c774c", "score": "0.51556885", "text": "function show(data) { \r\n console.log(data);\r\n}", "title": "" }, { "docid": "89142f2dfb58dd0c0c2a9b64c1d3587b", "score": "0.51537716", "text": "function setFeedTitle(title) {\n var titleTag = document.getElementById('title');\n titleTag.textContent = \"Feed for \"+title;\n}", "title": "" }, { "docid": "36e5bcf8bd7c8d7f3c48c6ab18d64197", "score": "0.51516247", "text": "printUrl(){\n console.log(this.url);\n console.log(this.userName);\n console.log(this.pswrd);\n console.log(this.callsImplemented)\n }", "title": "" }, { "docid": "d471fd84d78c296f1f26ef99bf3a6096", "score": "0.5149488", "text": "function printRecords(input)\n{\n console.log(input);\n}", "title": "" }, { "docid": "b6a6113176fd5dc5d8bb8b0f243ddb61", "score": "0.5149031", "text": "testing() {\n console.log(data);\n }", "title": "" } ]
6b9b32e58938f044a0f94c45584e5bab
indicates whether or not all the models are loaded
[ { "docid": "6635870af32a7272d18308024e8a059a", "score": "0.0", "text": "function setup() {\n createCanvas(1695, 824);\n\n //Input for monster Name\n nameIn = createInput();\n nameIn.position(250, 115);\n\n //Loads this file as an image\n nameLoad = createInput();\n nameLoad.position(950, 115)\n\n //Button to Save image & run Classifier\n savImg = createButton('Save Image');\n savImg.position(440, 710);\n savImg.mousePressed(saveimg);\n\n //Button to Load image\n loadMon = createButton('Load Monster')\n loadMon.position(1050, 710)\n loadMon.mousePressed(loadMonster);\n\n //Button that actually classifies the images\n genMon = createButton('Generate Monster Traits');\n genMon.position(850, 710);\n genMon.mousePressed(classifyImg);\n // Button to clear 'Canvas'\n clBut = createButton('Clear');\n clBut.position(380, 710);\n clBut.mousePressed(clearSpace);\n\n //\n background(220);\n // Drawing space\n rect(width / 40, height / 6, 550, 550);\n strokeWeight(2);\n line((width / 2) - 150, 0, (width / 2) - 150, height)\n fill(255)\n\n}", "title": "" } ]
[ { "docid": "9a2c68f4e33b945e3cab7e836b0dd03d", "score": "0.82810247", "text": "function AreModelsLoaded() \n{\n\tfor(var i = 0; i < Models.length; i++)\n\t{\n\t\t// If we find a single model not ready then leave\n\t\tif(!Models[i].Ready)\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "title": "" }, { "docid": "23a1e25069461e1423a4450fa5cb2dc6", "score": "0.7355011", "text": "isComplete () {\n\t\tif (this.getMissingModels().length > 0)\n\t\t\treturn false;\n\t\tif (this.getUnlinkedModels().length > 0)\n\t\t\treturn false;\n\t\treturn true;\n\t}", "title": "" }, { "docid": "3658fea4709f6d53af4376d1b2f7a605", "score": "0.6836694", "text": "function allgridsLoaded() {\n if (isPaymentGridLoaded == true && isCashGridLoaded == true && isInvoiceGridLoaded == true && isGLGridLoaded == true) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "4b54b4ce1eaa6db7f376efdb5c4fbb4e", "score": "0.67851454", "text": "function areAllImagesLoaded(){\n var ret = true;\n for(let i = 0; i < images.length; i++){\n ret = ret && images[i].ready;\n }\n return ret;\n}", "title": "" }, { "docid": "82f5da39ddbef83634124beeb8ebedb8", "score": "0.67287767", "text": "isLoaded() {\n return this._numLoaded === this._resourceCount;\n }", "title": "" }, { "docid": "19c5de769c05cb84378cb5e5065d1155", "score": "0.6714743", "text": "function isReady() {\n\t\tif(this.modelData === null) {\n\t\t\treturn false;\n\t\t\t//console.log(\"model.isReady: this.modelData==null\");\n\t\t}\n\t\tif(!this.initTransformedVertricesDone) {\n\t\t\treturn false;\n\t\t}\n\t\tif(!this.initTransformedNormalsDone) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "db784f3b9b2527224a51bdbeaa4a0606", "score": "0.6712218", "text": "get loaded() {\n return this.length > 0;\n }", "title": "" }, { "docid": "db784f3b9b2527224a51bdbeaa4a0606", "score": "0.6712218", "text": "get loaded() {\n return this.length > 0;\n }", "title": "" }, { "docid": "e41be3ad7ed33e03f0f87569b6e51ef0", "score": "0.669707", "text": "async preLoad() {\n await getModel()\n return true\n }", "title": "" }, { "docid": "78eb660779d155fabfe7152dd0814f9b", "score": "0.6696108", "text": "function isLoaded() {\r\n return loaded;\r\n }", "title": "" }, { "docid": "de2cc8409cbe7440d05c8ad8008fa393", "score": "0.6681291", "text": "get willLoadItems() {\n return latte._isArray(this.loadItems.handlers) && this.loadItems.handlers.length ? true : false;\n }", "title": "" }, { "docid": "43151bcbb54f4cc8f91ddd3d629f5939", "score": "0.6524127", "text": "loadModels() {\n // Load each model in the list\n for (let key of Object.keys(ConfigModels)) {\n // Check if the model is to be loaded\n if (ConfigModels[key].load) {\n this.modelRegister.push(new Model(key, ConfigModels[key]));\n }\n }\n }", "title": "" }, { "docid": "0bc8e506da51510ac114e9a71d8ba3aa", "score": "0.64984363", "text": "function checkFiltersLoaded(){\r\n\tvar loaded = true;\r\n\tfor(var i = 0; i < filtersLoaded.length; i++){\r\n\t\tif(filtersLoaded[i].complete == false){\r\n\t\t\tloaded = false;\r\n\t\t}\r\n\t}\r\n\treturn loaded;\r\n}", "title": "" }, { "docid": "738903cde8919eb0db9f1c096e63af26", "score": "0.64539146", "text": "function modelLoaded() {\n // Check if both models are loaded\n if(style1.ready && style2.ready){\n statusMsg.html('Ready!')\n }\n}", "title": "" }, { "docid": "f39395d2573e9d12fd5f9bb4b69e3428", "score": "0.6446496", "text": "function modelLoaded() {\n // Check if both models are loaded\n if(transferStyle.ready){\n console.log('Ready!')\n }\n}", "title": "" }, { "docid": "f39395d2573e9d12fd5f9bb4b69e3428", "score": "0.6446496", "text": "function modelLoaded() {\n // Check if both models are loaded\n if(transferStyle.ready){\n console.log('Ready!')\n }\n}", "title": "" }, { "docid": "fad1e1d9da5a0950dc3fea6bd56653d9", "score": "0.6430534", "text": "function haveAllPropertiesLoaded(props) {\n var isLoading = props.isLoading;\n \n return isLoading === false || isLoading !== true && (0, _objectValues2['default'])(props).filter(function (value) {\n return value === undefined;\n }).length === 0;\n }", "title": "" }, { "docid": "4b5057f031f116078502de51e6e54796", "score": "0.64204955", "text": "get isLoaded() {\n const { isLoaded, loader } = this._loadable\n return isLoaded && !loader\n }", "title": "" }, { "docid": "3bce2973277b2b3de6104741aea0eb33", "score": "0.64034486", "text": "allSpritesLoaded() {\n return this.spritesLoaded == SPRITE_URLS.length;\n }", "title": "" }, { "docid": "6002e61ca10ab8355e1c099879974eb2", "score": "0.63890576", "text": "isLoading() {\n return !this.initiated;\n }", "title": "" }, { "docid": "9723b73dd106f7c1d0a00caf1f7996ec", "score": "0.63833", "text": "function modelLoaded() {\n // Check if both models are loaded\n if(style1.ready){\n statusMsg.html('Ready!')\n }\n}", "title": "" }, { "docid": "8a3eef60ea611c9e61304f34f836eeb4", "score": "0.63312274", "text": "@api\n get loaded() {\n return this.permissionSets !== undefined;\n }", "title": "" }, { "docid": "7f047eb208c2c4cea55d8a15c840790d", "score": "0.6309224", "text": "get isLoaded() {\n const res = this.record && this.objectInfo && this.possibleSteps;\n if (res && !this._currentScenario) {\n // when fully loaded initialize the action\n this._setCurrentScenario();\n }\n return res;\n }", "title": "" }, { "docid": "ea835c0ebe8604b2f438c5cc26da8c42", "score": "0.628565", "text": "checkLoaded() {\n return (this.loaded == this.numImages);\n }", "title": "" }, { "docid": "0b7f561fa95e696760097349532bbc13", "score": "0.626752", "text": "fetchingTrainings() {\n return this.get('trainings.fetching') > 0;\n }", "title": "" }, { "docid": "fa15e237eac4f975c2150ac3825f0cd5", "score": "0.6244837", "text": "function isLoaded()/*:Boolean*/ {\n return true;\n }", "title": "" }, { "docid": "07e12694739a6f632370910583859119", "score": "0.6242909", "text": "function forceLoadAll() {\n\n checkLazyElements(true);\n\n }", "title": "" }, { "docid": "d4e79ce7524c02352663c15cd0c77f29", "score": "0.6240045", "text": "get isLoading() {\n return !!this._loadable.loader\n }", "title": "" }, { "docid": "9d86acd2883142492981ea83a19e5c59", "score": "0.6217384", "text": "get hasItems() {\n return this.items.length > 0 || (latte._isArray(this.loadItems.handlers) && this.loadItems.handlers.length > 0);\n }", "title": "" }, { "docid": "0ed08cb026cff8f217beed055d740e42", "score": "0.61843765", "text": "isLoaded() {\n return this.state.isComplete();\n }", "title": "" }, { "docid": "c519a7c39b412fc21ab459763685f9c7", "score": "0.61743593", "text": "isLoaded() {\n return this.data !== null;\n }", "title": "" }, { "docid": "47dbe9cc1007b035f3cd21ff1623e141", "score": "0.61624193", "text": "get hasItems() {\n return this.items.count > 0 || this.willLoadItems;\n }", "title": "" }, { "docid": "737754aca880315991460cc0c98c3b80", "score": "0.6136421", "text": "function isAllDataIsReady() {\n\n if (appData.lists.length && appData.members.length) {\n return true;\n }\n else {\n return false\n }\n}", "title": "" }, { "docid": "9cc6ee543e60276edffbd972b821e489", "score": "0.6097276", "text": "function modelLoaded() {\n console.log('model loaded!');\n}", "title": "" }, { "docid": "1356e7832358ced0fcf50a165f87bc0f", "score": "0.60870665", "text": "function checkIfloaded() {\n var imagesLoaded = 0;\n var numImages = 0;\n\n for (var image in images) {\n numImages++;\n }\n\n for (var image in images) {\n if (images[image].didload) {\n\n imagesLoaded++;\n }\n }\n if (imagesLoaded >= numImages) {\n\n clearInterval(imageloadObserver);\n setParameters();\n }\n}", "title": "" }, { "docid": "1b52db7fd3c703e6f3461e53b98153e6", "score": "0.6074583", "text": "IsReady()\n {\n return (this.resourcesCount === this.resourcesLoaded);\n }", "title": "" }, { "docid": "011ca09e70d93a6e5ef33963f1a5d256", "score": "0.6072668", "text": "get loaded() {\n debug(\"getter for loaded called\\n\");\n // We're never fully loaded\n return false;\n }", "title": "" }, { "docid": "3c241268a2b5957eb169dec8e2a48ba8", "score": "0.60541105", "text": "function startLoad(){\n if($scope.loadState.locations != false){\n loadDevices();\n loadGenericInitial();\n }\n }", "title": "" }, { "docid": "6a45ebefc1060b904e18d23c121b1598", "score": "0.6049938", "text": "function shouldFetchBaseCollections() {\n return Bkg.projects.length + Bkg.users.length + Bkg.task_lists.length > 0;\n }", "title": "" }, { "docid": "b57c8a7183310eb0eda1558abe0fd64e", "score": "0.6026523", "text": "function checkAllItemsStartedPreloading(){\n\n\t\tif(g_temp.isAllItemsPreloaded == true)\n\t\t\treturn(false);\n\n\t\t//if some of the items not started, exit function:\n\t\tfor(var index in g_arrItems){\n\t\t\tif(g_arrItems[index].isBigImageLoadStarted == false)\n\t\t\t\treturn(false);\n\t\t}\n\n\t\t//if all started, set flag to true\n\t\tg_temp.isAllItemsPreloaded = true;\n\t}", "title": "" }, { "docid": "42801a9f4563675a16cbe0c075f267a1", "score": "0.60135263", "text": "function isDataLoaded() {\n return _ouiMap !== null;\n }", "title": "" }, { "docid": "d64a5ea2463a16a0c160b353dbcc5a29", "score": "0.6010543", "text": "function modelLoaded() {\n console.log(\"Model Loaded!\");\n }", "title": "" }, { "docid": "18cee57b090d5d90756ca5678ba1ab60", "score": "0.60010874", "text": "function modelLoaded() {\n console.log('Model Loaded!');\n }", "title": "" }, { "docid": "18cee57b090d5d90756ca5678ba1ab60", "score": "0.60010874", "text": "function modelLoaded() {\n console.log('Model Loaded!');\n }", "title": "" }, { "docid": "2d640db649e33261ead7359ae74bffca", "score": "0.6000082", "text": "function modelLoaded() {\r\n console.log(\"Model Loaded\");\r\n}", "title": "" }, { "docid": "359dc72ad29975c4e74b9c3f6a25119b", "score": "0.59908473", "text": "function checkIfloaded() {\n let imagesLoaded = 0;\n let numImages = 0;\n\n for (var image in images) {\n numImages++;\n }\n\n for (var image in images) {\n if (images[image].didload) {\n\n imagesLoaded++;\n }\n }\n if (imagesLoaded >= numImages) {\n\n clearInterval(imageloadObserver);\n setParameters();\n\n }\n}", "title": "" }, { "docid": "e13eae875c69e9fd2769f3079636d594", "score": "0.5990191", "text": "isLoadPerformed() {\n const { type, state } = this.props;\n const { isLoadPerformed = false } = state[type];\n\n return isLoadPerformed;\n }", "title": "" }, { "docid": "40045c8693373d07a2af8abffeed5028", "score": "0.5965531", "text": "function hasFinishedLoading(){\n \n if($scope.loadState.dataGenerics >= $scope.genericLoad.length && \n $scope.loadState.dataDevices >= $scope.devices.length){\n\n $scope.monitorizeData = angular.copy($scope.monitorize);\n //startListening();\n }\n }", "title": "" }, { "docid": "2c0b4de1d9e6bc3e4c2b7cd26b079f05", "score": "0.5962163", "text": "loadCheck() {\n this.loadCounter++;\n if (this.loadCounter === 2) {\n this.loadBool = true;\n }\n }", "title": "" }, { "docid": "00d67cf65c0997b9462008a7903cb2b3", "score": "0.5959711", "text": "function isLoading(state) {\n return size(state.graph.entity) === 0\n}", "title": "" }, { "docid": "bec364f4b5c22c1c4e69d9a8ff04e102", "score": "0.59526306", "text": "function jsAllLoaded() {\n var ans = true;\n for (var i=0; i<jsDependsOnList.length; i++){\n\tif(jsDependsOnList[i].readyState && (!(jsDependsOnList[i].readyState === 'interactive' && !!document.getElementsByTagName('body')[0])) && jsDependsOnList[i].readyState != 'loaded' && jsDependsOnList[i].readyState != 'complete'){ans=false;}\n }\n return ans;\n}", "title": "" }, { "docid": "d369c81f7aa990b071ec1773ddd85ba0", "score": "0.5945576", "text": "function modelLoaded() {\n console.log('Model Loaded!');\n}", "title": "" }, { "docid": "d369c81f7aa990b071ec1773ddd85ba0", "score": "0.5945576", "text": "function modelLoaded() {\n console.log('Model Loaded!');\n}", "title": "" }, { "docid": "d369c81f7aa990b071ec1773ddd85ba0", "score": "0.5945576", "text": "function modelLoaded() {\n console.log('Model Loaded!');\n}", "title": "" }, { "docid": "ecf00d0f3a10717066b4c8cce54d6518", "score": "0.5944042", "text": "checkIfLoaded() {\n // console.log('WorkContainer::checkIfLoaded', this.state);\n return (this.state && this.state.loaded) || false;\n }", "title": "" }, { "docid": "6de5c8746f432c0121e7085e1ff564f6", "score": "0.59401137", "text": "function onBeforeEnter() {\n if (!U.areSiblingViews(noLoadingStates)) {\n SampleListModel.loading = true;\n }\n }", "title": "" }, { "docid": "55c706b3f460cb392eb19f388e9e6d02", "score": "0.5913949", "text": "isLoaded(){\n return this._isLoaded;\n }", "title": "" }, { "docid": "6d114a28b5461ae05aa2017583089327", "score": "0.59069043", "text": "willLoad() {\n this._hasLoaded = true;\n void 0;\n }", "title": "" }, { "docid": "46678f24a3c6a4ca956882111803423c", "score": "0.59047765", "text": "notLoaded(){\n return this.load_state !== LOADING_STATES.loaded;\n }", "title": "" }, { "docid": "8ad29566820b19b1be234da0c7d021aa", "score": "0.5892023", "text": "function modelReady() {\n console.log('Model is ready!!!');\n // classifier.load('model.json', customModelReady);\n}", "title": "" }, { "docid": "4b59c50d134120ec553480537e0907bc", "score": "0.58839196", "text": "function _loadRequired() {\n if(!reqAnnotationArray || !reqAnnotationArray.length) {\n _reqLoad.resolve();\n return;\n }\n \n var count = 0;\n reqAnnotationArray.forEach(function(id) {\n Annotation.get({identifier: id, client: \"popcorn\"}, function(){\n _initAnnotation.apply(this, arguments);\n if(++count >= reqAnnotationArray.length) {\n _reqLoad.resolve();\n }\n });\n });\n }", "title": "" }, { "docid": "7a323dd58e2d1ef2c451734d1aeaf933", "score": "0.5879918", "text": "function modelLoaded() {\r\n console.log('Model Loaded.');\r\n}", "title": "" }, { "docid": "d2f94a96bc9d83f98ff181e3d3211b6e", "score": "0.5878312", "text": "isLoaded() {\n return !!this.data;\n }", "title": "" }, { "docid": "7ca349826061e78c1365ab47fbb96819", "score": "0.58711874", "text": "isLoading(object) {\n if( !this.store ) {\n return console.warn('Checking LOADED state but no store set for service');\n }\n \n if( object && object.state === this.store.STATE.LOADING ) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "b078df3ffa5f40d599167a10f8615ce9", "score": "0.5863417", "text": "function allLoaded(){\n var results = [];\n $('iframe').each(function(){\n if(!$(this).data('loaded')){results.push(false)}\n });\n var result = (results.length > 0) ? false : true;\n return result;\n}", "title": "" }, { "docid": "dc81c92bf4605cf89dbd48874bf430ad", "score": "0.5841734", "text": "hasModel (modelName) {\n\t\treturn Boolean(this.models[modelName]);\n\t}", "title": "" }, { "docid": "044c2a859fcf587edebcaf94b57cacd2", "score": "0.5833915", "text": "function modelLoaded() {\n status.html('Model loaded successfully.');\n detect();\n}", "title": "" }, { "docid": "f1a7842723ac94b76e5489a33e811579", "score": "0.5832", "text": "function loadModels(models, callback) {\n // first remove existing model\n removeModel();\n\n var count = 0;\n\n var loaded_handler = function() {\n // all loaded\n if (++count == models.length) {\n\n // reset scene\n resetScene();\n\n if (callback) callback();\n }\n };\n\n // load each model\n $.each(models, function(index, model) {\n loadModel(model.model_url, model.traj_url, loaded_handler)\n });\n}", "title": "" }, { "docid": "f1a7842723ac94b76e5489a33e811579", "score": "0.5832", "text": "function loadModels(models, callback) {\n // first remove existing model\n removeModel();\n\n var count = 0;\n\n var loaded_handler = function() {\n // all loaded\n if (++count == models.length) {\n\n // reset scene\n resetScene();\n\n if (callback) callback();\n }\n };\n\n // load each model\n $.each(models, function(index, model) {\n loadModel(model.model_url, model.traj_url, loaded_handler)\n });\n}", "title": "" }, { "docid": "048cd0dd84a85e2c0fabd31f3b05cdf8", "score": "0.582755", "text": "get loaded() {\n return Array.from(this._buffers).every(([_, buffer])=>buffer.loaded\n );\n }", "title": "" }, { "docid": "af2a1c3a047ef3277cdc11a32a4e0f5a", "score": "0.58211714", "text": "function isLoaded(uri) {\n return loadedDataSets[uri] !== undefined;\n }", "title": "" }, { "docid": "8f1b04e5503610265ac44095dc8fd504", "score": "0.5819962", "text": "get loaded() {\n return Array.from(this._buffers).every(([_, buffer]) => buffer.loaded);\n }", "title": "" }, { "docid": "4476b644ced54f2681ab97dad562683a", "score": "0.58190703", "text": "function modelloaded(){\r\n console.log('Post net is intialized');\r\n}", "title": "" }, { "docid": "dc4326251e2bfa71da8d305b863ce721", "score": "0.58168125", "text": "function loadModels(models, callback) {\n // first remove existing model\n removeModel();\n\n var count = 0;\n\n var loaded_handler = function() {\n // all loaded\n if (++count == models.length) {\n\n // reset scene\n resetScene();\n\n if (callback) callback();\n }\n };\n\n // load each model\n $.each(models, function(index, model) {\n loadModel(model.model_url, model.traj_url, loaded_handler)\n });\n}", "title": "" }, { "docid": "8ebbb472e7f93a4b1b3765c544ce9624", "score": "0.58003175", "text": "function checkDataLoaded() {\n if (filmsLoaded && planetsLoaded && charactersLoaded && starshipsLoaded && vehiclesLoaded) {\n connectData();\n onDataReadyCallback(filmsList, planetsList, charactersList, starshipsList, vehiclesList);\n }\n }", "title": "" }, { "docid": "37d32ab220c5c9650f2c792db907c1ec", "score": "0.5777332", "text": "async checkStoredModelStatus() {\n const modelsInfo = await tf.io.listModels();\n return modelsInfo[this.modelSavePath_];\n }", "title": "" }, { "docid": "17baf128a4eed1bb2fe6783b1b64f46c", "score": "0.5767976", "text": "loadAll() {\n // Loads all found enabled extensions\n for (let ext of this.all) if (this.enabled.includes(ext.id)) this.load(ext);\n }", "title": "" }, { "docid": "548e54edd34da258c2cd61116db3ebc0", "score": "0.57614416", "text": "function loadModels()\n {\n fs.readdir(\n modelPath,\n function (err, files)\n {\n if(!err)\n for(var i in files)\n loadModel(files[i]);\n });\n }", "title": "" }, { "docid": "2b953f3a1e0a66552c0a1aaa1f6368db", "score": "0.5757942", "text": "get isMetadataLoaded() {\n return this._available;\n }", "title": "" }, { "docid": "7a4f55ef03dd00bd2a369b31c17741f7", "score": "0.5753532", "text": "function loadModels(modelNames, callback){\n\tGui.loadingSpinner.show();\n\n\tif(modelNames.length == 0){\n\t\tGui.loadingSpinner.hide();\n\n\t\tif(typeof(callback) === 'function')\n\t\t\tcallback();\n\t\treturn;\n\t}\n\n\tfunction load(name, xml){\n\t\tvar loader = new ActorModelLoader();\n\t\tloader.addEventListener(ActorModelLoader.doneLoading, function(res){\n\t\t\tloadedModels[res.scene.name] = new ModelWrapper(res.scene);\n\t\t\tloader = null;\n\n\t\t\tif(--queue === 0){\n\t\t\t\tGui.loadingSpinner.hide();\n\n\t\t\t\tif(typeof(callback) === 'function')\n\t\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t\tloader.loadActorXml(name, xml);\n\t}\n\n\tvar queue = modelNames.length;\n\tfor(var i in modelNames){\n\t\tif(!modelNames.hasOwnProperty(i)) continue;\n\t\tload(modelNames[i], Main.actorsDefinition[modelNames[i]]);\n\t};\n}", "title": "" }, { "docid": "0b34e54f815987ec5170783ea7293425", "score": "0.57519317", "text": "function flagOnLoad() {\n objectData(this)['loaded'] = true; // not quite the same as complete - failed is still complete\n //CGD.DEBUG.p(['complete' in this, this.complete, this.src]);\n \n // Dashboard bug... again.\n if (!('complete' in this)) {\n this.complete = true;\n }\n }", "title": "" }, { "docid": "1a064be1e842635dbea49387d83271a4", "score": "0.5751137", "text": "function hasTrackerListLoaded() {\n return !!_trackers[\"default\"].trackerList;\n}", "title": "" }, { "docid": "de6b11c7b52eed7efe3cf80aa56565c8", "score": "0.57490444", "text": "function modelReady() {\n console.log(\"Model is ready!!!\");\n classifier.load(\"model.json\", customModelReady);\n}", "title": "" }, { "docid": "adc83022d10827bfaaf7ff65db711174", "score": "0.5717031", "text": "async function exists() { return (await load()) !== null; }", "title": "" }, { "docid": "9c1cff574af308c856ef9704453e5159", "score": "0.57045984", "text": "loadingData (state) {\n return state.pendingHttpRequests > 0\n }", "title": "" }, { "docid": "60d4bfe05e4d593d7f5cee86f4b4ba4c", "score": "0.56874526", "text": "function loadedCheck() {\n if (numberOfLoaded === 0) {\n // If non of the picture has already loaded.\n numberOfLoaded++;\n } else {\n // If one of the picture has already loaded,\n // render them\n __webpack_require__(/*! ./loading */ \"./src/view/loading.js\").loading.end(function () {\n // Stop loading\n document.getElementById(\"zcapt-frame\").appendChild(fragment);\n callback(null);\n });\n }\n }", "title": "" }, { "docid": "17906944e258a882cdbfab0b990e371c", "score": "0.56843925", "text": "isLoading() {\n\t\tconst loading = 0;\n\t\tthis.loadedSounds = 0;\n\t\tthis.loadingSounds = 0;\n\t\tconst stillLoading = new Array();\n\t\tfor (let i = 0; i < this.sounds.length; i++) {\n\t\t\tif (typeof this.sounds[i] !== 'undefined') {\n\t\t\t\tif (this.sounds[i].loaded === false) {\n\t\t\t\t\tthis.loadingSounds++;\n\t\t\t\t} else {\n\t\t\t\t\tthis.loadedSounds++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.loadedSounds / this.sounds.length;\n\t}", "title": "" }, { "docid": "966d356d3de67f633d4c40d59e753f29", "score": "0.5683652", "text": "isLoaded(object) {\n if( !this.store ) {\n return console.warn('Checking LOADED state but no store set for service');\n }\n\n if( object && object.state === this.store.STATE.LOADED ) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "503794da7ec43bdfe7679a8c9e7a36b2", "score": "0.5681865", "text": "function modelReady() {\r\n console.log('Model Loaded');\r\n}", "title": "" }, { "docid": "503794da7ec43bdfe7679a8c9e7a36b2", "score": "0.5681865", "text": "function modelReady() {\r\n console.log('Model Loaded');\r\n}", "title": "" }, { "docid": "256df8c6976dee3d23c7695182e5d739", "score": "0.56734157", "text": "function verifyAllResourcesLoaded () {\n if ( resources.some(notLoaded) ) {\n setTimeout(verifyAllResourcesLoaded, 0);\n } else {\n killTick();\n frameRequestId = window.requestAnimationFrame(tick);\n }\n }", "title": "" }, { "docid": "7fb0ecfaf2c53d5a1d425b1dddcc63b7", "score": "0.5649122", "text": "isAjaxLoading() {\n return this.ajaxLoading.some((state) => state === true);\n }", "title": "" }, { "docid": "cfe7d4a0af7909e29f26992d045924f2", "score": "0.5643916", "text": "function Ready() {\n var ready = true;\n for(var k in MyresourceCache) {\n \n //Check for property\n\n if(MyresourceCache.hasOwnProperty(k) &&\n !MyresourceCache[k]) { ready = false;\n }\n }\n return ready;\n }", "title": "" }, { "docid": "a58f183d06755ccdcd513134dc84aff9", "score": "0.5639823", "text": "canLoad(value) {\n\t if (!this.settings.load) return false;\n\t if (this.loadedSearches.hasOwnProperty(value)) return false;\n\t return true;\n\t }", "title": "" }, { "docid": "cb2f47d98527fb736e90ef2ad44c5be7", "score": "0.56380326", "text": "get isDeferredLoad() {\n return this.i.isDeferredLoad;\n }", "title": "" }, { "docid": "64c2dc8440be2ef6f422c6b67fa94062", "score": "0.56371427", "text": "shouldReload() {\n return this.routingConfig.getLoadStrategy() !== \"once\" /* ONCE */;\n }", "title": "" }, { "docid": "74e9d5175f0690bab494603ec458a892", "score": "0.56277573", "text": "function checkDataIsLoaded() {\n if (Adapt.contentObjects.models.length > 0\n && Adapt.articles.models.length > 0\n && Adapt.blocks.models.length > 0\n && Adapt.components.models.length > 0\n && Adapt.course.get('_id')) {\n\n mapAdaptIdsToObjects();\n\n if (typeof Adapt.course.get('_buttons').submit !== 'undefined') {\n // Backwards compatibility with v1.x\n var oldButtons = Adapt.course.get('_buttons');\n var buttons = [];\n\n for (var key in oldButtons) {\n buttons['_' + key] = {\n buttonText: oldButtons[key],\n ariaLabel: oldButtons[key]\n };\n }\n\n // HACK - Append other missing values\n buttons['_showFeedback'] = {\n buttonText: 'Show feedback',\n ariaLabel: 'Show feedback'\n };\n\n // Replace the existing property\n Adapt.course.set('_buttons', buttons);\n }\n\n // Triggered to setup model connections in AdaptModel.js\n try {\n Adapt.trigger('app:dataLoaded');\n } catch(e) {\n outputError(e);\n }\n // Sets up collection mapping\n Adapt.setupMapping();\n // Triggers once all the data is ready\n try {\n Adapt.trigger('app:dataReady');\n } catch(e) {\n outputError(e);\n }\n // Setups a new navigation view\n // This should be triggered after 'app:dataReady' as plugins might want\n // to manipulate the navigation\n new NavigationView();\n // Called once Adapt is ready to begin\n Adapt.initialize();\n // Remove event listeners\n Adapt.off('adaptCollection:dataLoaded courseModel:dataLoaded');\n\n }\n }", "title": "" }, { "docid": "c1bc557e2206a7262ac1d3caa1906595", "score": "0.5625055", "text": "isDataLoaded() {\n return of(true);\n }", "title": "" }, { "docid": "b16abda48163b39b63bb9a502311f1ba", "score": "0.56240666", "text": "isLoaded() {\n return this.state.images ? true : false;\n }", "title": "" }, { "docid": "ab6f00148db4f4ab80fae1636f990640", "score": "0.5615659", "text": "function loadModels () {\n loader('models').forEach((model) => {\n db[model.name] = Promise.promisifyAll(model.File);\n });\n}", "title": "" }, { "docid": "0bb673bfe926d3a6b4888f4bb6c842da", "score": "0.5609823", "text": "get isUnloaded() {\n return !this.isLoading && !this._loadable.isLoaded\n }", "title": "" } ]
a7abea96be170803f3cd220fd3258899
=================================================== rotate ===================================================== /=================================================== rotate =====================================================
[ { "docid": "3fa4d9c417c02f0f30b6ae7430831c47", "score": "0.0", "text": "function rotate_relative_to_source ( rotation, position, source, axisAway, axisForward, lerpDelta, updateRigidBody ) {\n\t\t\n\t\tvar ca = shared.cardinalAxes,\n\t\t\taxisAwayNew = utilVec31RotateToSrc,\n\t\t\taxisAwayToAwayNewDist,\n\t\t\tangleToNew,\n\t\t\taxisToNew = utilVec32RotateToSrc,\n\t\t\trotationTarget = utilQ1RotateToSrc,\n\t\t\trotationTargetForMatrix = utilQ2RotateToSrc,\n\t\t\tqToNew = utilQ3RotateToSrc,\n\t\t\taxes;\n\t\t\n\t\t// if source is 3D object, cascade\n\t\tif ( source instanceof THREE.Object3D ) {\n\t\t\t\n\t\t\tsource = source.position;\n\t\t\n\t\t}\n\t\t\n\t\t// default to universe gravity source\n\t\t\n\t\tif ( source instanceof THREE.Vector3 !== true ) {\n\t\t\t\n\t\t\tsource = shared.universeGravitySource;\n\t\t\t\n\t\t}\n\t\t\n\t\tlerpDelta = main.is_number( lerpDelta ) ? lerpDelta : 1;\n\t\t\n\t\taxisAwayNew.sub( position, source ).normalize();\n\t\t\n\t\t// quaternion between axes\n\t\t\n\t\tqToNew = _VectorHelper.q_to_axis( axisAway, axisAwayNew, axisForward );\n\t\t\n\t\tif ( qToNew instanceof THREE.Quaternion ) {\n\t\t\t\n\t\t\t// apply as quaternion or matrix\n\t\t\t\n\t\t\tif ( rotation instanceof THREE.Quaternion ) {\n\t\t\t\t\n\t\t\t\t// quaternion rotations\n\t\t\t\t\n\t\t\t\trotationTarget.multiply( qToNew, rotation );\n\t\t\t\t\n\t\t\t\t// normalized lerp to new rotation\n\t\t\t\t\n\t\t\t\t_VectorHelper.lerp_normalized( rotation, rotationTarget, lerpDelta );\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\t// matrix rotations\n\t\t\t\t\n\t\t\t\trotationTarget.setFromRotationMatrix( rotation );\n\t\t\t\t\n\t\t\t\trotationTargetForMatrix.multiply( qToNew, rotationTarget );\n\t\t\t\t\n\t\t\t\t// normalized lerp to new rotation\n\t\t\t\t\n\t\t\t\t_VectorHelper.lerp_normalized( rotationTarget, rotationTargetForMatrix, lerpDelta );\n\t\t\t\t\n\t\t\t\trotation.setRotationFromQuaternion( rotationTarget );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// update rigid body\n\t\t\t\n\t\t\tif ( updateRigidBody === true ) {\n\t\t\t\t\n\t\t\t\tqToNew.multiplyVector3( axisAway );\n\t\t\t\t\n\t\t\t\tif ( axisForward instanceof THREE.Vector3 ) {\n\t\t\t\t\t\n\t\t\t\t\tqToNew.multiplyVector3( axisForward );\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if ( typeof updateRigidBody !== 'undefined' ) {\n\t\t\t\t\n\t\t\t\t// find new axes based on new rotation\n\t\t\t\t\n\t\t\t\taxes = updateRigidBody.axes;\n\t\t\t\t\n\t\t\t\trotation.multiplyVector3( axes.up.copy( ca.up ) );\n\t\t\t\trotation.multiplyVector3( axes.forward.copy( ca.forward ) );\n\t\t\t\trotation.multiplyVector3( axes.right.copy( ca.right ) );\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn qToNew;\n\t\t\n\t}", "title": "" } ]
[ { "docid": "d4758fa95b42063115a6ff5c8d5b3cad", "score": "0.81473964", "text": "rotate() {\n this._rotation = (this._rotation + 90) % 360\n }", "title": "" }, { "docid": "c6881253a08a47409d8bef562ee99352", "score": "0.7944477", "text": "rotate() {\n this._rotation = (this._rotation + 90) % 360\n \n\n this.rotateAroundCenter(90)\n }", "title": "" }, { "docid": "a4538ba8fa203ae0b435d24cc4c17555", "score": "0.7818407", "text": "rotate( amt ) {\n this.dir.rotate( amt )\n }", "title": "" }, { "docid": "878976e5329cd4d6cced6c1a7ce79a89", "score": "0.7769458", "text": "Rotate(float, float, float) {\n\n }", "title": "" }, { "docid": "62c748a79cb83a4a876fcd6e04b0491f", "score": "0.75555205", "text": "function rotateClock() {\n updateCopyImage(); \n rotation += 90;\n newSize(imageWidth, imageHeight, rotation);\n rotate();\n }", "title": "" }, { "docid": "e4c1383a8eae5916c909b1f2bceb00e3", "score": "0.75555146", "text": "rotate(amount) {\n this.orientation += amount;\n }", "title": "" }, { "docid": "6eb60ac291dee55e5efb71acd674236e", "score": "0.7504707", "text": "rotate(dir) {\n this._rotation = (this._rotation + dir + 4) % 4;\n }", "title": "" }, { "docid": "0e3afb2621cc56656e9fc3523685bb65", "score": "0.74833184", "text": "rotate() {\n this.rotation = (this.rotation + 1) % (LAYOUTS[this.shapetype].length);\n\n this.setlocation(this.leftest() - 1, this.lowest());\n }", "title": "" }, { "docid": "4005262c06cea1adbeb699c528dfb911", "score": "0.7245286", "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": "9eb84f408dd20a1325f9802cddc4fc2f", "score": "0.721772", "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": "a6d9132f405538ecfda36c2703099320", "score": "0.7214379", "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": "9b496975f234f21815863878a34fcfe2", "score": "0.71764076", "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": "17fc8a3a56ecee56e0479349605f4ca1", "score": "0.7135616", "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": "6d6468408add74e77cc4df3e30b878c2", "score": "0.7113044", "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": "45d14e45b61fa2530753deaf0012c132", "score": "0.7109051", "text": "function rotateClockwise() {\n undraw()\n currentRotation ++\n\n if(currentRotation === current.length) {\n currentRotation = 0\n }\n\n current = theTetrominoes[random][currentRotation]\n checkRotatedPosition()\n draw()\n }", "title": "" }, { "docid": "8c9c16570eb7970556916051ce343bfd", "score": "0.7077084", "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": "02a4b1fadda080094a0adac91079b375", "score": "0.7054148", "text": "rotateCounterClockwise() {\n for (let block of this.shape) {\n let temp = block[0];\n block[0] = block[1];\n block[1] = -temp;\n }\n }", "title": "" }, { "docid": "efcdd1dd756c2a18300818668b5714ad", "score": "0.70178574", "text": "rotate(direction) {\n if (direction)\n this._angle += 4;\n else\n this._angle -= 4;\n if (this.angle >= 360)\n this._angle = this.angle % 360;\n }", "title": "" }, { "docid": "c809a36a976bbe67e3732484b8f3e22a", "score": "0.70141405", "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": "6c2339dc629aa1df4811523322b3f7cf", "score": "0.70049256", "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": "82f821dba7eb974a3cc5f96e7d62d955", "score": "0.6998112", "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": "5104c6ca9d5ad0c06a57dc043e743222", "score": "0.69303334", "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": "f9d2f79ff129307c29beb2ecea5c338e", "score": "0.6923508", "text": "function rotate () {\n rotated = true;\n ctx.translate(width, 0);\n ctx.rotate(Math.PI / 2);\n}", "title": "" }, { "docid": "1a89a6c4c3f9953bcb36d8e4e1ba4c09", "score": "0.69166225", "text": "function rotLeft(arr, d) {\n \n}", "title": "" }, { "docid": "29e3355729591f8cd86440f48892e681", "score": "0.6905128", "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": "7a72b2758fdfc10e024d31ad34d862a3", "score": "0.68982357", "text": "decomposeRotation() {\n return rad2deg(Math.atan2(this._v[3], this._v[0]));\n }", "title": "" }, { "docid": "b9862fa0b180cfb10c225242ee70b085", "score": "0.6895497", "text": "function rotateAntiClock() {\n updateCopyImage(); \n rotation -= 90;\n newSize(imageWidth, imageHeight, rotation);\n rotate();\n }", "title": "" }, { "docid": "8a363573ae60f317181b52b7bb2bee15", "score": "0.6890952", "text": "function rotate(x) {\n ctx.rotate(x);\n}", "title": "" }, { "docid": "fcfc2adf97f29c2ca1bce361e4f77a58", "score": "0.6880161", "text": "rotated(angle) {\n const newAngle = this.angle + angle;\n const mag = this.magnitude;\n return v2(mag * Math.cos(newAngle), mag * Math.sin(newAngle));\n }", "title": "" }, { "docid": "2eea346c5ff312a107e5d6ecfaff91e4", "score": "0.6870028", "text": "rotate(orientation) {\n\n const direction = compass.indexOf(history[history.length - 1].direction) + orientation;\n\n const currentDir = direction < 0 ?\n 3 : direction > 3 ? 0 : direction;\n\n this.addStep({direction: compass[currentDir]});\n\n }", "title": "" }, { "docid": "2ac0e66bf8161612531537451cc88a99", "score": "0.68590796", "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": "3b8f8e8e634985063c6890225cd67143", "score": "0.68577623", "text": "rotate(angle) {\n ctx.translate(this.posX, this.posY);\n ctx.rotate(angle);\n ctx.drawImage(this.car, -this.width/2, -this.height/2);\n ctx.rotate(-angle);\n ctx.translate(-this.posX, -this.posY);\n }", "title": "" }, { "docid": "57c61ddf0c2f100a9a0dd4e40c2fb828", "score": "0.68553454", "text": "setRotation(degrees) {\n this.rotation = degrees ;\n }", "title": "" }, { "docid": "635239188df580d6bf04dfe817d033c7", "score": "0.6842477", "text": "function cevir(radyan) {\n rotate(radyan);\n}", "title": "" }, { "docid": "16574a0f0ff7dadeba06588febe11b5b", "score": "0.6816046", "text": "rotateClockwise90() {\n this.hide_selection_box();\n this.angle += 90;\n if (this.angle === 360) this.angle = 0;\n }", "title": "" }, { "docid": "6980fd90b67fcc390c6e8e3095ea0441", "score": "0.68122476", "text": "setRotationAmount(rotation){\r\n\t\tthis.rotation=rotation;\r\n\t}", "title": "" }, { "docid": "bc6d66dee8db85b0a074ed9f396ecf8c", "score": "0.6810902", "text": "getRotation() {\n return Math.atan2(this.m10(), this.m00());\n }", "title": "" }, { "docid": "7b043dbd09365b67590e446a27d5d5f3", "score": "0.6776119", "text": "resetRotation(){\r\n this.raw[1] = this.raw[3] = this.raw[6] = this.raw[7] = 0;\r\n this.raw[0] = this.raw[4] = this.raw[8] = 1; //only positions 0,4,8 need to be 1 else 0.\r\n\t\treturn this;\r\n\t}", "title": "" }, { "docid": "543bfc9a8d4805c0b654ca61db5c1fe2", "score": "0.6762859", "text": "rotateRow()\n {\n this.rotateArray(this.matrix);\n this.rotateArray(this.vector);\n }", "title": "" }, { "docid": "7c0030194fb350b4efb72b312c41d97a", "score": "0.67575204", "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": "13a8329b14de35e3e4026e06000e3ff0", "score": "0.67436844", "text": "function imageRotator(matrix) {\n // if (matrix.length <= 1) {\n // return matrix;\n // }\n //\n // for (let i = 0; i < (matrix.length / 2); i++) {\n // for (let j = i; j < matrix.length / 2 - i; j++) {\n // matrix[i][j], matrix[i][-1 - j], matrix[-1 - i][-1 - j], matrix[-1-j][i]\n // = matrix[-1-j][i], matrix[i][j], matrix[i][-1 - j], matrix[-1 - i][-1 - j];\n // }\n // }\n // return matrix;\n}", "title": "" }, { "docid": "6d793be24ac185e510aefb5c7c26c1cf", "score": "0.6734629", "text": "function rotateImage(a) {\n for (let i = 0; i < a.length; i++) {\n for (let j = 0; j < i; j++) {\n let temp = a[i][j]\n a[i][j] = a[j][i]\n a[j][i] = temp\n }\n }\n for (let i = 0; i < a.length; i++) {\n for (let j = 0; j < a[0].length / 2; j++) {\n let temp = a[i][j]\n a[i][j] = a[i][a[0].length - 1 - j]\n a[i][a[0].length - 1 - j] = temp\n }\n }\n return a\n}", "title": "" }, { "docid": "5a70ad3991a5c06fbeb3f1e4a5a93a63", "score": "0.67157376", "text": "function cyclicRotation(arr, rotation){\n for (var i = 0; i < rotation; i++){\n var lastNum = arr.pop();\n arr.unshift(lastNum);\n }\n return arr;\n}", "title": "" }, { "docid": "51a97199f7bee860aa888fd326b7b3bd", "score": "0.67125165", "text": "static Rotate180(src) {\n\n\t\tvar result = this.Create(src.length, src[0].length);\n\t\tvar tmp = this.Clone(src);\n\n\t\tfor (var FlipDim = 0; FlipDim < 2; FlipDim++) {\n\n\t\t\tresult = this.Flip2D(tmp, FlipDim);\n\n\t\t\ttmp = this.Clone(result);\n\t\t}\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "92b15ab8b7688d7612f13ce829b41775", "score": "0.67121446", "text": "drawRotate() {\n ctx.save();\n ctx.beginPath();\n ctx.translate(this.x + this.w / 2, this.y + this.h / 2);\n ctx.rotate(this.degrees * Math.PI / 180);\n ctx.drawImage(this.img, -this.w / 2, -this.h / 2, this.w, this.h);\n ctx.restore();\n }", "title": "" }, { "docid": "83e678f50b360482d108524ffff582d9", "score": "0.6701322", "text": "function rotateFromOldAngle(group, degrees) {\n\t\tgroup.applyRightTransform(gfx.matrix.rotate(2 * Math.PI * degrees / 360));\n\t}", "title": "" }, { "docid": "a05b2a097773b4b69606736d37024262", "score": "0.6697063", "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": "bce9088f3a88a6379e79f33fd5d25381", "score": "0.6696216", "text": "rotate(theta)\n {\n var sin = Math.sin(theta);\n var cos = Math.cos(theta);\n\n for (var i = 0; i < this.length; i+=2)\n {\n var x = this.vertices[i];\n var y = this.vertices[i+1];\n\n this.vertices[i] = (cos*x - sin*y) ;\n this.vertices[i+1] = (sin*x + cos*y);\n }\n }", "title": "" }, { "docid": "f8a54765d7a6085061c3f5b09271e836", "score": "0.6693175", "text": "timer() {\n this.sethandRotation()\n }", "title": "" }, { "docid": "495c13af47e00c0ad03031611afaca29", "score": "0.66828644", "text": "function rotate(){\n for(i = 0; i < 7; ++i){\n var makestring = i.toString(); // convert number to string\n rotateImage(mergeWind[i], \"data\" + makestring); \n }\n }", "title": "" }, { "docid": "223b57dbb136f6ab44c3188f9783bcad", "score": "0.666787", "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": "6685f4164d401cc36ba478a0c6497b81", "score": "0.6667162", "text": "resetRotation(){\r\n for(var i=0; i < this.raw.length; i++){\r\n if(i == 3) continue;\r\n if(i == 7) continue;\r\n if(i == 11) continue; // skip translation components\r\n this.raw[i] = (i % 5 == 0)? 1 : 0; //only positions 0,5,10,15 need to be 1 else 0.\r\n }\r\n return this;\r\n }", "title": "" }, { "docid": "d2f573dc8f0c1d534c18dffce5c63b7c", "score": "0.6665001", "text": "function createRotate(deg, x, y)\n{\n return \" rotate (\" + deg + \", \" + x + \", \" + y + \")\"\n}", "title": "" }, { "docid": "e65198a002ffaf4584bb09b6cc2bad06", "score": "0.66619617", "text": "rotateDevice(){\n this.device.rotate();\n this.app.updateDevice(this.device);\n }", "title": "" }, { "docid": "a627b68be4f950a2f8a01bbe3cb324a1", "score": "0.6659028", "text": "static rotation2(angle) {\n return fromPool().setToRotationZ(angle);\n }", "title": "" }, { "docid": "e2d938b702611567e47ef5db5dc49252", "score": "0.6658974", "text": "function rotateLineRight(line) {\n \n cube[RIGHT][line] = cubeBackup[FRONT][line]; \n cube[FRONT][line] = cubeBackup[LEFT][line];\n cube[LEFT][line] = cubeBackup[BACK][line];\n cube[BACK][line] = cubeBackup[RIGHT][line];\n\n draw();\n\n}", "title": "" }, { "docid": "edda4e99ccd936f9b25cd54dfb81935d", "score": "0.6655966", "text": "tryRotate()\r\n {\r\n \tif(!this.checkRotationCollisions())\r\n \t{\r\n \t\tthis.shapes[this.shapes.length - 1].rotate();\r\n \t}\r\n }", "title": "" }, { "docid": "d81569ccf65f55c127f7ec0b4f9da939", "score": "0.6651403", "text": "function rotate(){\n\tif(horisontalPlacement==1){\n\t\thorisontalPlacement=0;\n\t}\n\telse{\n\t\thorisontalPlacement=1;\n\t}\n}", "title": "" }, { "docid": "f9f5eeebf128434be51e7e5b723ba5a7", "score": "0.6644503", "text": "rotateClockwise() {\n this._matrix = Private.prod(this._matrix, Private.rotateClockwiseMatrix);\n this._updateStyle();\n }", "title": "" }, { "docid": "77e0269f808d1821b5abb3d6ddf0bb1c", "score": "0.663885", "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": "151ecc7a2d972e4f3026f73fb598b7c4", "score": "0.66217905", "text": "setRotation(value) {\n this.rotation = value;\n }", "title": "" }, { "docid": "a82886ced6c2de89d37e8fc815443937", "score": "0.661397", "text": "function RotateImage(imgRef, degreesToRotate) {\n \n $(imgRef).rotate(degreesToRotate);\n \n}", "title": "" }, { "docid": "839341e4f55120a5b5088c59910140e3", "score": "0.6612881", "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": "194f60345a63fded0e873250fa5aa4d3", "score": "0.66097254", "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": "2a5edfdf43734ded81f2a135514593c2", "score": "0.66065407", "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": "8c0ad155f4af47da1d474a2d0fec6bcd", "score": "0.66021883", "text": "rotate(direction) {\n\n if ( direction !== 'L' && direction !== 'R') throw { \n error: 'rotate', \n message: `${direction} is not a valid direction`\n }\n\n if (direction == \"L\") this.heading -= 90\n if (direction == \"R\") this.heading += 90\n if (this.heading < 0 ) this.heading += 360\n if (this.heading === 360) this.heading = 0 \n\n return this\n }", "title": "" }, { "docid": "93e302de2323743793806ab3f49b791b", "score": "0.6592758", "text": "function frame(angle){\n context.clearRect(0, 0, context.canvas.width, context.canvas.height);\n \n context.save();\n context.translate(context.canvas.width/2, (context.canvas.height/2)-120);\n context.rotate(angle/180 * Math.PI); \n loadImage();\n context.restore();\n }", "title": "" }, { "docid": "743df617a96e8edf78cf4b15d85f9aea", "score": "0.6589732", "text": "function rotateImage() {\r\n var img = document.querySelector('#arm');\r\n img.style.transform = 'rotate(18deg)';\r\n}", "title": "" }, { "docid": "7ca1eefc3ff7332e655fbb80c60c6ecd", "score": "0.6587833", "text": "function c(){var t=s();return 90===L._viewrotation||270===L._viewrotation?B(t):t}", "title": "" }, { "docid": "2bfa073bef6c4cc8ba8aba6b9d71b86c", "score": "0.65870917", "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": "9d0f7a9a5a054d2a38f5cd50ef3bd748", "score": "0.6580124", "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": "e08cb3efc6e787a2d30a9910b09ac87c", "score": "0.6579922", "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": "c311b12d611727fa456b1dc62af57acd", "score": "0.6578972", "text": "updateRotation() {\n this.element.css(\"transform\", \"rotate(\"+this.rotation+\"rad)\") ;\n }", "title": "" }, { "docid": "487ec12ccb41586fdb23d541be018908", "score": "0.65744853", "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": "8399f599a71d56d2e4b0d78568ddb5bc", "score": "0.6562307", "text": "function rotate( degrees ) {\n\tcube.rotation.y = degrees * (Math.PI / 180);\n}", "title": "" }, { "docid": "7b1d4c47b5de84848ed1156c0929227f", "score": "0.6558942", "text": "inner_rotate( obj, cx, cy, angle ){\n\t\tvar c = this.copy(obj)\n\t\tif( typeof obj.commands !== 'undefined' ){\n\t\t\tvar commands = []\n\t\t\tfor(var i=0; i<obj.commands.length; i++ ) \n \t\t\tcommands[i] = this.inner_rotate(obj.commands[i],cx,cy,angle)\n\t\t\tc.commands = commands\n\t\t}\n\t\tif( obj.command == 'image' ) c.r = obj.r + angle\n\t\telse{\n\t\t\tvar p\n \t\tif( typeof obj.x !== 'undefined' ){\n\t\t\t\tif( Array.isArray(obj.x) ){\n\t\t\t\t\tvar nx = []\n\t\t\t\t\tvar ny = []\n\t\t\t\t\tfor(var i=0; i<obj.x.length; i++){\n\t\t\t\t\t\tp = this.rotate_point( cx, cy, obj.x[i], obj.y[i], angle )\n\t\t\t\t\t\tnx.push(p[0])\n\t\t\t\t\t\tny.push(p[1])\n\t\t\t\t\t} \n\t\t\t\t\tc.x = nx\n\t\t\t\t\tc.y = ny\n\t\t\t\t}else{\n\t\t\t\t\tp = this.rotate_point( cx, cy, obj.x, obj.y, angle )\n\t\t\t\t\tc.x = p[0]\n\t\t\t\t\tc.y = p[1]\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t\treturn c\n\t}", "title": "" }, { "docid": "c0ac44086dfc7e444282901c2831d8cf", "score": "0.65513813", "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": "1389a31b8025e1108a6d869c1d544d98", "score": "0.65434897", "text": "rotate(time, direction){\n\t\tlet angle = time * this.rotAngle;\n\t\tif (direction != 0) {\n\t\t\tif((this.currRotAngle + angle) < this.maxRotAngle){\n\t\t\t\tthis.currRotAngle+=angle;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.currRotAngle = this.maxRotAngle;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif((this.currRotAngle - angle) > 0){\n\t\t\t\tthis.currRotAngle-=angle;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.currRotAngle = 0;\n\t\t\t\tthis.hide = true;\n\t\t\t\tif(this.hold){\n\t\t\t\t\tthis.hold = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "title": "" }, { "docid": "2d0629ad81230e4c8b5885c68d340541", "score": "0.65335613", "text": "function rotate(){\n\t\t/*function copy(oldObj){\n\t\t\tlet newObj = new Object;\n\t\t\tfor(let i in oldObj){\n\t\t\t\tif(oldObj.hasOwnProperty(i)){\n\t\t\t\t\tnewObj[i] = oldObj[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn newObj;*/\n\n\t\tlet t_coords = [];\n\t\tfor(let i in c_block.coords){\n\t\t\tt_coords.push([c_block.coords[i][0], c_block.coords[i][1]]);\n\t\t}\n\t\tlet block_to_remove = blocks[c_block.rotation][c_block.id];\n\t\tlet block_to_add = blocks[c_block.rotation + 1][c_block.id];\n\t\tfor(let i in t_coords){\n\t\t\tfor(let j in t_coords[i]){\n\t\t\t\tconsole.log(\"t_coords = \" + t_coords);\n\t\t\t\tconsole.log(\"c_block = \" + c_block.coords);\n\t\t\t\tt_coords[i][j] -= block_to_remove[i][j];\n\t\t\t\tt_coords[i][j] += block_to_add[i][j];\n\t\t\t}\n\t\t\tif(document.getElementById(t_coords[i][0] + \",\" + t_coords[i][1]).style.backgroundColor != board_color){\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tfor(let i in c_block.coords){\n\t\t\tconsole.log(c_block.coords[i]);\n\t\t\tchange_color(c_block.coords[i][0], c_block.coords[i][1], board_color);\n\t\t}\n\t\tc_block.coords = t_coords\n\n\n\n\t\tc_block.rotation += 1;\n\n\t\tc_block.indexes_lower_coords = find_indexes(\"bottom\");\n\t\tc_block.indexes_right_coords = find_indexes(\"right\");\n\t\tc_block.indexes_left_coords = find_indexes(\"left\");\n\t}", "title": "" }, { "docid": "c564902bdb0912d3b77db522b89869b5", "score": "0.6514233", "text": "function rotate180(struct) {\n let height = struct.length;\n let lineArrays = [];\n for (let i = 0; i < height; i++) {\n lineArrays[i] = struct[height-1-i].split(' ');\n }\n let width = lineArrays[0].length;\n let res = [];\n for (let i = 0; i < height; i++) {\n res[i] = new Array(width);\n }\n for (let i = 0; i < height; i++) {\n for (let j = 0; j < width; j++) {\n res[i][j] = flipCell(lineArrays[i][width-1-j]);\n }\n }\n for (let i = 0; i < height; i++) {\n res[i] = res[i].join(' ');\n }\n return res;\n}", "title": "" }, { "docid": "bda4e3ef87a30f159ab8aae53eb4f120", "score": "0.65098536", "text": "function rotateImage(matrix,length){\n\n for(let layer = 0; layer < length/2; layer++){\n\n\n let first = layer;\n let last = length - 1 - layer;\n\n for(let i = first ; i < last; i++){\n let temp = matrix[layer][i];\n\n // bottomLeft to topLeft\n matrix[layer][i] = matrix[last][first];\n\n //bottomRight to bottomLeft\n matrix[last][first] = matrix[last][last];\n\n //topRight to bottomRight\n matrix[last][last] = matrix[first][last];\n\n //move temp to topRight\n\n matrix[first][last] = temp;\n\n\n }\n\n }\n\n return matrix;\n\n}", "title": "" }, { "docid": "b30415902273e31f966789268a827a9d", "score": "0.6501909", "text": "function rotatePicture(matrix, cycle) {\n if (cycle == 0) {\n return matrix;\n }\n var rotate_cycle = cycle % 4;\n var count = 0\n switch (rotate_cycle) {\n case 1:\n rotateClockWise_90Degree(matrix);\n break;\n case 2:\n rotateMatrix2D_180Degree(matrix);\n break;\n case 3:\n rotateCounterClockWise_90Degree(matrix);\n break;\n default:\n return matrix;\n }\n console.log(\"after rotate matrix with \" + cycle + \" cycle\");\n console.log(matrix);\n return matrix;\n }", "title": "" }, { "docid": "b6867e69ac27a454ed55943c342904a7", "score": "0.6498051", "text": "function incrementalRotation(rotation)\n{\n cubies = myCube.performAction(rotation);\n var rotationMatrix;\n switch(rotation)\n {\n case \"R\":\n rotationMatrix = rotateX(-90/FRAMES_PER_ROTATION);\n break;\n case \"r\":\n rotationMatrix = rotateX(90/FRAMES_PER_ROTATION);\n break;\n case \"L\":\n rotationMatrix = rotateX(90/FRAMES_PER_ROTATION);\n break;\n case \"l\":\n rotationMatrix = rotateX(-90/FRAMES_PER_ROTATION);\n break;\n case \"F\":\n rotationMatrix = rotateZ(-90/FRAMES_PER_ROTATION);\n break;\n case \"f\":\n rotationMatrix = rotateZ(90/FRAMES_PER_ROTATION);\n break;\n case \"B\":\n rotationMatrix = rotateZ(90/FRAMES_PER_ROTATION);\n break;\n case \"b\":\n rotationMatrix = rotateZ(-90/FRAMES_PER_ROTATION);\n break;\n case \"U\":\n rotationMatrix = rotateY(-90/FRAMES_PER_ROTATION);\n break;\n case \"u\":\n rotationMatrix = rotateY(90/FRAMES_PER_ROTATION);\n break;\n case \"D\":\n rotationMatrix = rotateY(90/FRAMES_PER_ROTATION);\n break;\n case \"d\":\n rotationMatrix = rotateY(-90/FRAMES_PER_ROTATION);\n break;\n }\n rotationFunction = function(piece)\n {\n accum_rotation[myCube.cubie_at_position[piece]] =\n mult(rotationMatrix, accum_rotation[myCube.cubie_at_position[piece]]);\n };\n timer = FRAMES_PER_ROTATION;\n disableButtons(true);\n render();\n}", "title": "" }, { "docid": "277ce79d3f8c3d98a906aab729677de5", "score": "0.64930886", "text": "function rotate() {\n //frente do carro\n asaEsquerdafrontal.matrix.multiply(\n mat4.makeRotationY(degreesToRadians(90))\n );\n asaDireitoFrontal.matrix.multiply(mat4.makeRotationY(degreesToRadians(90)));\n banco.matrix.multiply(mat4.makeRotationY(degreesToRadians(90)));\n apoioBanco.matrix.multiply(mat4.makeRotationX(degreesToRadians(90)));\n frenteDoCarro.matrix.multiply(mat4.makeRotationZ(degreesToRadians(90)));\n\n //meio do carro\n arcoEsquerdo.matrix.multiply(mat4.makeRotationZ(degreesToRadians(94)));\n arcoDireito.matrix.multiply(mat4.makeRotationZ(degreesToRadians(-86)));\n ponteCentral.matrix.multiply(mat4.makeRotationZ(degreesToRadians(90)));\n\n //traseira do carro\n leftWing.matrix.multiply(mat4.makeRotationY(degreesToRadians(90)));\n rightWing.matrix.multiply(mat4.makeRotationY(degreesToRadians(90)));\n suporteEsquerdoWing.matrix.multiply(\n mat4.makeRotationX(degreesToRadians(90))\n );\n suporteDireitoWing.matrix.multiply(\n mat4.makeRotationX(degreesToRadians(90))\n );\n\n //rodas e eixo\n rodaDianteiraDireita.matrix.multiply(\n mat4.makeRotationZ(degreesToRadians(90))\n );\n rodaTraseiraDireita.matrix.multiply(\n mat4.makeRotationZ(degreesToRadians(90))\n );\n rodaDianteiraEsquerda.matrix.multiply(\n mat4.makeRotationZ(degreesToRadians(90))\n );\n rodaTraseiraEsquerda.matrix.multiply(\n mat4.makeRotationZ(degreesToRadians(90))\n );\n eixoFrontal.matrix.multiply(mat4.makeRotationZ(degreesToRadians(90)));\n suporteEixoFrontalDireito.matrix.multiply(\n mat4.makeRotationZ(degreesToRadians(90))\n );\n suporteEixoFrontalDireito.matrix.multiply(\n mat4.makeRotationX(degreesToRadians(30))\n );\n suporteeixoFrontalEsquerdo.matrix.multiply(\n mat4.makeRotationZ(degreesToRadians(90))\n );\n suporteeixoFrontalEsquerdo.matrix.multiply(\n mat4.makeRotationX(degreesToRadians(-30))\n );\n eixoTraseiro.matrix.multiply(mat4.makeRotationZ(degreesToRadians(90)));\n\n texturaConexaoFrontalEsquerda.matrix.multiply(mat4.makeRotationY(degreesToRadians(90)));\n texturaConexaoFrontalDireita.matrix.multiply(mat4.makeRotationY(degreesToRadians(90)));\n texturaConexaoFrontalFrente.matrix.multiply(mat4.makeRotationX(degreesToRadians(90)));\n texturaConexaoFrontalVolante.matrix.multiply(mat4.makeRotationX(degreesToRadians(90)));\n\n texturaAsaLateral.matrix.multiply(mat4.makeRotationX(degreesToRadians(90)));\n texturaAsaLateralTraseira.matrix.multiply(\n mat4.makeRotationX(degreesToRadians(90))\n );\n\n texturaChassiFrontal.matrix.multiply(\n mat4.makeRotationX(degreesToRadians(90))\n );\n texturaChassiTraseira.matrix.multiply(\n mat4.makeRotationX(degreesToRadians(90))\n );\n texturaChassiLateralEsquerda.matrix.multiply(\n mat4.makeRotationY(degreesToRadians(90))\n );\n texturaChassiLateralDireita.matrix.multiply(\n mat4.makeRotationY(degreesToRadians(90))\n );\n }", "title": "" }, { "docid": "5fd3f291a9637ca44a4d38ef52dfbf35", "score": "0.6480514", "text": "function keepRotating(){\r\n modelViewMatrix = mult(modelViewMatrix, rotateX(rotationAngleX));\r\n modelViewMatrix = mult(modelViewMatrix, rotateY(rotationAngleY));\r\n\r\n rotationAngleX = rotationAngleX + rotationAngleXFactor;\r\n rotationAngleY = rotationAngleY + rotationAngleYFactor;\r\n if(rotationAngleX > 360)\r\n rotationAngleX = 0;\r\n if(rotationAngleY > 360)\r\n rotationAngleY = 0;\r\n\r\n if(rotationAngleX < 0)\r\n rotationAngleX = 360;\r\n if(rotationAngleY < 0)\r\n rotationAngleY = 360;\r\n\r\n if(isKeyPressed)\r\n {\r\n if(keyValue == 87) //w\r\n {\r\n rotationAngleXFactor = rotationAngleXFactor + rotationAngleMultiple;\r\n }\r\n else if(keyValue == 65) //a\r\n {\r\n rotationAngleYFactor = rotationAngleYFactor + rotationAngleMultiple;\r\n }\r\n else if(keyValue == 68) //d\r\n {\r\n rotationAngleYFactor = rotationAngleYFactor - rotationAngleMultiple;\r\n }\r\n else if(keyValue == 83) //s\r\n {\r\n rotationAngleXFactor = rotationAngleXFactor - rotationAngleMultiple;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6955685b6128fde4712feddf3e367619", "score": "0.6478847", "text": "rotateX(angle) {\n angle = Number(angle) || 0;\n const c = Math.cos(angle);\n const s = Math.sin(angle);\n const mat = new Transformation();\n mat.fields[5] = c;\n mat.fields[10] = c;\n mat.fields[9] = -s;\n mat.fields[6] = s;\n return this.mult(mat);\n }", "title": "" }, { "docid": "18a6c513f497a3ece8603d9785746f6c", "score": "0.64786357", "text": "function rotateLoop(){\t\r\n\trotateAll(index, \"x\");\r\n\trotateAll(2*index, \"y\");\r\n\trotateAll(index, \"z\");\r\n\t\r\n\tdrawLines();\t\r\n}", "title": "" }, { "docid": "368b1013a6e9d79c0b6ed8fe43f736fd", "score": "0.6475258", "text": "function rotateArray(Array) {\n\t\t\tfor (var i=0; i<Array.length; i++) {\n\t\t\t\tArray[i].rotation++;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b273277fb5ce0d726f652ba78d3ecb87", "score": "0.647288", "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": "0995846bb205dc3e012fc8a5f6aeb14d", "score": "0.64726144", "text": "resetRotate() {\n this._transformDirection.x = 0;\n this.theta = 0;\n return this;\n }", "title": "" }, { "docid": "2403badb19eff1a1f51159574fa18a2e", "score": "0.6458129", "text": "function _rotate(xs){\n var l = xs.length;\n var ys = new Array(l);\n ys[0] = xs[l - 1];\n for(var i = 1; i < l; i++) ys[i] = xs[i - 1];\n return ys;\n}", "title": "" }, { "docid": "201993f7fb610d457d566290b9c0feaa", "score": "0.64570886", "text": "function u(){var t=c();return 90===L._viewrotation||270===L._viewrotation?B(t):t}", "title": "" }, { "docid": "9c11d3dbee740e86e42fbec71fd2455c", "score": "0.64554757", "text": "rotate(x){\r\n this.deque = this.deque.slice(this.deque.length - x).concat(this.deque.slice(0, this.deque.length - x));\r\n }", "title": "" }, { "docid": "4c6d35ae9d26130fe0a1f6d711264008", "score": "0.64438885", "text": "rotate( axis, amount ) {\n this.dir.applyAxisAngle( axis, amount )\n }", "title": "" }, { "docid": "ee3da7f889398c84326e43b4cde0d533", "score": "0.64425635", "text": "rotateArray(array)\n {\n let lastRow = array[array.length-1];\n for(let i = 1; i < array.length; i+=1)\n {\n array[this.size-i] = array[array.length-i-1];\n }\n\n array[0] = lastRow;\n }", "title": "" }, { "docid": "4aef78ece87d3209d7ea410ba9770a5e", "score": "0.6441852", "text": "rotatey(a) {\n for(let i = 0; i<this.points.length; i++) {\n let dx = this.points[i].x - (this.x + this.w/2)\n let dz = this.points[i].z - (this.z + this.d/2)\n let nx = dx * Math.cos(a) - dz * Math.sin(a)\n let nz = dx * Math.sin(a) + dz * Math.cos(a)\n this.points[i].x = nx + (this.x + this.w/2)\n this.points[i].z = nz + (this.z + this.d/2)\n }\n }", "title": "" }, { "docid": "cfb9e48f3b0dd1b02b745ed5a7486c49", "score": "0.6441183", "text": "function rotateImage(a) {\n\n \n const flip = a => (\n \n a[0].map((column, index) => (\n \n a.map(row => row[index])\n \n \n \n ) )\n ); \n \n \n return flip(a.reverse()); \n \n}", "title": "" }, { "docid": "57201d4ffb9d1cde5b1437532738b84c", "score": "0.64381695", "text": "_applyRotation() {\n let start = 0;\n let end = this.pageCount;\n let leftOffset = Math.floor(this.maxSize / 2);\n let rightOffset = this.maxSize % 2 === 0 ? leftOffset - 1 : leftOffset;\n\n if (this.page <= leftOffset) {\n // very beginning, no rotation -> [0..maxSize]\n end = this.maxSize;\n } else if (this.pageCount - this.page < leftOffset) {\n // very end, no rotation -> [len-maxSize..len]\n start = this.pageCount - this.maxSize;\n } else {\n // rotate\n start = this.page - leftOffset - 1;\n end = this.page + rightOffset;\n }\n\n return [start, end];\n }", "title": "" }, { "docid": "2662f4e5d7d8063e1779029a3575f279", "score": "0.6434265", "text": "rotateZ(angle) {\n angle = Number(angle) || 0;\n const c = Math.cos(angle);\n const s = Math.sin(angle);\n const mat = new Transformation();\n mat.fields[0] = c;\n mat.fields[5] = c;\n mat.fields[4] = -s;\n mat.fields[1] = s;\n return this.mult(mat);\n }", "title": "" }, { "docid": "906851b3ca60b61599568f48346c56c5", "score": "0.64332813", "text": "function rotateChairRight(){\n 'use strict';\n rotation = true;\n rotate -=(Math.PI/25);\n chairUpperPart.rotation.y-=(Math.PI/25);\n}", "title": "" }, { "docid": "a7c5751b7dea5ac8bca20cf9fa6a6304", "score": "0.6433035", "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": "" } ]
0b0c47045c567a3ad97f7657302c03e6
Apply Django template variable syntax highlighting
[ { "docid": "ebdd5620368bd0d7279eb112880af545", "score": "0.0", "text": "function inVariable (stream, state) {\n\t // Attempt to match a dot that precedes a property\n\t if (state.waitDot) {\n\t state.waitDot = false;\n\n\t if (stream.peek() != \".\") {\n\t return \"null\";\n\t }\n\n\t // Dot followed by a non-word character should be considered an error.\n\t if (stream.match(/\\.\\W+/)) {\n\t return \"error\";\n\t } else if (stream.eat(\".\")) {\n\t state.waitProperty = true;\n\t return \"null\";\n\t } else {\n\t throw Error (\"Unexpected error while waiting for property.\");\n\t }\n\t }\n\n\t // Attempt to match a pipe that precedes a filter\n\t if (state.waitPipe) {\n\t state.waitPipe = false;\n\n\t if (stream.peek() != \"|\") {\n\t return \"null\";\n\t }\n\n\t // Pipe followed by a non-word character should be considered an error.\n\t if (stream.match(/\\.\\W+/)) {\n\t return \"error\";\n\t } else if (stream.eat(\"|\")) {\n\t state.waitFilter = true;\n\t return \"null\";\n\t } else {\n\t throw Error (\"Unexpected error while waiting for filter.\");\n\t }\n\t }\n\n\t // Highlight properties\n\t if (state.waitProperty) {\n\t state.waitProperty = false;\n\t if (stream.match(/\\b(\\w+)\\b/)) {\n\t state.waitDot = true; // A property can be followed by another property\n\t state.waitPipe = true; // A property can be followed by a filter\n\t return \"property\";\n\t }\n\t }\n\n\t // Highlight filters\n\t if (state.waitFilter) {\n\t state.waitFilter = false;\n\t if (stream.match(filters)) {\n\t return \"variable-2\";\n\t }\n\t }\n\n\t // Ignore all white spaces\n\t if (stream.eatSpace()) {\n\t state.waitProperty = false;\n\t return \"null\";\n\t }\n\n\t // Identify numbers\n\t if (stream.match(/\\b\\d+(\\.\\d+)?\\b/)) {\n\t return \"number\";\n\t }\n\n\t // Identify strings\n\t if (stream.match(\"'\")) {\n\t state.tokenize = inString(\"'\", state.tokenize);\n\t return \"string\";\n\t } else if (stream.match('\"')) {\n\t state.tokenize = inString('\"', state.tokenize);\n\t return \"string\";\n\t }\n\n\t // Attempt to find the variable\n\t if (stream.match(/\\b(\\w+)\\b/) && !state.foundVariable) {\n\t state.waitDot = true;\n\t state.waitPipe = true; // A property can be followed by a filter\n\t return \"variable\";\n\t }\n\n\t // If found closing tag reset\n\t if (stream.match(\"}}\")) {\n\t state.waitProperty = null;\n\t state.waitFilter = null;\n\t state.waitDot = null;\n\t state.waitPipe = null;\n\t state.tokenize = tokenBase;\n\t return \"tag\";\n\t }\n\n\t // If nothing was found, advance to the next character\n\t stream.next();\n\t return \"null\";\n\t }", "title": "" } ]
[ { "docid": "39e53ed5211be743eecd37fc8ab2d576", "score": "0.66167575", "text": "function django$1(hljs) {\n const FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name: \"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags \" + \"filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands \" + \"title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode \" + \"timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort \" + \"dictsortreversed default_if_none pluralize lower join center default \" + \"truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first \" + \"escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize \" + \"localtime utc timezone\"\n },\n contains: [ hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE ]\n };\n return {\n name: \"Django\",\n aliases: [ \"jinja\" ],\n case_insensitive: true,\n subLanguage: \"xml\",\n contains: [ hljs.COMMENT(/\\{%\\s*comment\\s*%\\}/, /\\{%\\s*endcomment\\s*%\\}/), hljs.COMMENT(/\\{#/, /#\\}/), {\n className: \"template-tag\",\n begin: /\\{%/,\n end: /%\\}/,\n contains: [ {\n className: \"name\",\n begin: /\\w+/,\n keywords: {\n name: \"comment endcomment load templatetag ifchanged endifchanged if endif firstof for \" + \"endfor ifnotequal endifnotequal widthratio extends include spaceless \" + \"endspaceless regroup ifequal endifequal ssi now with cycle url filter \" + \"endfilter debug block endblock else autoescape endautoescape csrf_token empty elif \" + \"endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix \" + \"plural get_current_language language get_available_languages \" + \"get_current_language_bidi get_language_info get_language_info_list localize \" + \"endlocalize localtime endlocaltime timezone endtimezone get_current_timezone \" + \"verbatim\"\n },\n starts: {\n endsWithParent: true,\n keywords: \"in by as\",\n contains: [ FILTER ],\n relevance: 0\n }\n } ]\n }, {\n className: \"template-variable\",\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [ FILTER ]\n } ]\n };\n }", "title": "" }, { "docid": "0c4c32b1ff95cc219da332e1875dee3d", "score": "0.65659857", "text": "function django(hljs) {\n const FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name:\n 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +\n 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +\n 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +\n 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +\n 'dictsortreversed default_if_none pluralize lower join center default ' +\n 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +\n 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +\n 'localtime utc timezone'\n },\n contains: [\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE\n ]\n };\n\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n hljs.COMMENT(/\\{%\\s*comment\\s*%\\}/, /\\{%\\s*endcomment\\s*%\\}/),\n hljs.COMMENT(/\\{#/, /#\\}/),\n {\n className: 'template-tag',\n begin: /\\{%/,\n end: /%\\}/,\n contains: [{\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name:\n 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +\n 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +\n 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +\n 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +\n 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +\n 'plural get_current_language language get_available_languages ' +\n 'get_current_language_bidi get_language_info get_language_info_list localize ' +\n 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +\n 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [FILTER]\n }\n ]\n };\n}", "title": "" }, { "docid": "0c4c32b1ff95cc219da332e1875dee3d", "score": "0.65659857", "text": "function django(hljs) {\n const FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name:\n 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +\n 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +\n 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +\n 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +\n 'dictsortreversed default_if_none pluralize lower join center default ' +\n 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +\n 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +\n 'localtime utc timezone'\n },\n contains: [\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE\n ]\n };\n\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n hljs.COMMENT(/\\{%\\s*comment\\s*%\\}/, /\\{%\\s*endcomment\\s*%\\}/),\n hljs.COMMENT(/\\{#/, /#\\}/),\n {\n className: 'template-tag',\n begin: /\\{%/,\n end: /%\\}/,\n contains: [{\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name:\n 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +\n 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +\n 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +\n 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +\n 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +\n 'plural get_current_language language get_available_languages ' +\n 'get_current_language_bidi get_language_info get_language_info_list localize ' +\n 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +\n 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [FILTER]\n }\n ]\n };\n}", "title": "" }, { "docid": "0c4c32b1ff95cc219da332e1875dee3d", "score": "0.65659857", "text": "function django(hljs) {\n const FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name:\n 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +\n 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +\n 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +\n 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +\n 'dictsortreversed default_if_none pluralize lower join center default ' +\n 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +\n 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +\n 'localtime utc timezone'\n },\n contains: [\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE\n ]\n };\n\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n hljs.COMMENT(/\\{%\\s*comment\\s*%\\}/, /\\{%\\s*endcomment\\s*%\\}/),\n hljs.COMMENT(/\\{#/, /#\\}/),\n {\n className: 'template-tag',\n begin: /\\{%/,\n end: /%\\}/,\n contains: [{\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name:\n 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +\n 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +\n 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +\n 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +\n 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +\n 'plural get_current_language language get_available_languages ' +\n 'get_current_language_bidi get_language_info get_language_info_list localize ' +\n 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +\n 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [FILTER]\n }\n ]\n };\n}", "title": "" }, { "docid": "f4f36a5bd7913e24f37b86e404d21dfb", "score": "0.6551556", "text": "function django(hljs) {\n const FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name:\n 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +\n 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +\n 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +\n 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +\n 'dictsortreversed default_if_none pluralize lower join center default ' +\n 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +\n 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +\n 'localtime utc timezone'\n },\n contains: [\n hljs.QUOTE_STRING_MODE,\n hljs.APOS_STRING_MODE\n ]\n };\n\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n hljs.COMMENT(/\\{%\\s*comment\\s*%\\}/, /\\{%\\s*endcomment\\s*%\\}/),\n hljs.COMMENT(/\\{#/, /#\\}/),\n {\n className: 'template-tag',\n begin: /\\{%/,\n end: /%\\}/,\n contains: [{\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name:\n 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +\n 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' +\n 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' +\n 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +\n 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +\n 'plural get_current_language language get_available_languages ' +\n 'get_current_language_bidi get_language_info get_language_info_list localize ' +\n 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' +\n 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [FILTER]\n }\n ]\n };\n }", "title": "" }, { "docid": "f0f13cdd993ccbe1ec12dbd16ab10070", "score": "0.64861506", "text": "function django(hljs) {\n var FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name: \"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags \" + \"filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands \" + \"title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode \" + \"timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort \" + \"dictsortreversed default_if_none pluralize lower join center default \" + \"truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first \" + \"escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize \" + \"localtime utc timezone\"\n },\n contains: [ hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE ]\n };\n return {\n name: \"Django\",\n aliases: [ \"jinja\" ],\n case_insensitive: true,\n subLanguage: \"xml\",\n contains: [ hljs.COMMENT(/\\{%\\s*comment\\s*%}/, /\\{%\\s*endcomment\\s*%}/), hljs.COMMENT(/\\{#/, /#}/), {\n className: \"template-tag\",\n begin: /\\{%/,\n end: /%}/,\n contains: [ {\n className: \"name\",\n begin: /\\w+/,\n keywords: {\n name: \"comment endcomment load templatetag ifchanged endifchanged if endif firstof for \" + \"endfor ifnotequal endifnotequal widthratio extends include spaceless \" + \"endspaceless regroup ifequal endifequal ssi now with cycle url filter \" + \"endfilter debug block endblock else autoescape endautoescape csrf_token empty elif \" + \"endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix \" + \"plural get_current_language language get_available_languages \" + \"get_current_language_bidi get_language_info get_language_info_list localize \" + \"endlocalize localtime endlocaltime timezone endtimezone get_current_timezone \" + \"verbatim\"\n },\n starts: {\n endsWithParent: true,\n keywords: \"in by as\",\n contains: [ FILTER ],\n relevance: 0\n }\n } ]\n }, {\n className: \"template-variable\",\n begin: /\\{\\{/,\n end: /}}/,\n contains: [ FILTER ]\n } ]\n };\n }", "title": "" }, { "docid": "f4d874e45092efe4479548bae0fceea5", "score": "0.6418394", "text": "function django(hljs) {\n const FILTER = {\n begin: /\\|[A-Za-z]+:?/,\n keywords: {\n name: 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' + 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' + 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' + 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' + 'dictsortreversed default_if_none pluralize lower join center default ' + 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' + 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' + 'localtime utc timezone'\n },\n contains: [hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE]\n };\n return {\n name: 'Django',\n aliases: ['jinja'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [hljs.COMMENT(/\\{%\\s*comment\\s*%\\}/, /\\{%\\s*endcomment\\s*%\\}/), hljs.COMMENT(/\\{#/, /#\\}/), {\n className: 'template-tag',\n begin: /\\{%/,\n end: /%\\}/,\n contains: [{\n className: 'name',\n begin: /\\w+/,\n keywords: {\n name: 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' + 'endfor ifnotequal endifnotequal widthratio extends include spaceless ' + 'endspaceless regroup ifequal endifequal ssi now with cycle url filter ' + 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' + 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' + 'plural get_current_language language get_available_languages ' + 'get_current_language_bidi get_language_info get_language_info_list localize ' + 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone ' + 'verbatim'\n },\n starts: {\n endsWithParent: true,\n keywords: 'in by as',\n contains: [FILTER],\n relevance: 0\n }\n }]\n }, {\n className: 'template-variable',\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [FILTER]\n }]\n };\n}", "title": "" }, { "docid": "6bc02d90f071f70579bf8e2b278e57f9", "score": "0.6194541", "text": "_highlight() {\n let lang = this.get('lang');\n\n schedule('afterRender', () => {\n //Get raw txt\n let raw = `\\n${this.$().find('.code').text().trim()}\\n`;\n let numbers = this.get('withLineNumbers');\n\n //Syntax instance\n let syntax = highlight(raw, {\n hljs: hljs,\n lang: lang,\n start: Number(numbers),\n });\n\n //output formatted\n this.set('code', syntax);\n });\n\n }", "title": "" }, { "docid": "70669986b5cdb43ab83e2f41f1a4ca20", "score": "0.596328", "text": "function syntaxHighlight(json) {\n json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); // basic html escaping\n return json\n .replace(/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g, function (match) {\n var cls = 'red';\n if (/^\"/.test(match)) {\n if (/:$/.test(match)) {\n cls = 'blue';\n } else {\n cls = 'green';\n }\n } else if (/true|false/.test(match)) {\n cls = 'Sienna';\n } else if (/null/.test(match)) {\n cls = 'gray';\n }\n return '<span style=\"color:' + cls + ';\">' + match + '</span>';\n })\n .replace(/\\t/g,\"&nbsp;&nbsp;\") // to keep indentation in html\n .replace(/\\n/g,\"<br/>\"); // to keep line break in html\n }", "title": "" }, { "docid": "402a0fd179487585f69a0a2c581271b9", "score": "0.5919349", "text": "static highlightSql(sql) {\n return sql;\n }", "title": "" }, { "docid": "f32b3cfeac6f35557cfc5bbcba17538c", "score": "0.58341366", "text": "function highlight(name,value,ignore_illegals,continuation){function subMode(lexeme,mode){var i,length;for(i=0,length=mode.contains.length;i<length;i++){if(testRe(mode.contains[i].beginRe,lexeme)){return mode.contains[i];}}}function endOfMode(mode,lexeme){if(testRe(mode.endRe,lexeme)){while(mode.endsParent&&mode.parent){mode=mode.parent;}return mode;}if(mode.endsWithParent){return endOfMode(mode.parent,lexeme);}}function isIllegal(lexeme,mode){return!ignore_illegals&&testRe(mode.illegalRe,lexeme);}function keywordMatch(mode,match){var match_str=language.case_insensitive?match[0].toLowerCase():match[0];return mode.keywords.hasOwnProperty(match_str)&&mode.keywords[match_str];}function buildSpan(classname,insideSpan,leaveOpen,noPrefix){var classPrefix=noPrefix?'':options.classPrefix,openSpan='<span class=\"'+classPrefix,closeSpan=leaveOpen?'':spanEndTag;openSpan+=classname+'\">';return openSpan+insideSpan+closeSpan;}function processKeywords(){var keyword_match,last_index,match,result;if(!top.keywords)return escape(mode_buffer);result='';last_index=0;top.lexemesRe.lastIndex=0;match=top.lexemesRe.exec(mode_buffer);while(match){result+=escape(mode_buffer.substring(last_index,match.index));keyword_match=keywordMatch(top,match);if(keyword_match){relevance+=keyword_match[1];result+=buildSpan(keyword_match[0],escape(match[0]));}else{result+=escape(match[0]);}last_index=top.lexemesRe.lastIndex;match=top.lexemesRe.exec(mode_buffer);}return result+escape(mode_buffer.substr(last_index));}function processSubLanguage(){var explicit=typeof top.subLanguage==='string';if(explicit&&!languages[top.subLanguage]){return escape(mode_buffer);}var result=explicit?highlight(top.subLanguage,mode_buffer,true,continuations[top.subLanguage]):highlightAuto(mode_buffer,top.subLanguage.length?top.subLanguage:undefined);// Counting embedded language score towards the host language may be disabled\n// with zeroing the containing mode relevance. Usecase in point is Markdown that\n// allows XML everywhere and makes every XML snippet to have a much larger Markdown\n// score.\nif(top.relevance>0){relevance+=result.relevance;}if(explicit){continuations[top.subLanguage]=result.top;}return buildSpan(result.language,result.value,false,true);}function processBuffer(){result+=top.subLanguage!=null?processSubLanguage():processKeywords();mode_buffer='';}function startNewMode(mode){result+=mode.className?buildSpan(mode.className,'',true):'';top=Object.create(mode,{parent:{value:top}});}function processLexeme(buffer,lexeme){mode_buffer+=buffer;if(lexeme==null){processBuffer();return 0;}var new_mode=subMode(lexeme,top);if(new_mode){if(new_mode.skip){mode_buffer+=lexeme;}else{if(new_mode.excludeBegin){mode_buffer+=lexeme;}processBuffer();if(!new_mode.returnBegin&&!new_mode.excludeBegin){mode_buffer=lexeme;}}startNewMode(new_mode,lexeme);return new_mode.returnBegin?0:lexeme.length;}var end_mode=endOfMode(top,lexeme);if(end_mode){var origin=top;if(origin.skip){mode_buffer+=lexeme;}else{if(!(origin.returnEnd||origin.excludeEnd)){mode_buffer+=lexeme;}processBuffer();if(origin.excludeEnd){mode_buffer=lexeme;}}do{if(top.className){result+=spanEndTag;}if(!top.skip){relevance+=top.relevance;}top=top.parent;}while(top!==end_mode.parent);if(end_mode.starts){startNewMode(end_mode.starts,'');}return origin.returnEnd?0:lexeme.length;}if(isIllegal(lexeme,top))throw new Error('Illegal lexeme \"'+lexeme+'\" for mode \"'+(top.className||'<unnamed>')+'\"');/*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */mode_buffer+=lexeme;return lexeme.length||1;}var language=getLanguage(name);if(!language){throw new Error('Unknown language: \"'+name+'\"');}compileLanguage(language);var top=continuation||language;var continuations={};// keep continuations for sub-languages\nvar result='',current;for(current=top;current!==language;current=current.parent){if(current.className){result=buildSpan(current.className,'',true)+result;}}var mode_buffer='';var relevance=0;try{var match,count,index=0;while(true){top.terminators.lastIndex=index;match=top.terminators.exec(value);if(!match)break;count=processLexeme(value.substring(index,match.index),match[0]);index=match.index+count;}processLexeme(value.substr(index));for(current=top;current.parent;current=current.parent){// close dangling modes\nif(current.className){result+=spanEndTag;}}return{relevance:relevance,value:result,language:name,top:top};}catch(e){if(e.message&&e.message.indexOf('Illegal')!==-1){return{relevance:0,value:escape(value)};}else{throw e;}}}", "title": "" }, { "docid": "422b27f57ec12f13aa8e98461f8686d2", "score": "0.582438", "text": "function syntaxHighlight(json) {\n if(json == null)\n return;\n\tjson = JSON.stringify(json, undefined, 2)\n\tjson = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n var syntaxedJson = json.replace(/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g, function (match) {\n \tvar cls = 'number';\n if (/^\"/.test(match)) {\n if (/:$/.test(match)) {\n cls = 'key';\n } else {\n cls = 'string';\n }\n } else if (/true|false/.test(match)) {\n cls = 'boolean';\n } else if (/null/.test(match)) {\n cls = 'null';\n }\n\n if(cls == 'key'){\n \tmatch = match.replace(/\"/g,'');\n \treturn '<span class=\"' + cls + '\">' + match + '</span>';\n }\n return '<span class=\"' + cls + '\">' + match + '</span>';\n });\n\n syntaxedJson = syntaxedJson.replace(/\\]/g, ']</span></span>');\n syntaxedJson = syntaxedJson.replace(/\\[/g, '<span class=\"preBlock\"><i class=\"icon-minus\"></i><span class=\"collapsed hide\"> [...]</span><span class=\"expanded\"> [');\n\n syntaxedJson = syntaxedJson.replace(/\\}/g, '}</span></span>');\n syntaxedJson = syntaxedJson.replace(/\\{/g, '<span class=\"preBlock\"><i class=\"icon-minus\"></i><span class=\"collapsed hide\"> {...}</span><span class=\"expanded\"> {');\n \n return syntaxedJson;\n}", "title": "" }, { "docid": "a544eae6145c9ac98637eee8c4af0a3a", "score": "0.57764435", "text": "syntaxHighlight(passedJson) {\n\t\tlet json = passedJson;\n\t\tif (typeof json !== 'string') {\n\t\t\tjson = JSON.stringify(json, undefined, 2);\n\t\t}\n\t\tjson = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n\t\treturn json.replace(/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g, (match) => {\n\t\t\tlet cls = 'number';\n\t\t\tlet stl = 'darkorange';\n\t\t\tif (/^\"/.test(match)) {\n\t\t\t\tif (/:$/.test(match)) {\n\t\t\t\t\tcls = 'key';\n\t\t\t\t\tstl = 'red';\n\t\t\t\t} else {\n\t\t\t\t\tcls = 'string';\n\t\t\t\t\tstl = 'green';\n\t\t\t\t}\n\t\t\t} else if (/true|false/.test(match)) {\n\t\t\t\tcls = 'boolean';\n\t\t\t\tstl = 'blue';\n\t\t\t} else if (/null/.test(match)) {\n\t\t\t\tcls = 'null';\n\t\t\t\tstl = 'magenta';\n\t\t\t}\n\n\t\t\treturn `<span class=\"${cls}\" style=\"color: ${stl}\">${match}</span>`;\n\t\t});\n\t}", "title": "" }, { "docid": "2ab09569aa251c953ef5c8959fd94c0d", "score": "0.5758588", "text": "function syntaxHighlight(json) {\r\n if (getIsDebugJSONVisible()){\r\n $('#result').html('');\r\n if (typeof json != 'string') {\r\n json = JSON.stringify(json, undefined, 2);\r\n }\r\n json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\r\n $('#JSONResult').show();\r\n return json.replace(/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g, function (match) {\r\n var cls = 'number';\r\n if (/^\"/.test(match)) {\r\n if (/:$/.test(match)) {\r\n cls = 'key';\r\n } else {\r\n cls = 'string';\r\n }\r\n } else if (/true|false/.test(match)) {\r\n cls = 'boolean';\r\n } else if (/null/.test(match)) {\r\n cls = 'null';\r\n }\r\n return '<span class=\"' + cls + '\">' + match + '</span>';\r\n });\r\n }\r\n}", "title": "" }, { "docid": "47946655e199c7c9b9abfe8d4fdcf5ef", "score": "0.57360965", "text": "function highlight(js) {\n return js\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\\/\\/(.*)/gm, '<span class=\"comment\">//$1</span>')\n .replace(/('.*?')/gm, '<span class=\"string\">$1</span>')\n .replace(/(\\d+\\.\\d+)/gm, '<span class=\"number\">$1</span>')\n .replace(/(\\d+)/gm, '<span class=\"number\">$1</span>')\n .replace(/\\bnew *(\\w+)/gm, '<span class=\"keyword\">new</span> <span class=\"init\">$1</span>')\n .replace(/\\b(function|new|throw|return|var|if|else)\\b/gm, '<span class=\"keyword\">$1</span>')\n }", "title": "" }, { "docid": "9acda476aa605ad783eaad89b8e30458", "score": "0.5661791", "text": "function javascript(hljs) {\n var IDENT_RE$1$1 = IDENT_RE$1;\n var FRAGMENT = {\n begin: \"<>\",\n end: \"</>\"\n };\n var XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/\n };\n var KEYWORDS$1 = {\n $pattern: IDENT_RE$1,\n keyword: KEYWORDS$2.join(\" \"),\n literal: LITERALS$2.join(\" \"),\n built_in: BUILT_INS$2.join(\" \")\n };\n var NUMBER = {\n className: \"number\",\n variants: [ {\n begin: \"\\\\b(0[bB][01]+)n?\"\n }, {\n begin: \"\\\\b(0[oO][0-7]+)n?\"\n }, {\n begin: hljs.C_NUMBER_RE + \"n?\"\n } ],\n relevance: 0\n };\n var SUBST = {\n className: \"subst\",\n begin: \"\\\\$\\\\{\",\n end: \"\\\\}\",\n keywords: KEYWORDS$1,\n contains: []\n };\n var HTML_TEMPLATE = {\n begin: \"html`\",\n end: \"\",\n starts: {\n end: \"`\",\n returnEnd: false,\n contains: [ hljs.BACKSLASH_ESCAPE, SUBST ],\n subLanguage: \"xml\"\n }\n };\n var CSS_TEMPLATE = {\n begin: \"css`\",\n end: \"\",\n starts: {\n end: \"`\",\n returnEnd: false,\n contains: [ hljs.BACKSLASH_ESCAPE, SUBST ],\n subLanguage: \"css\"\n }\n };\n var TEMPLATE_STRING = {\n className: \"string\",\n begin: \"`\",\n end: \"`\",\n contains: [ hljs.BACKSLASH_ESCAPE, SUBST ]\n };\n SUBST.contains = [ hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, HTML_TEMPLATE, CSS_TEMPLATE, TEMPLATE_STRING, NUMBER, hljs.REGEXP_MODE ];\n var PARAMS_CONTAINS = SUBST.contains.concat([ \n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [ \"self\" ].concat(SUBST.contains, [ hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE ])\n }, hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE ]);\n var PARAMS = {\n className: \"params\",\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n contains: PARAMS_CONTAINS\n };\n return {\n name: \"JavaScript\",\n aliases: [ \"js\", \"jsx\", \"mjs\", \"cjs\" ],\n keywords: KEYWORDS$1,\n contains: [ hljs.SHEBANG({\n binary: \"node\",\n relevance: 5\n }), {\n className: \"meta\",\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n }, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, HTML_TEMPLATE, CSS_TEMPLATE, TEMPLATE_STRING, hljs.C_LINE_COMMENT_MODE, hljs.COMMENT(\"/\\\\*\\\\*\", \"\\\\*/\", {\n relevance: 0,\n contains: [ {\n className: \"doctag\",\n begin: \"@[A-Za-z]+\",\n contains: [ {\n className: \"type\",\n begin: \"\\\\{\",\n end: \"\\\\}\",\n relevance: 0\n }, {\n className: \"variable\",\n begin: IDENT_RE$1$1 + \"(?=\\\\s*(-)|$)\",\n endsParent: true,\n relevance: 0\n }, \n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n } ]\n } ]\n }), hljs.C_BLOCK_COMMENT_MODE, NUMBER, {\n // object attr container\n begin: concat(/[{,\\n]\\s*/, \n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*)|(\\/\\*(.|\\n)*\\*\\/))\\s*)*/, IDENT_RE$1$1 + \"\\\\s*:\"))),\n relevance: 0,\n contains: [ {\n className: \"attr\",\n begin: IDENT_RE$1$1 + lookahead(\"\\\\s*:\"),\n relevance: 0\n } ]\n }, {\n // \"value\" container\n begin: \"(\" + hljs.RE_STARTERS_RE + \"|\\\\b(case|return|throw)\\\\b)\\\\s*\",\n keywords: \"return throw case\",\n contains: [ hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, hljs.REGEXP_MODE, {\n className: \"function\",\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: \"(\\\\([^(]*\" + \"(\\\\([^(]*\" + \"(\\\\([^(]*\" + \"\\\\))?\" + \"\\\\))?\" + \"\\\\)|\" + hljs.UNDERSCORE_IDENT_RE + \")\\\\s*=>\",\n returnBegin: true,\n end: \"\\\\s*=>\",\n contains: [ {\n className: \"params\",\n variants: [ {\n begin: hljs.UNDERSCORE_IDENT_RE\n }, {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n }, {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n } ]\n } ]\n }, {\n // could be a comma delimited list of params to a function call\n begin: /,/,\n relevance: 0\n }, {\n className: \"\",\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n }, {\n // JSX\n variants: [ {\n begin: FRAGMENT.begin,\n end: FRAGMENT.end\n }, {\n begin: XML_TAG.begin,\n end: XML_TAG.end\n } ],\n subLanguage: \"xml\",\n contains: [ {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: [ \"self\" ]\n } ]\n } ],\n relevance: 0\n }, {\n className: \"function\",\n beginKeywords: \"function\",\n end: /\\{/,\n excludeEnd: true,\n contains: [ hljs.inherit(hljs.TITLE_MODE, {\n begin: IDENT_RE$1$1\n }), PARAMS ],\n illegal: /\\[|%/\n }, {\n begin: /\\$[(.]/\n }, hljs.METHOD_GUARD, {\n // ES6 class\n className: \"class\",\n beginKeywords: \"class\",\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"\\[\\]]/,\n contains: [ {\n beginKeywords: \"extends\"\n }, hljs.UNDERSCORE_TITLE_MODE ]\n }, {\n beginKeywords: \"constructor\",\n end: /\\{/,\n excludeEnd: true\n }, {\n begin: \"(get|set)\\\\s+(?=\" + IDENT_RE$1$1 + \"\\\\()\",\n end: /{/,\n keywords: \"get set\",\n contains: [ hljs.inherit(hljs.TITLE_MODE, {\n begin: IDENT_RE$1$1\n }), {\n begin: /\\(\\)/\n }, // eat to avoid empty params\n PARAMS ]\n } ],\n illegal: /#(?!!)/\n };\n }", "title": "" }, { "docid": "90b70c55af058d901ad66c373fb932c0", "score": "0.56493855", "text": "function highlight_term(value, term) {\n\t\t\t\treturn value.replace(new RegExp(\"(?![^&;]+;)(?!<[^<>]*)(\" + term + \")(?![^<>]*>)(?![^&;]+;)\", \"gi\"), \"<b>$1</b>\");\n\t\t\t}", "title": "" }, { "docid": "f68b21f4597fc2f6ace6875a8f526780", "score": "0.56355524", "text": "function razor(hljs) {\n var razor_comment = hljs.COMMENT(\"@\\\\*\", \"\\\\*@\", {\n relevance: 10\n });\n var razor_line = {\n begin: \"@[a-zA-Z]+\",\n returnBegin: true,\n end: \"(</?[a-zA-Z])|$\",\n returnEnd: true,\n className: \"razor-line\",\n subLanguage: \"cs\",\n contains: [ {\n begin: \"@\",\n className: \"symbol\"\n } ]\n };\n var simple_xml_bloc = {\n begin: \"</?[a-zA-Z]\",\n end: \">\",\n className: \"simple-xml-block\",\n subLanguage: \"xml\",\n contains: [ {\n begin: '\"@\\\\(',\n excludeBegin: true,\n end: '\\\\)\"',\n excludeEnd: true,\n className: \"razor-code-surrounded-by-parenthesis-in-xml-attr-value\",\n subLanguage: \"cs\"\n }, {\n begin: '\"@',\n excludeBegin: true,\n end: '\"',\n excludeEnd: true,\n className: \"razor-code-in-xml-attr-value\",\n subLanguage: \"cs\"\n } ]\n };\n var razor_bloc = {\n begin: \"((@[a-z]+)|(else))\\\\s?(\\\\(.+\\\\))?\\\\r?\\\\n?\\\\s*{\",\n returnBegin: true,\n end: \"^}\",\n className: \"razor-block\",\n subLanguage: \"cs\",\n contains: [ {\n begin: \"@(code|functions)?\",\n className: \"symbol\"\n }, simple_xml_bloc ]\n };\n var xml_bloc = hljs.inherit(simple_xml_bloc, {\n className: \"xml-block\",\n contains: simple_xml_bloc.contains.concat([ {\n begin: \"@\",\n className: \"symbol\"\n }, {\n begin: \"@[a-z]+ (\\\\(.+\\\\))?\\\\r?\\\\n?\\\\s*{\",\n returnBegin: true,\n end: \"}\",\n subLanguage: \"cs\",\n contains: [ {\n begin: \"@[a-z]+\",\n className: \"name\"\n }, {\n begin: \"<[a-z]\",\n end: \"}\",\n excludeEnd: true,\n subLanguage: \"xml\"\n } ]\n } ])\n });\n // @page, @inject, @inherits\n var razor_directives = {\n begin: \"@[a-z]+\\\\s\",\n returnBegin: true,\n end: \"$\",\n className: \"razor-directives\",\n subLanguage: \"cs\",\n contains: [ {\n begin: \"@[a-z]+\",\n className: \"name\"\n } ]\n };\n return {\n aliases: [ \"razor\", \"blazor\" ],\n keywords: \"@\",\n contains: [ razor_comment, xml_bloc, razor_bloc, razor_directives, razor_line ]\n };\n }", "title": "" }, { "docid": "b175421dc53bcb9381036340804e0ca1", "score": "0.5620289", "text": "function CustomHighlight() {}", "title": "" }, { "docid": "67a612d3259e18af132a74bdef7c5675", "score": "0.5616072", "text": "function syntaxHighlight(json) {\n if (typeof json != 'string') {\n json = JSON.stringify(json, undefined, 2);\n }\n json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n return json.replace(/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g, function (match) {\n let cls = 'number';\n if (/^\"/.test(match)) {\n if (/:$/.test(match)) {\n cls = 'key';\n } else {\n cls = 'string';\n }\n } else if (/true|false/.test(match)) {\n cls = 'boolean';\n } else if (/null/.test(match)) {\n cls = 'null';\n }\n return '<span class=\"' + cls + '\">' + match + '</span>';\n });\n}", "title": "" }, { "docid": "885ab24a2d4c91604b2ff25111cf8e2e", "score": "0.5574626", "text": "function highlight() {\n\t\t\t$('pre code').each(function(i, e) {\n\t\t\t\thljs.highlightBlock(e)\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "e6dfb2dd2bb4a04dae6a95c7c3f2be22", "score": "0.5546067", "text": "function highlight() {\n document.querySelectorAll('pre code').forEach((block) => {\n var code = Prism.highlight(block.innerHTML, Prism.languages.javascript, 'javascript');\n block.innerHTML = code;\n });\n}", "title": "" }, { "docid": "07ee41e0ad26cd11a36a9760be6979f0", "score": "0.55361044", "text": "function razor$1(hljs) {\n var razor_comment = hljs.COMMENT(\"@\\\\*\", \"\\\\*@\", {\n relevance: 10\n });\n var razor_line = {\n begin: \"@[a-zA-Z]+\",\n returnBegin: true,\n end: \"(</?[a-zA-Z])|$\",\n returnEnd: true,\n className: \"razor-line\",\n subLanguage: \"cs\",\n contains: [ {\n begin: \"@\",\n className: \"symbol\"\n } ]\n };\n var simple_xml_bloc = {\n begin: \"</?[a-zA-Z]\",\n end: \">\",\n className: \"simple-xml-block\",\n subLanguage: \"xml\",\n contains: [ {\n begin: '\"@\\\\(',\n excludeBegin: true,\n end: '\\\\)\"',\n excludeEnd: true,\n className: \"razor-code-surrounded-by-parenthesis-in-xml-attr-value\",\n subLanguage: \"cs\"\n }, {\n begin: '\"@',\n excludeBegin: true,\n end: '\"',\n excludeEnd: true,\n className: \"razor-code-in-xml-attr-value\",\n subLanguage: \"cs\"\n } ]\n };\n var razor_bloc = {\n begin: \"((@[a-z]+)|(else))\\\\s?(\\\\(.+\\\\))?\\\\r?\\\\n?\\\\s*{\",\n returnBegin: true,\n end: \"^}\",\n className: \"razor-block\",\n subLanguage: \"cs\",\n contains: [ {\n begin: \"@(code|functions)?\",\n className: \"symbol\"\n }, simple_xml_bloc ]\n };\n var xml_bloc = hljs.inherit(simple_xml_bloc, {\n className: \"xml-block\",\n contains: simple_xml_bloc.contains.concat([ {\n begin: \"@\",\n className: \"symbol\"\n }, {\n begin: \"@[a-z]+ (\\\\(.+\\\\))?\\\\r?\\\\n?\\\\s*{\",\n returnBegin: true,\n end: \"}\",\n subLanguage: \"cs\",\n contains: [ {\n begin: \"@[a-z]+\",\n className: \"name\"\n }, {\n begin: \"<[a-z]\",\n end: \"}\",\n excludeEnd: true,\n subLanguage: \"xml\"\n } ]\n } ])\n });\n // @page, @inject, @inherits\n var razor_directives = {\n begin: \"@[a-z]+\\\\s\",\n returnBegin: true,\n end: \"$\",\n className: \"razor-directives\",\n subLanguage: \"cs\",\n contains: [ {\n begin: \"@[a-z]+\",\n className: \"name\"\n } ]\n };\n return {\n aliases: [ \"razor\", \"blazor\" ],\n keywords: \"@\",\n contains: [ razor_comment, xml_bloc, razor_bloc, razor_directives, razor_line ]\n };\n }", "title": "" }, { "docid": "ba00a6853dbc2e286f4ed074f5b45ae7", "score": "0.553527", "text": "function highlightTerms(term) {\n console.log('highlighting: ', term);\n var src_str = $(\"#pre-show-source\").html();\n\n term = term.replace(/(\\s+)/,\"(<[^>]+>)*$1(<[^>]+>)*\");\n var pattern = new RegExp(\"(\"+term+\")\", \"gi\");\n\n src_str = src_str.replace(pattern, \"<mark>$1</mark>\");\n src_str = src_str.replace(/(<mark>[^<>]*)((<[^>]+>)+)([^<>]*<\\/mark>)/,\"$1</mark>$2<mark>$4\");\n\n $(\"#pre-show-source\").html(src_str);\n }", "title": "" }, { "docid": "ef5b387af325697fe70c6e54a9a2627a", "score": "0.5527417", "text": "function highlight(language, value, options) {\n var settings = options || {}\n var prefix = settings.prefix\n\n if (prefix === null || prefix === undefined) {\n prefix = defaultPrefix\n }\n\n return normalize(coreHighlight(language, value, true, prefix))\n}", "title": "" }, { "docid": "ef5b387af325697fe70c6e54a9a2627a", "score": "0.5527417", "text": "function highlight(language, value, options) {\n var settings = options || {}\n var prefix = settings.prefix\n\n if (prefix === null || prefix === undefined) {\n prefix = defaultPrefix\n }\n\n return normalize(coreHighlight(language, value, true, prefix))\n}", "title": "" }, { "docid": "ef5b387af325697fe70c6e54a9a2627a", "score": "0.5527417", "text": "function highlight(language, value, options) {\n var settings = options || {}\n var prefix = settings.prefix\n\n if (prefix === null || prefix === undefined) {\n prefix = defaultPrefix\n }\n\n return normalize(coreHighlight(language, value, true, prefix))\n}", "title": "" }, { "docid": "181acfe7da0d6ee9dfeadbcd3f693b75", "score": "0.5524715", "text": "function highlightKeywords() {\n var varClass = \"cm-variable\";\n\n var vars = jQuery(\".\" + varClass);\n\n for (var i = 0; i < vars.length; i++) {\n if (checkToken(vars[i].textContent)) {\n jQuery(vars[i]).removeClass(varClass);\n }\n }\n }", "title": "" }, { "docid": "81d8b53643eb184c71b1ead11e5c98d1", "score": "0.5429558", "text": "function highlight_term(value, term) {\n value = value.replace(/\\\\/g, \"\");\n return value.replace(new RegExp(\"(?![^&;]+;)(?!<[^<>]*)(\" + term + \")(?![^<>]*>)(?![^&;]+;)\", \"gi\"), \"<b>$1</b>\");\n }", "title": "" }, { "docid": "b78b3be0f6c3c33c77b16f808f9b0d31", "score": "0.54132086", "text": "highlight(str, lang) {\n\t\tif(lang && hl.getLanguage(lang)) {\n\t\t\ttry {\n\t\t\t\treturn `<pre><code class=\"lang-${lang}\">` +\n\t\t\t\t\thl.highlight(lang, str, true).value +\n\t\t\t\t\"</code></pre>\"\n\t\t\t}\n\t\t\tcatch(e) {}\n\t\t}\n\t\treturn `<pre><code class=\"lang-${lang}\">` +\n\t\t\tmd.utils.escapeHtml(str) + \"</code></pre>\";\n\t}", "title": "" }, { "docid": "a363eb35df94efd155bed9c74f0f5875", "score": "0.54010695", "text": "function handlebars(hljs) {\n var BUILT_INS = {\n \"builtin-name\": \"action bindattr collection component concat debugger \" + \"each each-in get hash if in input link-to loc log lookup \" + \"mut outlet partial query-params render template textarea unbound \" + \"unless view with yield\"\n };\n var LITERALS = {\n literal: \"true false undefined null\"\n };\n // as defined in https://handlebarsjs.com/guide/expressions.html#literal-segments\n // this regex matches literal segments like ' abc ' or [ abc ] as well as helpers and paths\n // like a/b, ./abc/cde, and abc.bcd\n var IDENFIFIER_REGEX = /(\".*?\"|'.*?'|\\[.*?\\]|[^\\s!\"#%&'()*+,.\\/;<=>@\\[\\\\\\]^`{|}~]+|\\.|\\/)+/;\n // identifier followed by a equal-sign (without the equal sign)\n var HASH_PARAM_REGEX = /(\".*?\"|'.*?'|\\[.*?\\]|[^\\s!\"#%&'()*+,.\\/;<=>@\\[\\\\\\]^`{|}~]+)(?==)/;\n var HELPER_NAME_OR_PATH_EXPRESSION = {\n begin: IDENFIFIER_REGEX,\n lexemes: /[\\w.\\/]+/\n };\n var HELPER_PARAMETER = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n keywords: LITERALS\n });\n var SUB_EXPRESSION = {\n illegal: /\\}\\}/,\n begin: /\\(/,\n end: /\\)/\n };\n var HASH = {\n // fka \"attribute-assignment\", parameters of the form 'key=value'\n className: \"attr\",\n illegal: /\\}\\}/,\n begin: HASH_PARAM_REGEX,\n relevance: 0,\n starts: {\n begin: /=/,\n end: /=/,\n starts: {\n contains: [ hljs.NUMBER_MODE, hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE, HELPER_PARAMETER, SUB_EXPRESSION ]\n }\n }\n };\n var BLOCK_PARAMS = {\n // parameters of the form '{{#with x as | y |}}...{{/with}}'\n begin: /as\\s+\\|/,\n keywords: {\n keyword: \"as\"\n },\n end: /\\|/,\n contains: [ {\n // define sub-mode in order to prevent highlighting of block-parameter named \"as\"\n begin: /\\w+/,\n keywords: \"\"\n } ]\n };\n var HELPER_PARAMETERS = {\n contains: [ hljs.NUMBER_MODE, hljs.QUOTE_STRING_MODE, hljs.APOS_STRING_MODE, BLOCK_PARAMS, HASH, HELPER_PARAMETER, SUB_EXPRESSION ],\n returnEnd: true\n };\n var SUB_EXPRESSION_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n className: \"name\",\n keywords: BUILT_INS,\n starts: hljs.inherit(HELPER_PARAMETERS, {\n end: /\\)/\n })\n });\n SUB_EXPRESSION.contains = [ SUB_EXPRESSION_CONTENTS ];\n var OPENING_BLOCK_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n keywords: BUILT_INS,\n className: \"name\",\n starts: hljs.inherit(HELPER_PARAMETERS, {\n end: /}}/\n })\n });\n var CLOSING_BLOCK_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n keywords: BUILT_INS,\n className: \"name\"\n });\n var BASIC_MUSTACHE_CONTENTS = hljs.inherit(HELPER_NAME_OR_PATH_EXPRESSION, {\n className: \"name\",\n keywords: BUILT_INS,\n starts: hljs.inherit(HELPER_PARAMETERS, {\n end: /}}/\n })\n });\n var ESCAPE_MUSTACHE_WITH_PRECEEDING_BACKSLASH = {\n begin: /\\\\\\{\\{/,\n skip: true\n };\n var PREVENT_ESCAPE_WITH_ANOTHER_PRECEEDING_BACKSLASH = {\n begin: /\\\\\\\\(?=\\{\\{)/,\n skip: true\n };\n return {\n name: \"Handlebars\",\n aliases: [ \"hbs\", \"html.hbs\", \"html.handlebars\", \"htmlbars\" ],\n case_insensitive: true,\n subLanguage: \"xml\",\n contains: [ ESCAPE_MUSTACHE_WITH_PRECEEDING_BACKSLASH, PREVENT_ESCAPE_WITH_ANOTHER_PRECEEDING_BACKSLASH, hljs.COMMENT(/\\{\\{!--/, /--\\}\\}/), hljs.COMMENT(/\\{\\{!/, /\\}\\}/), {\n // open raw block \"{{{{raw}}}} content not evaluated {{{{/raw}}}}\"\n className: \"template-tag\",\n begin: /\\{\\{\\{\\{(?!\\/)/,\n end: /\\}\\}\\}\\}/,\n contains: [ OPENING_BLOCK_MUSTACHE_CONTENTS ],\n starts: {\n end: /\\{\\{\\{\\{\\//,\n returnEnd: true,\n subLanguage: \"xml\"\n }\n }, {\n // close raw block\n className: \"template-tag\",\n begin: /\\{\\{\\{\\{\\//,\n end: /\\}\\}\\}\\}/,\n contains: [ CLOSING_BLOCK_MUSTACHE_CONTENTS ]\n }, {\n // open block statement\n className: \"template-tag\",\n begin: /\\{\\{#/,\n end: /\\}\\}/,\n contains: [ OPENING_BLOCK_MUSTACHE_CONTENTS ]\n }, {\n className: \"template-tag\",\n begin: /\\{\\{(?=else\\}\\})/,\n end: /\\}\\}/,\n keywords: \"else\"\n }, {\n // closing block statement\n className: \"template-tag\",\n begin: /\\{\\{\\//,\n end: /\\}\\}/,\n contains: [ CLOSING_BLOCK_MUSTACHE_CONTENTS ]\n }, {\n // template variable or helper-call that is NOT html-escaped\n className: \"template-variable\",\n begin: /\\{\\{\\{/,\n end: /\\}\\}\\}/,\n contains: [ BASIC_MUSTACHE_CONTENTS ]\n }, {\n // template variable or helper-call that is html-escaped\n className: \"template-variable\",\n begin: /\\{\\{/,\n end: /\\}\\}/,\n contains: [ BASIC_MUSTACHE_CONTENTS ]\n } ]\n };\n }", "title": "" }, { "docid": "6aa2aa8b0d24c0a842a709e94c98692d", "score": "0.53792685", "text": "function highlight(language, value, options) {\n var settings = options || {};\n var prefix = settings.prefix;\n\n if (prefix === null || prefix === undefined) {\n prefix = DEFAULT_PREFIX;\n }\n\n return normalize(coreHighlight(language, value, true, prefix));\n}", "title": "" }, { "docid": "b09ddb8baa2b74bf8a9c997ad8422c78", "score": "0.53756744", "text": "function applySyntax() {\n /* find all the <pre><code> blocks */\n var snippets = document.querySelectorAll('pre code');\n\n /* highlight each one */\n for (i = 0; i < snippets.length; i++) {\n /* get existing text */\n var text = snippets[i].textContent;\n \n /* apply the replacements */\n for (j = 0; j < keywords.length; j++) {\n var retext = \"\\\\b\" + keywords[j] + \"\\\\b\";\n var re = new RegExp(retext, \"g\");\n text = text.replace(re, \"<span class='tetra-key'>$&</span>\");\n }\n for (j = 0; j < types.length; j++) {\n var retext = \"\\\\b\" + types[j] + \"\\\\b\";\n var re = new RegExp(retext, \"g\");\n text = text.replace(re, \"<span class='tetra-type'>$&</span>\");\n }\n for (j = 0; j < builtins.length; j++) {\n var retext = \"\\\\b\" + builtins[j] + \"\\\\b\";\n var re = new RegExp(retext, \"g\");\n text = text.replace(re, \"<span class='tetra-builtin'>$&</span>\");\n }\n /* comments */\n text = text.replace(/#.*\\r?\\n/g, \"<span class='tetra-comment'>$&</span>\");\n text = text.replace(/#.*$/g, \"<span class='tetra-comment'>$&</span>\");\n\n /* strings */\n text = text.replace(/\"[^\"]*\"/g, \"<span class=\\\"tetra-value\\\">$&</span>\");\n\n /* numbers */\n text = text.replace(/\\b\\d+\\.\\d+\\b/g, \"<span class=\\\"tetra-value\\\">$&</span>\"); \n text = text.replace(/\\b\\d+\\b/g, \"<span class=\\\"tetra-value\\\">$&</span>\"); \n text = text.replace(/\\b(true|false)\\b/g, \"<span class=\\\"tetra-value\\\">$&</span>\"); \n\n /* write it back */\n snippets[i].innerHTML = text;\n }\n}", "title": "" }, { "docid": "8e75c028da87e9739f2d2de77123ae52", "score": "0.5374185", "text": "highlightInline(subTokens) {\n let pos = 0;\n const text = this.content.getBlockForKey(this.key).getText();\n const res = new Array(text.length);\n res.fill('mdSyntax');\n\n if (subTokens) {\n const styles = [];\n subTokens.forEach((st) => {\n switch (st.type) {\n case 'link_open': {\n const id = shortId().replace(/-/g, ':');\n [[, this.hrefs[id]]] = st.attrs;\n styles.push(`a:${id}`);\n break;\n }\n\n case 'em_open':\n case 'strong_open':\n styles.push(st.tag);\n break;\n\n case 's_open':\n styles.push('strike');\n break;\n\n case 'em_close':\n case 'link_close':\n case 's_close':\n case 'strong_close':\n styles.pop();\n break;\n\n case 'code_inline': {\n if (!st.content.length) break;\n let style = styles.join('-');\n if (!style) style = 'inlineCode';\n else style = `${style}-inlineCode`;\n pos = text.indexOf(st.content, pos);\n const end = pos + st.content.length;\n while (pos < end) {\n res[pos] = style;\n pos += 1;\n }\n break;\n }\n\n case 'text': {\n if (!st.content.length) break;\n pos = text.indexOf(st.content, pos);\n const end = pos + st.content.length;\n const style = styles.join('-') || 'text';\n while (pos < end) {\n res[pos] = style;\n pos += 1;\n }\n if (styles.length && _.last(styles).startsWith('a:')) {\n pos += 3 + _.last(styles).slice(2).length;\n }\n break;\n }\n\n default:\n }\n });\n }\n\n let i = text.length - 1;\n while (i >= 0 && text[i] === ' ') {\n res[i] = 'text';\n i -= 1;\n }\n while (i >= 0 && res[i] === 'mdSyntax') i -= 1;\n if (i < 0) res.fill('mdSyntax');\n\n const decorations = List(res);\n this.content = mergeBlockData(this.content, this.key, { decorations });\n }", "title": "" }, { "docid": "cbfb915e8243827aa1abafb7f757a248", "score": "0.53023934", "text": "function highlight( e, z, y ){ z = HSYN[z];\n\n // invalid scope array or target element?\n if(!z||!e||!e.nodeType==1){ return 0; }\n\n var // statement ends on line: 161\n\n l = y || 0, // name of current level in array\n a = [l], // scope list array\n s = z[l], // choose initial scope or 0 for top\n t = e, // target element for adding characters\n o, // scope level being evaluated\n c, // current term being built\n i, j, // iterators\n ua = false, // scope up after token completed?\n\n // truncated (one character) typeof check:\n ty = function(v,d){ return ((typeof v).charAt(0)==d); },\n\n // enter into a new scope level, child tag of the current:\n to = function(n){\n l = n; // name of the current level\n a.push(n); // add it to the scope depth\n s = z[n]; // select current scope from definition\n\n // create the tag associated with this scope depth and\n // set as target tag for pasting characters.\n t = t.appendChild(document.createElement(s.tg||'span'));\n // apply class and optional style attributes to the element.\n cl = s.cl || ''; if(cl){ t.setAttribute('class',cl); }\n st = s.st || ''; if(st){ t.setAttribute('style',st); } \n },\n\n // leave a scope level and re-enter the parent tag.\n // check 'id' on full literal completion.\n up = function(){ \n idm('id'); \n a.pop(); \n l = a[a.length-1]; \n s = z[l];\n t = t.parentNode; \n },\n\n // check scope tag contents for 'id' or 'ib', etc... matches:\n idm = function(w){\n // which type? id | ib\n // just selects name of property from definition.\n if(!w){ return 0; }\n // if the match of this scope is a function, call the\n // function with the target tag as a single argument.\n // the function can then analyse the tag with the term\n // to alter presentation accordingly.\n if(ty(s[w],'f')){ \n s[w](t,v); \n return 0; \n } \n // if the match is an object, each of the members will\n // be a table of terms, the first index holding an\n // operation to perform on the tag if a match from \n // this list is found.\n if(ty(s[w],'o')){ \n var k, l, x = null, v = t.textContent;\n // check for an (ip) initial processing function on this \n // scope and execute prior to checking any matches. \n // This can implement case insensitivity, etc...\n if(ty(s.ip,'f')){ v = s.ip(v); } \n // loop through the entire library of term classes.\n for(k=0; k<s[w].length; k++){\n // check each term in the library for a full match.\n for(l=1; l<s[w][k].length; l++){\n if(v==s[w][k][l]){\n // match found, store the operation to perform.\n x = s[w][k][0];\n // run the operation if it is a function, \n if(ty(x,'f')){ x(t); }\n // otherwise apply .class or styles from string\n // to the target element.\n else if(ty(x,'s')){\n if(x.charAt(0)=='.'){ \n t.setAttribute('class', x.substr(1)); \n } else {\n t.setAttribute('style', x); \n }\n } \n return 1; \n } \n } \n } \n } \n return 0; \n },\n\n // search array of scope children for new scope level:\n chl = function(){ \n var y;\n // check this scope's (ch) child scope list in order.\n // each scope will be evaluated as (o)...\n for(j=0; j<s.ch.length; j++){\n o = z[s.ch[j]];\n // check for (os) opening string, inclusive, that\n // opens this scope level.\n if(ty(o.os,'s') && at(i,o.os)){ \n to(s.ch[j]); \n y = o.os.length;\n c+=src.substr(i+1,y-1); \n i+=y-1; \n return 1; \n }\n // if the opening string is an array, check each\n // index in the array for an opener match.\n if(ty(o.os,'o')){ \n for(h=0; h<o.os.length; h++){\n if(at(i,o.os[h])){ \n to(s.ch[j]); \n y = o.os[h].length;\n c+=src.substr(i+1,y-1); \n i+=y-1; \n return 1; \n } \n } \n }\n // check opening characters if this scope may be\n // opened by a range of single characters.\n // provide a string and any characters within will\n // open this scope. (words, numbers, etc...)\n if(ty(o.oc,'s') && ch(o.oc)){ \n to(s.ch[j]); \n return 1; \n } \n } \n },\n\n // confirm string matches on the source (src) and char (c).\n // tests if the current pointer is at a sequence.\n at = function(p,m){ \n return (src.substr(p,m.length)==m); \n },\n\n // check that the current term (c) only contains characters\n // in the (h) haystack provided.\n ch = function(h){ \n for(var i=0; i<c.length; i++){\n if(h.indexOf(c.charAt(i))==-1){ return 0; } \n } \n return 1; \n },\n\n src = e.textContent; // END OF FIRST var...\n\n // wipe the contents of the target tag and prepare to \n // insert finished HTML. Reset up-after and fetch character.\n t.innerHTML = ''; \n for(i=0; i<src.length; i++){\n ua = false; \n c = src.charAt(i);\n // conditions that cause this scope to return up to the\n // previous scope immediately, excluding the character.\n // this will execute recursively up the nested scope\n // levels until one level allows the character.\n while(\n // check (cx) characters not allowed in scope.\n (ty(s.cx,'s') && ch(s.cx)) \n // check (cp) characters permitted. (negative)\n || (ty(s.cp,'s') && !ch(s.cp))\n // check (lm) character limit has been exceeded.\n || (ty(s.lm,'n') && t.textContent.length>s.lm-1))\n { up(); }\n // check (nd) discrete enders at current position.\n // these will up-scope after having printed, though.\n if(ty(s.nd,'s') && at((i-s.nd.length)+1, s.nd)){ ua = true; }\n // if the ender is an array, check all of the strings\n // provided and match any discrete ender.\n if(ty(s.nd,'o')){\n for(j=0; j<s.nd.length; j++){\n if(at((i-s.nd[j].length)+1, s.nd[j])){\n ua = true;\n break;\n }\n }\n }\n // searching all child scope levels for a new match...\n if(ty(s.ch,'o')){ chl(); }\n // escape HTML entities for output and add to current element:\n t.innerHTML+=(c.replace(/&/g,'&amp;').replace(/</g,'&lt;'));\n // up-scope if (ua) up-after is true.\n // otherwise, check (ib) instantly breaking matches,\n // for terms that will immediately terminate a literal.\n if(ua || idm('ib')){ up(); }\n } \n}", "title": "" }, { "docid": "0747288dc7803cb29f037d97f6bee506", "score": "0.5277498", "text": "function prismHighlighting() {\n try {\n let codeUsed = document.querySelector('pre code');\n if (codeUsed == null) return;\n\n let jsEle = document.createElement('script'),\n cssEle = document.createElement('link');\n jsEle.src = 'https://content.byui.edu/integ/gen/a40c34d7-9f6f-4a18-a41d-2f40e2b2a18e/0/codeHighlighter.js';\n cssEle.href = 'https://content.byui.edu/integ/gen/a40c34d7-9f6f-4a18-a41d-2f40e2b2a18e/0/codeHighlighter.css';\n cssEle.rel = 'stylesheet';\n document.head.appendChild(jsEle);\n document.head.appendChild(cssEle);\n\n } catch (prismErr) {\n console.error(prismErr);\n }\n }", "title": "" }, { "docid": "97971c691e8ea0d12d7df254dee4b5aa", "score": "0.52684146", "text": "function prettify() {\n function syntaxHighlight(json) {\n \tif(json && json !== \"\"){\n \t\tjson = JSON.stringify(JSON.parse(json),undefined,4);\n \t\tjson = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n \t\tjson = json.replace(/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g, function (match) {\n \t\t\tif (/^\"/.test(match)) {\n \t\t\t\tif (/:$/.test(match)) {\n \t\t\t\t\tmatch = '<span class=\"json-key\">' + match.replace(/\"/g,\"\") + '</span>';\n \t\t\t\t}else{\n \t\t\t\t\tmatch = match.replace(/\"/g,\"\");\n \t\t\t\t}\n \t\t\t}\n \t\t\treturn match;\n \t\t});\n \t\tjson = json.substring(1,json.length -1);\n \t\treturn json;\n \t}\n \telse {\n \t\treturn \"\";\n \t}\n }\n return syntaxHighlight;\n }", "title": "" }, { "docid": "a0cc467f9ab6f600d51227bc8a909b7f", "score": "0.52661276", "text": "function removeVars(val){return val.replace(/%(\\w+)/g,'');}// Create block/inline element to use for preview", "title": "" }, { "docid": "8cf0202a14d2587bf1f035f7c824ac92", "score": "0.5260724", "text": "set Highlight(value) {}", "title": "" }, { "docid": "3851d4ea866b32d230495e143b47e5fd", "score": "0.52050865", "text": "highlight(str)\n {\n return \"<span class='conSenseHighlight'>&nbsp;\" + str\n + \"&nbsp;</span>\";\n }", "title": "" }, { "docid": "ba51ded4b00ec76030aee348da09fdc9", "score": "0.5186523", "text": "function python(hljs) {\n var KEYWORDS = {\n keyword: \"and elif is global as in if from raise for except finally print import pass return \" + \"exec else break not with class assert yield try while continue del or def lambda \" + \"async await nonlocal|10\",\n built_in: \"Ellipsis NotImplemented\",\n literal: \"False None True\"\n };\n var PROMPT = {\n className: \"meta\",\n begin: /^(>>>|\\.\\.\\.) /\n };\n var SUBST = {\n className: \"subst\",\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS,\n illegal: /#/\n };\n var LITERAL_BRACKET = {\n begin: /\\{\\{/,\n relevance: 0\n };\n var STRING = {\n className: \"string\",\n contains: [ hljs.BACKSLASH_ESCAPE ],\n variants: [ {\n begin: /(u|b)?r?'''/,\n end: /'''/,\n contains: [ hljs.BACKSLASH_ESCAPE, PROMPT ],\n relevance: 10\n }, {\n begin: /(u|b)?r?\"\"\"/,\n end: /\"\"\"/,\n contains: [ hljs.BACKSLASH_ESCAPE, PROMPT ],\n relevance: 10\n }, {\n begin: /(fr|rf|f)'''/,\n end: /'''/,\n contains: [ hljs.BACKSLASH_ESCAPE, PROMPT, LITERAL_BRACKET, SUBST ]\n }, {\n begin: /(fr|rf|f)\"\"\"/,\n end: /\"\"\"/,\n contains: [ hljs.BACKSLASH_ESCAPE, PROMPT, LITERAL_BRACKET, SUBST ]\n }, {\n begin: /(u|r|ur)'/,\n end: /'/,\n relevance: 10\n }, {\n begin: /(u|r|ur)\"/,\n end: /\"/,\n relevance: 10\n }, {\n begin: /(b|br)'/,\n end: /'/\n }, {\n begin: /(b|br)\"/,\n end: /\"/\n }, {\n begin: /(fr|rf|f)'/,\n end: /'/,\n contains: [ hljs.BACKSLASH_ESCAPE, LITERAL_BRACKET, SUBST ]\n }, {\n begin: /(fr|rf|f)\"/,\n end: /\"/,\n contains: [ hljs.BACKSLASH_ESCAPE, LITERAL_BRACKET, SUBST ]\n }, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE ]\n };\n var NUMBER = {\n className: \"number\",\n relevance: 0,\n variants: [ {\n begin: hljs.BINARY_NUMBER_RE + \"[lLjJ]?\"\n }, {\n begin: \"\\\\b(0o[0-7]+)[lLjJ]?\"\n }, {\n begin: hljs.C_NUMBER_RE + \"[lLjJ]?\"\n } ]\n };\n var PARAMS = {\n className: \"params\",\n variants: [ \n // Exclude params at functions without params\n {\n begin: /\\(\\s*\\)/,\n skip: true,\n className: null\n }, {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n contains: [ \"self\", PROMPT, NUMBER, STRING, hljs.HASH_COMMENT_MODE ]\n } ]\n };\n SUBST.contains = [ STRING, NUMBER, PROMPT ];\n return {\n name: \"Python\",\n aliases: [ \"py\", \"gyp\", \"ipython\" ],\n keywords: KEYWORDS,\n illegal: /(<\\/|->|\\?)|=>/,\n contains: [ PROMPT, NUMBER, \n // eat \"if\" prior to string so that it won't accidentally be\n // labeled as an f-string as in:\n {\n beginKeywords: \"if\",\n relevance: 0\n }, STRING, hljs.HASH_COMMENT_MODE, {\n variants: [ {\n className: \"function\",\n beginKeywords: \"def\"\n }, {\n className: \"class\",\n beginKeywords: \"class\"\n } ],\n end: /:/,\n illegal: /[${=;\\n,]/,\n contains: [ hljs.UNDERSCORE_TITLE_MODE, PARAMS, {\n begin: /->/,\n endsWithParent: true,\n keywords: \"None\"\n } ]\n }, {\n className: \"meta\",\n begin: /^[\\t ]*@/,\n end: /$/\n }, {\n begin: /\\b(print|exec)\\(/\n } ]\n };\n }", "title": "" }, { "docid": "988608e6368802c145d88d52256942e4", "score": "0.51261336", "text": "highlight(str, lang) {\n if (lang && hljs.getLanguage(lang)) {\n try {\n return hljs.highlight(lang, str).value;\n } catch (__) { }\n }\n\n try {\n return hljs.highlightAuto(str).value;\n } catch (__) { }\n\n return ''; // use external default escaping\n }", "title": "" }, { "docid": "483122eb5379bafe478892cc3bf1730f", "score": "0.5125405", "text": "function highlight(text, value, names) {\n $('body').mark(text, {\n \"element\": \"mark\",\n \"className\": value,\n \"separateWordSearch\": false,\n \"ignorePunctuation\": true,\n \"diacritics\": true,\n \"acrossElements\": true,\n \"each\": function(node) {\n node.title = names;\n node.dataset.toggle = \"tooltip\";\n node.dataset.placement = \"top\";\n },\n \"limiters\": [\".\", \",\", \"!\"],\n \"exclude\": [\"statistic_content\", \".ignore\"]\n });\n}", "title": "" }, { "docid": "ed06190583d11bbc9e57dc710d369a2c", "score": "0.5122596", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\t\n\t function subMode(lexeme, mode) {\n\t var i, length;\n\t\n\t for (i = 0, length = mode.contains.length; i < length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\t\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\t\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\t\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\t\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : spanEndTag\n\t\n\t openSpan += classname + '\">';\n\t\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\t\n\t function processKeywords() {\n\t var keyword_match, last_index, match, result;\n\t\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t\n\t result = '';\n\t last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t\n\t while (match) {\n\t result += escape(mode_buffer.substring(last_index, match.index));\n\t keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\t\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage === 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\t\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\t\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\t\n\t function processBuffer() {\n\t result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n\t mode_buffer = '';\n\t }\n\t\n\t function startNewMode(mode) {\n\t result += mode.className? buildSpan(mode.className, '', true): '';\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\t\n\t function processLexeme(buffer, lexeme) {\n\t\n\t mode_buffer += buffer;\n\t\n\t if (lexeme == null) {\n\t processBuffer();\n\t return 0;\n\t }\n\t\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t if (new_mode.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (new_mode.excludeBegin) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\t\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (origin.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (origin.excludeEnd) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t do {\n\t if (top.className) {\n\t result += spanEndTag;\n\t }\n\t if (!top.skip) {\n\t relevance += top.relevance;\n\t }\n\t top = top.parent;\n\t } while (top !== end_mode.parent);\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\t\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\t\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\t\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\t\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current !== language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substring(index, match.index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += spanEndTag;\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message && e.message.indexOf('Illegal') !== -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "a8939d24dbf99935dac37023312d41d7", "score": "0.51197374", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "a8939d24dbf99935dac37023312d41d7", "score": "0.51197374", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "a8939d24dbf99935dac37023312d41d7", "score": "0.51197374", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "d76d18bbe0cb95d36d4c61e62232a871", "score": "0.51050025", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n if (!classname) return insideSpan;\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "d76d18bbe0cb95d36d4c61e62232a871", "score": "0.51050025", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n if (!classname) return insideSpan;\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "78f86942e110a4dbfadf63daf6ef2a06", "score": "0.51038444", "text": "function template(html, context) {\n\t return html.replace(/\\{([\\w_\\.]+)\\}/g, function (variable) {\n\t return (0, _util.get)(context, variable.slice(1, variable.length - 1), '');\n\t });\n\t}", "title": "" }, { "docid": "abc928989590571036f3e25070531a28", "score": "0.5099418", "text": "function Highlight(){\n if (!(this instanceof Highlight)) return new Highlight();\n this.languages = {};\n this.prefix('Highlight-');\n}", "title": "" }, { "docid": "6a2d84a2fb1ae779b7c320d3220080e8", "score": "0.5085336", "text": "function highlight(concept) {\n // var the_map = {\n // opinions:\"chartreuse\",\n // life:\"yellow\",\n // }\n return 'yellow'\n}", "title": "" }, { "docid": "08844e2da4c5b0ecda358cbe8bba3345", "score": "0.50652087", "text": "function initHighlighting(){if(initHighlighting.called)return;initHighlighting.called=true;var blocks=document.querySelectorAll('pre code');ArrayProto.forEach.call(blocks,highlightBlock);}", "title": "" }, { "docid": "6e51f9bb0f9421f6e83359ea414fe632", "score": "0.506406", "text": "highlighter(spec) {\n let styling = new Styling(this, spec);\n return [(0, _state.precedence)(_view.ViewPlugin.define(view => new Highlighter(view, this.prop, styling), {\n decorations: v => v.decorations\n }), \"fallback\"), _view.EditorView.styleModule.of(styling.module)];\n }", "title": "" }, { "docid": "77678d0ed2b4e0ee5a287484ead3e818", "score": "0.5062069", "text": "function highlightById() {\n}", "title": "" }, { "docid": "e2b4a77553de849d7b4ff2063de6e345", "score": "0.50615734", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "c191f3f14ae8f18dc4325e1dd735d6d7", "score": "0.5059754", "text": "function highlight(name, value, ignore_illegals, continuation) {\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe(mode.contains[i].beginRe.exec(lexeme)[0]);\n }\n\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n\n return mode;\n }\n\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n openSpan += classname + '\">';\n if (!classname) return insideSpan;\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n if (!top.keywords) return escape(mode_buffer);\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += top.subLanguage != null ? processSubLanguage() : processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, {\n parent: {\n value: top\n }\n });\n }\n\n function processLexeme(buffer, lexeme) {\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n\n if (end_mode) {\n var origin = top;\n\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n\n do {\n if (top.className) {\n result += spanEndTag;\n }\n\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n\n top = top.parent;\n } while (top !== end_mode.parent);\n\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n\n startNewMode(end_mode.starts, '');\n }\n\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top)) throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n\n var result = '',\n current;\n\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n\n var mode_buffer = '';\n var relevance = 0;\n\n try {\n var match,\n count,\n index = 0;\n\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match) break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n\n processLexeme(value.substr(index));\n\n for (current = top; current.parent; current = current.parent) {\n // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "355a4bceab9e9d329344e9b33a052980", "score": "0.50553626", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage == 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "355a4bceab9e9d329344e9b33a052980", "score": "0.50553626", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage == 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.5052743", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.5052743", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.5052743", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.5052743", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.5052743", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.5052743", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.5052743", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.5052743", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "bd9c519926faec1414a582f7fdd9fea2", "score": "0.5051937", "text": "function highlight(language_name, value) {\n\n function subMode(lexem, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n var match = mode.contains[i].beginRe.exec(lexem);\n if (match && match.index == 0) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexem) {\n if (mode.end && mode.endRe.test(lexem)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexem);\n }\n }\n\n function isIllegal(lexem, mode) {\n return mode.illegal && mode.illegalRe.test(lexem);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function processKeywords() {\n var buffer = escape(mode_buffer);\n if (!top.keywords)\n return buffer;\n var result = '';\n var last_index = 0;\n top.lexemsRe.lastIndex = 0;\n var match = top.lexemsRe.exec(buffer);\n while (match) {\n result += buffer.substr(last_index, match.index - last_index);\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n keyword_count += keyword_match[1];\n result += '<span class=\"'+ keyword_match[0] +'\">' + match[0] + '</span>';\n } else {\n result += match[0];\n }\n last_index = top.lexemsRe.lastIndex;\n match = top.lexemsRe.exec(buffer);\n }\n return result + buffer.substr(last_index);\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n keyword_count += result.keyword_count;\n relevance += result.relevance;\n }\n return '<span class=\"' + result.language + '\">' + result.value + '</span>';\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexem) {\n var markup = mode.className? '<span class=\"' + mode.className + '\">': '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexem) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexem;\n }\n top = Object.create(mode, {parent: {value: top}});\n relevance += mode.relevance;\n }\n\n function processLexem(buffer, lexem) {\n mode_buffer += buffer;\n if (lexem === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexem, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexem);\n return new_mode.returnBegin ? 0 : lexem.length;\n }\n\n var end_mode = endOfMode(top, lexem);\n if (end_mode) {\n if (!(end_mode.returnEnd || end_mode.excludeEnd)) {\n mode_buffer += lexem;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n top = top.parent;\n } while (top != end_mode.parent);\n if (end_mode.excludeEnd) {\n result += escape(lexem);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return end_mode.returnEnd ? 0 : lexem.length;\n }\n\n if (isIllegal(lexem, top))\n throw 'Illegal';\n\n /*\n Parser should not reach this point as all types of lexems should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexem;\n return lexem.length || 1;\n }\n\n var language = languages[language_name];\n compileLanguage(language);\n var top = language;\n var mode_buffer = '';\n var relevance = 0;\n var keyword_count = 0;\n var result = '';\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexem(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexem(value.substr(index))\n return {\n relevance: relevance,\n keyword_count: keyword_count,\n value: result,\n language: language_name\n };\n } catch (e) {\n if (e == 'Illegal') {\n return {\n relevance: 0,\n keyword_count: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "c3a11409d5c68e88498970dc90a6ad5d", "score": "0.50448", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "6261d1fc143f96d1e407b7079727d940", "score": "0.5017104", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "a9b4ce8675419698f6645649c4025744", "score": "0.5004508", "text": "function highlight(varName){\n\t// console.log(varName);\n\tlineChart.selectAll('.corLine').attr('stroke-opacity', .2);\n\tlineChart.select('#'+varName)\n\t\t\t.attr('stroke-opacity', 1)\n\t\t\t.attr('stroke-width', 3);\n\tlineChart.select('#DOW')\n\t\t\t.attr('stroke-opacity', 1)\n\t\t\t.attr('stroke-width', 3);\n}", "title": "" }, { "docid": "1704632949ceb80e329e5818a3e86bb9", "score": "0.5003222", "text": "function source(text, variable, properties) {\n\t variable = variable || 'obj';\n\t var index = 0;\n\t var src = '\\'';\n\t var regex = template_re;\n\n\t // Compile the template source, escaping string literals appropriately.\n\t text.replace(regex, function(match, interpolate, offset) {\n\t src += text\n\t .slice(index, offset)\n\t .replace(template_escaper, template_escapeChar);\n\t index = offset + match.length;\n\n\t if (interpolate) {\n\t src += '\\'\\n+((__t=(' +\n\t template_var(interpolate, variable, properties) +\n\t '))==null?\\'\\':__t)+\\n\\'';\n\t }\n\n\t // Adobe VMs need the match returned to produce the correct offest.\n\t return match;\n\t });\n\t return src + '\\'';\n\t}", "title": "" }, { "docid": "201c71efdb90c262402257e5f3dc9bd6", "score": "0.49879986", "text": "function performSubstitutions(input) {\n return input.replace(/!([\\w\\-]+)/g, function(orig, name){\n return data.variables[name] || orig\n })\n .replace(/\\{(.*?)\\}/g, function(_, js){\n with (data.variables){ return eval(js) }\n })\n }", "title": "" }, { "docid": "ee51c6fa270cb53cbb8a428075e05047", "score": "0.49873087", "text": "get Highlight() {}", "title": "" }, { "docid": "a6417663fff00d75df1a9e25940d9b7c", "score": "0.49813", "text": "function source(text, variable, properties) {\n variable = variable || 'obj';\n var index = 0;\n var src = '\\'';\n var regex = template_re;\n\n // Compile the template source, escaping string literals appropriately.\n text.replace(regex, function(match, interpolate, offset) {\n src += text\n .slice(index, offset)\n .replace(template_escaper, template_escapeChar);\n index = offset + match.length;\n\n if (interpolate) {\n src += '\\'\\n+((__t=(' +\n template_var(interpolate, variable, properties) +\n '))==null?\\'\\':__t)+\\n\\'';\n }\n\n // Adobe VMs need the match returned to produce the correct offest.\n return match;\n });\n return src + '\\'';\n}", "title": "" }, { "docid": "a6417663fff00d75df1a9e25940d9b7c", "score": "0.49813", "text": "function source(text, variable, properties) {\n variable = variable || 'obj';\n var index = 0;\n var src = '\\'';\n var regex = template_re;\n\n // Compile the template source, escaping string literals appropriately.\n text.replace(regex, function(match, interpolate, offset) {\n src += text\n .slice(index, offset)\n .replace(template_escaper, template_escapeChar);\n index = offset + match.length;\n\n if (interpolate) {\n src += '\\'\\n+((__t=(' +\n template_var(interpolate, variable, properties) +\n '))==null?\\'\\':__t)+\\n\\'';\n }\n\n // Adobe VMs need the match returned to produce the correct offest.\n return match;\n });\n return src + '\\'';\n}", "title": "" }, { "docid": "a6417663fff00d75df1a9e25940d9b7c", "score": "0.49813", "text": "function source(text, variable, properties) {\n variable = variable || 'obj';\n var index = 0;\n var src = '\\'';\n var regex = template_re;\n\n // Compile the template source, escaping string literals appropriately.\n text.replace(regex, function(match, interpolate, offset) {\n src += text\n .slice(index, offset)\n .replace(template_escaper, template_escapeChar);\n index = offset + match.length;\n\n if (interpolate) {\n src += '\\'\\n+((__t=(' +\n template_var(interpolate, variable, properties) +\n '))==null?\\'\\':__t)+\\n\\'';\n }\n\n // Adobe VMs need the match returned to produce the correct offest.\n return match;\n });\n return src + '\\'';\n}", "title": "" }, { "docid": "a6417663fff00d75df1a9e25940d9b7c", "score": "0.49813", "text": "function source(text, variable, properties) {\n variable = variable || 'obj';\n var index = 0;\n var src = '\\'';\n var regex = template_re;\n\n // Compile the template source, escaping string literals appropriately.\n text.replace(regex, function(match, interpolate, offset) {\n src += text\n .slice(index, offset)\n .replace(template_escaper, template_escapeChar);\n index = offset + match.length;\n\n if (interpolate) {\n src += '\\'\\n+((__t=(' +\n template_var(interpolate, variable, properties) +\n '))==null?\\'\\':__t)+\\n\\'';\n }\n\n // Adobe VMs need the match returned to produce the correct offest.\n return match;\n });\n return src + '\\'';\n}", "title": "" }, { "docid": "0e72d5f555524eccb6dcad7e326bf3f8", "score": "0.49772555", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t var i, length;\n\n\t for (i = 0, length = mode.contains.length; i < length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : spanEndTag\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t var keyword_match, last_index, match, result;\n\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\n\t result = '';\n\t last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t match = top.lexemesRe.exec(mode_buffer);\n\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage === 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n\t mode_buffer = '';\n\t }\n\n\t function startNewMode(mode) {\n\t result += mode.className? buildSpan(mode.className, '', true): '';\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\n\t if (lexeme == null) {\n\t processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t if (new_mode.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (new_mode.excludeBegin) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (origin.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (origin.excludeEnd) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t do {\n\t if (top.className) {\n\t result += spanEndTag;\n\t }\n\t if (!top.skip) {\n\t relevance += top.relevance;\n\t }\n\t top = top.parent;\n\t } while (top !== end_mode.parent);\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current !== language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += spanEndTag;\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message && e.message.indexOf('Illegal') !== -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "3cd078845d9d474c30ea6b68519574e7", "score": "0.49772227", "text": "function style(data) {\n\t\t\t\tif(typeof data=='string') return '<q>'+data.replace(/\\r/g,'\\\\r').replace(/\\n/g,'\\\\n').replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\")+'</q>';\n\t\t\t\tif(typeof data=='number' && !isNaN(data)) return '<em>'+data+'</em>';\n\t\t\t\tif(typeof data=='boolean') return '<b>'+data+'</b>';\n\t\t\t\tif(data===null || data===undefined || typeof data=='number'&&isNaN(data)) return '<strong>'+data+'</strong>';\n\t\t\t\tif(typeof data=='object') {\n\t\t\t\t\treturn '<a href=\"javascript: void(0)\">[object '+GlobalDebugger.getConstructor(data)+']</a>';\n\t\t\t\t}\n\t\t\t\tif(typeof data=='function') {\n\t\t\t\t\tvar re = /^function\\s*[A-Z0-9_]*\\([^)]*\\)/i;\n\t\t\t\t\tif(re.test(data)) return '<var>'+re.exec(data).pop()+' { ... }</var>'; else return '<var>'+data+'</var>';\n\t\t\t\t}\n\t\t\t\treturn data;\n\t\t\t}", "title": "" }, { "docid": "8c356521801f754c532a605d5450c0ba", "score": "0.49706355", "text": "interpolateVariable(token, parsed) {\n return token.replace(/[a-zA-Z0-9_]+/, (key) => {\n return this.getValue(key, parsed);\n });\n }", "title": "" }, { "docid": "523068f43e9ba70d13f7b24367f8582d", "score": "0.49698225", "text": "function syntaxHighlight(json) {\n const newJson = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n\n return newJson.replace(JSON_REGEX, (match) => {\n let className = 'number';\n let innerElement = match;\n\n if (/^\"/.test(match)) {\n if (/:$/.test(match)) {\n className = 'key';\n } else if (match.indexOf('://') > 0) {\n // Create a link for urls\n let url = match.replace('\"', '').replace('https://swapi.co/api', '');\n url = url.slice(0, url.length - 2);\n innerElement = `<a href=\"${url}\" class=\"json-link string\">${match}</a>`;\n } else {\n className = 'string';\n }\n } else if (/true|false/.test(match)) {\n className = 'boolean';\n } else if (/null/.test(match)) {\n className = 'null';\n }\n return `<span class=\"${className}\">${innerElement}</span>`;\n });\n}", "title": "" }, { "docid": "884081711e16ec6cc35f3fa25de7a021", "score": "0.49555317", "text": "function highlight(text, tabReplace, useCodeBlocks){\n tabReplace = tabReplace || ' ';\n text = text.replace(/\\r\\n|\\r|\\n/g, '\\n'); // remove \\r\n if (!!useCodeBlocks) {\n // JS regexpes have some multiline issues, so we temporarily remove them\n return text\n .replace(/\\n/g,'\\uffff')\n .replace(/<code([^>]*)>(.*?)<\\/code>/gm, function(original, attrs, source){\n return '<code'+attrs+'>'+hljs.highlightText(source.replace(/\\uffff/g,\"\\n\"), tabReplace)+'</code>';\n })\n .replace(/&amp;(\\w+;)/g,'&$1').replace(/\\uffff/g,\"\\n\");\n } else {\n return hljs.highlightText(text, tabReplace);\n }\n }", "title": "" }, { "docid": "2045536326bd07c8edbc6bfb2c977f58", "score": "0.49535155", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t var i, length;\n\n\t for (i = 0, length = mode.contains.length; i < length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : spanEndTag;\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t var keyword_match, last_index, match, result;\n\n\t if (!top.keywords)\n\t { return escape(mode_buffer); }\n\n\t result = '';\n\t last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t match = top.lexemesRe.exec(mode_buffer);\n\n\t while (match) {\n\t result += escape(mode_buffer.substring(last_index, match.index));\n\t keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage === 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n\t mode_buffer = '';\n\t }\n\n\t function startNewMode(mode) {\n\t result += mode.className? buildSpan(mode.className, '', true): '';\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\n\t if (lexeme == null) {\n\t processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t if (new_mode.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (new_mode.excludeBegin) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (origin.skip) {\n\t mode_buffer += lexeme;\n\t } else {\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t processBuffer();\n\t if (origin.excludeEnd) {\n\t mode_buffer = lexeme;\n\t }\n\t }\n\t do {\n\t if (top.className) {\n\t result += spanEndTag;\n\t }\n\t if (!top.skip) {\n\t relevance += top.relevance;\n\t }\n\t top = top.parent;\n\t } while (top !== end_mode.parent);\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t { throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"'); }\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current !== language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t { break; }\n\t count = processLexeme(value.substring(index, match.index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += spanEndTag;\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message && e.message.indexOf('Illegal') !== -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "0a512972d10d527bceb4a683c5e1f2eb", "score": "0.4934394", "text": "function blogModeHighlightHelper(){ \n const editor = playbackData.editors[playbackData.activeEditorFileId] ? playbackData.editors[playbackData.activeEditorFileId] : playbackData.editors[''];\n \n const selection = editor.getSelectedText();\n\n if (selection !== \"\"){\n const numbersAbove = Number(blogModeNumberAboveSelector.value);\n const numbersBelow = Number(blogModeNumberBelowSelector.value); \n\n const totalLines = editor.session.getLength() - 1\n\n const ranges = editor.getSession().getSelection().getAllRanges();\n\n editor.session.removeMarker(aceTempMarker);\n\n const startRow = ranges[0].start.row - numbersAbove; \n let endRow = ranges[ranges.length - 1].end.row + numbersBelow;\n endRow = ranges[ranges.length - 1].end.column === 0 ? endRow - 1 : endRow;\n const endCol = editor.session.getLine(endRow).length;\n\n blogModeNumberAboveSelector.max = ranges[0].start.row;\n blogModeNumberAboveSelector.value = blogModeNumberAboveSelector.max > numbersAbove ? numbersAbove : blogModeNumberAboveSelector.max;\n blogModeNumberBelowSelector.max = ranges[ranges.length - 1].end.column === 0 ? totalLines - ranges[ranges.length - 1].end.row + 1 : totalLines - ranges[ranges.length - 1].end.row; //TODO clean this up\n blogModeNumberBelowSelector.value = blogModeNumberBelowSelector.max > numbersBelow ? numbersBelow : blogModeNumberBelowSelector.max;\n\n const higlightedRange = new ace.Range(startRow, 0, endRow, endCol); \n aceTempRange = higlightedRange;\n\n aceTempMarker = editor.session.addMarker(higlightedRange, 'highlight', 'text', true);\n }else{\n editor.session.removeMarker(aceTempMarker);\n clearHighlights();\n\n blogModeNumberAboveSelector.max = 50;\n blogModeNumberBelowSelector.max = 50;\n }\n}", "title": "" }, { "docid": "c88631ecc8aa0e396fe1a1c141a5823e", "score": "0.49210373", "text": "function dust(hljs) {\n var EXPRESSION_KEYWORDS = \"if eq ne lt lte gt gte select default math sep\";\n return {\n name: \"Dust\",\n aliases: [ \"dst\" ],\n case_insensitive: true,\n subLanguage: \"xml\",\n contains: [ {\n className: \"template-tag\",\n begin: /\\{[#\\/]/,\n end: /\\}/,\n illegal: /;/,\n contains: [ {\n className: \"name\",\n begin: /[a-zA-Z\\.-]+/,\n starts: {\n endsWithParent: true,\n relevance: 0,\n contains: [ hljs.QUOTE_STRING_MODE ]\n }\n } ]\n }, {\n className: \"template-variable\",\n begin: /\\{/,\n end: /\\}/,\n illegal: /;/,\n keywords: EXPRESSION_KEYWORDS\n } ]\n };\n }", "title": "" }, { "docid": "658c8d5e685d0c89908c6edb4b5a1fdf", "score": "0.49162152", "text": "function replaceVariables(template) {\n return template\n .replace(/@abiname@/g, abiname)\n .replace(/@class@/g, class_)\n .replace(/@localversion@/g, localVersion)\n .replace(/@longclass@/g, longclass)\n .replace(/@upstreamversion@/g, upstreamVersion);\n}", "title": "" }, { "docid": "e9c7bd929521692dea16e5a4d66ca18c", "score": "0.49143252", "text": "function highlight(language_name, value, ignore_illegals) {\n\n function subMode(lexem, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n var match = mode.contains[i].beginRe.exec(lexem);\n if (match && match.index == 0) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexem) {\n if (mode.end && mode.endRe.test(lexem)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexem);\n }\n }\n\n function isIllegal(lexem, mode) {\n return !ignore_illegals && mode.illegal && mode.illegalRe.test(lexem);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function processKeywords() {\n var buffer = escape(mode_buffer);\n if (!top.keywords)\n return buffer;\n var result = '';\n var last_index = 0;\n top.lexemsRe.lastIndex = 0;\n var match = top.lexemsRe.exec(buffer);\n while (match) {\n result += buffer.substr(last_index, match.index - last_index);\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n keyword_count += keyword_match[1];\n result += '<span class=\"'+ keyword_match[0] +'\">' + match[0] + '</span>';\n } else {\n result += match[0];\n }\n last_index = top.lexemsRe.lastIndex;\n match = top.lexemsRe.exec(buffer);\n }\n return result + buffer.substr(last_index);\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n keyword_count += result.keyword_count;\n relevance += result.relevance;\n }\n return '<span class=\"' + result.language + '\">' + result.value + '</span>';\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexem) {\n var markup = mode.className? '<span class=\"' + mode.className + '\">': '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexem) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexem;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexem(buffer, lexem) {\n mode_buffer += buffer;\n if (lexem === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexem, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexem);\n return new_mode.returnBegin ? 0 : lexem.length;\n }\n\n var end_mode = endOfMode(top, lexem);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexem;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexem);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexem.length;\n }\n\n if (isIllegal(lexem, top))\n throw new Error('Illegal lexem \"' + lexem + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexems should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexem;\n return lexem.length || 1;\n }\n\n var language = languages[language_name];\n compileLanguage(language);\n var top = language;\n var mode_buffer = '';\n var relevance = 0;\n var keyword_count = 0;\n var result = '';\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexem(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexem(value.substr(index))\n return {\n relevance: relevance,\n keyword_count: keyword_count,\n value: result,\n language: language_name\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n keyword_count: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "1b59b0a75b3ab8f970055bf1b1e8de40", "score": "0.49133867", "text": "function phpTemplate(hljs) {\n return {\n name: \"PHP template\",\n subLanguage: \"xml\",\n contains: [ {\n begin: /<\\?(php|=)?/,\n end: /\\?>/,\n subLanguage: \"php\",\n contains: [ \n // We don't want the php closing tag ?> to close the PHP block when\n // inside any of the following blocks:\n {\n begin: \"/\\\\*\",\n end: \"\\\\*/\",\n skip: true\n }, {\n begin: 'b\"',\n end: '\"',\n skip: true\n }, {\n begin: \"b'\",\n end: \"'\",\n skip: true\n }, hljs.inherit(hljs.APOS_STRING_MODE, {\n illegal: null,\n className: null,\n contains: null,\n skip: true\n }), hljs.inherit(hljs.QUOTE_STRING_MODE, {\n illegal: null,\n className: null,\n contains: null,\n skip: true\n }) ]\n } ]\n };\n }", "title": "" }, { "docid": "96d2d49f57b6020d2c54cfd6e0f07ee0", "score": "0.49050948", "text": "function formatTemplate(template, obj) {\n\t\treturn template.replace(/{(\\w+)}/g, function(match, keyword) { \n\t\t return typeof obj[keyword] != 'undefined'\n\t\t ? obj[keyword]\n\t\t : match\n\t\t ;\n\t\t});\n\t}", "title": "" }, { "docid": "efbb65fdbcbd6ff03ac21bf2906cb457", "score": "0.49044862", "text": "function dust(hljs) {\n const EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';\n return {\n name: 'Dust',\n aliases: ['dst'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [{\n className: 'template-tag',\n begin: /\\{[#\\/]/,\n end: /\\}/,\n illegal: /;/,\n contains: [{\n className: 'name',\n begin: /[a-zA-Z\\.-]+/,\n starts: {\n endsWithParent: true,\n relevance: 0,\n contains: [hljs.QUOTE_STRING_MODE]\n }\n }]\n }, {\n className: 'template-variable',\n begin: /\\{/,\n end: /\\}/,\n illegal: /;/,\n keywords: EXPRESSION_KEYWORDS\n }]\n };\n}", "title": "" }, { "docid": "6b1dc36b4015cb36805f38c19ea8491d", "score": "0.49011707", "text": "function formatTemplate(template, obj) {\n return template.replace(/{(\\w+)}/g, function(match, keyword) {\n return typeof obj[keyword] != 'undefined' ? obj[keyword] : match;\n });\n }", "title": "" }, { "docid": "81749f968870c4fe15f7ba962dc7d9e8", "score": "0.49009833", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!classname) return insideSpan;\n\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var end_mode = endOfMode(top, lexeme);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1)\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n illegal:false,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "81749f968870c4fe15f7ba962dc7d9e8", "score": "0.49009833", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!classname) return insideSpan;\n\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var end_mode = endOfMode(top, lexeme);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1)\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n illegal:false,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "16938cbc3c3cfe4bfd7809febfc872fa", "score": "0.48942792", "text": "function highlightString(classPostfix) {\n // empty string preventions\n data = data.replace(/\"\"/g, \"^^|^\");\n data = data.replace(/\\\"([a-zA-Z0-9;<\\-\\/\\.':,\\s\\(\\)\\[\\]\\+=\\?!>_#\\$&\\^\\\\%áéíóúôýľščťžäÁÉÍÓÚÔÝĽŠČŤŽÄ]+?)\\\"/g, \"\\\"<span class='my-highlight-string\" + classPostfix + \"'>$1</span>\\\"\");\n // returns back empty string\n data = data.replace(/\\^\\^\\|\\^/g, \"\\\"\\\"\");\n }", "title": "" }, { "docid": "1f78610247c79da56b1d8b527e4f211b", "score": "0.48938492", "text": "function soy(hljs) {\n var TEMPLATE_KEYWORDS = \"alias as autoescape call case default delcall else elseif fallbackmsg foreach if ifempty let msg namespace param print switch template\";\n // Partial html tag support\n var TAG_INTERNALS = {\n endsWithParent: true,\n illegal: /</,\n relevance: 0,\n contains: [ {\n className: \"attr\",\n begin: \"[A-Za-z0-9\\\\._:-]+\",\n relevance: 0\n }, {\n begin: /=\\s*/,\n relevance: 0,\n contains: [ {\n className: \"string\",\n endsParent: true,\n variants: [ {\n begin: /\"/,\n end: /\"/\n }, {\n begin: /'/,\n end: /'/\n }, {\n begin: /[^\\s\"'=<>`]+/\n } ]\n } ]\n } ]\n };\n return {\n contains: [ hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE, {\n begin: /\\{delpackage/,\n ends: /\\}/,\n relevance: 10,\n keywords: \"delpackage\"\n }, {\n begin: /\\{namespace/,\n end: /\\}/,\n relevance: 10,\n keywords: \"namespace autoescape\",\n contains: [ hljs.QUOTE_STRING_MODE ]\n }, {\n className: \"template-tag\",\n begin: /\\{template/,\n end: /\\{\\/template\\}/,\n relevance: 10,\n keywords: TEMPLATE_KEYWORDS,\n contains: [ hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE, hljs.QUOTE_STRING_MODE, {\n className: \"template-variable\",\n relevance: 0,\n begin: /\\$[^}\\s]+/\n }, \n // Partial html support not achievable via subLanguage\n {\n className: \"tag\",\n begin: \"</?\",\n end: \"/?>\",\n contains: [ {\n className: \"name\",\n begin: /[^\\/><\\s]+/,\n relevance: 0\n }, TAG_INTERNALS ]\n } ]\n } ]\n };\n }", "title": "" }, { "docid": "e6c11b2731abcf31b6b85f15c0139a72", "score": "0.4888546", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(className, insideSpan, leaveOpen, noPrefix) {\n if (!leaveOpen && insideSpan === '') return '';\n if (!className) return insideSpan;\n\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += className + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Use case in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n\n function doBeginMatch(match) {\n var lexeme = match[0];\n var new_mode = match.rule;\n\n if (new_mode && new_mode.endSameAsBegin) {\n new_mode.endRe = escapeRe( lexeme );\n }\n\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n function doEndMatch(match) {\n var lexeme = match[0];\n var matchPlusRemainder = value.substr(match.index);\n var end_mode = endOfMode(top, matchPlusRemainder);\n if (!end_mode) { return; }\n\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts);\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n var lastMatch = {};\n function processLexeme(text_before_match, match) {\n\n var lexeme = match && match[0];\n\n // add non-matched text to the current mode buffer\n mode_buffer += text_before_match;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n // we've found a 0 width match and we're stuck, so we need to advance\n // this happens when we have badly behaved rules that have optional matchers to the degree that\n // sometimes they can end up matching nothing at all\n // Ref: https://github.com/highlightjs/highlight.js/issues/2140\n if (lastMatch.type==\"begin\" && match.type==\"end\" && lastMatch.index == match.index && lexeme === \"\") {\n // spit the \"skipped\" character that our regex choked on back into the output sequence\n mode_buffer += value.slice(match.index, match.index + 1);\n return 1;\n }\n lastMatch = match;\n\n if (match.type===\"begin\") {\n return doBeginMatch(match);\n } else if (match.type===\"illegal\" && !ignore_illegals) {\n // illegal match, we do not continue processing\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n } else if (match.type===\"end\") {\n var processed = doEndMatch(match);\n if (processed != undefined)\n return processed;\n }\n\n /*\n Why might be find ourselves here? Only one occasion now. An end match that was\n triggered but could not be completed. When might this happen? When an `endSameasBegin`\n rule sets the end rule to a specific match. Since the overall mode termination rule that's\n being used to scan the text isn't recompiled that means that any match that LOOKS like\n the end (but is not, because it is not an exact match to the beginning) will\n end up here. A definite end match, but when `doEndMatch` tries to \"reapply\"\n the end rule and fails to match, we wind up here, and just silently ignore the end.\n\n This causes no real harm other than stopping a few times too many.\n */\n\n mode_buffer += lexeme;\n return lexeme.length;\n }\n\n var language = getLanguage(name);\n if (!language) {\n console.error(LANGUAGE_NOT_FOUND.replace(\"{}\", name));\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n illegal:false,\n language: name,\n top: top\n };\n } catch (err) {\n if (err.message && err.message.indexOf('Illegal') !== -1) {\n return {\n illegal: true,\n relevance: 0,\n value: escape(value)\n };\n } else if (SAFE_MODE) {\n return {\n relevance: 0,\n value: escape(value),\n language: name,\n top: top,\n errorRaised: err\n };\n } else {\n throw err;\n }\n }\n }", "title": "" }, { "docid": "750049e55d1a5ff03c687faedbfa8a89", "score": "0.48810396", "text": "function scala(hljs) {\n var ANNOTATION = {\n className: \"meta\",\n begin: \"@[A-Za-z]+\"\n };\n // used in strings for escaping/interpolation/substitution\n var SUBST = {\n className: \"subst\",\n variants: [ {\n begin: \"\\\\$[A-Za-z0-9_]+\"\n }, {\n begin: \"\\\\${\",\n end: \"}\"\n } ]\n };\n var STRING = {\n className: \"string\",\n variants: [ {\n begin: '\"',\n end: '\"',\n illegal: \"\\\\n\",\n contains: [ hljs.BACKSLASH_ESCAPE ]\n }, {\n begin: '\"\"\"',\n end: '\"\"\"',\n relevance: 10\n }, {\n begin: '[a-z]+\"',\n end: '\"',\n illegal: \"\\\\n\",\n contains: [ hljs.BACKSLASH_ESCAPE, SUBST ]\n }, {\n className: \"string\",\n begin: '[a-z]+\"\"\"',\n end: '\"\"\"',\n contains: [ SUBST ],\n relevance: 10\n } ]\n };\n var SYMBOL = {\n className: \"symbol\",\n begin: \"'\\\\w[\\\\w\\\\d_]*(?!')\"\n };\n var TYPE = {\n className: \"type\",\n begin: \"\\\\b[A-Z][A-Za-z0-9_]*\",\n relevance: 0\n };\n var NAME = {\n className: \"title\",\n begin: /[^0-9\\n\\t \"'(),.`{}\\[\\]:;][^\\n\\t \"'(),.`{}\\[\\]:;]+|[^0-9\\n\\t \"'(),.`{}\\[\\]:;=]/,\n relevance: 0\n };\n var CLASS = {\n className: \"class\",\n beginKeywords: \"class object trait type\",\n end: /[:={\\[\\n;]/,\n excludeEnd: true,\n contains: [ {\n beginKeywords: \"extends with\",\n relevance: 10\n }, {\n begin: /\\[/,\n end: /\\]/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0,\n contains: [ TYPE ]\n }, {\n className: \"params\",\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0,\n contains: [ TYPE ]\n }, NAME ]\n };\n var METHOD = {\n className: \"function\",\n beginKeywords: \"def\",\n end: /[:={\\[(\\n;]/,\n excludeEnd: true,\n contains: [ NAME ]\n };\n return {\n name: \"Scala\",\n keywords: {\n literal: \"true false null\",\n keyword: \"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit\"\n },\n contains: [ hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, STRING, SYMBOL, TYPE, METHOD, CLASS, hljs.C_NUMBER_MODE, ANNOTATION ]\n };\n }", "title": "" }, { "docid": "51cf8eb85a790ccb15aaac86b8cfc9a3", "score": "0.48786417", "text": "function dust(hljs) {\n const EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';\n return {\n name: 'Dust',\n aliases: ['dst'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n {\n className: 'template-tag',\n begin: /\\{[#\\/]/,\n end: /\\}/,\n illegal: /;/,\n contains: [{\n className: 'name',\n begin: /[a-zA-Z\\.-]+/,\n starts: {\n endsWithParent: true,\n relevance: 0,\n contains: [hljs.QUOTE_STRING_MODE]\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{/,\n end: /\\}/,\n illegal: /;/,\n keywords: EXPRESSION_KEYWORDS\n }\n ]\n };\n }", "title": "" }, { "docid": "a0f4bd57a192f8b93c6e202afb14aa5c", "score": "0.48745406", "text": "function dust(hljs) {\n const EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';\n return {\n name: 'Dust',\n aliases: ['dst'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n {\n className: 'template-tag',\n begin: /\\{[#\\/]/,\n end: /\\}/,\n illegal: /;/,\n contains: [{\n className: 'name',\n begin: /[a-zA-Z\\.-]+/,\n starts: {\n endsWithParent: true,\n relevance: 0,\n contains: [hljs.QUOTE_STRING_MODE]\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{/,\n end: /\\}/,\n illegal: /;/,\n keywords: EXPRESSION_KEYWORDS\n }\n ]\n };\n}", "title": "" }, { "docid": "a0f4bd57a192f8b93c6e202afb14aa5c", "score": "0.48745406", "text": "function dust(hljs) {\n const EXPRESSION_KEYWORDS = 'if eq ne lt lte gt gte select default math sep';\n return {\n name: 'Dust',\n aliases: ['dst'],\n case_insensitive: true,\n subLanguage: 'xml',\n contains: [\n {\n className: 'template-tag',\n begin: /\\{[#\\/]/,\n end: /\\}/,\n illegal: /;/,\n contains: [{\n className: 'name',\n begin: /[a-zA-Z\\.-]+/,\n starts: {\n endsWithParent: true,\n relevance: 0,\n contains: [hljs.QUOTE_STRING_MODE]\n }\n }]\n },\n {\n className: 'template-variable',\n begin: /\\{/,\n end: /\\}/,\n illegal: /;/,\n keywords: EXPRESSION_KEYWORDS\n }\n ]\n };\n}", "title": "" } ]
0fa71a00263113a71c07357599c23319
Method pour cacher le bouton 50/50
[ { "docid": "74fc68387e86278ff25b4bd459fb1d63", "score": "0.0", "text": "function jokerCondition(){\n if(i ==4){\n let del = document.getElementById(\"joker\");\n del.classList.remove(\"hidd\");\n }\n}", "title": "" } ]
[ { "docid": "66af670927d79b684793bca4c982feac", "score": "0.63363737", "text": "function hitungBebek(bulan){\n var bebek = 1000\n for(var i = 1 ; i<=bulan ; i++){\n bebek = (bebek - (bebek*20/100)) *2\n }\n return bebek\n }", "title": "" }, { "docid": "1acad239a017912655f5bb92b3cc6ec1", "score": "0.5893275", "text": "function margemBruta(receita,custo){\r\n return ((receita-custo)/receita)*100;\r\n}", "title": "" }, { "docid": "68bc333d9c22aab7d903ab3826295ac4", "score": "0.57728153", "text": "function percentualMargemBruta(receitaLiquida, custoProdutos){\n lucroBruto = receitaLiquida - custoProdutos\n margemBruta = (lucroBruto / receitaLiquida) * 100\n return console.log(\"5) O percentual da margem bruta é de \" + margemBruta + \"%\")\n}", "title": "" }, { "docid": "bec751730deb6969ef42a3be53da5ead", "score": "0.57440186", "text": "calculatePercent() {\n let comMoney = (this.percent / 100) * this.fee;\n return comMoney;\n }", "title": "" }, { "docid": "a38da7b5e049278d4fa79f54ce6d4929", "score": "0.57396984", "text": "comparisonRate(comparison) {\n let height = 1 / (this.props.rates[comparison]) * 100\n return height\n\n }", "title": "" }, { "docid": "1da58aa735da078a68453f90bba9b203", "score": "0.56589", "text": "calculateFootprint() {\n let plasticSaved = 0;\n this.state.activePledges.forEach((pledge) => {\n plasticSaved += pledge.footprintReduction\n })\n let userFootprint = Math.round((this.state.avgFootprint - plasticSaved) * 10) / 10;\n this.setState({\n userFootprint: userFootprint\n });\n }", "title": "" }, { "docid": "2a74e972f4ad74491f04409e72cfe007", "score": "0.5640031", "text": "function determineBreath(sumEachL, sumEachR) {\n\n //souffle harmonieux\n if (Math.abs(kmL1 - kmR1) <= toljuste && kmL1!=0 && kmR1!=0) {\n console.log(\"souffle HARMONIEUX\");\n TREE.stopFeuille();\n TREE.createFeuille();\n if (TREE.tronc.length < TREE.TREEsizeMax) { // ajouter une variable intermédaire pour les trois taille tailleADo, taille adulte\n var count = 3;//count en seconde\n var interval = 1000;//count en seconde\n var minus = 1;//count en seconde\n TREE.maxNode +=50;\n growTREEwithtimer(count, interval, minus);\n\n\n } else{\n //TREE.stopAutoGrow();\n TREE.stopFleurs();\n TREE.createFleurs();\n console.log(\"TREE > TREEsizeMax\");\n //une fois que l'arbre a atteint sa taille adulte des fruits poussent\n }\n\n //jouer sur la vitesse de pousse\n //si le tronc est plus petit que X alors pousse\n //si le tronc est plus grand que X alors feuille\n //si le tronc est plus grand que X et feuille plus grand que X alors fruits\n\n\n //souffle bof\n } else if ((Math.abs(kmL1 - kmR1) > toljuste && Math.abs(kmL1 - kmR1) <= tolMoyen)) {\n TREE.stopAutoGrow();\n console.log(\"souffle faux légères conséquences\");\n console.log(Math.abs(kmL1 - kmR1));\n\n //enleve une petite proportion de feueille\n proportion = 0.3;\n TREE.decrocheFeuille(); //ajouter des paramètres de combien décrocher\n TREE.decrocheFleurs();\n TREE.decrocheAbricot();\n // une ptite partie des feuilles s'envole\n // une petite partie des fruits s'envole\n // les feuilles se fane un peu les couleurs perdent leurs clarté\n\n\n\n\n\n\n\n\n\n\n\n\n/////////////////////// //souffle chaotique\n/////////////////////// //souffle chaotique\n } else if (Math.abs(kmL1 - kmR1) > tolMoyen) {\n\n audio[\"alarme\"].play();\n console.log(\"souffle faux graves conséquences\");\n console.log(Math.abs(kmL1 - kmR1));\n if (kmL1 > kmR1) {\n //vent négatif, l'arbre doit pousser légèrement plus sur la droite\n console.log(\"joueur LEFT souffle plus fort\");\n testAngle -= 0.001;\n } else if (kmL1 < kmR1) {\n //vent positif, l'arbre doit pousser légèrement plus sur la gauche\n console.log(\"joueur RIGHT souffle plus fort\");\n testAngle += 0.001;\n }\n console.log(\"VeryBadBreath\");\n var count = 1;\n // l'arbre perd toute ces feuilles\n //l'arbre perd tout ces fruits\n // l'arbre devient terne\n proportion = 0.8;\n TREE.stopAutoGrow();\n TREE.stopFeuille();\n TREE.stopFleurs();\n TREE.stopAbricot();\n TREE.stopWakeFeuille();\n TREE.stopWakeFleurs();\n TREE.stopWakeAbricot();\n TREE.wakeFeuille();\n TREE.wakeFleurs();\n TREE.wakeAbricot();\n TREE.decrocheFeuille();\n TREE.decrocheFleurs();\n TREE.decrocheAbricot();\n //TREE.recalculate(false);\n\n //growTREEwithtimer(count,1000, 1);\n //TREE.maxNode += 10;\n\n// if(TREE.tronc[0].y-TREE.tronc[TREE.tronc.length-1].y<80){\n// console.log(\"<200\");\n// }else{\n// growTREEwithtimer(count,100, 0.1);\n// \n// }\n\n\n //count en seconde\n\n\n }else{\n TREE.stopAutoGrow();\n console.log(kmL1+\" \"+kmR1);\n }\n\n}", "title": "" }, { "docid": "b0d37d4f7f576013db2ae48eb61189ca", "score": "0.56218", "text": "llenar_combustible(){ \t\n\t\tlet aux_cantidad_Combustible = Math.random() * 100;\n\t\tif(aux_cantidad_Combustible <= (this.tamaño_Tanque - this.cantidad_Combustible)){\n\t\t\tthis.cantidad_Combustible += aux_cantidad_Combustible;\n\t\t\tconsole.log(`Nuevo estado de combustible ${this.cantidad_Combustible} litros`);\n\t\t}\n\t\telse{\n\t\t\tconsole.log('El combustible excede la capacidad máxima del tanque');\n\t\t}\n\t}", "title": "" }, { "docid": "02e2bd5dec657bf384d54ac2d2cb2aa5", "score": "0.56190896", "text": "function registrationCost(bhp) {\n\t\t if ( bhp <= 85) {\n\t\t\treturn 3000; \n\t\t } else if(bhp > 85 && bhp <= 150 ) {\n\t\t\t return 5000;\n\t\t } else {\n\t\t\t return 15000;\n\t\t \n\t\t \n\t\t \n\t }\n\t \n\t }", "title": "" }, { "docid": "fd39e95d2e3fdf8d40c902a898b077f0", "score": "0.55592847", "text": "function somBalk(player_pitching) {\n //( BALK * 290 ) / IP\n let BK = _.toFinite(player_pitching.BK)\n let IP = _.toFinite(player_pitching.IP)\n\n let balk = (BK * 290) / IP\n\n //can't have negative chances on card\n if (balk < 0) {\n balk = 0\n }\n\n return balk\n }", "title": "" }, { "docid": "4e997c475e4e33bbae735e2133a39082", "score": "0.548726", "text": "encherBomba(){\n \n if (this.quantidade == this.capacidade){\n console.log(\"A bomba já está cheia em sua capacidade máxima\");\n }\n else{\n let litros = this.capacidade - this.quantidade;\n this.quantidade += litros;\n\n console.log(`A bomba será enchido com ${litros} litros.` ); \n }\n }", "title": "" }, { "docid": "1b91635c3dcea1feb2b29977f05c8ed9", "score": "0.5465136", "text": "getUsersBitByTick(){\n userManager.getAll()\n .then((usersFromData) => {\n const bitByTick = usersFromData.filter(\n currentUser => currentUser.tickBite === true\n )\n var percentBitByTick = Math.round((bitByTick.length/usersFromData.length)*100)\n console.log(percentBitByTick)\n this.setState({\n tickBite: percentBitByTick\n })\n })\n}", "title": "" }, { "docid": "7d804be876ae95d12885b179c0006327", "score": "0.54530853", "text": "function underweight(){\n var underweight;\n underweight = CrCl*0.69;\n }", "title": "" }, { "docid": "f57652dec1eeec176c060e3863dd9f7c", "score": "0.54523635", "text": "function bowPrice() {\n denom = (1 + haggling) * (1 + allure) * (1 + fortify_barter_potion) * 1 + (fortify_barter_equip_bless);\n factor = (3.3 - 1.3 * (speech_lvl / 100)) / denom;\n return Math.floor(270 / factor);\n}", "title": "" }, { "docid": "5b64c3883f2931c8c2fe70c925646122", "score": "0.5443708", "text": "function getMilk(money) { \n console.log(\"leaveHouse\");\n console.log(\"moveRight\");\n console.log(\"moveRight\");\n console.log(\"moveUp\");\n console.log(\"moveUp\");\n console.log(\"moveUp\");\n console.log(\"moveUp\");\n console.log(\"moveRight\");\n console.log(\"moveRight\");\n var numberOfBottles = Math.floor(money / 1.5); // Round down\n console.log(\"buy \" + numberOfBottles + \" bottles of milk\")\n console.log(\"moveLeft\");\n console.log(\"moveLeft\");\n console.log(\"moveDown\");\n console.log(\"moveDown\");\n console.log(\"moveDown\");\n console.log(\"moveDown\");\n console.log(\"moveLeft\");\n console.log(\"moveLeft\");\n console.log(\"enterHouse\");\n return money % 1.5; // Remainder of this division. The output of this function will be the change.\n }", "title": "" }, { "docid": "61234d3c101d98ba7e6aa409aa5aecd0", "score": "0.5435236", "text": "_2860_updateMileage() {\r\n this.M_totalMileage += 200;\r\n this.M_totalMileage += (this.A_oxen - 220) / 5;\r\n this.M_totalMileage += randomInt(9) + 1;\r\n this.L1_blizzardFlag = false;\r\n this.C1_haveEnoughClothing = false;\r\n this._2880_ridersAttack();\r\n }", "title": "" }, { "docid": "1b2daad25e55715ccb86a6619091e081", "score": "0.5417243", "text": "function bonAppetit(bill, k, b) {\n\tlet billActual = (bill.reduce((acc, crnt) => acc + crnt) - bill[k]) / 2;\n\tbillActual === b ? console.log('Bon Appetit') : console.log(b - billActual);\n}", "title": "" }, { "docid": "125ce3b45e2d648b770987b62137c1c3", "score": "0.5411705", "text": "function brickcalculator (tala){\n var oneFeetByIt =1000 \n \n if (tala<=10){\n tala = tala*15\n tala= tala*oneFeetByIt\n }else if (tala <= 20 ){\n tala = tala*12\n tala= tala*oneFeetByIt\n }else if (tala >= 21 ){\n tala = tala*10\n tala= tala*oneFeetByIt\n }\n return tala\n}", "title": "" }, { "docid": "830ae41d1f45bb270f7bb3d1ea9579d7", "score": "0.5405672", "text": "function bonAppetit(bill, k, b) {\n let total = 0;\n for (let i = 0; i < bill.length; i++){\n if (i == k) {\n total -= bill[i];\n }\n total += bill[i];\n }\n let half = total / 2;\n if (half == b) {\n console.log(\"Bon Appetit\")\n } else {\n console.log(b - half); \n } \n}", "title": "" }, { "docid": "9f1fbebcd5c4cfece6a32ceda5790edd", "score": "0.5399827", "text": "function fasilitasLengkap(){\n\t\tif(fasilitas >= 70){\n\t\t\treturn 1;\n\t\t}else if(fasilitas > 20 && fasilitas < 70){\n\t\t\treturn (fasilitas - 20) / 50;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}", "title": "" }, { "docid": "c47afea83c0c47582d7f0fbcd9fe5408", "score": "0.53979564", "text": "function tipCalculator(bill) {\n var percentage;\n if (bill < 50) {\n percentage = 0.2;\n } else if (bill >= 50 && bill < 200) {\n percentage = 0.15;\n } else {\n percentage = 0.1;\n }\n return percentage * bill;\n}", "title": "" }, { "docid": "098b18095ca0df05b25e62c2781260d6", "score": "0.53874505", "text": "function floorToMultiplier(a) {\n return Math.round(a / 50) * 50;\n\n}", "title": "" }, { "docid": "df9d8d0bb480cc2cdfe6c4638deaa572", "score": "0.53788906", "text": "happinessCheck() {\n let happy = this.happiness;\n let happinessMod = 1;\n if (happy > 75){\n happinessMod = (happy/20) * this.genome[1]\n } else if (happy < 75 && happy > 50){\n happinessMod = (happy/10) * this.genome[1]\n } else if (happy < 50 && happy > 35){\n happinessMod = this.genome[1]\n }else {\n happinessMod = -1\n }\n return happinessMod\n }", "title": "" }, { "docid": "5152c797e25d95aebe2eae17c1492267", "score": "0.536921", "text": "function somGBB(player_batting) {\n let GBA = somGBA(player_batting)\n\n let ground_ball_B = 31 - GBA\n\n if (ground_ball_B < 0) {\n ground_ball_B = 0\n }\n\n return _.round(ground_ball_B)\n }", "title": "" }, { "docid": "20c776842c6fff72fedd9f804bd6c2ef", "score": "0.5368628", "text": "function basalLookup() {\n var now = new Date();\n basalRate = Math.round(basalprofile_data[basalprofile_data.length-1].rate*100)/100\n \n for (var i = 0; i < basalprofile_data.length - 1; i++) {\n if ((now >= getTime(basalprofile_data[i].minutes)) && (now < getTime(basalprofile_data[i + 1].minutes))) {\n basalRate = basalprofile_data[i].rate.toFixed(2);\n break;\n }\n }\n}", "title": "" }, { "docid": "c192f8a119184c14b27c9263a60b56a3", "score": "0.5363541", "text": "function calcBaseBet()\n{\n\tvar currentBal = engine.getBalance();\t\n\treturn (risk * currentBal) / riskFactor;\n}", "title": "" }, { "docid": "0bc5a591a6b38a8abe4e6eaea8088075", "score": "0.53524333", "text": "function gettingSmallBabushka() {\n if (cells[currentMatrushkaPosition].classList.contains('points')) {\n countBabushkaPoints += 10\n coins.play()\n babushkaScore.innerText = parseFloat(countBabushkaPoints)\n }\n }", "title": "" }, { "docid": "86e868b8801ca736a935e2f921d128aa", "score": "0.53490627", "text": "calculateEcoFootprintPerMem(val){\n\n }", "title": "" }, { "docid": "cdae0f1c68a4f04acccbf7ff4c7818d3", "score": "0.53433806", "text": "calculateGrowthRate() {\n let rate = fieldConfigurations.rate;\n if (this.buff.positive && this.buff.positive.length) {\n this.buff.positive.forEach((e) => {\n if (e.rate) rate = rate + e.rate;\n });\n this.buff.negative.forEach((e) => {\n if (e.rate) rate = rate - e.rate;\n });\n }\n return rate / 100;\n }", "title": "" }, { "docid": "9074159d625cb89c3523aa09ac306076", "score": "0.53433204", "text": "function som1SB(player_batting) {\n\n //(( SB / ( SB + CS )) + 0.13 ) * 20\n\n }", "title": "" }, { "docid": "a82f9093a7f9bd81899e08837b2b8cf5", "score": "0.5335505", "text": "invest(bank, size){\n if (size == 0){\n bank.boughtMBS[0] += 1;\n this.balance = this.balance - this.lower*.75;\n }\n else if (size == 1){\n bank.boughtMBS[1] += 1;\n this.balance = this.balance - this.middle*.75;\n }\n else if (size == 2){\n bank.boughtMBS[2] += 1;\n this.balance = this.balance - this.upper*.75;\n }\n }", "title": "" }, { "docid": "095880255b0122fb5ebbff99aaad5e63", "score": "0.53343725", "text": "function updateBPM(bpm) {\n intervaloAnalise = 15000 / bpm\n}", "title": "" }, { "docid": "e78da8e26f079431f650a928683d046a", "score": "0.53209454", "text": "function coolBlaster(){\n if(blasterHealth.height < 160){\n cool()\n if(overheatBG.height > 75 ){\n blasterHealth.height += 4\n }\n }\n}", "title": "" }, { "docid": "2945fa4c5b2bc117dcc0ddfa3ff813fd", "score": "0.5320938", "text": "function countiny_perc_whol(b, c) {\n \t return (c/b)*100\n}", "title": "" }, { "docid": "12bcd1a7b7f16e34af8aeeff7b0bac5a", "score": "0.53153557", "text": "function extround(zahl) {\n //runden auf drei Nachkommastellen\n //50/(100/200)\n zahl = (Math.round(zahl * 100) / 100);\n return zahl * 1 / 1000; //prozentzahl\n }", "title": "" }, { "docid": "e4363d78b0794f76ceeaf4268df45877", "score": "0.530998", "text": "getRentabilite() {\n let ponderation = 10; // Facteur pour nivelle le taux\n if (!this.isTerrain() || this.nbMaison >= 3) {\n return 0;\n } else {\n // Maison du groupe\n let proprietes = this.groupe.fiches;\n let nbMaisonsConstruites = 0;\n for (let i = 0; i < proprietes.length; i++) {\n nbMaisonsConstruites += proprietes[i].nbMaison;\n }\n return (this.loyer[3] / Math.max((proprietes.length * 3 - nbMaisonsConstruites) * this.prixMaison, 1)) / ponderation;\n }\n }", "title": "" }, { "docid": "2768e70949f953e287309c7861cd012f", "score": "0.5288183", "text": "calculateBalance(foreclosed, banks){\n this.mortgages[0] -= foreclosed[0];\n this.mortgages[1] -= foreclosed[1];\n this.mortgages[2] -= foreclosed[2];\n var change = 0;\n for (var i=0; i<banks.length-1; i++){\n change += banks[i].payments();\n }\n change += this.mortgages[0]*this.lower*.1;\n change += this.mortgages[1]*this.middle*.1;\n change += this.mortgages[2]*this.upper*.1;\n return change;\n }", "title": "" }, { "docid": "27662ccb8f35f70836da5ed095a29a34", "score": "0.52832997", "text": "getMetaboliteBalance(metId, thr) {\n // metBalAllScens ==> list of objects, each for one scen, containing scenId and all reactions\n let reactsTotalFlux = {};\n let metBalAllScens = {};\n for (let scen of this.state.allScens) {\n metBalAllScens[scen.id] = {};\n let model = this.getModel(scen.baseModelId);\n model.reactions.forEach(r => {\n if (metId in r.metabolites && r.id in this.state.respfba[scen.id]) {\n let flux = r.metabolites[metId]*this.state.respfba[scen.id][r.id];\n metBalAllScens[scen.id][r.id] = +flux.toFixed(2);\n // add this reaction to reactsTotalFlux\n if (r.id in reactsTotalFlux) reactsTotalFlux[r.id] += Math.abs(metBalAllScens[scen.id][r.id]);\n else reactsTotalFlux[r.id] = Math.abs(metBalAllScens[scen.id][r.id]); \n }\n });\n }\n\n // console.log('metBalAllScens', metBalAllScens);\n\n // Select reactions ok\n let reactsOK = Object.keys(reactsTotalFlux).sort((x,y)=>reactsTotalFlux[y]-reactsTotalFlux[x]).filter(rId => (\n (reactsTotalFlux[rId]>=thr)\n ));\n\n // metBalReacts ==> list of objects, one for reaction, if sum abs >= thr\n let metBalReacts = reactsOK.map(rId => {\n let reaction = (rId.length<20 ? rId : rId.slice(0,20)+'...')\n let metBalR = {reaction}\n for (let scen of this.state.allScens) {\n if (rId in metBalAllScens[scen.id]) metBalR[scen.id] = metBalAllScens[scen.id][rId];\n else metBalR[scen.id] = 0;\n }\n return metBalR;\n })\n\n return metBalReacts;\n\n // return metaboliteBalance;\n }", "title": "" }, { "docid": "5f16a26c192fa3165c98d0270edf3c6b", "score": "0.5273552", "text": "atualiza_pct() {\n this.pilha.pop();\n this.pilha.pop();\n }", "title": "" }, { "docid": "5010dbfcc83c56df4d74c3ee72a5d294", "score": "0.525907", "text": "calculate_pennies() {\n let pennie = this.cents % 5;\n return pennie;\n }", "title": "" }, { "docid": "0bae0211283ccd7da3cf96d8e9911ab7", "score": "0.5240066", "text": "descendre(){\r\n if (this.bas < terrain.hauteur){\r\n this.vitesseY = 2;\r\n }\r\n else{\r\n this.bas = terrain.hauteur;\r\n this.arreterDeBouger();\r\n }\r\n }", "title": "" }, { "docid": "b8ef041c4c2a627f7b93094e9ef419c8", "score": "0.52292013", "text": "getRentabiliteBrute() {\n return !this.isTerrain() ? 0 : this.loyer[3] / (this.achat + 3 * this.prixMaison);\n }", "title": "" }, { "docid": "2818f3eb331b6e37d9e718ccaa4b4a24", "score": "0.52284074", "text": "function getMilk(money) {\n // instructions\n console.log(\"leave house\");\n console.log(\"move right\");\n console.log(\"leave left\");\n\n let bottlePrice = 1.5\n\n // divide money by price\n // round down the number to avoid decimals\n let numberOfBottles = Math.floor(money / bottlePrice);\n\n console.log(\"buy \" + numberOfBottles + \" botles of milk\");\n}", "title": "" }, { "docid": "e0b6450d0876374c2a6633607ffcc015", "score": "0.52249306", "text": "function updateBreath() { \n \n if (breathDir === 1) { // breath in\n breathAmt -= breathInc;\n if (breathAmt < -breathMax) {\n breathDir = -1;\n }\n } else { // breath out\n breathAmt += breathInc;\n if(breathAmt > breathMax) {\n breathDir = 1;\n }\n }\n}", "title": "" }, { "docid": "179c49a77ab3402a8223690d1187f19b", "score": "0.5214324", "text": "function brickCalculator(brick) {\n\n let building = brick;\n if (building <= 10) {\n return (building * 15 * 1000);\n } else if (building <= 20) {\n return ((10 * 15) + (building - 10) * 12) * 1000;\n } else return ((10 * 15) + (10 * 12) + (building - 20) * 10) * 1000;\n}", "title": "" }, { "docid": "fa4d97a1c083c10c619fe13a11526342", "score": "0.5204969", "text": "roundUpBets() {\n for (let j = 0; j < this.players.length; j++) {\n var player = this.players[j];\n this.potAmount += player.chipsOnTable;\n player.chipsOnTable = 0;\n }\n this.currentBet = 0;\n }", "title": "" }, { "docid": "972a8d553ca31f4a3ceafdee0e0fd63d", "score": "0.5204443", "text": "function LiteBal() {\n }", "title": "" }, { "docid": "218b6231ed11cd4b94e7b16fcff33c52", "score": "0.51997596", "text": "function saleHotdogs(n) {\n return n < 5 ? n * 100 : n >= 5 && n < 10 ? n * 95 : n * 90\n }", "title": "" }, { "docid": "49386555a6660b788ba865c7a954fbb6", "score": "0.51926994", "text": "deductBudgetClothing() {\n let price = parseFloat(costClothing.value);\n runningBudget -= price;\n updateBudget();\n }", "title": "" }, { "docid": "75bb885127913b7342cb2e6f74ba9b4d", "score": "0.5185587", "text": "function ointerest() {\n if (player.BANKACCOUNT < 0) player.BANKACCOUNT = 0;\n\n if (player.BANKACCOUNT > 0 && player.BANKACCOUNT < 500000) {\n var i = elapsedtime() - lasttime; /* # mobuls elapsed */\n while (i-- > 0 && player.BANKACCOUNT < 500000) {\n player.BANKACCOUNT += player.BANKACCOUNT / 250;\n }\n /* interest limit */\n player.BANKACCOUNT = Math.min(500000, player.BANKACCOUNT);\n }\n\n lasttime = elapsedtime();\n\n player.BANKACCOUNT = Math.floor(player.BANKACCOUNT);\n}", "title": "" }, { "docid": "9c0ca02bb8e3e9497d3b11954aef3a78", "score": "0.51849174", "text": "static promotionalDeal(pizza,percent){\n percent = percent*0.01\n return pizza.price()-(pizza.price()*percent);\n}", "title": "" }, { "docid": "f295ada327c5eb14c5130191e5d5d4ec", "score": "0.5174194", "text": "function brickCalculator(floor){\n let totalHeight;\n let totalBrick;\n if(floor<=10){\n totalHeight = floor * 15;\n totalBrick = totalHeight * 1000;\n } \n else if (floor <=20 ){\n totalHeight = (10 * 15) + (10 *12);\n totalBrick = totalHeight * 1000;\n }\n else{\n if ( floor >= 21){\n totalHeight = (10 *15)+(10 * 12)+(floor * 10);\n totalBrick = totalHeight * 1000 - (200000);\n\n }\n \n }\n return totalBrick;\n}", "title": "" }, { "docid": "1e7aceaa1b6730aba323f3aa1d0e97f7", "score": "0.51700354", "text": "stateCheckGb(x) {\n\n\t\t\t\tif (internetPrice > 0) {\n\n\t\t\t\t\tif (x.name == \"ilimitodo\") {\n\t\t\t\t\t\t// tenemos un caso especial, los gigabites son ilimitados\n\t\t\t\t\t\t// asi que el valor devuelto no es tipo integer\n\t\t\t\t\t\treturn x.gb;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn x.gb + x.bonus_gb;\n\t\t\t\t}\n\n\t\t\t\treturn x.gb;\n\t\t\t}", "title": "" }, { "docid": "686be1065af586f4e94d43d6bb62a802", "score": "0.5164883", "text": "rubberBand(dt)\n\t{\n\t\tconst diff = (this.ball.pos.y - this.players[1].pos.y);\n\t\tthis.manager.AIvelocity = this.manager.difficultyFactor * Math.sign(diff) * Math.sqrt(Math.abs(diff));\n\t\tthis.players[1].pos.y += this.manager.AIvelocity * dt;\n\t}", "title": "" }, { "docid": "083fe20efc4b7c5460fecce9d65ea768", "score": "0.5162906", "text": "function porcConDescuento(descuento) {\n return 100 - descuento;\n}", "title": "" }, { "docid": "fc63ef97c90f60974ca2aac5f6e56874", "score": "0.5157363", "text": "function getPercCoins(){\n\n\t\n\n}", "title": "" }, { "docid": "d8b1056526f1ad74d8c0006555c9cd74", "score": "0.51553684", "text": "function updateBMI() {\n if (vm.wt <= 0) {\n return;\n }\n\n vm.bmi = Math.round(vm.wt / (vm.ht * vm.ht));\n }", "title": "" }, { "docid": "70f8de0800d5d022351190b11863c906", "score": "0.5153012", "text": "bestEconomyBowler() {\n var superovereconomy = {}\n this.matchesData.map(function (data1) {\n if (data1.is_super_over != 0) {\n if (superovereconomy.hasOwnProperty(data1.bowler)) {\n superovereconomy[data1.bowler]['total_runs'] += parseInt(data1.batsman_runs)\n + parseInt(data1.noball_runs) + parseInt(data1.wide_runs)\n if (parseInt(data1.noball_runs) === 0 && parseInt(data1.wide_runs) === 0) {\n superovereconomy[data1.bowler]['total_balls'] += 1\n }\n } else {\n superovereconomy[data1.bowler] = {}\n superovereconomy[data1.bowler]['total_runs'] = parseInt(data1.batsman_runs)\n + parseInt(data1.noball_runs) + parseInt(data1.wide_runs)\n if (parseInt(data1.noball_runs) === 0 && parseInt(data1.wide_runs) === 0) {\n superovereconomy[data1.bowler]['total_balls'] = 1\n } else {\n superovereconomy[data1.bowler]['total_balls'] = 0\n }\n }\n }\n })\n var rseobj2 = {}\n for (var i in superovereconomy) {\n rseobj2[i] = (superovereconomy[i]['total_runs'] / (superovereconomy[i]['total_balls'] / 6))\n }\n var max1 = Infinity, val = 0, resobj2 = {}, pos = ''\n for (var i in rseobj2) {\n val = rseobj2[i]\n if (val < max1) {\n max1 = val\n pos = i\n }\n }\n resobj2[pos] = max1\n var arr1 = [],resArray = []\n for(let i in resobj2){\n arr1.push(i)\n arr1.push(resobj2[i])\n resArray.push(arr1)\n arr1 = []\n }\n return resArray\n }", "title": "" }, { "docid": "e156dac8b1feac2a7ec46b7a91aff7a4", "score": "0.5144112", "text": "function secondCustomerShoppingCard(ifExceedsFifty) {\n return (ifExceedsFifty> 50 ? (ifExceedsFifty*80/100):ifExceedsFifty)\n}", "title": "" }, { "docid": "0bd50f223afb04acca00240cfa16fad5", "score": "0.5136362", "text": "cost(x=player[this.layer].buyables[this.id]) { // cost for buying xth buyable, can be an object if there are multiple currencies\n let cost = Decimal.pow(2, x).times(10).times(Decimal.pow(1.001, x.pow(2)))\n return cost.floor()\n }", "title": "" }, { "docid": "17deccaa34dd8eded70c2729635762bb", "score": "0.513193", "text": "sellMBS(bank, size){\n if (size == 0){\n this.balance = this.balance + this.lower*.75;\n }\n else if (size == 1){\n this.balance = this.balance + this.middle*.75;\n }\n else if (size == 2){\n this.balance = this.balance + this.upper*.75;\n }\n bank.soldMBS[size] += 1;\n }", "title": "" }, { "docid": "626db852a683e10b93b2b3c96db4f8e4", "score": "0.51284415", "text": "function BmrBmiBerekenen() {\n submitHandler();\n // mijnLichaamItems.push({\n // bmr: calories,\n // bmi: bmi,\n // datum: new Date(Date.now()).toLocaleDateString(),\n // });\n\n // verzend naar DB en update lijst (dbFuncties)\n // BerekeningToevoegen(calories, bmi, new Date(Date.now()));\n AddDataToFS(calories.toFixed(2), bmi);\n mijnLichaamVirtualList.update();\n\n}", "title": "" }, { "docid": "deeed4d05dbde8ec8992b28a31cb3cc7", "score": "0.51275355", "text": "function gratuity() {\n return (billAmount * 0.2);\n}", "title": "" }, { "docid": "68269e26cbb13c87a33f3bc3e5b7019b", "score": "0.5126033", "text": "function game(kapital, betammount, bet){\n\n\tvar r = roulette();\n\tvar outcome = 0;\n\toutcome = outcome - betammount; //Der Einsatz wird abgezogen\n\tif(r === bet){ //Wurde richtig getippt, wird der Einsatz verdoppelt\n\t\toutcome = outcome + betammount * 2;\n\t}\n\tif(r === \"green\"){ //Wenn Grün kommt wird die Hälfte des Einsatzes zurückerstattet\n\t\toutcome = outcome + betammount / 2;\n\t}\n\treturn outcome; //Der Gewinn (Negativ oder Positiv) wird zurückgegeben.\n\n}", "title": "" }, { "docid": "45d269e9523fb94c442f0d334c178c00", "score": "0.5116617", "text": "function hight(feet) {\n\n var mile=feet/5280; \n return mile;\n}", "title": "" }, { "docid": "e890fd19827a74da05ef8b478cf02b2d", "score": "0.5110404", "text": "function majBouton() {\n bouton.innerHTML = \"J'ai été clické \" + compteur + \" fois!\";\n compteur += 1;\n}", "title": "" }, { "docid": "c4b5c1ac7bd37192fee582b9c6162674", "score": "0.5106832", "text": "countBmi() {\n var bmi = this.weight/Math.pow(this.height, 2); \n return parseFloat(bmi.toFixed(2));\n \n }", "title": "" }, { "docid": "f0c458a280d8ee26248176ca79078a6b", "score": "0.5101934", "text": "function calcAnim(){\r\n\t\tanimationCpt = animationCpt+1;\r\n\t\tif(animationCpt >100){animationCpt = 0;}\r\n\r\n\t\tif(animationCpt%50==1){\r\n\t\t\tif(meuh<50){meuh=200;}\r\n\t\t\telse{meuh = Math.floor(Math.floor(Math.random() *100)/2);}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "6099b9d170ee9a67dad4321e63059c8d", "score": "0.5096903", "text": "calculRebond(positionYBalle){\r\n //0% de la raquette : sens = 0\r\n //50% de la raquette : sens = 3\r\n //100% de la raquette : sens = 6\r\n //le tout -3\r\n console.log(\"On est la\");\r\n console.log (\"pos balle :\",positionYBalle);\r\n console.log(\"pos raquette :\",this.positionY);\r\n console.log(\"pos relative :\",positionYBalle-this.positionY);\r\n console.log(\"hauteur raquette:\",this.hauteur);\r\n console.log(((positionYBalle - this.positionY)*this.hauteur/6)-3);\r\n //return ((positionYBalle - this.positionY)*this.hauteur/6)-3;\r\n\r\n /*Resultat de debug\r\n console.log(\"positionYBalle : \" , positionYBalle);\r\n console.log(\"this.positionY : \" , this.positionY);\r\n console.log(\"this.hauteur : \" , this.hauteur);\r\n console.log(\"position relative : \" , positionYBalle - this.positionY);\r\n console.log(\"Position relative * 100 : \",(positionYBalle - this.positionY)*6);\r\n console.log(\"Regle de 3 entre 0 et 6 \" , ((positionYBalle - this.positionY)*6/100));\r\n */\r\n return (((positionYBalle - this.positionY)*6/100)-3);\r\n }", "title": "" }, { "docid": "08dd54a0588360c9f686b45415e5b9be", "score": "0.50870514", "text": "combatir() {\n this.datos[0] = this.calculoCombate(this.poke1.getType(), this.poke2.getType(), this.poke1.getAttack(), this.poke2.getDef());\n this.datos[1] = this.calculoCombate(this.poke2.getType(), this.poke1.getType(), this.poke2.getAttack(), this.poke1.getDef());\n let iterator = 1;\n console.log(\"\\n## COMBATE POKEMON ##\\n\" +\n this.poke1.getName() + \" - VS - \" + this.poke2.getName());\n while ((this.poke1.hpCombate > 0) && (this.poke2.hpCombate > 0)) {\n console.log(\"\\n -[ Ronda \" + iterator + \" ]-\");\n if ((iterator % 2) == 0) {\n console.log(this.poke2.getName() + \" inflinje -\" + this.datos[1] +\n \" a \" + this.poke1.getName());\n this.poke1.hpCombate -= this.datos[1];\n }\n else {\n console.log(this.poke1.getName() + \" inflinje -\" + this.datos[0] +\n \" a \" + this.poke2.getName());\n this.poke2.hpCombate -= this.datos[0];\n }\n iterator++;\n console.log(this.poke1.getName() + \" [HP: \" +\n +(this.poke1.hpCombate).toFixed(2) + \"] VS \" +\n this.poke2.getName() + \" [HP: \" +\n +(this.poke2.hpCombate).toFixed(2) + \"]\");\n }\n console.log(\"\\n -> GANADOR: \" +\n (this.poke1.hpCombate <= 0 ? this.poke2.getName() : this.poke1.getName()));\n if (this.poke1.hpCombate <= 0) {\n return this.poke2;\n }\n else {\n return this.poke1;\n }\n }", "title": "" }, { "docid": "d1925f83c36566b50932c838bba4f50e", "score": "0.5084366", "text": "handleUltimateChargeChanged(ratio){\n //fully charged\n if(ratio >= 1){\n this.ultimateChargeBar.children.each((gameObject) => {\n gameObject.setTint(0x00ff00);\n });\n }else{\n this.ultimateChargeBar.children.each((gameObject, index) => {\n const check = (index + 1) / 10;\n if(ratio >= check){\n gameObject.setTint(0xff0000);\n }else{\n gameObject.setTint(0xffffff);\n }\n });\n }\n }", "title": "" }, { "docid": "b20a7d90f354cf030631bac1318cdb38", "score": "0.50827056", "text": "function twentyDollarBills() {\n var dollarsTotal = Number(dollarsChange());\n if (dollarsTotal < 20) {\n return 0\n }\n else {\n return Math.floor(dollarsTotal/20);\n }\n\n}", "title": "" }, { "docid": "0fc233917d81acf05dac686b176a9463", "score": "0.5082665", "text": "function hitung_ck(harga,tujuan){\n\t\t\tvar berat = $(\"#berat_ck\").val();\n\t\t\tvar volume = $(\"#volume_ck\").val();\n\t\t\tif(berat!='' && volume!=''){\n\t\t\tif(parseInt(berat) > parseInt(volume)){\n\t\t\t\t\tvar jumlah = harga*berat;\n\t\t\t\t}else{\n\t\t\t\t\tvar jumlah = harga*volume;\n\t\t\t\t}\n\t\t\t$(\"#biaya_kirim_ck\").val(jumlah);\n\t\t\t$(\"#b_kirim_ck\").html(rupiah(jumlah));\n\t\t\thitung_total_ck();\t\t\n\t\t}}", "title": "" }, { "docid": "497fbc01cd1b7271e0f88d1d56a44863", "score": "0.5074486", "text": "function compcrackedgrains(cracked){\t\t//Compute Cracked Grains\n\tvar val = (cracked/100)*100;\n\treturn round(val);\n}", "title": "" }, { "docid": "800d17cd2c4a59440c09f5b55b439427", "score": "0.50737315", "text": "function dialyGambling() {\n winnigCash = 0\n cash = STAKE_FOR_EVERY_DAY\n while (cash > LOWER_LIMIT && cash < UPPER_LIMIT) {\n var randonValue = Math.random()\n //Ternary operator\n randonValue < 0.5 ? cash += BET : cash -= BET\n }\n winnigCash = cash - STAKE_FOR_EVERY_DAY\n return winnigCash\n}", "title": "" }, { "docid": "e97b89c12bc0a1ada0adf3b027ce4c4c", "score": "0.50736594", "text": "function calcHeightRocket(){\n\t\theightRocket = (background.y+3600)*28;//100000/3600=28\n\t\tunit = \"m\";\n\t\t//change units to km\n\t\tif (heightRocket > 15000){\n\t\t\theightRocket = heightRocket/1000;\n\t\t\theightRocket = Math.round(heightRocket * 100) / 100;\n\t\t\tunit = \"km\";\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "8dd4c41949b1192138ba18384fcefdd0", "score": "0.5069053", "text": "function ProgressoConsumo(limite,gasto){\n var result = (gasto*100)/limite;\n return result;\n}", "title": "" }, { "docid": "6c5db04ca155790a8840bcf770186efb", "score": "0.50610626", "text": "collectOil() {\n let newOilAmount =\n this.state.gallonsCollected +\n this.oilLocations[this.state.currentLocation].oilAmount;\n if (newOilAmount >= 400) this.props.criteriaMet();\n this.setState({\n gallonsCollected:\n this.state.gallonsCollected +\n this.oilLocations[this.state.currentLocation].oilAmount\n });\n this.oilLocations[this.state.currentLocation].oilAmount = 0;\n }", "title": "" }, { "docid": "9c53d2333712ee2092065474560049d5", "score": "0.50609833", "text": "function timbreColegioAbogadosF(monto) {\n timbreColegio = 0;\n if (monto <= 250000) timbreColegio = 0;\n if (monto > 250000 && monto <= 1000000) timbreColegio = 1100;\n if (monto > 1000000 && monto <= 5000000) timbreColegio = 2200;\n if (monto > 5000000 && monto <= 25000000) timbreColegio = 5500;\n if (monto > 25000000 && monto <= 50000000) timbreColegio = 11000;\n if (monto > 50000000 && monto <= 100000000) timbreColegio = 16500;\n if (monto > 100000000 && monto <= 500000000) timbreColegio = 27500;\n if (monto > 500000000) timbreColegio = 55000;\n\n descuento = .94;\n return timbreColegio * descuento;\n}", "title": "" }, { "docid": "1247990a2def9853ef82b73693b77713", "score": "0.5048948", "text": "function EBIT(revenue,cogs,opr_expense){\n return (((revenue - cogs - opr_expense )*100)/revenue)/100\n}", "title": "" }, { "docid": "17a1f40df29fdcf1eb579d29acd3a057", "score": "0.5047792", "text": "function defineHeartSpeed(){\n if(heartSpeed === 60){\n heartRate = 60;\n }else if(heartSpeed > 60 && heartSpeed < 80){\n heartRate = 50;\n }else if(heartSpeed > 80 && heartSpeed < 100){\n heartRate = 40;\n }else if(heartSpeed > 100 && heartSpeed < 120){\n heartRate = 30;\n }else if(heartSpeed > 120 && heartSpeed < 140){\n heartRate = 20;\n }else if(heartSpeed > 140 && heartSpeed < 160){\n heartRate = 10;\n }else if(heartRate > 160){\n heartRate = 5;\n }\n}", "title": "" }, { "docid": "f694e00bc8d9930c3d8369a9eb2bd094", "score": "0.5046468", "text": "calcBmi() {\n const RUNDUNG = 10 * AUF_STELLEN_RUNDEN\n\n // Null abfangen, da wir sonst durch 0 teilen.\n if (this._groesse === 0) {\n this._bmi = -1\n return\n }\n\n // Wir geben die Größe in cm an - BMI Formel will aber m\n const groesseInMetern = this.groesse / 100\n\n // Die eigentliche Formel nach Wikipedia:\n // -> https://de.wikipedia.org/wiki/Body-Mass-Index\n const bmi = this.gewicht / (groesseInMetern * groesseInMetern)\n\n // BMI nach festgelegter Rundung runden\n this._bmi = Math.round(RUNDUNG * bmi) / RUNDUNG\n }", "title": "" }, { "docid": "b45bd9c5338335cd2ce90fbfd5fbb447", "score": "0.50427413", "text": "function brakeWagonFunction(config, valueBrake) {\r\n log.writeLine(\"mouveWagon function start\");\r\n log.writeLine(\"speedWagon for mouve : \" +decimalToHexString(speedWagon) +\"%\");\r\n\r\n cpt = 0;\r\n\r\n // low brake\r\n const interval = setInterval( function () {\r\n cpt += 10;\r\n if (cpt >= valueBrake)\r\n clearInterval( interval);\r\n i2cManager.sendData(0x03, decimalToHexString(valueBrake * config.coeffBrakeWagon));\r\n\r\n }, 500);\r\n\r\n log.writeLine(\"End of function brakeWagon\");\r\n}", "title": "" }, { "docid": "b94da3cbc45cb3b6e37053c8785f9539", "score": "0.50405085", "text": "function hbeat(h)\r\n{ \r\n \r\n if(h >=20 && h<=50)\r\n {\r\n return Math.round(206.9 - (0.67 * h));\r\n }\r\n else\r\n {\r\n return -1;\r\n }\r\n}", "title": "" }, { "docid": "4800f819ded7a3d2e1c02acdc20af56d", "score": "0.50403583", "text": "function calculateMileagePerKilometre(mileage) {\n return mileage / 100\n}", "title": "" }, { "docid": "2634757bcd935eff93639765313d379f", "score": "0.50391585", "text": "recentrer() {\n this.gauche = terrain.largeur / 2 - this.largeur / 2;\n this.haut = terrain.hauteur / 2 - this.hauteur / 2;\n\n this.angle = this.defAngle();\n this.vitesseDeBase();\n }", "title": "" }, { "docid": "755996a5fd739bc23de8b03b5de69f41", "score": "0.5037778", "text": "function solve(arr){\n var bagOfCoins = arr;\n var amountOfAll = 0;\n for (var i = 0; i < bagOfCoins.length; i++) {\n var obj = bagOfCoins[i].split(\" \");\n var isItCoin = obj[0].toLowerCase();\n var amount = Number(obj[1]);\n\n if(isItCoin === 'coin'){\n if(amount === parseInt(amount, 10) && amount >0){\n amountOfAll+=amount;\n }\n }\n }\n\n //console.log(amountOfAll);\n var gold = Math.floor(amountOfAll/100);\n amountOfAll -= (gold * 100)\n //console.log(amountOfAll);\n var silver = Math.floor(amountOfAll/10);\n amountOfAll-= (silver * 10);\n var bronze = amountOfAll;\n\n console.log('gold : '+ gold);\n console.log('silver : ' + silver);\n console.log('bronze : '+ bronze);\n\n}", "title": "" }, { "docid": "fdaf2ca90b3d921a53e997bf0e5dbe3f", "score": "0.50291705", "text": "function brickCalculator(floor){\n const brickPerFeet = 1000;\n var firstTenFloor = 10;\n var secondTenFloor = 10;\n \n if(floor > 20){\n var a = floor - 20;\n var totalBricks = (a * 10 * 1000) + (firstTenFloor * 15 * 1000) + (secondTenFloor * 12 * 1000);\n return totalBricks;\n }\n else if(floor > 10 && floor <= 20){\n var b = floor - secondTenFloor;\n var totalBricks = (firstTenFloor * 15 * 1000) + (b * 12 * 1000);\n return totalBricks;\n }\n else{\n floorHight = 15;\n var totalBricks = brickPerFeet * floorHight * floor;\n return totalBricks;\n }\n}", "title": "" }, { "docid": "e83e3627396a16fc567cbf503ceb70f4", "score": "0.5027831", "text": "function t96boardeval(board,player)\n { var value = 0; var position;\n for (position in board)\n { value += board[position]*t96value[position]; }\n return(player*value); }", "title": "" }, { "docid": "52ff220873736247b17794f09d2221ae", "score": "0.5025855", "text": "function brickCalculator(floor) {\n var building_Height, total_brick;\n if (floor < 0) {\n return 0;\n }\n else if (floor <= 10) {\n building_Height = floor * 15;\n total_brick = building_Height * 1000;\n return total_brick;\n }\n else if (floor > 10 && floor <= 20) {\n building_Height = 150 + (floor - 10) * 12;\n total_brick = building_Height * 1000;\n return total_brick;\n }\n else if (floor > 20) {\n building_Height = 270 + (floor - 20) * 10;\n total_brick = building_Height * 1000;\n return total_brick;\n }\n}", "title": "" }, { "docid": "19eda879ed5cc0554f8a00821dea001f", "score": "0.5020145", "text": "function makeChange() {\n \ttotalChange = (Math.round(totalChange * 100)) / 100;\n\n \tif (totalChange >= 100 && cid[8][1] !== 0) {\n \t\tvar hundreds = Math.floor(totalChange / 100);\n\n \t\tif (cid[8][1] >= (hundreds * 20)) {\n\t \t\tchange.push([\"HUNDRED\", hundreds * 20])\n\t \t\ttotalChange -= hundreds * 20;\n\t \t\tcid[8][1] -= hundreds * 20;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"HUNDRED\", cid[8][1]])\n\t \t\ttotalChange -= cid[8][1];\n\t \t\tcid[8][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n \t\n \telse if (totalChange >= 20 && cid[7][1] !== 0) {\n \t\tvar twenties = Math.floor(totalChange / 20);\n\n \t\tif (cid[7][1] >= (twenties * 20)) {\n\t \t\tchange.push([\"TWENTY\", twenties * 20])\n\t \t\ttotalChange -= twenties * 20;\n\t \t\tcid[7][1] -= twenties * 20;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"TWENTY\", cid[7][1]])\n\t \t\ttotalChange -= cid[7][1];\n\t \t\tcid[7][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n \t\n \telse if (totalChange >= 10 && cid[6][1] !== 0) {\n \t\t\n \t\tvar tens = Math.floor(totalChange / 10);\n \t\t\n \t\tif (cid[6][1] >= tens * 10) {\n\t \t\tchange.push([\"TEN\", tens * 10])\n\t \t\ttotalChange -= tens * 10;\n\t \t\tcid[6][1] -= tens * 10;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"TEN\", cid[6][1]])\n\t \t\ttotalChange -= cid[6][1];\n\t \t\tcid[6][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n\n \telse if (totalChange >= 5 && cid[5][1] !== 0) {\n \t\t\n \t\tvar fives = Math.floor(totalChange / 5);\n \t\t\n \t\tif (cid[5][1] >= fives * 5) {\n\t \t\tchange.push([\"FIVE\", fives * 5])\n\t \t\ttotalChange -= fives * 5;\n\t \t\tcid[5][1] -= fives * 5;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"FIVE\", cid[5][1]])\n\t \t\ttotalChange -= cid[5][1];\n\t \t\tcid[5][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n\n \telse if (totalChange >= 1 && cid[4][1] !== 0) {\n \t\t\n \t\tvar ones = Math.floor(totalChange / 1);\n \t\t\n \t\tif (cid[4][1] >= ones * 1) {\n\t \t\tchange.push([\"ONE\", ones * 1])\n\t \t\ttotalChange -= ones * 1;\n\t \t\tcid[4][1] -= ones * 1;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"ONE\", cid[4][1]])\n\t \t\ttotalChange -= cid[4][1];\n\t \t\tcid[4][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n\n \telse if (totalChange >= .25 && cid[3][1] !== 0) {\n \t\t\n \t\tvar quarters = Math.floor(totalChange / .25);\n \t\t\n \t\tif (cid[3][1] >= quarters * .25) {\n\t \t\tchange.push([\"QUARTER\", quarters * .25])\n\t \t\ttotalChange -= quarters * .25;\n\t \t\tcid[3][1] -= quarters * .25;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"QUARTER\", cid[3][1]])\n\t \t\ttotalChange -= cid[3][1];\n\t \t\tcid[3][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n\n \telse if (totalChange >= .1 && cid[2][1] !== 0) {\n \t\t\n \t\tvar dimes = Math.floor(totalChange / .1);\n \t\t\n \t\tif (cid[2][1] >= dimes * .1) {\n\t \t\tchange.push([\"DIME\", dimes * .1])\n\t \t\ttotalChange -= dimes * .1;\n\t \t\tcid[2][1] -= dimes * .1;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"DIME\", cid[2][1]])\n\t \t\ttotalChange -= cid[2][1];\n\t \t\tcid[2][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n\n \telse if (totalChange >= .05 && cid[1][1] !== 0) {\n \t\t\n \t\tvar nickels = Math.floor(totalChange / .05);\n \t\t\n \t\tif (cid[1][1] >= nickels * .05) {\n\t \t\tchange.push([\"NICKEL\", nickels * .05])\n\t \t\ttotalChange -= nickels * .05;\n\t \t\tcid[1][1] -= nickels * .05;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"NICKEL\", cid[1][1]])\n\t \t\ttotalChange -= cid[1][1];\n\t \t\tcid[1][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n\n \telse if (totalChange >= .01 && cid[0][1] !== 0) {\n \t\t\n \t\tvar pennies = Math.floor(totalChange / .01);\n \t\t\n \t\tif (cid[0][1] >= pennies * .01) {\n\t \t\tchange.push([\"PENNY\", pennies * .01])\n\t \t\ttotalChange -= pennies * .01;\n\t \t\tcid[0][1] -= pennies * .01;\n\t \t}\n\t \telse {\n\t \t\tchange.push([\"PENNY\", cid[0][1]])\n\t \t\ttotalChange -= cid[0][1];\n\t \t\tcid[0][1] = 0;\n\t \t}\n \t\tmakeChange();\n \t}\n }", "title": "" }, { "docid": "682e9ea54ce8692ad80d4ec88c26c390", "score": "0.5018518", "text": "cdo(lowers, middles, uppers, rating){\n this.mortgages[0] = this.mortgages[0] + lowers;\n this.mortgages[1] = this.mortgages[1] + middles;\n this.mortgages[2] = this.mortgages[2] + uppers;\n this.balance = this.balance - lowers*this.lower -\n middles*this.middle - uppers*this.upper - 20*(1 + rating);\n }", "title": "" }, { "docid": "f92c40ee4cc0bf4ce4fa1566f07d1df9", "score": "0.50155824", "text": "function brickCalculator(buidingFloor) {\n var totalBrick = 0;\n var oneToTenHeight = 10 * 15 * 1000;\n var elevenToTwentyHeight = oneToTenHeight + (10 * 12 * 1000);\n var twentyOneToAbove = elevenToTwentyHeight + (10 * 1000 * (buidingFloor-20));\n\n if (buidingFloor < 0) {\n return \"Building height Can not be Negative\";\n }\n\n if (buidingFloor > 0) {\n if (buidingFloor <= 10) {\n totalBrick = (buidingFloor * 15) * 1000; \n }\n else if (buidingFloor > 10 && buidingFloor <= 20) {\n totalBrick = oneToTenHeight + ((buidingFloor - 10) * 12) * 1000; \n }\n else {\n totalBrick = twentyOneToAbove; \n }\n }\n return totalBrick;\n}", "title": "" }, { "docid": "5cd27e25b4244e5d4197f5845f94e5dd", "score": "0.5011893", "text": "function bmiCalculator(weight,height){\n return (weight)/(height*height);\n}", "title": "" }, { "docid": "226fb5d15996adf80fa1cc2b883b1fbb", "score": "0.5009717", "text": "score() {\n\t\t\treturn this.hub === 'crm' ? 100 : 20;\n\t\t}", "title": "" }, { "docid": "53e9bab87be9a13be2a2c69a5e65f2db", "score": "0.50022054", "text": "async borrowRate() {\n return (await this.contract.methods.borrowRatePerBlock().call()) / 1e18;\n }", "title": "" }, { "docid": "50d51d67f1222e80f096d588f7f9a4e9", "score": "0.5001943", "text": "function tipCalculator(bill) {\n var tip;\n if (bill < 50){\n tip = 0.2;\n } else if (bill >= 50 && bill <= 200){\n tip = 0.15;\n } else {\n tip = 0.1;\n }\n return tip * bill;\n}", "title": "" }, { "docid": "610dfa16a7b36e1c2e13a62576f0bd0c", "score": "0.4999103", "text": "function actualGrowthMultiplier() { \n return playerHackingGrowMult * bitnodeGrowMult; \n}", "title": "" }, { "docid": "26780fbd6ae5a9c95e49b53a39e543af", "score": "0.49957606", "text": "function renderPercent(data){\n let percent = (data / 30) * 100;\n return Math.round(percent);\n }", "title": "" }, { "docid": "759143c54a4a06b5038451c4b4a9dff8", "score": "0.49954247", "text": "get progress() {\n let percent = (this.orders / this.goal) * 100;\n\n return percent > 100 ? 100 : percent;\n }", "title": "" }, { "docid": "6ff14d9a473a9a1bb0cb34fe091e9b7f", "score": "0.49888125", "text": "function timbreCruzRojaF(monto) {\n valor = 500;\n descuento = .94;\n return valor * descuento;\n}", "title": "" } ]
9330a2b73f3e87b9cab4ba64bb54f398
ECMA262 11.8.6 Template Literal Lexical Components
[ { "docid": "a18cad398725b854c1be7191a2a18247", "score": "0.58804244", "text": "function scanTemplate() {\n\t var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\t\n\t terminated = false;\n\t tail = false;\n\t start = index;\n\t head = (source[index] === '`');\n\t rawOffset = 2;\n\t\n\t ++index;\n\t\n\t while (index < length) {\n\t ch = source[index++];\n\t if (ch === '`') {\n\t rawOffset = 1;\n\t tail = true;\n\t terminated = true;\n\t break;\n\t } else if (ch === '$') {\n\t if (source[index] === '{') {\n\t state.curlyStack.push('${');\n\t ++index;\n\t terminated = true;\n\t break;\n\t }\n\t cooked += ch;\n\t } else if (ch === '\\\\') {\n\t ch = source[index++];\n\t if (!isLineTerminator(ch.charCodeAt(0))) {\n\t switch (ch) {\n\t case 'n':\n\t cooked += '\\n';\n\t break;\n\t case 'r':\n\t cooked += '\\r';\n\t break;\n\t case 't':\n\t cooked += '\\t';\n\t break;\n\t case 'u':\n\t case 'x':\n\t if (source[index] === '{') {\n\t ++index;\n\t cooked += scanUnicodeCodePointEscape();\n\t } else {\n\t restore = index;\n\t unescaped = scanHexEscape(ch);\n\t if (unescaped) {\n\t cooked += unescaped;\n\t } else {\n\t index = restore;\n\t cooked += ch;\n\t }\n\t }\n\t break;\n\t case 'b':\n\t cooked += '\\b';\n\t break;\n\t case 'f':\n\t cooked += '\\f';\n\t break;\n\t case 'v':\n\t cooked += '\\v';\n\t break;\n\t\n\t default:\n\t if (ch === '0') {\n\t if (isDecimalDigit(source.charCodeAt(index))) {\n\t // Illegal: \\01 \\02 and so on\n\t throwError(Messages.TemplateOctalLiteral);\n\t }\n\t cooked += '\\0';\n\t } else if (isOctalDigit(ch)) {\n\t // Illegal: \\1 \\2\n\t throwError(Messages.TemplateOctalLiteral);\n\t } else {\n\t cooked += ch;\n\t }\n\t break;\n\t }\n\t } else {\n\t ++lineNumber;\n\t if (ch === '\\r' && source[index] === '\\n') {\n\t ++index;\n\t }\n\t lineStart = index;\n\t }\n\t } else if (isLineTerminator(ch.charCodeAt(0))) {\n\t ++lineNumber;\n\t if (ch === '\\r' && source[index] === '\\n') {\n\t ++index;\n\t }\n\t lineStart = index;\n\t cooked += '\\n';\n\t } else {\n\t cooked += ch;\n\t }\n\t }\n\t\n\t if (!terminated) {\n\t throwUnexpectedToken();\n\t }\n\t\n\t if (!head) {\n\t state.curlyStack.pop();\n\t }\n\t\n\t return {\n\t type: Token.Template,\n\t value: {\n\t cooked: cooked,\n\t raw: source.slice(start + 1, index - rawOffset)\n\t },\n\t head: head,\n\t tail: tail,\n\t lineNumber: lineNumber,\n\t lineStart: lineStart,\n\t start: start,\n\t end: index\n\t };\n\t }", "title": "" } ]
[ { "docid": "df38159d4e16d05cb31bc60cfb2f42c6", "score": "0.70186543", "text": "function thing() {\n return `template <NBSP>string`;\n}", "title": "" }, { "docid": "328943b757dff456c0f3d5c9f777226e", "score": "0.6370927", "text": "function visitTemplateLiteral(node) {\n return ts.setTextRange(ts.createLiteral(node.text), node);\n }", "title": "" }, { "docid": "957fc5ec0895a5cb40c6e278e279cd01", "score": "0.629492", "text": "function declarationClass(){\n const firstName = \"Ricardo\";\n const lastName = \"Milos\"; \n\n return(\n <p>Hello {firstName + \" \" + lastName} !</p> //everythign inside {} is look as JavaScript\n //<p>Hello {`${firstName} ${lastName}`} !</p> \n )\n}", "title": "" }, { "docid": "cd5d883872bc1581d26a09e7b8f79787", "score": "0.6174701", "text": "function tag(strings, ...values) {\n log(strings)\n log(strings[0])\n log(strings[1])\n log(values)\n return 'Tagged Template Literals made Styled Components'\n}", "title": "" }, { "docid": "c791442cbd6098688c06694d020d459c", "score": "0.60822606", "text": "function visitTemplateExpression(node) {\n var expressions = [];\n addTemplateHead(expressions, node);\n addTemplateSpans(expressions, node);\n // createAdd will check if each expression binds less closely than binary '+'.\n // If it does, it wraps the expression in parentheses. Otherwise, something like\n // `abc${ 1 << 2 }`\n // becomes\n // \"abc\" + 1 << 2 + \"\"\n // which is really\n // (\"abc\" + 1) << (2 + \"\")\n // rather than\n // \"abc\" + (1 << 2) + \"\"\n var expression = ts.reduceLeft(expressions, ts.createAdd);\n if (ts.nodeIsSynthesized(expression)) {\n expression.pos = node.pos;\n expression.end = node.end;\n }\n return expression;\n }", "title": "" }, { "docid": "c8a60e75ba103b5d8df5c3652dedc8fa", "score": "0.60326225", "text": "function is_literal(component) {\n return is_tagged_list(component, \"literal\");\n}", "title": "" }, { "docid": "02b7249eeb9e781ad84d2577eda1b2ec", "score": "0.6012724", "text": "enterLiteral(ctx) {\n\t}", "title": "" }, { "docid": "babe91138484234670b17d3a10e6f40e", "score": "0.5942653", "text": "function lit(value) { return new TLiteral(value); }", "title": "" }, { "docid": "b2ed21ef08d021a4f1e9280d1a09dda3", "score": "0.5924505", "text": "function doTemplateLiteral(context, leftOrRbp) {\n // ASSERT: this.type === \"(template)\"\n // jshint validthis: true\n var ctx = this.context;\n var noSubst = this.noSubst;\n var depth = this.depth;\n var left = typeof leftOrRbp === \"number\" ? null : leftOrRbp;\n\n if (!noSubst) {\n while (!end()) {\n if (!state.tokens.next.template || state.tokens.next.depth > depth) {\n expression(context, 0); // should probably have different rbp?\n } else {\n // skip template start / middle\n advance();\n }\n }\n }\n\n return {\n id: \"(template)\",\n type: \"(template)\",\n tag: left\n };\n\n function end() {\n if (state.tokens.curr.template && state.tokens.curr.tail &&\n state.tokens.curr.context === ctx) {\n /* istanbul ignore next */\n return true;\n }\n var complete = (state.tokens.next.template && state.tokens.next.tail &&\n state.tokens.next.context === ctx);\n if (complete) advance();\n return complete || state.tokens.next.isUnclosed;\n }\n }", "title": "" }, { "docid": "4a5c5eaf3804554bbcabb94ced735f71", "score": "0.589117", "text": "function ce(elt) {\n return `<${elt}></${elt}>`\n}", "title": "" }, { "docid": "1cab1a0648c64a333effcf7602aaeebf", "score": "0.58599854", "text": "function scanTemplateAndSetTokenValue() {\n\t var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */;\n\t pos++;\n\t var start = pos;\n\t var contents = \"\";\n\t var resultingToken;\n\t while (true) {\n\t if (pos >= end) {\n\t contents += text.substring(start, pos);\n\t tokenIsUnterminated = true;\n\t error(ts.Diagnostics.Unterminated_template_literal);\n\t resultingToken = startedWithBacktick ? 11 /* NoSubstitutionTemplateLiteral */ : 14 /* TemplateTail */;\n\t break;\n\t }\n\t var currChar = text.charCodeAt(pos);\n\t // '`'\n\t if (currChar === 96 /* backtick */) {\n\t contents += text.substring(start, pos);\n\t pos++;\n\t resultingToken = startedWithBacktick ? 11 /* NoSubstitutionTemplateLiteral */ : 14 /* TemplateTail */;\n\t break;\n\t }\n\t // '${'\n\t if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) {\n\t contents += text.substring(start, pos);\n\t pos += 2;\n\t resultingToken = startedWithBacktick ? 12 /* TemplateHead */ : 13 /* TemplateMiddle */;\n\t break;\n\t }\n\t // Escape character\n\t if (currChar === 92 /* backslash */) {\n\t contents += text.substring(start, pos);\n\t contents += scanEscapeSequence();\n\t start = pos;\n\t continue;\n\t }\n\t // Speculated ECMAScript 6 Spec 11.8.6.1:\n\t // <CR><LF> and <CR> LineTerminatorSequences are normalized to <LF> for Template Values\n\t if (currChar === 13 /* carriageReturn */) {\n\t contents += text.substring(start, pos);\n\t pos++;\n\t if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) {\n\t pos++;\n\t }\n\t contents += \"\\n\";\n\t start = pos;\n\t continue;\n\t }\n\t pos++;\n\t }\n\t ts.Debug.assert(resultingToken !== undefined);\n\t tokenValue = contents;\n\t return resultingToken;\n\t }", "title": "" }, { "docid": "91ce086b0316b5db6e998a65c995e77e", "score": "0.5858871", "text": "function scanTemplate() {\n\t var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n\t terminated = false;\n\t tail = false;\n\t start = index;\n\t head = (source[index] === '`');\n\t rawOffset = 2;\n\n\t ++index;\n\n\t while (index < length) {\n\t ch = source[index++];\n\t if (ch === '`') {\n\t rawOffset = 1;\n\t tail = true;\n\t terminated = true;\n\t break;\n\t } else if (ch === '$') {\n\t if (source[index] === '{') {\n\t state.curlyStack.push('${');\n\t ++index;\n\t terminated = true;\n\t break;\n\t }\n\t cooked += ch;\n\t } else if (ch === '\\\\') {\n\t ch = source[index++];\n\t if (!isLineTerminator(ch.charCodeAt(0))) {\n\t switch (ch) {\n\t case 'n':\n\t cooked += '\\n';\n\t break;\n\t case 'r':\n\t cooked += '\\r';\n\t break;\n\t case 't':\n\t cooked += '\\t';\n\t break;\n\t case 'u':\n\t case 'x':\n\t if (source[index] === '{') {\n\t ++index;\n\t cooked += scanUnicodeCodePointEscape();\n\t } else {\n\t restore = index;\n\t unescaped = scanHexEscape(ch);\n\t if (unescaped) {\n\t cooked += unescaped;\n\t } else {\n\t index = restore;\n\t cooked += ch;\n\t }\n\t }\n\t break;\n\t case 'b':\n\t cooked += '\\b';\n\t break;\n\t case 'f':\n\t cooked += '\\f';\n\t break;\n\t case 'v':\n\t cooked += '\\v';\n\t break;\n\n\t default:\n\t if (ch === '0') {\n\t if (isDecimalDigit(source.charCodeAt(index))) {\n\t // Illegal: \\01 \\02 and so on\n\t throwError(Messages.TemplateOctalLiteral);\n\t }\n\t cooked += '\\0';\n\t } else if (isOctalDigit(ch)) {\n\t // Illegal: \\1 \\2\n\t throwError(Messages.TemplateOctalLiteral);\n\t } else {\n\t cooked += ch;\n\t }\n\t break;\n\t }\n\t } else {\n\t ++lineNumber;\n\t if (ch === '\\r' && source[index] === '\\n') {\n\t ++index;\n\t }\n\t lineStart = index;\n\t }\n\t } else if (isLineTerminator(ch.charCodeAt(0))) {\n\t ++lineNumber;\n\t if (ch === '\\r' && source[index] === '\\n') {\n\t ++index;\n\t }\n\t lineStart = index;\n\t cooked += '\\n';\n\t } else {\n\t cooked += ch;\n\t }\n\t }\n\n\t if (!terminated) {\n\t throwUnexpectedToken();\n\t }\n\n\t if (!head) {\n\t state.curlyStack.pop();\n\t }\n\n\t return {\n\t type: Token.Template,\n\t value: {\n\t cooked: cooked,\n\t raw: source.slice(start + 1, index - rawOffset)\n\t },\n\t head: head,\n\t tail: tail,\n\t lineNumber: lineNumber,\n\t lineStart: lineStart,\n\t start: start,\n\t end: index\n\t };\n\t }", "title": "" }, { "docid": "b0970c17b25a4c818228dbf36271dd9f", "score": "0.58442384", "text": "function MiComponenteFuncional() {\n return <p>Hola Mundo \"Mi componente funcional\"</p>;\n}", "title": "" }, { "docid": "2777eedf0236094e0f42ad999469ee4d", "score": "0.58259565", "text": "function scanTemplateAndSetTokenValue() {\n var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */;\n pos++;\n var start = pos;\n var contents = \"\";\n var resultingToken;\n while (true) {\n if (pos >= end) {\n contents += text.substring(start, pos);\n tokenIsUnterminated = true;\n error(ts.Diagnostics.Unterminated_template_literal);\n resultingToken = startedWithBacktick ? 13 /* NoSubstitutionTemplateLiteral */ : 16 /* TemplateTail */;\n break;\n }\n var currChar = text.charCodeAt(pos);\n // '`'\n if (currChar === 96 /* backtick */) {\n contents += text.substring(start, pos);\n pos++;\n resultingToken = startedWithBacktick ? 13 /* NoSubstitutionTemplateLiteral */ : 16 /* TemplateTail */;\n break;\n }\n // '${'\n if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) {\n contents += text.substring(start, pos);\n pos += 2;\n resultingToken = startedWithBacktick ? 14 /* TemplateHead */ : 15 /* TemplateMiddle */;\n break;\n }\n // Escape character\n if (currChar === 92 /* backslash */) {\n contents += text.substring(start, pos);\n contents += scanEscapeSequence();\n start = pos;\n continue;\n }\n // Speculated ECMAScript 6 Spec 11.8.6.1:\n // <CR><LF> and <CR> LineTerminatorSequences are normalized to <LF> for Template Values\n if (currChar === 13 /* carriageReturn */) {\n contents += text.substring(start, pos);\n pos++;\n if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) {\n pos++;\n }\n contents += \"\\n\";\n start = pos;\n continue;\n }\n pos++;\n }\n ts.Debug.assert(resultingToken !== undefined);\n tokenValue = contents;\n return resultingToken;\n }", "title": "" }, { "docid": "4e115a97f7c7e14536078e6936020593", "score": "0.5812496", "text": "function scanTemplate() {\n var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n terminated = false;\n tail = false;\n start = index;\n head = (source[index] === '`');\n rawOffset = 2;\n\n ++index;\n\n while (index < length) {\n ch = source[index++];\n if (ch === '`') {\n rawOffset = 1;\n tail = true;\n terminated = true;\n break;\n } else if (ch === '$') {\n if (source[index] === '{') {\n state.curlyStack.push('${');\n ++index;\n terminated = true;\n break;\n }\n cooked += ch;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n cooked += '\\n';\n break;\n case 'r':\n cooked += '\\r';\n break;\n case 't':\n cooked += '\\t';\n break;\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n cooked += scanUnicodeCodePointEscape();\n } else {\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n cooked += unescaped;\n } else {\n index = restore;\n cooked += ch;\n }\n }\n break;\n case 'b':\n cooked += '\\b';\n break;\n case 'f':\n cooked += '\\f';\n break;\n case 'v':\n cooked += '\\v';\n break;\n\n default:\n if (ch === '0') {\n if (isDecimalDigit(source.charCodeAt(index))) {\n // Illegal: \\01 \\02 and so on\n throwError(Messages.TemplateOctalLiteral);\n }\n cooked += '\\0';\n } else if (isOctalDigit(ch)) {\n // Illegal: \\1 \\2\n throwError(Messages.TemplateOctalLiteral);\n } else {\n cooked += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n cooked += '\\n';\n } else {\n cooked += ch;\n }\n }\n\n if (!terminated) {\n throwUnexpectedToken();\n }\n\n if (!head) {\n state.curlyStack.pop();\n }\n\n return {\n type: Token.Template,\n value: {\n cooked: cooked,\n raw: source.slice(start + 1, index - rawOffset)\n },\n head: head,\n tail: tail,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "title": "" }, { "docid": "4e115a97f7c7e14536078e6936020593", "score": "0.5812496", "text": "function scanTemplate() {\n var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n terminated = false;\n tail = false;\n start = index;\n head = (source[index] === '`');\n rawOffset = 2;\n\n ++index;\n\n while (index < length) {\n ch = source[index++];\n if (ch === '`') {\n rawOffset = 1;\n tail = true;\n terminated = true;\n break;\n } else if (ch === '$') {\n if (source[index] === '{') {\n state.curlyStack.push('${');\n ++index;\n terminated = true;\n break;\n }\n cooked += ch;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n cooked += '\\n';\n break;\n case 'r':\n cooked += '\\r';\n break;\n case 't':\n cooked += '\\t';\n break;\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n cooked += scanUnicodeCodePointEscape();\n } else {\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n cooked += unescaped;\n } else {\n index = restore;\n cooked += ch;\n }\n }\n break;\n case 'b':\n cooked += '\\b';\n break;\n case 'f':\n cooked += '\\f';\n break;\n case 'v':\n cooked += '\\v';\n break;\n\n default:\n if (ch === '0') {\n if (isDecimalDigit(source.charCodeAt(index))) {\n // Illegal: \\01 \\02 and so on\n throwError(Messages.TemplateOctalLiteral);\n }\n cooked += '\\0';\n } else if (isOctalDigit(ch)) {\n // Illegal: \\1 \\2\n throwError(Messages.TemplateOctalLiteral);\n } else {\n cooked += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n cooked += '\\n';\n } else {\n cooked += ch;\n }\n }\n\n if (!terminated) {\n throwUnexpectedToken();\n }\n\n if (!head) {\n state.curlyStack.pop();\n }\n\n return {\n type: Token.Template,\n value: {\n cooked: cooked,\n raw: source.slice(start + 1, index - rawOffset)\n },\n head: head,\n tail: tail,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "title": "" }, { "docid": "4e115a97f7c7e14536078e6936020593", "score": "0.5812496", "text": "function scanTemplate() {\n var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n terminated = false;\n tail = false;\n start = index;\n head = (source[index] === '`');\n rawOffset = 2;\n\n ++index;\n\n while (index < length) {\n ch = source[index++];\n if (ch === '`') {\n rawOffset = 1;\n tail = true;\n terminated = true;\n break;\n } else if (ch === '$') {\n if (source[index] === '{') {\n state.curlyStack.push('${');\n ++index;\n terminated = true;\n break;\n }\n cooked += ch;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n cooked += '\\n';\n break;\n case 'r':\n cooked += '\\r';\n break;\n case 't':\n cooked += '\\t';\n break;\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n cooked += scanUnicodeCodePointEscape();\n } else {\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n cooked += unescaped;\n } else {\n index = restore;\n cooked += ch;\n }\n }\n break;\n case 'b':\n cooked += '\\b';\n break;\n case 'f':\n cooked += '\\f';\n break;\n case 'v':\n cooked += '\\v';\n break;\n\n default:\n if (ch === '0') {\n if (isDecimalDigit(source.charCodeAt(index))) {\n // Illegal: \\01 \\02 and so on\n throwError(Messages.TemplateOctalLiteral);\n }\n cooked += '\\0';\n } else if (isOctalDigit(ch)) {\n // Illegal: \\1 \\2\n throwError(Messages.TemplateOctalLiteral);\n } else {\n cooked += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n cooked += '\\n';\n } else {\n cooked += ch;\n }\n }\n\n if (!terminated) {\n throwUnexpectedToken();\n }\n\n if (!head) {\n state.curlyStack.pop();\n }\n\n return {\n type: Token.Template,\n value: {\n cooked: cooked,\n raw: source.slice(start + 1, index - rawOffset)\n },\n head: head,\n tail: tail,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "title": "" }, { "docid": "4e115a97f7c7e14536078e6936020593", "score": "0.5812496", "text": "function scanTemplate() {\n var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n terminated = false;\n tail = false;\n start = index;\n head = (source[index] === '`');\n rawOffset = 2;\n\n ++index;\n\n while (index < length) {\n ch = source[index++];\n if (ch === '`') {\n rawOffset = 1;\n tail = true;\n terminated = true;\n break;\n } else if (ch === '$') {\n if (source[index] === '{') {\n state.curlyStack.push('${');\n ++index;\n terminated = true;\n break;\n }\n cooked += ch;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n cooked += '\\n';\n break;\n case 'r':\n cooked += '\\r';\n break;\n case 't':\n cooked += '\\t';\n break;\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n cooked += scanUnicodeCodePointEscape();\n } else {\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n cooked += unescaped;\n } else {\n index = restore;\n cooked += ch;\n }\n }\n break;\n case 'b':\n cooked += '\\b';\n break;\n case 'f':\n cooked += '\\f';\n break;\n case 'v':\n cooked += '\\v';\n break;\n\n default:\n if (ch === '0') {\n if (isDecimalDigit(source.charCodeAt(index))) {\n // Illegal: \\01 \\02 and so on\n throwError(Messages.TemplateOctalLiteral);\n }\n cooked += '\\0';\n } else if (isOctalDigit(ch)) {\n // Illegal: \\1 \\2\n throwError(Messages.TemplateOctalLiteral);\n } else {\n cooked += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n cooked += '\\n';\n } else {\n cooked += ch;\n }\n }\n\n if (!terminated) {\n throwUnexpectedToken();\n }\n\n if (!head) {\n state.curlyStack.pop();\n }\n\n return {\n type: Token.Template,\n value: {\n cooked: cooked,\n raw: source.slice(start + 1, index - rawOffset)\n },\n head: head,\n tail: tail,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "title": "" }, { "docid": "4e115a97f7c7e14536078e6936020593", "score": "0.5812496", "text": "function scanTemplate() {\n var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n terminated = false;\n tail = false;\n start = index;\n head = (source[index] === '`');\n rawOffset = 2;\n\n ++index;\n\n while (index < length) {\n ch = source[index++];\n if (ch === '`') {\n rawOffset = 1;\n tail = true;\n terminated = true;\n break;\n } else if (ch === '$') {\n if (source[index] === '{') {\n state.curlyStack.push('${');\n ++index;\n terminated = true;\n break;\n }\n cooked += ch;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n cooked += '\\n';\n break;\n case 'r':\n cooked += '\\r';\n break;\n case 't':\n cooked += '\\t';\n break;\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n cooked += scanUnicodeCodePointEscape();\n } else {\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n cooked += unescaped;\n } else {\n index = restore;\n cooked += ch;\n }\n }\n break;\n case 'b':\n cooked += '\\b';\n break;\n case 'f':\n cooked += '\\f';\n break;\n case 'v':\n cooked += '\\v';\n break;\n\n default:\n if (ch === '0') {\n if (isDecimalDigit(source.charCodeAt(index))) {\n // Illegal: \\01 \\02 and so on\n throwError(Messages.TemplateOctalLiteral);\n }\n cooked += '\\0';\n } else if (isOctalDigit(ch)) {\n // Illegal: \\1 \\2\n throwError(Messages.TemplateOctalLiteral);\n } else {\n cooked += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n cooked += '\\n';\n } else {\n cooked += ch;\n }\n }\n\n if (!terminated) {\n throwUnexpectedToken();\n }\n\n if (!head) {\n state.curlyStack.pop();\n }\n\n return {\n type: Token.Template,\n value: {\n cooked: cooked,\n raw: source.slice(start + 1, index - rawOffset)\n },\n head: head,\n tail: tail,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "title": "" }, { "docid": "4e115a97f7c7e14536078e6936020593", "score": "0.5812496", "text": "function scanTemplate() {\n var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n terminated = false;\n tail = false;\n start = index;\n head = (source[index] === '`');\n rawOffset = 2;\n\n ++index;\n\n while (index < length) {\n ch = source[index++];\n if (ch === '`') {\n rawOffset = 1;\n tail = true;\n terminated = true;\n break;\n } else if (ch === '$') {\n if (source[index] === '{') {\n state.curlyStack.push('${');\n ++index;\n terminated = true;\n break;\n }\n cooked += ch;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n cooked += '\\n';\n break;\n case 'r':\n cooked += '\\r';\n break;\n case 't':\n cooked += '\\t';\n break;\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n cooked += scanUnicodeCodePointEscape();\n } else {\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n cooked += unescaped;\n } else {\n index = restore;\n cooked += ch;\n }\n }\n break;\n case 'b':\n cooked += '\\b';\n break;\n case 'f':\n cooked += '\\f';\n break;\n case 'v':\n cooked += '\\v';\n break;\n\n default:\n if (ch === '0') {\n if (isDecimalDigit(source.charCodeAt(index))) {\n // Illegal: \\01 \\02 and so on\n throwError(Messages.TemplateOctalLiteral);\n }\n cooked += '\\0';\n } else if (isOctalDigit(ch)) {\n // Illegal: \\1 \\2\n throwError(Messages.TemplateOctalLiteral);\n } else {\n cooked += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n cooked += '\\n';\n } else {\n cooked += ch;\n }\n }\n\n if (!terminated) {\n throwUnexpectedToken();\n }\n\n if (!head) {\n state.curlyStack.pop();\n }\n\n return {\n type: Token.Template,\n value: {\n cooked: cooked,\n raw: source.slice(start + 1, index - rawOffset)\n },\n head: head,\n tail: tail,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "title": "" }, { "docid": "4e115a97f7c7e14536078e6936020593", "score": "0.5812496", "text": "function scanTemplate() {\n var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n terminated = false;\n tail = false;\n start = index;\n head = (source[index] === '`');\n rawOffset = 2;\n\n ++index;\n\n while (index < length) {\n ch = source[index++];\n if (ch === '`') {\n rawOffset = 1;\n tail = true;\n terminated = true;\n break;\n } else if (ch === '$') {\n if (source[index] === '{') {\n state.curlyStack.push('${');\n ++index;\n terminated = true;\n break;\n }\n cooked += ch;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n cooked += '\\n';\n break;\n case 'r':\n cooked += '\\r';\n break;\n case 't':\n cooked += '\\t';\n break;\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n cooked += scanUnicodeCodePointEscape();\n } else {\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n cooked += unescaped;\n } else {\n index = restore;\n cooked += ch;\n }\n }\n break;\n case 'b':\n cooked += '\\b';\n break;\n case 'f':\n cooked += '\\f';\n break;\n case 'v':\n cooked += '\\v';\n break;\n\n default:\n if (ch === '0') {\n if (isDecimalDigit(source.charCodeAt(index))) {\n // Illegal: \\01 \\02 and so on\n throwError(Messages.TemplateOctalLiteral);\n }\n cooked += '\\0';\n } else if (isOctalDigit(ch)) {\n // Illegal: \\1 \\2\n throwError(Messages.TemplateOctalLiteral);\n } else {\n cooked += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n cooked += '\\n';\n } else {\n cooked += ch;\n }\n }\n\n if (!terminated) {\n throwUnexpectedToken();\n }\n\n if (!head) {\n state.curlyStack.pop();\n }\n\n return {\n type: Token.Template,\n value: {\n cooked: cooked,\n raw: source.slice(start + 1, index - rawOffset)\n },\n head: head,\n tail: tail,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "title": "" }, { "docid": "4e115a97f7c7e14536078e6936020593", "score": "0.5812496", "text": "function scanTemplate() {\n var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;\n\n terminated = false;\n tail = false;\n start = index;\n head = (source[index] === '`');\n rawOffset = 2;\n\n ++index;\n\n while (index < length) {\n ch = source[index++];\n if (ch === '`') {\n rawOffset = 1;\n tail = true;\n terminated = true;\n break;\n } else if (ch === '$') {\n if (source[index] === '{') {\n state.curlyStack.push('${');\n ++index;\n terminated = true;\n break;\n }\n cooked += ch;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'n':\n cooked += '\\n';\n break;\n case 'r':\n cooked += '\\r';\n break;\n case 't':\n cooked += '\\t';\n break;\n case 'u':\n case 'x':\n if (source[index] === '{') {\n ++index;\n cooked += scanUnicodeCodePointEscape();\n } else {\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n cooked += unescaped;\n } else {\n index = restore;\n cooked += ch;\n }\n }\n break;\n case 'b':\n cooked += '\\b';\n break;\n case 'f':\n cooked += '\\f';\n break;\n case 'v':\n cooked += '\\v';\n break;\n\n default:\n if (ch === '0') {\n if (isDecimalDigit(source.charCodeAt(index))) {\n // Illegal: \\01 \\02 and so on\n throwError(Messages.TemplateOctalLiteral);\n }\n cooked += '\\0';\n } else if (isOctalDigit(ch)) {\n // Illegal: \\1 \\2\n throwError(Messages.TemplateOctalLiteral);\n } else {\n cooked += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n cooked += '\\n';\n } else {\n cooked += ch;\n }\n }\n\n if (!terminated) {\n throwUnexpectedToken();\n }\n\n if (!head) {\n state.curlyStack.pop();\n }\n\n return {\n type: Token.Template,\n value: {\n cooked: cooked,\n raw: source.slice(start + 1, index - rawOffset)\n },\n head: head,\n tail: tail,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }", "title": "" }, { "docid": "59fddc42c47c6776b3dd998426f59efd", "score": "0.57914233", "text": "function templateLiteralNode(def) {\n return {\n type: 'TemplateLiteral',\n quasis: [\n {\n type: 'TemplateElement',\n tail: true,\n value: {\n raw: def['Source String'],\n cooked: def['Source String'],\n },\n },\n ],\n expressions: [],\n };\n}", "title": "" }, { "docid": "8853f3c003d2f01565bbdd87a41cd995", "score": "0.5772109", "text": "function parseTemplateElement(option) {\n\t var node, token;\n\t\n\t if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n\t throwUnexpectedToken();\n\t }\n\t\n\t node = new Node();\n\t token = lex();\n\t\n\t return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n\t }", "title": "" }, { "docid": "8853f3c003d2f01565bbdd87a41cd995", "score": "0.5772109", "text": "function parseTemplateElement(option) {\n\t var node, token;\n\t\n\t if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n\t throwUnexpectedToken();\n\t }\n\t\n\t node = new Node();\n\t token = lex();\n\t\n\t return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n\t }", "title": "" }, { "docid": "8853f3c003d2f01565bbdd87a41cd995", "score": "0.5772109", "text": "function parseTemplateElement(option) {\n\t var node, token;\n\t\n\t if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n\t throwUnexpectedToken();\n\t }\n\t\n\t node = new Node();\n\t token = lex();\n\t\n\t return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n\t }", "title": "" }, { "docid": "8853f3c003d2f01565bbdd87a41cd995", "score": "0.5772109", "text": "function parseTemplateElement(option) {\n\t var node, token;\n\t\n\t if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n\t throwUnexpectedToken();\n\t }\n\t\n\t node = new Node();\n\t token = lex();\n\t\n\t return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n\t }", "title": "" }, { "docid": "0022200988c49e0127f96fc875ea95c9", "score": "0.57635885", "text": "function tmpl(s, p) {\n\n\t if (s.indexOf(brackets(0)) < 0) {\n\t // return raw text\n\t s = s.replace(/\\n|\\r\\n?/g, '\\n')\n\t return function () { return s }\n\t }\n\n\t // temporarily convert \\{ and \\} to a non-character\n\t s = s\n\t .replace(brackets(/\\\\{/g), '\\uFFF0')\n\t .replace(brackets(/\\\\}/g), '\\uFFF1')\n\n\t // split string to expression and non-expresion parts\n\t p = split(s, extract(s, brackets(/{/), brackets(/}/)))\n\n\t // is it a single expression or a template? i.e. {x} or <b>{x}</b>\n\t s = (p.length === 2 && !p[0]) ?\n\n\t // if expression, evaluate it\n\t expr(p[1]) :\n\n\t // if template, evaluate all expressions in it\n\t '[' + p.map(function(s, i) {\n\n\t // is it an expression or a string (every second part is an expression)\n\t return i % 2 ?\n\n\t // evaluate the expressions\n\t expr(s, true) :\n\n\t // process string parts of the template:\n\t '\"' + s\n\n\t // preserve new lines\n\t .replace(/\\n|\\r\\n?/g, '\\\\n')\n\n\t // escape quotes\n\t .replace(/\"/g, '\\\\\"') +\n\n\t '\"'\n\n\t }).join(',') + '].join(\"\")'\n\n\t return new Function('d', 'return ' + s\n\t // bring escaped { and } back\n\t .replace(/\\uFFF0/g, brackets(0))\n\t .replace(/\\uFFF1/g, brackets(1)) + ';')\n\n\t }", "title": "" }, { "docid": "a1b92f1b56812a8403e64c526784ba4f", "score": "0.57410026", "text": "Literal() {\n switch (this._lookahead.type) {\n case \"NUMBER\":\n return this.NumericLiteral();\n case \"STRING\":\n return this.StringLiteral();\n case \"true\":\n case \"false\":\n return this.BooleanLiteral(this._lookahead.type);\n case \"null\":\n return this.NullLiteral();\n }\n throw new SyntaxError(`Literal: unexpected literal production`);\n }", "title": "" }, { "docid": "502b30c65914d3362cad5ef7feb84a71", "score": "0.57397795", "text": "function Person() {\n\n\n return (\n <>\n <p>hola</p>\n </>\n );\n}", "title": "" }, { "docid": "8462c2459c905d50293a9289e514872b", "score": "0.57317567", "text": "function echoTag(literals, ...substitutions) {\n let result = \"\";\n for (let i = 0; i < substitutions.length; i++) {\n result += literals[i];\n result += substitutions[i];\n }\n // add the last literal.\n result += literals[literals.length - 1];\n return result\n }", "title": "" }, { "docid": "bef3dedcd0b236418755ac193343fea8", "score": "0.56914115", "text": "function tmpl(s, p) {\n\n\t // default template string to {}\n\t s = (s || (brackets(0) + brackets(1)))\n\n\t // temporarily convert \\{ and \\} to a non-character\n\t .replace(brackets(/\\\\{/g), '\\uFFF0')\n\t .replace(brackets(/\\\\}/g), '\\uFFF1')\n\n\t // split string to expression and non-expresion parts\n\t p = split(s, extract(s, brackets(/{/), brackets(/}/)))\n\n\t return new Function('d', 'return ' + (\n\n\t // is it a single expression or a template? i.e. {x} or <b>{x}</b>\n\t !p[0] && !p[2] && !p[3]\n\n\t // if expression, evaluate it\n\t ? expr(p[1])\n\n\t // if template, evaluate all expressions in it\n\t : '[' + p.map(function(s, i) {\n\n\t // is it an expression or a string (every second part is an expression)\n\t return i % 2\n\n\t // evaluate the expressions\n\t ? expr(s, true)\n\n\t // process string parts of the template:\n\t : '\"' + s\n\n\t // preserve new lines\n\t .replace(/\\n/g, '\\\\n')\n\n\t // escape quotes\n\t .replace(/\"/g, '\\\\\"')\n\n\t + '\"'\n\n\t }).join(',') + '].join(\"\")'\n\t )\n\n\t // bring escaped { and } back\n\t .replace(/\\uFFF0/g, brackets(0))\n\t .replace(/\\uFFF1/g, brackets(1))\n\n\t + ';')\n\n\t }", "title": "" }, { "docid": "1b146a50450e69002ecb409993b3263c", "score": "0.5680647", "text": "function parseTemplateElement(option) {\n\t var node, token;\n\n\t if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n\t throwUnexpectedToken();\n\t }\n\n\t node = new Node();\n\t token = lex();\n\n\t return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n\t }", "title": "" }, { "docid": "22c9d8c4f75d2acaaceea245cf8f2fec", "score": "0.56521815", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n const hasClosingTag = (match, { after }) => {\n const tag = \"</\" + match[0].slice(1);\n const pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n const IDENT_RE$1 = IDENT_RE;\n const FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n }\n // <something>\n // This is now either a tag or a type.\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n NUMBER,\n hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n NUMBER,\n { // object attr container\n begin: concat(/[{,\\n]\\s*/,\n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [\n {\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }\n ]\n },\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/, relevance: 0\n },\n {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n relevance: 0\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: [\n 'self',\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n PARAMS\n ],\n illegal: /%/\n },\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n ]\n },\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [\n { begin: '\\\\.' + IDENT_RE$1 },\n { begin: '\\\\$' + IDENT_RE$1 }\n ],\n relevance: 0\n },\n { // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"[\\]]/,\n contains: [\n { beginKeywords: 'extends' },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n begin: /\\b(?=constructor)/,\n end: /[{;]/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n 'self',\n PARAMS\n ]\n },\n {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /\\{/,\n keywords: \"get set\",\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n { begin: /\\(\\)/ }, // eat to avoid empty params\n PARAMS\n ]\n },\n {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n }", "title": "" }, { "docid": "55be276acd9b1bbbefeb5f6ac76bee85", "score": "0.5642229", "text": "function extractValueFromTaggedTemplateExpression(value) {\n\t return (0, _TemplateLiteral2.default)(value.quasi);\n\t}", "title": "" }, { "docid": "a0f000f452a6ef0815254fb14bc7df34", "score": "0.5639025", "text": "function thing() {\n return ' <NBSP>thing';\n}", "title": "" }, { "docid": "68e9d4ac033bb665026f428b0c8a753a", "score": "0.5637621", "text": "enterStringLiteral(ctx) {\n\t}", "title": "" }, { "docid": "2290d3d72bb823e40a899af03602558d", "score": "0.56344277", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n const hasClosingTag = (match, { after }) => {\n const tag = \"</\" + match[0].slice(1);\n const pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n const IDENT_RE$1 = IDENT_RE;\n const FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n }\n // <something>\n // This is now either a tag or a type.\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n NUMBER,\n hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n NUMBER,\n { // object attr container\n begin: concat(/[{,\\n]\\s*/,\n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [\n {\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }\n ]\n },\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/, relevance: 0\n },\n {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n relevance: 0\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: [\n 'self',\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n PARAMS\n ],\n illegal: /%/\n },\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n ]\n },\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [\n { begin: '\\\\.' + IDENT_RE$1 },\n { begin: '\\\\$' + IDENT_RE$1 }\n ],\n relevance: 0\n },\n { // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"[\\]]/,\n contains: [\n { beginKeywords: 'extends' },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n begin: /\\b(?=constructor)/,\n end: /[{;]/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n 'self',\n PARAMS\n ]\n },\n {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /\\{/,\n keywords: \"get set\",\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n { begin: /\\(\\)/ }, // eat to avoid empty params\n PARAMS\n ]\n },\n {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}", "title": "" }, { "docid": "2290d3d72bb823e40a899af03602558d", "score": "0.56344277", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n const hasClosingTag = (match, { after }) => {\n const tag = \"</\" + match[0].slice(1);\n const pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n const IDENT_RE$1 = IDENT_RE;\n const FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n }\n // <something>\n // This is now either a tag or a type.\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n NUMBER,\n hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n NUMBER,\n { // object attr container\n begin: concat(/[{,\\n]\\s*/,\n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [\n {\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }\n ]\n },\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/, relevance: 0\n },\n {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n relevance: 0\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: [\n 'self',\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n PARAMS\n ],\n illegal: /%/\n },\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n ]\n },\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [\n { begin: '\\\\.' + IDENT_RE$1 },\n { begin: '\\\\$' + IDENT_RE$1 }\n ],\n relevance: 0\n },\n { // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"[\\]]/,\n contains: [\n { beginKeywords: 'extends' },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n begin: /\\b(?=constructor)/,\n end: /[{;]/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n 'self',\n PARAMS\n ]\n },\n {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /\\{/,\n keywords: \"get set\",\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n { begin: /\\(\\)/ }, // eat to avoid empty params\n PARAMS\n ]\n },\n {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}", "title": "" }, { "docid": "2290d3d72bb823e40a899af03602558d", "score": "0.56344277", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n const hasClosingTag = (match, { after }) => {\n const tag = \"</\" + match[0].slice(1);\n const pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n const IDENT_RE$1 = IDENT_RE;\n const FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n }\n // <something>\n // This is now either a tag or a type.\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n NUMBER,\n hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n NUMBER,\n { // object attr container\n begin: concat(/[{,\\n]\\s*/,\n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [\n {\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }\n ]\n },\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/, relevance: 0\n },\n {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n relevance: 0\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: [\n 'self',\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n PARAMS\n ],\n illegal: /%/\n },\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n ]\n },\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [\n { begin: '\\\\.' + IDENT_RE$1 },\n { begin: '\\\\$' + IDENT_RE$1 }\n ],\n relevance: 0\n },\n { // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"[\\]]/,\n contains: [\n { beginKeywords: 'extends' },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n begin: /\\b(?=constructor)/,\n end: /[{;]/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n 'self',\n PARAMS\n ]\n },\n {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /\\{/,\n keywords: \"get set\",\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n { begin: /\\(\\)/ }, // eat to avoid empty params\n PARAMS\n ]\n },\n {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}", "title": "" }, { "docid": "2290d3d72bb823e40a899af03602558d", "score": "0.56344277", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n const hasClosingTag = (match, { after }) => {\n const tag = \"</\" + match[0].slice(1);\n const pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n const IDENT_RE$1 = IDENT_RE;\n const FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n }\n // <something>\n // This is now either a tag or a type.\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n NUMBER,\n hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n NUMBER,\n { // object attr container\n begin: concat(/[{,\\n]\\s*/,\n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [\n {\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }\n ]\n },\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/, relevance: 0\n },\n {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n relevance: 0\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: [\n 'self',\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n PARAMS\n ],\n illegal: /%/\n },\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n ]\n },\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [\n { begin: '\\\\.' + IDENT_RE$1 },\n { begin: '\\\\$' + IDENT_RE$1 }\n ],\n relevance: 0\n },\n { // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"[\\]]/,\n contains: [\n { beginKeywords: 'extends' },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n begin: /\\b(?=constructor)/,\n end: /[{;]/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n 'self',\n PARAMS\n ]\n },\n {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /\\{/,\n keywords: \"get set\",\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n { begin: /\\(\\)/ }, // eat to avoid empty params\n PARAMS\n ]\n },\n {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}", "title": "" }, { "docid": "2290d3d72bb823e40a899af03602558d", "score": "0.56344277", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n const hasClosingTag = (match, { after }) => {\n const tag = \"</\" + match[0].slice(1);\n const pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n const IDENT_RE$1 = IDENT_RE;\n const FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n }\n // <something>\n // This is now either a tag or a type.\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n NUMBER,\n hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n NUMBER,\n { // object attr container\n begin: concat(/[{,\\n]\\s*/,\n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [\n {\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }\n ]\n },\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/, relevance: 0\n },\n {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n relevance: 0\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: [\n 'self',\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n PARAMS\n ],\n illegal: /%/\n },\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n ]\n },\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [\n { begin: '\\\\.' + IDENT_RE$1 },\n { begin: '\\\\$' + IDENT_RE$1 }\n ],\n relevance: 0\n },\n { // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"[\\]]/,\n contains: [\n { beginKeywords: 'extends' },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n begin: /\\b(?=constructor)/,\n end: /[{;]/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n 'self',\n PARAMS\n ]\n },\n {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /\\{/,\n keywords: \"get set\",\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n { begin: /\\(\\)/ }, // eat to avoid empty params\n PARAMS\n ]\n },\n {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}", "title": "" }, { "docid": "2290d3d72bb823e40a899af03602558d", "score": "0.56344277", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n const hasClosingTag = (match, { after }) => {\n const tag = \"</\" + match[0].slice(1);\n const pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n const IDENT_RE$1 = IDENT_RE;\n const FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n }\n // <something>\n // This is now either a tag or a type.\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n NUMBER,\n hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n NUMBER,\n { // object attr container\n begin: concat(/[{,\\n]\\s*/,\n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [\n {\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }\n ]\n },\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/, relevance: 0\n },\n {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n relevance: 0\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: [\n 'self',\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n PARAMS\n ],\n illegal: /%/\n },\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n ]\n },\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [\n { begin: '\\\\.' + IDENT_RE$1 },\n { begin: '\\\\$' + IDENT_RE$1 }\n ],\n relevance: 0\n },\n { // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"[\\]]/,\n contains: [\n { beginKeywords: 'extends' },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n begin: /\\b(?=constructor)/,\n end: /[{;]/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n 'self',\n PARAMS\n ]\n },\n {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /\\{/,\n keywords: \"get set\",\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n { begin: /\\(\\)/ }, // eat to avoid empty params\n PARAMS\n ]\n },\n {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}", "title": "" }, { "docid": "2290d3d72bb823e40a899af03602558d", "score": "0.56344277", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n const hasClosingTag = (match, { after }) => {\n const tag = \"</\" + match[0].slice(1);\n const pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n const IDENT_RE$1 = IDENT_RE;\n const FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n const XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: (match, response) => {\n const afterMatchIndex = match[0].length + match.index;\n const nextChar = match.input[afterMatchIndex];\n // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n }\n // <something>\n // This is now either a tag or a type.\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, { after: afterMatchIndex })) {\n response.ignoreMatch();\n }\n }\n }\n };\n const KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS,\n literal: LITERALS,\n built_in: BUILT_INS\n };\n\n // https://tc39.es/ecma262/#sec-literals-numeric-literals\n const decimalDigits = '[0-9](_?[0-9])*';\n const frac = `\\\\.(${decimalDigits})`;\n // DecimalIntegerLiteral, including Annex B NonOctalDecimalIntegerLiteral\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;\n const NUMBER = {\n className: 'number',\n variants: [\n // DecimalLiteral\n { begin: `(\\\\b(${decimalInteger})((${frac})|\\\\.)?|(${frac}))` +\n `[eE][+-]?(${decimalDigits})\\\\b` },\n { begin: `\\\\b(${decimalInteger})\\\\b((${frac})\\\\b|\\\\.)?|(${frac})\\\\b` },\n\n // DecimalBigIntegerLiteral\n { begin: `\\\\b(0|[1-9](_?[0-9])*)n\\\\b` },\n\n // NonDecimalIntegerLiteral\n { begin: \"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\\\b\" },\n { begin: \"\\\\b0[bB][0-1](_?[0-1])*n?\\\\b\" },\n { begin: \"\\\\b0[oO][0-7](_?[0-7])*n?\\\\b\" },\n\n // LegacyOctalIntegerLiteral (does not include underscore separators)\n // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals\n { begin: \"\\\\b0[0-7]+n?\\\\b\" },\n ],\n relevance: 0\n };\n\n const SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n };\n const HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'xml'\n }\n };\n const CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n subLanguage: 'css'\n }\n };\n const TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ]\n };\n const JSDOC_COMMENT = hljs.COMMENT(\n /\\/\\*\\*(?!\\/)/,\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [\n {\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n },\n {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n },\n // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }\n ]\n }\n ]\n }\n );\n const COMMENT = {\n className: \"comment\",\n variants: [\n JSDOC_COMMENT,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_LINE_COMMENT_MODE\n ]\n };\n const SUBST_INTERNALS = [\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n NUMBER,\n hljs.REGEXP_MODE\n ];\n SUBST.contains = SUBST_INTERNALS\n .concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /\\{/,\n end: /\\}/,\n keywords: KEYWORDS$1,\n contains: [\n \"self\"\n ].concat(SUBST_INTERNALS)\n });\n const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([\n // eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }\n ]);\n const PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: { PARAMS_CONTAINS },\n illegal: /#(?![$_A-z])/,\n contains: [\n hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }),\n {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n HTML_TEMPLATE,\n CSS_TEMPLATE,\n TEMPLATE_STRING,\n COMMENT,\n NUMBER,\n { // object attr container\n begin: concat(/[{,\\n]\\s*/,\n // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat(\n // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(((\\/\\/.*$)|(\\/\\*(\\*[^/]|[^*])*\\*\\/))\\s*)*/,\n IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [\n {\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }\n ]\n },\n { // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [\n COMMENT,\n hljs.REGEXP_MODE,\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [\n {\n className: 'params',\n variants: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE,\n relevance: 0\n },\n {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n },\n {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }\n ]\n }\n ]\n },\n { // could be a comma delimited list of params to a function call\n begin: /,/, relevance: 0\n },\n {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n },\n { // JSX\n variants: [\n { begin: FRAGMENT.begin, end: FRAGMENT.end },\n {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }\n ],\n subLanguage: 'xml',\n contains: [\n {\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }\n ]\n }\n ],\n relevance: 0\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: [\n 'self',\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n PARAMS\n ],\n illegal: /%/\n },\n {\n // prevent this from getting swallowed up by function\n // since they appear \"function like\"\n beginKeywords: \"while if switch catch for\"\n },\n {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE +\n '\\\\(' + // first parens\n '[^()]*(\\\\(' +\n '[^()]*(\\\\(' +\n '[^()]*' +\n '\\\\)[^()]*)*' +\n '\\\\)[^()]*)*' +\n '\\\\)\\\\s*\\\\{', // end parens\n returnBegin:true,\n contains: [\n PARAMS,\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n ]\n },\n // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [\n { begin: '\\\\.' + IDENT_RE$1 },\n { begin: '\\\\$' + IDENT_RE$1 }\n ],\n relevance: 0\n },\n { // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"[\\]]/,\n contains: [\n { beginKeywords: 'extends' },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n begin: /\\b(?=constructor)/,\n end: /[{;]/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n 'self',\n PARAMS\n ]\n },\n {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /\\{/,\n keywords: \"get set\",\n contains: [\n hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1 }),\n { begin: /\\(\\)/ }, // eat to avoid empty params\n PARAMS\n ]\n },\n {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n }\n ]\n };\n}", "title": "" }, { "docid": "2c6055b24fd6a397335e2160ab126829", "score": "0.5631643", "text": "visitLiteral(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "cd73666fc518beb8ea54f95ec13d074e", "score": "0.56012404", "text": "function makeLit(obj) {\n return {\n tag: tags.LIT,\n obj: obj\n };\n }", "title": "" }, { "docid": "679472d10c48fc4156099936b4d62f8b", "score": "0.5592591", "text": "function templateParser(m, unescapedKey, sectionToken, escapedKey, specialChar){\n\t\t//If section closing tag\n\t\treturn (sectionToken == '!')? '':\n\t\t\t(sectionToken == '>')? '\"+g(d,[\".\",\"'+stringify(rightTrim(escapedKey))+'\",0,d])+\"':\n\t\t\t\t(sectionToken == '\\/')?\n\t\t\t\t\t//source code to close any section\n\t\t\t\t\t'\"}return s})(d)+\"':\n\t\t\t\t\t//else if any of the section opening tokens\n\t\t\t\t\t(sectionToken)?\n\t\t\t\t\t\t//sections are compiled to immediately invoked\n\t\t\t\t\t\t//functions\n\t\t\t\t\t\t'\"+(function(d){'+\n\t\t\t\t\t\t//get the value of the current key\n\t\t\t\t\t\t'var k='+datacall(escapedKey)+\n\t\t\t\t\t\t//create a string buffer and an iterator variable\n\t\t\t\t\t\t',s=\"\",i,c=d,'+\n\t\t\t\t\t\t//call truthyLoop to get parameters:\n\t\t\t\t\t\t//1: is it a non-empty array?\n\t\t\t\t\t\t//2: how many times to iterate the section body?\n\t\t\t\t\t\t'p=t(k);'+\n\t\t\t\t\t\t((sectionToken == '#')?\n\t\t\t\t\t\t\t//if conditional section, setup a for loop\n\t\t\t\t\t\t\t'for(i=0;i<p;i++){d=[k.splice?k[i]:k].concat(c);':\n\t\t\t\t\t\t\t//if inverted conditional section, test if iteration count is 0\n\t\t\t\t\t\t\t'if(!p){'\n\t\t\t\t\t\t)+\n\t\t\t\t\t\t//capture subsequent syntax in string buffer\n\t\t\t\t\t\t's+=\"':\n\t\t\t\t\t\t(unescapedKey)?\n\t\t\t\t\t\t\t//call value of key in current context\n\t\t\t\t\t\t\t//without HTML sanitization\n\t\t\t\t\t\t\t'\"+'+datacall(unescapedKey)+'+\"':\n\t\t\t\t\t\t\t(escapedKey)?\n\t\t\t\t\t\t\t\t//call value of key in current context\n\t\t\t\t\t\t\t\t//with HTML sanitization\n\t\t\t\t\t\t\t\t'\"+h('+datacall(escapedKey)+')+\"':\n\t\t\t\t\t\t\t\t(specialChar)?\n\t\t\t\t\t\t\t\t\t//escape special characters\n\t\t\t\t\t\t\t\t\tstringifyReplace(specialChar):\n\t\t\t\t\t\t\t\t\t'';\n\t}", "title": "" }, { "docid": "418268c3e1c355255b7608f7faf5c145", "score": "0.5565675", "text": "function template () {\n return function (params, app, state) {\n const hx = hyperx(app.h)\n return hx`\n <section>hello world</section>\n `\n }\n}", "title": "" }, { "docid": "ba2bbe3df2c6ca322667bd705cad6e8a", "score": "0.55539966", "text": "function template(str, data) {\n return new Function(\"obj\",\n \"var p=[],print=function(){p.push.apply(p,arguments);};\" +\n\n // Introduce the data as local variables using with(){}\n \"with(obj){p.push('\" +\n\n // Convert the template into pure JavaScript\n str.replace(/[\\r\\t\\n]/g, \" \")\n .replace(/'(?=[^%]*%>)/g,\"\\t\")\n .split(\"'\").join(\"\\\\'\")\n .split(\"\\t\").join(\"'\")\n .replace(/<%=(.+?)%>/g, \"',$1,'\")\n .split(\"<%\").join(\"');\")\n .split(\"%>\").join(\"p.push('\")\n + \"');}return p.join('');\")(data || {});\n}", "title": "" }, { "docid": "1de41fc3d0b46b0bdca7e9b97150cef7", "score": "0.55535585", "text": "static _getTemplateLiteral(...tempLit) {\n let tmpl,\n// Store ref functions with tempLit in an array\n array = [...tempLit],\n props = Flare._propObj\n// Set a unique id on the component's props...\n props.flareId = `${Flare._createFlareId(array)}`\n//\n if (Flare._extend) {\n/* An object holding the styles of the extended component, and also,\nan array holding the broken up tempLit and ref functions... Once the Props\nfrom component instantiation are merged with the existing prop object, the\nresulting object will be injected into each ref function as they are called so that\nthe css can be completed...*/\n tmpl = {\n extended: true,\n super: Flare._superTempLit,\n superEl: Flare._superTag,\n superId: Flare._superId,\n array: array\n }\n } else {\n tmpl = {\n extended: false,\n array: array\n }\n }\n return {\n flare: true,\n taggedTempLit: tmpl,\n props: props,\n el: (tmpl.extended)? Flare._superTag : Flare._elementTag,\n tag: Flare._componentTag\n }\n }", "title": "" }, { "docid": "5d16fce62063e450e94efa8d51511b83", "score": "0.5548969", "text": "function parseTemplateElement(option) {\n var node, token;\n\n if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n throwUnexpectedToken();\n }\n\n node = new Node();\n token = lex();\n\n return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n }", "title": "" }, { "docid": "5d16fce62063e450e94efa8d51511b83", "score": "0.5548969", "text": "function parseTemplateElement(option) {\n var node, token;\n\n if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n throwUnexpectedToken();\n }\n\n node = new Node();\n token = lex();\n\n return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n }", "title": "" }, { "docid": "5d16fce62063e450e94efa8d51511b83", "score": "0.5548969", "text": "function parseTemplateElement(option) {\n var node, token;\n\n if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n throwUnexpectedToken();\n }\n\n node = new Node();\n token = lex();\n\n return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n }", "title": "" }, { "docid": "5d16fce62063e450e94efa8d51511b83", "score": "0.5548969", "text": "function parseTemplateElement(option) {\n var node, token;\n\n if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n throwUnexpectedToken();\n }\n\n node = new Node();\n token = lex();\n\n return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n }", "title": "" }, { "docid": "5d16fce62063e450e94efa8d51511b83", "score": "0.5548969", "text": "function parseTemplateElement(option) {\n var node, token;\n\n if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n throwUnexpectedToken();\n }\n\n node = new Node();\n token = lex();\n\n return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n }", "title": "" }, { "docid": "5d16fce62063e450e94efa8d51511b83", "score": "0.5548969", "text": "function parseTemplateElement(option) {\n var node, token;\n\n if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n throwUnexpectedToken();\n }\n\n node = new Node();\n token = lex();\n\n return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n }", "title": "" }, { "docid": "5d16fce62063e450e94efa8d51511b83", "score": "0.5548969", "text": "function parseTemplateElement(option) {\n var node, token;\n\n if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n throwUnexpectedToken();\n }\n\n node = new Node();\n token = lex();\n\n return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n }", "title": "" }, { "docid": "5d16fce62063e450e94efa8d51511b83", "score": "0.5548969", "text": "function parseTemplateElement(option) {\n var node, token;\n\n if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {\n throwUnexpectedToken();\n }\n\n node = new Node();\n token = lex();\n\n return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);\n }", "title": "" }, { "docid": "f55b97f939f3ca1b7cd8920b244bd95b", "score": "0.5545088", "text": "function javascript(hljs) {\n /**\n * Takes a string like \"<Booger\" and checks to see\n * if we can find a matching \"</Booger\" later in the\n * content.\n * @param {RegExpMatchArray} match\n * @param {{after:number}} param1\n */\n var hasClosingTag = function hasClosingTag(match, _ref5) {\n var after = _ref5.after;\n var tag = match[0].replace(\"<\", \"</\");\n var pos = match.input.indexOf(tag, after);\n return pos !== -1;\n };\n\n var IDENT_RE$1 = IDENT_RE;\n var FRAGMENT = {\n begin: '<>',\n end: '</>'\n };\n var XML_TAG = {\n begin: /<[A-Za-z0-9\\\\._:-]+/,\n end: /\\/[A-Za-z0-9\\\\._:-]+>|\\/>/,\n\n /**\n * @param {RegExpMatchArray} match\n * @param {CallbackResponse} response\n */\n isTrulyOpeningTag: function isTrulyOpeningTag(match, response) {\n var afterMatchIndex = match[0].length + match.index;\n var nextChar = match.input[afterMatchIndex]; // nested type?\n // HTML should not include another raw `<` inside a tag\n // But a type might: `<Array<Array<number>>`, etc.\n\n if (nextChar === \"<\") {\n response.ignoreMatch();\n return;\n } // <something>\n // This is now either a tag or a type.\n\n\n if (nextChar === \">\") {\n // if we cannot find a matching closing tag, then we\n // will ignore it\n if (!hasClosingTag(match, {\n after: afterMatchIndex\n })) {\n response.ignoreMatch();\n }\n }\n }\n };\n var KEYWORDS$1 = {\n $pattern: IDENT_RE,\n keyword: KEYWORDS.join(\" \"),\n literal: LITERALS.join(\" \"),\n built_in: BUILT_INS.join(\" \")\n };\n\n var nonDecimalLiterals = function nonDecimalLiterals(prefixLetters, validChars) {\n return \"\\\\b0[\".concat(prefixLetters, \"][\").concat(validChars, \"]([\").concat(validChars, \"_]*[\").concat(validChars, \"])?n?\");\n };\n\n var noLeadingZeroDecimalDigits = /[1-9]([0-9_]*\\d)?/;\n var decimalDigits = /\\d([0-9_]*\\d)?/;\n var exponentPart = concat(/[eE][+-]?/, decimalDigits);\n var NUMBER = {\n className: 'number',\n variants: [{\n begin: nonDecimalLiterals('bB', '01')\n }, // Binary literals\n {\n begin: nonDecimalLiterals('oO', '0-7')\n }, // Octal literals\n {\n begin: nonDecimalLiterals('xX', '0-9a-fA-F')\n }, // Hexadecimal literals\n {\n begin: concat(/\\b/, noLeadingZeroDecimalDigits, 'n')\n }, // Non-zero BigInt literals\n {\n begin: concat(/(\\b0)?\\./, decimalDigits, optional(exponentPart))\n }, // Decimal literals between 0 and 1\n {\n begin: concat(/\\b/, noLeadingZeroDecimalDigits, optional(concat(/\\./, optional(decimalDigits))), // fractional part\n optional(exponentPart))\n }, // Decimal literals >= 1\n {\n begin: /\\b0[\\.n]?/\n } // Zero literals (`0`, `0.`, `0n`)\n ],\n relevance: 0\n };\n var SUBST = {\n className: 'subst',\n begin: '\\\\$\\\\{',\n end: '\\\\}',\n keywords: KEYWORDS$1,\n contains: [] // defined later\n\n };\n var HTML_TEMPLATE = {\n begin: 'html`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n subLanguage: 'xml'\n }\n };\n var CSS_TEMPLATE = {\n begin: 'css`',\n end: '',\n starts: {\n end: '`',\n returnEnd: false,\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n subLanguage: 'css'\n }\n };\n var TEMPLATE_STRING = {\n className: 'string',\n begin: '`',\n end: '`',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST]\n };\n var JSDOC_COMMENT = hljs.COMMENT('/\\\\*\\\\*', '\\\\*/', {\n relevance: 0,\n contains: [{\n className: 'doctag',\n begin: '@[A-Za-z]+',\n contains: [{\n className: 'type',\n begin: '\\\\{',\n end: '\\\\}',\n relevance: 0\n }, {\n className: 'variable',\n begin: IDENT_RE$1 + '(?=\\\\s*(-)|$)',\n endsParent: true,\n relevance: 0\n }, // eat spaces (not newlines) so we can find\n // types or variables\n {\n begin: /(?=[^\\n])\\s/,\n relevance: 0\n }]\n }]\n });\n var COMMENT = {\n className: \"comment\",\n variants: [JSDOC_COMMENT, hljs.C_BLOCK_COMMENT_MODE, hljs.C_LINE_COMMENT_MODE]\n };\n var SUBST_INTERNALS = [hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, HTML_TEMPLATE, CSS_TEMPLATE, TEMPLATE_STRING, NUMBER, hljs.REGEXP_MODE];\n SUBST.contains = SUBST_INTERNALS.concat({\n // we need to pair up {} inside our subst to prevent\n // it from ending too early by matching another }\n begin: /{/,\n end: /}/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_INTERNALS)\n });\n var SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);\n var PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([// eat recursive parens in sub expressions\n {\n begin: /\\(/,\n end: /\\)/,\n keywords: KEYWORDS$1,\n contains: [\"self\"].concat(SUBST_AND_COMMENTS)\n }]);\n var PARAMS = {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n };\n return {\n name: 'Javascript',\n aliases: ['js', 'jsx', 'mjs', 'cjs'],\n keywords: KEYWORDS$1,\n // this will be extended by TypeScript\n exports: {\n PARAMS_CONTAINS: PARAMS_CONTAINS\n },\n illegal: /#(?![$_A-z])/,\n contains: [hljs.SHEBANG({\n label: \"shebang\",\n binary: \"node\",\n relevance: 5\n }), {\n label: \"use_strict\",\n className: 'meta',\n relevance: 10,\n begin: /^\\s*['\"]use (strict|asm)['\"]/\n }, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE, HTML_TEMPLATE, CSS_TEMPLATE, TEMPLATE_STRING, COMMENT, NUMBER, {\n // object attr container\n begin: concat(/[{,\\n]\\s*/, // we need to look ahead to make sure that we actually have an\n // attribute coming up so we don't steal a comma from a potential\n // \"value\" container\n //\n // NOTE: this might not work how you think. We don't actually always\n // enter this mode and stay. Instead it might merely match `,\n // <comments up next>` and then immediately end after the , because it\n // fails to find any actual attrs. But this still does the job because\n // it prevents the value contain rule from grabbing this instead and\n // prevening this rule from firing when we actually DO have keys.\n lookahead(concat( // we also need to allow for multiple possible comments inbetween\n // the first key:value pairing\n /(\\/\\/.*$)*/, /(\\/\\*(.|\\n)*\\*\\/)*/, /\\s*/, IDENT_RE$1 + '\\\\s*:'))),\n relevance: 0,\n contains: [{\n className: 'attr',\n begin: IDENT_RE$1 + lookahead('\\\\s*:'),\n relevance: 0\n }]\n }, {\n // \"value\" container\n begin: '(' + hljs.RE_STARTERS_RE + '|\\\\b(case|return|throw)\\\\b)\\\\s*',\n keywords: 'return throw case',\n contains: [COMMENT, hljs.REGEXP_MODE, {\n className: 'function',\n // we have to count the parens to make sure we actually have the\n // correct bounding ( ) before the =>. There could be any number of\n // sub-expressions inside also surrounded by parens.\n begin: '(\\\\(' + '[^()]*(\\\\(' + '[^()]*(\\\\(' + '[^()]*' + '\\\\))*[^()]*' + '\\\\))*[^()]*' + '\\\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\\\s*=>',\n returnBegin: true,\n end: '\\\\s*=>',\n contains: [{\n className: 'params',\n variants: [{\n begin: hljs.UNDERSCORE_IDENT_RE\n }, {\n className: null,\n begin: /\\(\\s*\\)/,\n skip: true\n }, {\n begin: /\\(/,\n end: /\\)/,\n excludeBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: PARAMS_CONTAINS\n }]\n }]\n }, {\n // could be a comma delimited list of params to a function call\n begin: /,/,\n relevance: 0\n }, {\n className: '',\n begin: /\\s/,\n end: /\\s*/,\n skip: true\n }, {\n // JSX\n variants: [{\n begin: FRAGMENT.begin,\n end: FRAGMENT.end\n }, {\n begin: XML_TAG.begin,\n // we carefully check the opening tag to see if it truly\n // is a tag and not a false positive\n 'on:begin': XML_TAG.isTrulyOpeningTag,\n end: XML_TAG.end\n }],\n subLanguage: 'xml',\n contains: [{\n begin: XML_TAG.begin,\n end: XML_TAG.end,\n skip: true,\n contains: ['self']\n }]\n }],\n relevance: 0\n }, {\n className: 'function',\n beginKeywords: 'function',\n end: /[{;]/,\n excludeEnd: true,\n keywords: KEYWORDS$1,\n contains: ['self', hljs.inherit(hljs.TITLE_MODE, {\n begin: IDENT_RE$1\n }), PARAMS],\n illegal: /%/\n }, {\n className: 'function',\n // we have to count the parens to make sure we actually have the correct\n // bounding ( ). There could be any number of sub-expressions inside\n // also surrounded by parens.\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\(' + // first parens\n '[^()]*(\\\\(' + '[^()]*(\\\\(' + '[^()]*' + '\\\\))*[^()]*' + '\\\\))*[^()]*' + '\\\\)\\\\s*{',\n // end parens\n returnBegin: true,\n contains: [PARAMS, hljs.inherit(hljs.TITLE_MODE, {\n begin: IDENT_RE$1\n })]\n }, // hack: prevents detection of keywords in some circumstances\n // .keyword()\n // $keyword = x\n {\n variants: [{\n begin: '\\\\.' + IDENT_RE$1\n }, {\n begin: '\\\\$' + IDENT_RE$1\n }],\n relevance: 0\n }, {\n // ES6 class\n className: 'class',\n beginKeywords: 'class',\n end: /[{;=]/,\n excludeEnd: true,\n illegal: /[:\"\\[\\]]/,\n contains: [{\n beginKeywords: 'extends'\n }, hljs.UNDERSCORE_TITLE_MODE]\n }, {\n begin: /\\b(?=constructor)/,\n end: /[\\{;]/,\n excludeEnd: true,\n contains: [hljs.inherit(hljs.TITLE_MODE, {\n begin: IDENT_RE$1\n }), 'self', PARAMS]\n }, {\n begin: '(get|set)\\\\s+(?=' + IDENT_RE$1 + '\\\\()',\n end: /{/,\n keywords: \"get set\",\n contains: [hljs.inherit(hljs.TITLE_MODE, {\n begin: IDENT_RE$1\n }), {\n begin: /\\(\\)/\n }, // eat to avoid empty params\n PARAMS]\n }, {\n begin: /\\$[(.]/ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`\n\n }]\n };\n }", "title": "" }, { "docid": "3b521165914541a06e1c3e69136a67e9", "score": "0.5534038", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\".concat(componentName, \",\").concat(genData(el, state)).concat(children ? \",\".concat(children) : '', \")\");\n }", "title": "" }, { "docid": "b904e0bcb8eb56ad182643c8187a82a9", "score": "0.5512188", "text": "function genComponent(componentName, el, state) {\n const children = el.inlineTemplate ? null : genChildren(el, state, true);\n return `_c(${componentName},${genData(el, state)}${children ? `,${children}` : ''})`;\n}", "title": "" }, { "docid": "81383df57bb8b75d42c61d09bf32f553", "score": "0.5501422", "text": "function tokenize(templ) {\n return (function (arr) {\n var tokens = [];\n for (i = 0; i < arr.length; i++) {\n (function (token) {\n return token === \"\" ?\n null :\n tokens.push(token);\n }(arr[i]));\n }\n return tokens;\n }(split(templ, new RegExp(\"(\" + VAR_TAG.source + \"|\" +\n BLOCK_TAG.source + \"|\" +\n END_BLOCK_TAG.source + \")\"))));\n }", "title": "" }, { "docid": "70a534d5c6964740290558da4d3a2899", "score": "0.5496066", "text": "function gql(template) {\n return dedent(template);\n}", "title": "" }, { "docid": "03b6f4fa2211a09a471b31d343840114", "score": "0.5472445", "text": "function Components(){\n return <ul>\n <li><FuncComponent name=\"Bob\" /></li>\n <li><ClassComponent name=\"Bob\" /></li>\n </ul>;\n}", "title": "" }, { "docid": "eb9349e5392581a6b6f78b81538c9581", "score": "0.5444223", "text": "function Template(tpl) {\n\n // 1 trim left\n // 2 exp\n // 3 trim right\n // 4 trim left\n // 5 fnbody\n // 6 trim right\n const re_tag = /\\{\\{(\\-)?((?:(?!\\}\\})[^])+)?(\\-)?\\}\\}|%%(\\-)?((?:(?!%%)[^])*)(\\-)?%%/g\n\n var fncode = ['var __res = [];'], start = 0, match;\n\n function add(m) {\n fncode.push('__res.push(`' + tpl.substr(start, m.index - start) + '`)')\n if (m[2]) {\n fncode.push(`__res.push(${m[2]})`)\n } else if (m[5]) {\n fncode.push(m[5])\n }\n // console.log(cursor, match)\n }\n\n while(match = re_tag.exec(tpl)) {\n add(match);\n start = match.index + match[0].length;\n }\n\n fncode.push('__res.push(`' + tpl.substr(start, tpl.length - start) + '`)');\n fncode.push(`return __res.join('');`);\n // code = code.replace(/[\\r\\t\\n]+/g, ' ')\n var rescode = fncode.join('\\n')\n // console.log(rescode)\n var fn = new Function('v', rescode)\n return (data) => fn(data);\n}", "title": "" }, { "docid": "85f0ad5f985ddf1bb7724bce12a4d8ca", "score": "0.5440557", "text": "function extractValueFromTaggedTemplateExpression(value) {\n return (0, _TemplateLiteral2.default)(value.quasi);\n}", "title": "" }, { "docid": "96e8bbafaa88deff3173803e2ad36e96", "score": "0.54385275", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\".concat(componentName, \",\").concat(genData(el, state)).concat(children ? \",\".concat(children) : '', \")\");\n}", "title": "" }, { "docid": "7b4f6ee03e7f53bcef61ac3ac7a0069d", "score": "0.5437913", "text": "function userTemplate(strings, value){\n return `<p>${strings[0]}<strong>${value}</strong></p>`\n}", "title": "" }, { "docid": "14f641d6ea8506ee0434a28120b28f9e", "score": "0.54247373", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\".concat(componentName, \",\").concat(genData(el, state)).concat(children ? \",\".concat(children) : '', \")\");\n }", "title": "" }, { "docid": "7b194b39742ff6d388d75ba7e640a7d1", "score": "0.5423766", "text": "function genComponent (componentName, el) {\n\t var children = el.inlineTemplate ? null : genChildren(el, true);\n\t return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n\t}", "title": "" }, { "docid": "7b194b39742ff6d388d75ba7e640a7d1", "score": "0.5423766", "text": "function genComponent (componentName, el) {\n\t var children = el.inlineTemplate ? null : genChildren(el, true);\n\t return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n\t}", "title": "" }, { "docid": "7b194b39742ff6d388d75ba7e640a7d1", "score": "0.5423766", "text": "function genComponent (componentName, el) {\n\t var children = el.inlineTemplate ? null : genChildren(el, true);\n\t return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n\t}", "title": "" }, { "docid": "1e6e36b0a6e78d113eafe65ac3d12397", "score": "0.54178685", "text": "function create_fragment$l(ctx) {\n \tlet t_value = (/*value*/ ctx[0] !== undefined && /*value*/ ctx[0] !== null\n \t? /*value*/ ctx[0]\n \t: `-`) + \"\";\n\n \tlet t;\n\n \tconst block = {\n \t\tc: function create() {\n \t\t\tt = text(t_value);\n \t\t},\n \t\tl: function claim(nodes) {\n \t\t\tthrow new Error(\"options.hydrate only works if the component was compiled with the `hydratable: true` option\");\n \t\t},\n \t\tm: function mount(target, anchor) {\n \t\t\tinsert_dev(target, t, anchor);\n \t\t},\n \t\tp: function update(ctx, [dirty]) {\n \t\t\tif (dirty & /*value*/ 1 && t_value !== (t_value = (/*value*/ ctx[0] !== undefined && /*value*/ ctx[0] !== null\n \t\t\t? /*value*/ ctx[0]\n \t\t\t: `-`) + \"\")) set_data_dev(t, t_value);\n \t\t},\n \t\ti: noop,\n \t\to: noop,\n \t\td: function destroy(detaching) {\n \t\t\tif (detaching) detach_dev(t);\n \t\t}\n \t};\n\n \tdispatch_dev(\"SvelteRegisterBlock\", {\n \t\tblock,\n \t\tid: create_fragment$l.name,\n \t\ttype: \"component\",\n \t\tsource: \"\",\n \t\tctx\n \t});\n\n \treturn block;\n }", "title": "" }, { "docid": "68de3f111caedcf353d5f29b6e221b3d", "score": "0.5408257", "text": "processTagIntro() {\n // Walk forward until we see one of these patterns:\n // jsxName to start the first prop, preceded by another jsxName to end the tag name.\n // jsxName to start the first prop, preceded by greaterThan to end the type argument.\n // [open brace] to start the first prop.\n // [jsxTagEnd] to end the open-tag.\n // [slash, jsxTagEnd] to end the self-closing tag.\n let introEnd = this.tokens.currentIndex() + 1;\n while (\n this.tokens.tokens[introEnd].isType ||\n (!this.tokens.matches2AtIndex(introEnd - 1, tt.jsxName, tt.jsxName) &&\n !this.tokens.matches2AtIndex(introEnd - 1, tt.greaterThan, tt.jsxName) &&\n !this.tokens.matches1AtIndex(introEnd, tt.braceL) &&\n !this.tokens.matches1AtIndex(introEnd, tt.jsxTagEnd) &&\n !this.tokens.matches2AtIndex(introEnd, tt.slash, tt.jsxTagEnd))\n ) {\n introEnd++;\n }\n if (introEnd === this.tokens.currentIndex() + 1) {\n const tagName = this.tokens.identifierName();\n if (startsWithLowerCase(tagName)) {\n this.tokens.replaceToken(`'${tagName}'`);\n }\n }\n while (this.tokens.currentIndex() < introEnd) {\n this.rootTransformer.processToken();\n }\n }", "title": "" }, { "docid": "1a8f9742dce298867a76871b65563fc7", "score": "0.5405862", "text": "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return \"_c(\" + componentName + \",\" + genData$2(el, state) + (children ? \",\" + children : '') + \")\";\n}", "title": "" }, { "docid": "661b5ab0b51e5f820f953aa3d1ce8e17", "score": "0.5405446", "text": "function genComponent (\n componentName,\n el,\n state\n ) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n }", "title": "" }, { "docid": "661b5ab0b51e5f820f953aa3d1ce8e17", "score": "0.5405446", "text": "function genComponent (\n componentName,\n el,\n state\n ) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n }", "title": "" }, { "docid": "661b5ab0b51e5f820f953aa3d1ce8e17", "score": "0.5405446", "text": "function genComponent (\n componentName,\n el,\n state\n ) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n }", "title": "" }, { "docid": "661b5ab0b51e5f820f953aa3d1ce8e17", "score": "0.5405446", "text": "function genComponent (\n componentName,\n el,\n state\n ) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n }", "title": "" }, { "docid": "661b5ab0b51e5f820f953aa3d1ce8e17", "score": "0.5405446", "text": "function genComponent (\n componentName,\n el,\n state\n ) {\n var children = el.inlineTemplate ? null : genChildren(el, state, true);\n return (\"_c(\" + componentName + \",\" + (genData$2(el, state)) + (children ? (\",\" + children) : '') + \")\")\n }", "title": "" }, { "docid": "cb484781ed95b589cf0d9f8b7e0103ec", "score": "0.5405178", "text": "function visitTaggedTemplateExpression(node) {\n // Visit the tag expression\n var tag = ts.visitNode(node.tag, visitor, ts.isExpression);\n // Allocate storage for the template site object\n var temp = ts.createTempVariable(hoistVariableDeclaration);\n // Build up the template arguments and the raw and cooked strings for the template.\n var templateArguments = [temp];\n var cookedStrings = [];\n var rawStrings = [];\n var template = node.template;\n if (ts.isNoSubstitutionTemplateLiteral(template)) {\n cookedStrings.push(ts.createLiteral(template.text));\n rawStrings.push(getRawLiteral(template));\n }\n else {\n cookedStrings.push(ts.createLiteral(template.head.text));\n rawStrings.push(getRawLiteral(template.head));\n for (var _i = 0, _a = template.templateSpans; _i < _a.length; _i++) {\n var templateSpan = _a[_i];\n cookedStrings.push(ts.createLiteral(templateSpan.literal.text));\n rawStrings.push(getRawLiteral(templateSpan.literal));\n templateArguments.push(ts.visitNode(templateSpan.expression, visitor, ts.isExpression));\n }\n }\n // NOTE: The parentheses here is entirely optional as we are now able to auto-\n // parenthesize when rebuilding the tree. This should be removed in a\n // future version. It is here for now to match our existing emit.\n return ts.createParen(ts.inlineExpressions([\n ts.createAssignment(temp, ts.createArrayLiteral(cookedStrings)),\n ts.createAssignment(ts.createPropertyAccess(temp, \"raw\"), ts.createArrayLiteral(rawStrings)),\n ts.createCall(tag, /*typeArguments*/ undefined, templateArguments)\n ]));\n }", "title": "" }, { "docid": "46fd225fa290f23d850f503e9ef5f650", "score": "0.54046994", "text": "get template() {\n return Xen.html`&nbsp;`;\n }", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" }, { "docid": "eb80537c0398887f1125dba5aa04c8e3", "score": "0.5403222", "text": "function genComponent (componentName, el) {\n var children = el.inlineTemplate ? null : genChildren(el, true);\n return (\"_c(\" + componentName + \",\" + (genData(el)) + (children ? (\",\" + children) : '') + \")\")\n}", "title": "" } ]
8d8f86e981f6fb42cf439d8ec405e613
This is the common logic for both the Node.js and web browser implementations of `debug()`.
[ { "docid": "e7b9dd2a169a4934ce548d80c06d9c55", "score": "0.0", "text": "function setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(23);\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}", "title": "" } ]
[ { "docid": "07722b783e50162c71bcd7f35dbb387f", "score": "0.80899704", "text": "function debug(){}/* eslint-enable */ // -----------------------------------------------------------------------", "title": "" }, { "docid": "64aa18440b720e1535e076e9830112ae", "score": "0.75992125", "text": "function debug(value) { }", "title": "" }, { "docid": "a05cf26c84a863f6fd28a09259695e40", "score": "0.7316907", "text": "function isDebug(){ return false; }", "title": "" }, { "docid": "20da166b84733b5e8a455f71320dc7ef", "score": "0.72869825", "text": "debug() {\n this._debug = Browser._enableDebugging();\n }", "title": "" }, { "docid": "40ff30d00210fb8b24f67f611559986d", "score": "0.71686953", "text": "function debug() {\n 'use strict';\n\n tl.debug(format(arguments));\n}", "title": "" }, { "docid": "780761dbc551dcf48ce2c81493735c4d", "score": "0.71440816", "text": "function debug() {\n if (debugging && console) {\n console.log.apply(console, arguments);\n }\n }", "title": "" }, { "docid": "9dfbe0f1a9201dda4f45135c45501234", "score": "0.71294886", "text": "static debug() {\n debugging = true;\n }", "title": "" }, { "docid": "518372acba93035b9a7637582a2b5bf6", "score": "0.7091559", "text": "function _debug(obj) {\n \n }", "title": "" }, { "docid": "a87063ccf482b3f21878e12edfcd7a42", "score": "0.7057383", "text": "function dbug(v){\n DEBUG = v;\n}", "title": "" }, { "docid": "f1d0b23f7fa13528824787387ab4c962", "score": "0.70480084", "text": "function debug(s) {\n if (!debugOn) {\n return;\n }\n console.log(s);\n}", "title": "" }, { "docid": "aa1973aa4bd06249354a29acf8c9baea", "score": "0.70425886", "text": "function dbg(info) {\r\n console.log(info)\r\n}", "title": "" }, { "docid": "4d612b259512e564d3da1c3d7a515432", "score": "0.70159763", "text": "debug() {\n if (this.enabled)\n console.debug(...arguments); \n }", "title": "" }, { "docid": "8d9655bf1610810e3a12de5ecae6a529", "score": "0.69499475", "text": "function main() {\n // Do something :D\n debug();\n}", "title": "" }, { "docid": "a2989d166912bc84d49ce937ba6745f5", "score": "0.6946415", "text": "function _debug() {\n \tif ( typeof console != 'undefined' && settings.debug ) {\t\n \t\tvar args = [] ;\n \t\tfor ( var i = 0 ; i < arguments.length ; i++ ) args.push(arguments[i]) ;\n \t\ttry { console.log('LazyLoadAD |', args) ; } catch(e) {} ;\n \t}\n }", "title": "" }, { "docid": "7c703f07f2f9aa38a099ada813d45d59", "score": "0.69374496", "text": "static set allowDebugging(value) {}", "title": "" }, { "docid": "f4df09f8b3148dbe23c976cbf6e9d8e9", "score": "0.6901513", "text": "function setup(env){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=__webpack_require__(/*! ms */\"../../node_modules/debug/node_modules/ms/index.js\");Object.keys(env).forEach(key=>{createDebug[key]=env[key];});/**\n\t* Active `debug` instances.\n\t*/createDebug.instances=[];/**\n\t* The currently active debug mode names, and names to skip.\n\t*/createDebug.names=[];createDebug.skips=[];/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/createDebug.formatters={};/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/function selectColor(namespace){var hash=0;for(var i=0;i<namespace.length;i++){hash=(hash<<5)-hash+namespace.charCodeAt(i);hash|=0;// Convert to 32bit integer\n}return createDebug.colors[Math.abs(hash)%createDebug.colors.length];}createDebug.selectColor=selectColor;/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/function createDebug(namespace){var prevTime;function debug(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2];}// Disabled?\nif(!debug.enabled){return;}var self=debug;// Set `diff` timestamp\nvar curr=Number(new Date());var ms=curr-(prevTime||curr);self.diff=ms;self.prev=prevTime;self.curr=curr;prevTime=curr;args[0]=createDebug.coerce(args[0]);if(typeof args[0]!=='string'){// Anything else let's inspect with %O\nargs.unshift('%O');}// Apply any `formatters` transformations\nvar index=0;args[0]=args[0].replace(/%([a-zA-Z%])/g,(match,format)=>{// If we encounter an escaped % then don't increase the array index\nif(match==='%%'){return match;}index++;var formatter=createDebug.formatters[format];if(typeof formatter==='function'){var val=args[index];match=formatter.call(self,val);// Now we need to remove `args[index]` since it's inlined in the `format`\nargs.splice(index,1);index--;}return match;});// Apply env-specific formatting (colors, etc.)\ncreateDebug.formatArgs.call(self,args);var logFn=self.log||createDebug.log;logFn.apply(self,args);}debug.namespace=namespace;debug.enabled=createDebug.enabled(namespace);debug.useColors=createDebug.useColors();debug.color=selectColor(namespace);debug.destroy=destroy;debug.extend=extend;// Debug.formatArgs = formatArgs;\n// debug.rawLog = rawLog;\n// env-specific initialization logic for debug instances\nif(typeof createDebug.init==='function'){createDebug.init(debug);}createDebug.instances.push(debug);return debug;}function destroy(){var index=createDebug.instances.indexOf(this);if(index!==-1){createDebug.instances.splice(index,1);return true;}return false;}function extend(namespace,delimiter){var newDebug=createDebug(this.namespace+(typeof delimiter==='undefined'?':':delimiter)+namespace);newDebug.log=this.log;return newDebug;}/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/function enable(namespaces){createDebug.save(namespaces);createDebug.names=[];createDebug.skips=[];var i;var split=(typeof namespaces==='string'?namespaces:'').split(/[\\s,]+/);var len=split.length;for(i=0;i<len;i++){if(!split[i]){// ignore empty strings\ncontinue;}namespaces=split[i].replace(/\\*/g,'.*?');if(namespaces[0]==='-'){createDebug.skips.push(new RegExp('^'+namespaces.substr(1)+'$'));}else{createDebug.names.push(new RegExp('^'+namespaces+'$'));}}for(i=0;i<createDebug.instances.length;i++){var instance=createDebug.instances[i];instance.enabled=createDebug.enabled(instance.namespace);}}/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/function disable(){var namespaces=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map(namespace=>'-'+namespace)].join(',');createDebug.enable('');return namespaces;}/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/function enabled(name){if(name[name.length-1]==='*'){return true;}var i;var len;for(i=0,len=createDebug.skips.length;i<len;i++){if(createDebug.skips[i].test(name)){return false;}}for(i=0,len=createDebug.names.length;i<len;i++){if(createDebug.names[i].test(name)){return true;}}return false;}/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/function toNamespace(regexp){return regexp.toString().substring(2,regexp.toString().length-2).replace(/\\.\\*\\?$/,'*');}/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/function coerce(val){if(val instanceof Error){return val.stack||val.message;}return val;}createDebug.enable(createDebug.load());return createDebug;}", "title": "" }, { "docid": "a3fc3552cf37051fcbd2c35901727dde", "score": "0.68732136", "text": "function debug() {\n console.log(\"Hello, world!\");\n\n}", "title": "" }, { "docid": "81b597fd94e3c94e4d82b0e77ef6d8b0", "score": "0.6821594", "text": "function debug() {\r\n\tif (console) {\r\n\t\tconsole.log(this, arguments);\r\n\t}\r\n}", "title": "" }, { "docid": "db4e4d3f46180b20fcc97688b8ab4041", "score": "0.6784203", "text": "dbug(text) {\n if (this.debug) {\n this.print('debug ', text, colors.debug);\n }\n }", "title": "" }, { "docid": "55cba4f47595cafbfa95d46ec9cbef3a", "score": "0.67804545", "text": "function isDebug() {\n\treturn typeof DEBUG != \"undefined\";\n}", "title": "" }, { "docid": "79146508478e3a8b26dca7517c7ab5fb", "score": "0.67336255", "text": "function $debug(debug, level)\n{\n\t$_info('Debug: ' + debug, level);\n}", "title": "" }, { "docid": "82ad4d818de54052614414b28660490f", "score": "0.6705657", "text": "get Debug() {}", "title": "" }, { "docid": "82ad4d818de54052614414b28660490f", "score": "0.6705657", "text": "get Debug() {}", "title": "" }, { "docid": "2c15d007cad2eb6c1a63cb1210d4a358", "score": "0.6672331", "text": "function debug() {\r\n return currentLogLevel >= 3 /* debug */;\r\n}", "title": "" }, { "docid": "5006f406a40e76eb39172b7e484bfe17", "score": "0.6664412", "text": "function isDebugMode() {\n return global.DEBUG;\n}", "title": "" }, { "docid": "e78b41f689247f756e50cda9f198a692", "score": "0.66591936", "text": "function debug(msg){\r\n\tunsafeWindow.console.log(new Date().getTimeString() + ' >> ' + msg);\r\n}", "title": "" }, { "docid": "605b82252102959149e9f6468f6b9ba5", "score": "0.66458344", "text": "function debug() {\n\tconst args = nconf.stores.argv.store;\n\treturn args && args.hasOwnProperty('debug');\n}", "title": "" }, { "docid": "605b82252102959149e9f6468f6b9ba5", "score": "0.66458344", "text": "function debug() {\n\tconst args = nconf.stores.argv.store;\n\treturn args && args.hasOwnProperty('debug');\n}", "title": "" }, { "docid": "b79640040d4740004aadce614c726d3a", "score": "0.66407526", "text": "static get allowDebugging() {}", "title": "" }, { "docid": "d01f0ab2f7eaba6d65f566e553f50d65", "score": "0.66247123", "text": "function isDebugMode() {\r\n return DEBUG;\r\n}", "title": "" }, { "docid": "910363c7c022f63c4c58ff1449e56069", "score": "0.66163605", "text": "function _debug(msg) {\n if(_logLevel.debug){\n console.debug(msg);\n }\n }", "title": "" }, { "docid": "f5e61b6c71aac1d6c536a870d44d8098", "score": "0.66154385", "text": "function debugLog(string) {\n// console.log(string);\n}", "title": "" }, { "docid": "4f1d04ca684de56e026c3996dd3c4785", "score": "0.6600484", "text": "function debug()\n{\n\tfor (var k in g_def)\n\t{\n\t\t//console.log(g_def[k]);\n\t\tconsole.log(\"********Showing \" + g_def[k].modulename + \"*********\");\n\t\tg_def[k].debug();\n\t}\n\tfor (var varName in g_mapDictGlobal) \n\t console.log(\"GLOBAL var:\"+varName+\" get:\"+g_mapDictGlobal[varName].get+\" set:\"+g_mapDictGlobal[varName].set);\n}", "title": "" }, { "docid": "f144c4a249144718a010a987dc9cb687", "score": "0.65933704", "text": "function debug(s) {\n\tif (typeof console == \"undefined\") {\n this.console = {log: function() {}};\n\t}\n console.error(s);\n}", "title": "" }, { "docid": "81c6fe2c21711151edd06dd26a5b707c", "score": "0.65833956", "text": "function debug(txt) {\n console.log('Debug: ' + txt);\n}", "title": "" }, { "docid": "10b61ab177d7cb707928daff6e3c2f6e", "score": "0.6562688", "text": "function DebugConsole() {\n}", "title": "" }, { "docid": "acf48e04a9e06a8a5619739ba66c2088", "score": "0.6549884", "text": "function shouldReportDebugInfo() {\n return true;\n}", "title": "" }, { "docid": "ae0880176b000afbb273538aacdd6c92", "score": "0.6532617", "text": "function debug(...args) {\n write(entryFromArgs('DEBUG', args));\n}", "title": "" }, { "docid": "3afcf082062f04a88c54cdad25677ddf", "score": "0.6511377", "text": "function isDebug() {\n return exports.logLevel <= LogLevel.DEBUG;\n}", "title": "" }, { "docid": "f49f8ab25e858e597ea18a1d046e7f97", "score": "0.6511305", "text": "function debug(txt) {\n\t\tif (DEBUG && window.console && window.console.log)\n\t\t window.console.log(txt);\n\t}", "title": "" }, { "docid": "d55bbb0db0ba9c7d2f573f1f457e63ec", "score": "0.6498907", "text": "function debug(str) {\n\t if (defaults.debug && 'console' in this) {\n\t console.log(str);\n\t }\n\t}", "title": "" }, { "docid": "cea1c8a046c77ebcac64371aaad14c72", "score": "0.6489098", "text": "function debug() {\n if (options.verbose) console.log.apply(console, arguments);\n // log.push(arguments);\n}", "title": "" }, { "docid": "2ee0ad5fa3623183b0335cb2a16ddfad", "score": "0.64841753", "text": "function _debug(message) {\n\t\tif (Xbmc.DEBUG === true)\n\t\t\tconsole.log(message);\n\t}", "title": "" }, { "docid": "2ee0ad5fa3623183b0335cb2a16ddfad", "score": "0.64841753", "text": "function _debug(message) {\n\t\tif (Xbmc.DEBUG === true)\n\t\t\tconsole.log(message);\n\t}", "title": "" }, { "docid": "0370da1b82a933d72a3ff186170cd5b9", "score": "0.6483892", "text": "_writeDebug(message) {\n if (!this._options.debug)\n return;\n\n console.log(message);\n }", "title": "" }, { "docid": "757adc14c229bd2fd7d31f5792bc8112", "score": "0.6472814", "text": "function debugMode() {\n debugMode = !debugMode;\n}", "title": "" }, { "docid": "47fed8a30aa6397b61d000d8e71f458f", "score": "0.64685744", "text": "function debugOut(data)\n{\n\tif (debug)\n\t{\n\t\tconsole.log(data)\n\t}\n}", "title": "" }, { "docid": "52d9220c56c444d1f1808f5bd7dc468c", "score": "0.6467753", "text": "function IsDebugging() {\n return GetUrlParam(\"debug\") == \"T\" || window.location.protocol == \"file:\";\n}", "title": "" }, { "docid": "9a7ebf62ff93b0a12a66bb92d892d9f2", "score": "0.6444451", "text": "function setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/sockjs-client/node_modules/ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}", "title": "" }, { "docid": "9a7ebf62ff93b0a12a66bb92d892d9f2", "score": "0.6444451", "text": "function setup(env) {\n createDebug.debug = createDebug;\n createDebug.default = createDebug;\n createDebug.coerce = coerce;\n createDebug.disable = disable;\n createDebug.enable = enable;\n createDebug.enabled = enabled;\n createDebug.humanize = __webpack_require__(/*! ms */ \"./node_modules/sockjs-client/node_modules/ms/index.js\");\n Object.keys(env).forEach(function (key) {\n createDebug[key] = env[key];\n });\n /**\n * Active `debug` instances.\n */\n\n createDebug.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n createDebug.names = [];\n createDebug.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n createDebug.formatters = {};\n /**\n * Selects a color for a debug namespace\n * @param {String} namespace The namespace string for the for the debug instance to be colored\n * @return {Number|String} An ANSI color code for the given namespace\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0;\n\n for (var i = 0; i < namespace.length; i++) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n }\n\n createDebug.selectColor = selectColor;\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // Disabled?\n if (!debug.enabled) {\n return;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var self = debug; // Set `diff` timestamp\n\n var curr = Number(new Date());\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n args[0] = createDebug.coerce(args[0]);\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O');\n } // Apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // If we encounter an escaped % then don't increase the array index\n if (match === '%%') {\n return match;\n }\n\n index++;\n var formatter = createDebug.formatters[format];\n\n if (typeof formatter === 'function') {\n var val = args[index];\n match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // Apply env-specific formatting (colors, etc.)\n\n createDebug.formatArgs.call(self, args);\n var logFn = self.log || createDebug.log;\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = createDebug.enabled(namespace);\n debug.useColors = createDebug.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy;\n debug.extend = extend; // Debug.formatArgs = formatArgs;\n // debug.rawLog = rawLog;\n // env-specific initialization logic for debug instances\n\n if (typeof createDebug.init === 'function') {\n createDebug.init(debug);\n }\n\n createDebug.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = createDebug.instances.indexOf(this);\n\n if (index !== -1) {\n createDebug.instances.splice(index, 1);\n return true;\n }\n\n return false;\n }\n\n function extend(namespace, delimiter) {\n return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n createDebug.save(namespaces);\n createDebug.names = [];\n createDebug.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) {\n // ignore empty strings\n continue;\n }\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n createDebug.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < createDebug.instances.length; i++) {\n var instance = createDebug.instances[i];\n instance.enabled = createDebug.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n createDebug.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i;\n var len;\n\n for (i = 0, len = createDebug.skips.length; i < len; i++) {\n if (createDebug.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = createDebug.names.length; i < len; i++) {\n if (createDebug.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) {\n return val.stack || val.message;\n }\n\n return val;\n }\n\n createDebug.enable(createDebug.load());\n return createDebug;\n}", "title": "" }, { "docid": "0654e8bc594660501acdda72bee6755f", "score": "0.6444147", "text": "function debug (...args) {\n if (DEBUG_LOGGING) console.log(...args);\n}", "title": "" }, { "docid": "78762cd588ba94f312aa08edeb9d23ca", "score": "0.6426884", "text": "function debug_log( str )\n{\n\tif (_DEBUG_) console.log( str );\n}", "title": "" }, { "docid": "3608db4ce64585dd4427697c7b8221dd", "score": "0.642679", "text": "function debug(message) {\n log(message, TDEBUG, 'dbug');\n}", "title": "" }, { "docid": "1f4c8fe12373b02c99df61b449e26b8a", "score": "0.6417317", "text": "function $D()\n{\n if (Logger.debugEnabled)\n {\n Logger.debug(Logger.buildMessage(arguments));\n }\n}", "title": "" }, { "docid": "270f07062d1d0355d3f0e64653747e9e", "score": "0.64068514", "text": "function isDebug()\n{\n return (process.env.LOG_LEVEL && process.env.LOG_LEVEL >= 3);\n}", "title": "" }, { "docid": "034f7c2fb81196b378213fe85645c1ef", "score": "0.64018834", "text": "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "title": "" }, { "docid": "034f7c2fb81196b378213fe85645c1ef", "score": "0.64018834", "text": "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "title": "" }, { "docid": "034f7c2fb81196b378213fe85645c1ef", "score": "0.64018834", "text": "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "title": "" }, { "docid": "19aad48db1fe4700f03b88dd27b40562", "score": "0.6395271", "text": "static debug(string){\n //requires setting the VERBOSE_LOGGING environment variable to true\n if(!this.verboseLogging) return;\n console.log(ConsoleColors.yellowFg() + string + ConsoleColors.reset());\n }", "title": "" }, { "docid": "8f84b473799d149fe8578e15880df898", "score": "0.63868743", "text": "function debug(msg) {\r\n\tif (debugLoggingEnabled) {\r\n\t\tconsole.log(msg);\r\n\t}\r\n}", "title": "" }, { "docid": "30ce2ed06ba5fd1030b45520627fd652", "score": "0.63858074", "text": "function debug(obj) {\n if (window.console && window.console.log) {\n window.console.log(obj);\n }\n }", "title": "" }, { "docid": "dddcf6cf78be8faa9b330de8842439a8", "score": "0.6385456", "text": "function init (debug) {\n\t debug.inspectOpts = util._extend({}, exports.inspectOpts);\n\t}", "title": "" }, { "docid": "dddcf6cf78be8faa9b330de8842439a8", "score": "0.6385456", "text": "function init (debug) {\n\t debug.inspectOpts = util._extend({}, exports.inspectOpts);\n\t}", "title": "" }, { "docid": "acfe32fe2126e1957d3bb6155dee58b1", "score": "0.6370548", "text": "function setupDebug(){\n debug = new DEBUGTOOL(false,document.querySelector(\"section .content-wrap\"),[12,12,12]);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" }, { "docid": "29d41971e53af28a28c434d38a236aaf", "score": "0.63658416", "text": "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "title": "" } ]
a89039842046d745810a019a914e4dee
base64 is 4/3 + up to two characters of the original data
[ { "docid": "a884017c2af5d430bf98d22b97abbc16", "score": "0.0", "text": "function byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}", "title": "" } ]
[ { "docid": "39d3f3c05fb1ade6b41c45a5d2388d14", "score": "0.72438735", "text": "function base64(str) {\n\treturn new Buffer(str).toString('base64');\n}", "title": "" }, { "docid": "71d21450ceff5c5ec1d46cf03eb9e74f", "score": "0.7239418", "text": "function base64_encode(data) {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n enc = \"\",\n tmp_arr = [];\n\n if (!data) {\n return data;\n }\n\n do { // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n\n bits = o1 << 16 | o2 << 8 | o3;\n\n h1 = bits >> 18 & 0x3f;\n h2 = bits >> 12 & 0x3f;\n h3 = bits >> 6 & 0x3f;\n h4 = bits & 0x3f;\n\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n\n enc = tmp_arr.join('');\n\n var r = data.length % 3;\n\n return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);\n\n }", "title": "" }, { "docid": "c51a005bb08a6d88e5fe50361111ad1b", "score": "0.7192733", "text": "function base64AddPadding(str) {\n return str + Array((4 - str.length % 4) % 4 + 1).join('=');\n}", "title": "" }, { "docid": "da9508c3df3a326c32360ee67a7ef8b7", "score": "0.7181892", "text": "function fromBase64(enc) {\n enc = enc.replace(new RegExp('-', 'g'), '+');\n enc = enc.replace(new RegExp('_', 'g'), '/');\n if((enc.length & 3) == 2) enc += '==';\n else if((enc.length & 3) == 3) enc += '=';\n return atob(enc);\n}", "title": "" }, { "docid": "da9508c3df3a326c32360ee67a7ef8b7", "score": "0.7181892", "text": "function fromBase64(enc) {\n enc = enc.replace(new RegExp('-', 'g'), '+');\n enc = enc.replace(new RegExp('_', 'g'), '/');\n if((enc.length & 3) == 2) enc += '==';\n else if((enc.length & 3) == 3) enc += '=';\n return atob(enc);\n}", "title": "" }, { "docid": "015f0653f506a16904931111f3cf6ff7", "score": "0.7163182", "text": "function encoderBase64() {\n return {\n write: encodeBase64Write,\n end: encodeBase64End,\n prevStr: ''\n };\n }", "title": "" }, { "docid": "b4e8e9ef57102f8aac0af2503959b7c5", "score": "0.7151796", "text": "static bytesToBase64(bytes) {\r\n\t return base64_js_1.fromByteArray(bytes);\r\n\t }", "title": "" }, { "docid": "4974ac512a4adcdedd85d044a872b054", "score": "0.71263164", "text": "function e(a,b,d){if(!b)return c.encodeBase64Packet(a,d);var e=a.data,f=new Uint8Array(e),g=new Uint8Array(1+e.byteLength);g[0]=r[a.type];for(var h=0;h<f.length;h++)g[h+1]=f[h];return d(g.buffer)}", "title": "" }, { "docid": "75cad1bb8e35dcfb2f8d71617e20da57", "score": "0.70655483", "text": "function base64_encode(data) {\r\n // discuss at: http://phpjs.org/functions/base64_encode/\r\n // original by: Tyler Akins (http://rumkin.com)\r\n // improved by: Bayron Guevara\r\n // improved by: Thunder.m\r\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // improved by: Rafaإ‚ Kukawski (http://kukawski.pl)\r\n // bugfixed by: Pellentesque Malesuada\r\n // example 1: base64_encode('Kevin van Zonneveld');\r\n // returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='\r\n // example 2: base64_encode('a');\r\n // returns 2: 'YQ=='\r\n\r\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\r\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\r\n ac = 0,\r\n enc = '',\r\n tmp_arr = [];\r\n\r\n if (!data) {\r\n return data;\r\n }\r\n\r\n do { // pack three octets into four hexets\r\n o1 = data.charCodeAt(i++);\r\n o2 = data.charCodeAt(i++);\r\n o3 = data.charCodeAt(i++);\r\n\r\n bits = o1 << 16 | o2 << 8 | o3;\r\n\r\n h1 = bits >> 18 & 0x3f;\r\n h2 = bits >> 12 & 0x3f;\r\n h3 = bits >> 6 & 0x3f;\r\n h4 = bits & 0x3f;\r\n\r\n // use hexets to index into b64, and append result to encoded string\r\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\r\n } while (i < data.length);\r\n\r\n enc = tmp_arr.join('');\r\n\r\n var r = data.length % 3;\r\n\r\n return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);\r\n}", "title": "" }, { "docid": "111520be675b9815342322d84516c391", "score": "0.7064094", "text": "static encode(bytes) {\n let tmp;\n const len = bytes.length;\n const extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n const parts = [];\n const maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(Base64.encodeChunk(bytes, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n }\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = bytes[len - 1];\n parts.push(`${Base64._LOOKUP[tmp >> 2] + Base64._LOOKUP[(tmp << 4) & 0x3F]}==`);\n }\n else if (extraBytes === 2) {\n tmp = (bytes[len - 2] << 8) + bytes[len - 1];\n parts.push(`${Base64._LOOKUP[tmp >> 10] +\n Base64._LOOKUP[(tmp >> 4) & 0x3F] +\n Base64._LOOKUP[(tmp << 2) & 0x3F]}=`);\n }\n return parts.join(\"\");\n }", "title": "" }, { "docid": "390c29c7a538e975a0de39ae796aa197", "score": "0.7048005", "text": "static encode(bytes) {\n let tmp;\n const len = bytes.length;\n const extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n const parts = [];\n const maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (let i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(Base64.encodeChunk(bytes, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n }\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = bytes[len - 1];\n parts.push(`${Base64._LOOKUP[tmp >> 2] + Base64._LOOKUP[(tmp << 4) & 0x3F]}==`);\n }\n else if (extraBytes === 2) {\n tmp = (bytes[len - 2] << 8) + bytes[len - 1];\n parts.push(`${Base64._LOOKUP[tmp >> 10] +\n Base64._LOOKUP[(tmp >> 4) & 0x3F] +\n Base64._LOOKUP[(tmp << 2) & 0x3F]}=`);\n }\n return parts.join(\"\");\n }", "title": "" }, { "docid": "15d6d0a09e285ac2d415f5c3b4e9bf58", "score": "0.7043314", "text": "function base64Pusher(s) {\n var ch =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var c1, c2, c3, e1, e2, e3, e4;\n var l = s.length;\n var i = 0;\n var r = \"\";\n\n do {\n c1 = s.charCodeAt(i);\n e1 = c1 >> 2;\n c2 = s.charCodeAt(i+1);\n e2 = ((c1 & 3) << 4) | (c2 >> 4);\n c3 = s.charCodeAt(i+2);\n if (l < i+2) { e3 = 64; } else { e3 = ((c2 & 0xf) << 2) | (c3 >> 6); }\n if (l < i+3) { e4 = 64; } else { e4 = c3 & 0x3f; }\n r += ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);\n } while ((i += 3) < l);\n\n return r;\n}", "title": "" }, { "docid": "eba8aa70ccfa89c913b0b3c5be4935ff", "score": "0.7016321", "text": "function base64_encode() {\n // // read binary data\n // var bitmap = fs.readFileSync(\n // );\n // // // convert binary data to base64 encoded string\n // return new Buffer(bitmap).toString('base64');\n let a =\n 'https://firebasestorage.googleapis.com/v0/b/ccap-21cd3.appspot.com/o/issuer_registration_images%2FFInal_Testing%2Fmanufacture.png?alt=media&token=0bce1a83-1621-4b31-8081-6199d53207a6';\n return a.toString('base64');\n}", "title": "" }, { "docid": "bc7b10fc1b846a7f3bf36e4ea947a799", "score": "0.69685113", "text": "function encoderBase64() {\n return {\n write: encodeBase64Write,\n end: encodeBase64End,\n\n prevStr: '',\n };\n }", "title": "" }, { "docid": "0bb17f62cc0c7d93a7c1e3485aa34c26", "score": "0.6944185", "text": "function convertToBase64(input){var result=\"\";var charCodes=getExpandedCharCodes(input);var i=0;var length=charCodes.length;var byte1,byte2,byte3,byte4;while(i<length){// Convert every 6-bits in the input 3 character points\n// into a base64 digit\nbyte1=charCodes[i]>>2;byte2=(charCodes[i]&3)<<4|charCodes[i+1]>>4;byte3=(charCodes[i+1]&15)<<2|charCodes[i+2]>>6;byte4=charCodes[i+2]&63;// We are out of characters in the input, set the extra\n// digits to 64 (padding character).\nif(i+1>=length){byte3=byte4=64;}else if(i+2>=length){byte4=64;}// Write to the output\nresult+=base64Digits.charAt(byte1)+base64Digits.charAt(byte2)+base64Digits.charAt(byte3)+base64Digits.charAt(byte4);i+=3;}return result;}", "title": "" }, { "docid": "0be7c31a231b3cfca18ae4131d391e19", "score": "0.6932471", "text": "function base64_decode( data ) {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='';\n do { \n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1<<18 | h2<<12 | h3<<6 | h4;\n o1 = bits>>16 & 0xff;\n o2 = bits>>8 & 0xff;\n o3 = bits & 0xff;\n if (h3 == 64) enc += String.fromCharCode(o1);\n else if (h4 == 64) enc += String.fromCharCode(o1, o2);\n else enc += String.fromCharCode(o1, o2, o3);\n } while (i < data.length);\n return enc;\n}", "title": "" }, { "docid": "45b31e686844a20e9868627731e91573", "score": "0.69274974", "text": "function base64_decode(data) {\r\n // discuss at: http://phpjs.org/functions/base64_decode/\r\n // original by: Tyler Akins (http://rumkin.com)\r\n // improved by: Thunder.m\r\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // input by: Aman Gupta\r\n // input by: Brett Zamir (http://brett-zamir.me)\r\n // bugfixed by: Onno Marsman\r\n // bugfixed by: Pellentesque Malesuada\r\n // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');\r\n // returns 1: 'Kevin van Zonneveld'\r\n // example 2: base64_decode('YQ===');\r\n // returns 2: 'a'\r\n\r\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\r\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\r\n ac = 0,\r\n dec = '',\r\n tmp_arr = [];\r\n\r\n if (!data) {\r\n return data;\r\n }\r\n\r\n data += '';\r\n\r\n do { // unpack four hexets into three octets using index points in b64\r\n h1 = b64.indexOf(data.charAt(i++));\r\n h2 = b64.indexOf(data.charAt(i++));\r\n h3 = b64.indexOf(data.charAt(i++));\r\n h4 = b64.indexOf(data.charAt(i++));\r\n\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n\r\n o1 = bits >> 16 & 0xff;\r\n o2 = bits >> 8 & 0xff;\r\n o3 = bits & 0xff;\r\n\r\n if (h3 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1);\r\n } else if (h4 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\r\n } else {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\r\n }\r\n } while (i < data.length);\r\n\r\n dec = tmp_arr.join('');\r\n\r\n return dec.replace(/\\0+$/, '');\r\n}", "title": "" }, { "docid": "59b871c9ea4e6f3100487957bf89070e", "score": "0.69052875", "text": "static base64ToBytes(base64) {\r\n\t return base64_js_1.toByteArray(base64);\r\n\t }", "title": "" }, { "docid": "56ca95a9a90a768f30abaddf19092fb0", "score": "0.6904496", "text": "toBase64() {\n return this._byteString.toBase64();\n }", "title": "" }, { "docid": "56ca95a9a90a768f30abaddf19092fb0", "score": "0.6904496", "text": "toBase64() {\n return this._byteString.toBase64();\n }", "title": "" }, { "docid": "721376541c90b560a7e7fcc69bbe8fac", "score": "0.68914217", "text": "function base64(input) {\n return Base64.encode(input);\n }", "title": "" }, { "docid": "7b223c1bdaf0e0ecd506cdca0d14d661", "score": "0.68904036", "text": "function rawToBase64(raw) {\n var res = '';\n for (var i = 0; i < raw.length; i++) {\n res += intToString(raw[i]);\n }\n return global.btoa(res);\n}", "title": "" }, { "docid": "7b223c1bdaf0e0ecd506cdca0d14d661", "score": "0.68904036", "text": "function rawToBase64(raw) {\n var res = '';\n for (var i = 0; i < raw.length; i++) {\n res += intToString(raw[i]);\n }\n return global.btoa(res);\n}", "title": "" }, { "docid": "f7dd2cc6a0da0f29e5f9f1759a99a89a", "score": "0.6879304", "text": "function encoderBase64() {\n return {\n write: encodeBase64Write,\n end: encodeBase64End,\n\n prevStr: '',\n };\n}", "title": "" }, { "docid": "2ea592f82cded18e5c46dd63c8542bc7", "score": "0.68747", "text": "static base64ToBytes(base64) {\n return Base64.decode(base64);\n }", "title": "" }, { "docid": "cd53cc8eccd5c96f22f1e90e71a409f2", "score": "0.68740326", "text": "function rawToBase64(raw) {\n var res = '';\n for (var i = 0; i < raw.length; i++) {\n res += intToString(raw[i]);\n }\n return btoa(res);\n}", "title": "" }, { "docid": "2e4025fbd8d29ff6b9841a9278dc3303", "score": "0.6791465", "text": "function encode_base64(buffer){\r\n let png_base64=buffer.toString('base64');\r\n return png_base64;\r\n}", "title": "" }, { "docid": "75cd1668e7018d64cca8ce91d6249e0f", "score": "0.6769328", "text": "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "title": "" }, { "docid": "132a5d8c8e6478ab6d042c22c5f6be46", "score": "0.67641276", "text": "function atob(data) { return new Buffer(data, \"base64\").toString(\"binary\"); }", "title": "" }, { "docid": "0444d0ecc281de68ce045f158845a35b", "score": "0.675876", "text": "function base64ArrayBuffer(arrayBuffer) {\n var base64 = ''\n var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n\n var bytes = new Uint8Array(arrayBuffer)\n var byteLength = bytes.byteLength\n var byteRemainder = byteLength % 3\n var mainLength = byteLength - byteRemainder\n\n var a, b, c, d\n var chunk\n\n // Main loop deals with bytes in chunks of 3\n for (var i = 0; i < mainLength; i = i + 3) {\n // Combine the three bytes into a single integer\n chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]\n\n // Use bitmasks to extract 6-bit segments from the triplet\n a = (chunk & 16515072) >> 18 // 16515072 = (2^6 - 1) << 18\n b = (chunk & 258048) >> 12 // 258048 = (2^6 - 1) << 12\n c = (chunk & 4032) >> 6 // 4032 = (2^6 - 1) << 6\n d = chunk & 63 // 63 = 2^6 - 1\n\n // Convert the raw binary segments to the appropriate ASCII encoding\n base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d]\n }\n\n // Deal with the remaining bytes and padding\n if (byteRemainder == 1) {\n chunk = bytes[mainLength]\n\n a = (chunk & 252) >> 2 // 252 = (2^6 - 1) << 2\n\n // Set the 4 least significant bits to zero\n b = (chunk & 3) << 4 // 3 = 2^2 - 1\n\n base64 += encodings[a] + encodings[b] + '=='\n } else if (byteRemainder == 2) {\n chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1]\n\n a = (chunk & 64512) >> 10 // 64512 = (2^6 - 1) << 10\n b = (chunk & 1008) >> 4 // 1008 = (2^6 - 1) << 4\n\n // Set the 2 least significant bits to zero\n c = (chunk & 15) << 2 // 15 = 2^4 - 1\n\n base64 += encodings[a] + encodings[b] + encodings[c] + '='\n }\n\n return base64\n}", "title": "" }, { "docid": "ec5c12c19485bfcb9ddbdb654e13def4", "score": "0.67524993", "text": "function base64ArrayBuffer(arrayBuffer) {\n var base64 = ''\n var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n\n var bytes = new Uint8Array(arrayBuffer)\n var byteLength = bytes.byteLength\n var byteRemainder = byteLength % 3\n var mainLength = byteLength - byteRemainder\n\n var a, b, c, d\n var chunk\n\n // Main loop deals with bytes in chunks of 3\n for (var i = 0; i < mainLength; i = i + 3) {\n // Combine the three bytes into a single integer\n chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]\n\n // Use bitmasks to extract 6-bit segments from the triplet\n a = (chunk & 16515072) >> 18 // 16515072 = (2^6 - 1) << 18\n b = (chunk & 258048) >> 12 // 258048 = (2^6 - 1) << 12\n c = (chunk & 4032) >> 6 // 4032 = (2^6 - 1) << 6\n d = chunk & 63 // 63 = 2^6 - 1\n\n // Convert the raw binary segments to the appropriate ASCII encoding\n base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d]\n }\n\n // Deal with the remaining bytes and padding\n if (byteRemainder == 1) {\n chunk = bytes[mainLength]\n\n a = (chunk & 252) >> 2 // 252 = (2^6 - 1) << 2\n\n // Set the 4 least significant bits to zero\n b = (chunk & 3) << 4 // 3 = 2^2 - 1\n\n base64 += encodings[a] + encodings[b] + '=='\n } else if (byteRemainder == 2) {\n chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1]\n\n a = (chunk & 64512) >> 10 // 64512 = (2^6 - 1) << 10\n b = (chunk & 1008) >> 4 // 1008 = (2^6 - 1) << 4\n\n // Set the 2 least significant bits to zero\n c = (chunk & 15) << 2 // 15 = 2^4 - 1\n\n base64 += encodings[a] + encodings[b] + encodings[c] + '='\n }\n\n return base64\n}", "title": "" }, { "docid": "ab0bac3347dc417b7c6c76e7b91731cd", "score": "0.67437583", "text": "function base64(o) {\n return o.toString(CryptoJS.enc.Base64);\n }", "title": "" }, { "docid": "95375375cdccab42a80eebffca193b45", "score": "0.6741511", "text": "base64_encode(bitmap) {\n return Buffer.from(bitmap).toString('base64')\n }", "title": "" }, { "docid": "218e4697a90e30c625eb9377ffda8c31", "score": "0.67379946", "text": "function fromBase64(input) {\n let totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n const out = new ArrayBuffer(totalByteLength);\n const dataView = new DataView(out);\n for (let i = 0; i < input.length; i += 4) {\n let bits = 0;\n let bitLength = 0;\n for (let j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n const chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n const byteLength = Math.floor(bitLength / bitsPerByte);\n for (let k = 0; k < byteLength; k++) {\n const offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "title": "" }, { "docid": "2df590154c0bc08637018e04d64e6aa0", "score": "0.6725884", "text": "function forgivingBase64Encode(input) {\n /**\n * To forgiving-base64 encode given a byte sequence data, apply the base64\n * algorithm defined in section 4 of RFC 4648 to data and return the result.\n * [RFC4648]\n */\n return Buffer.from(input).toString('base64');\n}", "title": "" }, { "docid": "2df590154c0bc08637018e04d64e6aa0", "score": "0.6725884", "text": "function forgivingBase64Encode(input) {\n /**\n * To forgiving-base64 encode given a byte sequence data, apply the base64\n * algorithm defined in section 4 of RFC 4648 to data and return the result.\n * [RFC4648]\n */\n return Buffer.from(input).toString('base64');\n}", "title": "" }, { "docid": "39c7e5c11e389bea7dd3bc8e60db4413", "score": "0.67249316", "text": "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "title": "" }, { "docid": "d614b916c6d5da499f8af089c9de333a", "score": "0.6715237", "text": "function btoa (str) {return new Buffer(str).toString('base64');}", "title": "" }, { "docid": "9a6173df756437efeb7e4497b07f164f", "score": "0.67123723", "text": "function rawToBase64(raw) {\n var res = '';\n for (var i = 0, len = raw.length; i < len; i++) {\n res += intToString(raw[i]);\n }\n return base64.btoa(res);\n}", "title": "" }, { "docid": "94c9e7d8b3fd2da6d87313856bc79a42", "score": "0.67017466", "text": "function base64ArrayBuffer(arrayBuffer, off, byteLength) {\n var base64 = '';\n var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var bytes = new Uint8Array(arrayBuffer);\n var byteRemainder = byteLength % 3;\n var mainLength = off + byteLength - byteRemainder;\n var a, b, c, d;\n var chunk;\n // Main loop deals with bytes in chunks of 3\n for (var i = off; i < mainLength; i = i + 3) {\n // Combine the three bytes into a single integer\n chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n\n // Use bitmasks to extract 6-bit segments from the triplet\n a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18\n b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12\n c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6\n d = chunk & 63; // 63 = 2^6 - 1\n\n // Convert the raw binary segments to the appropriate ASCII encoding\n base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];\n }\n\n // Deal with the remaining bytes and padding\n if (byteRemainder == 1) {\n chunk = bytes[mainLength];\n\n a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2\n\n // Set the 4 least significant bits to zero\n b = (chunk & 3) << 4; // 3 = 2^2 - 1\n\n base64 += encodings[a] + encodings[b] + '==';\n } else if (byteRemainder == 2) {\n chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1];\n\n a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10\n b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4\n\n // Set the 2 least significant bits to zero\n c = (chunk & 15) << 2; // 15 = 2^4 - 1\n\n base64 += encodings[a] + encodings[b] + encodings[c] + '=';\n }\n\n return base64;\n}", "title": "" }, { "docid": "f338785c7532f408b94c465f493a782f", "score": "0.66929346", "text": "function toBase64(text) {\n var result = btoa(text);\n // remove padding, and use -_ instead of +/\n result = result.split('=')[0];\n result = result.replace(new RegExp('\\\\+', 'g'), '-');\n result = result.replace(new RegExp('/', 'g'), '_');\n return result;\n}", "title": "" }, { "docid": "f338785c7532f408b94c465f493a782f", "score": "0.66929346", "text": "function toBase64(text) {\n var result = btoa(text);\n // remove padding, and use -_ instead of +/\n result = result.split('=')[0];\n result = result.replace(new RegExp('\\\\+', 'g'), '-');\n result = result.replace(new RegExp('/', 'g'), '_');\n return result;\n}", "title": "" }, { "docid": "92e0eeeec22186acfc6424474b7a0f75", "score": "0.66927165", "text": "function Base64() {\n \n\t// private property\n\t_keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n \n\t// public method for encoding\n\tthis.encode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = _utf8_encode(input);\n\t\twhile (i < input.length) {\n\t\t\tchr1 = input.charCodeAt(i++);\n\t\t\tchr2 = input.charCodeAt(i++);\n\t\t\tchr3 = input.charCodeAt(i++);\n\t\t\tenc1 = chr1 >> 2;\n\t\t\tenc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n\t\t\tenc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n\t\t\tenc4 = chr3 & 63;\n\t\t\tif (isNaN(chr2)) {\n\t\t\t\tenc3 = enc4 = 64;\n\t\t\t} else if (isNaN(chr3)) {\n\t\t\t\tenc4 = 64;\n\t\t\t}\n\t\t\toutput = output +\n\t\t\t_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n\t\t\t_keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\t\t}\n\t\treturn output;\n\t};\n \n\t// public method for decoding\n\tthis.decode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3;\n\t\tvar enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\t\twhile (i < input.length) {\n\t\t\tenc1 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc2 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc3 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc4 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\t\t\toutput = output + String.fromCharCode(chr1);\n\t\t\tif (enc3 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t\t}\n\t\t\tif (enc4 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t\t}\n\t\t}\n\t\toutput = _utf8_decode(output);\n\t\treturn output;\n\t};\n \n\t// private method for UTF-8 encoding\n\t_utf8_encode = function (string) {\n\t\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\t\tvar utftext = \"\";\n\t\tfor (var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t} else if((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t} else {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n \n\t\t}\n\t\treturn utftext;\n\t};\n \n\t// private method for UTF-8 decoding\n\t_utf8_decode = function (utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c = c1 = c2 = 0;\n\t\twhile ( i < utftext.length ) {\n\t\t\tc = utftext.charCodeAt(i);\n\t\t\tif (c < 128) {\n\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\ti++;\n\t\t\t} else if((c > 191) && (c < 224)) {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\ti += 2;\n\t\t\t} else {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tc3 = utftext.charCodeAt(i+2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\t\t}\n\t\treturn string;\n\t};\n}", "title": "" }, { "docid": "be431a6dbae137d77ebe1bdeeb225b84", "score": "0.6690181", "text": "function Base64() {\n \n\t// private property\n\t_keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n \n\t// public method for encoding\n\tthis.encode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = _utf8_encode(input);\n\t\twhile (i < input.length) {\n\t\t\tchr1 = input.charCodeAt(i++);\n\t\t\tchr2 = input.charCodeAt(i++);\n\t\t\tchr3 = input.charCodeAt(i++);\n\t\t\tenc1 = chr1 >> 2;\n\t\t\tenc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n\t\t\tenc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n\t\t\tenc4 = chr3 & 63;\n\t\t\tif (isNaN(chr2)) {\n\t\t\t\tenc3 = enc4 = 64;\n\t\t\t} else if (isNaN(chr3)) {\n\t\t\t\tenc4 = 64;\n\t\t\t}\n\t\t\toutput = output +\n\t\t\t_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n\t\t\t_keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\t\t}\n\t\treturn output;\n\t}\n \n\t// public method for decoding\n\tthis.decode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3;\n\t\tvar enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\t\twhile (i < input.length) {\n\t\t\tenc1 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc2 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc3 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc4 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\t\t\toutput = output + String.fromCharCode(chr1);\n\t\t\tif (enc3 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t\t}\n\t\t\tif (enc4 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t\t}\n\t\t}\n\t\toutput = _utf8_decode(output);\n\t\treturn output;\n\t}\n \n\t// private method for UTF-8 encoding\n\t_utf8_encode = function (string) {\n\t\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\t\tvar utftext = \"\";\n\t\tfor (var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t} else if((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t} else {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n \n\t\t}\n\t\treturn utftext;\n\t}\n \n\t// private method for UTF-8 decoding\n\t_utf8_decode = function (utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c = c1 = c2 = 0;\n\t\twhile ( i < utftext.length ) {\n\t\t\tc = utftext.charCodeAt(i);\n\t\t\tif (c < 128) {\n\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\ti++;\n\t\t\t} else if((c > 191) && (c < 224)) {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\ti += 2;\n\t\t\t} else {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tc3 = utftext.charCodeAt(i+2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\t\t}\n\t\treturn string;\n\t}\n}", "title": "" }, { "docid": "be431a6dbae137d77ebe1bdeeb225b84", "score": "0.6690181", "text": "function Base64() {\n \n\t// private property\n\t_keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n \n\t// public method for encoding\n\tthis.encode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = _utf8_encode(input);\n\t\twhile (i < input.length) {\n\t\t\tchr1 = input.charCodeAt(i++);\n\t\t\tchr2 = input.charCodeAt(i++);\n\t\t\tchr3 = input.charCodeAt(i++);\n\t\t\tenc1 = chr1 >> 2;\n\t\t\tenc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n\t\t\tenc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n\t\t\tenc4 = chr3 & 63;\n\t\t\tif (isNaN(chr2)) {\n\t\t\t\tenc3 = enc4 = 64;\n\t\t\t} else if (isNaN(chr3)) {\n\t\t\t\tenc4 = 64;\n\t\t\t}\n\t\t\toutput = output +\n\t\t\t_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n\t\t\t_keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\t\t}\n\t\treturn output;\n\t}\n \n\t// public method for decoding\n\tthis.decode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3;\n\t\tvar enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\t\twhile (i < input.length) {\n\t\t\tenc1 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc2 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc3 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc4 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\t\t\toutput = output + String.fromCharCode(chr1);\n\t\t\tif (enc3 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t\t}\n\t\t\tif (enc4 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t\t}\n\t\t}\n\t\toutput = _utf8_decode(output);\n\t\treturn output;\n\t}\n \n\t// private method for UTF-8 encoding\n\t_utf8_encode = function (string) {\n\t\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\t\tvar utftext = \"\";\n\t\tfor (var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t} else if((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t} else {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n \n\t\t}\n\t\treturn utftext;\n\t}\n \n\t// private method for UTF-8 decoding\n\t_utf8_decode = function (utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c = c1 = c2 = 0;\n\t\twhile ( i < utftext.length ) {\n\t\t\tc = utftext.charCodeAt(i);\n\t\t\tif (c < 128) {\n\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\ti++;\n\t\t\t} else if((c > 191) && (c < 224)) {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\ti += 2;\n\t\t\t} else {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tc3 = utftext.charCodeAt(i+2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\t\t}\n\t\treturn string;\n\t}\n}", "title": "" }, { "docid": "c601ffbfe25edff2cf23a07db7b6c593", "score": "0.66895187", "text": "function Base64() {\n // private property \n _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n // public method for encoding \n this.encode = function(input) {\n var output = \"\";\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n input = _utf8_encode(input);\n while (i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n }\n return output;\n }\n\n // public method for decoding \n this.decode = function(input) {\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n while (i < input.length) {\n enc1 = _keyStr.indexOf(input.charAt(i++));\n enc2 = _keyStr.indexOf(input.charAt(i++));\n enc3 = _keyStr.indexOf(input.charAt(i++));\n enc4 = _keyStr.indexOf(input.charAt(i++));\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n output = output + String.fromCharCode(chr1);\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n output = _utf8_decode(output);\n return output;\n }\n\n // private method for UTF-8 encoding \n _utf8_encode = function(string) {\n string = string.replace(/\\r\\n/g, \"\\n\");\n var utftext = \"\";\n for (var n = 0; n < string.length; n++) {\n var c = string.charCodeAt(n);\n if (c < 128) {\n utftext += String.fromCharCode(c);\n } else if ((c > 127) && (c < 2048)) {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\n } else {\n utftext += String.fromCharCode((c >> 12) | 224);\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n\n }\n return utftext;\n }\n\n // private method for UTF-8 decoding \n _utf8_decode = function(utftext) {\n var string = \"\";\n var i = 0;\n var c = c1 = c2 = 0;\n while (i < utftext.length) {\n c = utftext.charCodeAt(i);\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n } else if ((c > 191) && (c < 224)) {\n c2 = utftext.charCodeAt(i + 1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n } else {\n c2 = utftext.charCodeAt(i + 1);\n c3 = utftext.charCodeAt(i + 2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n }\n return string;\n }\n}", "title": "" }, { "docid": "488c2ee073176383e930f4b7df6da22c", "score": "0.6685446", "text": "function Base64(){_keyStr=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";this.encode=function(input){var output=\"\";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=_utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64}else{if(isNaN(chr3)){enc4=64}}output=output+_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4)}return output};this.decode=function(input){var output=\"\";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");while(i<input.length){enc1=_keyStr.indexOf(input.charAt(i++));enc2=_keyStr.indexOf(input.charAt(i++));enc3=_keyStr.indexOf(input.charAt(i++));enc4=_keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2)}if(enc4!=64){output=output+String.fromCharCode(chr3)}}output=_utf8_decode(output);return output};_utf8_encode=function(string){string=string.replace(/\\r\\n/g,\"\\n\");var utftext=\"\";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c)}else{if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128)}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128)}}}return utftext};_utf8_decode=function(utftext){var string=\"\";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++}else{if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3}}}return string}}", "title": "" }, { "docid": "12cb86ef7bba4b5f920b0c1d9b435d8e", "score": "0.6675746", "text": "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "title": "" }, { "docid": "2a3df091d5ada64a00626603d3a43bf0", "score": "0.6672441", "text": "base64_encode(file) {\n // read binary data\n var bitmap = fs.readFileSync(file);\n // convert binary data to base64 encoded string\n return new Buffer(bitmap).toString('base64');\n }", "title": "" }, { "docid": "c2d8079f43f858e9608369c3e9fc313c", "score": "0.6671782", "text": "function Base64(){_keyStr=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";this.encode=function(e){var t=\"\",n,r,i,s,o,u,a,f=0;e=_utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;isNaN(r)?u=a=64:isNaN(i)&&(a=64);t=t+_keyStr.charAt(s)+_keyStr.charAt(o)+_keyStr.charAt(u)+_keyStr.charAt(a)}return t};this.decode=function(e){var t=\"\",n,r,i,s,o,u,a,f=0;e=e.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");while(f<e.length){s=_keyStr.indexOf(e.charAt(f++));o=_keyStr.indexOf(e.charAt(f++));u=_keyStr.indexOf(e.charAt(f++));a=_keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t+=String.fromCharCode(n);u!=64&&(t+=String.fromCharCode(r));a!=64&&(t+=String.fromCharCode(i))}t=_utf8_decode(t);return t};_utf8_encode=function(e){e=e.replace(/\\r\\n/g,\"\\n\");var t=\"\";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128)t+=String.fromCharCode(r);else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t};_utf8_decode=function(e){var t=\"\",n=0,r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}}", "title": "" }, { "docid": "db4a275cd377e2410b85366a81fa0a26", "score": "0.66627276", "text": "function forgivingBase64Decode(input) {\n if (input === \"\")\n return \"\";\n /**\n * 1. Remove all ASCII whitespace from data.\n */\n input = input.replace(CodePoints_1.ASCIIWhiteSpace, '');\n /**\n * 2. If data’s length divides by 4 leaving no remainder, then:\n * 2.1. If data ends with one or two U+003D (=) code points, then remove them from data.\n */\n if (input.length % 4 === 0) {\n if (input.endsWith(\"==\")) {\n input = input.substr(0, input.length - 2);\n }\n else if (input.endsWith(\"=\")) {\n input = input.substr(0, input.length - 1);\n }\n }\n /**\n * 3. If data’s length divides by 4 leaving a remainder of 1, then return failure.\n */\n if (input.length % 4 === 1)\n return null;\n /**\n * 4. If data contains a code point that is not one of\n * - U+002B (+)\n * - U+002F (/)\n * - ASCII alphanumeric\n * then return failure.\n */\n if (!/[0-9A-Za-z+/]/.test(input))\n return null;\n /**\n * 5. Let output be an empty byte sequence.\n * 6. Let buffer be an empty buffer that can have bits appended to it.\n * 7. Let position be a position variable for data, initially pointing at the\n * start of data.\n * 8. While position does not point past the end of data:\n * 8.1. Find the code point pointed to by position in the second column of\n * Table 1: The Base 64 Alphabet of RFC 4648. Let n be the number given in the\n * first cell of the same row. [RFC4648]\n * 8.2. Append the six bits corresponding to n, most significant bit first,\n * to buffer.\n * 8.3. If buffer has accumulated 24 bits, interpret them as three 8-bit\n * big-endian numbers. Append three bytes with values equal to those numbers\n * to output, in the same order, and then empty buffer.\n * 8.4. Advance position by 1.\n * 9. If buffer is not empty, it contains either 12 or 18 bits. If it contains\n * 12 bits, then discard the last four and interpret the remaining eight as an\n * 8-bit big-endian number. If it contains 18 bits, then discard the last two\n * and interpret the remaining 16 as two 8-bit big-endian numbers. Append the\n * one or two bytes with values equal to those one or two numbers to output,\n * in the same order.\n * 10. Return output.\n */\n return Buffer.from(input, 'base64').toString('utf8');\n}", "title": "" }, { "docid": "db4a275cd377e2410b85366a81fa0a26", "score": "0.66627276", "text": "function forgivingBase64Decode(input) {\n if (input === \"\")\n return \"\";\n /**\n * 1. Remove all ASCII whitespace from data.\n */\n input = input.replace(CodePoints_1.ASCIIWhiteSpace, '');\n /**\n * 2. If data’s length divides by 4 leaving no remainder, then:\n * 2.1. If data ends with one or two U+003D (=) code points, then remove them from data.\n */\n if (input.length % 4 === 0) {\n if (input.endsWith(\"==\")) {\n input = input.substr(0, input.length - 2);\n }\n else if (input.endsWith(\"=\")) {\n input = input.substr(0, input.length - 1);\n }\n }\n /**\n * 3. If data’s length divides by 4 leaving a remainder of 1, then return failure.\n */\n if (input.length % 4 === 1)\n return null;\n /**\n * 4. If data contains a code point that is not one of\n * - U+002B (+)\n * - U+002F (/)\n * - ASCII alphanumeric\n * then return failure.\n */\n if (!/[0-9A-Za-z+/]/.test(input))\n return null;\n /**\n * 5. Let output be an empty byte sequence.\n * 6. Let buffer be an empty buffer that can have bits appended to it.\n * 7. Let position be a position variable for data, initially pointing at the\n * start of data.\n * 8. While position does not point past the end of data:\n * 8.1. Find the code point pointed to by position in the second column of\n * Table 1: The Base 64 Alphabet of RFC 4648. Let n be the number given in the\n * first cell of the same row. [RFC4648]\n * 8.2. Append the six bits corresponding to n, most significant bit first,\n * to buffer.\n * 8.3. If buffer has accumulated 24 bits, interpret them as three 8-bit\n * big-endian numbers. Append three bytes with values equal to those numbers\n * to output, in the same order, and then empty buffer.\n * 8.4. Advance position by 1.\n * 9. If buffer is not empty, it contains either 12 or 18 bits. If it contains\n * 12 bits, then discard the last four and interpret the remaining eight as an\n * 8-bit big-endian number. If it contains 18 bits, then discard the last two\n * and interpret the remaining 16 as two 8-bit big-endian numbers. Append the\n * one or two bytes with values equal to those one or two numbers to output,\n * in the same order.\n * 10. Return output.\n */\n return Buffer.from(input, 'base64').toString('utf8');\n}", "title": "" }, { "docid": "8f73ae0f41e475d24b105f483ce0231c", "score": "0.66603154", "text": "static bytesToBase64(bytes) {\n return Base64.encode(bytes);\n }", "title": "" }, { "docid": "8ace29e593d3c3cae5f50aaad37f8511", "score": "0.6657323", "text": "encode(blob){\n Base64.init()\n if( blob.byteLength === undefined ) throw '·Not a byte array·'\n var str=''\n var m = (blob.length%3)\n if(m>0) m++ \n var n = 4*Math.floor(blob.length/3) + m\n var k=0\n var c=0\n for(var i=0; i<n; i++){\n c=i&3\n switch(c){\n case 0: str += Base64.i2a[blob[k]>>2]; break;\n case 1: str += Base64.i2a[((blob[k]&3)<<4) | (blob[k+1]>>4)]; break;\n case 2: str += Base64.i2a[((blob[k]&15)<<2) | (blob[k+1]>>6)]; break;\n case 3: str += Base64.i2a[blob[k]&63]; break;\n }\n if(c!=0) k++ \n }\n while(m<4){\n str+='='\n m++\n } \n return str\n }", "title": "" }, { "docid": "52d430187b52614b9acaabad17c82fd1", "score": "0.66330004", "text": "Base64(){\n // private property\n this._keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n // public method for encoding\n this.encode = function (input) {\n var output = '';\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n input = this._utf8_encode(input);\n while (i < input.length) {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n output = output +\n this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) +\n this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);\n }\n return output;\n };\n // public method for decoding\n this.decode = function (input) {\n var output = '';\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n while (i < input.length) {\n enc1 = this._keyStr.indexOf(input.charAt(i++));\n enc2 = this._keyStr.indexOf(input.charAt(i++));\n enc3 = this._keyStr.indexOf(input.charAt(i++));\n enc4 = this._keyStr.indexOf(input.charAt(i++));\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n output = output + String.fromCharCode(chr1);\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n }\n output = this._utf8_decode(output);\n return output;\n };\n // private method for UTF-8 encoding\n this._utf8_encode = function (string) {\n string = string.replace(/\\r\\n/g,'\\n');\n var utftext = '';\n for (var n = 0; n < string.length; n++) {\n var c = string.charCodeAt(n);\n if (c < 128) {\n utftext += String.fromCharCode(c);\n }\n else if((c > 127) && (c < 2048)) {\n utftext += String.fromCharCode((c >> 6) | 192);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n else {\n utftext += String.fromCharCode((c >> 12) | 224);\n utftext += String.fromCharCode(((c >> 6) & 63) | 128);\n utftext += String.fromCharCode((c & 63) | 128);\n }\n }\n return utftext;\n };\n // private method for UTF-8 decoding\n this._utf8_decode = function (utftext) {\n var string = '';\n var i = 0;\n var c = c1 = c2 = 0;\n while ( i < utftext.length ) {\n c = utftext.charCodeAt(i);\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n }\n else if((c > 191) && (c < 224)) {\n c2 = utftext.charCodeAt(i+1);\n string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n i += 2;\n }\n else {\n c2 = utftext.charCodeAt(i+1);\n c3 = utftext.charCodeAt(i+2);\n string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n i += 3;\n }\n }\n return string;\n }\n return this;\n }", "title": "" }, { "docid": "3b1aaa3735f723e544a859c8e510fce2", "score": "0.6627594", "text": "function url_base64_decode(str) {\n\tvar output = str.replace('-', '+').replace('_', '/');\n\tswitch (output.length % 4) {\n\tcase 0:\n\t\tbreak;\n\tcase 2:\n\t\toutput += '==';\n\t\tbreak;\n\tcase 3:\n\t\toutput += '=';\n\t\tbreak;\n\tdefault:\n\t\tthrow 'Illegal base64url string!';\n\t}\n\treturn window.atob(output); // polifyll\n\t// https://github.com/davidchambers/Base64.js\n}", "title": "" }, { "docid": "f1ad9c13f9f34f5af765683bc21fae31", "score": "0.6621898", "text": "function base64ArrayBuffer(arrayBuffer)\n{\n var base64 = ''\n var encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n\n var bytes = new Uint8Array(arrayBuffer)\n var byteLength = bytes.byteLength\n var byteRemainder = byteLength % 3\n var mainLength = byteLength - byteRemainder\n\n var a, b, c, d\n var chunk\n\n // Main loop deals with bytes in chunks of 3\n for (var i = 0; i < mainLength; i = i + 3) {\n\t// Combine the three bytes into a single integer\n\tchunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]\n\n\t// Use bitmasks to extract 6-bit segments from the triplet\n\ta = (chunk & 16515072) >> 18 // 16515072 = (2^6 - 1) << 18\n\tb = (chunk & 258048) >> 12 // 258048 = (2^6 - 1) << 12\n\tc = (chunk & 4032) >> 6 // 4032 = (2^6 - 1) << 6\n\td = chunk & 63 // 63 = 2^6 - 1\n\n\t// Convert the raw binary segments to the appropriate ASCII encoding\n\tbase64 += encodings[a] + encodings[b] + encodings[c] + encodings[d]\n }\n\n // Deal with the remaining bytes and padding\n if (byteRemainder == 1) {\n\tchunk = bytes[mainLength]\n\n\ta = (chunk & 252) >> 2 // 252 = (2^6 - 1) << 2\n\n\t// Set the 4 least significant bits to zero\n\tb = (chunk & 3) << 4 // 3 = 2^2 - 1\n\n\tbase64 += encodings[a] + encodings[b] + '=='\n } else if (byteRemainder == 2) {\n\tchunk = (bytes[mainLength] << 8) | bytes[mainLength + 1]\n\n\ta = (chunk & 64512) >> 10 // 64512 = (2^6 - 1) << 10\n\tb = (chunk & 1008) >> 4 // 1008 = (2^6 - 1) << 4\n\n\t// Set the 2 least significant bits to zero\n\tc = (chunk & 15) << 2 // 15 = 2^4 - 1\n\n\tbase64 += encodings[a] + encodings[b] + encodings[c] + '='\n }\n\n return base64\n}", "title": "" }, { "docid": "603ab68ce147ad429f10657f48e40584", "score": "0.6613756", "text": "function base64Converter(e,t){Base64={_keyStr:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",encode:function(e){var t=\"\";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t=\"\";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\\r\\n/g,\"\\n\");var t=\"\";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t=\"\";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}};switch(e){case\"encode\":return Base64.encode(t);case\"decode\":return Base64.decode(t)}}", "title": "" }, { "docid": "a4809249b0a0240a4063bd99f8fb54c1", "score": "0.66097736", "text": "set _base64(encodedData) {\n this.injectRaw(JSON.parse(atob(encodedData)));\n }", "title": "" }, { "docid": "bc4bccac6fde00b54bd805d9f63ea18f", "score": "0.6580911", "text": "function encodeToBase64(string, type) {\r\n var type = \"data:\" + type + \";base64,\";\r\n return type + btoa(unescape(encodeURIComponent(string)));\r\n //return type + btoa(string); // doesn't work for characters outside latin-1 range\r\n}", "title": "" }, { "docid": "3a4aa5017e77624429c4dab84c244163", "score": "0.65731865", "text": "function Base64() {\n var self = this;\n\n self.keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\n self.encode = function(input) {\n var output = '';\n var chr1, chr2, chr3 = '';\n var enc1, enc2, enc3, enc4 = '';\n var i = 0;\n\n do {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n self.keyStr.charAt(enc1) +\n self.keyStr.charAt(enc2) +\n self.keyStr.charAt(enc3) +\n self.keyStr.charAt(enc4);\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n } while (i < input.length);\n\n return output;\n };\n\n self.decode = function(input) {\n var output = '';\n var chr1, chr2, chr3 = '';\n var enc1, enc2, enc3, enc4 = '';\n var i = 0;\n\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n window.alert('There were invalid base64 characters in the input text.\\n' +\n 'Valid base64 characters are A-Z, a-z, 0-9, \\'+\\', \\'/\\',and \\'=\\'\\n' +\n 'Expect errors in decoding.');\n }\n\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n do {\n enc1 = self.keyStr.indexOf(input.charAt(i++));\n enc2 = self.keyStr.indexOf(input.charAt(i++));\n enc3 = self.keyStr.indexOf(input.charAt(i++));\n enc4 = self.keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n\n chr1 = chr2 = chr3 = '';\n enc1 = enc2 = enc3 = enc4 = '';\n\n } while (i < input.length);\n\n return output;\n };\n }", "title": "" }, { "docid": "debaf57e0c18c6fa3f14e62f600aef6d", "score": "0.6570285", "text": "function toBase64(txt) {\n return Buffer.from(txt).toString('base64')\n}", "title": "" }, { "docid": "8af7d191cda9190287dbf3b3d559553d", "score": "0.6569875", "text": "function _base64ArrayBuffer(arrayBuffer) {\n let base64 = '';\n let encodings = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n let bytes = new Uint8Array(arrayBuffer);\n let byteLength = bytes.byteLength;\n let byteRemainder = byteLength % 3;\n let mainLength = byteLength - byteRemainder;\n\n let a, b, c, d = undefined;\n let chunk = undefined;\n\n // Main loop deals with bytes in chunks of 3\n for (let i = 0; i < mainLength; i = i + 3) {\n // Combine the three bytes into a single integer\n chunk = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n\n // Use bitmasks to extract 6-bit segments from the triplet\n a = (chunk & 16515072) >> 18; // 16515072 = (2^6 - 1) << 18\n b = (chunk & 258048) >> 12; // 258048 = (2^6 - 1) << 12\n c = (chunk & 4032) >> 6; // 4032 = (2^6 - 1) << 6\n d = chunk & 63; // 63 = 2^6 - 1\n\n // Convert the raw binary segments to the appropriate ASCII encoding\n base64 += encodings[a] + encodings[b] + encodings[c] + encodings[d];\n }\n\n // Deal with the remaining bytes and padding\n if (byteRemainder === 1) {\n chunk = bytes[mainLength];\n\n a = (chunk & 252) >> 2; // 252 = (2^6 - 1) << 2\n\n // Set the 4 least significant bits to zero\n b = (chunk & 3) << 4; // 3 = 2^2 - 1\n\n base64 += encodings[a] + encodings[b] + '==';\n } else if (byteRemainder === 2) {\n chunk = (bytes[mainLength] << 8) | bytes[mainLength + 1];\n\n a = (chunk & 64512) >> 10; // 64512 = (2^6 - 1) << 10\n b = (chunk & 1008) >> 4; // 1008 = (2^6 - 1) << 4\n\n // Set the 2 least significant bits to zero\n c = (chunk & 15) << 2; // 15 = 2^4 - 1\n\n base64 += encodings[a] + encodings[b] + encodings[c] + '=';\n }\n\n return base64;\n}", "title": "" }, { "docid": "904e78b3b77692a9641b42c81804328d", "score": "0.6566215", "text": "function base64_decode(data) {\n var dst = \"\"\n var i, a, b, c, d, z\n\n for (i = 0; i < data.length - 3; i += 4) {\n a = base64_charIndex(data.charAt(i+0))\n b = base64_charIndex(data.charAt(i+1))\n c = base64_charIndex(data.charAt(i+2))\n d = base64_charIndex(data.charAt(i+3))\n\n dst += String.fromCharCode((a << 2) | (b >>> 4))\n if (data.charAt(i+2) != b64pad)\n dst += String.fromCharCode(((b << 4) & 0xF0) | ((c >>> 2) & 0x0F))\n if (data.charAt(i+3) != b64pad)\n dst += String.fromCharCode(((c << 6) & 0xC0) | d)\n }\n\n dst = decodeURIComponent(escape(dst))\n return dst\n}", "title": "" }, { "docid": "fe125bb4fcd3eed71938f19bdc3d8383", "score": "0.6552427", "text": "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polyfill https://github.com/davidchambers/Base64.js\n }", "title": "" }, { "docid": "3bd21814a2d0b385abe0f48b18209f33", "score": "0.6541642", "text": "function url_base64_decode(str) {\n var output = str.replace(\"-\", \"+\").replace(\"_\", \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw \"Illegal base64url string!\";\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "title": "" }, { "docid": "876cd8c59dcc59d47eb91e6cf3f66681", "score": "0.6523706", "text": "base64_decode(base64str) {\n return Buffer.from(base64str, 'base64')\n }", "title": "" }, { "docid": "25edb0d54159ce727226fa04767e9ee7", "score": "0.6517727", "text": "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t case 0:\n\t break;\n\t case 2:\n\t output += '==';\n\t break;\n\t case 3:\n\t output += '=';\n\t break;\n\t default:\n\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); \n\t}", "title": "" }, { "docid": "20c8b090692b3bc7aa20e76396f46fc4", "score": "0.6511522", "text": "function base64_encode(str)\r\n{\r\n var out = '';\r\n var t, x, y ,z;\r\n\r\n for (var i = 0; i < str.length; i += 3)\r\n {\r\n t = Math.min(3, str.length - i);\r\n if (t == 1)\r\n {\r\n x = str.charCodeAt(i);\r\n out += alnum.charAt((x >> 2));\r\n out += alnum.charAt(((x & 0X00000003) << 4));\r\n out += '--';\r\n } \r\n else if (t == 2)\r\n {\r\n x = str.charCodeAt(i);\r\n y = str.charCodeAt(i+1);\r\n out += alnum.charAt((x >> 2));\r\n out += alnum.charAt((((x & 0X00000003) << 4) | (y >> 4)));\r\n out += alnum.charAt(((y & 0X0000000f) << 2));\r\n out += '-';\r\n }\r\n else\r\n {\r\n x = str.charCodeAt(i);\r\n y = str.charCodeAt(i+1);\r\n z = str.charCodeAt(i+2);\r\n out += alnum.charAt((x >> 2));\r\n out += alnum.charAt((((x & 0x00000003) << 4) | (y >> 4)));\r\n out += alnum.charAt((((y & 0X0000000f) << 2) | (z >> 6)));\r\n out += alnum.charAt((z & 0X0000003f));\r\n }\r\n }\r\n\r\n return out;\r\n}", "title": "" }, { "docid": "aa06163aac3ac3a7cc372fa5a64354c9", "score": "0.65101063", "text": "function toBase64(input) {\n return util_buffer_from_1.fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString(\"base64\");\n}", "title": "" }, { "docid": "aa06163aac3ac3a7cc372fa5a64354c9", "score": "0.65101063", "text": "function toBase64(input) {\n return util_buffer_from_1.fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString(\"base64\");\n}", "title": "" }, { "docid": "41517e718d790f8363bec2cc16e55c98", "score": "0.6508838", "text": "function base64_encode(file) {\n\n // read binary data\n let bitmap = fs.readFileSync(file);\n\n // convert binary data to base64 encoded string\n //return new Buffer(bitmap).toString('base64');\n //console.log(new Buffer.from(bitmap).toString('base64'));\n return new Buffer.from(bitmap).toString('base64');\n}", "title": "" }, { "docid": "137c7860c7aafc0161000ea6900e9ded", "score": "0.650658", "text": "function makeBase64Hash() {\r\n var i = 0, BASE64_CODE = _BASE64_CODE,\r\n iz = BASE64_CODE.length;\r\n\r\n for (; i < iz; ++i) {\r\n _b64hash[BASE64_CODE.charAt(i)] = i;\r\n }\r\n}", "title": "" }, { "docid": "b49099c487e9be3bd2ad46ae57e5e6d0", "score": "0.6502358", "text": "base64_encode(file) {\n // read binary data\n var bitmap = fs.readFileSync(file);\n // convert binary data to base64 encoded string\n return new Buffer(bitmap).toString('base64');\n }", "title": "" }, { "docid": "a8344bcb17d93acef53cb94cc3021363", "score": "0.6487589", "text": "qb64b() {\n return Buffer.from(this.qb64(), 'binary'); // encode\n }", "title": "" }, { "docid": "6ff9b2e8679491944cfc4db860430289", "score": "0.6473797", "text": "function Base64ToPNG() { }", "title": "" }, { "docid": "9807511d050247c805b7d4b8b06fa998", "score": "0.6472342", "text": "function InternalEncoderBase64(options,codec){this.prevStr='';}", "title": "" }, { "docid": "5199de9981986cf0ed1fc6c08ac310ac", "score": "0.64653283", "text": "base64EmbedData(): ?string {\n if (this.embededData == null) {\n return null;\n }\n let binary = '';\n let bytes = new Uint8Array(this.embededData);\n let len = bytes.byteLength;\n for (let i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa(binary);\n }", "title": "" }, { "docid": "1c4b06e033cf469fa3e2c310098ef49e", "score": "0.6465297", "text": "function base64urlEncode(data) {\n let result = btoa(data);\n return result.replace(/=+$/g, '').replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n}", "title": "" }, { "docid": "e5230b37332951c00d0b62fe78fce3f2", "score": "0.6451722", "text": "static byteLength(base64) {\n const lens = Base64.getLengths(base64);\n return Base64.calcByteLength(lens[0], lens[1]);\n }", "title": "" }, { "docid": "bc991cd2c6c842bff14b319befa8a42d", "score": "0.6445882", "text": "function isBase64Encoded(key) {\n var isValidBase64String = key.match(/^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/);\n return !!isValidBase64String;\n }", "title": "" }, { "docid": "f33f8fa017baf2913f8b9c8fcdafe3cf", "score": "0.64435637", "text": "static encode64(string) {\n const b64 = Buffer.from(string).toString('base64');\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n }", "title": "" }, { "docid": "8ebc1444d26ae1bf31db28103f306696", "score": "0.64323413", "text": "function bad64(s) { try { base64(s); ok(false); } catch (e) { ok(e.name == \"data\"); } }//you cant find anything to make node's base64 throw, but the round trip check works wonders", "title": "" }, { "docid": "97debc817350fb2c75d397585b31163f", "score": "0.642579", "text": "function encode64(buffer, callback) {\n\t//var base64 = btoa(compressed).replace(/\\+/g, '-').replace(/\\//g, '_');\n\n\tvar blob = new Blob([buffer]);\n\n\tvar reader = new FileReader();\n\treader.onload = function(event) {\n\t\tvar dataurl = event.target.result;\n\n\t\tvar base64 = dataurl.substr(dataurl.indexOf(',') + 1);\n\t\t\t \n\t\t//log(\"base64\", base64);\n\t\tcallback(base64);\n\t};\n\n\treader.readAsDataURL(blob);\n}", "title": "" }, { "docid": "85a06396c32a0cf41513d8edcc0f7497", "score": "0.6416667", "text": "static byteLength(base64) {\n const lens = Base64.getLengths(base64);\n return Base64.calcByteLength(lens[0], lens[1]);\n }", "title": "" }, { "docid": "0340b52ef38b6f49c2c908f9a4744d6e", "score": "0.6412866", "text": "static getLengths(base64) {\n const len = base64.length;\n if (len % 4 > 0) {\n throw new Error(\"Invalid string. Length must be a multiple of 4\");\n }\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n let validLen = base64.indexOf(\"=\");\n if (validLen === -1) {\n validLen = len;\n }\n const placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4);\n return [validLen, placeHoldersLen];\n }", "title": "" }, { "docid": "fd00d13d27aaa331dae0abb58b38e4a0", "score": "0.64047074", "text": "decode(str){\n Base64.init()\n var end = str.length\n while(end>=0 && str.charAt(end-1)=='=') end--\n if(end<2) throw '·Invalid Base64 string at· ' + end\n var m = (end%4)\n if(m==1) throw '·Invalid Base64 string at· ' + (end-1)\n if(m>1) m--\n var n = 3*Math.floor(end/4) + m\n var blob = new Uint8Array(n)\n var control =[[2,4,1],[4,2,1],[6,0,2]]\n var left, right\n var k=0\n var c=0\n for(var i=0; i<n; i++){\n left = Base64.a2i[str.charAt(k)]\n right = Base64.a2i[str.charAt(k+1)]\n if(left===undefined || right===undefined) throw '·Invalid Base64 string at· ' + k\n blob[i] = (left << control[c][0]) |( right >> control[c][1])\n k+=control[c][2]\n c = (c+1)%3\n } \n return blob\n }", "title": "" }, { "docid": "71ebe63aa6aef2428bd0f46b71a7e932", "score": "0.63997006", "text": "function base64Url(b64) {\n var b64u = b64.replace( /\\+/gi, \"-\" );\n b64u = b64u.replace( /\\//gi, \"_\" );\n b64u = b64u.replace( /\\=/gi, \"\" );\n\n return b64u;\n\n}", "title": "" }, { "docid": "6da4cd09ffe66cbb89d3a8554a54c06e", "score": "0.63960135", "text": "function fragSizeBase64( buf, base, bound ) {\n return (bound - base) % 3;\n}", "title": "" }, { "docid": "6a066dfec0cbd887903e2df2d5317e68", "score": "0.6392095", "text": "function getBase64String(dataURL) {\r\n\t\t/* from this: https://levelup.gitconnected.com/draw-an-svg-to-canvas-and-download-it-as-image-in-javascript-f7f7713cf81f */\r\n\t\tvar idx = dataURL.indexOf('base64,') + 'base64,'.length;\r\n\t\treturn dataURL.substring(idx);\r\n\t}", "title": "" }, { "docid": "222f1b8ab6d67c8f5ff87ec9a9398af6", "score": "0.6383996", "text": "static decode(base64) {\n let tmp;\n const lens = Base64.getLengths(base64);\n const validLen = lens[0];\n const placeHoldersLen = lens[1];\n const arr = new Uint8Array(Base64.calcByteLength(validLen, placeHoldersLen));\n let curByte = 0;\n // if there are placeholders, only get up to the last complete 4 chars\n const len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n let i;\n for (i = 0; i < len; i += 4) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 18) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] << 12) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 2)] << 6) |\n Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 3)];\n arr[curByte++] = (tmp >> 16) & 0xFF;\n arr[curByte++] = (tmp >> 8) & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n if (placeHoldersLen === 2) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 2) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] >> 4);\n arr[curByte++] = tmp & 0xFF;\n }\n if (placeHoldersLen === 1) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 10) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] << 4) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 2)] >> 2);\n arr[curByte++] = (tmp >> 8) & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n return arr;\n }", "title": "" }, { "docid": "efd023d8e9849e8610959d3c26c2e80f", "score": "0.63831383", "text": "function rstr2b64(input) {\r\n\ttry { b64pad } catch(e) { b64pad=''; }\r\n\tvar tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n\tvar output = \"\";\r\n\tvar len = input.length;\r\n\tfor (var i = 0; i < len; i += 3) {\r\n\t\tvar triplet = (input.charCodeAt(i) << 16)\r\n\t\t | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)\r\n\t\t | (i + 2 < len ? input.charCodeAt(i+2) : 0);\r\n\t\tfor (var j = 0; j < 4; j++) {\r\n\t\t\tif (i * 8 + j * 6 > input.length * 8) {\r\n\t\t\t\toutput += b64pad;\r\n\t\t\t} else {\r\n\t\t\t\toutput += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn output;\r\n}", "title": "" }, { "docid": "ac48b74f8b102e351c4818781492f0d4", "score": "0.63803554", "text": "function base64Encode(string) {\n return Buffer.from(string).toString('base64');\n}", "title": "" }, { "docid": "9eda070fe3deeb35f0ccfe945143b904", "score": "0.63793725", "text": "static decode(base64) {\n let tmp;\n const lens = Base64.getLengths(base64);\n const validLen = lens[0];\n const placeHoldersLen = lens[1];\n const arr = new Uint8Array(Base64.calcByteLength(validLen, placeHoldersLen));\n let curByte = 0;\n // if there are placeholders, only get up to the last complete 4 chars\n const len = placeHoldersLen > 0 ? validLen - 4 : validLen;\n let i;\n for (i = 0; i < len; i += 4) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 18) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] << 12) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 2)] << 6) |\n Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 3)];\n arr[curByte++] = (tmp >> 16) & 0xFF;\n arr[curByte++] = (tmp >> 8) & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n if (placeHoldersLen === 2) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 2) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] >> 4);\n arr[curByte++] = tmp & 0xFF;\n }\n if (placeHoldersLen === 1) {\n tmp =\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i)] << 10) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 1)] << 4) |\n (Base64._REVERSE_LOOKUP[base64.charCodeAt(i + 2)] >> 2);\n arr[curByte++] = (tmp >> 8) & 0xFF;\n arr[curByte++] = tmp & 0xFF;\n }\n return arr;\n }", "title": "" }, { "docid": "b1a50d2f7d74fe867b1673e8eb2ed6cc", "score": "0.6377906", "text": "function b64fromURLSafe(base64) {\n validateB64URL(base64);\n const str = base64.replace(/-/g, '+').replace(/_/g, '/');\n\n return b64PadSuffix(str)\n}", "title": "" }, { "docid": "daa9bacc88127355da751ba4ff664bc7", "score": "0.6364996", "text": "getBase64(file, cb) {\n let reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = function () {\n cb(reader.result)\n };\n reader.onerror = function (error) {\n console.log('Error: ', error);\n };\n}", "title": "" }, { "docid": "e98992b14becbc33f0565954d5a2f6a7", "score": "0.63633", "text": "function rstr2b64(input)\n{\n var tab = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var output = \"\";\n var len = input.length;\n for(var i = 0; i < len; i += 3)\n {\n var triplet = (input.charCodeAt(i) << 16)\n | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)\n | (i + 2 < len ? input.charCodeAt(i+2) : 0);\n for(var j = 0; j < 4; j++)\n {\n if(i * 8 + j * 6 > input.length * 8) output += b64pad;\n else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);\n }\n }\n return output;\n}", "title": "" }, { "docid": "21a8fcba4165c7b1585755c4bb480e88", "score": "0.63631", "text": "function 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}", "title": "" }, { "docid": "37d1b67fb85137981b07f828dde271fc", "score": "0.6362728", "text": "encode64(input) {\n let keyStr = \"ABCDEFGHIJKLMNOP\" +\n \"QRSTUVWXYZabcdef\" +\n \"ghijklmnopqrstuv\" +\n \"wxyz0123456789+/\" +\n \"=\";\n\n let output = \"\";\n let chr1, chr2, chr3 = \"\";\n let enc1, enc2, enc3, enc4 = \"\";\n let i = 0;\n\n do {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n keyStr.charAt(enc1) +\n keyStr.charAt(enc2) +\n keyStr.charAt(enc3) +\n keyStr.charAt(enc4);\n chr1 = chr2 = chr3 = \"\";\n enc1 = enc2 = enc3 = enc4 = \"\";\n } while (i < input.length);\n\n return output;\n }", "title": "" }, { "docid": "dd9dfaa1645893c42a4fb5f81ee17040", "score": "0.63576204", "text": "function rstr2b64(input)\r\n{\r\n// try { b64pad } catch(e) { b64pad=''; } //modify this\r\n if(!window.b64pad){ 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}", "title": "" }, { "docid": "a9de2c70c7e013592469f77f7b9e81ab", "score": "0.6356909", "text": "function md5AsBase64(string) {\n var hash = crypto.createHash('md5').update(string).digest('hex');\n var result = new Buffer(hash).toString('base64');\n return result;\n}", "title": "" } ]
7686f07f97e889ef97c5ad39c14f44a1
this function closes the server, and returns a promise. we'll use it in our integration tests later.
[ { "docid": "ae217b4e53e1662ce823557794ae057d", "score": "0.7710724", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" } ]
[ { "docid": "a426b0e323e6e949974fc8feaf3360cb", "score": "0.8344707", "text": "function close() {\n\treturn new Promise((resolve, reject) => {\n\t\thttpServer.close((err) => {\n\t\t\tif (err) {\n\t\t\t\treject(err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "fec46886594527fa3a19d9626961a06c", "score": "0.82524985", "text": "function closeServer() {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n}", "title": "" }, { "docid": "223f35eab7acb804832d588802a9a012", "score": "0.79811823", "text": "function closeServer() {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n server.close(err => {\n if (err) {\n reject(err);\n // so we don't also call `resolve()`\n return;\n }\n resolve();\n });\n });\n}", "title": "" }, { "docid": "518cf92492746dd4b4498b9cd6be8943", "score": "0.79809177", "text": "function closeServer() {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n reject(err);\n // so we don't also call `resolve()`\n return;\n }\n resolve();\n });\n });\n}", "title": "" }, { "docid": "494a46c21a7c946e25fd6ce441684c83", "score": "0.78544027", "text": "function closeServer() {\n\treturn mongoose.disconnect().then(() => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconsole.log('Closing server');\n\t\t\tserver.close(err => {\n\t\t\t\tif (err) {\n\t\t\t\t\treturn reject(err);\n\t\t\t\t}\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "feddfae5d6eda5845147a45cfee39c51", "score": "0.7844838", "text": "function closeServer(){\n\treturn mongoose.disconnect().then(() => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconsole.log('Closing server');\n\t\t\tserver.close(err => {\n\t\t\t\tif(err){\n\t\t\t\t\treturn reject(err);\n\t\t\t\t}\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "5f21269f834339b74b3fac8ddc165bfd", "score": "0.77713877", "text": "function closeServer(){\n return mongoose.disconnect().then(() => {\n return new Promise ((resolve, reject) => {\n console.log(\"Closing Server\");\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "790e7e5c4e6cb3d222790f0489304036", "score": "0.7755858", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "790e7e5c4e6cb3d222790f0489304036", "score": "0.7755858", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "790e7e5c4e6cb3d222790f0489304036", "score": "0.7755858", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "790e7e5c4e6cb3d222790f0489304036", "score": "0.7755858", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "80d8b5b0945ec9a151392c924cfdca8e", "score": "0.774933", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "02559947011d60d15e1608c0f90a655a", "score": "0.77367514", "text": "function closeServer() {\r\n return mongoose.disconnect().then(() => {\r\n return new Promise((resolve, reject) => {\r\n console.log('Closing server');\r\n server.close(err => {\r\n if (err) {\r\n return reject(err);\r\n }\r\n resolve();\r\n });\r\n });\r\n });\r\n}", "title": "" }, { "docid": "14ad52fc00eb39eb4666e14f53b730ff", "score": "0.7733264", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log(\"Closing server\");\n //Shut down the ExpressJS server\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "a099f72752258b35c7d13458169b1fd0", "score": "0.7722067", "text": "function closeServer(){\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if(err)\n return reject(err);\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "c9a37495f3524fed44b1736c90402fc5", "score": "0.771613", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "c9a37495f3524fed44b1736c90402fc5", "score": "0.771613", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "7578da2dbbfd448d90b408e7baf90772", "score": "0.76859725", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "7578da2dbbfd448d90b408e7baf90772", "score": "0.76859725", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "b6e46420ad97c412792babbadd939c95", "score": "0.7668671", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n })\n })\n })\n }", "title": "" }, { "docid": "e7b774ea69ea32777a34e08d61ffbe47", "score": "0.76291156", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing master server');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n }", "title": "" }, { "docid": "91f7df63157ae426fad08e05ac459313", "score": "0.7617927", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing server');\n server.close(err => {\n if (err) {\n console.log('\\n\\n\\MONGO ON ERROR \\n\\n\\n');\n return reject(err);\n }\n resolve();\n });\n });\n });\n}", "title": "" }, { "docid": "7c61eeb8c4068da260775f27c73861e0", "score": "0.7498385", "text": "close() {\n return new Promise((resolve, reject) => {\n this.connection.end(err => {\n if (err) { return reject( err ); }\n resolve();\n });\n });\n }", "title": "" }, { "docid": "3fd45965b24847b1cd52a04fddf56438", "score": "0.7491942", "text": "close() {\n return new Promise((resolve, reject) => {\n this.connection.end(err => {\n if (err)\n return reject(err);\n resolve();\n });\n });\n }", "title": "" }, { "docid": "b12629f593d81d6080f74f64d072ae7b", "score": "0.7411078", "text": "close() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.fetch(\"close\", {});\n });\n }", "title": "" }, { "docid": "92acbb1dd7cf6e8ac56a11874bb79423", "score": "0.7346225", "text": "stop() {\n const server = this._server;\n if (server === undefined) {\n throw new Error('The component HTTP server is not started');\n }\n return new Promise((resolve) => {\n server.close(() => {\n this._server = undefined;\n debug(`Component HTTP server stopped`);\n resolve();\n });\n });\n }", "title": "" }, { "docid": "aa3187bd683707957b38f2f1a3250d1d", "score": "0.73117244", "text": "function closeServer() {\n return mongoose.disconnect().then(() => {\n return new Promise((resolve, reject) => {\n console.log('Closing Weekly Words Node App');\n server.close(err => {\n if (err) {\n return reject(err);\n }\n resolve();\n });\n });\n });\n }", "title": "" }, { "docid": "a3eda6b51a44164c63941a248c69150d", "score": "0.7252781", "text": "close() {\n\t\tif (this.pingIntervalHandle != null) {\n\t\t\tclearInterval(this.pingIntervalHandle);\n\t\t\tthis.pingIntervalHandle = null;\n\t\t}\n\t\treturn this.client != null ? this.client.quit() : Promise.resolve();\n\t}", "title": "" }, { "docid": "6ec9b40b072beb42a0919cc620d89eb7", "score": "0.71677595", "text": "async function close() {}", "title": "" }, { "docid": "47f452ff63c4727167fbab3112cb1879", "score": "0.7060233", "text": "stop() {\n this.connection.close();\n return this.server.stop();\n }", "title": "" }, { "docid": "3c1eed60512522f8e4815d7bace14e3c", "score": "0.6958733", "text": "async close() {\r\n //@TODO\r\n await this.client.close();\r\n }", "title": "" }, { "docid": "139a8615caee0fb6b9f5c80a9e17931f", "score": "0.6956153", "text": "stop () {\n if (!this._server)\n return\n return this._server.close()\n }", "title": "" }, { "docid": "7003bb4c9fbd3452925fd23df076c9a7", "score": "0.69397455", "text": "shutdown () {\n this._server.close();\n }", "title": "" }, { "docid": "634fd4baf25f6799256e4e793b0c1155", "score": "0.6850615", "text": "close() {\n this.client.end(true);\n }", "title": "" }, { "docid": "c7b38e58d6d8e91be2dd62c36a750d34", "score": "0.6849189", "text": "close() {\n return new P((resolve) => {\n return this.getAdapter().closeConnection().then(() => {\n return resolve();\n });\n });\n }", "title": "" }, { "docid": "420d186b29e59803b1fce16b232ce2d3", "score": "0.6778391", "text": "shutdown() {\n this.httpServer.close(() => {\n console.log(\"The http server is closed.\");\n });\n this.httpsServer.close(() => {\n console.log(\"The https server is closed.\")\n });\n }", "title": "" }, { "docid": "2c886275400eae9697ed384e4a6f74f4", "score": "0.67741907", "text": "_shutdown() {\n return new Promise((resolve,reject) => {\n this.db_connection.close(function callbacK() {\n resolve('DB Connection closed')\n })\n });\n }", "title": "" }, { "docid": "4226b52dc67d10234a4a8dd479c46804", "score": "0.6748388", "text": "async close() {\n await this.client.close();\n }", "title": "" }, { "docid": "4226b52dc67d10234a4a8dd479c46804", "score": "0.6748388", "text": "async close() {\n await this.client.close();\n }", "title": "" }, { "docid": "4226b52dc67d10234a4a8dd479c46804", "score": "0.6748388", "text": "async close() {\n await this.client.close();\n }", "title": "" }, { "docid": "f898196b8a09366767ea2d70cf326afc", "score": "0.6729062", "text": "close() {\n this._client.end();\n }", "title": "" }, { "docid": "85bbff7780ab51a6c0db2bcf0f8ee254", "score": "0.66898125", "text": "async close() {\n return null\n }", "title": "" }, { "docid": "a8d8f7a566fbcf0d5cd3c01146cfa73c", "score": "0.6655825", "text": "closeClient () {\n return this.client.destroy()\n .then( () => { return PROM.log('core', 'Closed the CLI prompt'); } )\n .catch( PROM.errorHandler );\n }", "title": "" }, { "docid": "a57c93732d9a68eae9f6bfde510928b6", "score": "0.6640543", "text": "function stop() {\n return new Promise(function(resolve, reject) {\n if(server !== null) {\n api.stop().then(function() {\n server.close(function() {\n resolve();\n });\n }, Promise.reject);\n } else\n if(workers !== null && workers.length > 0) {\n workers.forEach(function(w) {\n w.send({kill: \"Shutdown UPFROnt PAP instance.\" });\n });\n resolve();\n }\n \n });\n}", "title": "" }, { "docid": "0c646c689b75e59679c0c88b8e5e8b92", "score": "0.65777856", "text": "close() {\n\n clearInterval(this.heartbeatTask);\n for (let client of Object.values(this.clients)) {\n this.deleteClient(client);\n client.terminate();\n }\n this.logger.info('Server terminated');\n\n }", "title": "" }, { "docid": "171ca8d0706d7d21e6f912fe4d9b19bc", "score": "0.6558133", "text": "async close() {\n assert(this.opened, 'TestUtil is not open.');\n this.opened = false;\n\n await this.nclient.close();\n await this.wclient.close();\n await this.node.close();\n }", "title": "" }, { "docid": "13e47afce66aca4c7b438381f56fcb85", "score": "0.64910567", "text": "closeDB () {\n return new Promise( (resolve,reject) => {\n if (this.database) {\n this.database.close()\n .then( (err) => {\n if (err) { reject( err ); }\n else { PROM.log('core', 'Closed the database').then(resolve); }\n } )\n .catch( PROM.errorHandler );\n } else { resolve(); }\n } );\n }", "title": "" }, { "docid": "f34da683437a72945f71fef977c69a47", "score": "0.6471183", "text": "async stop() {\n try {\n await new Promise((resolve) => {\n this.__server.destroy(() => {\n resolve(true);\n });\n });\n\n // to release all memory\n this.__server = undefined;\n this.app = undefined;\n this.logger = undefined;\n this.__http = undefined;\n } catch (err) {\n this.logger.error(`stop() fail. Error: ${err.message}`, {\n error: err,\n });\n }\n }", "title": "" }, { "docid": "fb1b09c1c118a616be5aef9f3e7439b6", "score": "0.6468127", "text": "close() {\t\t\t\t//Close server connection from this end\n this.socket.close()\n this.notify(this.addr = '')\n }", "title": "" }, { "docid": "9ae5b222ff777620ba4b8ef6dd23602e", "score": "0.64480436", "text": "async finalize() {\n if (this.client) {\n this.client.close();\n }\n }", "title": "" }, { "docid": "1c80ce9ebcd5d8acfbd2b7dc412d89d1", "score": "0.6446829", "text": "close() {\n if (this.database) {\n this.database.close();\n return Promise.resolve(true);\n }\n return Promise.reject('No Connection open');\n }", "title": "" }, { "docid": "fcd0b641dea3d8f1f284945e69634c74", "score": "0.6433415", "text": "function shutdown(sig) {\n\n return new Promise((resolve, reject) => {\n\n function cleanupHttp() {\n return new Promise((resolve, reject) => {\n destroyAllConnections();\n\n // normal shutdown / do not allow new connections\n server.close((err) => {\n if (err) { return reject(err); }\n resolve();\n });\n });\n }\n\n debug('shutdown signal - ' + sig);\n\n // Don't bother with graceful shutdown on development to speed up round trip\n if (options.development) {\n debug('DEV-Mode - imediate forceful shutdown');\n return process.exit(0);\n }\n\n const finalHandler = () => {\n if (!finalRun) {\n finalRun = true;\n if (options.finally && isFunction(options.finally)) {\n options.finally();\n }\n process.nextTick(() => {\n if (fnIntervall) {\n fnIntervall.unref();\n }\n if (options.forceExit) {\n process.exit(failed ? 1 : 0);\n }\n resolve();\n });\n }\n };\n\n const exitHandler = promise => promise\n .catch((err) => {\n const errString = (typeof err === 'string') ? err : JSON.stringify(err);\n debug(errString);\n failed = true;\n reject(errString);\n });\n\n if (!isShuttingDown) {\n isShuttingDown = true;\n debug('shutting down');\n\n const pollIterations = options.timeout ? Math.round(options.timeout / 250) : 0;\n // forcefull shutdown after timeout\n if (options.timeout) {\n let interation = 0;\n fnIntervall = setInterval(function () {\n interation++;\n\n // test all connections closed already?\n if (Object.keys(connections).length === 0 && Object.keys(secureConnections).length === 0) {\n if (options.onShutdown && isFunction(options.onShutdown && !shutdownRun)) {\n shutdownRun = true;\n exitHandler(options.onShutdown(sig)).then(() => {\n finalHandler();\n\n process.nextTick(() => {\n resolve();\n if (options.forceExit) {\n process.exit(1);\n }\n });\n });\n } else if (!shutdownRun) {\n // no onShutdown function\n finalHandler();\n\n process.nextTick(() => {\n resolve();\n if (options.forceExit) {\n process.exit(1);\n }\n });\n }\n }\n if (interation === pollIterations) {\n // timeout time reached! Now forcefully close all connections\n debug('Could not close connections in time (' + options.timeout + 'ms), forcefully shutting down');\n\n // destroy rest of connections\n destroyAllConnections(true);\n\n // call finally function (if provided in options)\n finalHandler();\n\n process.nextTick(() => {\n resolve();\n if (options.forceExit) {\n process.exit(1);\n }\n });\n }\n }, 250);\n }\n\n exitHandler(cleanupHttp()).then(() => {\n if (options.onShutdown && isFunction(options.onShutdown) && !shutdownRun) {\n\n shutdownRun = true;\n return exitHandler(options.onShutdown(sig));\n } else {\n return;\n }\n }).then(finalHandler);\n }\n });\n }", "title": "" }, { "docid": "5498695061c9992b62fe91f846480a53", "score": "0.6399534", "text": "function onClose() {\n\n server.close(function () {\n console.log(\"Closed out remaining connections.\");\n let db = app.get('db');\n db.close();\n });\n\n setTimeout(function () {\n console.error(\"Could not close connections in time, forcefully shutting down\");\n process.exit(1);\n }, 30 * 1000);\n\n}", "title": "" }, { "docid": "7dd3defcf24b7383f0a0d0294044efc5", "score": "0.63968056", "text": "async destroy() {\n return this.client.close();\n }", "title": "" }, { "docid": "4e48799019ea4806bcae925735456d8f", "score": "0.6375978", "text": "close() {\n if (this._connected) {\n this._connected = false;\n this._socket.close();\n for (let requestResolve of Object.values(this._requestResolves)) {\n requestResolve.reject(new Error('MetaApi connection closed'));\n }\n this._requestResolves = {};\n this._synchronizationListeners = {};\n this._latencyListeners = [];\n this._packetOrderer.stop();\n }\n }", "title": "" }, { "docid": "43a417edc881c36dfe141d9f24921a84", "score": "0.6365773", "text": "stopped() {\r\n\t\tif (this.settings.middleware)\r\n\t\t\treturn;\r\n\r\n\t\tif (this.server.listening) {\r\n\t\t\t/* istanbul ignore next */\r\n\t\t\treturn new this.Promise((resolve, reject) => {\r\n\t\t\t\tthis.server.close(err => {\r\n\t\t\t\t\tif (err)\r\n\t\t\t\t\t\treturn reject(err);\r\n\r\n\t\t\t\t\tthis.logger.info(\"API Gateway stopped!\");\r\n\t\t\t\t\tresolve();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "d3f99f64077fbc7eadd62eb7f07f93d1", "score": "0.63522923", "text": "close() {\n return new Promise((res, rej) => {\n var ok = this.handler.Close((errCode, errMsg) => {\n res({ ec: errCode, em: errMsg });\n }, (canceled) => {\n this.set_aborted(rej, exports.DB.ReqIds.idClose, canceled);\n }, (errMsg, errCode, errWhere, id) => {\n this.set_exception(rej, errMsg, errCode, errWhere, id);\n });\n if (!ok) {\n this.raise(rej, exports.DB.ReqIds.idClose);\n }\n });\n }", "title": "" }, { "docid": "0391c20a0861a8c112437d977526f91d", "score": "0.6352219", "text": "close() {\n if (this.db) {\n logger.info(`${this.constructor.name}.close(): Closing the database for topic: ${this.config.topic}`)\n return this.db.close()\n }\n return new Promise((resolve) => {\n logger.debug(`${this.constructor.name}.close(): No database present.`)\n setImmediate(resolve())\n })\n }", "title": "" }, { "docid": "f4a42c94435c5241ffbd481503d04a9f", "score": "0.6351686", "text": "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "f4a42c94435c5241ffbd481503d04a9f", "score": "0.6351686", "text": "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "f4a42c94435c5241ffbd481503d04a9f", "score": "0.6351686", "text": "close() {\n clearTimeout(this._connectionTimeout);\n clearTimeout(this._greetingTimeout);\n this._responseActions = [];\n\n // allow to run this function only once\n if (this._closing) {\n return;\n }\n this._closing = true;\n\n let closeMethod = 'end';\n\n if (this.stage === 'init') {\n // Close the socket immediately when connection timed out\n closeMethod = 'destroy';\n }\n\n this.logger.debug(\n {\n tnx: 'smtp'\n },\n 'Closing connection to the server using \"%s\"',\n closeMethod\n );\n\n let socket = (this._socket && this._socket.socket) || this._socket;\n\n if (socket && !socket.destroyed) {\n try {\n this._socket[closeMethod]();\n } catch (E) {\n // just ignore\n }\n }\n\n this._destroy();\n }", "title": "" }, { "docid": "389d382f9a921ca8515489face729c63", "score": "0.63479537", "text": "async function close () {\n try {\n alive = false\n conn.close()\n } catch (err) {\n emitter.emit(err)\n }\n}", "title": "" }, { "docid": "10b4d27e3dfd68da3d0c0d249a0dd907", "score": "0.63326734", "text": "async close() {\n await this.connection.close();\n }", "title": "" }, { "docid": "0d5c057bc0e268cc9ec2aa50d6ea0373", "score": "0.6325699", "text": "async function exitProcess() {\n // console.log('Process has exited:', process.pid);\n // Gracefully close the connection to the DB\n if (client) {\n client.end();\n }\n process.exit(0);\n}", "title": "" }, { "docid": "e038c197aaa4a6d441f7820e25d5bce6", "score": "0.63023376", "text": "function close() {\n db.close().then(() => {\n console.log('\\nConnection closed!');\n return true;\n });\n}", "title": "" }, { "docid": "d52716fc1cb582bbae7e5c5b2564ca86", "score": "0.6283888", "text": "function stop() {\n server.close();\n}", "title": "" }, { "docid": "a9e415bde2768fd6ce4c765219074c64", "score": "0.62827384", "text": "end() {\n return new Promise((resolve, reject) => {\n this.connection.end(err => {\n if (err)\n return reject(err);\n this.active = false;\n resolve();\n });\n });\n }", "title": "" }, { "docid": "a2ea31c39fdc8d52ee2ed2a412aa35eb", "score": "0.6277599", "text": "close(passThrough){\n return this.c().close()\n .then(function(){ return passThrough; })\n .catch(function(err){\n console.log('Error closing db:', err);\n });\n }", "title": "" }, { "docid": "d53e200980977207bcbdf4d6bbfc13a1", "score": "0.626876", "text": "function endClient() {\n\tconsole.log('Connection closed');\n\tprocess.exit(0);\n}", "title": "" }, { "docid": "5de8cf7c5a771596268b837512fc3684", "score": "0.62685794", "text": "function stop() {\n server.close();\n}", "title": "" }, { "docid": "5de8cf7c5a771596268b837512fc3684", "score": "0.62685794", "text": "function stop() {\n server.close();\n}", "title": "" }, { "docid": "3cb7104df871532af2358b9fa08f0326", "score": "0.62467504", "text": "close (callback = () => {}) {\n debug('Closing connection', this.id)\n if (this._openRequests > 0) {\n setTimeout(() => this.close(callback), 1000)\n } else {\n this.agent.destroy()\n callback()\n }\n }", "title": "" }, { "docid": "f470eaeea9ebfd259196f715faba39bc", "score": "0.6231367", "text": "function close() {\n if (!client) {\n return;\n }\n if (client.connected) {\n client.end(true);\n }\n}", "title": "" }, { "docid": "2db0c678646b1975e3d76b023e94f430", "score": "0.6203547", "text": "async mockHttpStop() {\n await this.executeScript(function() {\n if(typeof window.smashtestSinonFakeServer != 'undefined') {\n window.smashtestSinonFakeServer.restore();\n window.smashtestSinonFakeServer = undefined;\n }\n });\n }", "title": "" }, { "docid": "2164d1945540f6b81ab06bc24aef5512", "score": "0.61833584", "text": "end() {\n this.status('closed');\n if (typeof this.driver.end !== 'function') {\n this.connection = null;\n return;\n }\n\n this.driver.end(this.connection);\n this.connection = null;\n }", "title": "" }, { "docid": "f35af6262601da954cb558a6207cdb7a", "score": "0.6175561", "text": "close(timeout) {\n return Promise.resolve(true);\n }", "title": "" }, { "docid": "35439cabd8f28a60fbd8474b024efa24", "score": "0.6173973", "text": "close() {\n return __awaiter(this, void 0, void 0, function* () {\n const errs = [];\n try {\n yield this.microphone.close();\n }\n catch (err) {\n errs.push(err.message);\n }\n try {\n yield this.apiClient.close();\n }\n catch (err) {\n errs.push(err.message);\n }\n this.activeContexts.clear();\n this.setState(types_1.ClientState.Disconnected);\n if (errs.length > 0) {\n throw Error(errs.join(','));\n }\n });\n }", "title": "" }, { "docid": "f7c7d7d174c63c02d90e6314495fa1d0", "score": "0.61736935", "text": "shutdown() {\n if (this.isDisposed) {\n return Promise.reject(new Error('Session is disposed'));\n }\n return Private.shutdownSession(this.id, this.serverSettings);\n }", "title": "" }, { "docid": "5dd65662e3fb81432493c8152615be92", "score": "0.6168835", "text": "stop() {\n server.close();\n database.close();\n running = false;\n }", "title": "" }, { "docid": "0959c183972056332ab5ad01225a45b3", "score": "0.6154499", "text": "close() {\n // Clearing all intervals.\n this.intervals.forEach((interval) => clearInterval(interval));\n return (Promise.resolve());\n }", "title": "" }, { "docid": "776ad6362d86408cfe9d1448b2ba2416", "score": "0.6152561", "text": "async disconnect() {\n try {\n if (this.client && this.client.close) {\n await this.client.close();\n }\n } catch (error) {\n appLog.error(error, 'error closing connection after error');\n }\n this.client = null;\n }", "title": "" }, { "docid": "0def4c73663d8a9a99616b3a51c07263", "score": "0.61450285", "text": "function shutdown() {\n // stop python server\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"GET\", \"/stopserver\", true);\n xhttp.send();\n // close browser tab\n window.close()\n}", "title": "" }, { "docid": "360f5f4f9b11b9ecca9b4506eb9470e6", "score": "0.61300963", "text": "function stop(done) {\n server.close(done);\n}", "title": "" }, { "docid": "dae367af00535cc87712c3e33a8875a8", "score": "0.6128089", "text": "stop() {\n var _this4 = this;\n\n return (0, _asyncToGenerator3.default)(function* () {\n debug('Perform close connection');\n\n _this4.eioClient.close();\n delete _this4.eioClient;\n })();\n }", "title": "" }, { "docid": "7de7fd0f5721864f80cba00d7b630afe", "score": "0.61280096", "text": "function close(timeout) {\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\n if (client) {\n return client.close(timeout);\n }\n return _sentry_utils__WEBPACK_IMPORTED_MODULE_1__[\"SyncPromise\"].reject(false);\n}", "title": "" }, { "docid": "7de7fd0f5721864f80cba00d7b630afe", "score": "0.61280096", "text": "function close(timeout) {\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\n if (client) {\n return client.close(timeout);\n }\n return _sentry_utils__WEBPACK_IMPORTED_MODULE_1__[\"SyncPromise\"].reject(false);\n}", "title": "" }, { "docid": "ddaeb77d321615a14e60a32c329b68c5", "score": "0.61016613", "text": "function disconnect() {\n return new Promise(function(resolve) {\n if (dirtyBitsConnection) {\n setupConnectionListener(resolve);\n dirtyBitsConnection.close();\n } else {\n //if there's no connection (cause we timed out or something) lets just resolve;\n resolve();\n }\n }).catch(handleConnectionPromiseError);\n }", "title": "" }, { "docid": "1eec8fd5b7ffbbfe7bfab7a8a261a299", "score": "0.60931414", "text": "close(closeConnections, callback) {\n if (typeof (closeConnections) === 'function') {\n callback = closeConnections;\n closeConnections = false;\n }\n\n if (closeConnections) {\n this.log(null, 'Closing pending handlers');\n let count = 0;\n _.each(this.handlers, (handler) => {\n count++;\n handler.close();\n });\n this.log(null, `Destroyed ${count} pending handlers`);\n }\n\n if (this.server) {\n const { server } = this;\n this.server = null;\n const promise = util.promisify(server.close).bind(server)();\n return nodeify(promise, callback);\n }\n }", "title": "" }, { "docid": "65a3d5e0486d8fe3e065254deff9c181", "score": "0.60877883", "text": "_on_close ()\n {\n log('server closed');\n }", "title": "" }, { "docid": "300a6eb1b7b59c057827d8804c8dd320", "score": "0.6075251", "text": "function handleClose() {\n console.log('server closed!');\n process.exit();\n}", "title": "" }, { "docid": "0730cdef8afb00c0bc18b5c1e480aa3f", "score": "0.60690534", "text": "disconnect() {\n return Promise.resolve();\n }", "title": "" }, { "docid": "1b22f92296b649cdf209d84fa9f9ba1e", "score": "0.60626924", "text": "async end_() {\n if (this.client && this.client.isConnected()) {\n await this.client.close();\n }\n\n delete this.client;\n }", "title": "" }, { "docid": "0137c9d100746d22a8286dc46a9de775", "score": "0.6061894", "text": "stopServer() {\n this.mc.close();\n }", "title": "" }, { "docid": "c4884cad9c2f3cae126fc0eaf4524dac", "score": "0.60572356", "text": "async function terminateApp() {\n try {\n await db.terminate();\n server.close();\n console.log(\"> MuSprint stories service shutdown\");\n }\n catch (err) {\n // Catch error and issue SIGTERM\n console.error(err);\n }\n}", "title": "" }, { "docid": "deb46fbad6bdd32a358ec0920ba75b26", "score": "0.60565186", "text": "close() {\n if (this._changeState(exports.CLOSED))\n this._endAsync();\n }", "title": "" }, { "docid": "656de04ea33319c7beb909a4f45bb079", "score": "0.6049874", "text": "function close(timeout) {\n var client = Object(_sentry_core__WEBPACK_IMPORTED_MODULE_0__[\"getCurrentHub\"])().getClient();\n if (client) {\n return client.close(timeout);\n }\n return Promise.reject(false);\n}", "title": "" }, { "docid": "c8d2625e23c2068f360f4ce6eca9ecf2", "score": "0.6049407", "text": "async close() {\n await this.channel.close();\n await this.connection.close();\n }", "title": "" }, { "docid": "db2274c6eb27acb0f2aa36bd5cfd1c9e", "score": "0.6043915", "text": "disconnect() {\n debug(`Mediaserver#disconnect - closing connection to ${this.address}`);\n this.closing = true;\n this._server.close() ;\n this.conn.removeAllListeners();\n this.conn.disconnect() ;\n }", "title": "" } ]
0a5b55201e0ab37b0609038132b0d7d6
Updates the selectedness of each option when the list of selected options changes.
[ { "docid": "8ea0cc9a5febb800f5d8def34a4f5d45", "score": "0.66155636", "text": "selectedOptionsChanged(prev, next) {\n var _a;\n\n const filteredNext = next.filter(Listbox.slottedOptionFilter);\n (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {\n const notifier = Observable.getNotifier(o);\n notifier.unsubscribe(this, \"selected\");\n o.selected = filteredNext.includes(o);\n notifier.subscribe(this, \"selected\");\n });\n }", "title": "" } ]
[ { "docid": "d2111fd8dde6032b51b01bdd679ea626", "score": "0.7213276", "text": "toggleSelectedForAllCheckedOptions() {\n const enabledCheckedOptions = this.checkedOptions.filter(o => !o.disabled);\n const force = !enabledCheckedOptions.every(o => o.selected);\n enabledCheckedOptions.forEach(o => o.selected = force);\n this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]);\n this.setSelectedOptions();\n }", "title": "" }, { "docid": "4a87b5a3758ecfd9ddd7d5599c265f50", "score": "0.69347364", "text": "selectedOptionsChanged(prev, next) {\n if (this.$fastController.isConnected) {\n this._options.forEach(o => {\n o.selected = next.includes(o);\n });\n }\n }", "title": "" }, { "docid": "98cdd0d3918ce778b67b499b5c38e506", "score": "0.687892", "text": "setSelectedOptions() {\n if (!this.multiple) {\n super.setSelectedOptions();\n return;\n }\n\n if (this.$fastController.isConnected && this.options) {\n this.selectedOptions = this.options.filter(o => o.selected);\n this.focusAndScrollOptionIntoView();\n }\n }", "title": "" }, { "docid": "84b1e9310004a7fb0589a6d24174324b", "score": "0.6855107", "text": "function updateSelected() {\n var multiSelect = $(this);\n var multiSelectOptions = multiSelect.next(\".multiSelectOptions\");\n var o = multiSelect.data(\"config\");\n\n var i = 0;\n var selectAll = true;\n var display = \"\";\n multiSelectOptions.find(\"INPUT:checkbox\").not(\".selectAll, .optGroup\").each(function () {\n if ($(this).is(\":checked\")) {\n i += 1;\n display = display + $(this).parent().text().trim() + \", \";\n } else {\n selectAll = false;\n }\n });\n\n // trim any end comma and surounding whitespace\n display = display.replace(/\\s*,\\s*$/, \"\");\n\n if (i === 0) {\n multiSelect.find(\"span\").html(o.noneSelected);\n } else {\n if (o.oneOrMoreSelected === \"*\" || o.autoListSelected) {\n multiSelect.find(\"span\").html(display);\n multiSelect.attr(\"title\", display);\n if (o.autoListSelected) {\n if (checkOverflow(multiSelect.find(\"span\")[0])) {\n multiSelect.find(\"span\").html(o.oneOrMoreSelected.replace(\"%\", i));\n }\n }\n } else {\n multiSelect.find(\"span\").html(o.oneOrMoreSelected.replace(\"%\", i));\n }\n }\n\n // Determine if Select All should be checked\n if (o.selectAll) {\n multiSelectOptions.find(\"INPUT.selectAll\")\n .prop(\"checked\", selectAll)\n .parent(\"LABEL\")\n .toggleClass(\"checked\", selectAll);\n }\n }", "title": "" }, { "docid": "69466b6885457a91a8e32e3bccf64002", "score": "0.66074896", "text": "function updateSelected(e, value) {\n setSelected(value)\n updateSize(e)\n }", "title": "" }, { "docid": "650ab95efec7290078e43421813e688d", "score": "0.65594983", "text": "_setAllOptionsSelected(isSelected, skipDisabled) {\n // Keep track of whether anything changed, because we only want to\n // emit the changed event when something actually changed.\n const changedOptions = [];\n this.options.forEach(option => {\n if ((!skipDisabled || !option.disabled) && option._setSelected(isSelected)) {\n changedOptions.push(option);\n }\n });\n if (changedOptions.length) {\n this._reportValueChange();\n }\n return changedOptions;\n }", "title": "" }, { "docid": "fc5092fe10c7bd31c5ab057b75e2c33a", "score": "0.65184236", "text": "multipleChanged(prev, next) {\n var _a;\n\n this.ariaMultiSelectable = next ? \"true\" : null;\n (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach(o => {\n o.checked = next ? false : undefined;\n });\n this.setSelectedOptions();\n }", "title": "" }, { "docid": "426ad0431bbdd1a25e3db6023bf21d7c", "score": "0.65067273", "text": "setSelected() {\n if (!this.multiple) {\n let option = this.getOption(this.value);\n if (option.created) {\n this.createdLabel = option.currentLabel;\n this.createdSelected = true;\n } else {\n this.createdSelected = false;\n }\n this.selectedLabel = option.currentLabel;\n this.selected = option;\n if (this.filterable) this.query = this.selectedLabel;\n return;\n }\n let result = [];\n if (Array.isArray(this.value)) {\n this.value.forEach(value => {\n result.push(this.getOption(value));\n });\n }\n this.selected = result;\n this.$nextTick(() => {\n this.resetInputHeight();\n });\n }", "title": "" }, { "docid": "8a5890a39a0be13b06b3f2eb43ba151a", "score": "0.6468979", "text": "handleMultiSelectChange() {\n if (!this.isMobile()) {\n return;\n }\n const selectedVals = [];\n Array.from(this.elem.options).forEach(opt => {\n if (opt.selected) {\n selectedVals.push(opt.value);\n }\n });\n this.selectedValues = selectedVals;\n this.requestUpdate();\n }", "title": "" }, { "docid": "7fb9ebfcef41b569a7d00dd7eab39533", "score": "0.64530957", "text": "function updateChoices() {\n $(\".ia-choice\")\n .filter(function() {\n return $(this).data(\"ia-ui-kind\") != null;\n })\n .each(function() {\n var el = $(this);\n if (isSelected(el)) {\n setUiProp($(this), $(this).data(\"ia-color\").sel);\n setUiProp($(this).children(\".ia-readmore\"), $(this).data(\"ia-color\").sel);\n } else {\n setUiProp($(this), $(this).data(\"ia-color\").bg); \n setUiProp($(this).children(\".ia-readmore\"), $(this).data(\"ia-color\").bg);\n }\n }); \n}", "title": "" }, { "docid": "91a9c08ad305dd04c6f8a93f6ecf17a5", "score": "0.6418188", "text": "_setOptionsFromValues(values) {\n this.options.forEach(option => option._setSelected(false));\n values.forEach(value => {\n const correspondingOption = this.options.find(option => {\n // Skip options that are already in the model. This allows us to handle cases\n // where the same primitive value is selected multiple times.\n return option.selected ? false : this.compareWith(option.value, value);\n });\n if (correspondingOption) {\n correspondingOption._setSelected(true);\n }\n });\n }", "title": "" }, { "docid": "499dcd45adc9a61a84b3af4d272ae968", "score": "0.6355188", "text": "function featureChangeListener() {\n if (this.selectedOptions.length > 0) {\n var selOpt = this.selectedOptions[0].value;\n selected_feature = selOpt;\n updateAll();\n }\n}", "title": "" }, { "docid": "5f16b7930d91a11202160a309340b055", "score": "0.6328809", "text": "_updateSelectedItems(selectionCallback) {\n const { start, end } = this._getSelectionBoundaries();\n for (let index = start; index <= end; index++) {\n selectionCallback(index);\n }\n }", "title": "" }, { "docid": "80debec5a6de8a324db69b9225918b6c", "score": "0.6304444", "text": "function updateOptionGroupsForNewFilters() {\n\t\t$('.filter-option').each(function() {\n\t\t\tif ($(this).find('.option.selected').length > 0) {\n\t\t\t\t$(this).addClass('selected');\n\t\t\t} else {\n\t\t\t\t$(this).removeClass('selected');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "824acc3da9bfbbababeb57afd7f8d65e", "score": "0.62963235", "text": "selectedOptionsChanged(prev, next) {\n var _a;\n\n super.selectedOptionsChanged(prev, next);\n (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => {\n var _a;\n\n const proxyOption = (_a = this.proxy) === null || _a === void 0 ? void 0 : _a.options.item(i);\n\n if (proxyOption) {\n proxyOption.selected = o.selected;\n }\n });\n }", "title": "" }, { "docid": "e59599bf975c9b087371fb2f80aaadb5", "score": "0.6293204", "text": "updateSelectedFeatures() {\n let allFeatures = this.state.allFeatures;\n allFeatures.forEach((feature) => {\n if (this.state.selectedFeatureIds.includes(feature.id)) {\n Object.assign(feature, { selected: true });\n } else {\n Object.assign(feature, { selected: false });\n }\n }, this);\n //update allFeatures to reflect those that are selected\n this.setState({ allFeatures: allFeatures });\n this.closeFeaturesDialog();\n }", "title": "" }, { "docid": "c7642cbf1d3ecb0520ca24f8a5a38a4f", "score": "0.62841034", "text": "function CheckSelectedOptions() {\n $(\"select[data-type='m2m_chosen'] option\").prop(\"selected\",true);\n RemoveDisabledAttrs();\n}", "title": "" }, { "docid": "bda383ab8fd3fbe42c064fe51bbd1c42", "score": "0.6248301", "text": "function updateSelectedFlags() {\n\tterm_selected = false;\n\thas_term_left = false;\n\tif (group_chosen) {\n\t\tvar terms = group_chosen.getElementsByClassName('term');\n\t\tfor (i = 0; i < terms.length; i++) {\n\t\t\tvar checkbox = terms[i].getElementsByTagName('input');\n\t\t\tif (checkbox && checkbox[0].type == \"checkbox\") {\n\t\t\t\tif (term_selected == false) {\n\t\t\t\t\tif (checkbox[0].checked == true) {\n\t\t\t\t\t\t// has checked terms\n\t\t\t\t\t\tterm_selected = true;\n\t\t\t\t\t\t// alert(\"find checked\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (has_term_left == false) {\n\t\t\t\t\tif (checkbox[0].checked == false) {\n\t\t\t\t\t\thas_term_left = true;\n\t\t\t\t\t\t// alert(\"find unchecked\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4dce91353f16acce63a5bbf2cad4993f", "score": "0.6210412", "text": "function updateSelectedFlags() {\n\tvar i;\n\tterm_selected = false;\n\thas_term_left = false;\n\tif (group_chosen) {\n\t\tvar terms = group_chosen.getElementsByClassName('term');\n\t\tfor (i = 0; i < terms.length; i++) {\n\t\t\tvar checkbox = terms[i].getElementsByTagName('input');\n\t\t\tif (checkbox && checkbox[0].type == \"checkbox\") {\n\t\t\t\tif (term_selected == false) {\n\t\t\t\t\tif (checkbox[0].checked == true) {\n\t\t\t\t\t\t// has checked terms\n\t\t\t\t\t\tterm_selected = true;\n\t\t\t\t\t\t// alert(\"find checked\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (has_term_left == false) {\n\t\t\t\t\tif (checkbox[0].checked == false) {\n\t\t\t\t\t\thas_term_left = true;\n\t\t\t\t\t\t// alert(\"find unchecked\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2c9d2c8d945006f90f966ce35d4b77e3", "score": "0.6140149", "text": "get _shouldUpdateSelection() {\n return this.selected != null || this.selectedValues != null && this.selectedValues.length;\n }", "title": "" }, { "docid": "2c9d2c8d945006f90f966ce35d4b77e3", "score": "0.6140149", "text": "get _shouldUpdateSelection() {\n return this.selected != null || this.selectedValues != null && this.selectedValues.length;\n }", "title": "" }, { "docid": "90ff6462237ec7fd4bbce6251ead9ba5", "score": "0.6135906", "text": "function update_selected_order_items(select_elt) {\n g.selected_order[1] = [];\n for (var i = 0; i != select_elt.options.length; ++i) {\n var option = select_elt.options[i];\n if (option.selected)\n g.selected_order[1].push(g.all_orders[option.value]);\n }\n}", "title": "" }, { "docid": "981d791bb1984218ab9a4ec873d89fc5", "score": "0.61076367", "text": "setSelectedOptions() {\n var _a, _b, _c;\n\n if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) {\n this.selectedOptions = [this.options[this.selectedIndex]];\n this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : \"\";\n this.focusAndScrollOptionIntoView();\n }\n }", "title": "" }, { "docid": "1501e0bdb0935baa9b4fc566f2067f3b", "score": "0.60842717", "text": "selectAllOptions()\n {\n const selectedList = [];\n for (let i = 0; i < this.props.checkOptions.length; i++) {\n selectedList.push(i);\n }\n this.setState({selectedList: selectedList});\n }", "title": "" }, { "docid": "ae6c41261286dfdb1cbd3e02e6229335", "score": "0.6070279", "text": "_setSelectedValues() {\n let self = this;\n self.set('_selectedValues', [...self.value]);\n }", "title": "" }, { "docid": "b1e5883d557977d14ec935727696b21b", "score": "0.60632634", "text": "_applySelection() {\n let self = this;\n if(self.isString){\n self.set('value', self._selectedValues);\n }\n\n self.set('value', [...self._selectedValues]);\n }", "title": "" }, { "docid": "99722188b995d10777bbc8145a7cbfcb", "score": "0.60578775", "text": "function checkAllSelectedForRedraw(){\n for (var avatar in _this.selectedAvatars) {\n maybeRedraw(avatar);\n }\n}", "title": "" }, { "docid": "3b5ae4f1fda254705fb0e010f4d83036", "score": "0.6014398", "text": "_markOptionsForCheck() {\n if (this.options) {\n this.options.forEach(option => option._markForCheck());\n }\n }", "title": "" }, { "docid": "71a65abe10d410f0430514f8b3a49ff5", "score": "0.60133463", "text": "updateOption() {\n this.selectedOption.setText(this.options[this.selectedId]);\n this.selectedText = this.options[this.selectedId];\n }", "title": "" }, { "docid": "ee00124ce6620de20a75a2aadf5d68d7", "score": "0.6010308", "text": "get _shouldUpdateSelection() {\n return this.selected != null || this.selectedValues != null && this.selectedValues.length;\n }", "title": "" }, { "docid": "9f727e41f9d51ac355fb5c3078b28d7f", "score": "0.6008976", "text": "checkSelectedItemsCount () {\n var allowedToSelect = get(this, 'allowedToSelect');\n var currentlySelected = get(this, 'options').filterBy('isSelected').length;\n var selectionDisabled = allowedToSelect <= currentlySelected;\n A(get(this, 'options').filterBy('isSelected', false)).setEach('isDisabled', selectionDisabled);\n }", "title": "" }, { "docid": "1c1cf0e7592c16f964b108d30931bb83", "score": "0.59930414", "text": "_finalizeSelectedOptions(addedOptions, parsedOptions) {\n const foundOptions = [];\n let previouslySelected = sanitizeArray(this.state.passedValue);\n let newSelected = sanitizeArray(this.state.selectedOptions);\n for (const selectedOpt of previouslySelected) {\n const key = selectedOpt[this.props.valueKey] ?? selectedOpt;\n const option = addedOptions.find((term) => term[this.props.valueKey] === key);\n if (!option) continue;\n foundOptions.push(key);\n const optionParsed = parsedOptions.find((term) => term[this.props.valueKey] === key);\n newSelected.push(optionParsed);\n }\n this._addSelectedOption(newSelected);\n\n //remove already found options\n for (const foundOption of foundOptions) {\n previouslySelected = previouslySelected.filter((term) => {\n return term !== foundOption;\n });\n }\n\n this.setState({passedValue: previouslySelected});\n }", "title": "" }, { "docid": "bdf873a9cacf4df7061b591a51b87d55", "score": "0.5977208", "text": "_resetOptions() {\n const changedOrDestroyed = merge(this.options.changes, this._destroy);\n this.optionSelectionChanges.pipe(takeUntil(changedOrDestroyed)).subscribe(event => {\n this._onSelect(event.source, event.isUserInput);\n if (event.isUserInput && !this.multiple && this._panelOpen) {\n this.close();\n this.focus();\n }\n });\n // Listen to changes in the internal state of the options and react accordingly.\n // Handles cases like the labels of the selected options changing.\n merge(...this.options.map(option => option._stateChanges))\n .pipe(takeUntil(changedOrDestroyed))\n .subscribe(() => {\n // `_stateChanges` can fire as a result of a change in the label's DOM value which may\n // be the result of an expression changing. We have to use `detectChanges` in order\n // to avoid \"changed after checked\" errors (see #14793).\n this._changeDetectorRef.detectChanges();\n this.stateChanges.next();\n });\n }", "title": "" }, { "docid": "b04472a47f1f04ae163886526133de97", "score": "0.59332186", "text": "function updateOptions() {\n \t// add the new options\n \tfield.html('');\n \tif (placeholder != undefined) {\n \t\tvar option = $(document.createElement('option'));\n \t\toption.attr('value', -1);\n \t\toption.text(placeholder);\n \t\tfield.append(option);\n \t}\n \tfor (var i = 0; i < optionStructures.length; i++) {\n \t\tvar option = $(document.createElement('option'));\n \t\toption.attr('value', i);\n \t\toption.text(displayFunction(optionStructures[i]));\n \t\tfield.append(option);\n \t}\n \t// select the option that was previously selected\n \t// or update the bindItem to point to the first structure in the list\n \tif (optionStructures.length > 0) {\n \t\tvar initIndex = getBindItemStructureIndex();\n \t\tif (initIndex == null) {\n \t\t\tif (placeholder == undefined) {\n \t\t\t\tbindItem.load(sources.get(0).unwrap());\n \t\t\t}\n \t\t} else {\n \t\t\tfield.val(initIndex);\n \t\t}\n \t}\n }", "title": "" }, { "docid": "259583f0ce7b0e25015170bf552df55f", "score": "0.5918592", "text": "onChange(selectedItems){}", "title": "" }, { "docid": "b892cebc6fe4d8653d3c7bde5ce922b5", "score": "0.59078854", "text": "handleMultiSelect(e) {\n if (e.target.nodeName === 'OPTION') {\n if (e.target.classList.contains('option--selected')) {\n this.selectedValues.splice(this.selectedValues.indexOf(e.target.value), 1);\n } else {\n this.selectedValues.push(e.target.value);\n }\n this.clearSearchField();\n this.checkFieldForErrors();\n this.requestUpdate();\n }\n }", "title": "" }, { "docid": "8246fb50591bc0e2f808ec2e975415b1", "score": "0.5902587", "text": "function changeSelectionStatusAll() {\n\n var keys = Object.keys(self.selectedRows);\n\n if(self.allToggled) {\n for(var x=0; x<Object.keys(self.selectedRows).length; x++) {\n self.selectedRows[keys[x]] = false;\n }\n }\n else {\n for(var x=0; x<Object.keys(self.selectedRows).length; x++) {\n self.selectedRows[keys[x]] = true;\n }\n }\n }", "title": "" }, { "docid": "115fc2e6d107277f13bf07e2835d7894", "score": "0.58964694", "text": "_setSelected(selected) {\n if (selected === this._selected) {\n return false;\n }\n this._selected = selected;\n if (selected) {\n this._selectionList.selectedOptions.select(this);\n }\n else {\n this._selectionList.selectedOptions.deselect(this);\n }\n this.selectedChange.emit(selected);\n this._changeDetectorRef.markForCheck();\n return true;\n }", "title": "" }, { "docid": "fb86c06c8c1a4a936fab8ceba8ade86d", "score": "0.58877254", "text": "change() {\n const { selectedIndex } = this.$('select')[0];\n const values = this.get('values');\n const _selected = values[selectedIndex];\n const selected = typeof _selected.value !== 'undefined' ? _selected.value : _selected;\n\n this.set('selected', selected);\n\n get(this, 'selectionDidChange')(_selected);\n }", "title": "" }, { "docid": "1f49523d6d8fa8daf15b74cb77266cf4", "score": "0.5885844", "text": "onMultipleSelect(selected) {\n this.$set(this.action, 'selected', selected)\n }", "title": "" }, { "docid": "94a53ebfd6dd7f53102a5a074d7e46cd", "score": "0.58706254", "text": "function handleMovement(options) {\r\n $(options.parentElement + ' .unselected').find('option:selected').prop('selected', false);\r\n $(options.parentElement + ' .selected').find('option:selected').prop('selected', false);\r\n\r\n //$(options.parentElement + ' .filter').val('');\r\n //$(options.parentElement + ' select').find('option').each(function() { $(this).show(); });\r\n\r\n countElements(options.parentElement);\r\n }", "title": "" }, { "docid": "f7e546c2a66116b39305c5a1655ff9e2", "score": "0.5869827", "text": "function updateSelectedValues() {\n var onchangeEventHandler = element.getAttribute(\"onchange\");\n element.setAttribute(\"onchange\", \"\");\n $(element).trigger(\"change.select2\");\n element.setAttribute(\"onchange\", onchangeEventHandler);\n }", "title": "" }, { "docid": "60db9ef4a4dffc1fee4319a0132c8db2", "score": "0.5865486", "text": "_selectedChanged() {\n this._updateCols();\n }", "title": "" }, { "docid": "dec3e744c512e394d40ea9d920cb46ce", "score": "0.5863681", "text": "setSelectedKeys(selectedKeys){\n this.x().a(this.options.map(option =>\n Labeled(option[1], this.checkBoxes[option[0]] = \n CheckBox({id: option[0], changedCallback: checked => {\n this.store({\n selectedKeys: this.getSelectedKeys()\n })\n }})\n .setChecked(selectedKeys.includes(option[0]))\n )\n ))\n\n this.store({\n selectedKeys: selectedKeys\n })\n }", "title": "" }, { "docid": "1ce8d98867553441b990890ee0821b29", "score": "0.58614963", "text": "formatOptions() {\n const { options, selectedOptions, variant } = this.props;\n const updatedOptions = _isPlainObject(options)\n ? Object.keys(options).map(key => ({ ...options[key], title: key, value: options[key] }))\n : _cloneDeep(options);\n\n const activateOptions =\n (selectedOptions && typeof selectedOptions === 'string') || typeof selectedOptions === 'number'\n ? [selectedOptions]\n : selectedOptions;\n\n updatedOptions.forEach((option, index) => {\n let convertedOption = option;\n\n if (typeof convertedOption === 'string') {\n convertedOption = {\n title: option,\n value: option\n };\n\n updatedOptions[index] = convertedOption;\n }\n\n convertedOption.text = convertedOption.text || convertedOption.title;\n convertedOption.textContent = convertedOption.textContent || convertedOption.title;\n convertedOption.label = convertedOption.label || convertedOption.title;\n\n if (activateOptions) {\n updatedOptions[index].selected =\n activateOptions.includes(convertedOption.value) || activateOptions.includes(convertedOption.title);\n }\n });\n\n let updateSelected;\n\n if (variant === SelectVariant.single) {\n updateSelected = (updatedOptions.find(opt => opt.selected === true) || {}).title;\n } else {\n updateSelected = updatedOptions.filter(opt => opt.selected === true).map(opt => opt.title);\n }\n\n this.setState({\n options: updatedOptions,\n selected: updateSelected\n });\n }", "title": "" }, { "docid": "6f5fdfdefc54302295d4c54d593316a9", "score": "0.5853512", "text": "function resetItemSelection(selectedItems) {\n for(var i = selectedItems.length - 1; i >= 0; i--) {\n selectedItems[i].isSelected = false;\n selectedItems.splice(i, 1);\n }\n }", "title": "" }, { "docid": "35f7fcb8f1db7bff621ecd8156855215", "score": "0.58176064", "text": "_resetOptions() {\n const changedOrDestroyed = (0,rxjs__WEBPACK_IMPORTED_MODULE_10__.merge)(this.options.changes, this._destroy);\n this.optionSelectionChanges.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.takeUntil)(changedOrDestroyed)).subscribe(event => {\n this._onSelect(event.source, event.isUserInput);\n if (event.isUserInput && !this.multiple && this._panelOpen) {\n this.close();\n this.focus();\n }\n });\n // Listen to changes in the internal state of the options and react accordingly.\n // Handles cases like the labels of the selected options changing.\n (0,rxjs__WEBPACK_IMPORTED_MODULE_10__.merge)(...this.options.map(option => option._stateChanges)).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.takeUntil)(changedOrDestroyed)).subscribe(() => {\n // `_stateChanges` can fire as a result of a change in the label's DOM value which may\n // be the result of an expression changing. We have to use `detectChanges` in order\n // to avoid \"changed after checked\" errors (see #14793).\n this._changeDetectorRef.detectChanges();\n this.stateChanges.next();\n });\n }", "title": "" }, { "docid": "eae1079afe86b20b72912a2b7f77a902", "score": "0.5808701", "text": "function update_selection() {\n\t// Remove deleted bodies\n\tvar selection = viewport.selection.filter(function(select_obj) {\n\t\t// Make sure each selection body exists in world's list of bodies too\n\t\treturn world.objects.some(function(world_obj) {\n\t\t\treturn select_obj===world_obj;\n\t\t});\n\t});\n\t\n\tviewport.selection = selection;\n\t\n\tvar selection = viewport.selection;\n\tvar selection_empty = (selection.length === 0);\n\tselection_properties_button.disabled = selection_empty;\n\tselection_delete_button.disabled = selection_empty;\n\tselection_duplicate_button.disabled = selection_empty;\n}", "title": "" }, { "docid": "e1c734742ab3fb705daf75171afcf3a8", "score": "0.5808547", "text": "handleSelectionChange() {\n if (this.selectedItems.toString() === this.selection) {\n return;\n }\n\n this.selectedItems = this.selection === \"\" ? [] : this.selection.split(\",\");\n this.updateFilteredOptions();\n DOM.queueUpdate(() => {\n this.checkMaxItems();\n });\n this.$emit(\"selectionchange\", {\n bubbles: false\n });\n }", "title": "" }, { "docid": "d4a4d9e3cc8f628d065147ad577e829a", "score": "0.5796511", "text": "function updateSelectedApps() {\n var checked = $('input[name=\"selectedApps\"]:checked').length;\n //Updating selected count info\n $('.selectedAppsCount').html('Selected Apps : ' + checked);\n //Updating status of selectall select\n var total = $('input[name=\"selectedApps\"]').length; \n $('input[name=\"selectall\"]').prop('checked', (total == checked) ? true : false);\n }", "title": "" }, { "docid": "1cade463c10234b4370d442215bd7d54", "score": "0.57939863", "text": "function updateMultipleChoice(item, values){\n item.asMultipleChoiceItem().setChoiceValues(values).showOtherOption(true)\n}", "title": "" }, { "docid": "a2014940d1b4a60185c7e4cb322f7423", "score": "0.5793954", "text": "updateSelectedOptions(selectedOption, trigger) {\n const index = this.state.triggerSelections.findIndex((option) => {\n return trigger === option.trigger;\n });\n\n // Find index of trigger in triggerSelections and set the selectedOption\n if (index >= 0) {\n const triggerSelections = [...this.state.triggerSelections];\n triggerSelections[index].selectedOption = selectedOption;\n this.setState({ triggerSelections });\n this.handleInsertChosenOption();\n } else {\n console.error(`Trigger ${trigger} is not in triggerSelections array.`);\n }\n }", "title": "" }, { "docid": "6efbfc4ef54e2d9e3e331c257adbae84", "score": "0.5788983", "text": "function updateOrderSelectors() {\n\tvar row_count = $('table.graphics tbody tr').length;\n\t$('table.graphics select').each(function () {\n\t\tvar select = $(this);\n\t\tvar selected = select.val();\n\t\tselect.empty();\n\t\tfor (var n = 1; n <= row_count; n++) {\n\t\t\tvar option = $('<option value=\"\"></option>');\n\t\t\toption.html(n);\n\t\t\toption.val(n - 1);\n\t\t\tif (selected == n - 1) {\n\t\t\t\toption.attr('selected', 'selected');\n\t\t\t}\n\t\t\tselect.append(option);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "4d831feaaed57c1d4c79c7245404a816", "score": "0.57850593", "text": "handleDropdownChange(selectedOptions) {\n this.selectedMiners = selectedOptions.map(option => option.value);\n }", "title": "" }, { "docid": "a764da4a8fe9e30ecef2e2754267d596", "score": "0.57841146", "text": "calculateOptions () {\n set(this, 'options', A(get(this, 'attributes').map(entryValue => {\n return dropDownElement.create({\n value: entryValue.value,\n label: entryValue.label || entryValue.value,\n isSelected: !!entryValue.selected\n });\n })));\n }", "title": "" }, { "docid": "6de0a01db84eaeb1e825e743338b5121", "score": "0.5777302", "text": "function updateSelectedPalette()\n{\n // Palettes\n pallist.querySelector(`input[name=\"palette\"][value=\"${selectedPal}\"]`).checked = true;\n selElement = pallist.querySelector('.selected');\n if (selElement) {\n selElement.classList.remove('selected')\n }\n pallist.querySelector(`.lstI[data-id=\"${selectedPal}\"]`).classList.add('selected');\n\n}", "title": "" }, { "docid": "ef3f78bd59f16dca78ce7f6e325ef439", "score": "0.5774261", "text": "function SelectAll(list) {\n for (var i=0; i<list.length; i++)\n list.options[i].selected = true;\n}", "title": "" }, { "docid": "4eafa8991bcd6ed6e3d225f04a4768c4", "score": "0.5763205", "text": "deselectAll() {\n return this._setAllOptionsSelected(false);\n }", "title": "" }, { "docid": "6bdd8de317ef0d99ed3e2d1a4c7a0c3b", "score": "0.57567614", "text": "[ RENDER_REFRESH_SELECTALL ] () {\n // Elements\n const selectAll = this.shadowRoot.querySelector ('#selectAll');\n const checkboxes = this.shadowRoot.querySelector ('#checkboxes');\n let checked;\n let visible;\n if (HAS_NATIVE_SHADOW) {\n checked = checkboxes.querySelectorAll ('p:not(.hidden) input.option:checked').length;\n visible = checkboxes.querySelectorAll ('p:not(.hidden) input.option').length;\n } else {\n checked = checkboxes\n .querySelectorAll ('p input.option:checked')\n .filter(o => ! o.parentNode.classList.contains('hidden'))\n .length;\n visible = checkboxes\n .querySelectorAll ('p input.option')\n .filter(o => ! o.parentNode.classList.contains('hidden'))\n .length;\n }\n // Update\n selectAll.checked = checked === visible && checked !== 0;\n }", "title": "" }, { "docid": "8eda38ad6e459c2da83f497d7562196d", "score": "0.57530546", "text": "function refreshSelects(){\n\tvar selectElements = document.getElementsByTagName(\"select\");\n\n\tfor(i=0;i<selectElements.length;i++){\n\t\tif(selectElements[i].type==\"select-multiple\")\n\t\t\tselectElements[i].style.zoom = selectElements[i].style.zoom ? \"\" : 1;\n\t}\n}", "title": "" }, { "docid": "cd5bebffddf39b220d28eb1bb449f60a", "score": "0.57528543", "text": "function selectChangeHandler(selectedOptions) {\n selectedTags = selectedOptions;\n }", "title": "" }, { "docid": "a4c867536e56236f4b1a4d80159fd37a", "score": "0.5747172", "text": "slottedOptionsChanged(prev, next) {\n this.options = next.reduce((options, item) => {\n if (isListboxOption(item)) {\n options.push(item);\n }\n\n return options;\n }, []);\n const setSize = `${this.options.length}`;\n this.options.forEach((option, index) => {\n if (!option.id) {\n option.id = uniqueId(\"option-\");\n }\n\n option.ariaPosInSet = `${index + 1}`;\n option.ariaSetSize = setSize;\n });\n\n if (this.$fastController.isConnected) {\n this.setSelectedOptions();\n this.setDefaultSelectedOption();\n }\n }", "title": "" }, { "docid": "601c84e52463115c5022dc1f4282d4a5", "score": "0.5746401", "text": "function initSelect(newVal, oldVal) {\r\n\t if (attrs.multiple) {\r\n\t if (oldVal !== undefined && newVal !== undefined) {\r\n\t if (oldVal.length === newVal.length) {\r\n\t return;\r\n\t }\r\n\t }\r\n\t var activeUl = element.siblings(\"ul.active\");\r\n\t if (newVal !== undefined && activeUl.length) { // If select is open\r\n\t var selectedOptions = activeUl.children(\"li.active\").length; // Number of selected elements\r\n\t if (selectedOptions == newVal.length) {\r\n\t return;\r\n\t }\r\n\t }\r\n\t }\r\n\t\r\n\t element.siblings(\".caret\").remove();\r\n\t scope.$evalAsync(function () {\r\n\t //element.material_select();\r\n\t //Lines 301-311 fix Dogfalo/materialize/issues/901 and should be removed and the above uncommented whenever 901 is fixed\r\n\t element.material_select(function () {\r\n\t if (!attrs.multiple) {\r\n\t $('input.select-dropdown').trigger('close');\r\n\t }\r\n\t });\r\n\t var onMouseDown = function (e) {\r\n\t // preventing the default still allows the scroll, but blocks the blur.\r\n\t // We're inside the scrollbar if the clientX is >= the clientWidth.\r\n\t if (e.clientX >= e.target.clientWidth || e.clientY >= e.target.clientHeight) {\r\n\t e.preventDefault();\r\n\t }\r\n\t };\r\n\t element.siblings('input.select-dropdown').on('mousedown', onMouseDown);\r\n\t });\r\n\t }", "title": "" }, { "docid": "bad28449f1c3aac3cec2aa5689ada45c", "score": "0.5746285", "text": "handleOptionSelected(selectedOptions) {\n if (selectedOptions.length < this.props.maxQueryWorks) {\n this.setState({selections: selectedOptions});\n }\n }", "title": "" }, { "docid": "6c8c47fe9b16f8f3625d50c37ab88459", "score": "0.57375306", "text": "function selected(option, q){\r\n //remove any selected classes from all options first\r\n $(\"#\" + q + \" .options .option\").removeClass(\"selected\");\r\n\r\n //add selected class only to this selected option\r\n option.addClass(\"selected\");\r\n}", "title": "" }, { "docid": "d7ec9965195f28178c257135d742f785", "score": "0.5734366", "text": "function reselectVisChoices () {\n var visCheckBoxGroup = d3.select(\"#dynamicSelectDiv\").selectAll(\"span.fieldGroup input\");\n DWCAHelper.reselectActiveVisChoices (visCheckBoxGroup, d3.select(\"#listDiv\"), function() { return getMeta(); });\n }", "title": "" }, { "docid": "549a4b9536d86a2f6e13ad14df6f7fce", "score": "0.57338613", "text": "function update_selectedItem(selected_box, $dom) {\n var $input = $dom.find(\"input[name='checkbox']\");\n for (var i = 0; i < selected_box.length; i+=1) {\n var val = selected_box[i].val();\n for(var j = 0; j < $input.length; j+=1) {\n if ($input.eq(j).val() == val) {\n $input.eq(j).attr(\"checked\", \"checked\");\n break;\n }\n }\n }\n select_item({\"data\": {\n \"selected_box\": selected_box,\n \"$dom\": $dom\n }});\n }", "title": "" }, { "docid": "25208c4c049ad1c86ba1bfe6abcdf6c5", "score": "0.57324475", "text": "function sureChange(){\n if (_selected.includes('1')) {\n $('#defaultUnchecked1').prop('checked', true)\n }else{\n $('#defaultUnchecked1').prop('checked', false)\n }\n if (_selected.includes('2')) {\n $('#defaultUnchecked2').prop('checked', true)\n }else{\n $('#defaultUnchecked2').prop('checked', false)\n }\n if (_selected.includes('3')) {\n $('#defaultUnchecked3').prop('checked', true)\n }else{\n $('#defaultUnchecked3').prop('checked', false)\n }\n if (_selected.includes('4')) {\n $('#defaultUnchecked4').prop('checked', true)\n }else{\n $('#defaultUnchecked4').prop('checked', false)\n }\n }", "title": "" }, { "docid": "14d1145100442536d898c3a67e891cbc", "score": "0.5726756", "text": "_resetOptions() {\n const changedOrDestroyed = (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.merge)(this.options.changes, this._destroy);\n this.optionSelectionChanges.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.takeUntil)(changedOrDestroyed)).subscribe(event => {\n this._onSelect(event.source, event.isUserInput);\n if (event.isUserInput && !this.multiple && this._panelOpen) {\n this.close();\n this.focus();\n }\n });\n // Listen to changes in the internal state of the options and react accordingly.\n // Handles cases like the labels of the selected options changing.\n (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.merge)(...this.options.map(option => option._stateChanges))\n .pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.takeUntil)(changedOrDestroyed))\n .subscribe(() => {\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n });\n }", "title": "" }, { "docid": "3253bd66e62899b48a90ef08b8d4f891", "score": "0.5709504", "text": "_selectAllItems() {\n var range = this.getSelectables();\n for (var i = 0, l = range.length; i < l; i++) {\n this._addToSelection(range[i]);\n }\n }", "title": "" }, { "docid": "2f5798e5f073d2f8173cf51c57628141", "score": "0.5701519", "text": "#updateSelectionState() {\n if (!this.children.length) {\n return;\n }\n\n // determine which child tab value was set,\n // then highlight the item\n\n let hadTabSelection = false;\n\n for (let i = 0; i < this.children.length; i++) {\n const tabValue = this.children[i].getAttribute(attributes.VALUE);\n const isTabSelected = Boolean(this.value === tabValue);\n\n if (Boolean(this.children[i].selected) !== isTabSelected) {\n this.children[i].selected = isTabSelected;\n }\n\n if (!hadTabSelection && Boolean(this.children[i].selected)) {\n hadTabSelection = true;\n }\n }\n }", "title": "" }, { "docid": "781e78a3c2458e46bc5ab1524eaa4b06", "score": "0.5693767", "text": "select(...values) {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "781e78a3c2458e46bc5ab1524eaa4b06", "score": "0.5693767", "text": "select(...values) {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "781e78a3c2458e46bc5ab1524eaa4b06", "score": "0.5693767", "text": "select(...values) {\n this._verifyValueAssignment(values);\n values.forEach(value => this._markSelected(value));\n this._emitChangeEvent();\n }", "title": "" }, { "docid": "3c1eef482b6f32395e31745f8103cec2", "score": "0.56908", "text": "function changeSelected() {\n console.log('changed!');\n }", "title": "" }, { "docid": "41b5ba371c14cfdd1b3f98639b1ce2bc", "score": "0.56858647", "text": "function updateSelected(contentItem, persist) {\n\n\t\t\t\tvar allSelected = lsWire.list.selected(contentItem);\n\n\t\t\t\t_.forEach(allSelected, function (item) {\n\t\t\t\t\titem.lsWireSelected = persist;\n\t\t\t\t});\n\n\t\t\t}", "title": "" }, { "docid": "c94f1feab974bb0c7693cb0c823c623a", "score": "0.56854886", "text": "selectedIndexChanged(prev, next) {\n var _a;\n\n if (!this.hasSelectableOptions) {\n this.selectedIndex = -1;\n return;\n }\n\n if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === \"number\") {\n const selectableIndex = this.getSelectableIndex(prev, next);\n const newNext = selectableIndex > -1 ? selectableIndex : prev;\n this.selectedIndex = newNext;\n\n if (next === newNext) {\n this.selectedIndexChanged(next, newNext);\n }\n\n return;\n }\n\n this.setSelectedOptions();\n }", "title": "" }, { "docid": "918835551e902ffa920a5f8c4b241257", "score": "0.56841636", "text": "removeAll(e) {\n e.stopPropagation();\n for (let i = this.selectedOptions.length - 1; i >= 0; i--) {\n let item = this.selectedOptions[i];\n this.removeOne(item);\n }\n }", "title": "" }, { "docid": "bc997f0b59afcaca15d75f77b993c07e", "score": "0.56775856", "text": "function initializeContainersSelection() {\r\n\r\n console.log('initializeContainersSelection called');\r\n for (var i = 0; i < containers.length; i++) {\r\n containers[i].isSelected = false;\r\n }\r\n}", "title": "" }, { "docid": "7b53d2954eab3f8320b0cfc059189700", "score": "0.56756383", "text": "function _listener() {\n $scope.$watch('options', function (options) {\n setInit();\n if (ngModel.$modelValue && ngModel.$modelValue.length > 0) {\n var selected = ngModel.$modelValue;\n for(var i in selected) {\n var option = selected[i];\n if (options.indexOf(option) === -1) {\n selected.splice(i, 1);\n }\n }\n setValue(selected);\n }\n }, true);\n }", "title": "" }, { "docid": "537412fa28d44903e224495b3f3aae7a", "score": "0.56742287", "text": "set selected(value) {\n if (this.selectable) {\n this.children.forEach(c => {\n c.selected = value;\n });\n }\n }", "title": "" }, { "docid": "8239a5d7de58da74628cf70df1824dc3", "score": "0.5672387", "text": "setSelectedList()\n {\n const selectedList = [];\n for (let i = 0; i < this.props.checkOptions.length; i++) {\n if (this.props.checkOptions[i].selected == 1) {\n if (this.props.maxSelected != undefined) {\n if (selectedList.length < this.props.maxSelected) {\n selectedList.push(i);\n }\n } else {\n selectedList.push(i);\n }\n }\n }\n this.setState({selectedList: selectedList});\n }", "title": "" }, { "docid": "02059dee560f7936e36c0a39f0cb6bf9", "score": "0.5666399", "text": "function GASselectAll(sel) {\n if (!sel || (sel.type != \"select-multiple\" && sel.type != \"select-one\")) {\n return;\n }\n for (var i = 0; i < sel.options.length; i++) {\n sel.options[i].selected = true;\n }\n}", "title": "" }, { "docid": "705b3647601b2accbde5f286fd791d18", "score": "0.56578785", "text": "function selectAll(list)\n{\n\t// Go through each item and set the select flag to true\n\t//\n\tfor ( var i = 0; i < list.length; i++ )\n\t{\n\t\tlist[i].selected = true;\n\t}\n}", "title": "" }, { "docid": "a651cba37f471fe63e1757dd09e1048a", "score": "0.56560224", "text": "_unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }", "title": "" }, { "docid": "a651cba37f471fe63e1757dd09e1048a", "score": "0.56560224", "text": "_unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }", "title": "" }, { "docid": "a651cba37f471fe63e1757dd09e1048a", "score": "0.56560224", "text": "_unmarkAll() {\n if (!this.isEmpty()) {\n this._selection.forEach(value => this._unmarkSelected(value));\n }\n }", "title": "" }, { "docid": "921ae5ed6f46f388b2789a0b4d974048", "score": "0.5655048", "text": "function refreshTransitionStates() {\n var options = userSelectList.find('option');\n console.log('project user count: %s', projectUsers.length);\n $.each(options, function (index, item) {\n var opt = $(item);\n $.each(projectUsers, function (index, item) {\n if (item.id == opt.val()) {\n opt.prop('selected', true);\n }\n });\n });\n\n userSelectList.bootstrapDualListbox('refresh');\n }", "title": "" }, { "docid": "7e79471cb44279ab5245d7e98c15563b", "score": "0.5653901", "text": "function updateCheckbox(){\n var allSelected = true, semiSelected = false;\n $.each(buttonList, function(index/*, button*/){\n if (!selectedOnMap[index])\n allSelected = false;\n if (selectedOnMap[index] != selectedOnMap[0])\n semiSelected = true;\n });\n\n $checkbox.find('input')\n ._cbxSet(allSelected || semiSelected, true)\n .prop('checked', allSelected || semiSelected)\n .toggleClass('semi-selected', semiSelected);\n }", "title": "" }, { "docid": "b6f4164c66f2bab341cfae42cd6a5697", "score": "0.5649064", "text": "updateSelection() {\n this._selection.update();\n }", "title": "" }, { "docid": "48bbab0d610fa9aecfc7df5c7e15f4ec", "score": "0.56484884", "text": "_handleHierarchicalSelection(item, selectedIndexes) {\n function checkUncheckChildren(item, check) {\n const children = item.itemContainer.children;\n\n for (let i = 0; i < children.length; i++) {\n const currentChild = children[i];\n\n currentChild.set('selected', check);\n currentChild.setAttribute('aria-selected', check);\n currentChild.removeAttribute('indeterminate');\n\n if (currentChild instanceof Smart.TreeItemsGroup) {\n checkUncheckChildren(currentChild, check);\n }\n }\n }\n\n const that = this;\n let currentItem = item;\n\n if (item.selected) {\n item.set('selected', false);\n item.setAttribute('aria-selected', false);\n }\n else {\n item.set('selected', true);\n item.setAttribute('aria-selected', true);\n item.removeAttribute('indeterminate');\n }\n\n while (currentItem.parentItem) {\n const parent = currentItem.parentItem,\n children = parent.itemContainer.children;\n let selectedChildren = 0, indeterminateChildren = 0;\n\n for (let i = 0; i < children.length; i++) {\n if (children[i].selected) {\n selectedChildren++;\n }\n else if (children[i].hasAttribute('indeterminate')) {\n indeterminateChildren++;\n }\n }\n\n that._setThreeStateCheckbox(parent, selectedChildren, indeterminateChildren);\n\n currentItem = parent;\n }\n\n if (item instanceof Smart.TreeItemsGroup) {\n checkUncheckChildren(item, item.selected);\n }\n\n selectedIndexes.length = 0;\n\n const selectedItems = Array.from((that.enableShadowDOM ? that.shadowRoot : that).querySelectorAll('[selected]'));\n\n for (let i = 0; i < selectedItems.length; i++) {\n selectedIndexes.push(selectedItems[i].path);\n }\n\n that._sortPathCollection(selectedIndexes);\n }", "title": "" }, { "docid": "e0e93cbea18d8bbd3323b28fc3350a08", "score": "0.56473655", "text": "function SeleccionarPerifericos(){\n var lista = document.getElementById(\"perifericos[]\");\n for(i = 0; i<lista.options.length; i++){\n lista[i].selected = \"selected\";\n }\n}", "title": "" }, { "docid": "941096f17e745d329d5816a44f27227f", "score": "0.5645421", "text": "function highlightSelection(){\n\n const current = list.querySelectorAll('[selected=\"true\"]');\n\n if(current.length > 0){\n current.forEach(function(item){\n item.setAttribute('selected', 'false');\n });\n }\n\n list.childNodes[sel_index].setAttribute('selected', 'true');\n}", "title": "" }, { "docid": "18c717de89d5b62fa015d27ec78766ec", "score": "0.56448656", "text": "function handleSelectionClick(e) {\n //listened to by the list via event bubbling\n const id = parseInt(e.target.dataset.id);\n if (!id) {\n return;\n }\n //remove in selected\n setSelection(prevSelection =>\n prevSelection.filter(select => select.id !== id)\n );\n //add in options\n setOptions(prevOptions => {\n const copy = prevOptions.map(option => ({ ...option }));\n copy.push({ ...selection.find(option => option.id === id) });\n return copy;\n });\n }", "title": "" }, { "docid": "8bc87a3e22880e7ff50ba8e41886296f", "score": "0.5644575", "text": "selectAll() {\n return this._setAllOptionsSelected(true);\n }", "title": "" }, { "docid": "3d23a05ac2c7bc37c56d051f0918cec3", "score": "0.5637045", "text": "function restore_options() {\n\t\tconsole.log(\"restore options...\");\n\t\tvar ids = [\n\t\t\t\"genre1\", \"genre2\", \"genre3\",\n\t\t\t\"mood1\", \"mood2\", \"mood3\",\n\t\t\t\"era1\", \"era2\", \"era3\"\n\t\t];\n\t\tfor (var j=0; j<ids.length; j++) {\n\t\t\tvar select1 = document.getElementById(ids[j]);\n\t\t\tvar genre1 = localStorage[ids[j]];\n\t\t\tfor (var i = 0; i < select1.children.length; i++) {\n\t\t\t\tvar child = select1.children[i];\n\t\t\t\tif (child.value == genre1) {\n\t\t\t\t\tchild.selected = \"true\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "da04d2da7862bbe62e05549f1ed48f99", "score": "0.5635205", "text": "function updateUI() {\n\t\tif ($selectedOption[0]) {\n\t\t\t$inputElement.val($selectedOption[0].textContent); //textContent will break on IE8 and older. Do we care?\n\t\t\t$optionsContainer.children(optionSelector).removeClass(selectedClass);\n\t\t\t$selectedOption.addClass(selectedClass);\n\t\t}\n\t\telse {\n\t\t\t//preserve cursor position in the case where the value didn't change\n\t\t\tif ($inputElement.val() !== userEnteredValue) {\n\t\t\t\t$inputElement.val(userEnteredValue);\n\t\t\t}\n\n\t\t\t$optionsContainer.children(optionSelector).removeClass(selectedClass);\n\t\t}\n\t}", "title": "" }, { "docid": "42f0183cb666f8ba3b6f8ad6ad287db8", "score": "0.5633434", "text": "@computed get selectedOptions() {\n return this.props.allSelectedOptions[this.props.itemNumber]\n }", "title": "" }, { "docid": "3dad12cd20f5cde406450bd41caf53b2", "score": "0.56314874", "text": "_onSelectChoiceChanged() {\n this.model.set('choice',\n this.conditionSet.choices.get(this._$choice.val()));\n }", "title": "" }, { "docid": "77575a32e50c92858bdf210843f1f111", "score": "0.56190825", "text": "selectionUpdates(valGood, valBad) {\n const {good, bad} = this.state;\n //callback is added because setState is async so it forces update\n this.setState({good: [...good, valGood]}, () => {this.removeOpposite(valBad, this.state.good)});\n this.setState({bad: [...bad, valBad]}, () => {this.removeOpposite(valGood, this.state.bad)});\n }", "title": "" } ]
4a2d9fd0a8a2ff18708c6b3394f64d81
const offsetHeight = 30; const offsetWidth = 40;
[ { "docid": "1a83ab74adb289618b6fdbfd50eb7f48", "score": "0.0", "text": "function defaultSetting() {\n isPencil = true;\n isEraser = false;\n isCircle = false;\n isSquare = false;\n}", "title": "" } ]
[ { "docid": "26fc48f97050bac3391e1790d73ec4d1", "score": "0.7457216", "text": "_getImageStyle(size){let offset=\"22%\",diameter=\"56%\";if(\"xs\"===this.size){offset=\"32%\";diameter=\"36%\"}else if(\"sm\"===this.size){offset=\"26%\";diameter=\"48%\"}else if(\"lg\"===this.size){offset=\"20%\";diameter=\"60%\"}else if(\"xl\"===this.size){offset=\"17%\";diameter=\"66%\"}return\"left: \"+offset+\"; top: \"+offset+\"; width: \"+diameter+\"; height: \"+diameter+\";\"}", "title": "" }, { "docid": "9e4824e130e40861c391eefffb0e75bb", "score": "0.6878107", "text": "@flow\n get offsetSize() {\n const {width: borderWidth} = this.attr('border'),\n [width, height] = this.clientSize;\n\n return [width + 2 * borderWidth,\n height + 2 * borderWidth];\n }", "title": "" }, { "docid": "7c7f08321cb9f56c969df4b316239fe6", "score": "0.6819111", "text": "constructor () {\n this.height = 70;\n this.width = 10;\n this.xPosition = 0;\n this.yPosition= 0;\n }", "title": "" }, { "docid": "fe8f998ed5fa8e58dde053c16c296f77", "score": "0.66330487", "text": "function K(){var t=l.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?t.width||l[e]:t.height||l[e]}", "title": "" }, { "docid": "aacd24a511f17d1dbd86214928dccc84", "score": "0.65724945", "text": "function G(){var e=c.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?e.width||c[t]:e.height||c[t]}", "title": "" }, { "docid": "2fed0414e84866867a29a1a36a29b507", "score": "0.6545086", "text": "calcRect() {\n const image = this.getCurrentAsset().img;\n\n return {\n left: this._x,\n right: this._x + image.width,\n top: this._y + image.height - 5,\n bottom: this._y + image.height,\n };\n }", "title": "" }, { "docid": "d91a29854063cda243dc25cc6644886b", "score": "0.6516192", "text": "area() {\n return this.w * this.h\n }", "title": "" }, { "docid": "ef8c68ebc503a44c3488f9445859588a", "score": "0.6512787", "text": "calculateOffset() {\n this.offsetX = -this.sketch.mouseX + this.x + this.w/2;\n this.offsetY = -this.sketch.mouseY + this.y + this.h/2;\n }", "title": "" }, { "docid": "e58d94d13b7ed6fea9c1b635f3840ddc", "score": "0.64456147", "text": "borders() {\n if (this.position.x < -this.r) this.position.x = width+this.r+this.position.x;\n if (this.position.y < -this.r) this.position.y = height+this.r+this.position.y;\n if (this.position.x > width+this.r) this.position.x = -this.r+this.position.x-width;\n if (this.position.y > height+this.r) this.position.y = -this.r+this.position.y-height;\n }", "title": "" }, { "docid": "497410f9506eb03414dff74e4c489369", "score": "0.6390894", "text": "changeSize(x,y) {\n this.w=sqrt(pow(x-this.x,2)+pow(y-this.y,2))*2;\n }", "title": "" }, { "docid": "70700ec7d7fc58bbd23b9f324507d573", "score": "0.6384549", "text": "function z(){var t=f.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||f[e]:t.height||f[e]}", "title": "" }, { "docid": "a3146a7f9aee4a688ab273ad761cd226", "score": "0.6376918", "text": "function E(){var e=oe.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][n.ort];return 0===n.ort?e.width||oe[t]:e.height||oe[t]}", "title": "" }, { "docid": "4d8fab85882891337ede484c02a20d90", "score": "0.6241326", "text": "show() {\n let paddingX = this.component.calculatePadding();\n let paddingY = this.component.calculatePadding();\n this.sketch.fill(0, 0, 0, 0);\n this.sketch.rect(\n this.grid.getRealCoordinateX(this.component.x) - paddingX / 2,\n this.grid.getRealCoordinateY(this.component.y) - paddingY / 2,\n this.component.w * this.grid.scalingFactor + paddingX,\n this.component.h * this.grid.scalingFactor + paddingY,\n this.grid.scalingFactor * 0\n );\n\n \n }", "title": "" }, { "docid": "d20d8a8295e5b9b79f63f9455fc724fa", "score": "0.6240118", "text": "function N(){var e=d.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||d[t]:e.height||d[t]}", "title": "" }, { "docid": "46bdbf492bcb06fb9f28aafc42ec78e2", "score": "0.6233004", "text": "makePixelAligned()\n\t{\n\t\tlet x2 = Math.ceil(this.x + this.width);\n\t\tlet y2 = Math.ceil(this.y + this.height);\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\t\tthis.width = x2 - this.x + 1;\n\t\tthis.height = y2 - this.y + 1;\n\t}", "title": "" }, { "docid": "03d267fda01e85876be9c0b91ea87b43", "score": "0.6227398", "text": "restrain(p) {\n let x = p.x;\n let y = p.y;\n if (x < 100) x = 100;\n if (x > width - 100) x = width - 100;\n if (y < 100) y = 100;\n if (y > height - 100) y = height - 100;\n p.x = x;\n p.y = y;\n }", "title": "" }, { "docid": "06f83936eef64e1e1881fc0ce1609f65", "score": "0.6223041", "text": "function D(){var e=d.getBoundingClientRect(),t=\"offset\"+[\"Width\",\"Height\"][r.ort];return 0===r.ort?e.width||d[t]:e.height||d[t]}", "title": "" }, { "docid": "cf8ffb3ddd4ba0bdfbdff57d468733f9", "score": "0.62060887", "text": "resize() {\n this.scrollPosition = width * 0.0625;\n this.x = width * 0.06;\n this.y = height * (2 * this.position + 1) * 0.125 - this.scrollPosition * this.scrollAmount;\n this.width = width * this.objImage.width * 0.0002;\n this.height = width * this.objImage.height * 0.0002;\n this.textX = width * 0.125;\n this.tSize = 15 * scalars.textScalar;\n this.rectX = width * 0.15;\n\n this.starX = width * 0.135;\n this.starY = this.y + height * 0.07;\n this.starSize = 40;\n this.starDist = this.starSize * 1.4;\n }", "title": "" }, { "docid": "86fa85e657434af011c666491ae6b6bd", "score": "0.6205017", "text": "function region_code(x,y){\nlet code=0;\n\nif (x < minWidowWidth){\n code = code + 1;\n\n}else if (x > maxWindowWidth){\n code = code + 2;\n}\nif (y < minWindowHeight){\n code = code + 4;\n\n}else if (y > maxWindowHeight){\n code = code + 8;\n}\nreturn code;\n}", "title": "" }, { "docid": "43f05a37f9920dcdf7d831c52b0fcc9b", "score": "0.6193774", "text": "offset() {\n if (this.overlap) return this.dot ? 8 : 12;\n return this.dot ? 2 : 4;\n }", "title": "" }, { "docid": "e988f55142a2466a51e96975a524933e", "score": "0.61847115", "text": "changeSize(x,y) {\n this.r=sqrt(pow(x-this.x,2)+pow(y-this.y,2))*2;\n }", "title": "" }, { "docid": "e5b22a37de6ce8b12fd68235bae785c7", "score": "0.6138909", "text": "changeSize(x,y) {\n this.h=sqrt(pow(x-this.x,2)+pow(y-this.y,2))*2;\n }", "title": "" }, { "docid": "166dffe461b8b99cf84f0c3c7a25e96f", "score": "0.6127337", "text": "function MinY() {\n return MinX() * Height / Width;\n}", "title": "" }, { "docid": "86d009c4c42f5324b1fde495cd8c6100", "score": "0.6083654", "text": "generateMargin(assetInfo) {\n const x = assetInfo[2];\n const y = assetInfo[3];\n return `${-GAMESQUARE_SIZE * x}px 0px 0px ${-GAMESQUARE_SIZE * y}px`;\n }", "title": "" }, { "docid": "d4a5d19cf8fecf9442fee2bf4f840c28", "score": "0.6080701", "text": "function setOffset() {\n offset = $(\"#sketcharea\").offset();\n offset.left = Math.round(offset.left);\n offset.top = Math.round(offset.top)\n}", "title": "" }, { "docid": "417f1f5bd71ed0b8d65137f34583709c", "score": "0.6033112", "text": "_size_elements () {\n\n\t\tthis.w = this.context.canvas.width\n\t\tthis.h = this.context.canvas.height\n\n\t\tvar sw = this.w * 0.9 / 7\n\t\tvar sh = this.h * 0.9 / 7\n\n\t\tthis.cell_size = Math.min (sw, sh)\n\t\tthis.margin_h = (this.h - this.cell_size * 7) / 2\n\t\tthis.margin_w = (this.w - this.cell_size * 7) / 2\n\t\tthis.hole_size = this.cell_size * 0.8\n\t}", "title": "" }, { "docid": "635936d9d7772f1bd42ddcad78a7d37b", "score": "0.60297334", "text": "function defineVars(){\n\t\twidthOfContainer = container.offsetWidth;\n\t\tmaxPos = widthOfContainer * imageStrip.children.length;\n\t}", "title": "" }, { "docid": "2067fa7d3f80d39b0a759d59de837ffe", "score": "0.60290277", "text": "get _physicalBottom(){return this._physicalTop+this._physicalSize}", "title": "" }, { "docid": "f7f96a50ffb63a7c0dd4df10541e085a", "score": "0.6023063", "text": "getFastBounds () {\n return {\n left: -120,\n top: 60,\n right: 0,\n bottom: -60\n };\n }", "title": "" }, { "docid": "a38fe3b9e675ad4ed45b91789131b7fe", "score": "0.60211533", "text": "get center() { return this.size.divide(2); }", "title": "" }, { "docid": "9cddfb29d84e4dbdd121d9cef0ac16b7", "score": "0.60104185", "text": "setSize(ptr, size){\n this.uview[ptr + 1] = size;\n this.uview[ptr + size - 2] = size;\n }", "title": "" }, { "docid": "313dc1fe8913f2ac185fdd765111d409", "score": "0.600724", "text": "function positionArtwork(offset)\n{\n placedArtwork.position = [ ((proofSheet.width / 2) - (placedArtwork.width / 2) - offset) , \n (((proofSheet.height / 2) + (placedArtwork.height / 2)) + inchesToPoints(0.2) + offset)];\n}", "title": "" }, { "docid": "af8cf14fce4fd0a499d6219a59f74eb8", "score": "0.5991375", "text": "position(){\n const ary = this.viewBox().split(' ');\n\n return {\n x: parseInt(ary[0]),\n y: parseInt(ary[1]),\n width: parseInt(ary[2]),\n height: parseInt(ary[3])\n };\n }", "title": "" }, { "docid": "b9c2301d492ae0a914c60a2020a697a5", "score": "0.5985746", "text": "position(posX, posY, sizeX, sizeY) {\n\n this.size = [sizeX, sizeY];\n // this.position = [posX, posY];\n\n this.tl = [\n posX - sizeX/2,\n posY - sizeY/2\n ]\n this.bl = [\n posX - sizeX/2,\n posY + sizeY/2\n ]\n this.br = [\n posX + sizeX/2,\n posY + sizeY/2\n ]\n\n }", "title": "" }, { "docid": "dd1fd315f80eda1a68a52efcb72d81b8", "score": "0.5966597", "text": "shrink(){\n this.height=this.height-this.shrink\n this.width=this.width-this.shrink\n }", "title": "" }, { "docid": "6ee57fb927b1b710281eddfec364abcd", "score": "0.59593475", "text": "_calculateSize(ctx){\n\n ctx.font = this.opts.font;\n let measurement = ctx.measureText(this.content);\n let height = 48;\n this.setPos(this.pos.x - this.opts.padding.left, this.pos.y - this.opts.padding.top);\n this.shape.setSize(measurement.width + this.opts.padding.left + this.opts.padding.right, height + this.opts.padding.top + this.opts.padding.bottom);\n\n }", "title": "" }, { "docid": "c767bf192f5644902bb2be67786f2eb0", "score": "0.59541166", "text": "calcArea() {\n return this.height * this.width;\n }", "title": "" }, { "docid": "f68510a850687ae1e20c72e36da74356", "score": "0.59531194", "text": "function getPixelPosition($target)\n{\n var offs = $target.offset();\n var sizes = [ offs.left, offs.top,$target.width(), $target.height(),];\n return sizes;\n\n}", "title": "" }, { "docid": "8354f3b80ae1c9c33b4bfd960832b747", "score": "0.5939087", "text": "function confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n}", "title": "" }, { "docid": "d4fe47dcf03523939f9be05a39692f79", "score": "0.5935363", "text": "setHeight(value) {\n this.position.y = height - this.radius - value;\n this.previous_position.y = this.position.y;\n }", "title": "" }, { "docid": "33b35936a05f59b5aa7a0d921121d773", "score": "0.59331214", "text": "changeSize(x,y) {\n this.d=sqrt(pow(x-this.x,2)+pow(y-this.y,2))*2;\n }", "title": "" }, { "docid": "33b35936a05f59b5aa7a0d921121d773", "score": "0.59331214", "text": "changeSize(x,y) {\n this.d=sqrt(pow(x-this.x,2)+pow(y-this.y,2))*2;\n }", "title": "" }, { "docid": "33b35936a05f59b5aa7a0d921121d773", "score": "0.59331214", "text": "changeSize(x,y) {\n this.d=sqrt(pow(x-this.x,2)+pow(y-this.y,2))*2;\n }", "title": "" }, { "docid": "33b35936a05f59b5aa7a0d921121d773", "score": "0.59331214", "text": "changeSize(x,y) {\n this.d=sqrt(pow(x-this.x,2)+pow(y-this.y,2))*2;\n }", "title": "" }, { "docid": "9879698a52aaf5ac12bb261e3ca2f12e", "score": "0.59301686", "text": "_calculateSize(){\n\n this.shape._width = this.shape.width * this.scale.x;\n this.shape._height = this.shape.height * this.scale.y;\n\n console.log('width', this.width, 'height', this.height);\n\n }", "title": "" }, { "docid": "9ad0ea95c3de8e71ec6490c34ebc1894", "score": "0.5923342", "text": "function reOffset() {\n var BB = canvas.getBoundingClientRect();\n offsetX = BB.left;\n offsetY = BB.top;\n}", "title": "" }, { "docid": "596f762c937d56660b8effefea83eb9b", "score": "0.59217495", "text": "constructor(x, y, w, h) {\r\n this.x = x;\r\n this.y = y;\r\n this.width = w;\r\n this.height = h;\r\n }", "title": "" }, { "docid": "8ba633a546d796249992f96011732ae5", "score": "0.5921332", "text": "get size() {\n return { w: this.width,\n h: this.height }\n }", "title": "" }, { "docid": "0f2caf528e362f1c1ff0f4bef108da35", "score": "0.59101945", "text": "getBoundingClientRect() {\r\n return {top: 0, left: 0, width: window.innerWidth, height: window.innerHeight};\r\n }", "title": "" }, { "docid": "0f2caf528e362f1c1ff0f4bef108da35", "score": "0.59101945", "text": "getBoundingClientRect() {\r\n return {top: 0, left: 0, width: window.innerWidth, height: window.innerHeight};\r\n }", "title": "" }, { "docid": "aedc22a733347b8e2ed5d4142e5c0317", "score": "0.5898519", "text": "get size() {\n return Math.max( Math.abs(this.x), Math.abs(this.y) );\n }", "title": "" }, { "docid": "46b97f5dc1f40a78c987ec0a8c0faf13", "score": "0.5894921", "text": "layout () {\n this.editor.layout({\n width: this._rootRef.clientWidth,\n height: this.props.fontSize\n })\n }", "title": "" }, { "docid": "c279f0f6fa10d7ad16acb54383101ab5", "score": "0.5893166", "text": "getElementOffset() {\n //get position of the element\n let pos = this.elementContainer.getBoundingClientRect();\n\n //get height\n this.elementHeight = pos.height;\n //get offset top\n this.elementTopX = pos.top + window.pageYOffset;\n //get offset bottom\n this.elementBottomX = this.elementHeight + this.elementTopX;\n }", "title": "" }, { "docid": "602e3616109286a351a618af1b0d1444", "score": "0.58905303", "text": "getBoundingClientRect() {\n return {top: 0, left: 0, width: window.innerWidth, height: window.innerHeight};\n }", "title": "" }, { "docid": "4b310c075df859a9ef3d4fdac58881ea", "score": "0.58814687", "text": "resize() {\n this.scrollPosition = width * 0.0625;\n this.x = width * 0.76;\n this.y = height * (2 * this.position + 1) * 0.125 - this.scrollPosition * this.scrollAmount;\n this.width = width * 0.06;\n this.height = width * 0.06;\n this.textX = width * 0.825;\n this.tSize = 15 * scalars.textScalar;\n this.rectX = width * 0.85;\n }", "title": "" }, { "docid": "ab7ee1c80105bcb6efb703b331dd61f6", "score": "0.58801365", "text": "function calcOffsets() {\n screenZoom = width / 1920;\n\tif (height / 1080 < screenZoom) {\n screenZoom = height / 1080;\n\t}\n // zoom = 810 * screenZoom / (GRIDSIZE * CELLSIZE);\n\n xOff = 555 * screenZoom;\n yOff = 135 * screenZoom;\n}", "title": "" }, { "docid": "6be59e3558fd67f2dd95cb67805cc832", "score": "0.5879518", "text": "function yLayout(x) {\n return (x+2) * rowHeight;\n}", "title": "" }, { "docid": "a0143bc50dcf2dd01d9b5a3749e0cfca", "score": "0.5878552", "text": "findHeight() { return 1.5; }", "title": "" }, { "docid": "7f0a14a8ddb0dd2f33657280b18a065b", "score": "0.58725053", "text": "function incSize() {\n w = w * 1.1;\n h = h * 1.1;\n \n return w, h;\n}", "title": "" }, { "docid": "bd49b4c7aa7bc7b663abe9179740652c", "score": "0.58690834", "text": "function markerSize(magnitude){\n return magnitude * 4\n}", "title": "" }, { "docid": "c7ed6d4970134ec84d5bfc773f549d59", "score": "0.58687735", "text": "initPosition() {\n return { top: 0, left: 0 };\n }", "title": "" }, { "docid": "bd9317e68651f4a9ad9d787579b662ef", "score": "0.5868633", "text": "get bounds() {\n return {\n left: this.position.x,\n top: this.position.y,\n right: this.position.x + this.size.x,\n bottom: this.position.y + this.size.y\n };\n }", "title": "" }, { "docid": "358117b2609ec87ee8de20e71bf592aa", "score": "0.5865334", "text": "getDim() {\n return {\n width: this.width,\n height: this.height\n };\n }", "title": "" }, { "docid": "f805fb40aaa40b74d6653b8a1c97cb5a", "score": "0.585204", "text": "getOffset() {\n return { top: 0, left: 0 }\n }", "title": "" }, { "docid": "874eb07b607d9c30aea4d193f767d0d6", "score": "0.58438563", "text": "getBoundingClientRect() {\n return {\n top: 0,\n left: 0,\n width: window.innerWidth,\n height: window.innerHeight\n };\n }", "title": "" }, { "docid": "36616025d8f5001881717c8b5602eb14", "score": "0.58418334", "text": "resize() {\n this.scrollPosition = width * 0.0625;\n this.x = width * 0.76;\n this.y = height * (2 * this.position + 1) * 0.125 - this.scrollPosition * this.scrollAmount;\n this.width = width * this.objImage.width * 0.0002;\n this.height = width * this.objImage.height * 0.0002;\n this.textX = width * 0.825;\n this.tSize = 15 * scalars.textScalar;\n this.rectX = width * 0.85;\n }", "title": "" }, { "docid": "49de627d904e5a447d33baac062b7e76", "score": "0.5837622", "text": "function OverlaySizeConfig() {}", "title": "" }, { "docid": "4a9136b1969e0d239f412f420acdccd5", "score": "0.58367676", "text": "set uvTopLeft(value) {}", "title": "" }, { "docid": "b221e0fc8158dfb59ef542d490890a11", "score": "0.583127", "text": "function OverlaySizeConfig() { }", "title": "" }, { "docid": "b221e0fc8158dfb59ef542d490890a11", "score": "0.583127", "text": "function OverlaySizeConfig() { }", "title": "" }, { "docid": "df01a8f0548c39016a6f6b41dc57c726", "score": "0.5829179", "text": "width(){ return this.element.getBoundingClientRect().width + 10 }", "title": "" }, { "docid": "3a7928c692cc5c95748009c0541fe9dc", "score": "0.58279175", "text": "displaySize() {\r\n this.w = Math.sqrt(this.seq.length, 2) * 50 + 10;\r\n this.h = Math.floor(this.w / 1.55);\r\n }", "title": "" }, { "docid": "25b7ba71f95f2f98454b758f849b6cbf", "score": "0.5827721", "text": "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n }\n else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n }\n else if (this.y > height) {\n this.y -= height;\n }\n }", "title": "" }, { "docid": "a621d39cd1698ba8b461d07c1c206df2", "score": "0.58259666", "text": "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "title": "" }, { "docid": "a621d39cd1698ba8b461d07c1c206df2", "score": "0.58259666", "text": "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "title": "" }, { "docid": "a621d39cd1698ba8b461d07c1c206df2", "score": "0.58259666", "text": "handleWrapping() {\n // Off the left or right\n if (this.x < 0) {\n this.x += width;\n } else if (this.x > width) {\n this.x -= width;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.y += height;\n } else if (this.y > height) {\n this.y -= height;\n }\n }", "title": "" }, { "docid": "4a91ad57f1380fee53fac49f11a1debd", "score": "0.5823491", "text": "data() {\n return {\n unit: 0,\n isHover: false,\n isSelected: false,\n xPosition: 0,\n yPosition: 0,\n width: 16,\n }\n }", "title": "" }, { "docid": "cfd4bfbaefa3493d939c2dfc1d50968b", "score": "0.581", "text": "getCenterOffset() {\n let canvasWidth = this.canvas.width;\n let canvasHeight = this.canvas.height;\n let offset = new geom.Vec2(\n canvasWidth * 0.5,\n canvasHeight * 0.5\n );\n return offset;\n }", "title": "" }, { "docid": "ada3b4d1bed195c229c36e7b28d8c18c", "score": "0.580804", "text": "getPosition() {\n return { top: 0, left: 0 }\n }", "title": "" }, { "docid": "ddddb1569a6939cd3f5d720bd5a0e545", "score": "0.5807322", "text": "getShootingPosition() {\n // right limit\n const x = this.x + this.width;\n // mid section\n const y = this.y + this.height / 2;\n return { x, y };\n }", "title": "" }, { "docid": "17e60153da301773025ae3c3d6f64588", "score": "0.5806955", "text": "getBoundingClientRect() {\n return {\n top: 0,\n left: 0,\n width: window.innerWidth,\n height: window.innerHeight,\n };\n }", "title": "" }, { "docid": "81a572e32538e5f8016e1c3343daa707", "score": "0.5802359", "text": "getBoundingClientRect() {\r\n return {\r\n top: 0,\r\n left: 0,\r\n width: window.innerWidth,\r\n height: window.innerHeight,\r\n };\r\n }", "title": "" }, { "docid": "f8b733fb8bfad965538b07b75a22a95d", "score": "0.5800212", "text": "calculatePadding() {\n return this.grid.scalingFactor * this.padding * 300;\n }", "title": "" }, { "docid": "d081366a8910282450dfa89b1dff9ebc", "score": "0.5799887", "text": "update(newX, newY) {\n this.width = newX - this.anchorPoint.x;\n this.height = newY - this.anchorPoint.y;\n }", "title": "" }, { "docid": "82e19f3877144aa0b72630ca1860acb2", "score": "0.57928145", "text": "function setOffset() {\n let elstate = document.getElementById('sk3');\n let elsket = document.querySelector('#sk2 canvas');\n\n if (!elsket) return;\n\n let coords = elsket.getBoundingClientRect();\n\n elstate.style.left = coords.left + 'px';\n elstate.style.top = coords.top + 'px';\n elstate.style.width = coords.width + 'px';\n elstate.style.height = coords.height + 'px';\n}", "title": "" }, { "docid": "0fb04916d9e8b0c74a22da9f993380fe", "score": "0.5791783", "text": "function offset(_offset) {\r\n newPosition = position + _offset;\r\n if (newPosition <= 0)\r\n newPosition = 1;\r\n else if (newPosition > imagesNoms.length)\r\n newPosition = imagesNoms.length;\r\n return newPosition;\r\n}", "title": "" }, { "docid": "2d8d5ac3a7d52033a014fd4d0795eb69", "score": "0.5791679", "text": "constructor(size, width, height) {\n this.size = size\n this.width = width\n this.height = height\n }", "title": "" }, { "docid": "1e92909cb9369d4a8ec10bc8edfc7b91", "score": "0.5787175", "text": "getBoundingClientRect() {\n return {top: 0, left: 0, width: window.innerWidth, height: window.innerHeight};\n }", "title": "" }, { "docid": "e49f68cffaf358220240ad6837809c6a", "score": "0.57846403", "text": "getWidth(){\n return this._viewport.w;\n }", "title": "" }, { "docid": "0a74408489adab678722d4f3ad1a59dc", "score": "0.5782337", "text": "constructor(x,y,wh) {\n this.x = x;\n this.y = y-(wh*4/20);\n this.wh = wh-(wh*4/20);\n }", "title": "" }, { "docid": "c80f85fa71a16c58fd05c7be99eec665", "score": "0.57758003", "text": "border() {\n this.x = constrain(this.x, 0, width);\n this.y = constrain(this.y, 0, height);\n }", "title": "" }, { "docid": "07c6f0c5d84dfbffc04676ca116f1f42", "score": "0.57581025", "text": "function normalize() {\r\n $e.css({\r\n top: (_top > _bottom ? _bottom : _top) - $local.offset().top,\r\n left: (_left > _right ? _right : _left) - $local.offset().left,\r\n width: Math.abs(_right - _left),\r\n height: Math.abs(_bottom - _top)\r\n });\r\n }", "title": "" }, { "docid": "eb48879abeb1095091dbd9d7a9720cc0", "score": "0.57576466", "text": "getPlatPos(){\n return(this.platPos + houseHeight/2);\n }", "title": "" }, { "docid": "00fbdcddd0065997ad12988ce8e1a15b", "score": "0.5757196", "text": "function confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n }", "title": "" }, { "docid": "00fbdcddd0065997ad12988ce8e1a15b", "score": "0.5757196", "text": "function confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n }", "title": "" }, { "docid": "00fbdcddd0065997ad12988ce8e1a15b", "score": "0.5757196", "text": "function confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n }", "title": "" }, { "docid": "00fbdcddd0065997ad12988ce8e1a15b", "score": "0.5757196", "text": "function confineInContainer(position, width, height, api) {\n var viewWidth = api.getWidth();\n var viewHeight = api.getHeight();\n position[0] = Math.min(position[0] + width, viewWidth) - width;\n position[1] = Math.min(position[1] + height, viewHeight) - height;\n position[0] = Math.max(position[0], 0);\n position[1] = Math.max(position[1], 0);\n }", "title": "" }, { "docid": "2fa93ccc7c76def745165804faece412", "score": "0.5749449", "text": "function pixelPosition(x, y, w) {\n return ((y * w) + x) * 4;\n}", "title": "" }, { "docid": "cd6c8f71d35ceec34ad356f8e390eb29", "score": "0.5745297", "text": "constructor(x,y,w) {\n this.x = x;\n this.y = y+w/8;\n this.w = w*0.9;\n this.animate=true;\n }", "title": "" }, { "docid": "7ac5b588727be1276468d07cb13efda8", "score": "0.5744325", "text": "get adjust() {\n return (size) => {\n return Math.round(size * this.lineHeight / defaultMediumThemeOptions.lineHeight);\n };\n }", "title": "" }, { "docid": "14dc76b980c56ecb27fad95031083223", "score": "0.57440317", "text": "function cLocSize(x, y, W, H) {\n this.x = x !== undefined ? x : 0;\n this.y = y !== undefined ? y : 0;\n this.W = W !== undefined ? W : 0;\n this.H = H !== undefined ? H : 0;\n}", "title": "" } ]
d31d127782906ea7eab577fb5eab4f6d
Allow for dynamic setting of the parent field if we have the store around with values to do so
[ { "docid": "217cb72a6e1492add9745c7500fc93a5", "score": "0.0", "text": "haxsetupActiveElementForm(props) {\n if (window.HAXCMS) {\n const itemManifest = store.getManifestItems(true);\n // default to null parent as the whole site\n var items = [\n {\n text: `Select page`,\n value: null,\n },\n ];\n itemManifest.forEach((el) => {\n if (el.id != this.itemId) {\n // calculate -- depth so it looks like a tree\n let itemBuilder = el;\n // walk back through parent tree\n let distance = \"- \";\n while (itemBuilder && itemBuilder.parent != null) {\n itemBuilder = itemManifest.find((i) => i.id == itemBuilder.parent);\n // double check structure is sound\n if (itemBuilder) {\n distance = \"--\" + distance;\n }\n }\n items.push({\n text: distance + el.title,\n value: el.id,\n });\n }\n });\n props.settings.configure.forEach((attr, index) => {\n if (attr.property === \"uuid\") {\n props.settings.configure[index].inputMethod = \"select\";\n props.settings.configure[index].itemsList = items;\n }\n });\n }\n }", "title": "" } ]
[ { "docid": "dfb0814496f9b73625583c7f3aaefdcd", "score": "0.68088573", "text": "get parentField(){\n return this._parent;\n }", "title": "" }, { "docid": "221924c617d1e38840620b02fc5defea", "score": "0.675967", "text": "set parent(parent) {\n this.properties.parent = parent\n }", "title": "" }, { "docid": "854b0be73c73004e2de8ff77a58e9d45", "score": "0.6255709", "text": "_setField(field, isFull) {\n var allAncestors, ancestors, i, id, index, info, len, parentInfo, prop;\n allAncestors = this._getAncestors(field, isFull);\n ancestors = [];\n for (index = i = 0, len = allAncestors.length; i < len; index = ++i) {\n prop = allAncestors[index];\n if (index === allAncestors.length - 1) {\n this._selectProp(prop, ancestors);\n continue;\n }\n parentInfo = info;\n ancestors.push(prop);\n id = this._getUniqueId(null, ancestors);\n info = this._getSetInfo(id);\n if (parentInfo) {\n parentInfo.properties = parentInfo.properties || {};\n this._set(parentInfo.properties, id, true);\n }\n this._joinProp(id, parentInfo);\n }\n }", "title": "" }, { "docid": "1fb1c0b0843f7c5213c9e86b846b15fe", "score": "0.61529624", "text": "function updateParentModel() {\n if ($scope.containerModel.language == undefined) {\n modelSetter($scope.$parent, undefined);\n } else {\n modelSetter($scope.$parent, $scope.containerModel.language.tag);\n }\n }", "title": "" }, { "docid": "c28f232acd45169d7947c2cb05936f0d", "score": "0.6043154", "text": "get parent() {\n return this.properties.parent\n }", "title": "" }, { "docid": "e373b4b179100407436aa75cd8b5e8b2", "score": "0.60047394", "text": "get parent_id() {return this.artefact.compartment_id;}", "title": "" }, { "docid": "6e3ed0f9e8b1b63f665a432a407ef0b4", "score": "0.59667027", "text": "function setValueParent(id, value) {\n\tobj = window.parent.document.getElementById(id);\n\tif (obj) {\n\t\tobj.value = value;\n\t}\n\n}", "title": "" }, { "docid": "fcaa2594b52645b34c77b1032e6ba2c4", "score": "0.5945151", "text": "handleChange(parent, event) {\n this.setValueFromType(parent, event.target.value);\n }", "title": "" }, { "docid": "d2a841e4750ff972b0cd5a47f8b83207", "score": "0.58176917", "text": "get parent() {\n const t = this.qn.q();\n return t.L() ? null : new oe(this.firestore, \n /* converter= */ null, new z(t));\n }", "title": "" }, { "docid": "0475a87d9c8f966f4c57b47154a46321", "score": "0.57693", "text": "function setCidparent() {\r\n\tvar cidparentInput = jQuery('.cid-search input[name=\"cidparent\"]');\r\n\tvar parentId = jQuery(this).attr('data-parent-category-id');\r\n\tif(cidparentInput.length == 0) {\r\n\t\tjQuery('.cid-search form').append('<input name=\"cidparent\" type=\"hidden\" value=\"' + parentId + '\">');\r\n\t} else {\r\n\t\tcidparentInput.attr('value', parentId);\r\n\t}\r\n}", "title": "" }, { "docid": "b59f19fd72534110e478c985c8ccf8d0", "score": "0.5768068", "text": "setParent(_parent) {\n this.parent = _parent;\n }", "title": "" }, { "docid": "c2a6c9a56d6915a0f8900c3a1df44ab9", "score": "0.5750292", "text": "set parent(value) {\n this._parent = value;\n this.element.detach().appendTo(value.element);\n }", "title": "" }, { "docid": "bfe7d759b65c8855a06a7746d1df4513", "score": "0.5726848", "text": "function setSettingId() {\n \n var a = $('#t_ParentID').val()\n // alert($('#' + a).val());\n if (a != null) {\n $('#n_SettingID').val($('#' + a).val());\n console.log(a, $('#' + a).val(), $('#n_SettingID').val());\n }\n}", "title": "" }, { "docid": "7130f19c999b5d5f8a97b46516f983fb", "score": "0.5726078", "text": "didSetAtomicParent() {}", "title": "" }, { "docid": "d642018c53e70f692afab969cd203484", "score": "0.57098013", "text": "function update_parent(data, parent_id) {\n //alert(dump(data));\n //return;\n\n var obj_id = data.obj_id || data.id;\n var descriptor = data.obj_descriptor || data.name; // todo: make generic\n\n var $parent = $('#' + parent_id);\n var $parent_text = $('#' + parent_id + '_textbox');\n if ($parent.is('select')) { // select box\n $parent.\n append($(\"<option></option>\").\n attr(\"value\",obj_id).\n text(descriptor));\n $parent.val(obj_id);\n // alert(parent_id + \" is select box\");\n } else if ($parent_text.length && $parent_text) { // ajax chooser: todo, check for in\n //alert('new ajax_chooser');\n $parent.val(obj_id);\n $parent_text.val(descriptor);\n } else if ($parent.length) { // some - div info text field\n // alert('writing' + responseText + ' to ' + parent_id);\n $parent.html(responseText);\n } else {\n alert('??');\n $parent.val(obj_id);\n }\n}", "title": "" }, { "docid": "a07007af7b9c5f924c2148c7f631e838", "score": "0.5674238", "text": "function setValue(parent, obj, propToUse, prop, value, isNotToHistorize) {\n if (isInteger(Number(propToUse)) && Array.isArray(parent)) {\n obj = parent;\n }\n\n if (!getBool(isNotToHistorize)) {\n historizeOperation(SET, prop, obj[propToUse], value);\n }\n\n obj[propToUse] = value;\n }", "title": "" }, { "docid": "edfc9b2bde6bb5ca7e08d9d103e6aa1b", "score": "0.56474686", "text": "_createParent (obj, type, len) {\n this._parents[this._depth] = {\n type: type,\n length: len,\n ref: obj,\n values: 0,\n tmpKey: null\n }\n }", "title": "" }, { "docid": "edfc9b2bde6bb5ca7e08d9d103e6aa1b", "score": "0.56474686", "text": "_createParent (obj, type, len) {\n this._parents[this._depth] = {\n type: type,\n length: len,\n ref: obj,\n values: 0,\n tmpKey: null\n }\n }", "title": "" }, { "docid": "edfc9b2bde6bb5ca7e08d9d103e6aa1b", "score": "0.56474686", "text": "_createParent (obj, type, len) {\n this._parents[this._depth] = {\n type: type,\n length: len,\n ref: obj,\n values: 0,\n tmpKey: null\n }\n }", "title": "" }, { "docid": "edfc9b2bde6bb5ca7e08d9d103e6aa1b", "score": "0.56474686", "text": "_createParent (obj, type, len) {\n this._parents[this._depth] = {\n type: type,\n length: len,\n ref: obj,\n values: 0,\n tmpKey: null\n }\n }", "title": "" }, { "docid": "8ad8529ace71cfcdd35784ca693aad70", "score": "0.5638965", "text": "_createParent(obj, type, len) {\n this._parents[this._depth] = {\n type: type,\n length: len,\n ref: obj,\n values: 0,\n tmpKey: null\n };\n }", "title": "" }, { "docid": "8ad8529ace71cfcdd35784ca693aad70", "score": "0.5638965", "text": "_createParent(obj, type, len) {\n this._parents[this._depth] = {\n type: type,\n length: len,\n ref: obj,\n values: 0,\n tmpKey: null\n };\n }", "title": "" }, { "docid": "316322fc96655bb44755ea6af66a75e3", "score": "0.5575904", "text": "function _assignModelToParent() {\n if (scope.$parent.$parent.ngModel) {\n scope.$parent.$parent.ngModel = modelCtrl;\n } else if (scope.$parent.$parent.$parent.ngModel) {\n scope.$parent.$parent.$parent.ngModel = modelCtrl;\n } else if (scope.$parent.$parent.$parent.$parent.ngModel) {\n scope.$parent.$parent.$parent.$parent.ngModel = modelCtrl;\n } else {\n console.error('ngModel from fieldBox is not found even at 3rd level, custom.validator:215', scope)\n }\n // modelCtrl.$setDirty();\n // if (scope.$parent.$parent.listnerFromValidText) {\n // scope.$parent.$parent.listnerFromValidText(modelCtrl)\n // }\n // scope.$parent.$parent.ngModel = modelCtrl;\n\n // console.log('from validText', newVal, scope.$parent.$parent.ngModel)\n\n //sending change event to controller, if assigned\n if (modelCtrl.$viewValue) {\n if (scope.$parent.$parent.fbOnChange) {\n scope.$parent.$parent.fbOnChange({\n event: event,\n element: element,\n modelCtrl: modelCtrl,\n column: column\n })\n } else if (scope.$parent.$parent.$parent.fbOnChange) {\n scope.$parent.$parent.$parent.fbOnChange({\n event: event,\n element: element,\n modelCtrl: modelCtrl,\n column: column\n })\n } else if (scope.$parent.$parent.$parent.$parent.fbOnChange) {\n scope.$parent.$parent.$parent.$parent.fbOnChange({\n event: event,\n element: element,\n modelCtrl: modelCtrl,\n column: column\n })\n }\n }\n }", "title": "" }, { "docid": "ecbc2826b687e1c60feafc1d4f37339e", "score": "0.5548933", "text": "get parent() {\n return new ce(this.firestore, this.Sn, this.xn.path.q());\n }", "title": "" }, { "docid": "091d4472b463a6f5a046b38f5d706c2d", "score": "0.5546636", "text": "function ManageParents(obj) {\n var parentObj = $jQuery('[fieldIndex=\"' + $jQuery(obj).parent(\"span\").attr(\"parent\") + '\"] input');\n\n if (parentObj != undefined && parentObj != null && parentObj.length > 0) {\n parentObj.prop('checked', true);\n ManageParents(parentObj);\n }\n}", "title": "" }, { "docid": "b1c5cb8110ffbcf312738b8889939c3f", "score": "0.5535557", "text": "get parent () {\n return this._parent\n }", "title": "" }, { "docid": "5a7dd60158a0f5e53468ddf2ae970f9b", "score": "0.5519589", "text": "setParent(parent) {\n this.parent = parent;\n }", "title": "" }, { "docid": "306d36b3103d51601bc169ac289beac1", "score": "0.5507937", "text": "get parent() {\n return this._parent\n }", "title": "" }, { "docid": "ff232fea51eb435221688732334987b4", "score": "0.5495306", "text": "setPosFromParentRecords() {\n \n if ( this.getUIParent() && this.getUIParent().childrenPos[ this.id ] ) {\n\n this.position.x = ( this.getUIParent().childrenPos[ this.id ].x );\n this.position.y = ( this.getUIParent().childrenPos[ this.id ].y );\n\n }\n\n }", "title": "" }, { "docid": "ba5bc93da539420cc03108cf9296f57e", "score": "0.54952437", "text": "function setParentAccount(account) {\n $(form_input_ids[2]).val(account.account_code);\n}", "title": "" }, { "docid": "555927f21c052ad4e4d974f654077b47", "score": "0.54871094", "text": "function setParentId(sketchComponet, parent) {\n sketchComponet.parentID = parent.id;\n}", "title": "" }, { "docid": "d7052c954481694d18930ac986ac2e83", "score": "0.5472529", "text": "assign(parent, path) {\n this.data.parentUrl = parent.data.url;\n this.data.url = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"combine\"])(this.data.parentUrl, path || \"\");\n this.configureFrom(parent);\n }", "title": "" }, { "docid": "1b1a7896c3adc309a7a25265c1dab15b", "score": "0.54701304", "text": "function selectedParentCategory(parent) {\n if(parent) {\n if (typeof parent.originalObject === 'object') {\n vm.categoryForm.parentId = parent.originalObject.id;\n } else{\n vm.categoryForm.parentId = '';\n }\n } else {\n vm.categoryForm.parentId = '';\n }\n }", "title": "" }, { "docid": "df3762046dba2f6d337201c2bbda658f", "score": "0.545322", "text": "get parent() {\n return _(this).parent;\n }", "title": "" }, { "docid": "1bad06c356b7ea96c41fa9770f36a44e", "score": "0.54317737", "text": "get parent() {\n const t = this.D_.G();\n return t.Y() ? null : new Yc$1(this.firestore, \n /* converter= */ null, new tt(t));\n }", "title": "" }, { "docid": "382395a287e001c4fb48327fc8cb4e46", "score": "0.5426915", "text": "addValue(entity, child) {\n if (child.name) {\n const value = child.value;\n if (value !== void 0) {\n entity[child.name] = value;\n }\n }\n }", "title": "" }, { "docid": "faf307c62547176d525164991d4de734", "score": "0.5421324", "text": "function getParent()/*:ValueExpression*/ {\n return null;\n }", "title": "" }, { "docid": "b14c315d2217856a10c85c9389c4966b", "score": "0.5418695", "text": "function subrecord_setDereferencedFromParent(dereferencedFromParent)\n\t\t\t{\n\t\t\t\tsubrecordIsDereferencedFromParent = dereferencedFromParent;\n\t\t\t\tif (dereferencedFromParent)\n\t\t\t\t{\n\t\t\t\t\tsubrecord_abandon();\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "7a408883ec1e60050ed9b0616c843bf5", "score": "0.54077125", "text": "set parent(parent) {\n this._parent = parent;\n\n if (parent) {\n parent.addChild(this);\n }\n }", "title": "" }, { "docid": "d872d96699635618e741f85d4b58de54", "score": "0.5407248", "text": "function setParentOptionFR(parentOption) {\n\tthis.parentOption = parentOption;\n}", "title": "" }, { "docid": "fe4efbfbacdbbe8d28bc8f4f0a04f2f2", "score": "0.5391526", "text": "loadOwnProperties(){\r\n//\t\tdebugger;\r\n\t\tsuper.loadOwnProperties();\r\n//\t\tdebugger;\r\n\t\tvar self=this;\r\n\t\t\r\n\t\tself.autoAddPostHtml=false;\r\n\t\tself.subType=self.getAttrVal(\"subtype\").trim().toLowerCase();\r\n\t\t\r\n/*\t\tif (self.subType.toLowerCase()==\"row\"){\r\n\t\t\tself.postProcess=\"false\";\r\n\t\t}\r\n*/\t\t\r\n\t\t//debugger;\r\n\t\tself.rowPrePendHtml=\"\";\r\n\t\tself.counter=0;\r\n\t\tself.parentId=\"\";\r\n\t\tself.childId=\"\";\r\n\t\tself.recursive=self.getAttrVal(\"recursive\");\r\n\t\tself.bAllRoots=false;\r\n\t\tself.rootBackup;\r\n\t}", "title": "" }, { "docid": "ab30d9547199d93f6afc5c6514207dc7", "score": "0.5374879", "text": "get getParent() {\n return this._parent\n }", "title": "" }, { "docid": "b7f58eb34975d4e642254d9749ad2c1f", "score": "0.5371595", "text": "function setParent(){\n\t$.parentPin.show();\n\tif(currentUser == 'parent' || settings.parentPin == null){\n\t\t\tcurrentUser = 'parent';\n\t\t\tshowParent();\n\t}else{\n\t\tif($.parentPin.value == settings.parentPin){\n\t\t\tshowParent();\n\t\t\tcurrentUser = 'parent';\n\t\t} \n\t}\n\t\n}", "title": "" }, { "docid": "c7bacb9d8fd5f498aaaf01bef9156d4c", "score": "0.53611016", "text": "_initValue(id, row, model, tasks) {\n var childIdProp, childModel, childProp, info, prop, propClassName, value;\n info = this._getInfo(id);\n value = row[info.field];\n prop = info.attribute;\n // if value is null, no futher processing is needed\n // if Property has no sub-elements, no futher processing is needed\n if (value === null || !info.hasOwnProperty('className')) {\n this._setValue(model, prop, value, info);\n return model;\n }\n propClassName = info.className;\n childModel = this._getValue(model, prop);\n if (childModel === null || 'object' !== typeof childModel) {\n childModel = this._create(propClassName);\n this._setValue(model, prop, childModel, info);\n }\n if (info.hasOwnProperty('hasJoin')) {\n// this row contains needed data\n// init prop model with this row\n for (childProp in info.properties) {\n this._initValue(childProp, row, childModel, tasks);\n }\n // id is null, it means that value is null\n childIdProp = this.manager.getIdName(propClassName);\n if (null === this._getValue(childModel, childIdProp)) {\n this._setValue(model, prop, null, info);\n }\n } else {\n // a new request is needed to get properties value\n // that avoids stack overflow in case of \"circular\" reference with a property\n tasks.push({\n className: propClassName,\n options: {\n type: this.options.type,\n models: [childModel],\n // for nested element, value is the id\n where: STATIC.FIELD_CHAR_BEGIN + this.manager.getIdName(propClassName) + STATIC.FIELD_CHAR_END + ' = ' + value,\n // expect only one result. limit 2 is for unique checking without returning all rows\n limit: 2\n }\n });\n }\n return model;\n }", "title": "" }, { "docid": "effec6c287ec9cb9b395692bc4a12cc3", "score": "0.53372806", "text": "function data(key, value) {\n\t if (value !== undefined) {\n\t state.ownData[key] = value;\n\t return state;\n\t }\n\t\n\t var currentState = state;\n\t\n\t while (currentState.ownData[key] === undefined && currentState.parent) {\n\t currentState = currentState.parent;\n\t }return currentState.ownData[key];\n\t }", "title": "" }, { "docid": "10e0144beb984fe9ced29596de5da51b", "score": "0.5335302", "text": "function addCommonParent (trackerObj, parentName) {\n trackerObj.parentCompany = parentName\n trackerObj.block = false\n trackerObj.reason = 'first party'\n return trackerObj\n}", "title": "" }, { "docid": "f656a3aef2c8d40de3e48d187e3a661a", "score": "0.5319355", "text": "set value(value) {\n\t\tthis._value = value;\n\t\tthis.valueSetter(value);\n\t\tif (value !== '') {\n\t\t\tif (this.parent === null) {\n\t\t\t\t// If the menu is standalone\n\t\t\t\tthis.change.next(null);\n\t\t\t} else {\n\t\t\t\t// cascade the value\n\t\t\t\tthis.parent.value = value;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "d9209fccedcab116a3cab328b81e1e94", "score": "0.5314816", "text": "get multiple() { return this._parent && this._parent.multiple; }", "title": "" }, { "docid": "b278ef9ea2efd99fd2d95dddc6187bd1", "score": "0.5305195", "text": "set value(value) {\n for (const child of this.children) {\n if (child.unwind) {\n child.value = value;\n }\n else {\n const name = child.name;\n if (value instanceof Object && value[name] !== void 0) {\n child.value = value[name];\n }\n }\n }\n }", "title": "" }, { "docid": "eafbb7b8e1aff9dcd6edbda7bc2ab2cd", "score": "0.5303485", "text": "addCommonParent (trackerObj, parentName) {\n trackerObj.parentCompany = parentName\n trackerObj.block = false\n trackerObj.reason = 'first party'\n return trackerObj\n }", "title": "" }, { "docid": "d959ac9e2d41f81b415e7baac2de6f7a", "score": "0.5287607", "text": "onParentModelChanged(parentModel) {\n this.setState({\n parentModel: parentModel\n })\n }", "title": "" }, { "docid": "4e5b8c9b8d3c22f16ed1ecc2068fed7f", "score": "0.5287367", "text": "get parentItem() {\n return getParentItem(this.rootItem, this.dataPath, true) || null\n }", "title": "" }, { "docid": "ec212e76157ca2fef632555a87b7992c", "score": "0.5287353", "text": "get parent() {\n return this._parent;\n }", "title": "" }, { "docid": "9a3971e3b07059004e5512b0834e6fa7", "score": "0.5280698", "text": "get parent() {\n return new Ac(this.firestore, this.converter, this._key.path.popLast());\n }", "title": "" }, { "docid": "08c66c47287b40ac8b0ff084055d6f65", "score": "0.5266111", "text": "get parent() {\r\n\t return new CollectionReference(this.firestore, this.converter, this._key.path.popLast());\r\n\t }", "title": "" }, { "docid": "a71992f6d82b8858ea9a70b704db4239", "score": "0.5265648", "text": "_dataChanged(data){const items=[];if(!data)return;// find parents\ndata.forEach(element=>{// find top level parents\nif(!element.parent){items.push(element)}});// Recursively find and set children\nitems.forEach((item,i)=>{this._setChildren(item,data)});// Update items array\nthis.set(\"items\",[]);this.set(\"items\",items)}", "title": "" }, { "docid": "061c635eeafa707c531d1c1e7a41bc60", "score": "0.526316", "text": "function newParentDomainFieldBindings($this){\n var selector = thisInstance.constants.selector;\n $this.find(selector.removeDomainAnchor).on(\"click\", function(event){\n $(this).closest(selector.newDomainDiv).remove();\n });\n\n $this.find(selector.newDomainField).on(\"input\", function(){\n $(this).closest(selector.newDomainDiv).removeClass(\"error-wrap\");\n });\n }", "title": "" }, { "docid": "96ba63b8ab98355f75ba9cc634042ede", "score": "0.5258264", "text": "static makeProperties(dataNode, parent, props) {\n if (!parent) {\n return {\n refId: dataNode.refId,\n rootDataNode: dataNode,\n };\n }\n else {\n return null;\n }\n }", "title": "" }, { "docid": "b3610ba2a0b04c8917b29e686b9dd52e", "score": "0.523496", "text": "get parent() {\n return this._parent;\n }", "title": "" }, { "docid": "2ff678269c65cd8c76e27f9b1eaf583e", "score": "0.5231209", "text": "constructor(record = {}, parent = null) {\n this.record = record;\n this.parent = parent;\n }", "title": "" }, { "docid": "f9441520546494fbdabc0b77e4ed611c", "score": "0.52195615", "text": "function colocaValueField(nodo){\r\n\t\t\tif (objParent.findParentByType('form'))\r\n\t\t\t\tvar formCombo = objParent.findParentByType('form');\r\n\t\t\tif(formCombo){\r\n\t\t\t\tif (formCombo.getComponent(objParent.valueField) && formCombo.getComponent(objParent.valueField).isXType('hidden')){\r\n\t\t\t\t\tformCombo.getComponent(objParent.valueField).setValue(nodo.id);\r\n\t\t\t\t\t//console.info(formCombo.getComponent(objParent.valueField));\r\n\t\t\t\t\tobjParent.nodoSelected = nodo;\r\n\t\t\t\t} else if (formCombo){ formCombo.insert(0,{xtype:'hidden',id:objParent.valueField}).setValue(nodo.id);formCombo.doLayout();}\r\n\t\t\t}else{\r\n\t\t\t objParent.nodoSelected = nodo;\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "2bc7f7368c1b584120d0302822577bd2", "score": "0.52163905", "text": "saveInitialValue() {\n const { formId, attribute, submodelPath, value, options } = ownProps\n const initialValue = value || (options[0] && options[0].value)\n\n dispatchProps.dispatch(\n updateAction(formId, attribute, submodelPath, initialValue)\n )\n }", "title": "" }, { "docid": "a101d8fc7925ca93883421284f046e63", "score": "0.51933557", "text": "set parent(parent) {\n this._parent = parent;\n if (parent) {\n parent.addChild(this);\n }\n }", "title": "" }, { "docid": "9b426c01a313095490b1f2589449b27c", "score": "0.5192824", "text": "componentDidUpdate(prevProps) {\n const { choices, form } = this.props\n if (this._hasDynamicChoices(choices)) {\n const newParentVal = form.values[choices.parentField]\n const prevParentVal = prevProps.form.values[choices.parentField]\n if (newParentVal !== prevParentVal) {\n this._setDynamicChoiceFieldValue(newParentVal)\n }\n }\n }", "title": "" }, { "docid": "dd9e49c016c95bf9668ed54c02d240a6", "score": "0.51846415", "text": "function appendParent(parent) {\n $(document).on('ajax:success', function () {\n $('#section_parent_id').val(parent);\n });\n}", "title": "" }, { "docid": "a70ab81cbb89f6f943b77b970d690d66", "score": "0.51778805", "text": "function parent_page_field(node){\n return find_property(node, \"parent_page\");\n}", "title": "" }, { "docid": "5d3cd05f094107dd86a22382e3d1b283", "score": "0.51715523", "text": "newMessage(value) {\n if (this.parent && this.parent.hasInnerField) {\n this.parent.newMessage = value;\n }\n }", "title": "" }, { "docid": "056308fbd5cd875bbfcfc552673abacc", "score": "0.51662827", "text": "childOnChange(name, value) {\n const { updateField, formName } = this.props;\n updateField({ formName, name, value });\n this.setState({fresh: false})\n this.isValid();\n }", "title": "" }, { "docid": "aa6d8067e435e356d3895500c870f363", "score": "0.51636726", "text": "get parent() {\n const t = this._path.popLast();\n return t.isEmpty() ? null : new Tc(this.firestore, \n /* converter= */ null, new bt(t));\n }", "title": "" }, { "docid": "731155bc36a61f23b15e32b13f84e40c", "score": "0.51473093", "text": "get parent() {\n return this.id.substring(LEN, this.id.lastIndexOf('/', this.id.length - 2));\n }", "title": "" }, { "docid": "d2eb365c8bce15d421959b36753d761b", "score": "0.5146848", "text": "function update_parent_node_data(error) {\n if(error) {\n callback(error);\n } else {\n parentNodeData[name] = new DirectoryEntry(node.id, mode);\n context.putObject(parentNode.data, parentNodeData, update_time);\n }\n }", "title": "" }, { "docid": "d2eb365c8bce15d421959b36753d761b", "score": "0.5146848", "text": "function update_parent_node_data(error) {\n if(error) {\n callback(error);\n } else {\n parentNodeData[name] = new DirectoryEntry(node.id, mode);\n context.putObject(parentNode.data, parentNodeData, update_time);\n }\n }", "title": "" }, { "docid": "e143abd3630ce45292b0d9beb189bd3c", "score": "0.51434857", "text": "static makeProperties(dataNode, parent, props) {\n if (parent) {\n // NOTE: `value` is already in `props`, and has been computed by a call to `constructVersionedValueSnapshot`\n // const { value, hasValue } = dataNode;\n return {\n // value: hasValue ? value : undefined,\n // rootDataNode: dataNode\n };\n }\n else {\n const { value, hasValue } = dataNode;\n return {\n value: hasValue ? value : undefined,\n // dataNode\n };\n }\n }", "title": "" }, { "docid": "d21ff8173dca921d3cf6a4cb5b75a1b6", "score": "0.51379097", "text": "constructor(parent) {\n super(parent);\n this.value = '';\n }", "title": "" }, { "docid": "4081c4be2777fa72d66d7dd4c44deda7", "score": "0.51363313", "text": "insertRecParent(parent) {\n\t\tconst stmt = this.db.prepare(\n\t\t\t`INSERT INTO PG1_RECIPIENT_PARENT (\n\t\trecipient_parent_name\n\t\t\t) VALUES(?)`\n\t\t);\n\n\t\tconst insert = this.db.transaction((parent)=>{\n\t\t\ttry{\n\t\t\t\tstmt.run(\n\t\t\t\t\tparent.name\n\t\t\t\t);\n\t\t\t}catch(err){\n\t\t\t\t \n\t\t\t}\n\t\t});\n\n\t\tinsert(parent);\n\t}", "title": "" }, { "docid": "1a5f14977b63ee3877d1c08ab1bf69aa", "score": "0.51340055", "text": "get parent() {\n return this._parent;\n }", "title": "" }, { "docid": "1a5f14977b63ee3877d1c08ab1bf69aa", "score": "0.51340055", "text": "get parent() {\n return this._parent;\n }", "title": "" }, { "docid": "f35f8a6bc61539b2d41f091b0be69980", "score": "0.5132703", "text": "function setParentOptionFS(parentOption) {\n\tthis.parentOption = parentOption;\n\tthis.setLevel();\n}", "title": "" }, { "docid": "59c633bc717a0e56c79042ab505e8682", "score": "0.5122164", "text": "setParent(v){\n this.node.setParent(v);\n }", "title": "" }, { "docid": "bc1aad29791114197e357a12e8ce1b72", "score": "0.51210505", "text": "function selectedParentCategory(parent) {\n if(parent) {\n if (typeof parent.originalObject === 'object') {\n vm.skillForm.parentCategoryId = parent.originalObject.id;\n //getSubCategories(vm.skillForm.parentCategoryId);\n } else{\n vm.skillForm.parentCategoryId = '';\n }\n } else {\n vm.skillForm.parentCategoryId = '';\n }\n }", "title": "" }, { "docid": "5afc4f94cf465e287436d4f9611e46d3", "score": "0.5117001", "text": "function process(key, value, parent) {\n if (typeof value == \"string\") {\n console.log(key + \" : \" + value);\n parent[key] = decode_shortcode(value);\n }\n}", "title": "" }, { "docid": "6e216ffe3268c8abcd9f77cb8ee95c80", "score": "0.5110012", "text": "function ManageParentAndChildren(obj) {\n var parentObj = $jQuery('[fieldIndex=\"' + $jQuery(obj).parent(\"span\").attr(\"parent\") + '\"] input');\n\n //If package node is checked true then, checked its children.\n if (parentObj.length == 0) {\n $jQuery(\"[id$=hdnPackageNode]\")[0].value = obj.alt;\n $jQuery(\"[id$=\" + this.theForm.id + \"]\").submit();\n }\n else {\n //If child node is checked true then, checked its parent.\n ManageParents(obj);\n }\n}", "title": "" }, { "docid": "da9a2bf4c086617e2f9ad3b53be5f833", "score": "0.510962", "text": "function setParentSelectFSO(parentSelect) {\n\tthis.parentSelect = parentSelect;\n}", "title": "" }, { "docid": "ff2af3676ccfbf676da6871d4f65a8df", "score": "0.5086604", "text": "componentDidMount() {\n const { choices, form } = this.props\n if (this._hasDynamicChoices(choices)) {\n this._setDynamicChoiceFieldValue(form.values[choices.parentField])\n }\n }", "title": "" }, { "docid": "c3057dd0ad0bb2167a001dd7de176c0e", "score": "0.5076871", "text": "function selectedParentCategory(parent) {\n if (parent) {\n if (typeof parent.originalObject === 'object') {\n vm.subjectForm.parentCategoryId = parent.originalObject.id;\n //getSubCategories(vm.subjectForm.parentCategoryId);\n } else {\n vm.subjectForm.parentCategoryId = '';\n }\n } else {\n vm.subjectForm.parentCategoryId = '';\n }\n }", "title": "" }, { "docid": "35c35927be30d85f8789ebd5ca4701ba", "score": "0.5072511", "text": "get _transmit_value(){// a required field needs a special treatment --> required path\nif(this._constraints&&this._constraints.required&&\"true\"===this._constraints.required.is){return this._required_value}if(this._meta&&!this._meta.readonly){if(0<this.__childNodes.length){this.__value={};// nur reine Daten zurück geben\nfor(let index in this.__childNodes){let field=this.__childNodes[index],val;if(this._constraints&&this._constraints.required&&\"true\"===this._constraints.required.is){val=this._required_value}else{val=field._transmit_value}if(val!==void 0){this.__value[field._name]=val}}}return this.__value}else{return void 0}}", "title": "" }, { "docid": "e9e63e2c918b6ff15a91f81f5e989128", "score": "0.50724196", "text": "get parentId() { return this._parentId;}", "title": "" }, { "docid": "67c7f652cc5d991b50fc17329670904f", "score": "0.5069343", "text": "function setParent() {\n var parent = $(settings.parent);\n var table = $(settings.table);\n\n parent.append(table);\n parent.css({\n 'overflow-x': 'auto',\n 'overflow-y': 'auto'\n });\n\n parent.scroll(function () {\n var scrollWidth = parent[0].scrollWidth;\n var clientWidth = parent[0].clientWidth;\n var left = parent.scrollLeft();\n\n if (settings.right > 0)\n settings.rightColumns.css(\"right\", scrollWidth - clientWidth - left);\n }.bind(table));\n }", "title": "" }, { "docid": "de38fabcfd60f4e1e64f08d1a64219cd", "score": "0.50628376", "text": "function onChangeParent() {\n\t var _this = this;\n\n\t var parentOption = this.parent.options[this.parent.selectedIndex];\n\n\t // show the child options that are dependent on the\n\t // current selected parent option\n\t this._showChildOptions(function (childOption) {\n\t if (childOption.value === '') return true;\n\t if (parentOption.value === '') return true;\n\t if (_this.childOptionIsDependentOnParentOption(childOption, parentOption)) {\n\t return true;\n\t }\n\n\t return false;\n\t });\n\t}", "title": "" }, { "docid": "0885926799f7a068c6cd0d659cefd742", "score": "0.5062821", "text": "get owner() {\n return this.parent;\n }", "title": "" }, { "docid": "45b160a796eff6732e0e3f2820e6a733", "score": "0.5058033", "text": "_populateField(name, value) {\n if (!this.$schema.strict) {\n this[name] = value;\n } else {\n let names = (0, _keys2.default)(this.$schema.fields);\n let exists = names.indexOf(name) > -1;\n\n if (exists) {\n this[name] = value;\n }\n }\n }", "title": "" }, { "docid": "2d24f37314289fefe4889eda4c4c9ef7", "score": "0.5051383", "text": "function setParentOptionFIT(parentOption) {\n\tthis.parentOption = parentOption;\n}", "title": "" }, { "docid": "61447dcb6f10253bf3a7e75002b73ad7", "score": "0.5045396", "text": "function updateParentCheckbox($label) {\n\t\tif (!$label || $label.length == 0) return;\n\n\t\tvar myState = false;\n\t\t$label.closest('li').find('ul input[type=checkbox]').each(function(index, el){\n\t\t\tif (el.checked) myState = true;\n\t\t});\n\n\t\t$label.children('input')[0].checked = myState;\n\n\t\tif ($label.data('parent')) {\n\t\t\tupdateParentCheckbox(\n\t\t\t\t$this.closest('.facet-checkbox').find('label[data-value='+$label.data('parent')+']')\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "abf1ef1958e7ee07bb5cf0bfd542c281", "score": "0.50331324", "text": "prepareChild (props) {\n var defaultProps = {\n type: 'object',\n properties: props\n }\n this.prepareRequiredFields(defaultProps)\n this.prepareDefaultFields(defaultProps)\n return Object.assign(defaultProps, this.options)\n }", "title": "" }, { "docid": "aa25e9d33dcec76cc08d67be38599ba8", "score": "0.5031421", "text": "_fixupParents() {\n this.element.find(`tbody tr[${ATTR.fixedParent}]`).attr(ATTR.parent, function () {\n return this.getAttribute(ATTR.fixedParent);\n });\n }", "title": "" }, { "docid": "4f36b9e1296ac13f8a9ba3505690e838", "score": "0.50275815", "text": "newField(model) {\n const currentFields = model.get('fields');\n\n currentFields.then((data) => {\n const newField = this.store.createRecord('tsygan@spacedog-schemafield', {\n parentModel: model,\n type: 'string',\n dirty: true\n });\n\n data.addObject(newField);\n });\n }", "title": "" }, { "docid": "26d75baa3d11ebcf82a95cfef4909c25", "score": "0.50273967", "text": "function parentData(dataFromChild) {\n // alert(dataFromChild);\n alert(dataFromChild.name)\n console.log(dataFromChild)\n }", "title": "" }, { "docid": "11c5e978988fea57ef666f6ba34a78f6", "score": "0.50266606", "text": "function deepCTX(setcb, changes, parent, val) {\n\t\tif (Array.isArray(val))\n\t\t\tfor (let i = 0; i < val.length; i++) {\n\t\t\t\tconst deepkey = parent ? `${parent}.${i}` : ''+i\n\t\t\t\tval[i] = deepCTX(setcb, changes, deepkey, val[i])\n\t\t\t}\n\t\telse if (val && typeof val === 'object')\n\t\t\tObject.keys(val).forEach(function(k) {\n\t\t\t\tconst deepkey = parent ? `${parent}.${k}` : k\n\t\t\t\tval[k] = deepCTX(setcb, changes, deepkey, val[k])\n\t\t\t})\n\t\telse return val\n\t\t// transparent proxy with set trap on objects/arrays\n\t\treturn new Proxy(val, {\n\t\t\tset: (target, key, value, receiver) => {\n\t\t\t\tDEBUG_TRAPS && console.log('set', target, key, value, receiver)\n\t\t\t\tconst deepkey = parent ? `${parent}.${key}` : key\n\t\t\t\t// todo: handle arrays better\n\t\t\t\tif (setcb()) changes.push(deepkey)\n\t\t\t\ttarget[key] = deepCTX(setcb, changes, deepkey, value)\n\t\t\t\treturn true // indicate assignment succeeded\n\t\t\t},\n\t\t\tdeleteProperty: (target, key) => {\n\t\t\t\tDEBUG_TRAPS && console.log('delete', target, key)\n\t\t\t\t// todo; array manipulations and delete\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "bd1dde28ecf126314f2bfa7d1f886d98", "score": "0.50221246", "text": "transformParentType({ fieldNode, parentType, parentTypeSignature, }) {\n if (this.enabled &&\n Object(graphql__WEBPACK_IMPORTED_MODULE_1__[\"isObjectType\"])(parentType) &&\n isFederationObjectType(parentType) &&\n (isTypeExtension(parentType) || fieldNode.name.value === resolveReferenceFieldName)) {\n const keys = getDirectivesByName('key', parentType);\n if (keys.length) {\n const outputs = [`{ __typename: '${parentType.name}' } &`];\n // Look for @requires and see what the service needs and gets\n const requires = getDirectivesByName('requires', fieldNode).map(this.extractKeyOrRequiresFieldSet);\n const requiredFields = this.translateFieldSet(Object(lodash__WEBPACK_IMPORTED_MODULE_2__[\"merge\"])({}, ...requires), parentTypeSignature);\n // @key() @key() - \"primary keys\" in Federation\n const primaryKeys = keys.map(def => {\n const fields = this.extractKeyOrRequiresFieldSet(def);\n return this.translateFieldSet(fields, parentTypeSignature);\n });\n const [open, close] = primaryKeys.length > 1 ? ['(', ')'] : ['', ''];\n outputs.push([open, primaryKeys.join(' | '), close].join(''));\n // include required fields\n if (requires.length) {\n outputs.push(`& ${requiredFields}`);\n }\n return outputs.join(' ');\n }\n }\n return parentTypeSignature;\n }", "title": "" }, { "docid": "17e134a04e51695656f8557fbf0408eb", "score": "0.50214726", "text": "updateParentReference() {\n this.readTreeNodes({ __children: this.data }, 0, this.hot.countRows());\n }", "title": "" }, { "docid": "8dde6ed1a4313c84f0766075079de3d2", "score": "0.5020185", "text": "async initOrgParent({ state, commit }, payload){\n const orgParentId = payload.orgParentId;\n\n const GetOrgParentInfoPromise = axios.get(\n URL.GET_ORG_PARENT_INFO,\n {\n params: {\n orgParentId: orgParentId\n }\n }\n );\n\n const orgParent = await GetOrgParentInfoPromise;\n\n commit(\"parentInfo/setParentInfo\", {\n id: orgParent.id,\n firstName: orgParent.firstName,\n lastName: orgParent.lastName,\n email: orgParent.email,\n title: orgParent.title,\n profileImage: orgParent.profileImage,\n genderId: orgParent.genderId,\n mobile: orgParent.mobile,\n homePhone: orgParent.homePhone,\n workPhone: orgParent.workPhone,\n addressId: orgParent.addressId,\n orgChildList: orgParent.children,\n });\n }", "title": "" } ]
1a256640ac5f13da4524b15c25ea450f
Measurement can be split in two steps, the setup work that applies to the whole line, and the measurement of the actual character. Functions like coordsChar, that need to do a lot of measurements in a row, can thus ensure that the setup work is only done once.
[ { "docid": "4d5822de163a5baf596dce1e86e173bf", "score": "0.5874229", "text": "function prepareMeasureForLine(cm, line) {\r\n var lineN = lineNo(line);\r\n var view = findViewForLine(cm, lineN);\r\n if (view && !view.text) {\r\n view = null;\r\n } else if (view && view.changes) {\r\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\r\n cm.curOp.forceUpdate = true;\r\n }\r\n if (!view)\r\n { view = updateExternalMeasurement(cm, line); }\r\n\r\n var info = mapFromLineView(view, line, lineN);\r\n return {\r\n line: line, view: view, rect: null,\r\n map: info.map, cache: info.cache, before: info.before,\r\n hasHeights: false\r\n }\r\n}", "title": "" } ]
[ { "docid": "240523fa0319c767a447b20ae82bc631", "score": "0.6101549", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n\n if (!view) {\n view = updateExternalMeasurement(cm, line);\n }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line,\n view: view,\n rect: null,\n map: info.map,\n cache: info.cache,\n before: info.before,\n hasHeights: false\n };\n } // Given a prepared measurement object, measures the position of an", "title": "" }, { "docid": "5a4a049ddfe434b7da96a020747556b0", "score": "0.60807174", "text": "function prepareMeasureForLine(cm, line) {\n\t\t var lineN = lineNo(line);\n\t\t var view = findViewForLine(cm, lineN);\n\t\t if (view && !view.text) {\n\t\t view = null;\n\t\t } else if (view && view.changes) {\n\t\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t\t cm.curOp.forceUpdate = true;\n\t\t }\n\t\t if (!view)\n\t\t view = updateExternalMeasurement(cm, line);\n\t\t\n\t\t var info = mapFromLineView(view, line, lineN);\n\t\t return {\n\t\t line: line, view: view, rect: null,\n\t\t map: info.map, cache: info.cache, before: info.before,\n\t\t hasHeights: false\n\t\t };\n\t\t }", "title": "" }, { "docid": "821e5b8d5d7c9cff1cb55b0c3bfaf559", "score": "0.6048911", "text": "function prepareMeasureForLine(cm, line) {\n\t\t var lineN = lineNo(line);\n\t\t var view = findViewForLine(cm, lineN);\n\t\t if (view && !view.text) {\n\t\t view = null;\n\t\t } else if (view && view.changes) {\n\t\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t\t cm.curOp.forceUpdate = true;\n\t\t }\n\t\t if (!view)\n\t\t { view = updateExternalMeasurement(cm, line); }\n\n\t\t var info = mapFromLineView(view, line, lineN);\n\t\t return {\n\t\t line: line, view: view, rect: null,\n\t\t map: info.map, cache: info.cache, before: info.before,\n\t\t hasHeights: false\n\t\t }\n\t\t }", "title": "" }, { "docid": "31dc1920e7c26458d4c7f57d1117c95d", "score": "0.59248394", "text": "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\t\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "title": "" }, { "docid": "5b427f2f0c6c7e59b9bf70d4b36d8437", "score": "0.5919149", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line)\n var view = findViewForLine(cm, lineN)\n if (view && !view.text) {\n view = null\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm))\n cm.curOp.forceUpdate = true\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line) }\n\n var info = mapFromLineView(view, line, lineN)\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "5b427f2f0c6c7e59b9bf70d4b36d8437", "score": "0.5919149", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line)\n var view = findViewForLine(cm, lineN)\n if (view && !view.text) {\n view = null\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm))\n cm.curOp.forceUpdate = true\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line) }\n\n var info = mapFromLineView(view, line, lineN)\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "a836128114779ff8500261aaed7628f7", "score": "0.5902357", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }", "title": "" }, { "docid": "59512eee996befc6d808f7b255c2a92b", "score": "0.5898835", "text": "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "title": "" }, { "docid": "59512eee996befc6d808f7b255c2a92b", "score": "0.5898835", "text": "function prepareMeasureForLine(cm, line) {\n\t var lineN = lineNo(line);\n\t var view = findViewForLine(cm, lineN);\n\t if (view && !view.text) {\n\t view = null;\n\t } else if (view && view.changes) {\n\t updateLineForChanges(cm, view, lineN, getDimensions(cm));\n\t cm.curOp.forceUpdate = true;\n\t }\n\t if (!view)\n\t view = updateExternalMeasurement(cm, line);\n\n\t var info = mapFromLineView(view, line, lineN);\n\t return {\n\t line: line, view: view, rect: null,\n\t map: info.map, cache: info.cache, before: info.before,\n\t hasHeights: false\n\t };\n\t }", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "2f2d1ed049b13dfbebe2679f9a866a45", "score": "0.5889076", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n}", "title": "" }, { "docid": "36c50ca8d23933b2d2970be812c6dbf8", "score": "0.58766544", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "title": "" }, { "docid": "c7f7e77d299f1f88e0199a4d2e704f03", "score": "0.584467", "text": "function prepareMeasureForLine(cm, line) {\r\n var lineN = lineNo(line);\r\n var view = findViewForLine(cm, lineN);\r\n if (view && !view.text)\r\n view = null;\r\n else if (view && view.changes)\r\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\r\n if (!view)\r\n view = updateExternalMeasurement(cm, line);\r\n\r\n var info = mapFromLineView(view, line, lineN);\r\n return {\r\n line: line, view: view, rect: null,\r\n map: info.map, cache: info.cache, before: info.before,\r\n hasHeights: false\r\n };\r\n }", "title": "" }, { "docid": "b704d921a20217e8b57fabb339e575bd", "score": "0.58426183", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "title": "" }, { "docid": "b704d921a20217e8b57fabb339e575bd", "score": "0.58426183", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "title": "" }, { "docid": "b704d921a20217e8b57fabb339e575bd", "score": "0.58426183", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "title": "" }, { "docid": "b704d921a20217e8b57fabb339e575bd", "score": "0.58426183", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "title": "" }, { "docid": "b704d921a20217e8b57fabb339e575bd", "score": "0.58426183", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "title": "" }, { "docid": "b704d921a20217e8b57fabb339e575bd", "score": "0.58426183", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "title": "" }, { "docid": "b704d921a20217e8b57fabb339e575bd", "score": "0.58426183", "text": "function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text)\n view = null;\n else if (view && view.changes)\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n if (!view)\n view = updateExternalMeasurement(cm, line);\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n };\n }", "title": "" }, { "docid": "3caaf0991d872296230d16b179db8772", "score": "0.56498533", "text": "drawShallowLine(xInit, yInit, xFinal, deltaX, deltaY, keyCharacter) {\n\n let gridSquares = getSquaresForShallowLine(xInit, yInit, xFinal, deltaX, deltaY, keyCharacter);\n\n // clear any characters previously added to the grid square\n gridSquares.clear.forEach(square => {\n this.clearPreviousCharacter(square);\n });\n\n // add the required character to the square at location (x,y)\n gridSquares.add.forEach(square => {\n this.addCharacterToSquare(square.x, square.y, square.char);\n })\n }", "title": "" }, { "docid": "95c1dc08f58c7bd9aa1e51f0d8b459f9", "score": "0.5595703", "text": "_updateDimensions() {\n if (!this._charSizeService.hasValidSize) {\n return;\n }\n // Calculate the scaled character width. Width is floored as it must be\n // drawn to an integer grid in order for the CharAtlas \"stamps\" to not be\n // blurry. When text is drawn to the grid not using the CharAtlas, it is\n // clipped to ensure there is no overlap with the next cell.\n this.dimensions.scaledCharWidth = Math.floor(this._charSizeService.width * window.devicePixelRatio);\n // Calculate the scaled character height. Height is ceiled in case\n // devicePixelRatio is a floating point number in order to ensure there is\n // enough space to draw the character to the cell.\n this.dimensions.scaledCharHeight = Math.ceil(this._charSizeService.height * window.devicePixelRatio);\n // Calculate the scaled cell height, if lineHeight is not 1 then the value\n // will be floored because since lineHeight can never be lower then 1, there\n // is a guarentee that the scaled line height will always be larger than\n // scaled char height.\n this.dimensions.scaledCellHeight = Math.floor(this.dimensions.scaledCharHeight * this._optionsService.options.lineHeight);\n // Calculate the y coordinate within a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharTop = this._optionsService.options.lineHeight === 1 ? 0 : Math.round((this.dimensions.scaledCellHeight - this.dimensions.scaledCharHeight) / 2);\n // Calculate the scaled cell width, taking the letterSpacing into account.\n this.dimensions.scaledCellWidth = this.dimensions.scaledCharWidth + Math.round(this._optionsService.options.letterSpacing);\n // Calculate the x coordinate with a cell that text should draw from in\n // order to draw in the center of a cell.\n this.dimensions.scaledCharLeft = Math.floor(this._optionsService.options.letterSpacing / 2);\n // Recalculate the canvas dimensions; scaled* define the actual number of\n // pixel in the canvas\n this.dimensions.scaledCanvasHeight = this._bufferService.rows * this.dimensions.scaledCellHeight;\n this.dimensions.scaledCanvasWidth = this._bufferService.cols * this.dimensions.scaledCellWidth;\n // The the size of the canvas on the page. It's very important that this\n // rounds to nearest integer and not ceils as browsers often set\n // window.devicePixelRatio as something like 1.100000023841858, when it's\n // actually 1.1. Ceiling causes blurriness as the backing canvas image is 1\n // pixel too large for the canvas element size.\n this.dimensions.canvasHeight = Math.round(this.dimensions.scaledCanvasHeight / window.devicePixelRatio);\n this.dimensions.canvasWidth = Math.round(this.dimensions.scaledCanvasWidth / window.devicePixelRatio);\n // Get the _actual_ dimensions of an individual cell. This needs to be\n // derived from the canvasWidth/Height calculated above which takes into\n // account window.devicePixelRatio. ICharSizeService.width/height by itself\n // is insufficient when the page is not at 100% zoom level as it's measured\n // in CSS pixels, but the actual char size on the canvas can differ.\n this.dimensions.actualCellHeight = this.dimensions.canvasHeight / this._bufferService.rows;\n this.dimensions.actualCellWidth = this.dimensions.canvasWidth / this._bufferService.cols;\n }", "title": "" }, { "docid": "d94da1ab557f07db24c4f96069f8e71e", "score": "0.55469966", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n } // Get a {top, bottom, left, right} box (in line-local coordinates)", "title": "" }, { "docid": "28d52e9e04bbe50689b28f1f20ca366a", "score": "0.5452544", "text": "function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias);\n } // Find a line view that corresponds to the given line number.", "title": "" }, { "docid": "dcf7a468aae74e83da74f5565fd661dd", "score": "0.5441914", "text": "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view\n\t\t }", "title": "" }, { "docid": "0135ebace1f7793e09bf6a04c5fbdb14", "score": "0.5428903", "text": "function updateExternalMeasurement(cm, line) {\n\t\t line = visualLine(line);\n\t\t var lineN = lineNo(line);\n\t\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t\t view.lineN = lineN;\n\t\t var built = view.built = buildLineContent(cm, view);\n\t\t view.text = built.pre;\n\t\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t\t return view;\n\t\t }", "title": "" }, { "docid": "328b0eda4833379c8dbc195f4079ef93", "score": "0.5395885", "text": "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "title": "" }, { "docid": "328b0eda4833379c8dbc195f4079ef93", "score": "0.5395885", "text": "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "title": "" }, { "docid": "328b0eda4833379c8dbc195f4079ef93", "score": "0.5395885", "text": "function updateExternalMeasurement(cm, line) {\n\t line = visualLine(line);\n\t var lineN = lineNo(line);\n\t var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n\t view.lineN = lineN;\n\t var built = view.built = buildLineContent(cm, view);\n\t view.text = built.pre;\n\t removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n\t return view;\n\t }", "title": "" }, { "docid": "bde35d04ad155992284df375c8bdc05f", "score": "0.5394366", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}", "title": "" }, { "docid": "bde35d04ad155992284df375c8bdc05f", "score": "0.5394366", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line)\n var lineN = lineNo(line)\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN)\n view.lineN = lineN\n var built = view.built = buildLineContent(cm, view)\n view.text = built.pre\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre)\n return view\n}", "title": "" }, { "docid": "56fc5c3369fecea71d374ae3c49bc6cf", "score": "0.53785706", "text": "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view\r\n}", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "5adf4e458c9948066f05acc20b65687c", "score": "0.53765225", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }", "title": "" }, { "docid": "8d69de696215f1bb0972044f1d298051", "score": "0.5357086", "text": "function updateExternalMeasurement(cm, line) {\r\n line = visualLine(line);\r\n var lineN = lineNo(line);\r\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\r\n view.lineN = lineN;\r\n var built = view.built = buildLineContent(cm, view);\r\n view.text = built.pre;\r\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\r\n return view;\r\n }", "title": "" }, { "docid": "e095e8aaa29c9e3c8141d965ba8ecb00", "score": "0.53527236", "text": "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "title": "" }, { "docid": "d210cdff29b20887ee9b00a6e498f032", "score": "0.5352328", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "title": "" }, { "docid": "d210cdff29b20887ee9b00a6e498f032", "score": "0.5352328", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "title": "" }, { "docid": "d210cdff29b20887ee9b00a6e498f032", "score": "0.5352328", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "title": "" }, { "docid": "d210cdff29b20887ee9b00a6e498f032", "score": "0.5352328", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "title": "" }, { "docid": "d210cdff29b20887ee9b00a6e498f032", "score": "0.5352328", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "title": "" }, { "docid": "d210cdff29b20887ee9b00a6e498f032", "score": "0.5352328", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "title": "" }, { "docid": "d210cdff29b20887ee9b00a6e498f032", "score": "0.5352328", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "title": "" }, { "docid": "d210cdff29b20887ee9b00a6e498f032", "score": "0.5352328", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view;\n }", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "1c09b06a574411dd6c0a1798462748cb", "score": "0.5346438", "text": "function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n}", "title": "" }, { "docid": "80180f391e0c8e20be5f492b0258fd79", "score": "0.53110147", "text": "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "title": "" }, { "docid": "80180f391e0c8e20be5f492b0258fd79", "score": "0.53110147", "text": "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "title": "" }, { "docid": "80180f391e0c8e20be5f492b0258fd79", "score": "0.53110147", "text": "function coordsChar(x, y) {\n if (y < 0) y = 0;\n var th = textHeight(), cw = charWidth(), heightPos = displayOffset + Math.floor(y / th);\n var lineNo = lineAtHeight(doc, heightPos);\n if (lineNo >= doc.size) return {line: doc.size - 1, ch: getLine(doc.size - 1).text.length};\n var lineObj = getLine(lineNo), text = lineObj.text;\n var tw = options.lineWrapping, innerOff = tw ? heightPos - heightAtLine(doc, lineNo) : 0;\n if (x <= 0 && innerOff == 0) return {line: lineNo, ch: 0};\n function getX(len) {\n var sp = measureLine(lineObj, len);\n if (tw) {\n var off = Math.round(sp.top / th);\n return Math.max(0, sp.left + (off - innerOff) * scroller.clientWidth);\n }\n return sp.left;\n }\n var from = 0, fromX = 0, to = text.length, toX;\n // Guess a suitable upper bound for our search.\n var estimated = Math.min(to, Math.ceil((x + innerOff * scroller.clientWidth * .9) / cw));\n for (;;) {\n var estX = getX(estimated);\n if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));\n else {toX = estX; to = estimated; break;}\n }\n if (x > toX) return {line: lineNo, ch: to};\n // Try to guess a suitable lower bound as well.\n estimated = Math.floor(to * 0.8); estX = getX(estimated);\n if (estX < x) {from = estimated; fromX = estX;}\n // Do a binary search between these bounds.\n for (;;) {\n if (to - from <= 1) return {line: lineNo, ch: (toX - x > x - fromX) ? from : to};\n var middle = Math.ceil((from + to) / 2), middleX = getX(middle);\n if (middleX > x) {to = middle; toX = middleX;}\n else {from = middle; fromX = middleX;}\n }\n }", "title": "" }, { "docid": "d2fe46327861ba4ac9d966e1a8af152e", "score": "0.5308901", "text": "function coordsChar(cm, x, y) {\n\t\t var doc = cm.doc;\n\t\t y += cm.display.viewOffset;\n\t\t if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\n\t\t var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n\t\t if (lineN > last)\n\t\t return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\n\t\t if (x < 0) x = 0;\n\t\t\n\t\t var lineObj = getLine(doc, lineN);\n\t\t for (;;) {\n\t\t var found = coordsCharInner(cm, lineObj, lineN, x, y);\n\t\t var merged = collapsedSpanAtEnd(lineObj);\n\t\t var mergedPos = merged && merged.find(0, true);\n\t\t if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\n\t\t lineN = lineNo(lineObj = mergedPos.to.line);\n\t\t else\n\t\t return found;\n\t\t }\n\t\t }", "title": "" }, { "docid": "e6b428bbc71fcf498fdf2ae3b1039a57", "score": "0.52921337", "text": "function coordsChar(cm, x, y) {\r\n var doc = cm.doc;\r\n y += cm.display.viewOffset;\r\n if (y < 0) return PosWithInfo(doc.first, 0, true, -1);\r\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\r\n if (lineN > last)\r\n return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);\r\n if (x < 0) x = 0;\r\n\r\n var lineObj = getLine(doc, lineN);\r\n for (;;) {\r\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\r\n var merged = collapsedSpanAtEnd(lineObj);\r\n var mergedPos = merged && merged.find(0, true);\r\n if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))\r\n lineN = lineNo(lineObj = mergedPos.to.line);\r\n else\r\n return found;\r\n }\r\n }", "title": "" } ]
e60e9a78b6fff0c4471abdf04c354dd0
Language: Monkey Description: Monkey2 is an easy to use, cross platform, games oriented programming language from Blitz Research.
[ { "docid": "e9f7398592908e90de29815f8a2460b4", "score": "0.0", "text": "function monkey(hljs) {\n const NUMBER = {\n className: 'number',\n relevance: 0,\n variants: [\n {\n begin: '[$][a-fA-F0-9]+'\n },\n hljs.NUMBER_MODE\n ]\n };\n\n return {\n name: 'Monkey',\n case_insensitive: true,\n keywords: {\n keyword: 'public private property continue exit extern new try catch ' +\n 'eachin not abstract final select case default const local global field ' +\n 'end if then else elseif endif while wend repeat until forever for ' +\n 'to step next return module inline throw import',\n\n built_in: 'DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil ' +\n 'Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI',\n\n literal: 'true false null and or shl shr mod'\n },\n illegal: /\\/\\*/,\n contains: [\n hljs.COMMENT('#rem', '#end'),\n hljs.COMMENT(\n \"'\",\n '$',\n {\n relevance: 0\n }\n ),\n {\n className: 'function',\n beginKeywords: 'function method',\n end: '[(=:]|$',\n illegal: /\\n/,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface',\n end: '$',\n contains: [\n {\n beginKeywords: 'extends implements'\n },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n className: 'built_in',\n begin: '\\\\b(self|super)\\\\b'\n },\n {\n className: 'meta',\n begin: '\\\\s*#',\n end: '$',\n keywords: {\n 'meta-keyword': 'if else elseif endif end then'\n }\n },\n {\n className: 'meta',\n begin: '^\\\\s*strict\\\\b'\n },\n {\n beginKeywords: 'alias',\n end: '=',\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n hljs.QUOTE_STRING_MODE,\n NUMBER\n ]\n };\n}", "title": "" } ]
[ { "docid": "b225e9be0aede247a4d0cb38cf57e34c", "score": "0.6030821", "text": "function Monkey() {}", "title": "" }, { "docid": "c5e112dc766e1e6a6736012ed23f38f0", "score": "0.5960252", "text": "function GameLanguage(){}", "title": "" }, { "docid": "5b82408e949c838b29d87fa5c5081be6", "score": "0.5762214", "text": "function startGame() {\n console.log(chalk.blue(\"Welcome ! Play a Word Guess Game with us!!\"));\n}", "title": "" }, { "docid": "600122f4e19a53c871bfc5b8289e4209", "score": "0.5699222", "text": "function main() {\n\ttj.speak(\"Hello, I am TJBOT\");\n}", "title": "" }, { "docid": "8e54a0fff701910423da2993e349eb0c", "score": "0.56624305", "text": "function help () {\r\n // Note the string creted below using the backtick ` is a Template literal.\r\n // You can use multi-line strings and string interpolation in a Template literal.\r\n return `\r\n Welcome to Scramble: the game where you unscramble letters to make words.\r\n\r\n Once you start the game, you will be given a scrambled word. \r\n If you correctly guess the word, you will receive a point. \r\n If you guess incorrectly you will receive a strike. \r\n You can also pass on a word. Passing adds the word back to the list. \r\n You can pass ${\r\n game.maxPasses\r\n } times. After the ${\r\n game.maxStrikes\r\n } strikes the game ends.\r\n \r\n To start a new game use start().\r\n To make guess use guess('word').\r\n To skip a word use pass().\r\n To show these instructions again use help().\r\n `\r\n}", "title": "" }, { "docid": "3953837f02fb6c539da915c0824de3ec", "score": "0.56403214", "text": "function GameOfLife() {}", "title": "" }, { "docid": "f5fea718daf3d16006750543edea1a4c", "score": "0.5579929", "text": "function playGame() {\n var wordChoices = [\n \"aerobics\", \n \"archer\",\n \"archery\",\n \"arena\",\n \"arrow\",\n \"athlete\",\n \"athletics\",\n \"axel\",\n \"badminton\",\n \"ball\",\n \"base\",\n \"baseball\",\n \"basketball\",\n \"bat\",\n \"baton\",\n \"batter\",\n \"batting\",\n \"biathlon\",\n \"bicycle\",\n \"bicycling\",\n \"bike\",\n \"biking\",\n \"billiards\",\n \"bobsleigh\", \n \"bocce\",\n \"boomerang\",\n \"boules\",\n \"bow\",\n \"bowler\",\n \"bowling\",\n \"boxer\",\n \"boxing\",\n \"bunt\",\n \"canoe\",\n \"canoeing\",\n \"catch\",\n \"catcher\",\n \"champion\",\n \"championship\",\n \"cleats\",\n \"club\",\n \"coach\",\n \"compete\",\n \"competing\",\n \"competition\",\n \"competitor\",\n \"crew\",\n \"cricket\",\n \"croquet\",\n \"cue\",\n \"curling\",\n \"cycle\",\n \"cycling\",\n \"cyclist\",\n \"dart\",\n \"dartboard\",\n \"deadlifting\",\n \"decathlon\",\n \"discus\",\n \"dive\",\n \"diver\",\n \"diving\",\n \"dodgeball\",\n \"doubleheader\",\n \"dugout\",\n \"equestrian\",\n \"equipment\",\n \"exercise\",\n \"fencing\",\n \"fielder\",\n \"fitness\",\n \"football\",\n \"forward\",\n \"frisbee\",\n \"game\",\n \"gear\",\n \"goal\",\n \"goalie\",\n \"golf\",\n \"guard\",\n \"gym\",\n \"gymnast\",\n \"gymnastics\",\n \"halftime\",\n \"handball\",\n \"heptathlon\",\n \"hitter\",\n \"hockey\",\n \"home\",\n \"huddle\",\n \"hurdle\",\n \"infield\",\n \"infielder\",\n \"inning\",\n \"ironman\",\n \"javelin\",\n \"jog\",\n \"judo\",\n \"jump\",\n \"karate\",\n \"kayak\",\n \"kickball\",\n \"kite\",\n \"lacrosse\",\n \"league\",\n \"luge\",\n \"mallet\",\n \"medal\",\n \"mitt\",\n \"net\",\n \"offense\",\n \"olympics\",\n \"out\",\n \"paddleball\",\n \"paddling\",\n \"paintball\",\n \"parasailing\",\n \"parkour\",\n \"pentathlon\",\n \"pickleball\",\n \"pitcher\",\n \"play\",\n \"playoff\",\n \"pole\",\n \"polo\",\n \"pool\",\n \"puck\",\n \"quarter\",\n \"quarterback\",\n \"racer\",\n \"racewalking\",\n \"racket\",\n \"racquetball\",\n \"rafting\",\n \"referee\",\n \"relay\",\n \"riding\",\n \"rink\",\n \"rowing\",\n \"rugby\",\n \"run\",\n \"runner\",\n \"sailing\",\n \"score\",\n \"scoreboard\",\n \"scuba\",\n \"shortstop\",\n \"skating\",\n \"skeleton\",\n \"skiing\",\n \"slalom\",\n \"sledding\",\n \"snorkeling\",\n \"snowboarding\",\n \"soccer\",\n \"softball\",\n \"sport\",\n \"sportsmanship\",\n \"squash\",\n \"stadium\",\n \"strike\",\n \"stroke\",\n \"surfing\",\n \"swimming\",\n \"taekondo\",\n \"tag\",\n \"team\",\n \"tennis\",\n \"tetherball\",\n \"throw\",\n \"toboggan\",\n \"trampoline\",\n \"triathlon\",\n \"tugowar\",\n \"ultramarathon\",\n \"umpire\",\n \"unicycle\",\n \"uniform\",\n \"vault\",\n \"volleyball\",\n \"wakeboarding\",\n \"walking\",\n \"weightlifting\",\n \"wetsuit\",\n \"wicket\",\n \"win\",\n \"windsurfing\",\n \"wrestling\"\n\n ];\n computerGuess = wordChoices[Math.floor(Math.random() * wordChoices.length)];\n // console.log(computerGuess);\n console.log(\"Hint: Its a sport or sports term!!\\n\");\n var computerGuessArray = computerGuess.split(\"\");\n var letterObjectsArray = [];\n numberOfGuesses = 10;\n // Creating letter object from the computer guessed word and storing it in an array\n for (var i = 0; i < computerGuessArray.length; i++) {\n letterObjectsArray.push(new letter(computerGuessArray[i]));\n }\n data = new word(letterObjectsArray);\n previousWord = data.getData();\n console.log(previousWord);\n checkUserInput();\n}", "title": "" }, { "docid": "8e30628d6f9840e1fcaa69fce2bf1122", "score": "0.5576503", "text": "function talkToJulia() {\n\tbasicEcho('\"Hey '+player.name + ', If you\\'re ready It\\'s time to bring operation: Take Back Appfolio to market. I\\'ve already spoken to the resistance here, but we need help. It\\'s time to bring Vendadores back together...\"');\n\tbasicEcho('\"To get us all on the same page, I\\'ve sent out a calendar invite for one week from today in Santa Barbara. We will need everyone if we\\'re going to beat ELISA.\"');\n}", "title": "" }, { "docid": "4b594a63c13f156f3eeb82fc788855dd", "score": "0.5494214", "text": "function play_word(word) {\n\n}", "title": "" }, { "docid": "9b99630760291d02d7cf29999cc5bae8", "score": "0.54873186", "text": "function e1008687() { return 'ML2.'; }", "title": "" }, { "docid": "8539fad9b98001ce561300e56932f126", "score": "0.5480566", "text": "function hey() {\n return 'Good morning'\n}", "title": "" }, { "docid": "2554f752908b0b0944e70ab1da1b7a8f", "score": "0.5479766", "text": "function introduction() {\n console.log('Thanks for tuning in to the Flatiron Podcast!')\n return 'Where we talk about coding!'\n }", "title": "" }, { "docid": "524323c75dee9fe68fbe723ad1401f4e", "score": "0.5427972", "text": "startGame() {\n\t\tthis.help();\n\t\tconsole.log(\n\t\t\t'Now go and %cexplore this website%c!',\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.default\n\t\t);\n\t\tconsole.log(' ');\n\t\tthis.log(\n\t\t\t`✨ You find yourself in a mansions ${this.getCurrentRoom().name}`\n\t\t);\n\t\tta.inspect(this.getCurrentRoom().name);\n\t}", "title": "" }, { "docid": "98021d3beacfe3dc7c93fd55943835b1", "score": "0.5424844", "text": "function youarebeautiful(){ // FIRST SCENE - WELCOMES PLAYER\n\tstory(\"You going to talk to her. She smiling to your face and she says Hi beautiful, in that point you are shocked because that's your first time someone tell you beautiful. So now you having a beautiful conversation with her\");\n\toptions = [\"Tell her that you like her\",\" Ask her for a date\",\"Tell her we should be just a friends\"];\n\tanswer = setOptions(options);\n}", "title": "" }, { "docid": "aed6963773e31d75b39a2b2c7b66e4f0", "score": "0.54195845", "text": "function greetWorld() {\n return 'Hello, World!';\n}", "title": "" }, { "docid": "54ea63efdfd4140e1c71174a961934cb", "score": "0.54178977", "text": "function madlib (word1, word2, word3, word4){\n\tlet hero = \"Hi! you look \" + word1 + \" your breath smells \" + word2 + \" you have nice \" + word3 + \"your feet are\" + word4\n\treturn hero\n}", "title": "" }, { "docid": "8d84e132af4b8fe029da0b3f9fe1f137", "score": "0.54121786", "text": "function ch02ex02b() {\n\n}", "title": "" }, { "docid": "a170816086226645c9ae78e601ea9c89", "score": "0.5392388", "text": "function C009_Library_Jennifer_PleasureJennifer() {\n\tGameLogAdd(\"EatenByPlayer\");\n\tOverridenIntroImage = \"\";\n\tC009_Library_Jennifer_MastubateCount++;\n\tCurrentTime = CurrentTime + 50000;\n\tif (C009_Library_Jennifer_ReadyToOrgasm()) {\n\t\tC009_Library_Jennifer_Orgasm();\n\t\tOverridenIntroImage = \"CouchCenterLove.jpg\";\n\t\tOverridenIntroText = GetText(\"JenniferOralOrgasm\");\n\t}\n}", "title": "" }, { "docid": "74b25a7f0e34a114832e945f7d68a2de", "score": "0.5388052", "text": "function Start_Dinner_3(){\n\n\tn(\"母さん。\");\n\n\tChoose({\n\t\t\"だからジャックと必死に勉強してるんだよ。\": Tutor,\n\t\t\"努力はしてるんだよ。本当だって。\": Tutor,\n\t\t\"そんなにひどくないって。\": Tutor\n\t});\n\n}", "title": "" }, { "docid": "bb826450a1b1ed8c901485ed22c7a048", "score": "0.53851223", "text": "function mood(){\n\treturn \"I'm feeling great\"\n}", "title": "" }, { "docid": "3b02e8cc3651be2c392d25cc2d8591b9", "score": "0.5384565", "text": "function codeLove() {\n return 'I love code';\n}", "title": "" }, { "docid": "1ecccf19d74f91d293b13fad1bd05ec8", "score": "0.53842354", "text": "commandWord() { return \"introduce\"; }", "title": "" }, { "docid": "916234470aa8ae7683c47757c9a9d787", "score": "0.5358455", "text": "help() {\n\t\tconsole.log('💡 %cHey! Listen!', this.formats.help);\n\t\tconsole.log(\n\t\t\t'You are in Text Adventure mode. That means you can navigate this site as if it were an early computer game.'\n\t\t);\n\t\tconsole.log(\"It's probably full of bugs and I don't care.\");\n\t\tconsole.log(\n\t\t\t\"It's written in javascript, so every command is a js command. Here is what you can do:\"\n\t\t);\n\t\tconsole.log(\n\t\t\t'• Move around the game world by using %cta.go(\"%cDirection%c\")%c. You can go to all four cardinal directions. Directions are marked in %csalmon%c.',\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.directions,\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.default,\n\t\t\tthis.formats.directions,\n\t\t\tthis.formats.default\n\t\t);\n\t\tconsole.log(\n\t\t\t'• Inspect an item or room by using %cta.inspect(\"%cItem%c\")%c to get more information on it. Items are marked in %cgreen%c and rooms are %cblue%c.',\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.items,\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.default,\n\t\t\tthis.formats.items,\n\t\t\tthis.formats.default,\n\t\t\tthis.formats.rooms,\n\t\t\tthis.formats.default\n\t\t);\n\t\tconsole.log(\n\t\t\t'• Use an item by using %cta.use(\"%cItem%c\")%c. Note that not all items are usable.',\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.items,\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.default\n\t\t);\n\t\tconsole.log(\n\t\t\t\"• Finish using an item by calling %cta.finish()%c. You don't need to do that for all items, though.\",\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.default\n\t\t);\n\t\tconsole.log(\n\t\t\t\"• %cta.reset()%c resets the game to the start. In case you're lost or just want to go back.\",\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.default\n\t\t);\n\t\tconsole.log(\n\t\t\t'• %cta.help()%c displays this message.',\n\t\t\tthis.formats.help,\n\t\t\tthis.formats.default\n\t\t);\n\t}", "title": "" }, { "docid": "5b05893c99f56324ebacd0cdfe984c30", "score": "0.5356053", "text": "function developerGuessingGame(){\n var famousDevelopers = [['Dennis Ritchie','Dennis MacAlistair Ritchie was an American computer scientist who is credited for shaping and pioneering the digital era. He created the most commonly used C programming language that is used today in various software applications, embedded system development, operating systems, and has influenced most modern programming languages.'],\n ['Linus Torvalds','Linus Benedict Torvalds s a Finnish American software engineer, who was the principal driving force behind the development of the Linux kernel. Its creation itself is attributed towards him and he later became the chief architect of the Linux kernel, and is now the project’s coordinator.'],\n ['Bjarne Stroustrup','Bjarne Stroustrup is a Danish computer scientist who is credited for the creation and the development of the widely used and highly successful C++ programming language. He not only invented it, but also evolved it, all by himself, by writing its early definitions, producing its first implementation, formulating its design criteria, designing all its major facilities, processing extension proposals for standards committee and its standard textbook.'],\n ['Tim Berners-Lee','Sir Timothy John “Tim” Berners-Lee is a British computer scientist who is renowned all across the globe because of his creation of the World Wide Web as well as the implementation of the first successful communication between a Hypertext Transfer Protocol (HTTP) client and server via the Internet in November, 1989.'],\n ['Brian Kernighan','Brian Wilson Kernighan is a Canadian computer scientist who worked at Bell Labs alongside Ken Thompson and Dennis Ritchie. He is the co-creator and developer of UNIX. He is also co-author of the AWK and AMPL programming languages. Kernighan is currently a Professor and the Undergraduate Department Representative at the Computer Science Department of Princeton University.'],\n ['Donald Knuth','Donald Ervin Knuth is an American computer scientist and mathematician as well as a Professor Emeritus (retired professor) at Stanford University. Knuth has been dubbed as the “Father of the Analysis of Algorithms” as he has contributed to the development of rigorous analysis of the computational complexity of algorithms and systematized formal mathematical techniques for it.'],\n ['Ken Thompson', 'Kenneth Lane Thompson, or simply “Ken” as he is called by the hacker community, is an American pioneer of computer science. Thompson had designed and implemented the original Unix operating system and also invented the B programming language (the direct predecessor to the famous C programming language), and was one of the early developers of the Plan 9 operating systems.'],\n ['Guido van Rossum','Guido van Rossum is a Dutch computer programmer who is the author of the popular Python programming language that is wildly used today. His creation of Python lead him to being declared a “Benevolent Dictator For Life” the In the Python community which means that he continues to oversee the Python development process, making decisions where necessary, forever.'],\n ['James Gosling','James Arthur Gosling is a Canadian computer scientist and an officer of the order of Canada. He has coded quite a number of programs but is widely known for his creation of the highly successful and commonly used Java programming language in 1994 as well as its original virtual machine and compiler. He credits his creation towards his graduate student days where he created a p-code virtual machine for the lab’s DEC VAX computer, so that his professor could run UCSD Pascal programs and then realized that the architecture-neutral execution for widely distributed programs could be achieved by a similar technique.'],\n ['Bill Gates','Arguably one of the most popular computer programmers of all time, Bill Gates is an American business magnate, computer programmer, PC pioneer, investor, and philanthropist. He is the co-founder, ex-executive officer and current chairman of Microsoft, which is the world’s largest personal-computer software company. He is the best-known entrepreneurs of the personal computer revolution and helped develop Windows, which is the most used operating system in the world.'],\n ['Niklaus Wirth','Niklaus Emil Wirth is a Swiss computer scientist who is regarded as a pioneer of computer programming among other fields in software engineering. He is best known for designing several programming languages, including the highly popular Pascal, Euler, Algol W, Modula, Modula-2, Oberon, Oberon-2, and Oberon-07. He also designed the simple programming language PL/0 to illustrate compiler design which formed the basis for many university compiler design classes.'],\n ['Ada Lovelace', 'Augusta Ada King, more commonly known as Ada Lovelace, was an English mathematician and the world’s first computer programmer and was chiefly known for her work on Charles Babbage’s early mechanical general-purpose computer, the Analytical Engine. The notes she created for the Analytical Engine include what is recognized as the very first algorithm created solely for the intent of being processed by a machine or in other words, the world’s first computer program.']\n ];\n\n var guessFamousDevelopers = prompt(\"I found a list on the internet of the Top Twelve Most Influential Software Developers in History. If you can guess one of the names on the list, I'll tell you what they're most famous for. You have unlimited guesses for this one. Be sure to capitalize the name properly. Enter your guess in the box below.\");\n var devGuessingGameState = true;\n \n for (var i=1; i<=6; i++){\n for (var f=0; f<famousDevelopers.length; f++){\n if (guessFamousDevelopers === famousDevelopers[f][0]){\n alert(\"Correct! \" + famousDevelopers[f][1]);\n quizAnswers[6] = true;\n i = 6;\n f = famousDevelopers.length;\n devGuessingGameState = false;\n }\n }\n\n if (devGuessingGameState && i<6){\n guessFamousDevelopers = prompt(\"Sorry, that doesn't match any of the names on my list. Try again. You have \" + (6-i) + \" guesses remaining.\");\n }\n else if (devGuessingGameState) {\n for (var f=0; f<famousDevelopers.length; f++){\n if (guessFamousDevelopers === famousDevelopers[f][0]){\n alert(\"Correct! \" + famousDevelopers[f][1]);\n quizAnswers[6] = true;\n i = 6;\n devGuessingGameState = false;\n }\n }\n\n if (devGuessingGameState){\n alert(\"Darn! You're all out of guesses. Thanks for playing!\");\n devGuessingGameState = false;\n }\n } \n }\n}", "title": "" }, { "docid": "b55456a108a72eee520514356d502026", "score": "0.5334213", "text": "function Start_Dinner_5(){\n\n\tPlaySound(\"sfx\",\"dinner_door\");\n\t\n\tf(\"Hey Qiying! Hey Nick!\");\n\tf(\"I'm home!\");\n\t\n\tShow(\"dad\",\"dad_serious\");\n\n\tm(\"Hi honey.\");\n\tn(\"Sup dad, how was your day?\");\n\n\tf(\"Stayed overtime. Hopefully the boss will notice it before my Performance Review.\");\n\tf(\"Really, though, I was just playing web games all day. Haha!\");\n\tn(\"Ha ha.\");\n\n\tf(\"Nick, why aren't <i>your</i> web games any fun?\");\n\n\tChoose({\n\t\t\"I thought my games were fun...\": function(message){\n\t\t\tn(message);\n\t\t\tf(\"Well then! You have a sick sense of fun, don't you. Haha!\");\n\t\t\tn(\". . .\");\n\t\t\tCasual();\n\t\t},\n\t\t\"Not all games have to be fun.\": function(message){\n\t\t\tn(message);\n\t\t\tf(\"Oh yes. You're right.\");\n\t\t\tf(\"BAD games aren't any fun. Haha!\");\n\t\t\tn(\". . .\");\n\t\t\tCasual();\n\t\t},\n\t\t\"ART!\": function(message){\n\t\t\tn(message);\n\t\t\tf(\"Pfft. What's the use of art?\");\n\t\t\tf(\"Next thing you know, you're going to be writing bad amateur poetry, or something.\");\n\t\t\tn(\". . .\");\n\t\t\tCasual();\n\t\t}\n\t});\n\n}", "title": "" }, { "docid": "6140fdb090c74f24dde803e8bcc41206", "score": "0.5327371", "text": "function TELL_ABOUT_INTRO(char, text) {\n return \"You tell \" + char.byname({article : DEFINITE}) + \" about \" + text +\n \".\";\n}", "title": "" }, { "docid": "2f4a6b20fd910fcf8f432368bc4447d3", "score": "0.5324339", "text": "function greetingMessage(){\n console.log(\"Welcome to code MacD well which is weird!\");\n}", "title": "" }, { "docid": "aab56922dc786fff6129b0cb336e8596", "score": "0.5323985", "text": "function Leg2() {\n\t\tif (!exleg2){\n\t\texleg2 = true;\n\t\tNrExercise = NrExercise + 1;\n\n\t\tsendVirtualAssistantMessage(\" Let's do some Leg Squats \");\n\t\t\tlockImages();\n\t\t\tsendVirtualAssistantMessage(\" With the first beep bring your leg fourth\",1,true);\n\t\tshowImage(\"Images/Spicy/Exercise/Legs/3.jpg\");\n\t\tsendVirtualAssistantMessage(\" With the second beep bring the same leg to the side\",1,true);\n\t\tsendVirtualAssistantMessage(\" With the third beep put the leg behind you\",1,true);\n\t\tsendVirtualAssistantMessage(\" Switch leg and repeat for the other leg\",1,true);\n\t\tsendVirtualAssistantMessage(\" Continue until you hear my bell \",1,true);\n\t\tplayAudio(\"Audio/Spicy/Stroking/Metronome/40 bpm.mp3\");\n\t\tsleep( 25+5* getVar(\"ExerciseLevel\"));\n\t\tstopAudio();\n\t\tplayAudio(\"Audio/Spicy/SpecialSounds/Bell.mp3\"); \n\t\tsleep(20);\n\t\tsendVirtualAssistantMessage(\" Continue until you hear my bell\",1,true);\n\t\tplayAudio(\"Audio/Spicy/Stroking/Metronome/40 bpm.mp3\");\n\t\tsleep( 25+5* getVar(\"ExerciseLevel\"));\n\t\tstopAudio();\n\t\tplayAudio(\"Audio/Spicy/SpecialSounds/Bell.mp3\"); \n\t\tsleep(20);\n\t\tsendVirtualAssistantMessage(\" Continue until you hear my bell \",1,true);\n\t\tplayAudio(\"Audio/Spicy/Stroking/Metronome/40 bpm.mp3\");\n\t\tsleep( 25+5* getVar(\"ExerciseLevel\"));\n\t\tstopAudio();\n\t\tplayAudio(\"Audio/Spicy/SpecialSounds/Bell.mp3\"); \n\t\tsleep(20);\n\t\t\tunlockImages();\n\n}\n}", "title": "" }, { "docid": "de2ca050425a949458d00c03c15d23aa", "score": "0.5322729", "text": "function printHello2() {\n console.log(\"Hello, World 2!\");\n}", "title": "" }, { "docid": "6ab3912dc5d6e43549d764b84c6d55ce", "score": "0.5306019", "text": "function sayHello() {\n return 'Hello Word';\n}", "title": "" }, { "docid": "9c971f510808202efca48ca73d51fd25", "score": "0.5268613", "text": "function begin_2_baker(){\n \t//**//**console.log(\"2_baker BEGIN\");\n \t\n \tplaySound('2_baker');\n }", "title": "" }, { "docid": "e4c7d13b74a2fbc3091e56e7f4f7507a", "score": "0.52343345", "text": "function help () {\n return `Welcome to Functional Fishing\n The text-based console fishing game.\n Instructions\n In this game you will catch, cook and eat fish. You will also search for wood and bait.\n \n Commands\n To eat a fish use eat() \n To go fishing use fish() \n To start/stop a fire use fire() \n To search for bait use bait() \n To search for wood use wood() \n To check inventory use inventory() \n To view the instruction use help()`\n}", "title": "" }, { "docid": "030bcd714ad82eb80332423640b06eaf", "score": "0.5226605", "text": "function intro()\n{\n printf (\"\\n\");\n printf (\" *************************************\\n\");\n printf (\" * *\\n\");\n printf (\" * *\\n\");\n printf (\" * * * Super Star Trek * * *\\n\");\n printf (\" * *\\n\");\n printf (\" * *\\n\");\n printf (\" *************************************\\n\\n\");\n\n printf(\"If you need instructions <a href='superstartrek.txt'>click here</a>.\");\n\n/*\n// printf(\"\\nEasy game (y/n): \");\n userreply = prompt(\"Easy game (y/n):\");\n if (userreply === 'y' || userreply === 'Y') {\n easy_mode = 1;\n }\n*/\n\n/* \n printf(\"\\nShort game (y/n): \");\n gets(sTemp);\n if (sTemp[0] == 'y' || sTemp[0] == 'Y')\n small = 1;\n*/\n easy_game = 1;\n small_game = 1;\n\n printf (\"\\n\\n\");\n printf(\" ------*------\\n\");\n printf(\" ------------- `--- ------'\\n\");\n printf(\" `-------- --' / /\\n\");\n printf(\" \\\\\\\\------- --\\n\");\n printf(\" '-----------'\\n\");\n printf(\"\\n The USS Enterprise --- NCC - 1701\\n\\n\\n\");\n\n // randomize(); // C->JS: don't think this is needed now\n}", "title": "" }, { "docid": "fbe5c39816cf4b1e5876ad8b2a57e73d", "score": "0.52237934", "text": "function GETGAME(diff, level) {\r\n return {\r\n \"text\": \"Have a nice day~uyrdfjkgfdhyddyjudfbnkjyfcjy\",\r\n \"time\": 30000\r\n };\r\n}", "title": "" }, { "docid": "8882498f8ffdd3d205fd2b86c1caf443", "score": "0.5218265", "text": "function Game1() {\n _super.call(this, \"Forest of Origins\", \"It is too dark to see around you. However,\\nyou notice there is some light up ahead\\naround the corner.\", \"Stay\", \"GoOver\", config.Scene.GAME2_1, config.Scene.GAME2_2);\n }", "title": "" }, { "docid": "fd32a3bb1451782e93f876837dcfbb63", "score": "0.521659", "text": "function alive(){\r\n\ttweet(\"Life always finds a way\");\r\n}", "title": "" }, { "docid": "c8f2bd9787cb6463073d03dc036fdf86", "score": "0.52077776", "text": "function PenultEngine(){}", "title": "" }, { "docid": "310eabc05a833b5cebd6d711e102fe1a", "score": "0.519686", "text": "function Letherbeinyourteam(){ \n\tstory(\"You went to play a video game and she is with you in the team. You are excited to be with her. She said 'You look good at this game' and you said 'Thanks but I didn't play this game for a long time ha-ha' she said 'Let's win this no matter what'. In the end you and she won the competition she said 'I don't know how we did it but we won ha-ha' You said 'we won because we made a great camaraderie'\");\n\toptions = [\"Tell her that you like her\"];\n\tanswer = setOptions(options);\n}", "title": "" }, { "docid": "aebdb6ded13a5f0d8e124c6280673ef1", "score": "0.51959336", "text": "function game(){\n\tconsole.log(\"____________________________________\");\n\tconsole.log(\"WELCOME TO HANGMAN - COUNTRY NAMES\");\n\tconsole.log(\"____________________________________\");\n\tconsole.log(\"Instructions :\\n* Press any letter & Enter to find the word\\n* Press Enter to Exit the Game\");\n\tconsole.log(\"____________________________________\");\n\t//function call to start the game\n\tstart();\n}", "title": "" }, { "docid": "769a76f7b2360c061de7c9d0a4615fbc", "score": "0.51931995", "text": "greet() {\n\t\tconsole.log('Just Hello');\n\t}", "title": "" }, { "docid": "1bf56e9079714ce4be4317da811d27d9", "score": "0.5190675", "text": "gamestart() {}", "title": "" }, { "docid": "6b5beae5e1a38e5702309d875498ad5b", "score": "0.51859695", "text": "function send_user_to_training2_1(game) {\n SND_KEY.play();\n game.user_text = game.user_text.substr(game.user_text.length-1);\n game.accuracy_params = calculate_accuracy_params(game.story, game.user_text);\n update(game, { state: GAME_IS_TRAINING_L2 });\n}", "title": "" }, { "docid": "b1d2d95391324a4411e71cd2ac866e72", "score": "0.5183577", "text": "function monkeyTalk(phrase){\n let translation = [];\n phrase.split(' ').map(word => {\n if (word.substring(0,1).match(/[aeiouAEIOU]/)){\n translation.push(\"eek\");\n } else {\n translation.push(\"ook\");\n }\n });\n\n let newString = translation.join(' ');\n let monkeyTalk = newString.substring(0,1).toUpperCase() + newString.substring(1).toLowerCase() + '.';\n\n return monkeyTalk;\n}", "title": "" }, { "docid": "d388832192c055c23bf6d207728be272", "score": "0.51613235", "text": "start(game) {}", "title": "" }, { "docid": "e3d3c82e58d8e2aebf309157bd6db30a", "score": "0.51522285", "text": "function sayHello() {\n console.log('Welcome to JavaScript City dude!!!');\n}", "title": "" }, { "docid": "8fa8906324f1b4081042c280e186c78c", "score": "0.5147415", "text": "function HelloWorld() { // Create functions using this format\n console.log(\"Hello World!\");\n}", "title": "" }, { "docid": "154fbf0c6dec904ff21347aa00b35467", "score": "0.51403755", "text": "function C008_DramaClass_Damsel_FinalTwoPrisoners() {\n\tGameLogSpecificAdd(CurrentChapter, \"\", \"FinalTwoPrisoners\");\n\tActorSpecificChangeAttitude(\"Sarah\", 0, 1);\n\tActorSpecificChangeAttitude(\"Amanda\", 0, 1);\n\tActorSpecificChangeAttitude(\"Julia\", 0, 1);\n\tC008_DramaClass_Theater_GlobalStage = 300;\n\tC008_DramaClass_Theater_Ending = \"TwoPrisoners\";\n}", "title": "" }, { "docid": "08c9b2e6f1c02ea83bba79bcea46a1c0", "score": "0.5138031", "text": "function howto() {\n alert(\"Use arrow keys to move character.\\nAvoid moving and stationary obstacles.\\nCollect coins as you progress.\\nReach the end of the level before your time runs out!\");\n}", "title": "" }, { "docid": "e6f941e642dbc02c5c593b9edc16ba93", "score": "0.51259625", "text": "function englishGreeting() {\n return \"Cheerio\";\n}", "title": "" }, { "docid": "319d820f26bde2379702a66e41fcbc0e", "score": "0.5121744", "text": "function greetMe2(nome) {\n console.log(\"Olá, \" + nome)\n }", "title": "" }, { "docid": "634b761ed6cbf00c16553839732236e3", "score": "0.5112494", "text": "function speak() {\n console.log(\"Hello, world!\");\n}", "title": "" }, { "docid": "46368097ed28c130583c4420e6d18711", "score": "0.51112443", "text": "function help() {\n\tconsole.log(\"Простая интерпритация turtle на чистом js. Используются следующие команды:\");\n\tfor(let key in textarea.commands){\n\t\tconsole.log(`\\t${key}: ${textarea.commands[key].join(\", \")}`);\n\t}\n\tconsole.log(\"Пока что циклы работают странно (можно осуществить вложенные циклы, но не два цикла на одном уровне\");\n\tconsole.log(\"По всем вопросам обращаться https://vk.com/kun_alex\");\n\tconsole.log(\"Королёв Александр (С) 2020\");\n}", "title": "" }, { "docid": "e25846d3d4b1bdb6eb2dd28228572a36", "score": "0.5110694", "text": "function talk() {\n // Stop the beat and melody\n stopBeat()\n stopMelody()\n // Recognition starts and listens to what you're saying\n recognition.start()\n}", "title": "" }, { "docid": "32588196e4003dd00f213d262546bb61", "score": "0.5109612", "text": "function createEnemy() {\n // all code from TODO 11 and 12\n}", "title": "" }, { "docid": "771d00d31707b9db37a7bfa97d61fdfb", "score": "0.51083577", "text": "function game() {\n\t\n}", "title": "" }, { "docid": "844b3162b661373d4ff8a8155d48cb57", "score": "0.5106691", "text": "function madlib(word1, word2, word3, word4){\n return \"Learning to code is very \" + (word1) + \"and I really \" + (word2) +\n \"learning. \" + (word3) + \"it can be difficult at \" + (word4)\n}", "title": "" }, { "docid": "b3897379cc36c489d1afad4cf87d67c9", "score": "0.5103382", "text": "function sayGreeting() {\n return 'Hello World again';\n}", "title": "" }, { "docid": "f8c7bc742ea6a7954a4fca93e31f7f5a", "score": "0.50955415", "text": "function talk() {\n console.log('I have no mouth, and I must scream');\n console.log('I have no mouth, and I must scream');\n console.log('I have no mouth, and I must scream');\n}", "title": "" }, { "docid": "ec7be491e6d595491dd127452739efeb", "score": "0.50853515", "text": "function playLevelFive() {\n \n}", "title": "" }, { "docid": "ec7be491e6d595491dd127452739efeb", "score": "0.50853515", "text": "function playLevelFive() {\n \n}", "title": "" }, { "docid": "68529d71018214f6aa1201d73c2fbb0c", "score": "0.5083593", "text": "function ASK_ABOUT_INTRO(char, text) {\n return \"You ask \" + char.byname({article : DEFINITE}) + \" about \" + text +\n \".\";\n}", "title": "" }, { "docid": "0d99b3f002ea18d3f95f9496f3a35c02", "score": "0.50802463", "text": "getBestMonkey() {\n return this.monkeys[0];\n }", "title": "" }, { "docid": "f09f0bf25ba7ef2cf452582032e08cef", "score": "0.50784916", "text": "function sayBye() {\n console.log(\"Bye!\");\n}", "title": "" }, { "docid": "414547e3065b210cc61f0846361bb1ec", "score": "0.50730145", "text": "function greeting(){\n console.log(\"Let's play some Scrabble!\");\n}", "title": "" }, { "docid": "edae6aa8799796a9771349ebfc02306e", "score": "0.5072028", "text": "function LoveatFirstsight() {\n\tstory(\"You are rich and you have everything you want. Your dad works at the government (though he never said what part of government). Your mom is a teacher at your school. You feel safe and taken care of.\\ \\nOne day you are walking in the town and see a beautiful girl walking by. You want to talk to her but you are shy person.\")\n\toptions = [\"Talk to her\",\"keep walking\",\"Talk with your parents\"];\n\tanswer = setOptions(options);\n}", "title": "" }, { "docid": "ccceb62715db2cd7d1ac0570e65b66f1", "score": "0.507022", "text": "function tweendone2() {\n // move letters back to the right layer\n for (var k = 0; k < 6; k++)\n M.squares[k].letter.layer = 3;\n\n M.character.dead = true;\n M.squares[i].letter.dead = true;\n\n if (checkForVictory()) {\n // new letter\n M.goalBox.dead = true;\n M.goalSprite.dead = true;\n\n Difficulty.advancediff();\n Profile.save();\n\n played++;\n if (played == Difficulty.windowsize)\n Main.changeScreen(Story);\n else\n setupNextLetter();\n\n } else {\n // need more letters\n M.allowClick = true;\n }\n }", "title": "" }, { "docid": "25ad521a979a94ab2ef21300dfa185f0", "score": "0.50701505", "text": "function startGame(){\n if(readlineSync.keyInYNStrict(\"Welcome to Hangman! Are you ready to play? Please say 'Y' for\"\n + \" yes or 'N' for no \")){\n let choices = ['SinglePlayer', 'Multiplayer'];\n let userChoice = (readlineSync.keyInSelect(choices, 'Would you like to play single player or multiplayer?'));\n if(userChoice === 0){\n console.log('Cool, lets begin!');\n runGame();\n }\n else if(userChoice === 1){\n getWordFromPlayer1(); \n runMultiplayerGame();\n }\n }\n else{\n console.log('Why arent you ready yet');\n startGame();\n }\n}", "title": "" }, { "docid": "46a8b83b255219eb41620c252b06190f", "score": "0.5067656", "text": "function sayHello() {\n return \"Hello Duniya!\";\n}", "title": "" }, { "docid": "9f285d11e2b335fe885adebc2a344f3f", "score": "0.5066106", "text": "function Ninja() {}", "title": "" }, { "docid": "e51b715d5689a87db365b74763b7c8cf", "score": "0.5065879", "text": "walk() {\n console.log('Walk like dog');\n }", "title": "" }, { "docid": "3af7d548453d0a51679476e5f0112991", "score": "0.50655705", "text": "function main() {\n console.log(\n JSON.stringify(\n {\n title: 'Japanese JIS to US Keyboard: Remap Symbol Keys',\n maintainers: ['halfwhole'],\n rules: rules(),\n },\n null,\n ' '\n )\n )\n}", "title": "" }, { "docid": "5c1be57b7a8a9a89d6e139be22006ec0", "score": "0.50622374", "text": "run(message, {game}) {\n var randNum;\n game = game.toLowerCase();\n if (game == \"overwatch\") {\n randNum = Math.floor(Math.random() * 32);\n switch(randNum) {\n case 0: \n return message.say(\"Symmetra\");\n case 1: \n return message.say(\"Zenyatta\");\n case 2: \n return message.say(\"Moira\");\n case 3: \n return message.say(\"Mercy\");\n case 4: \n return message.say(\"Lucio\");\n case 5: \n return message.say(\"Brigitte\");\n case 6: \n return message.say(\"Baptiste\");\n case 7: \n return message.say(\"Ana\");\n case 8: \n return message.say(\"Widowmaker\");\n case 9: \n return message.say(\"Tracer\");\n case 10: \n return message.say(\"Torbjorn\");\n case 11: \n return message.say(\"Sombra\");\n case 12: \n return message.say(\"Soldier:76\");\n case 13: \n return message.say(\"Reaper\");\n case 14: \n return message.say(\"Pharah\");\n case 15: \n return message.say(\"Mei\");\n case 16: \n return message.say(\"McCree\");\n case 17: \n return message.say(\"Junkrat\");\n case 18: \n return message.say(\"Hanzo\");\n case 19: \n return message.say(\"Genji\");\n case 20: \n return message.say(\"Echo\");\n case 21: \n return message.say(\"Doomfist\");\n case 22: \n return message.say(\"Bastion\");\n case 23: \n return message.say(\"Ashe\");\n case 24: \n return message.say(\"Zarya\");\n case 25: \n return message.say(\"Wrecking Ball\");\n case 26: \n return message.say(\"Winston\");\n case 27: \n return message.say(\"Sigma\");\n case 28: \n return message.say(\"Roadhog\");\n case 29: \n return message.say(\"Reinhardt\");\n case 30: \n return message.say(\"Orisa\");\n case 31: \n return message.say(\"D.Va\");\n }\n\n }\n\n else if (game == \"valorant\") {\n randNum = Math.floor(Math.random() * 11);\n switch(randNum) {\n case 0: \n return message.say(\"Omen\");\n case 1: \n return message.say(\"Phoenix\");\n case 2: \n return message.say(\"Sage\");\n case 3: \n return message.say(\"Cypher\");\n case 4: \n return message.say(\"Sova\");\n case 5: \n return message.say(\"Jett\");\n case 6: \n return message.say(\"Raze\");\n case 7: \n return message.say(\"Brimstone\");\n case 8: \n return message.say(\"Breach\");\n case 9: \n return message.say(\"Viper\");\n case 10: \n return message.say(\"Reyna\");\n }\n }\n\n else if ((game == \"apex legends\") || (game == \"apex\")) {\n randNum = Math.floor(Math.random() * 13);\n switch(randNum) {\n case 0: \n return message.say(\"Bangalore\");\n case 1: \n return message.say(\"Bloodhound\");\n case 2: \n return message.say(\"Caustic\");\n case 3: \n return message.say(\"Crypto\");\n case 4: \n return message.say(\"Gibraltar\");\n case 5: \n return message.say(\"Lifeline\");\n case 6: \n return message.say(\"Loba\");\n case 7: \n return message.say(\"Mirage\");\n case 8: \n return message.say(\"Octane\");\n case 9: \n return message.say(\"Pathfinder\");\n case 10: \n return message.say(\"Revenant\");\n case 11: \n return message.say(\"Wattson\");\n case 12: \n return message.say(\"Wraith\");\n }\n }\n\n\n return;\n }", "title": "" }, { "docid": "bfbddcdf67fda7f34a2ed116c00a7ede", "score": "0.50608927", "text": "function startGame() {\n state = {\n medPack: false,\n badge: false,\n politeCop: false,\n rudeCop: false,\n ski: false,\n hairspray: false,\n lighter: false,\n nailFile: false,\n };\n showTextNode(1);\n}", "title": "" }, { "docid": "a7ab9e7b7f1cfadffe1516824f2de0a4", "score": "0.5059073", "text": "wheelie() {\n return 'Wheee!';\n }", "title": "" }, { "docid": "fb37f9c96e8ac0b06999063cd3eed26e", "score": "0.50569236", "text": "function MadeWithLove() {\n \treturn (\n <Typography variant=\"subtitle\">\n \t{'Built with love by Team Home.'}\n \t</Typography>\n \t);\n}", "title": "" }, { "docid": "9e5fe97b6c9b9d173a7767faf5bafbbd", "score": "0.5055379", "text": "chug() {\n console.log(\"this better keep me awake\");\n }", "title": "" }, { "docid": "5be1656292f9514df3c20f95bb5b454f", "score": "0.5053624", "text": "runtime() {\n\t\tif (arg[2] === \"my-tweets\") {\n\t\t\tliri.tweets();\n\t\t} else if (arg[2] === \"spotify-this-song\") {\n\t\t\tliri.music();\n\t\t} else if (arg[2] === \"movie-this\") {\n\t\t\tliri.movie();\n\t\t} else if (arg[2] === \"do-what-it-says\") {\n\t\t\tliri.says();\n\t\t}\n\t}", "title": "" }, { "docid": "5337ce242a535f1d5bc45ef818f913ce", "score": "0.5047939", "text": "function loveJS(){\n console.log(\"I Love JavaScript!\");\n}", "title": "" }, { "docid": "b4e99d3fad764649866f1bf97e112394", "score": "0.5045267", "text": "introduction() {\n if (player.sprite.position.y < 288 && textStateFP === 0) {\n friendTalkedTo = true;\n textStateFP = 1\n friend.dialogue5.play();\n } else if (\n friend.sprite.overlap(player.sprite) &&\n keyCode === SHIFT &&\n textStateFP === 0\n ) {\n friendTalkedTo = true;\n textStateFP = 1\n friend.dialogue2.play();\n }\n }", "title": "" }, { "docid": "74c84be07ec1e15d16d2ad5f03a175b3", "score": "0.50423473", "text": "swim() {\n return 'Just keep swimming…';\n }", "title": "" }, { "docid": "fc210eea9fc1adc1f49ab92baf35d06c", "score": "0.50417215", "text": "function startGame() {\n\n easyAnagrams = [\n {answer: \"calm\", clue: \"peace\"},\n {answer: \"lantern\", clue: \"guiding light\"},\n {answer: \"blemish\", clue: \"imperfection\"},\n {answer: \"divine\", clue: \"holy\"},\n {answer: \"emotion\", clue: \"feelings\"},\n {answer: \"rotation\", clue: \"circular\"},\n {answer: \"karma\", clue: \"what comes around goes around\"},\n {answer: \"revenge\", clue: \"payback\"},\n {answer: \"shipwreck\", clue: \"the Titanic\"},\n {answer: \"poetry\", clue: \"... in motion\"}];\n\n mediumAnagrams = [\n {answer: \"rejoice\", clue: \"celebrate\"},\n {answer: \"elevate\", clue: \"higher\"},\n {answer: \"invulnerable\", clue: \"can't be hurt\"},\n {answer: \"liberty\", clue: \"freedom\"},\n {answer: \"scarce\", clue: \"hard to find\"},\n {answer: \"zealot\", clue: \"a true fanatic\"},\n {answer: \"heretic\", clue: \"a blasphemous person\"},\n {answer: \"subordinate\", clue: \"member of the rank and file\"},\n {answer: \"citadel\", clue: \"fortress\"},\n {answer: \"paramount\", clue: \"important\"}];\n\n hardAnagrams = [\n {answer: \"tyrannical\", clue: \"oppressive\"},\n {answer: \"meticulous\", clue: \"in great detail\"},\n {answer: \"miniscule\", clue: \"tiny\"},\n {answer: \"flagrant\", clue: \"brazen wrongdoing\"},\n {answer: \"juxtapostion\", clue: \"side by side comparison\"},\n {answer: \"paradox\", clue: \"a contradiction\"},\n {answer: \"philanthropic\", clue: \"charitable intentions\"},\n {answer: \"impervious\", clue: \"no entry\"},\n {answer: \"emphatic\", clue: \"forceful\"},\n {answer: \"prehistoric\", clue: \"time of the dinosaurs\"}];\n \n anagramCount = 0;\n clearInterval(timeLeft = 30);\n timer.classList.remove(\"red-timer\");\n timer.classList.remove(\"yellow-timer\");\n timer.classList.add(\"green-timer\");\n\n // on easy mode I want to shuffle through the easyAnagrams object take out the answer and use function to scramble the word to make the anagram\n if (sessionStorage.getItem(\"gamemode\") === \"easy\") {\n indexAnagram = [Math.floor(Math.random()*easyAnagrams.length)];\n shuffledAnagrams = easyAnagrams[indexAnagram];\n easyAnagrams.splice(indexAnagram,1);\n anagram = createAnagram(shuffledAnagrams.answer);\n answer = shuffledAnagrams.answer;\n showAnagram(anagram, shuffledAnagrams.clue);\n \n\n // on medium mode I want to shuffle through the mediumAnagrams object\n } else if (sessionStorage.getItem(\"gamemode\") === \"medium\") {\n indexAnagram = [Math.floor(Math.random()*mediumAnagrams.length)];\n shuffledAnagrams = mediumAnagrams[indexAnagram];\n mediumAnagrams.splice(indexAnagram,1);\n anagram = createAnagram(shuffledAnagrams.answer);\n answer = shuffledAnagrams.answer;\n showAnagram(anagram, shuffledAnagrams.clue);\n\n // when it's neither on easy or medium I want to shuffle through the hardAnagrams object\n } else {\n indexAnagram = [Math.floor(Math.random()*hardAnagrams.length)];\n shuffledAnagrams = hardAnagrams[indexAnagram];\n hardAnagrams.splice(indexAnagram,1);\n anagram = createAnagram(shuffledAnagrams.answer)\n answer = shuffledAnagrams.answer;\n showAnagram(anagram, shuffledAnagrams.clue);\n} anagramCount +=1;\n}", "title": "" }, { "docid": "7475cb66d4056d3636880b338990362b", "score": "0.50362", "text": "sayHi() {\n console.log('Hello from Software Engineer');\n }", "title": "" }, { "docid": "a0f2ed2207b9464d0a04bb4cbe5b09c9", "score": "0.50307775", "text": "function youLose() {\n\tconsole.log(\"\\n\\tThe \" + wildEnemy.type + \" killed you! \\n\\t Now you will be doomed to roam the lands beyond the wall as a Wight. \\n\\tTough luck hero. \\n\\tWinter is Here.\");\n\tconsole.log(\"\\n\\tGAME OVER!\");\n}", "title": "" }, { "docid": "9831e052da91a9ad47742ff42df2ece0", "score": "0.50264865", "text": "function basicGreeter(){\n return \"Hello!\"\n}", "title": "" }, { "docid": "252bedd8dc71c438db1203135f8dc1f8", "score": "0.5022576", "text": "function greet() {\n return \"hello world!\"\n}", "title": "" }, { "docid": "585350bd72b36026690784b1b11e395b", "score": "0.50221413", "text": "function helloworld() {\n return 'hello world!';\n}", "title": "" }, { "docid": "585350bd72b36026690784b1b11e395b", "score": "0.50221413", "text": "function helloworld() {\n return 'hello world!';\n}", "title": "" }, { "docid": "6af510fce7f973e8ccdc1cba130b64fb", "score": "0.502027", "text": "function runGame() {\n\tchooseWord();\n\tsetWordDisplay(currentHiddenWord);\n}", "title": "" }, { "docid": "5ace11eb427aaeb3b824f5d110102b39", "score": "0.5007516", "text": "function helloworld() {\n return 'hello world!';\n}", "title": "" }, { "docid": "9fb21b5e3b32d7e2b1ff7ecb5189795b", "score": "0.5004921", "text": "function Level2() {}", "title": "" }, { "docid": "322b718839423fb0b022217c5ced1d6e", "score": "0.5003389", "text": "function greet2(firstname, lastname, language) {\n language = language || 'en'\n console.log(firstname)\n console.log(lastname)\n console.log(language)\n console.log('-----------')\n}", "title": "" }, { "docid": "bf63c41f1b2d0ecd3586b312f8d3b00b", "score": "0.5002757", "text": "function morning(name1){\n return `Good morning! ${name1.toUpperCase()}`;\n }", "title": "" }, { "docid": "898b49becf1ba934f864369d2f9474f0", "score": "0.50012463", "text": "function gameIntro() {\n push();\n fill(0);\n textSize(60);\n text(\"DONUT COUNTY \\nDEMAKE\", width / 2, height / 2);\n textSize(25);\n text(\"click to play\", width / 2, height / 1.4);\n pop();\n}", "title": "" }, { "docid": "584cf474fb8518bf6db6b166300ff8d0", "score": "0.499805", "text": "function monkey(hljs) {\n var NUMBER = {\n className: 'number', relevance: 0,\n variants: [\n {\n begin: '[$][a-fA-F0-9]+'\n },\n hljs.NUMBER_MODE\n ]\n };\n\n return {\n name: 'Monkey',\n case_insensitive: true,\n keywords: {\n keyword: 'public private property continue exit extern new try catch ' +\n 'eachin not abstract final select case default const local global field ' +\n 'end if then else elseif endif while wend repeat until forever for ' +\n 'to step next return module inline throw import',\n\n built_in: 'DebugLog DebugStop Error Print ACos ACosr ASin ASinr ATan ATan2 ATan2r ATanr Abs Abs Ceil ' +\n 'Clamp Clamp Cos Cosr Exp Floor Log Max Max Min Min Pow Sgn Sgn Sin Sinr Sqrt Tan Tanr Seed PI HALFPI TWOPI',\n\n literal: 'true false null and or shl shr mod'\n },\n illegal: /\\/\\*/,\n contains: [\n hljs.COMMENT('#rem', '#end'),\n hljs.COMMENT(\n \"'\",\n '$',\n {\n relevance: 0\n }\n ),\n {\n className: 'function',\n beginKeywords: 'function method', end: '[(=:]|$',\n illegal: /\\n/,\n contains: [\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface', end: '$',\n contains: [\n {\n beginKeywords: 'extends implements'\n },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n },\n {\n className: 'built_in',\n begin: '\\\\b(self|super)\\\\b'\n },\n {\n className: 'meta',\n begin: '\\\\s*#', end: '$',\n keywords: {'meta-keyword': 'if else elseif endif end then'}\n },\n {\n className: 'meta',\n begin: '^\\\\s*strict\\\\b'\n },\n {\n beginKeywords: 'alias', end: '=',\n contains: [hljs.UNDERSCORE_TITLE_MODE]\n },\n hljs.QUOTE_STRING_MODE,\n NUMBER\n ]\n }\n}", "title": "" }, { "docid": "3e3931483cf5b5ef1ed57d72b6c289e5", "score": "0.49966207", "text": "function poop() {\n return 'POOP';\n}", "title": "" }, { "docid": "bc205eea6ce30a303c08f9b5e5c2a149", "score": "0.49948883", "text": "function greet() {\n return \"hello world!\";\n}", "title": "" }, { "docid": "2b7e5dabbb6155e7a5a083a4fa8ad937", "score": "0.49939987", "text": "function instructions() {\n push();\n textFont(paragraphFont);\n textAlign(CENTER, CENTER);\n textSize(15);\n fill(255, 255, 255);\n text(`Hello, ${agentProfile.name}`, width / 2, height / 2 - 40);\n text(\n `Collect the asteroids with your index finger using your camera!`,\n width / 2,\n height / 2\n );\n text(`Avoid the rockets!`, width / 2, height / 2 + 30);\n text(`Press any key to continue`, width / 2, height / 2 + 50);\n pop();\n}", "title": "" }, { "docid": "33de22a7a492371b0344c5f6f6b7a068", "score": "0.49935728", "text": "function team2(name){\n\tthis.name = name;\n\tthis.played = this.won = this.drawn = this.lost = this.goals = this.points = this.score = 0;\n}", "title": "" }, { "docid": "f1a4fa0c723610109c199c32831e29e6", "score": "0.499152", "text": "function setupNewGame(context){\n isGameRunning = true;\n Player = context.author;\n Channel = context.channel;\n\n //Get random word of selected difficulty\n switch (Difficulty){\n case 1: //Easy\n HM_Word = HM_Words.easy[Math.floor(Math.random() * HM_Words.easy.length)];\n context.channel.send(\"Starting a easy difficulty game!\\nSend 'quit' to stop playing\");\n break;\n case 3: //Hard\n HM_Word = HM_Words.hard[Math.floor(Math.random() * HM_Words.hard.length)];\n context.channel.send(\"Starting a hard difficulty game!\\nSend 'quit' to stop playing\");\n break;\n default: //Normal\n HM_Word = HM_Words.normal[Math.floor(Math.random() * HM_Words.normal.length)];\n context.channel.send(\"Starting a normal difficulty game!\\nSend 'quit' to stop playing\");\n break;\n }\n\n //console.log(\"Starting new game with the Word '\" + HM_Word +\"'\");\n \n updateGameDisplay();\n}", "title": "" }, { "docid": "96a872e03f9073eb898836e04f95fea6", "score": "0.49897212", "text": "function gamemode2() {\n\t\n\t// Starfields\n\t\n\tsf.draw()\n\t\n\t// Menu\n\tswitch (ram[\"tsmode\"]) {\n\t\tcase \"title\":\n\t\t\ttsmenu.draw()\n\t\t\tbreak\n\t\tcase \"option\":\n\t\t\topmenu.draw()\n\t\t\tbreak\n\t\tdefault:\n\t}\n\t\n\t\n\t// Logo\n\t\n\tif (ram[\"titlescreenLoaded\"]){\n\t\tdraw.drawImage(ram[\"c_titlescreen\"],100,0)\n\t}\n\t\n\t// Overlaygradient\n\t\n\tdraw.fillStyle = ram[\"overlayGradient\"]\n\tdraw.fillRect(0,0,width,height)\n\t\n\t// Version info\n\t\n\ttxt = build\n\t\n\tdraw.font = \"16px monospace\"\n\tvar xmax = draw.measureText(txt).width\n\t\n\tdraw.beginPath()\n\tdraw.moveTo(width+1,height-16)\n\tdraw.lineTo(width-xmax-32,height-16)\n\tdraw.lineTo(width-xmax-16,height)\n\tdraw.lineTo(width+1,height+1)\n\tdraw.closePath()\n\tdraw.strokeStyle = \"#000\"\n\tdraw.fillStyle = \"rgba(16,32,128,0.5)\"\n\t\n\tdraw.fill()\n\tdraw.stroke()\n\tdraw.fillStyle = \"#FFF\"\n\tdraw.fillText(txt,width-xmax,height-2)\n\t\t\n\t// Black2Transparent\n\t\n\tdraw.fillStyle = \"rgba(0,0,0,\" + (ram[\"fadeTime\"]/120) + \")\"\n\tdraw.fillRect(0,0,width,height)\n\t\n\t\n\tif (ram[\"fadeTime\"]) {\n\t\tram[\"fadeTime\"]--\n\t}\n}", "title": "" }, { "docid": "22446560410792fea3f0c11b1892f7f4", "score": "0.49885312", "text": "function greet() {\n console.log('Good Morning');\n}", "title": "" } ]
d7bee5dc50c953f3fbbc928a1edd45fc
const a = [1,2,4,6,2]; const b = [5, 10 , 100, 20, 30, 30, 12] let smallestNumber = a[0]; console.log(getSmallestElement(a)); getSmallestElement(b); Function to get smallest number in an array
[ { "docid": "747e3f8735fd78fd742aa5ac56a6d55e", "score": "0.7845212", "text": "function getSmallestElement(array) {\n let smallestNumber = array[0];\n for (let i=0; i<array.length;i++) {\n let value= array[i];\n smallestNumber = (value < smallestNumber) ? value: smallestNumber; \n }\n return smallestNumber;\n}", "title": "" } ]
[ { "docid": "f1d9b610615daf297c218d25e493cc82", "score": "0.8324992", "text": "function smallestElement(numbers2) {\n let min = numbers2[0];\n for (let i = 0; i < numbers2.length; i++) {\n const element = numbers2[i];\n if (element < min) {\n min = element;\n }\n }\n return min;\n}", "title": "" }, { "docid": "f571a9add7cf31b6d90d572b346d86ab", "score": "0.81313825", "text": "function smallestElement(numbers){\n let smallest = numbers[0];\n for(let i =0; i< numbers.length; i++){\n const element = numbers[i];\n if(element < smallest){\n smallest = element;\n }\n \n }\n return smallest;\n\n}", "title": "" }, { "docid": "7683f71c13a4c8a0d00f9136b43bf2ff", "score": "0.80057275", "text": "function findMin(numbers) {\r\n let minimum = numbers[0];\r\n for (let i = 0; i < numbers.length; i++) {\r\n if (numbers[i] < minimum) {\r\n minimum = numbers[i]\r\n }\r\n }\r\n return minimum\r\n}", "title": "" }, { "docid": "e2b1dace4e0ebf7495137ad448d1907a", "score": "0.79986984", "text": "function findMin(numbers) {\n let minNumber = numbers[0];\n for (i = 0; i < numbers.length; i++) {\n if (numbers[i] < minNumber) {\n minNumber = numbers[i]\n }\n }\n return minNumber;\n}", "title": "" }, { "docid": "f436b2e095cf8ea5f6691279164628d9", "score": "0.7858368", "text": "function smallerNumber(arrayNumbers){\n let menor = Math.min(...arrayNumbers)\n return menor\n}", "title": "" }, { "docid": "64161c7cb8e53fe181b7197492e16d23", "score": "0.7852487", "text": "function smallest_number(a){\n return Math.min(...a)\n }", "title": "" }, { "docid": "83b23c179b1df568fbe66f5edb951eff", "score": "0.77599543", "text": "function smallestNumber (a, b) {\n if (a < b) {\n return a;\n } else if (b < a) {\n return b;\n }\n}", "title": "" }, { "docid": "8a00c0087f4d925f4fb0ea48137299b4", "score": "0.77091444", "text": "function min_element(arr){\nvar min_ele = Math.min(...arr);\nreturn min_ele;\n}", "title": "" }, { "docid": "cba43fb72116ada330c8e7f944d5d745", "score": "0.7646632", "text": "function findSmallest(arr) {\n return Math.min.apply(null, arr);\n}", "title": "" }, { "docid": "75a94a62b32d5be55f9e52d416f7cc3e", "score": "0.7608577", "text": "function smallestNum(numbers){\n numbers.sort((a, b) => {\n return a - b;\n });\n\n return numbers[0];\n}", "title": "" }, { "docid": "3dc809c0b7979662cf94fd62ef1455ca", "score": "0.75920916", "text": "function smallestNumber(arr){\n smallest = arr[0]\n for(let i = 1; i < arr.length; i++){\n if (arr[i] < smallest) {\n smallest = arr[i]\n }\n }\n return smallest\n}", "title": "" }, { "docid": "428ae2aa93e79e652addacb0c18c4ae4", "score": "0.75808734", "text": "function findMinValue(numArray){\n let smallestNum = numArray[0];\n //The function should iterate through the array and return the minimum value from the array. \n for (let index=1; index<numArray.length; index++){\n if(numArray[index]<smallestNum){\n smallestNum=numArray[index];\n }\n }\n return smallestNum;\n}", "title": "" }, { "docid": "9364bc61088a89ed62f09a628fa147f6", "score": "0.75559413", "text": "function min(numbers) {\n var smallest = numbers[0];\n each(numbers, function(num) {\n if(num < smallest) {\n smallest = num;\n }\n });\n return smallest;\n}", "title": "" }, { "docid": "9d7cd6843e10781aa53c8d62733580fe", "score": "0.75556475", "text": "function findMinimum(arr){\n arr.sort((function(a, b){\n return a - b\n }))\n return arr[0]\n }", "title": "" }, { "docid": "ac91040d5f68f63b70db19f05c0ec500", "score": "0.7552933", "text": "function task17_20_9(){\n A = [24, 53, 78, 91, 12];\n var min = +Math.min(...A);\n document.write(\"Array : \"+A + '<br>');\n document.write(\"Smallest: \" + min);\n}", "title": "" }, { "docid": "f483b0b90486ac913a59ec49d36300f7", "score": "0.754967", "text": "function lowestNumber (){\n a.forEach(function (element){\n if (element < min) {\n min = element\n }\n console.log(min)\n })\n}", "title": "" }, { "docid": "de7ac5d2c73a9e95253a09cd6cdd49c8", "score": "0.75438416", "text": "function findTwoSmallest(numbers) {\n var twoSmallest = [];\n var sorted = numbers.sort();\n twoSmallest.push(sorted[0]);\n twoSmallest.push(sorted[1]);\n return twoSmallest;\n}", "title": "" }, { "docid": "e5215226e56514a28ed1d228ce519d52", "score": "0.7520898", "text": "function min(...arr){ // This function uses a js math operator that analyses and array and give the smallest number\n return Math.min(...arr);\n}", "title": "" }, { "docid": "ab5ec75c6a6fbd6cd667ddd44df11b22", "score": "0.7520068", "text": "function smallestNumber (array){\n var min = Infinity;\n var min2 = Infinity;\nfor(var i = 0; i < array.length; i++) {\n if(min > array[i]) {\n min2 = min;\n min = array[i];\n } else if (min2 > array[i]){\n min2 = array[i];\n }\n } return min2;\n}", "title": "" }, { "docid": "ae731c89c761e248c7d861f8363f2eb9", "score": "0.75055444", "text": "function smallestOf(a, b) {\n return Math.abs(a) < Math.abs(b) ? a : b;\n}", "title": "" }, { "docid": "ac80ac3b4aaee7bb2babd3434c701985", "score": "0.7482994", "text": "function findTheSmallestInteger(a) {\n a = a.sort((a, b) => a - b);\n return a[0]\n}", "title": "" }, { "docid": "f1b8b13d75edaa9923d179ce73b11b6f", "score": "0.74808955", "text": "function findSmallestInt(arr) {\n return Math.min(...arr)\n}", "title": "" }, { "docid": "3d1a4c3c761b6598083b5ce2fd74bf8c", "score": "0.7469768", "text": "function findSmallestElement(arr) {\n var min = arr[0];\n for(var i = 1; i < arr.length; i++){\n if(arr[i] < min){\n min = arr[i];\n }\n }\n return min;\n}", "title": "" }, { "docid": "c0a716affde114bc2cacb820f42ed808", "score": "0.7395642", "text": "static min(a) {\n let m = Number.MAX_VALUE;\n let index = 0;\n for (let i = 0, len = a.length; i < len; i++) {\n m = Math.min(m, a[i]);\n if (m === a[i])\n index = i;\n }\n return { value: m, index: index };\n }", "title": "" }, { "docid": "3dcd8e61201f5900c709d993669c0cfd", "score": "0.7391347", "text": "function minInArray(array) {\n\tlet min = array[0];\n\tfor (var i = 1; i < array.length; i++) {\n\t\tif (array[i]<min) \n\t\t{\n\t\t\tmin = array[i];\n\t\t}\n\n\n\t\t\n}\nreturn min;\n}", "title": "" }, { "docid": "38548d10278e7747842f2821b671b1cb", "score": "0.73891574", "text": "function smallestNumber(arr) {\n let small = arr[1];\n\n for (let i = 0; i < arr.length; i += 1) {\n if (arr[i] < small) {\n small = arr[i];\n }\n }\n console.log(small);\n}", "title": "" }, { "docid": "93bbd9877448fc0ab23c8aee31541a62", "score": "0.7347971", "text": "function findMin(a, b) {\n if(isValidNumber(a) && isValidNumber(b)) {\n return a < b ? a : b;\n } else {\n throw \"Invalid argument types\";\n }\n}", "title": "" }, { "docid": "32d3e6dd32058ff65f3c7c81173069fd", "score": "0.7345862", "text": "function min(a, b) {\n if (a < b)\n return a;\n else\n return b;\n }", "title": "" }, { "docid": "e82c9d8a8aa4c372b2ca0a04c258c29a", "score": "0.73357433", "text": "function findLowest(array)\n{\n\tlet min = 0;\n\tfor(i = 1; i < array.length; i++)\n\t{\n\t\tif(array[i] < array[min])\n\t\t{\n\t\t\tmin = i;\n\t\t}\n\t}\n\treturn min;\n}", "title": "" }, { "docid": "38fe0fcc1f7a459873aee9fab2a6c89f", "score": "0.73356503", "text": "function myMinimal(numbers){\n var minimal = numbers[0];\n numbers.forEach(function(number){\n if (number < minimal){\n minimal = number;\n }\n });\n return minimal;\n}", "title": "" }, { "docid": "404f748252ae84947d6f146cfff1f30b", "score": "0.73338234", "text": "function minimum(a, b) {\n if(a < b){\n return a;\n }\n return b;\n}", "title": "" }, { "docid": "8d40a5be098fdcf1b27ca756317bf3cd", "score": "0.7329279", "text": "function minimum(a, b) {\n if (a < b)\n return a;\n else\n return b;\n}", "title": "" }, { "docid": "8d40a5be098fdcf1b27ca756317bf3cd", "score": "0.7329279", "text": "function minimum(a, b) {\n if (a < b)\n return a;\n else\n return b;\n}", "title": "" }, { "docid": "f39be9db5c2a782d9ca07f6134099a96", "score": "0.73220384", "text": "function minimum(a,b) {\n if(a < b) return a;\n return b;\n}", "title": "" }, { "docid": "b3679bb1fbe3f38569d5f06398be77a9", "score": "0.7308426", "text": "function min(arr) {\n return arr.sort((a, b) => a - b)[0];\n}", "title": "" }, { "docid": "2dfe301d66adf37d74e6e76af66f075e", "score": "0.72827834", "text": "function minInArray(arr){\n var min = 0;\n for (let i = 0; i < arr.length; i++) {\n min = Math.min(arr[i]);\n\n \n }\n return min;\n}", "title": "" }, { "docid": "9a03e3be31e2cd3d385e72d729546e86", "score": "0.7277909", "text": "function min(a, b) {\n if (a < b)\n return a;\n else\n return b;\n}", "title": "" }, { "docid": "532888dd8f7eec6c341ffef29bae02fa", "score": "0.72666204", "text": "function findMin(array) {\n let min = null;\n // console.log(\"findminarray\",array);\n\n for (let i = 0; i < array.length; i++) {\n let cur = array[i];\n // console.log(\"ccurrr\",cur);\n \n if (min === null) {\n min = cur;\n }\n if (cur < min) {\n min = cur;\n }\n }\n return min;\n}", "title": "" }, { "docid": "e4d843c858dd3ee32ac4e82b0425502f", "score": "0.72657496", "text": "function minimumElementOfArr(arr) {\n var result;\n var min = arr[0];\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] < min) {\n min = arr[i]\n }\n \n}\nreturn min;\n}", "title": "" }, { "docid": "ef93b1a1d241a6fd51a46fab250c91e1", "score": "0.726484", "text": "function min(a,b) {\n if (a < b)\n return a;\n else\n return b;\n}", "title": "" }, { "docid": "49bad528e12e18da97d8f3dd8b3af79e", "score": "0.7264697", "text": "function lowestValue(array) {\n let lowest = 0\n for (let element of array) {\n if (element < lowest) {\n lowest = element\n }\n }\n return lowest\n}", "title": "" }, { "docid": "9b0a36bcab1349fcacc2b4a943993a90", "score": "0.724783", "text": "function min(a, b) {\n if (a < b)\n return a;\n else\n return b;\n}", "title": "" }, { "docid": "57dcecdc120229da4d57ba603e16ab9e", "score": "0.72471064", "text": "function minInArray(array){\n\tvar minimum = array[0];\n\tfor(var i=1; i<array.length; i++){\n\t\t\tif (array[i]<minimum){\n\t\t\tminimum=array[i];\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n}", "title": "" }, { "docid": "79b7f75441af29678806abc1b3ebe589", "score": "0.72388", "text": "function min(arr){\r\n let min = arr[0];\r\n for(let i = 1; i < arr.length; i+=1){\r\n if(arr[i] < min){\r\n min = arr[i];\r\n }\r\n }\r\n return min;\r\n}", "title": "" }, { "docid": "411ae3939442ef87ef524bcd4f69d0e7", "score": "0.7235199", "text": "function min(a,b) {\n if(a < b) {\n return a;\n } else {\n return b;\n }\n}", "title": "" }, { "docid": "4c05735fb2bceefb30be58f40b03c31e", "score": "0.7231256", "text": "function min(a, b) { \n if(a < b) {\n return a;\n } else if (b < a){\n return b;\n } else {\n return 0;\n }\n\n}", "title": "" }, { "docid": "57885466d6656ec57b6e77c2c6a008cd", "score": "0.7230464", "text": "function min(a, b) {\n if (a < b) return a\n return b\n}", "title": "" }, { "docid": "81198397e947451ef37429e6c113dffb", "score": "0.72176194", "text": "function twoSmallestNumbers(array) {\n var smallest = array[0];\n var secondSmallest = array[0];\n array.forEach(function (number) {\n if (number < smallest) {\n // console.log(\"hello\");\n secondSmallest = smallest;\n smallest = number;\n } else if (number < secondSmallest) {\n secondSmallest = number;\n }\n });\n return [smallest, secondSmallest];\n}", "title": "" }, { "docid": "2be0f1f1ecafc0f55ba775a1fc21e335", "score": "0.7216221", "text": "function findLowestIndex(nums){\n let index = 0;\n let min = nums[index];\n for(let i = 1; i < nums.length; i++){\n if(nums[i] <= min){\n min = nums[i];\n index = i;\n }\n }\n return index;\n}", "title": "" }, { "docid": "010c8fb65ac79f6f013cd988aa20334c", "score": "0.72143435", "text": "function minimum(arr){\n var min = arr[0];\n for (var i = 1; i < arr.length; i++) {\n if (arr[i] < min) {\n min = arr[i];\n }\n }\n return min;\n}", "title": "" }, { "docid": "f47cc239d490d32ee0e51410579f7320", "score": "0.72138804", "text": "function findSmallestElement(arr){\n if(arr.length === 0){\n return 0;\n }\n var smallestElement = arr[0];\n for (var i = 0; i < arr.length; i++){\n if (arr[i] < smallestElement){\n smallestElement = arr[i];\n }\n }\n return smallestElement;\n }", "title": "" }, { "docid": "b2c7b6d52df8f7c3fc57e809f4502286", "score": "0.7209912", "text": "function min (a,b){\n if (a < b)\n return a;\n else\n return b;\n}", "title": "" }, { "docid": "136f3ff94534a568155a871fefce4603", "score": "0.7199143", "text": "function min(array) {\n let i = 0;\n let minNum = array[0];\n\n while (i < array.length) {\n if(array[i] < minNum) {\n minNum = array[i];\n }\n i++;\n }\n return minNum;\n}", "title": "" }, { "docid": "7184a01df408eac179083a1a947de64a", "score": "0.71888477", "text": "function findMin(arr) {\n var min = arr[0];\n for ( var i = 1; i < arr.length; i++) {\n if ( arr[i] < min) {\n min = arr[i];\n }\n }\n return min;\n}", "title": "" }, { "docid": "96dd5c82404faa8426646ff787823e13", "score": "0.7179944", "text": "function leastLarger(a, i) {\n const targetVal = a[i]\n const largerVals = a.filter(num => num > targetVal)\n // if (largerVals.length === 0) return -1\n const leastLargeVal = Math.min(...largerVals)\n return a.findIndex(num => num === leastLargeVal)\n}", "title": "" }, { "docid": "7252d6e4b2d150dcc1d80dab35439b7f", "score": "0.7167416", "text": "function smallestNumber(num1, num2) {\n return Math.min(num1, num2);\n}", "title": "" }, { "docid": "7252d6e4b2d150dcc1d80dab35439b7f", "score": "0.7167416", "text": "function smallestNumber(num1, num2) {\n return Math.min(num1, num2);\n}", "title": "" }, { "docid": "9d0283d6470bdf3b23e4d8445c7680d0", "score": "0.7155997", "text": "function minimum(a, b){\n\tif ( a > b){\n\t\treturn a\n\t} else return b;\n}", "title": "" }, { "docid": "3fb25ba3360892a1ec8913e3c1b367fc", "score": "0.71421516", "text": "function smallestDifference(arrayOne, arrayTwo) {\n // Write your code here.\n let lowestSoFar = null;\n let lowestPair = null;\n\n for (let i = 0; i < arrayOne.length; i++) {\n let el = arrayOne[i];\n for (let j = 0; j < arrayTwo.length; j++) {\n let el2 = arrayTwo[j];\n let diff = Math.abs(el - el2);\n if (lowestSoFar === null || diff < lowestSoFar) {\n lowestSoFar = diff;\n lowestPair = [el, el2];\n }\n }\n }\n\n return lowestPair;\n}", "title": "" }, { "docid": "bb0aa3a9c7eb36a11d320bd586aaf247", "score": "0.7131564", "text": "function minAndIndex(a) {\n\nvar min=a[0];\nvar index;\n\n for (i = 0; i < a.length; i++) {\n\n if (a[i] < min) {\n \n min = a[i];\n index = i;\n }\n\n }\n return min + ' ' + index;\n}", "title": "" }, { "docid": "0738c797dd98ea3eeb0b3ca8a814c459", "score": "0.7130395", "text": "function min(a,b){\n\tif (a > b)\n return b;\n \telse\n return a;\n}", "title": "" }, { "docid": "d9284a2ef953cdf2c23832136e7672eb", "score": "0.7129191", "text": "function findMin(array) {\n var i;\n var min = Infinity;\n for (i = 0; i < array.length; i++) {\n if (array[i] < min) {\n min = array[i];\n }\n }\n return min;\n}", "title": "" }, { "docid": "3102a05449badbd044d5787844ab8a7e", "score": "0.71274775", "text": "function findMin(arr) {\n var min = arr[0];\n\n for (var i = 1; i < arr.length; i++) {\n if (arr[i] < min) min = arr[i];\n }\n\n return min;\n}", "title": "" }, { "docid": "79d0b5a46f983fa384b4a2dd4f4c317b", "score": "0.71223634", "text": "function min(arr) {\n let min = arr[0];\n for (let i = 1; i < arr.length; i++) {\n if (min > arr[i]) {\n min = arr[i];\n }\n }\n return min;\n}", "title": "" }, { "docid": "20439bc5d5350cf618b7f6c22151a189", "score": "0.7121782", "text": "function minNum(a, b){\n return Math.min(a,b);\n}", "title": "" }, { "docid": "7104f66dbf9f8dc728c7d8c886795bbd", "score": "0.7108128", "text": "function min(a, b) {\n return Math.floor(Math.min(a, b));\n }", "title": "" }, { "docid": "7104f66dbf9f8dc728c7d8c886795bbd", "score": "0.7108128", "text": "function min(a, b) {\n return Math.floor(Math.min(a, b));\n }", "title": "" }, { "docid": "a2bc5840b2fafdde646cdaa454f889af", "score": "0.7104301", "text": "function min(a, b) {\n return b < a ? b : a;\n }", "title": "" }, { "docid": "ee3784ec5e8c13d521b075d98dac8c51", "score": "0.7103775", "text": "function findSmallest(arr) {\n\tvar smallest = Number.POSITIVE_INFINITY; \t\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i] < smallest) {\n\t\t\tsmallest = arr[i];\n\t\t}\n\t}\n\treturn smallest;\n}", "title": "" }, { "docid": "4d6117be53db83240868e33c7e9b941c", "score": "0.7092943", "text": "function min(a, b) {\n if (a < b) {\n return a;\n } else if (b < a) {\n return b;\n } else {\n return undefined\n }\n}", "title": "" }, { "docid": "aa7e7281b5d005c294d86e48a6decb7d", "score": "0.7092032", "text": "function min(a,b){\nconsole.log(Math.min(a,b));\n}", "title": "" }, { "docid": "8d0f8371e6b965436a9448a5f73698ec", "score": "0.70887375", "text": "function getMinOfArray(randomArray){\n return Math.min(...randomArray);\n}", "title": "" }, { "docid": "aa1ac988299a911af82553be25fbc712", "score": "0.7087937", "text": "function smallestElement(arr) {\n let smallest = Infinity;\n let left = 0;\n let right = arr.length - 1;\n while (left <= right) {\n const mid = left + Math.floor((right - left) / 2);\n if (arr[mid] > arr[right]) {\n left = mid + 1;\n } else {\n smallest = Math.min(smallest, arr[mid]);\n right = mid - 1;\n }\n }\n return smallest;\n}", "title": "" }, { "docid": "173c13ee86faab34a68c00e1e4ae3e21", "score": "0.7086839", "text": "function smallestDifference(arrayOne,arrayTwo){\n arrayOne.sort((a,b)=>a-b);\n arrayTwo.sort((a,b) => a-b);\n let indexOne = 0;\n let indexTwo = 0;\n let smallest = Infinity;\n let current = Infinity;\n let smallestPair = [];\n while(indexOne < arrayOne.length && indexTwo < arrayTwo.length){\n let firstNum = arrayOne[indexOne];\n let secondNum = arrayTwo[indexTwo];\n if(firstNum < secondNum){\n current = secondNum - firstNum;\n indexOne++;\n }else if(firstNum > secondNum){\n current = firstNum - secondNum;\n indexTwo++;\n }else{\n return [firstNum, secondNum];\n }\n if(smallest > current){\n smallest = current;\n smallestPair = [firstNum,secondNum];\n }\n }\n return smallestPair;\n}", "title": "" }, { "docid": "61f326b81370fab252ff8c8cfabdc074", "score": "0.7077191", "text": "function getMin(inarray){\n var outvalue = inarray[0];\n for(var i=0;i<inarray.length;i++){\n if(outvalue > inarray[i]){outvalue = inarray[i]};\n }\n return(outvalue);\n }", "title": "" }, { "docid": "3153126dd2f2075f72b0fd1ed01e5cb8", "score": "0.7064696", "text": "function min(a, b) {\n if (a <= b)\n return a\n else\n return b\n}", "title": "" }, { "docid": "f2abc397f28985c71bf9cbf8f8f32ad7", "score": "0.7064428", "text": "function getMin(array) {\n return Math.min.apply(null, array)\n }", "title": "" }, { "docid": "87d02327536e6de6104e8745088a12de", "score": "0.7061831", "text": "function getMinOf(array) {\n\t\t\n\t\tlet minIndex = 0;\n\t\t\n\t\tfor (var i = 1; i < array.length; i++){\n\t\t\n\t\t\tif (array[i] < array[minIndex]){ \n\t\t\t\n\t\t\t\tminIndex = i;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn minIndex;\n\t\t\n\t}", "title": "" }, { "docid": "5cded19727e415401514c51e16946e6b", "score": "0.7059985", "text": "function min(a,b) {\n return (a < b) ? a : b;\n}", "title": "" }, { "docid": "c28ada0f73fe3308d3e68a07191b24ae", "score": "0.7048741", "text": "function min(a, b) {\n return console.log(Math.min(a, b));\n}", "title": "" }, { "docid": "38caaf1d4bd72ebd1c8ef536962575ad", "score": "0.7047696", "text": "function min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n }", "title": "" }, { "docid": "5b6f94618ffcc218f88af1106b472d76", "score": "0.7041116", "text": "function min(arr) {\n\tretval = arr[0];\n\tfor(var i=1; i<arr.length; i++) {\n\t\tretval = Math.min(arr[i], retval);\n\t}\n\treturn retval;\n}", "title": "" }, { "docid": "52971d06f88936b1e5c088f8a104a6f6", "score": "0.70409423", "text": "function smallestNumAcc(param){\n let smallest = param[0];\n\n for(let i = 0; i < param.length; i++){\n let element = param[i];\n \n if( element < smallest){\n smallest = element;\n }\n }\n\n return smallest;\n}", "title": "" }, { "docid": "910db82b9f460ee48748afb0b2de375d", "score": "0.7040274", "text": "function returnMin (a, b) {\n if (a < b) {\n return a;\n }else{\n return b;\n }\n}", "title": "" }, { "docid": "4135dd511256077afff5a2ea9672c453", "score": "0.70358634", "text": "function largestToSmallest(a, b) {\n return (b - a);\n}", "title": "" }, { "docid": "f38841da0f9c0240f77d9c322b2bc170", "score": "0.7034943", "text": "function min(a, b) {\n return a < b ? a : b;\n}", "title": "" }, { "docid": "b831379a682a2d470c30fe6857dea418", "score": "0.70054823", "text": "function compareByFirstArrayElement(a, b) {\n if (a[0] === b[0]) {\n return 0;\n }\n else {\n return (a[0] < b[0]) ? -1 : 1;\n }\n}", "title": "" }, { "docid": "d987257e0246a3b4f4ef4d515fb5d92f", "score": "0.7004393", "text": "function nthSmallest(...arrays) {\n let n = arrays.pop();\n return [].concat(...arrays).sort((a, b) => a - b)[n - 1];\n}", "title": "" }, { "docid": "72591446fdef31d990d28f3465c01988", "score": "0.70021516", "text": "function findSmallestNum(arr) {\n\n console.log(arr);\n var temp= 3000;\n for(var i = 0; i<arr.length ; i++)\n {\n\n if(arr[i]< temp)\n {\n temp = arr[i];\n }\n\n }\n\n return temp;\n}", "title": "" }, { "docid": "a8c029f28456fdfe956a812c7297acdd", "score": "0.6994371", "text": "function sortArray2(num) {\n let newArray =[];\n let smallestNum2 = num[0];\n //let smallestNum = Math.min(... num);\n for (let i = 1; i < num.length; i++) {\n if (num[i] < smallestNum2) {\n smallestNum2 = num[i];\n } \n }\n //return newArray;\n return smallestNum2;\n}", "title": "" }, { "docid": "2ff5af9696fcf2f1ecddaeac6bfda35b", "score": "0.6988317", "text": "function smallestNumber(num1, num2) {\n if (num1 < num2) {\n return num1;\n } else {\n return num2;\n }\n}", "title": "" }, { "docid": "4fd0510232350a8f842e7849639c13a3", "score": "0.69817233", "text": "function getMinOfArray(numArray) {\n return Math.min.apply(null, numArray);\n }", "title": "" }, { "docid": "895c86deaaa8960601f890f81bec1073", "score": "0.69753844", "text": "function getSmallestDiff(arrA, arrB){\n let sortedB = arrB.sort((a,b) => a-b);\n let sortedA = arrA.sort((a,b) => a-b);\n console.log(\"A:\", sortedA, \"\\nB: \", sortedB);\n\n let tuple = [];\n for (let i = 0; i < sortedA.length; i++){\n for(let j = 0; j < sortedB.length; j++){\n let v = sortedA[i] - sortedB[j]\n if (v < 0) break;\n if ( tuple.length > 0 && \n sortedB[j] < sortedB[tuple[2]] ) break;\n if (tuple.length == 0 && v >= 0){\n tuple = [v, i, j];\n } else if( v >= 0 && v < tuple[0]){\n tuple = [v, i, j];\n }\n }\n }\n return [sortedA[tuple[1]], sortedB[tuple[2]]]\n}", "title": "" }, { "docid": "28bc1a90a5c37563c7ac389dd28a6f7b", "score": "0.6973803", "text": "function min(arr) {\n return Math.min(...arr);\n}", "title": "" }, { "docid": "eb6fe4e42e4f0b85e487fd4f7f96b90c", "score": "0.6972544", "text": "function smallest (num, arr) {\n var a = [].concat( arr );\n var list = [];\n for (var i = 0; i < num; i++) {\n var index = a.indexOf(Math.min.apply(Math, a));\n list.push(index);\n a[index] = 999999999999;\n }\n return list;\n}", "title": "" }, { "docid": "81faaae8c79120ab1a2d13424954ea85", "score": "0.6967886", "text": "function min(list){\n var min = list[0]\n for (var i = 0; i < list.length; i++){\n if (list[i] < min){\n min = list[i]\n }\n }\n return min\n}", "title": "" }, { "docid": "9f166cc8f0deeff5739ca904868ec835", "score": "0.6964526", "text": "function min(a, b) { return Math.floor(Math.min(a, b)); }", "title": "" }, { "docid": "9f166cc8f0deeff5739ca904868ec835", "score": "0.6964526", "text": "function min(a, b) { return Math.floor(Math.min(a, b)); }", "title": "" }, { "docid": "0d1eea25fdf605f4d34745065db1bff2", "score": "0.696326", "text": "function minimumDistances(a) {\n let min_dist = -1;\n a.forEach((num, index) => {\n let temp = a.indexOf(num, index + 1);\n if (temp > -1) {\n let idx_diff = Math.abs(temp - index);\n if (min_dist === -1 || min_dist > idx_diff) min_dist = idx_diff;\n } else return;\n });\n return min_dist;\n}", "title": "" }, { "docid": "b1e3a6f8509abf726520f9ffeda0e643", "score": "0.69621277", "text": "function find(){\n var input=[4, 2, 2, -1, 6]\n var output=Math.min(...input);\n return output+\" \"+ input.indexOf(output)\n}", "title": "" } ]
edbca021170c9f2772930baf0d2e9002
Horizontal direction to the left
[ { "docid": "2c31ef34df68a206ad08e6a82323a037", "score": "0.7824289", "text": "*directionHorizontalLeft()\n {\n yield this.sendEvent({type: 0x03, code: 0x00, value: 0});\n }", "title": "" } ]
[ { "docid": "9769e98e3b88f86ba470c3b727ce5bae", "score": "0.746355", "text": "left() {\n\t\tthis.setPosition(this.line, this.col - 1)\n\t}", "title": "" }, { "docid": "10955e2025ab0cd58b9d4d0adfa573a7", "score": "0.7369338", "text": "goLeft () {\n if (this.direction === 'right') return false;\n this.direction = 'left';\n }", "title": "" }, { "docid": "d247618e00cefc37f2c881f44ea0d371", "score": "0.736645", "text": "moveLeft() {\n if (this.xPos - this.stepSize < 0) {\n this.xPos = 0;\n } else {\n this.xPos -= this.stepSize;\n }\n clearScreen();\n }", "title": "" }, { "docid": "db4aa8ad09ee642b267ce834042d5eca", "score": "0.73151475", "text": "moveLeft() {\n const newPoint = this.getNewPoint(this.left);\n this.moveTo(newPoint);\n this.direction = this.left;\n }", "title": "" }, { "docid": "189a61db5d313d910316491551b4bae3", "score": "0.7297132", "text": "function setDirectionLEFT() {\n\n\tif(playerDirection - 90 >= 0){\n\t\tplayerDirection -= 90;\n\t} else {\n\t\tplayerDirection = 270;\n\t}\n\tsetAnimation();\n}", "title": "" }, { "docid": "6d1cc1654aae58d111c54cabf9b064b8", "score": "0.7217788", "text": "get left() {\n return parseInt(this.style.left);\n }", "title": "" }, { "docid": "b96acd64b2077a9ddc30104c9452666e", "score": "0.7136089", "text": "get left() {\n return this.position.x - (this.size.x / 2);\n }", "title": "" }, { "docid": "197341c4cf5f0dcab2109882348233ab", "score": "0.7112563", "text": "moveLeft() {\n if (!this.HitWall(-1, 0, this.activeTetromino)) {\n this.unDraw();\n this.x--;\n this.draw();\n }\n }", "title": "" }, { "docid": "e23055b179093b4525b5516c94251c7a", "score": "0.70323575", "text": "moveLeft() {\n if (!this.movingTetromino) {\n return;\n }\n if (this.currentPositionY + this.movingTetromino.height <= 3) {\n return;\n }\n this.currentPositionX = this._canMoveHorizontally(this.currentPositionX - 1) ?\n this.currentPositionX - 1 : this.currentPositionX;\n }", "title": "" }, { "docid": "83adb1e722e6b84769bc774fba9c22bb", "score": "0.70117354", "text": "function changeLeft(ctrl){\n\t\t// console.log(ctrl);\n\t\tif(click*pos-(wli*nli-wd) > 0 ){\n\t\t\tul.style.left = String(wd-wli*nli) + 'px';\n\t\t}else{\n\t\t\tul.style.left = String(-click*pos) + 'px';\n\t\t}\n\t}", "title": "" }, { "docid": "632fffb6c633fc1e909e9a62f5f33fdf", "score": "0.6991648", "text": "static function getLeftSide() {\n\t\tif (SelectionController.getNumSelected() > 0 && handlePosition != null) {\n\t\t\treturn handlePosition.x;\n\t\t} else {\n\t\t\treturn Screen.width;\n\t\t}\n\t}", "title": "" }, { "docid": "7250934ce97a5073f8ee0869e7c40129", "score": "0.6915036", "text": "get _localeHorizontalAlign() {\n // In RTL, \"left\" becomes \"right\".\n if (this._isRTL()) {\n return this.horizontalAlign === 'right' ? 'left' : 'right';\n } else {\n return this.horizontalAlign;\n }\n }", "title": "" }, { "docid": "28deacc440ef181bdb4a1701adb12ea4", "score": "0.68422854", "text": "function leftArrow(){\n var ele = document.getElementById('yksi');\n \n ele.style.left = parseInt(ele.style.left) - 5 + \"px\";\n \n }", "title": "" }, { "docid": "a459ad0a69d6aa133fca4a5f2c9c3f6b", "score": "0.68030894", "text": "moveLeft() {\n const right = this._right.clone();\n right.setEl(0, 1);\n const position = this._position.subtract(\n right.scalarMultiply(0.2)\n );\n if (!this._checkCollision(position)) {\n this._position = position;\n }\n }", "title": "" }, { "docid": "6c87e7d122ef799cd2661c3a3e0a1376", "score": "0.6764784", "text": "holdLeft() {\n this.direction.x = -1;\n return this;\n }", "title": "" }, { "docid": "77f4ed0a679895da88dfd1377847d2e6", "score": "0.67381656", "text": "rotateLeft() {\n \n let int_orientation = CONF.BITS_INTEGER_MASK & ((this._orientation.VALUE << CONF.ROTATE_ONCE) | (this._orientation.VALUE >>> (CONF.BITS_INTEGER_LENGTH - CONF.ROTATE_ONCE)));\n \n this.setOrientation(int_orientation);\n }", "title": "" }, { "docid": "1520e9790b8916f62a500e17964e0736", "score": "0.6738131", "text": "function moveLeft() {\n var index = $(\"#sliderOnDisplay\").attr(\"index\");\n if (index > 0) {\n moveToPosition(index - 1);\n } else {\n moveToPosition($(\"#sliderControl ul li\").length - 1);\n }\n }", "title": "" }, { "docid": "1e0a94e4b1b39a852e163c8772411b67", "score": "0.67333394", "text": "function moveLeft() {\n\t\tdisplayLogs();\n\t\tundraw();\n\t\tconst isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\t\tif (!isAtLeftEdge) currentPosition -=1;\n\n\t\tif (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n\t\t\tcurrentPosition +=1;\n\t\t}\n\n\t\tdraw();\n\t}", "title": "" }, { "docid": "aa3d765602f368d74ededd9c4949b82e", "score": "0.67285585", "text": "get Left() {}", "title": "" }, { "docid": "1f9b82fa6105a14e86a036a399c061a3", "score": "0.67228144", "text": "left(value = '') {\n this._rightOffset = '';\n this._leftOffset = value;\n this._justifyContent = 'flex-start';\n return this;\n }", "title": "" }, { "docid": "1f9b82fa6105a14e86a036a399c061a3", "score": "0.67228144", "text": "left(value = '') {\n this._rightOffset = '';\n this._leftOffset = value;\n this._justifyContent = 'flex-start';\n return this;\n }", "title": "" }, { "docid": "7c879fbf81638103d43a30bd7a712097", "score": "0.67010856", "text": "function setMenuLeft() {\n\t\t\n\t\tl1 = $('#the_constructor_webapp').offset().left;\n\t\tw1 = $('#the_constructor_webapp').width();\n\t\t\n\t\t$('#the_constructor_links').css('float', 'left');\n\t\tw2 = $('#the_constructor_links').width();\n\t\t$('#the_constructor_links').css('float', 'none');\n\t\t\n\t\tw3 = $('.tc_wrapper').width();\n\t\t\n\t\tl2 = Math.round(l1 + w1/8 - w2/2);\n\t\t\n\t\t$('#the_constructor_links').css({'padding-left': l2+'px'});\n\t}", "title": "" }, { "docid": "c2bdd979f59b45f062bf694fa900a657", "score": "0.6697431", "text": "getHorizontal() {\n return new Padding(0, this.right, 0, this.left);\n }", "title": "" }, { "docid": "8087ad613f17713dcee4fc273d5daee7", "score": "0.66949177", "text": "static get DIRECTION_LEFT()\n {\n return \"left\";\n }", "title": "" }, { "docid": "ed609a11b4b2e56b6225cac60f458b26", "score": "0.66902184", "text": "function moveLeft(){\r\n\t\tobjImage.style.left=parseInt(objImage.style.left)-5 +'px';\r\n\t\tobjImage.style.transform = \"scaleX(-1)\";\r\n\t\tgetAudio();\r\n\t\tlegmove();\r\n\r\n\t}", "title": "" }, { "docid": "bcda38bd4fc82142192eab2ecf384d22", "score": "0.6682567", "text": "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some( index => (currentPosition + index) % width === 0 );\n if(!isAtLeftEdge) {\n currentPosition -= 1;\n }\n if(current.some( index => squares[currentPosition + index].classList.contains['taken'])) {\n currentPosition += 1;\n }\n draw();\n }", "title": "" }, { "docid": "6d0c35ba4e42d3e85cd7d507e759a623", "score": "0.6682083", "text": "left(rotation, scale = 1) {\n\t\tlet direction;\n\n\t\t// Math that I won't bother to explain, but it works!\n\t\tif (rotation == 0 || rotation == this.RADIANS._180)\n\t\t\tdirection = {x: -scale, z: 0};\n\t\telse if (rotation == this.RADIANS._90 || rotation == this.RADIANS._270)\n\t\t\tdirection = {x: 0, z: scale};\n\t\telse\n\t\t\tdirection = {x: -scale, z: scale};\n\n\t\t// How much we change in either direction\n\t\tlet delta = {\n\t\t\tx: direction.x * Math.cos(rotation),\n\t\t\tz: direction.z * Math.sin(rotation),\n\t\t};\n\n\t\treturn delta;\n\t}", "title": "" }, { "docid": "bbf325b3ff62f278d83eaac435ef4366", "score": "0.6679734", "text": "function left() { if (ip%width==0) ip += width-2; else --ip; }", "title": "" }, { "docid": "1109d8575bd95e04d0560a62f778cc46", "score": "0.6677301", "text": "function left() {\n /**\n * arrow left\n * Nintendo Wii left\n * char a\n */\n return keys[37] || keys[178] || keys[65];\n }", "title": "" }, { "docid": "52501c9424ed310f7de3c625021ee5ff", "score": "0.6667956", "text": "get _localeHorizontalAlign() {\n if (this._isRTL) {\n // In RTL, \"left\" becomes \"right\".\n if (this.horizontalAlign === 'right') {\n return 'left';\n }\n if (this.horizontalAlign === 'left') {\n return 'right';\n }\n }\n return this.horizontalAlign;\n }", "title": "" }, { "docid": "52501c9424ed310f7de3c625021ee5ff", "score": "0.6667956", "text": "get _localeHorizontalAlign() {\n if (this._isRTL) {\n // In RTL, \"left\" becomes \"right\".\n if (this.horizontalAlign === 'right') {\n return 'left';\n }\n if (this.horizontalAlign === 'left') {\n return 'right';\n }\n }\n return this.horizontalAlign;\n }", "title": "" }, { "docid": "d2764e267bf9538addb9e0fcafe9fad8", "score": "0.6663555", "text": "get _localeHorizontalAlign() {\n if (this._isRTL) {\n // In RTL, \"left\" becomes \"right\".\n if (this.horizontalAlign === 'right') {\n return 'left';\n }\n if (this.horizontalAlign === 'left') {\n return 'right';\n }\n }\n return this.horizontalAlign;\n }", "title": "" }, { "docid": "d2764e267bf9538addb9e0fcafe9fad8", "score": "0.6663555", "text": "get _localeHorizontalAlign() {\n if (this._isRTL) {\n // In RTL, \"left\" becomes \"right\".\n if (this.horizontalAlign === 'right') {\n return 'left';\n }\n if (this.horizontalAlign === 'left') {\n return 'right';\n }\n }\n return this.horizontalAlign;\n }", "title": "" }, { "docid": "56b292fd0dc9e580d883277bf5cdaaf5", "score": "0.6651137", "text": "turnLeft() {\n if (this.updated) {\n this.direction.setTo(this.direction.y, -this.direction.x);\n this.head.angle -= 90;\n\n this.move();\n }\n }", "title": "" }, { "docid": "e5541fd60e9ea081b9a75360fc6223b6", "score": "0.6631691", "text": "turnLeft() {\n if (this.direction === Constants.SKIER_DIRECTIONS.LEFT) {\n this.moveSkierLeft();\n } else if (this.direction === Constants.SKIER_DIRECTIONS.CRASH) {\n this.setDirection(Constants.SKIER_DIRECTIONS.LEFT);\n this.moveSkierLeft();\n } else {\n this.setDirection(this.direction - 1);\n }\n }", "title": "" }, { "docid": "13431a6c8e74414f3a1108ca52d04742", "score": "0.6622438", "text": "function RenderLeft(RenderTarget)\r\n\t{\r\n\t\tRenderHmdEye(RenderTarget,\"Left\",null);\r\n\t}", "title": "" }, { "docid": "0bf7934e0bebeb87d52857f897691061", "score": "0.65994304", "text": "getTieLeftX() {\n let tieEndX = this.getAbsoluteX();\n const note_glyph_width = this.glyph.getWidth();\n tieEndX += note_glyph_width / 2;\n tieEndX -= (this.width / 2) + 2;\n\n return tieEndX;\n }", "title": "" }, { "docid": "904aa597907e53179ac94ff08a929bb9", "score": "0.6586679", "text": "moveLeft() {\n if(this.columnLocation > 0){\n this.htmlToken.style.left = this.offsetLeft - 76;\n this.columnLocation -= 1;\n } else {\n console.log(\"Can't move left\");\n }\n }", "title": "" }, { "docid": "71ac6f5fff5087f4e30483de1d865666", "score": "0.658029", "text": "function moveLeft() {\n var newStart = Math.max(0, viewRegStart - Math.floor((viewRegEnd-viewRegStart)/4));\n var newEnd = Math.max(newStart, viewRegEnd - Math.floor((viewRegEnd-viewRegStart)/4));\n render(viewRefName, newStart, newEnd);\n}", "title": "" }, { "docid": "71835ab3916c5da537127d6d8b8137c3", "score": "0.6558072", "text": "function moveDodgerLeft() { moveDodgerImpl(-MOVE_DODGER_BY); }", "title": "" }, { "docid": "3882740f8805d0e968f5cb8a5b6002ee", "score": "0.6556078", "text": "function left(){\n var ment = document.getElementById('kaksi');\n ment.style.left = parseInt(ment.style.left) - 5 + \"px\";\n }", "title": "" }, { "docid": "eb49ec2eab363e88274cd69dd47457d0", "score": "0.6537365", "text": "function isHorizontal(dir) {\r\n return dir === 'left-to-right' || dir === 'right-to-left';\r\n }", "title": "" }, { "docid": "dfd0433c8a57776282016534a79057a7", "score": "0.6536533", "text": "function moveLeft () {\n undraw();\n // check if tetromino is in the left edge(indexes divisable by 10 >> 0, 10, 20..)\n const atLeftEdge = currentTetromino.some(index => (currentPosition + index) % width === 0);\n // will move left if not on the left edge\n if(!atLeftEdge) currentPosition -= 1;\n // move back if there's a frozen tetromino on your left\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition +=1\n }\n draw();\n }", "title": "" }, { "docid": "53f491d8533dac8f81c2b7f65ed27a36", "score": "0.6533883", "text": "function moveLeft() {\n\t\tundraw();\n\t\tconst isAtLeftEdge = current.some(\n\t\t\t(index) => (currentPosition + index) % width === 0\n\t\t);\n\n\t\tif (!isAtLeftEdge) currentPosition -= 1;\n\n\t\tif (\n\t\t\tcurrent.some((index) =>\n\t\t\t\tsquares[currentPosition + index].classList.contains('taken')\n\t\t\t)\n\t\t) {\n\t\t\tcurrentPosition += 1;\n\t\t}\n\n\t\tdraw();\n\t}", "title": "" }, { "docid": "69c93f5b786f9036d560322ccc673c8e", "score": "0.651112", "text": "get _localeHorizontalAlign(){if(this._isRTL){// In RTL, \"left\" becomes \"right\".\nif(this.horizontalAlign==='right'){return'left';}if(this.horizontalAlign==='left'){return'right';}}return this.horizontalAlign;}", "title": "" }, { "docid": "ac1a844cc07aaaf7cf57965f67690bb0", "score": "0.65063274", "text": "function changeLeftPosition(element, type) {\n switch (type) {\n case \"static\":\n return element.css('margin-left') == '0px' ? 0 : element.css('margin-left');\n default:\n return element.css('left') == 0 ? 0 : element.css('left');\n }\n}", "title": "" }, { "docid": "8e8da335556258ac6925680856259775", "score": "0.6504436", "text": "set ImageLeft(value) {}", "title": "" }, { "docid": "f4ef5c2e03b721208250e58bcfbead3f", "score": "0.6500469", "text": "function updateItemLeft() {\n item.style.transform = 'translateX(' + itemLeft + 'px)';\n }", "title": "" }, { "docid": "0d6f5ab455686455e2c3b42bff576d4b", "score": "0.6500188", "text": "*directionHorizontalRight()\n {\n yield this.sendEvent({type: 0x03, code: 0x00, value: 255});\n }", "title": "" }, { "docid": "296cad2820151a303193a6dddbdcb4fc", "score": "0.64994514", "text": "calcLeftPositionMode() {\n switch (this.positionMode.left) {\n case 'target':\n {\n this.position.left = this.originNodeRect.left - this.alignTarget.offsetLeft;\n this.horizontalTransformOrigin += 'left';\n break;\n }\n\n case 'target-left':\n {\n this.position.left = this.originNodeRect.left;\n this.horizontalTransformOrigin += 'left';\n break;\n }\n\n case 'target-right':\n {\n this.position.left = this.originNodeRect.right - this.openMenuNodeRect.width + (this.openMenuNodeRect.right - this.alignTargetRect.right);\n this.horizontalTransformOrigin += 'right';\n break;\n }\n\n case 'cascade':\n {\n let willFitRight = this.originNodeRect.right + this.openMenuNodeRect.width < this.bounds.right;\n this.position.left = willFitRight ? this.originNodeRect.right - this.originNode.style.left : this.originNodeRect.left - this.originNode.style.left - this.openMenuNodeRect.width;\n this.horizontalTransformOrigin += willFitRight ? 'left' : 'right';\n break;\n }\n\n case 'right':\n {\n this.position.left = this.originNodeRect.right - this.openMenuNodeRect.width;\n this.horizontalTransformOrigin += 'right';\n break;\n }\n\n case 'left':\n {\n this.position.left = this.originNodeRect.left;\n this.horizontalTransformOrigin += 'left';\n break;\n }\n\n default:\n {\n (true && !(false) && Ember.assert(`Invalid target mode '${this.positionMode.left}' specified for paper-menu on X axis.`));\n }\n }\n }", "title": "" }, { "docid": "41cea94eb813c17c7dd03267d2166eef", "score": "0.6493479", "text": "getTieLeftX() {\n let tieEndX = this.getAbsoluteX();\n tieEndX += this.x_shift - this.leftDisplacedHeadPx;\n return tieEndX;\n }", "title": "" }, { "docid": "a13ac79859995b252eb6c80a3ee42c09", "score": "0.64906025", "text": "function moveLeft() {\n if (spaceLeft()) {\n undraw();\n currentPosition -=1;\n draw();\n }\n}", "title": "" }, { "docid": "ec39a2366eec48d5fbd02c762e4b61c0", "score": "0.6487742", "text": "function isHorizontal(dir) {\n return dir === 'left-to-right' || dir === 'right-to-left';\n }", "title": "" }, { "docid": "ec39a2366eec48d5fbd02c762e4b61c0", "score": "0.6487742", "text": "function isHorizontal(dir) {\n return dir === 'left-to-right' || dir === 'right-to-left';\n }", "title": "" }, { "docid": "51f510f03ffa0be46574077be9d0960a", "score": "0.64836997", "text": "function moveLeft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if (!isAtLeftEdge) currentPosition -= 1\n\n if (current.some(index => square[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n draw()\n }", "title": "" }, { "docid": "13afdd6638a83c265947cf8fb50216f2", "score": "0.64780056", "text": "function moveDodgerLeft() {\n let leftNumbers = dodger.style.left.replace(\"px\", \"\");\n let left = parseInt(leftNumbers, 10);\n \n if (left > 0) {\n dodger.style.left = `${left - 1}px`;\n }\n}", "title": "" }, { "docid": "3f9a0b4b3454f5141bc7a22a880fc46f", "score": "0.64705956", "text": "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0);\n if(!isAtLeftEdge) currentPosition -=1;\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition +=1;\n }\n draw();\n }", "title": "" }, { "docid": "29bb412def7c82d0de9ecbf1d2284401", "score": "0.6466827", "text": "left() {\n const m = vec3.create();\n vec3.cross(m, this.up, this.vNorm);\n vec3.add(this.position, this.position, m);\n vec3.add(this.center, this.center, m);\n mat4.lookAt(this.transformation, this.position, this.center, this.up);\n }", "title": "" }, { "docid": "6f9f821c8d7fb47e8b458afc6025e750", "score": "0.6464757", "text": "get _localeHorizontalAlign(){if(this._isRTL){// In RTL, \"left\" becomes \"right\".\nif(\"right\"===this.horizontalAlign){return\"left\"}if(\"left\"===this.horizontalAlign){return\"right\"}}return this.horizontalAlign}", "title": "" }, { "docid": "c514cc9c19b10b65e1d03bd8dd009596", "score": "0.6459398", "text": "function moveLeft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n // if not at left edge, then can move\n if(!isAtLeftEdge) currentPosition -=1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n\n draw()\n }", "title": "" }, { "docid": "ca9fdef2f0d183c2f9e4949f6b16e75a", "score": "0.645773", "text": "moveSkierLeftDown() {\n this.x -= this.speed / Constants.SKIER_DIAGONAL_SPEED_REDUCER;\n this.y += this.speed / Constants.SKIER_DIAGONAL_SPEED_REDUCER;\n }", "title": "" }, { "docid": "58eb497f95f010d96ee3c33586168b6b", "score": "0.6449814", "text": "function moveLeft() {\r\n undraw(); // najprv odkreslim vsetko\r\n const isLeftEdge = current.some(\r\n (index) => (currentPosition + index) % width === 0\r\n ); //ak niektory z indexov tetromina % sirka = 0 tak sme na lavom okraji (10/10 = 0 , 20/20 = 0 and so on)\r\n\r\n if (!isLeftEdge) currentPosition -= 1; // ked nie som na left edge tak sa pohnem o 1 do lava\r\n if (\r\n current.some(\r\n (index) => squares[currentPosition + index].classList.contains(\"taken\") //ak uz tam tetromino je ... ma class taken tak pohne sa o 1 do prava bude to vyzerat ako keby ostalo na mieste\r\n )\r\n ) {\r\n currentPosition += 1;\r\n }\r\n draw(); //nakreslim nove tetromino ktore sa pohlo / nepohlo do lava\r\n }", "title": "" }, { "docid": "f0a7d14144276f91ee38685dbb16a277", "score": "0.64413637", "text": "function isHorizontal(dir) {\n\t return dir === Direction.LeftToRight || dir === Direction.RightToLeft;\n\t }", "title": "" }, { "docid": "d03003c92e3df51e74a059a4ee412270", "score": "0.6432268", "text": "function getHorizontalName(list)\n\t{\n\t\tif (list.indexOf('left') != -1)\n\t\t\treturn 'left';\n\t\telse if (list.indexOf('right') != -1)\n\t\t\treturn 'right';\n\t\telse\n\t\t\treturn 'centerx';\n\t}", "title": "" }, { "docid": "e80bd05e1e059a671bd6bfa5ceba8780", "score": "0.64288545", "text": "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some(index => (currentPosition + index) % columns == 0);\n if (!isAtLeftEdge) {\n currentPosition -= 1;\n }\n if (current.some((index) => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1;\n }\n draw();\n freeze();\n }", "title": "" }, { "docid": "16b07544e300b5da58f155c1f747b9de", "score": "0.64244777", "text": "moveElementLeft() {\r\n this.clearBoardElement()\r\n for (let i = 0; i < this.currentElement.occupancy.length; i++) {\r\n this.currentElement.occupancy[i][1] = (this.currentElement.occupancy[i][1] - 1)\r\n }\r\n this.currentElement.position.column = (this.currentElement.position.column - 1)\r\n this.insertElement(this.currentElement)\r\n }", "title": "" }, { "docid": "ba8f5fddc9a3d54c0aa38444d9c85abc", "score": "0.638834", "text": "left() {\n return this.x;\n }", "title": "" }, { "docid": "486eb4ff8c2c126b15fa6f740b836ef1", "score": "0.63784623", "text": "function updateLeftPosition() {\r\n var scrollLeft = scrollingParentX.scrollLeft();\r\n theadElemClone.css('left', - scrollLeft);\r\n }", "title": "" }, { "docid": "8884d8f25f298fbc19209b71fe72c443", "score": "0.63725346", "text": "function wpsFLY_internalGetLeft()\r\n{\r\n if (wpsFLY_isNetscape||wpsFLY_isMoz)\r\n leftfunc=parseInt(this.css.left);\r\n else if (wpsFLY_isIE)\r\n leftfunc=eval(this.css.pixelLeft);\r\n return leftfunc;\r\n}", "title": "" }, { "docid": "448bd1077c1ebbdcd6c7e1528299e666", "score": "0.636913", "text": "function playerLeft() {\n if (player.offsetLeft <= 50){\n return;\n }\n\n player.style.left = player.offsetLeft - motionStepPlayer + \"px\";\n\n}", "title": "" }, { "docid": "d63223a542eb305b79b261b4c0805cbe", "score": "0.6365812", "text": "function moveLeft(){\n undraw();\n const atLeftEdge = current.some(index => (currentPosition + index) % width === 0);\n if(!atLeftEdge) currentPosition -=1;\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition +=1;\n }\n draw();\n }", "title": "" }, { "docid": "8574143aa2b121644c7e726fc45131ec", "score": "0.6365278", "text": "function scrollLeft() {\n gridRef.current.scrollLeft -= gridRef.current.clientWidth;\n }", "title": "" }, { "docid": "578450dfd7f1908f442afb76ab883518", "score": "0.6350244", "text": "lookLeft() {\n vec3.rotateY(this.center, this.center, this.position, 0.05);\n this.rotationY += 0.05;\n vec3.sub(this.v, this.center, this.position);\n vec3.normalize(this.vNorm, this.v);\n mat4.lookAt(this.transformation, this.position, this.center, this.up);\n }", "title": "" }, { "docid": "af2274697684de9ade2b4d2bd03e465f", "score": "0.63474554", "text": "function moveLeft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if(!isAtLeftEdge) currentPosition -=1\n\n if(current.some(index => squares[currentPosition + index].classList.contains(\"taken\"))) {\n currentPosition +=1\n }\n draw()\n }", "title": "" }, { "docid": "9036478fca6cd3538d4925a8a898283f", "score": "0.6346033", "text": "moveLeft() {\n this.updateImage();\n if (!super.moveLeft(PIXEL_BY_ALIEN_MOVE)) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "53035cf85d07870d8e9322782d50680f", "score": "0.63454247", "text": "get isHorizontal() {\n return true;\n }", "title": "" }, { "docid": "851af5e3606de1c584c317d81f3417a7", "score": "0.63393867", "text": "function moveLeft() {\n\tvar x = 0;\n\tif(parseInt($('.container-list').css('left')) < 0){\n\t\tx = parseInt($('.container-list').css('left'))+pageWidth;\n\t\t$('.container-list').animate({left: (x.toString()+\"px\")}, 300);\n\t\t$('.container-list').css('left', x.toString()+\"px\");\n\t\tupdate_navbar(x);\n\t}\n}", "title": "" }, { "docid": "3c4ff995609a632247ed9b6142e4e8b3", "score": "0.63341767", "text": "function moveLeft(){\n let oldTop = snake[0].position().top;\n let oldLeft = snake[0].position().left;\n snake.unshift(snake.pop());\n snake[0].css('left',oldLeft-10);\n snake[0].css('top',oldTop);\n}", "title": "" }, { "docid": "47146c2fbfdf8d4eb4423e8070f8a7ae", "score": "0.6330933", "text": "get ImageLeft() {}", "title": "" }, { "docid": "8399a9e832b73e17780f99e904362e8d", "score": "0.6327704", "text": "function wpsFLY_internalResizeLeft(){\r\n \r\n if (wpsFLY_isIE) {\r\n wpsFLY_leftResize = wpsFLY_browserDimensions.getScrollFromLeft(); - wpsFLY_browserDimensions.getViewableAreaWidth();\r\n }\r\n\r\n}", "title": "" }, { "docid": "2af5071601f7055e6865b3b8fdf66823", "score": "0.6323727", "text": "function MoveLeft() {\n //If the player is on the far right already, don't move (they hit a wall), else, move.\n if (playerSpace % tilesPerRow === 1 || playerSpace - 1 === randomUnwalkable) {\n return;\n } else {\n playerSpace -= 1;\n MakeActive(playerSpace);\n }\n}", "title": "" }, { "docid": "fcfcba40fea6012f77d34d32ca45c0e4", "score": "0.63231754", "text": "function moveLeft() {\n if ( moving ) {\n moving = false;\n removeClone();\n var firstSlide = carouselContent.firstElementChild;\n firstSlide.addEventListener('transitionend', replaceToEnd);\n moveSlidesLeft();\n }\n }", "title": "" }, { "docid": "e229037b8be70596d976a5b06420515c", "score": "0.63226426", "text": "function moveleft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n if (!isAtLeftEdge) currentPosition -= 1\n if (current.some(index => squares[currentPosition + index].classList.contains('block2'))) {\n currentPosition += 1\n }\n draw()\n }", "title": "" }, { "docid": "0fde850b4fa96b1aa227dee35e20bcb0", "score": "0.6314422", "text": "getLeft() {\n return this.minX;\n }", "title": "" }, { "docid": "d7935f076bbee3c9fc2fabd618b53dec", "score": "0.6308882", "text": "function wippeLeftMove() {\n if (mouseLeftActive && mouseY > kYi(groundY) - tri_height * 2 * M && mouseY < kYi(groundY)) {\n wippeLMove = true;\n status_left = \"init\";\n status_right = \"init\";\n w1y = mouseY;\n leftPhi = asin((iYk(w1y) / M - tri_height) / (0.5 * wip_length));\n\n }\n}", "title": "" }, { "docid": "20c577ddaff9ff6a45d8f866971fee4d", "score": "0.63078076", "text": "function left (elem) {\n \t\tvar left = elem.offsetLeft;\n \t\twhile (elem = elem.offsetParent) {\n \t\t\tleft += elem.offsetLeft;\n \t\t}\n \t\treturn left;\n \t}", "title": "" }, { "docid": "c9b5378d9215774c7d836b68510838aa", "score": "0.6306133", "text": "function _Left ( ) {\n\n\t\tthis.go = function() {\n\n\t\t\tvar cCurrentChar = _sCodeRoad[_nCodePos];\n\n\t\t\tif ( _nCodePos < _nLengthCode ) {\n\n\t\t\t\t// fill w/ blanks when go LEFTer than ever\n\t\t\t\tif ( _nRowPos === 0 ) {\n\t\t\t\t\tfor ( var row=0; row < _nRows; row++) {\n\t\t\t\t\t\t\t_aProcessedRoad[row].unshift(\" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t_nRowPos--; // LEFT logic\n\t\t\t\t}\n\n\t\t\t\t_aProcessedRoad[_nCurrentRow][_nRowPos] = cCurrentChar;\n\t\t\t\t_nCodePos++;\n\n\t\t\t\tif (cCurrentChar !== '/' && cCurrentChar !== '\\\\') {\n\t\t\t\t\tthis.go();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif ( cCurrentChar == '/') {\n\t\t\t\t\t\t_changeDirection( new _Down() )\n\t\t\t\t\t}\n\t\t\t\t\telse if ( cCurrentChar == '\\\\') {\n\t\t\t\t\t\t_changeDirection( new _Up() )\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_output()\n\t\t\t}\n\n\t\t}\n\t}", "title": "" }, { "docid": "ee54089477c9df5d643abaf19d0bfaf3", "score": "0.6303071", "text": "getLeft() {\r\n return this._getNodeFromCompilerNode(this.compilerNode.left);\r\n }", "title": "" }, { "docid": "96921d75be5a10336b84982e2910fcc9", "score": "0.63021815", "text": "function rotateLeft() {\n angle -= 10;\n console.log(angle);\n cameraSide();\n }", "title": "" }, { "docid": "af1c1a74d7bbc259476673e297138934", "score": "0.62997174", "text": "function getLeftOffset() {\n return 250;\n}", "title": "" }, { "docid": "9fb4510c283e748e2d5719dbabd8b428", "score": "0.629278", "text": "getBarLeft() {\n return this.position.x - this.size.x / 2;\n }", "title": "" }, { "docid": "ddad3e4003a1cad82561fc3be915def4", "score": "0.62851226", "text": "function slideLeft(){\n\tpos--;\n\tif(pos==-1){ pos = totalSlides-1; }\n\t$('#slider-wrap ul#slider').css('left', -(sliderWidth*pos)); \t\n\t\n\t//*> optional\n\tcountSlides();\n\tpagination();\n}", "title": "" }, { "docid": "a9ed7c481c7d55b82036df5277368b0c", "score": "0.6284911", "text": "function moveLeft() {\n $('#main-gallery .inner-gallery').animate({\n left: + slideWidth\n }, function () {\n var currSlideL = $('#main-gallery .inner-gallery img:last-child');\n $('#main-gallery .inner-gallery').siblings().removeClass('active');\n currSlideL.addClass('active').prependTo('#main-gallery .inner-gallery');\n //$('#main-gallery .inner-gallery').css('left', '');\n });\n }", "title": "" }, { "docid": "3e45ce914eafe0a5aa8be35932c8381b", "score": "0.628173", "text": "function moveLeft(){\n var nextActive = actives[actives.length - 1]-1;\n if(nextActive%30 === 29 || nextActive < 0){\n nextActive += 30;\n }\n return nextActive;\n }", "title": "" }, { "docid": "ca0cb2e8b2f0009e37c693d0e5b87102", "score": "0.6280775", "text": "function left(el) {\n return el.cumulativeOffset().left;\n}", "title": "" }, { "docid": "b4bc83b25602043e4a03186b0722002c", "score": "0.62797076", "text": "function get$left()/*:Number*/ {\n return this.x;\n }", "title": "" }, { "docid": "d294fc1bf3f6c2ed0899e424ee6cd3ac", "score": "0.62744457", "text": "function op_left(line) {\n line = slide_left(line);\n line = combine_left(line);\n line = slide_left(line);\n return line;\n}", "title": "" }, { "docid": "5c3b53df7f3a647be1a4bcfa766f2a22", "score": "0.6273998", "text": "function moveLeft(){\n var left = parseInt(window.getComputedStyle(character).getPropertyValue(\"left\"));\n if(left>0){\n character.style.left = left - moveBy + 'px';\n }\n}", "title": "" }, { "docid": "162963a183c608fda7c94b42605b4f7b", "score": "0.6271088", "text": "function moveLeft(){\n let newPos= x-20;\n console.log(newPos);\n if (!(newPos < 0))\n x=newPos;\n }", "title": "" }, { "docid": "aa1c03a4e4a13b05bb4c4abf1faaa913", "score": "0.62625027", "text": "getLeftCenter() {\n return new Vector2(this.minX, this.getCenterY());\n }", "title": "" } ]
e93c5015ff0c87fb4d89e4c6a412994d
while loop that controls if game is still happening by if the number of found words is the same as all possible ones
[ { "docid": "e02ade19ed25d2de240165eb2d17ca1f", "score": "0.79976684", "text": "function contGame() {\n while (words.length() !== found.length()) {\n console.log(unguessed);\n console.log(found);\n }\n}", "title": "" } ]
[ { "docid": "1a1e792f4779a3b3741215002111ff0f", "score": "0.75268865", "text": "function newGame() {\n var w, findWord = true;\n do {\n let checkIndex = Math.floor(Math.random() * wordList.name.length);\n if (wordList.use[checkIndex]) {\n w = wordList.name[checkIndex];\n wordList.use[checkIndex] = false;\n findWord = false;\n } else if (!wordList.use.includes(true)) {\n for (let j = 0; j < wordList.use.length; j++) {\n wordList.use[j] = true;\n }\n }\n } while (findWord);\n end = false;\n trii = 10;\n guessL = [];\n tries.textContent = \"Remaining Tries:\" + trii;\n whatToDisplay = [];\n actualWord.textContent = \"\";\n res.textContent = (\"Keep playing!!\");\n for (let i = 0; i < w.length; i++) {\n whatToDisplay[i] = false;\n }\n return w;\n}", "title": "" }, { "docid": "7ff96015585d7dc3cab56cbfe5edaab6", "score": "0.7322678", "text": "function gameWon() {\n if (words.length() == found.length()) {\n console.log(\n `Congradulations! You beat the game! You sucessfully guessed all ${words.length()} words, impressive!`\n );\n console.log(found);\n }\n}", "title": "" }, { "docid": "d8f21e7da119ed3da9cacc8363bbd427", "score": "0.7006682", "text": "checkForWin() {\n const chosen = document.querySelectorAll(\"li.chosen\");\n const space = document.querySelectorAll(\"span.space\");\n const stringLength = this.activePhrase.length;\n const result = stringLength - space.length;\n if (chosen.length === result) {\n this.result = \"You Win!\";\n this.gameOver();\n }\n }", "title": "" }, { "docid": "d8db45e37ba61e912c1a833a301684cc", "score": "0.7002529", "text": "checkForWin() {\n let correctGuesses = 0;\n const phraseCharacters = document.querySelectorAll('#phrase ul li');\n\n for(let i = 0; i < phraseCharacters.length; i++) {\n // 'space' should be factored in so correctGuesses properly tallies to length of array\n if(phraseCharacters[i].className === 'show'\n || phraseCharacters[i].className === 'space') {\n correctGuesses++;\n \n if(correctGuesses === phraseCharacters.length)\n {\n return true; // Win\n }\n }\n }\n return false; // Continue game\n }", "title": "" }, { "docid": "976aee69974121257ce160eb6012a460", "score": "0.691517", "text": "playGame() {\n //solved is a boolean that will be set to true when the game is over\n let solved = false;\n //print the initial status of the game\n this.printStatus();\n //enter the game loop\n while(!solved) {\n //get a word from the user\n if(this.queryUser() == null) {\n //the player gave up, so print the game over status to the console\n this.printStatus(true);\n return;\n }\n //update and print the current game status to the console\n this.printStatus(false);\n\n //check if the game is over\n solved = (this.listOfWords.size == this.foundWords.size);\n\n }\n\n //congratulate the player and terminate\n alert(`You guessed all the words! Good Job!`);\n return;\n }", "title": "" }, { "docid": "f323a3c7e188b784d07f9ec17bf7cdde", "score": "0.6878386", "text": "function matchWords() {\n if (wordInput.value === currentWord.innerHTML && time > 0) {\n message.innerHTML = 'Correct!!!';\n score++;\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "a3eb3fc0cd622b839d5aa2dc4ccd5394", "score": "0.6870589", "text": "checkForWin(){\n const totalLetterLength= document.querySelectorAll('#phrase .letter-multiple').length+\n document.querySelectorAll('#phrase .letter').length;//all letters on screen\n const totalShownLength= document.querySelectorAll('#phrase .show').length;//total shown length\n if (totalLetterLength===totalShownLength){\n this.gameOver();\n }\n }", "title": "" }, { "docid": "0db37d22c0670d65d234cedf3b9e34f4", "score": "0.68256634", "text": "checkForWin() {\n const lengthPhrases = $('.letter').length;\n const lengthMatch = $('.letter.show').length;\n //if all the letter length match to the letter being click/shown it should call the gameOver\n if ( lengthPhrases === lengthMatch) {\n return true;\n }\n }", "title": "" }, { "docid": "07f57f8c68a5e6675d8fa80d818da582", "score": "0.68185455", "text": "function checkGameStatus() {\n let word_guessed = true;\n let out_of_guesses = false;\n\n for (let i = 0; i < current_word.word_arr.length; i++) {\n if (current_word.displayed_word_arr[i] == 0) {\n word_guessed = false;\n }\n }\n\n if (num_of_guesses === 0) {\n out_of_guesses = true;\n }\n\n if (word_guessed) {\n game_status = false;\n printWin();\n return;\n }\n\n if (out_of_guesses) {\n game_status = false;\n printLose();\n return;\n }\n}", "title": "" }, { "docid": "eaf3cfad6367f5fdefcc41c2592ad00e", "score": "0.68144894", "text": "checkGameOver() {\n\n const currentWord = this.state.currentWord.split(\"\");\n let pastGuesses = this.state.pastGuesses,\n nWrong = this.state.nWrong,\n nRight = 0;\n\n // for each letter in the target word\n for (let i = 0; i < currentWord.length; i++) {\n // check if it present in the current list of guesses \n if (pastGuesses.indexOf(currentWord[i]) >= 0) {\n // and count the letters that have been found\n nRight++;\n }\n }\n // game ends if the number of found letters is the same as the number of letters in the word\n if (nRight === currentWord.length) {\n this.setState({\n gameWon: true,\n gameStreak: this.state.gameStreak + 1,\n });\n this.endGame();\n }\n // game ends if the word is not yet complete BUT the number of wrong guesses has reached 6\n else if (nWrong === 6) {\n this.setState({\n gameStreak: 0,\n })\n this.endGame();\n }\n }", "title": "" }, { "docid": "3bbf139466a7b1ee95c114efa643f2cc", "score": "0.6798734", "text": "function overusedWord(words){\n for (const word of words){\n let checkWord = storyWords.filter(item => {return item === word} ); \n console.log(`'${word}' has been used ${checkWord.length} times`)\n }\n}", "title": "" }, { "docid": "59254462a131be0e06767a59ce3a35c4", "score": "0.6794533", "text": "function checkCorrectWord(){\n\tvar noMatchLetter = 0;\n\tfor(n=0; n<currentWord.length; n++){\n\t\tif(currentWord.substring(n,n+1)!=currentWord.substring(lettersSequence_arr[n], lettersSequence_arr[n]+1)){\n\t\t\tnoMatchLetter++;\n\t\t}\n\t}\n\t\n\tif(noMatchLetter==0){\n\t\tstopAudioDesc();\n\t\tanswerAudioComplete = true;\n\t\tif(playAnswerAudio && answerAudioExist){\n\t\t\tsetTimeout(function() {\n\t\t\t\tanswerAudioComplete = false;\n\t\t\t\tplayAudioAnswer('audioAnswer'+word_arr[curWordCount].id);\n\t\t\t}, 500);\n\t\t}\n\t\t\n\t\ttouchCon=false;\n\t\ttoggleRevealTimer(false);\n\t\ttoggleRevealButton(false);\n\t\tquestionIconTxt.alpha=0;\n\t\thideAudioIcon();\n\t\t\n\t\tsetTimeout(function() {\n\t\t\tcurrentWords++;\n\t\t\tvar animateSpeed = 300;\n\t\t\tvar scale = .05\n\t\t\tfor(n=0; n<lettersSequence_arr.length; n++){\n\t\t\t\tvar targetID = lettersSequence_arr[n];\n\t\t\t\t$($.lettersHolder[targetID])\n\t\t\t\t.clearQueue()\n\t\t\t\t.stop(true,false)\n\t\t\t\t.animate({scaleX:letterScale+scale, scaleY:letterScale+scale},animateSpeed)\n\t\t\t\t.animate({scaleX:letterScale, scaleY:letterScale},animateSpeed);\n\t\t\t\t\n\t\t\t\t$($.lettersShadow[targetID])\n\t\t\t\t.clearQueue()\n\t\t\t\t.stop(true,false)\n\t\t\t\t.animate({scaleX:letterScale+scale, scaleY:letterScale+scale},animateSpeed)\n\t\t\t\t.animate({scaleX:letterScale, scaleY:letterScale},animateSpeed, function(){\n\t\t\t\t\tplayTickAnimation();\n\t\t\t\t});\n\t\t\t}\n\t\t}, 500);\n\t}\n}", "title": "" }, { "docid": "d9f33bf1b3d4dbbabe9f3a244f517312", "score": "0.67835075", "text": "function startGame() {\n\n // gen gameSize random words\n var intersection;\n if(mode==\"sat\") {\n intersection = _.intersection(holdWords, allWords); //get the intersection of the words\n }\n else {\n intersection = allWords;\n }\n console.log('INTERSECTION LENGTH', intersection.length);\n do {\n console.log('generatingwords');\n totalWords = randomWords(gameSize, intersection);\n } while(_.uniq(totalWords).length !== totalWords.length);\n\n guessedWords = [];\n\n console.log(totalWords);\n // pick solutionSize random from them to be solutions\n goodWords = _.sampleSize(totalWords, answerCount);\n console.log(goodWords);\n // all else are badWords\n badWords = _.xor(totalWords, goodWords);\n console.log(badWords);\n\n\n // cluster by vector the solutions into numberOfHints groups\n clusters = cluster();\n console.log(clusters);\n\n\n\n const badWordsSum = avgWords(badWords);\n console.log('bad', badWordsSum);\n const hintVectors = clusters\n // for each group\n .map(cluster => {\n // add all vectors in group\n // subtract sum of vectors in badWords\n return Word2VecUtils.subVecs(avgWords(cluster), badWordsSum);\n });\n hints = hintVectors\n .map((hint, index, array) => Word2VecUtils.getNClosestMatches(array.length + 4, hint).map(arr => arr[0]));\n console.log(hints);\n\n // |> findNClosest (numberOfHints / group.len)\n\n populateUI(totalWords);\n\n loadingOverlay.style.display = \"none\";\n content.style.filter=\"none\";\n}", "title": "" }, { "docid": "35242bc5a224299bcfab33eb97d13ab6", "score": "0.67610806", "text": "function gameCheck() {\n\n if (correct.indexOf(\"_\") === -1) {\n alert(\"You do it! You found \" + wordChoice.toUpperCase() + \". Press ANY key to play again.\");\n wins++;\n winCount.innerHTML = wins;\n\n if (wordChoice === words[0]) {\n doggy.innerHTML = \"<h3>Beagle</h3><img src='assets/images/beagle.jpg' /></br></br>The Beagle is a breed of small hound that is similar in appearance to the much larger foxhound. The beagle is a scent hound, developed primarily for hunting hare.\";\n doggy.style.border = \"1px solid #888888\";\n \n }\n\n if (wordChoice === words[1]) {\n doggy.innerHTML = \"<h3>Weimaraner</h3><img src='assets/images/weimaraner.jpg' /></br></br>The Weimaraner is a large dog that was originally bred for hunting in the early 19th century. Early Weimaraners were used by royalty for hunting large game such as boar, bear and deer.\";\n doggy.style.border = \"1px solid #888888\";\n }\n\n if (wordChoice === words[2]) {\n doggy.innerHTML = \"<h3>Chihuahua</h3><img src='assets/images/chihuahua.jpg' /></br></br>The Chihuahua is the smallest breed of dog and is named after the state of Chihuahua in Mexico. Chihuahuas come in a wide variety of colors, and two coat lengths.\";\n dogInfo.style.border = \"1px solid #888888\";\n }\n\n if (wordChoice === words[3]) {\n doggy.innerHTML = \"<h3>Rottweiler</h3><img src='assets/images/rottweiler.jpg' /></br></br>The Rottweiler is a breed of domestic dog, regarded as medium-to-large or large. The dogs were known in German as Rottweiler Metzgerhund, meaning Rottweil butchers' dogs, because their main use was to herd livestock and pull carts laden with butchered meat to market.\";\n doggy.style.border = \"1px solid #888888\";\n }\n\n if (wordChoice === words[4]) {\n doggy.innerHTML = \"<h3>Whippet</h3><img src='assets/images/whippet.jpg' /></br></br>The Whippet is a dog breed of medium-size. They are a sighthound breed that originated in England, where they descended from greyhounds. Whippets today still strongly resemble a smaller greyhound. Shown in the Hound group, Whippets have relatively few health problems other than arrhythmia.\";\n doggy.style.border = \"1px solid #888888\";\n }\n\n if (wordChoice === words[5]) {\n doggy.innerHTML = \"<h3>Bulldog</h3><img src='assets/images/bulldog.jpg' /></br></br>The Bulldog, also known as the British Bulldog or English Bulldog, is a medium-sized breed of dog. It is a muscular, hefty dog with a wrinkled face and a distinctive pushed-in nose. The American Kennel Club, The Kennel Club, and the United Kennel Club oversee breeding records.\";\n doggy.style.border = \"1px solid #888888\";\n }\n\n if (wordChoice === words[6]) {\n doggy.innerHTML = \"<h3>Dobermann</h3><img src='assets/images/dobermann.jpg' /></br></br>The Dobermann, or Doberman Pinscher in the United States and Canada, is a medium-large breed of domestic dog that was originally developed around 1890 by Karl Friedrich Louis Dobermann, a tax collector from Germany. The Dobermann has a long muzzle. It stands on its pads and is not usually heavy-footed.\";\n doggy.style.border = \"1px solid #888888\";\n }\n \n gameStart();\n }\n else if (numGuesses === 0) {\n alert(\"Game over! The answer was \" + wordChoice.toUpperCase() + \". Press ANY key to play again.\");\n losses++;\n lossCount.innerHTML = losses;\n gameStart();\n }\n\n}", "title": "" }, { "docid": "f717eb1f9655843daa03390dce715880", "score": "0.6739054", "text": "function generateGame(word){\n\t\t\tword = word.toLowerCase();\n \n\t\t\t// Launch timer\n\t\t\tconst delay = (i === 0) ? 10000 : 0;\n\t\t\tif(i === 0){\n\t\t\t\tmessage.sendT(\"fun/findwords:GAME_STARTING\");\n\t\t\t}\n\n\t\t\tsetTimeout(() => {\n \n\t\t\t\t// Send announcment message\n\t\t\t\tmessage.sendT(\"fun/findwords:FIND_WORD\", {\n\t\t\t\t\tword\n\t\t\t\t}, false, false, \"warn\");\n \n\t\t\t\t// init a collector to receive the answers\n\t\t\t\tconst collector = new Discord.MessageCollector(message.channel, (m) => !m.author.bot, {\n\t\t\t\t\ttime: 20000\n\t\t\t\t});\n \n\t\t\t\tcollector.on(\"collect\", (msg) => {\n\t\t\t\t\tif(!participants.includes(msg.author.id)){\n\t\t\t\t\t\tparticipants.push(msg.author.id);\n\t\t\t\t\t}\n\t\t\t\t\tif(msg.content.toLowerCase().indexOf(word) >= 0 && wordList.map((word) => word.toLowerCase()).indexOf(msg.content.toLowerCase()) >= 0){\n\t\t\t\t\t console.log(wordList[wordList.map((word) => word.toLowerCase()).indexOf(msg.content.toLowerCase())])\n\t\t\t\t\t\tcollector.stop(msg.author.id); // Stop the collector\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsg.inlineReply(msg.translate(\"fun/findwords:INVALID_WORD\", {\n\t\t\t\t\t\t\tmember: msg.author.username\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t});\n \n\t\t\t\tcollector.on(\"end\", async (collected, reason) => {\n\t\t\t\t\tif(reason === \"time\"){\n\t\t\t\t\t currentGames[message.guild.id] = false;\n\t\t\t\t\t\treturn message.error(\"fun/findwords:NO_WINNER\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcollected.first().inlineReply(message.translate(\"fun/findwords:WORD_FOUND\", {\n\t\t\t\t\t\t\twinner: \"<@\"+reason+\">\"\n\t\t\t\t\t\t}));\n\t\t\t\t\t\twinners.push(reason);\n\t\t\t\t\t}\n\t\t\t\t\tif(i < nbGames-1) {\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tgenerateGame.call(this, words[i]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrentGames[message.guild.id] = false;\n\t\t\t\t\t\tif(winners.length < 1){\n\t\t\t\t\t\t\treturn message.error(\"fun/findwords:NO_WINNER_ALL\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst winnerID = await getWinner(winners);\n\t\t\t\t\t\tconst time = message.convertTime(createdAt, \"from\", true);\n\t\t\t\t\t\tconst user = await this.client.users.fetch(winnerID);\n\t\t\t\t\t\tmessage.sendT(\"fun/findwords:GAME_STATS\", {\n\t\t\t\t\t\t\twinner: user.username,\n\t\t\t\t\t\t\tduration: time,\n\t\t\t\t\t\t\tparticipantCount: participants.length,\n\t\t\t\t\t\t\tparticipantList: participants.map((p) => \"<@\"+p+\">\").join(\"\\n\")\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif(participants.length > 1 && data.guild.disabledCategories && !data.guild.disabledCategories.includes(\"Economy\")){\n\t\t\t\t\t\t\tmessage.sendT(\"fun/findwords:CREDITS\", {\n\t\t\t\t\t\t\t\twinner: user.username\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tconst userdata = await this.client.findOrCreateUser({ id: user.id });\n\t\t\t\t\t\t\tuserdata.money = userdata.money + 15;\n\t\t\t\t\t\t\tuserdata.save();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}, delay);\n\t\t}", "title": "" }, { "docid": "2ed406406de146dcc9dda39614718e84", "score": "0.6709931", "text": "function checkWin() {\n if (chosenWord.toLowerCase() === guessedWord.join(\"\").toLowerCase()) {\n wins++;\n gamestart = false;\n document.getElementById(\"wins\").textContent = wins;\n document.getElementById(\"guesswordText\").textContent = guessedWord.join(\"\");\n playaudioWin();\n showArtwork();\n }\n}", "title": "" }, { "docid": "f0b30542cfdc721cc9116d3b8b71ad59", "score": "0.670765", "text": "function cycle(){\n\n console.log(\"WinCount: \" + winCounter + \" | LossCount: \" + lossCounter + \" | NumGuesses: \" + allottedGuesses);\n\n document.getElementById(\"word-blanks\").innerHTML = blanksAndSuccesses.join(\" \");\n document.getElementById(\"wrong-guesses\").innerHTML = wrongGuesses.join(\" \");\n document.getElementById(\"guesses-left\").innerHTML = allottedGuesses;\n\n //correct\n if(blanksAndSuccesses.toString() === lettersInWordSelection.toString()){\n\n alert(\"SUCCESS\");\n winCounter++;\n document.getElementById(\"win-counter\").innerHTML = winCounter;\n\n initiationSequence();\n }\n\n //YOU LOSE\n else if(allottedGuesses === 0){\n\n lossCounter++;\n alert(\"FAILURE\");\n document.getElementById(\"loss-counter\").innerHTML = lossCounter;\n\n initiationSequence();\n\n }\n\n}", "title": "" }, { "docid": "ffee2b24216b0ff33c2d86f3656cef47", "score": "0.6651946", "text": "function gameRefresh() {\n curWord = wordBank[Math.floor(Math.random() * wordBank.length)],\n guessedRight = [],\n letterKeys = [],\n guessedLetters = [],\n letterStart();\n if ( guessedWords.indexOf(curWord) !== -1 ) {\n gameRefresh();\n };\n // console.log(curWord);\n}", "title": "" }, { "docid": "0ff56c330a799edebae9fe362096d307", "score": "0.66512215", "text": "function startFunction(){\n if (start == true){\n document.getElementById(\"scores\").style.display=\"block\";\n document.getElementById(\"word-board\").style.display=\"block\";\n document.getElementById(\"message\").innerHTML= \" \";\n document.getElementById(\"btn\").innerHTML=\"Retry\";\n reset();\n start = false; process = true ; status = 1;\n lives = 3; letters.length = 0; target.length = 0; repeated = \"\";\n iterator = 0; counter = 12 + iterator; repeatCounter = 1; guess = \"\"; letterCounter = 0 ;\n word = words[iterator];\n letters = word.split(\"\");\n letterCounter = letters.length;\n placement();\n document.getElementById(\"lives\").innerHTML= lives;\n document.getElementById(\"btn\").disabled=true;\n document.getElementById(\"counter\").innerHTML= counter;\n //========= Retry =======\n }else if (status==1) { \n reset();\n iterator -= 1;\n word = words[iterator];\n letters = word.split(\"\");\n repeated.length=0;\n letterCounter = letters.length;\n lives -= 1; \n counter = 12+iterator;\n placement();\n status=0;\n process =true;\n document.getElementById(\"lives\").innerHTML= lives;\n document.getElementById(\"btn\").disabled=true;\n document.getElementById(\"counter\").innerHTML= counter;\n //========= next =======\n }else if(status == 0){\n reset();\n word = words[iterator];\n letters = word.split(\"\");\n repeated.length=0;\n letterCounter = letters.length;\n counter = 12+iterator;\n placement();\n status=1;\n process =true;\n document.getElementById(\"btn\").innerHTML=\"Retry\";\n document.getElementById(\"btn\").disabled=true;\n document.getElementById(\"counter\").innerHTML= counter;\n }\n if (lives > 0 && iterator <= 5){\n \n //================== onkeyup function ============== \n \n document.onkeyup = function(event) {\n if (process== true){\n var guess = (event.key).toUpperCase();\n document.getElementById(\"btn\").disabled=false;\n document.getElementById(\"message\").innerHTML= \"\";\n if (availableLetters.indexOf(guess) > -1) {\n var flag = true;\n repeatFinder();\n if (flag){\n find();\n document.getElementById(\"the-word\").innerHTML =\"\";\n placement();\n counter--;\n document.getElementById(\"counter\").innerHTML= counter;\n }\n }else{\n document.getElementById(\"message\").innerHTML= message[0];\n }\n \n // =====================================\n \n if(counter >= 0 && letterCounter <= 0 ){\n if(iterator > 4){\n process =false;\n start=true;\n document.getElementById(\"message\").innerHTML= message[2];\n document.getElementById(\"btn\").innerHTML=\"Restart\";\n }else{\n process =false;\n status=0;\n document.getElementById(\"message\").innerHTML= message[4];\n document.getElementById(\"btn\").innerHTML=\"Next\";\n }\n }else if(counter == 0 && letterCounter > 0){\n if(lives == 0){\n process =false;\n start=true;\n document.getElementById(\"message\").innerHTML= message[3];\n \n document.getElementById(\"btn\").innerHTML=\"Restart\";\n }else{\n process =false;\n status=1;\n document.getElementById(\"message\").innerHTML= message[5];\n document.getElementById(\"btn\").innerHTML=\"Retry\"; \n }\n }\n if(counter >= 0 && letterCounter > 0){\n status=1;\n document.getElementById(\"btn\").innerHTML=\"Retry\"; \n }\n \n //==================== find function ===============\n \n function find(){\n for(i = 0 ; i < letters.length ; i++){\n if(guess == letters[i]){ \n target[i] = guess;\n letterCounter -= 1;\n }\n }\n }\n \n //==================== repeatFinder function========\n \n function repeatFinder(){\n if (repeated.indexOf(guess) > -1) {\n document.getElementById(\"message\").innerHTML= message[1];\n flag = false;\n }else{\n repeated+=guess;\n document.getElementById(\"g\"+repeatCounter).innerHTML= guess;\n repeatCounter += 1;\n }\n }\n //===================================================\n \n }//process\n }//keyup\n }else if (lives > 0 && iterator > 5 ){\n start=true;\n document.getElementById(\"message\").innerHTML= message[2];\n document.getElementById(\"btn\").innerHTML=\"Restart\";\n }else if(lives <= 0){\n start=true;\n document.getElementById(\"btn\").disabled=false;\n document.getElementById(\"message\").innerHTML= message[3];\n document.getElementById(\"btn\").innerHTML=\"Restart\"; \n }\n \n}", "title": "" }, { "docid": "3d6296896c3014fb0cc3a2a0d6090a52", "score": "0.6648487", "text": "function play(){\n\t\tdocument.onkeyup = function(){\n\t\t\tdocument.getElementById(\"pressToStart\").innerHTML=\"\";\n\t\t\tvar userGuess = String.fromCharCode(event.keyCode).toLowerCase();\n\t\t\t\n\t\t\t//Checking to see if the letter has already been guessed. If it has been entered already, flag = true, then the function does not go to check the blankWord against the user's guess. \n\t\t\tvar flag = false;\n\t\t\tfor (var j=0; j<lettersUsed.length;j++){\n\t\t\t\tif (userGuess === lettersUsed[j]){\n\t\t\t\t\tflag = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//If letter has not been guessed, the following logic will run to check if the user input is contained within the random word. \n\t\t\tif (flag === false){\n\t\t\t\t//Holder being created to correctly decrease guesses remainng\n\t\t\t\tvar holder = false;\n\t\t\t\tfor (var i=0; i<selectedWord.length; i++){\n\t\t\t\t\tif (userGuess === selectedWord.charAt(i)){\n\t\t\t\t\t\tblankWord[i] = userGuess;\n\t\t\t\t\t\tholder = true;\n\t\t\t\t\t\tcounter ++;\n\t\t\t\t\t\twinOrLose();\n\t\t\t\t\t\tconsole.log(\"Counter: \" + counter);\n\t\t\t\t\t\tconsole.log(\"Length of word: \" + selectedWord.length);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t//Guesses remainng only decreases if the letter that is guessed by the user is not contained in the random word.\n\t\t\t\tif (holder === false){\n\t\t\t\t\tguessesRemaining--;\n\t\t\t\t\tanimate();;\n\t\t\t\t\tdrawingIndex++;\n\t\t\t\t\tconsole.log(\"Guesses remaining: \" + guessesRemaining);\n\t\t\t\t\tdocument.getElementById(\"lives-left\").innerHTML=\"Guesses left: \" + guessesRemaining;\n\t\t\t\t\twinOrLose();\n\t\t\t\t\tconsole.log(\"Counter is: \" + counter);\n\t\t\t\t} \n\n\t\t\t\tconsole.log(lettersUsed);\n\t\t\t\tlettersUsed.push(userGuess);\n\t\t\t\tdocument.getElementById(\"letters-used\").innerHTML=lettersUsed.join(\"\").toUpperCase();\n\t\t\t}\n\n\t\t\tdocument.getElementById(\"blank-word\").innerHTML = blankWord.join(\"\").toUpperCase();\n\t\t}\n\t}", "title": "" }, { "docid": "e36237fcf3e253c82cb9d34f8606c6bb", "score": "0.6638079", "text": "function winCondition() {\n winCounter = 0;\n for (l = 0; l < wordC.length; l++) {\n if (wordC[l] != \" \") {\n winCounter++;\n } else { }\n }\n return winCounter;\n}", "title": "" }, { "docid": "6ebf58a3df3780b7bcb027cb1b7d2e0f", "score": "0.6628773", "text": "function gameWin()\n{\n var winChecker=\"\";\nfor (var i=0;i<unguessedString.length;i++)\n{\n winChecker=winChecker + unguessedString[i];\n}\nif (winChecker ==currentString)\n{\n console.log(\"You Win\" + winChecker + currentString);\n hintPic(6) // this will display clear picture when win\n isWinDisplay(1);\n wins++;\n currentString = \"\";\n setTimeout(createHangmanWord, 3000); // will wait 3 seconds until next word is displayed, also will delete the \"isWin\" tag\n // create a new word\n tries = []; //reset Tries\n}\nif (tries.length > 5) // check if Player has 5 tries, in which case loses\n{\n console.log(\"You LOSE\" + winChecker + currentString);\n isWinDisplay(2);\n loseDisplay();\n loses++;\n firstGame = true;\n setTimeout(createHangmanWord, 3000); // will wait 3 seconds until next word is displayed, also will delete the \"isWin\" tag // create a new word\n tries = []; //reset Tries\n}\n}", "title": "" }, { "docid": "696df78ce5caed8f35274c5865f86806", "score": "0.66217786", "text": "function wordComplete() {\n\tfor (i=0; i < wordBeingPlayed.length; i++) {\n\t\tif (wordBeingPlayed[i] == \"_\") {\n\t\t\treturn;\n\t\t} \n\t}\n\tplayerWins++;\n\tupdateScoreboard(\"win\");\n}", "title": "" }, { "docid": "d015a067177ffd138b333170db2ec94e", "score": "0.66159695", "text": "function checkWords() {\n return randomText === input.value\n}", "title": "" }, { "docid": "bf9f2317ce30c78374a38417e81453ac", "score": "0.6592547", "text": "checkForWin() {\n //phraseMatch is the length of the empty boxes\n const phraseMatch = $('.letter').length;\n //match is the length of the displayed boxes with the class of show\n const match = $('.letter.show').length;\n //if the length of the empty boxes is equal to the length of the displayed boxes then return true\n if (phraseMatch === match) {\n console.log(phraseMatch + match + ' (the player has chosen all letters in the phrase')\n return true\n }\n\n }", "title": "" }, { "docid": "05228c1a34d357273e37345accc25a5b", "score": "0.65858495", "text": "function winsLosses() {\n if (numberOfGuesses === 0) {\n console.log('You LOST! The correct US state was: ' + randomWord);\n losses++;\n console.log('Wins: ' + wins);\n console.log('Losses: ' + losses);\n console.log('******************************');\n askToPlayAgain();\n } //chesk is all slots filled in by entered correctly letters\n else if (numberOfSlots === computerWord.letters.length) {\n console.log(\"You WON!\");\n wins++;\n console.log(\"Wins: \" + wins);\n console.log(\"Losses: \" + losses);\n console.log(\"******************************\");\n askToPlayAgain();\n } else { //if user still need to enter letters to continue guessing the word\n guessLetter()\n };\n\n}", "title": "" }, { "docid": "f7263ae8fabebd86885bb8d12ff5a9c3", "score": "0.658371", "text": "function valid() {\n const found = []; //to track what has been found\n const unguessed = words.splice(0, words.length()); //copy of array with all possible words, used to track how many haven't been found and to help with displaying\n if (found.includes(word)) {\n //scenario if word has already been found.\n console.log(`${word} has already been found, try again!`);\n console.clear();\n } else {\n if (words.includes(word)) {\n //if word is correct and new it is pushed into found and removed from the unguessed array\n found.push(word);\n unguessed.pop(word);\n console.log(`Correct! ${word}`);\n //alert(`Correct! ${word}`);\n console.clear();\n } else {\n console.log(`${word} is not a word!`);\n //alert(`${word} is not a word!`);\n console.clear();\n }\n }\n if (word == \"*\") {\n //if an asterisk if inputted, the word is rescrambled and display is reset.\n scramble();\n //display status of game again\n console.log(`The word has been rescrambled and the display reset`);\n console.clear();\n }\n nextGuess();\n}", "title": "" }, { "docid": "b8593a6ce63d1fde99166b00a39a8c23", "score": "0.6571915", "text": "function randomWord() {\n animalIndex = Math.floor(Math.random() * zooAnimals.length);\n console.log(\"animal index \" + animalIndex);\n//try to account for words already used\nif (oldWords.length < zooAnimals.length) {\n while (oldWords.indexOf(animalIndex) !==-1 ) {\n animalIndex = Math.floor(Math.random() * zooAnimals.length);\n console.log(`animal index ${animalIndex} old index ${oldWords}`);\n }\n oldWords.push(animalIndex);\n console.log(`pushed wold words into animal index: ${oldWords}`)\n } else {\n console.log(\"pre-return\"); \n return gameEnd = false;\n }\n }", "title": "" }, { "docid": "8e9bcbc309e6e54a606b028d061cad00", "score": "0.6552485", "text": "function possible(word) {\r\n console.log(exists(word));\r\n console.log(word);\r\n if (word.length < 4 || !exists(word)){\r\n console.log(\"fail snatch 1\");\r\n return false;\r\n }\r\n let wordAttempt = make(word.split(\"\"));\r\n if(wordAttempt.works) {\r\n wordAttempt.snatch.forEach(snatch =>{\r\n for (let player of game_state.players) {\r\n if(player.name == snatch.from) {\r\n let ind = player.words.indexOf(snatch.word);\r\n player.words.splice(ind, 1);\r\n }\r\n }\r\n });\r\n console.log(\"successful snatch\");\r\n console.log(game_state.availLetters);\r\n return true;\r\n }\r\n console.log(\"fail snatch 2\");\r\n return false;\r\n}", "title": "" }, { "docid": "a3284556647c916de1500978805f8796", "score": "0.65387166", "text": "function hasWon(word) {\n // Creates string out of revealed letters\n var currentStatus = \"\";\n for (var i = 0; i < word.length; i++) {\n currentStatus += document.getElementById(i).innerHTML;\n };\n // If the string of revealed letters matches the word from the Word Bank array, triggers win button and updates wins\n if (currentStatus === word) {\n document.getElementById(\"win-button\").style.visibility = \"visible\";\n wins++;\n document.getElementById(\"wins\").innerText = \"Wins: \" + wins;\n };\n}", "title": "" }, { "docid": "5db3b8e8c4e2f32ad7d89e42d36690bc", "score": "0.6527445", "text": "function winLose() {\n // matching section - first make sure we have guessed a letter in the secretWord \n\n if (secretWord.search(userGuess) !== -1) {\n\n // I'm doing a for loop to search and replace - need loop for double letters\n // - painful but feel like that is less cheezey than just providing words with single letters\n for (i = 0; i < (secretWord.length); i++) {\n if (userGuess == secretWord.charAt(i)) {\n shownWord = (shownWord.replaceAt(i, userGuess));\n letterGuessed.push(userGuess);\n }\n }\n // check if they won with this guess\n if (shownWord == secretWord) {\n console.log(\"its a win!\");\n winCount++\n letterGuessed = [\"you won this one - good job! Press any letter for next round\"];\n newWord = true;\n manStage = 8;\n\n }\n }\n else {\n console.log(\"swing and a miss\");\n badGuesses++;\n letterGuessed.push(userGuess);\n\n\n\n // check if this has been five times\n if (badGuesses == 7) {\n lossesCount++\n newWord = true;\n shownWord = secretWord;\n letterGuessed = [\"you lost this round! Press any letter for the next round\"]\n }\n manStage = badGuesses;\n\n }\n\n}", "title": "" }, { "docid": "3e92da95e070527c8293546ba8d3acaf", "score": "0.6523963", "text": "function gameOver() {\n word.letters.forEach(letter => {\n letter.compareLetter(answers.userGuess);\n check.push(letter.returnLetter());\n // console.log(check);\n });\n\n // Complete word guessed\n if(word.toString() == check.join('')) {\n return true;\n }\n \n return false;\n }", "title": "" }, { "docid": "5dce011a1b6ad206646c0022ef4066bf", "score": "0.65222126", "text": "function gameLogic(keyPress) {\n for (i = 0; i < randomWord.length; i++) {\n if (randomWord[i] == keyPress && keyPress.match(/[a-z]/) && correctWord.indexOf(keyPress) == -1) {\n \n thatbox = document.getElementsByClassName('class_' + keyPress);\n for (p = 0; p < thatbox.length; p++) {\n thatbox[p].innerHTML = keyPress;\n victory ++;\n }\n correctWord.push(keyPress);\n \n } else if (keyPress.match(/[a-z]/) && incorrectGuess.indexOf(keyPress) == -1) {\n incorrectGuess.push(keyPress);\n }\n }\n filter();\n winCondition();\n userGuess.textContent = lastArray.join(' ');\n}", "title": "" }, { "docid": "4bcfd7e616d663bd0cea221abde8776f", "score": "0.65172553", "text": "function determineIfFinished() {\n \tvar spaces = 0;\n \tfor (var i = 0; i < word.length; i++) {\n \t\tif (hiddenWord[i] === \"_\") {\n \t\t\tspaces++;\n \t\t}\n \t}\n \tif (guesses === 0) {\n\t\t\tlosses++;\n\t\t\tnewRound = true;\n \t\tupdateLosses();\n \t}\n \telse if (spaces === 0) {\n\t\t\twins++;\n\t\t\tnewRound = true;\n \t\tupdateWins();\n \t}\n \telse {\n\t\t\tnewRound = false;\n \t}\n }", "title": "" }, { "docid": "0ec528d4281d384844688702222fe0ce", "score": "0.648703", "text": "function checkWordGuess() {\n if (roundWord.join(\"\") === guessWord.join(\"\")) {\n isWin = true;\n }\n}", "title": "" }, { "docid": "d53ce38fd2511777ed5a389c280f3a5a", "score": "0.64830303", "text": "function winCheck() {\n return document.querySelectorAll('.words-to-match').length === 0;\n }", "title": "" }, { "docid": "2911230946c0612f1b06862ff611331f", "score": "0.64775", "text": "function chooseWord() {\n\tvar tempArray = totalChoices[Math.floor(Math.random() * totalChoices.length)];\n\tvar tempWord = tempArray[Math.floor(Math.random() * tempArray.length)];\n\tif (allWordsChosen.indexOf(tempWord) == -1) {\n\t\twordChosen = tempWord;\n\t\tallWordsChosen.push(wordChosen);\n\t\tblankArray = [];\n\t\tfillBlankArray(wordChosen);\n\t\tcheckForSpaces();\n\t\tdisplayBlankArray();\n\t\tresetP2Health();\n\t\tsetP2Health();\n\t\tconsole.log(wordChosen);\n\t\tconsole.log(blankArray);\n\n\t} else if (allWordsChosen.length < 30) {\n\t\tconsole.log(\"Duplicate Word :\" + tempWord);\n\t\tchooseWord();\n\t} else {\n\t\tconsole.log(\"No More Words Left.\")\n\t}\n}", "title": "" }, { "docid": "1cc2f93f38a4a9752003174b31225c21", "score": "0.647654", "text": "function isStillPlaying(lives, underScore, word){\n underScore = underScore.split(' ').join('').trim()\n underScore = underScore.split('\\033[32m').join('').split('\\033[39m').join('').trim()\n let keepLooping = true\n if(lives === 0){\n keepLooping = false\n } else if (underScore === word){\n keepLooping = \"✅ \\033[32mCongratulations you guessed the word!\\033[39m ✅\"\n }\n return keepLooping\n}", "title": "" }, { "docid": "86568cf64a9b8e31f412ac4641700c2f", "score": "0.64709795", "text": "checkForWin() {\n //loop through all li's, check txt content & class\n const lis = document.getElementById('phrase').firstElementChild.children;\n for (let i = 0; i < lis.length; i++) {\n if (lis[i].textContent === ' ' || lis[i].className === 'letter show') {\n this.gameWon++;\n }\n }\n if (this.gameWon === this.currentPhrase.phrase.length) {\n this.gameOver('win', 'Congratulations! You Win!');\n } else {\n this.gameWon = 0;\n }\n\n }", "title": "" }, { "docid": "6c37e54aacb6c19622af17f287c4d9c6", "score": "0.6465854", "text": "checkForWin() {\r\n\t\tconst lost = 'YOU LOST';\r\n\t\tconst win = 'YOU WON';\r\n\t\tif (this.missed === 5) {\r\n\t\t\tthis.gameOver(lost);\r\n\t\t} else if (shownLetters === phraseLetters.filter((ch) => ch !== \" \").length) {\r\n\t\t\tthis.gameOver(win);\r\n\t\t} else {\r\n\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "54eade8b01ab39dbcb5a6c74c73c9495", "score": "0.64565736", "text": "function checkIfWordWasDiscovered(theme) {\n if (!(listOfUnderscores.indexOf('_') > -1)) {\n emptyGameDivs();\n \n currentUser = sessionStorage.getItem(\"currentUser\");\n \n if (currentUser !== null) {\n userScore();\n \n // Add one point to the player's score\n if (playerScore !== null) {\n playerScore = parseInt(playerScore) + 1;\n // If the player has no score yet, then his score is set to one\n } else {\n playerScore = 1;\n }\n \n $('#textBoxBtns').append(`<p><b>Ganhou 1 ponto!</b></p><p><b>Minha pontuação até agora:</b> ${playerScore} </p><p><b>Palavra:</b> ${word} </p><p><b>Tempo:</b> ${timeInMinSec}</p>`);\n \n localStorage.setItem(currentUserScore, playerScore);\n \n wasWordGuessed = \"Sim\";\n pushMatches(theme);\n } else {\n // In case user is not loggedin, the message is slightly different\n $('#textBoxBtns').append(`<p><b>Acertou!</b></p><p><b>Palavra:</b> ${word} </p><p><b>Tempo:</b> ${timeInMinSec}</p>`);\n }\n \n $('#textBoxBtns').append(\"<button class='btn btn-dark' onclick='location.reload()'>Começar novo jogo</button>\");\n $('#textBoxBtns').append(\"<br><br><img src='style/joker_clapping.gif' class='img-fluid' alt='Joker is clapping, because you won!'>\");\n } else {\n createTextBoxBtns(theme);\n }\n}", "title": "" }, { "docid": "e427d00212debf418a9e738de441335c", "score": "0.64380205", "text": "function checkGameOver() {\n\tif (attempts === 0 || !linesArray.includes('-')) {\n\t\tlet finalWord;\n\t\tattempts === 0 ? (finalWord = 'Perdiste!') : (finalWord = 'Ganaste!');\n\t\tsetTimeout(() => {\n\t\t\talert(`${finalWord} , la palabra era \"${wordGenerated}\"`);\n\t\t\twindow.location.href = window.location.href;\n\t\t}, 800);\n\t}\n}", "title": "" }, { "docid": "6660656dcfe181073a88a7f481af811e", "score": "0.64269775", "text": "function startGame() {\n // Initial Settings.\n pickedWord = \"\";\n guessesLeft = 15;\n if(pickedWords.length < wordBank.length) {\n pickedWord = getWord();\n } else {\n // If there are no more words in the word bank, the game will display the win condition.\n console.log(\"You definitely know your Greek mythology. Great job!\");\n continuePrompt();\n } // If there are still words left in the wordk bank the game will pick a new Word.\n if(pickedWord) {\n word = new Word(pickedWord);\n word.makeLetters();\n userGuess();\n }\n}", "title": "" }, { "docid": "c7e68e1dac1fe89e60a3fb91c0063578", "score": "0.6424319", "text": "function keystrokes(compKeystroke)\n{\n for (i=0;i<currentString.length;i++)\n {\n if (currentString.charAt(i)== compKeystroke)\n {\n wrongGoodMessage(\"GOOD!!!\");\n document.getElementById(\"myAudio\").currentTime = 0;\n document.getElementById(\"myAudio\").play().playbackRate = 2; //play a sound on keystrokes\n console.log(unguessedString);\n unguessedString[i] = compKeystroke; // This will add a space between words\n console.log(unguessedString[1] + \"changed\");\n } \n if (currentString.charAt(i)== \" \")\n {\n unguessedString[i] = \" \"; // with this line the user doesn't need to type spaces for two word games.\n } \n }\n if (compKeystroke != undefined) // will prevent \"tries\" to have undefined characters due to the function skipping controls. \n {\n if (countChar(currentString, compKeystroke) == 0 && currentString.length > 0 ) // this line will check if the keystroke is in the current string and the string size is at least 1, if not will add it to \"tries\"\n {\n if(tries.indexOf(compKeystroke) == -1)\n {\n wrongGoodMessage(\"WRONG !!! TRY AGAIN!!!\");\n document.getElementById(\"myAudio2\").currentTime = 0;\n document.getElementById(\"myAudio2\").play().playbackRate = 2; //play a sound on keystrokes\n tries[tries.length]= compKeystroke;\n hintPic(tries.length); // will display a less blurred image as the tries increase\n } \n }\n }\n printSingleCharacter(\"unguessed\", unguessedString); // Refresh Unguessed string to the html document\n gameWin(); //check isWin\n}", "title": "" }, { "docid": "fbbebee1fa3fe7428f877e81ff7bf9ea", "score": "0.64233416", "text": "function continueGame(){\n\trandomNumber = Math.floor(Math.random() * wordBank.length);\n\trandomWord = wordBank[randomNumber];\n\tblankSpaces();\n\tcounter = 6;\n\tnumberAttempts();\n\tupdateHangman();\n\tguessedLetters = \"\";\n\tdocument.querySelector(\"#lettersGuessed\").innerHTML = (\"Letters already guessed: \" + guessedLetters + \" \");\n\twinLetters = 0;\n}", "title": "" }, { "docid": "f423d0f1b4750ab93d53a19d2429fc1b", "score": "0.6422978", "text": "function runGame() {\n state = 'game';\n timeElapsed = 0;\n wordsTyped = -1;\n\n allowCapitals = document.getElementById('allowCapitals').checked; \n document.cookie = `capitals=${allowCapitals};`;\n\n document.getElementById('words').focus();\n setUpNextWord();\n}", "title": "" }, { "docid": "3ceb52f145a40e29023cd35b934b9b7e", "score": "0.6414172", "text": "function numRepeats(word){\n\tvar checkedLetters = [],\n\t\tnumRepeats = 0;\n\tfor (var i=0;i<word.length;i++){\n\t\tif (checkedLetters.indexOf(word[i]) === -1){\n\t\t\tcheckedLetters.push(word[i]);\n\t\t\tfor (var j=(i+1);j<word.length;j++){\n\t\t\t\tif (word[i] === word[j]){\n\t\t\t\t\tnumRepeats++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn numRepeats;\n}", "title": "" }, { "docid": "8173bb14279a28bb7c59c057f54b7661", "score": "0.64054424", "text": "function gamePlay(){\n availInput = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"0\", \" \"];\n wordBank = [\"luke\",\"leia\",\"chewbacca\",\"hansolo\",\"darthvader\",\"anakin\", \"obiwankenobi\", \"yoda\", \"lando\", \"darthmaul\",\"r2d2\",\"c3p0\", \"rey\",\"finn\",\"phasma\",\"poe\",\"kyloren\"];\n userGuesses = [];\n wrongGuesses = [];\n placeHolders = [];\n \n\n //decides if won or lost\n numMatchingGuesses = 0;\n allowedGuesses = 10; //lives\n\n //get a random word\n randWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n console.log(randWord.length);\n\n //replace randomWord and add underscores\n for (var i = 0; i < randWord.length; i++) {\n placeHolders.push(\" _ \");\n underScores.textContent = placeHolders.join(' ');\n \n }\n \n //user guessing functions\n document.onkeyup = function(event) {\n userGuess = event.key;\n\n if (availInput.indexOf(userGuess) > -1) {\n userGuesses.push(userGuess);\n availInput.splice(availInput.indexOf(userGuess), 1);\n\n if(randWord.indexOf(userGuess) > -1){ //maybe take this out later if it is DRY, leave for loop\n for (var i = 0; i < randWord.length; i++) {\n\n if ( randWord[i] === userGuess) {\n placeHolders[i] = userGuess;\n underScores.textContent = placeHolders.join(' ');\n numMatchingGuesses++;\n console.log(numMatchingGuesses);\n }\n }\n\n }\n else { //if change DRY code should be else if \n wrongGuesses.push(userGuess);\n wrongGuess.textContent = wrongGuesses.join(' ');\n allowedGuesses--;\n livesCounter.textContent = allowedGuesses;\n }\n\n\n\n } //end of if for not using same key twice\n \n else {\n alert(\" That's not a valid guess, or you may have used that letter previously.\");\n }\n \n if (numMatchingGuesses === randWord.length) {\n roundWin();\n console.log(numMatchingGuesses)\n \n }\n else if (allowedGuesses === 0) {\n roundLoss();\n alert(\"You Lost!\")\n \n }\n } \n\n \n } //end of gameplay function", "title": "" }, { "docid": "791a34bf2df9ae8bd01727de76c1b169", "score": "0.640227", "text": "function checkWin(word) {\n // variable will be used to count the underlines (blanks) in the word\n var blanks = 0;\n // place the string values of the word in an array\n word = word.split(\"\");\n // For loop to count the number of underlines\n for (var i = 0; i < word.length; i++) {\n if (word[i] === \"_\") {\n blanks++;\n }\n };\n // If the guesses have run out, tell user s/he has lost and restart game\n if (guesses <= 0) {\n console.log(\"\\x1b[37m\", word.join(\"\") + \"\\n\");\n console.log (\"\\x1b[37m\", \"You lost!! Next word:\\n\");\n startGame();\n // else if there are still underlines in the word (unguessed letters), continue game\n } else if (blanks > 0) {\n guessLetter();\n // The only possibility left is that the user has won!! Let user know, then restart game\n } else {\n console.log(\"\\x1b[37m\", \"You won!! Next word:\\n\");\n startGame();\n }\n}", "title": "" }, { "docid": "4298bf7b0be5fdff9f4dbfa9f94d9fad", "score": "0.63999057", "text": "function wordsChoosing() {\n var randomNum = Math.floor(Math.random() * engArray.length)\n if (wordsChoosingArray.length == 8) {\n wordsArrayFilling()\n return\n } else if (wordsChoosingArray.indexOf(randomNum) == -1) {\n wordsChoosingArray.push(randomNum)\n }\n wordsChoosing()\n}", "title": "" }, { "docid": "b7e6729b560399b8e853a8ed4c6f6d49", "score": "0.6396315", "text": "function noMatches () {\nwhile (gentleman1 == gentleman2 || gentleman1 == gentleman3 || gentleman1 == gentleman4 || gentleman2 == gentleman1 || gentleman2 == gentleman3 || gentleman2 == gentleman4 || gentleman3 == gentleman1 || gentleman3 == gentleman2 || gentleman3 == gentleman4 || gentleman4 == gentleman1 || gentleman4 == gentleman2 || gentleman4 == gentleman3) {\n gentleman1 = Math.floor(Math.random() * 12) + 1;\n gentleman2 = Math.floor(Math.random() * 12) + 1;\n gentleman3 = Math.floor(Math.random() * 12) + 1;\n gentleman4 = Math.floor(Math.random() * 12) + 1;\n console.log(gentleman1 + \" \" + gentleman2 + \" \" + gentleman3 + \" \" + gentleman4); //initial random numbers\n}\n}", "title": "" }, { "docid": "4aff6e6981ebd376c67320ada33f5e48", "score": "0.6391871", "text": "function checkKeyword()\n {\n var enteredWord = \"\";\n var boxesLength = $(\".cndkLevel\" + gameCurrentLevel + \" > .cndkBox\").length;\n var boxesEnteredLength = 0;\n $(\".cndkLevel\" + gameCurrentLevel + \" > .cndkBox\").each(function(){\n if($(this).find(\"input\").val().length == 1)\n {\n boxesEnteredLength++;\n }\n enteredWord += replaceSpecialChars($(this).find(\"input\").val()).toUpperCase();\n });\n\n // Word is completed check if is correct\n if(boxesEnteredLength == boxesLength)\n {\n if(enteredWord == gameCurrentKeyword)\n {\n // Lock game\n gameIsPassive = true;\n\n // Remove extra time content\n $(\".cndkExtraTimer\").remove();\n extraTimeDispose = true;\n\n // Correct\n $(\".cndkLevel\" + gameCurrentLevel + \" > .cndkBox input\").parent().addClass(\"cndkBoxCorrect\");\n $(\".cndkLevel\" + gameCurrentLevel + \" > .cndkBox input\").prop(\"disabled\",true);\n\n // Stop timer\n gameIsStopped = true;\n $(\".cndkRequestLetter\").attr(\"disabled\",true);\n $(\".cndkGuess\").attr(\"disabled\",true);\n\n // Calculate points\n $(\".cndkLevel\" + gameCurrentLevel + \" > .cndkBox input[data-opened='false']\").each(function(){\n gamePoints += 100;\n });\n\n // Write points\n $('.cndkPoints > span').html(\"<em>\" + textPoints + \"</em>\" + gamePoints);\n\n // Go to next level\n setTimeout(function(){\n $(\".cndkLevel\").remove();\n $(\".cndkCurrentInfo\").remove();\n }, 2000);\n gameCurrentQuestionNumber++;\n if(gameCurrentQuestionNumber <= gameTotalQuestionNumber)\n {\n if(gameCurrentQuestionNumber%2 != 0)\n {\n gameCurrentLevel++;\n }\n\n setTimeout(function(){\n $(\".cndkLevel\").remove();\n getLevel(gameCurrentLevel);\n }, 2500);\n }\n else\n {\n gameOver();\n }\n \n }\n else\n {\n // Incorrect\n $(\".cndkLevel\" + gameCurrentLevel + \" > .cndkBox input\").parent().addClass(\"cndkBoxIncorrect\");\n }\n }\n else\n {\n $(\".cndkLevel\" + gameCurrentLevel + \" > .cndkBox input\").parent().removeClass(\"cndkBoxCorrect\");\n $(\".cndkLevel\" + gameCurrentLevel + \" > .cndkBox input\").parent().removeClass(\"cndkBoxIncorrect\");\n }\n \n }", "title": "" }, { "docid": "a97f67bd49abb3953a27ea09691f31eb", "score": "0.6389361", "text": "function checkWin() {\n if (guessingWord.indexOf(\"_\") === -1) {\n document.getElementById(\"you-win\").style.cssText = \"display: block\";\n document.getElementById(\"tryAgain\").style.cssText = \"display: block\";\n wins++;\n hasFinished = true;\n }\n}", "title": "" }, { "docid": "5ca90132479cad0e2c172c77471d034d", "score": "0.63833183", "text": "function nextWord() {\r\n missedLetter = 0; // clears 'missedLetter' before next word challenge\r\n goodLetters = 0; // clears good letter count\r\n wordCounter++;\r\n letterButtons = document.getElementById(\"ltrGrp\").children;\r\n\r\n // shows all letter buttons\r\n for (i=0; i<letterButtons.length; i++) {\r\n letterButtons[i].style.display = \"inline-block\";\r\n } \r\n // removes all letter _ placeholders\r\n for (i=0; i<underline.childNodes.length; i++) {\r\n underline.innerHTML = \"\";\r\n }\r\n playGame.style.display = \"inline-block\"; // show PLAY GAME button \r\n // check whether more words available\r\n if (words[wordCounter]) {\r\n loadWord();\r\n }\r\n else {\r\n endGame();\r\n }\r\n}", "title": "" }, { "docid": "ed330f25cf622274fd854cf11b9fdd99", "score": "0.637983", "text": "function complete() {\n console.log(\"wins:\" + wins + \"| losses:\" + losses + \"| guesses left:\" + guessesRemaining)\n\n //if WON...\n if (lettersOfWord.toString() == blanksAndCorrect.toString()) {\n wins++;\n reset()\n //display wins on screen\n document.getElementById(\"winstracker\").innerHTML = \" \" + wins;\n\n //if LOST...\n } else if (guessesRemaining === 0) {\n losses++;\n reset()\n document.getElementById(\"losstracker\").innerHTML = \" \" + losses;\n }\n //display losses on screen && guesses remaining countdown\n document.getElementById(\"currentword\").innerHTML = \" \" + blanksAndCorrect.join(\" \");\n document.getElementById(\"guessesremaining\").innerHTML = \" \" + guessesRemaining;\n}", "title": "" }, { "docid": "80b81c25aad5a168279876967e48b005", "score": "0.6378619", "text": "function updateGameState(guess, word, answerArray) {\n let appearances = 0;\n for (let j = 0; j < word.length; j++) {\n if (word[j] === guess.toLowerCase() && answerArray[j] == \"_\") {\n answerArray[j] = guess.toLowerCase();\n displayCorrectGuesses(guess, j);\n appearances++;\n }\n }\n\n return appearances;\n}", "title": "" }, { "docid": "31936cee64006c56a164a1b0faf491e2", "score": "0.63786083", "text": "function intialSetupForDisplayWord (wrd){\n\tvar cword='';\n\tfor (i=0,i<wrd.length;i++){\n\t\tcword=cword + '_';\n\t}\n\treturn cword\n\n}\n\n//prompts the user for input\nfunction promptUser(c,w){\n\tvar totalChances= w.length;\n\tvar chancesLeft= totalChances-c;\n\tvar l= prompt(\"So far you have: \" + displayWord + \n\t\t\". Guess a letter please. You have \" +chancesLeft+ \n\t\t\" chances left.\" );\n\treturn l\n}\n\nfunction rebuildDisplayWord (index,wrd,dispwrd){\n\tvar letter=wrd[index];\n\tdispwrd=dispwrd.split('');\n\tdispwrd[index]=letter;\n\tdispwrd=dispwrd.join('');\n\treturn dispwrd;\n}\n \n//Establishes a list of words for the user to guess\nvar wordBank = ['ghost','candy','costume',\n'vampire','witch','monster']\n\n//Divides the word up by its individual characters to be checked against by user input\nword=wordSelector\nlettersInside=word.split('');\ndisplayWord=intialSetupForDisplayWord(word);\ntotalChances=word.length;\n\nwhile (displayWord != word){\n\tvar guess= promptUser(chancesUsed, word);\n\n\tbreak;\n}\n\nwhile (guess.length > 1 ){\n\talert(\"Choose a letter\");\n\tvar guess= promptUser(chancesUsed,word);\n}\n//Informs the user they lost if they exceed the number of guesses\nif (chancesUsed==(word.length)){\n\talert(\"Game Over\");\n\tbreak;\n}\n\nvar i=lettersOfWord.indexOf(guess);\nif (i !== =1){\n\tlettersOfWord.splice(i,1);\n\tdisplayWord=rebuildDisplayWord \n\t(word.indexOf(guess),word,displayWord);\n\tcorrect++;\n}else{\n\tchancesUsed++;\n}\n\nif (correct==word.length){\n\tcontinuePlay==true\n}\n//Informs user whether they won or lost\nif (continueplay== true){\n\tif (correct== word.length){\n\t\talert(\"You Win!\");\n\t\tvar playAgain = confirm(\"Play Again?\");\n\t}else{\n\t\talert(\"You Lost!\");\n\t\tvar playAgain = confirm(\"Play Again?\");\n\t}\n\tif (playAgain){\n\t\tlocation.reload();\n\t}\n}", "title": "" }, { "docid": "aa7dd7f8173a4148dcae1e536e2d9cb6", "score": "0.63770837", "text": "function keyMatch(guess) {\n //checks if key guessed was a spacebar and does nothing if it was *is unessicary because implimented logic on line 31*\n if (guess == \" \") {\n\n\n //checks if input is on an array of already pressed keys, and if it is part of the computer chosen word\n } else if (!(usedL.indexOf(guess) > -1) && (words[wordsRan].indexOf(guess) > -1)) {\n //adds it to the used letter array and refreshes guessed letter array on html\n usedL.push(guess);\n document.getElementById(\"usedL\").textContent = usedL;\n\n //runs function that counts where and how many times the letter guessed appears in the word\n freqMatch(guess);\n //console.log(loc)\n //console.log(guess)\n\n //a loop that uses the info gathered in freqMatch(guess); function to fill in the blanks on the html by\n //replacing the location of the guessed letter with the guessed letter\n for (i = 0; i < loc.length; i++) {\n console.log(loc);\n console.log(word);\n word[loc[i]] = words[wordsRan].charAt(loc[i]);\n console.log(word);\n }\n\n // refresh html missing letters with correctly guessed letters\n document.getElementById(\"mys-word\").textContent = word;\n\n\n // condition to determine if letter guessed is not on the already guessed letters array, and is not a letter \n // in the computer chosen word AND the user has more than one guess to be able to continue guessing AFTER\n // they lose a chance to guess\n } else if (!(usedL.indexOf(guess) > -1) && !(words[wordsRan].indexOf(guess) > -1) && (guesses > 1)) {\n // subtract 1 from guesses remaining, refresh that. adds guess to guessed letter array and refreshes that\n guesses--;\n document.getElementById(\"guesses\").textContent = guesses;\n usedL.push(guess);\n document.getElementById(\"usedL\").textContent = usedL;\n\n\n // conditon to see if letter was not guessed already, and is not a correct guess, and the user only has 1 guess remaing\n // to restart the game because user just lost\n } else if (!(usedL.indexOf(guess) > -1) && !(words[wordsRan].indexOf(guess) > -1) && (guesses = 1)) {\n guesses--;\n document.getElementById(\"guesses\").textContent = guesses;\n usedL.push(guess);\n document.getElementById(\"usedL\").textContent = usedL;\n document.getElementById(\"mys-word\").textContent = wordC;\n document.getElementById(\"start\").textContent = \"Better luck next time, press any key to get started\"\n document.onkeypress = function(){ begin() };\n }\n // all other conditions left are if the user guessed the letter already\n else {\n //console.log(\"already guessed\");}\n }\n}", "title": "" }, { "docid": "01431e3156e52b0e5b014a720d82e0bf", "score": "0.6372234", "text": "function easter() {\n //check if clue already found and game is started\n if (clueFound == false && gameStarted == true) {\n //check if wrongGuesses is greater than 2\n if (wrongGuess > 2) {\n //get clue\n let i = 0;\n while (i != phraseLength && clueFound != true) {\n if (puzzle[i] == \"-\") {\n //display clue\n let clue = phrase[i];\n txtOutput.setAttribute(\"class\", \"blue\");\n txtOutput.innerText = `Try Pressing '${clue}' 😉`;\n clueFound = true;\n }\n i += 1;\n }\n }\n }\n}", "title": "" }, { "docid": "86c50706b006276974f5f608e01ad949", "score": "0.63694334", "text": "function checkWord() {\r\n\tif (input.value === wordArray[currentWord]) {\r\n\t\twords.children[currentWord].classList.remove('current-word');\r\n\t\twords.children[currentWord].classList.add('correct');\r\n\t\tcorrectWords++;\r\n\t\tcurrentWord++;\r\n\t\thighlightCurrentWord();\r\n\t\tcorrWords.innerText = `Correct Words: ${correctWords}`;\r\n\t\tinput.value = '';\r\n\t} else {\r\n\t\twords.children[currentWord].classList.remove('current-word');\r\n\t\twords.children[currentWord].classList.add('wrong');\r\n\t\tincorrectWords++;\r\n\t\tcurrentWord++;\r\n\t\thighlightCurrentWord();\r\n\t\tincorrWords.innerText = `Incorrect Words: ${incorrectWords}`;\r\n\t\tinput.value = '';\r\n\t}\r\n}", "title": "" }, { "docid": "1b2e7bbb86c910a83fe8a0f89e3d26c5", "score": "0.6364371", "text": "function gameOver() {\n for (i = 0; i < newWord.length; i++) {\n if (newWord[i] != word[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "298f62a18a2861165b40dd61e341a22c", "score": "0.6357875", "text": "function selectWord () {\n if (possibleWords.length >0) {\n let idx = Math.floor(Math.random()*possibleWords.length);\n let selected = possibleWords[idx];\n currentWord.initialize(selected);\n possibleWords.splice(idx,1); \n numGuesses = maxGuesses; // re-set guesses\n guessedLetters = []; // re-set guessed letters\n gameSolved = false; // re-set game state\n playGame();\n } else {\n console.log ('\\nAll my words have been used!');\n }\n}", "title": "" }, { "docid": "26324d4d978a05c6081a44bd8aae0eb9", "score": "0.635659", "text": "function gameWonCheck() {\n var index = 0;\n var stillMatchesToCheck = true;\n\n // check for game won (all matches made)\n while (stillMatchesToCheck) {\n if (!gameBoard[index].match) {\n stillMatchesToCheck = false;\n } else {\n // if all tiles are checked and no false is found\n if (index === numberOfTiles) {\n gameWonScreen();\n } else {\n index++;\n }\n }\n }\n}", "title": "" }, { "docid": "916751e9612dbf8382935c2ba1fa6cd7", "score": "0.6352431", "text": "function checkWin()\n{\n\tfor(var i = 0; i < ourWordTable.length; i++){\n\t\tif( !(ourWordTable[i]))\n\t\t\treturn false\n\t}\n\tconsole.log('A WINNER IS YOU')\n\treturn true\n}", "title": "" }, { "docid": "87763e179a4f81172aaf19bc0e41f339", "score": "0.6349394", "text": "function correctGuess(){\n if (resume_or_play == 1){\n passOrCorrect = \"correct\"\n addWordToList(wordArrayList[randomNumber],\"#0066cc\"); // It marks the word in blue shade.\n result = result + 1;\n showWords();\n }\n}", "title": "" }, { "docid": "d3b494f6f97e39dc7b85ad9433fa5190", "score": "0.6337611", "text": "function matchwords() {\n\n\tif (typing.value === demsg.innerHTML) {\n\n\t\tmessage.innerHTML = \"Correct\";\n\t\timg1.style.display = \"block\";\n\t\timg2.style.display = \"none\";\n\t\treturn true;\n\t}\n\t\telse{\n\t\t\tmessage.innerHTML = \"\";\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "550d7615ddd6f26bb7cadbf9540d86f3", "score": "0.63241524", "text": "function checkIfGameWon() {\n if (wordStatus === answer) {\n clearInterval (clear);\n countDownElement.innerHTML = 0;\n document.getElementById('alphabet').innerHTML = 'You won!';\n won++;\n updateWon()\n }\n}", "title": "" }, { "docid": "5e3f921ee234615cf705e25096c489ed", "score": "0.6317422", "text": "function gameWords() {\n if (wordInput.value === currentWord.innerHTML) {\n message.innerHTML = \"Correct!!\";\n return true;\n } else {\n message.innerHTML = \"\";\n return false;\n }\n}", "title": "" }, { "docid": "883e42bb3147cdc1e6854c1a37031cc3", "score": "0.631521", "text": "function startMatch() {\n if (matchWords()) {\n isPlaying = true;\n time = startingTime;\n setTime();\n showWord(words);\n wordInput.value = \"\";\n score++;\n LevelButtons.classList.add(\"invisible\");\n }\n setScore();\n}", "title": "" }, { "docid": "141b55f54cde61fc50ebc7fd43091802", "score": "0.63139004", "text": "function gameLoop(arry) {\n if (arry.length === 0) {\n console.log(\"Game Over\");\n } else {\n let textWord = arry[Math.floor(Math.random() * arry.length)];\n let word = new Word(textWord);\n let numberGuesses = 12;\n arry.splice(arry.indexOf(textWord), 1);\n console.log(word.wordReturn());\n wordLoop(word, numberGuesses, arry);\n }\n}", "title": "" }, { "docid": "bedb47efa52df13e6c1b844aa9622424", "score": "0.6310195", "text": "function putWord(){\n\n var subtitles = \"\";\n\n for(var i = 0; i < CAPTIONS.length; i++)\n subtitles+=CAPTIONS[i].transcript+\" \";\n\n var scriptWords = subtitles.split(\" \");\n\n for(var i = 0; i < scriptWords.length; i++)\n scriptWords[i] = removePunctuation(scriptWords[i]);\n\n\n var gameWords = document.getElementsByClassName(\"game_word\");\n\n var gameWordsText = []\n\n for(var i = 0; i < gameWords.length; i++)\n gameWordsText.push(gameWords[i].textContent);\n\n var correctWord;\n\n //Check if blank is in first position\n if(document.getElementsByClassName(\"question\")[0].firstChild.className==\"underline\") {\n for(var i = 0; i < scriptWords.length; i++){\n if(scriptWords[i+1]===gameWordsText[0]&&scriptWords[i+2]===gameWordsText[1]\n &&scriptWords[i+3]===gameWordsText[2]){\n correctWord = scriptWords[i];\n break;\n }\n\n }\n\n }\n\n //Blank is not in first position\n else{\n var matchedWords = 0;\n\n for(var i = 0; i < scriptWords.length; i++){\n\n if(scriptWords[i]===gameWordsText[matchedWords])\n matchedWords++;\n\n else if(matchedWords >= 1){\n var isCorrect = true;\n\n //After finding suspect blank, check if remaining game words (if any) are correct\n for(var j = 0; j+matchedWords<gameWordsText.length; j++)\n if(!(scriptWords[i+j+1]===gameWordsText[matchedWords+j]))\n isCorrect = false;\n\n if(isCorrect==true){\n correctWord = scriptWords[i];\n i=scriptWords.length; //Essentially a break statement\n }\n }\n\n else if(!(scriptWords[i]===gameWordsText[matchedWords-1]))\n matchedWords = 0;\n }\n }\n\n var answerBox = document.getElementsByClassName(\"answer\")[0];\n\n answerBox.value = correctWord;\n\n var buttons = document.getElementsByClassName(\"button\")\n\n for(var i = 0; i < buttons.length; i++){\n if(buttons[i].innerHTML===correctWord){\n buttons[i].click()\n break;\n }\n\n }\n\n }", "title": "" }, { "docid": "1391e28174ffec7b460b13e7f4b8bcd8", "score": "0.63035005", "text": "function compareLetters(letter) {\n // Count how many times a number matches\n var numberOfNonMatches = 0;\n for(i = 0; i < selectedWordLetters.length; i++) {\n \n if (letter === selectedWordLetters[i]) {\n // Reveal the letter\n revealedLetters[i] = letter;\n $(\".word\").text(revealedLetters.join(\" \"));\n\n // See if the user has matched the word\n if (revealedLetters.join() === selectedWordLetters.join()) {\n // Adds a win and starts the game over\n wins++;\n readyToPlay = false;\n $(\".wins\").text(wins);\n $(\".modal-start h1\").text(\"You Won!\");\n $(\".modal-start p\").text(\"Press NEW GAME! to play again.\");\n $(\".modal-start button\").text(\"NEW GAME!\");\n $(\".modal-start\").removeClass(\"hidden\");\n $(\".modal-start button\").on(\"click\", function(){\n $(\".modal-start\").addClass(\"hidden\");\n readyToPlay = true;\n selectedWord();\n });\n };\n \n } else if (keyPressed !== selectedWordLetters[i]) {\n numberOfNonMatches++;\n }\n }\n\n // If guessed letter matches nothing...\n if (numberOfNonMatches === selectedWordLetters.length) {\n // Decrease score\n numberOfGuesses--;\n\n // Update the hangman images\n if (numberOfGuesses === 6) {\n $(\".drawing-2\").attr(\"src\", \"assets/img/drawing-2-middle.png\");\n $(\".drawing-4\").attr(\"src\", \"assets/img/drawing-4-start.png\");\n } else if (numberOfGuesses === 5) {\n $(\".drawing-4\").attr(\"src\", \"assets/img/drawing-4-middle.png\");\n $(\".drawing-6\").attr(\"src\", \"assets/img/drawing-6-start.png\");\n } else if (numberOfGuesses === 4) {\n $(\".drawing-4\").attr(\"src\", \"assets/img/drawing-4-middle-2.png\");\n } else if (numberOfGuesses === 3) {\n $(\".drawing-4\").attr(\"src\", \"assets/img/drawing-4-end.png\");\n } else if (numberOfGuesses === 2) {\n $(\".drawing-6\").attr(\"src\", \"assets/img/drawing-6-middle.png\");\n } else if (numberOfGuesses === 1) {\n $(\".drawing-6\").attr(\"src\", \"assets/img/drawing-6-end.png\");\n }\n\n if (numberOfGuesses === 0) {\n $(\".drawing-2\").attr(\"src\", \"assets/img/drawing-2-end.png\");\n \n losses++;\n readyToPlay = false;\n $(\".losses\").text(losses);\n $(\".modal-start h1\").text(\"You Lose!\");\n $(\".modal-start p\").text(\"Press NEW GAME! to play again.\");\n $(\".modal-start button\").text(\"NEW GAME!\");\n $(\".modal-start\").removeClass(\"hidden\");\n $(\".modal-start button\").on(\"click\", function(){\n $(\".modal-start\").addClass(\"hidden\");\n readyToPlay = true;\n selectedWord();\n });\n }\n }\n }", "title": "" }, { "docid": "8b96c614cee0a9390a907d03db1d5072", "score": "0.63006604", "text": "checkProgress() {\n let remainingGuesses = this.state.remainingGuesses;\n let gameWon = this.state.gameWon;\n let wordToGuess = this.state.wordToGuess;\n wordToGuess = [...new Set(wordToGuess)];\n let playerCorrectGuesses = this.state.playerCorrectGuesses;\n playerCorrectGuesses = [...new Set(playerCorrectGuesses)];\n if (\n wordToGuess.length === playerCorrectGuesses.length &&\n wordToGuess.length > 1 &&\n gameWon === false\n ) {\n gameWon = true;\n this.setState({ remainingGuesses: 6, gameOn: false, gameWon: gameWon });\n } else if (remainingGuesses < 1) {\n this.setState({ remainingGuesses: 6, gameOn: false });\n }\n }", "title": "" }, { "docid": "61089758e39a923a851214e19544e7de", "score": "0.62969536", "text": "function playGame() {\n pickedWord = \"\";\n guesses = 15;\n if(pickedWords.length < wordBank.length) {\n pickedWord = getWord();\n } else {\n // Console log message if user has guessed the word and won\n console.log(\"You know your American League teams!\");\n continuePrompt();\n }\n if(pickedWord) {\n word = new Word(pickedWord);\n word.makeLetters();\n makeGuess();\n }\n}", "title": "" }, { "docid": "3b54fa5c7b1f1adc84060832841da646", "score": "0.6296041", "text": "checkForWin(phrase) {\n // this method checks to see if the player has revealed all\n // of the letters in the active phrase.\n const letters = phrase.filter('.letter');\n const matchedLetters = letters.filter('.show');\n if (matchedLetters.length === letters.length) {\n this.gameOver('You win!', 'win');\n }\n }", "title": "" }, { "docid": "ce91cc6fdbaa3f282d85dbf72505b37f", "score": "0.62934947", "text": "function gameover()\n {\n random = Math.floor((Math.random()*(wordList.length-1))); \n word = wordList[random]; \n currentword = new Array(word.length);\n MAX_GUESSES = 10;\n for (var i = 0; i < currentword.length; i++)\n {\n currentword[i] = \"_ \";\n }\n prevguessed=[];\n document.getElementById(\"currentword\").innerHTML=\"\";\n guessWord();\n document.getElementById(\"letters\").innerHTML=\"\";\n document.getElementById(\"guessesleft\").innerHTML=MAX_GUESSES;\n resetFigure();\n }", "title": "" }, { "docid": "6e6d97d52a314250db15e0f9621c714e", "score": "0.6291969", "text": "function setUpNextWord() {\n document.getElementById('words').value = '';\n\n if(timer !== null) {\n clearInterval(timer);\n }\n\n wordIndex = 0;\n timeVal = 5;\n document.getElementById('timer').innerText = timeVal;\n\n timer = setInterval(() => {\n timeVal -= 1;\n timeElapsed += 1;\n document.getElementById('timer').innerText = timeVal;\n\n if(timeVal <= 0) {\n endGame();\n }\n }, 1000);\n\n wordsTyped += 1;\n word = generateNonsenseWord(wordsTyped + 1, true);\n document.getElementById('textHere').innerText = word;\n}", "title": "" }, { "docid": "e2947f883deea571d6cefbc4f2698e16", "score": "0.6289959", "text": "function chooseWord() {\n // If all words have been played, then reset wordTracker \n if (wordTracker.length === wordList.length) {\n wordTracker = [];\n }\n // Otherwise, if word is duplicated, then find a new word\n else {\n chosenWord = wordList[Math.floor(Math.random() * wordList.length)];\n var duplicateWord = wordTracker.indexOf(chosenWord.name);\n for (; duplicateWord !== -1;) {\n chosenWord = wordList[Math.floor(Math.random() * wordList.length)];\n duplicateWord = wordTracker.indexOf(chosenWord.name);\n }\n }\n console.log(chosenWord.name);\n // Create an array and use a for loop to iterate through all the letters in chosen word.\n wordArray = Array.from(chosenWord.name);\n for (var i = 0; i < chosenWord.name.length; i++) {\n wordArray[i] = \"_\";\n }\n // Add to game div on the page (\"#game\").\n gameDiv.innerText = wordArray.join(\" \");\n // Update image to match word\n imagesDiv.innerHTML = \"<img src='assets/images/\" + chosenWord.image + \"' class='img-fluid'>\";\n // Update quote to match word\n quotesDiv.innerHTML = chosenWord.quote;\n}", "title": "" }, { "docid": "f57d7e41f568c380c5ded041bc00db24", "score": "0.62876445", "text": "function checkWord () {\n let word = elGuessBox.value.toLowerCase()\n let isGuessValid = checkGuessValid(word)\n\n if (!isGuessValid) {\n return\n }\n\n console.log('adding word: ' + word)\n wordsFound.push(word)\n\n runningScore += calculateValidWordScore(word)\n updateScore()\n\n updateWordsFound(word)\n\n elGuessBox.value = ''\n\n}", "title": "" }, { "docid": "d4d1acc92e8ef3007940a742ea15bab7", "score": "0.62832385", "text": "function setGame() {\n\t\t\t\t//get random word\n\t\t\t\tvar randomWord = wordBank[Math.floor(Math.random() * wordBank.length)];\n\t\t\t\tvar randomArray = (randomWord.split(\"\"));\n\t\t\t\tconsole.log(randomWord);\n\t\t\t\tconsole.log(randomArray);\n\t\t\t\tconsole.log(randomWord.length);\n\n\t\t\t\tvar lettersGuessedString = \"...\";\n\t\t\t\tvar lettersGuessed = [];\n\t\t\t\tdocument.getElementById(\"winnerLoser\").innerHTML = blank;\n\n\t\t\t\t//create mystery placeholder array for screen view\n\t\t\t\tplaceHolderArray = [];\n\t\t\t\tremainingGuesses = 15;\n\t\t\t\tdocument.getElementById(\"lettersGuessed\").innerHTML = lettersGuessedString;\n\t\t\t\tdocument.getElementById(\"guessesRemaining\").innerHTML = remainingGuesses;\n\t\n\t\t\t\t\tfor (i=0; i<randomWord.length; i++) {\n\t\t\t\t\t\n\t\t\t\t\tplaceHolderArray.push (\"_\");\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconsole.log(placeHolderArray);\n\t\t\t\tvar placeHolderString = placeHolderArray.join(\" \");\n\t\t\t\tdocument.getElementById(\"mysteryWord\").innerHTML = placeHolderString;\n\t\t\t\tdocument.getElementById(\"guessesRemaining\").innerHTML = remainingGuesses;\n\t\t\t\n\n\t\t\t\t//get the player selection set\n\t\t\t\tdocument.onkeyup = function addToPlayerSelection(event) {\n\t\t\t\t\t\n\t\t\t\t\t//define player selection and set to lowercase\n\t\t\t\t\tplayerSelection = event.key.toLowerCase();\n\t\t\t\t\tconsole.log (playerSelection);\n\n\n\n\t\t\t\t\t//is selection in word?\n\t\t\t\t\tif (randomArray.indexOf(playerSelection) == -1 && lettersGuessed.indexOf(playerSelection) == -1 && alphabetArr.indexOf(playerSelection) != -1) {\n\t\t\t\t\t\tlettersGuessed.push(playerSelection);\n\t\t\t\t\t\tremainingGuesses = remainingGuesses - 1;\n\t\t\t\t\t\t //add check for guessing letter already in array and reducing number of guesses by 1\n\t\t\t\t\t\tconsole.log(lettersGuessed);\n\t\t\t\t\t\tconsole.log(remainingGuesses);\n\t\t\t\t\t\tlettersGuessedString = lettersGuessed.join(\"\");\n\t\t\t\t\t\tdocument.getElementById(\"lettersGuessed\").innerHTML = lettersGuessedString;\n\t\t\t\t\t\tdocument.getElementById(\"guessesRemaining\").innerHTML = remainingGuesses;\n\t\t\t\t\t}\n\n\t\t\t\t\t\t//else, where in the word is it?\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//get indexes where selection exists in randomArray\n\t\t\t\t\t\t\tfunction getAllIndexes(arr, val) { \n\t\t\t\t\t\t\tvar indexes = [];\n\t\t\t\t\t\t\tfor (i = 0; i < arr.length; i++)\n\t\t\t\t\t\t\t\t\tif (arr[i]===val)\n\t\t\t\t\t\t\t\t\tindexes.push(i);\n\t\t\t\t\t\t\t return(indexes);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar indexes = getAllIndexes(randomArray, playerSelection);\n\t\t\t\t\t\t\tconsole.log(indexes);\n\n\t\t\t\t\t\t\t//replace \"__\" in placeHolderArray with playerSelection at indexes\n\t\t\t\t\t\t\tfor (i=0; i<indexes.length; i++) {\n\t\t\t\t\t\t\t\tplaceHolderArray.splice(indexes[i], 1, playerSelection);\n\n\t\t\t\t\t\t\t} console.log(placeHolderArray);\n\t\t\t\t\t\t\t placeHolderString = placeHolderArray.join(\" \");\n\t\t\t\t\t\t\t document.getElementById(\"mysteryWord\").innerHTML = placeHolderString;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (placeHolderString.indexOf(\"_\") == -1 && remainingGuesses > 0) {\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twins = (wins + 1);\n\t\t\t\t\t\t\tdocument.getElementById(\"winText\").innerHTML = wins;\n\t\t\t\t\t\t\tdocument.getElementById(\"winnerLoser\").innerHTML = \"WAY TO GO! Click above for the next word\";\n\t\t\t\t\t\t\tdocument.onkeyup = function() {\n\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\telse if (placeHolderString.indexOf(\"_\") != -1 && remainingGuesses ==0) {\n\n\t\t\t\t\t\t\tfor (i=0; i<1; i++) {\n\t\t\t\t\t\t\t\tlosses = (losses + 1);\n\t\t\t\t\t\t\t\tdocument.getElementById(\"losses\").innerHTML = losses;\n\t\t\t\t\t\t\t\tdocument.getElementById(\"winnerLoser\").innerHTML = \"DANG IT, click above for the next word.\";\n\t\t\t\t\t\t\t\tdocument.onkeyup = function() {\n\n\t\t\t\t\t\t\t\t\treturn false;\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\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t return false;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t}", "title": "" }, { "docid": "43c902804eddd2e0107b812037841a00", "score": "0.6281044", "text": "function matchWord() {\n\tif (wordInput.value === currentWord.innerHTML) {\n\t\t//logging a completed word with time\n\t\tconsole.log(\n\t\t\t\"Typed \" +\n\t\t\t\tcurrentWord.innerHTML.toUpperCase() +\n\t\t\t\t\" in \" +\n\t\t\t\t(currentLevel - time) / 10 +\n\t\t\t\t\" seconds!\"\n\t\t);\n\t\tmessage.innerHTML =\n\t\t\t\"Typed \" +\n\t\t\tcurrentWord.innerHTML.toUpperCase() +\n\t\t\t\" in \" +\n\t\t\t(currentLevel - time) / 10 +\n\t\t\t\" seconds!\";\n\n\t\t// console.log(\"Typed in \" + (currentLevel - time) / 10 + \" secs!\");\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "ee46b4d989aa7cc9e4b13a6a179b3c32", "score": "0.62691313", "text": "checkForWin(hits) {\n const phraseLetters = newPhrase.phrase.split('');\n const lettercount = phraseLetters.filter(letter => letter !== ' ').length;\n \n if(hits === lettercount) {\n this.gameOver('win');\n }\n }", "title": "" }, { "docid": "3ff3d254ef4f14651bad5521ebd8c883", "score": "0.62673146", "text": "function letters() {\r\n // array of word miss messages\r\n var miss = [\r\n \"YOU'RE HUNG<br>Drinkin' whisky?\",\r\n \"YOU'RE HUNG<br>U a city slicker?\",\r\n \"YOU'RE HUNG<br>Been in the altitude?\",\r\n \"YOU'RE HUNG<br>On the trail too long?\",\r\n \"YOU'RE HUNG<br>Got a horse smarter than u\",\r\n \"YOU'RE HUNG<br>Maybe poker is ur game?\"\r\n ],\r\n letter = event.target.innerHTML, // captures the letter of the click\r\n // sets up current word\r\n wordArray = words[wordCounter].split(\"\"), // array of current word \r\n currentWord = words[wordCounter], // captures current word\r\n // creates array of matching letter indices\r\n indices = [];\r\n for (i=0; i<currentWord.length; i++) {\r\n if (currentWord[i] === letter) indices.push(i);\r\n } \r\n\r\n // checks for single or multiple same letters\r\n if (indices.length != 0) {\r\n // inserts the matching letter(s) into appropriate placeholder\r\n for (i=0; i<indices.length; i++) {\r\n var index = indices[i];\r\n underline.children[index].innerHTML = letter;\r\n event.target.style.display = \"none\"; // hides letter button after use\r\n }\r\n // play gunshot audio with pause/currentTime code for rapid fire\r\n var gun = document.getElementById(\"gunshot\");\r\n gun.pause();\r\n gun.currentTime = 0;\r\n gun.play();\r\n // concat multiple index letters within the letterCount\r\n goodLetters = goodLetters+indices.length-1;\r\n goodLetters++;\r\n // compares correct letters to wordArray to see if word solved\r\n if (goodLetters >= wordArray.length) {\r\n // applies a delay to show completed word\r\n setTimeout(function wordDelay() { \r\n playGame.style.display = \"inline-block\";\r\n playGame.innerHTML = \"NICE SHOOTIN' TEX\";\r\n wordSolved++;\r\n document.getElementById(\"bell\").play(); // play dinner bell audio\r\n hanginGallows.src = \"assets/images/gallows.png\"; // changes gallows img\r\n // hides all letter buttons\r\n letterButtons = document.getElementById(\"ltrGrp\").children;\r\n for (i=0; i<letterButtons.length; i++) {\r\n letterButtons[i].style.display = \"none\";\r\n }\r\n // removes all letter _ placeholders\r\n for (i=0; i<underline.childNodes.length; i++) {\r\n underline.innerHTML = \"\";\r\n }\r\n }, 1000);\r\n // applies a delay between words\r\n setTimeout(function wordSolved() { \r\n nextWord();\r\n }, 2000); \r\n }\r\n }\r\n // runs if letter is not in currentWord\r\n else {\r\n // checks number of 'missedLetter' count\r\n if (missedLetter < 5) {\r\n // play horse audio with pause/currentTime code for rapid fire\r\n var horse = document.getElementById(\"horse\");\r\n horse.pause();\r\n horse.currentTime = 0;\r\n horse.play(); \r\n hanginGallows.src = \"assets/images/gallows\" + missedLetter + \".png\"; // changes gallows img\r\n event.target.style.display = \"none\"; // hides letter button after use\r\n missedLetter++;\r\n }\r\n // runs when number of 'missedLetter' is reached\r\n else { \r\n letterGroup.removeEventListener(\"click\", letters, false); // removes event listener from letter buttons \r\n playGame.style.display = \"inline-block\";\r\n // display random message from miss message array \r\n playGame.innerHTML = miss[Math.floor(Math.random() * miss.length)];\r\n document.getElementById(\"fart\").play(); // play fart audio \r\n hanginGallows.src = \"assets/images/gallows5.png\"; // changes gallows img\r\n // hides all letter buttons\r\n letterButtons = letterGroup.children;\r\n for (i=0; i<letterButtons.length; i++) {\r\n letterButtons[i].style.display = \"none\";\r\n }\r\n // removes all letter _ placeholders\r\n for (i=0; i<underline.childNodes.length; i++) {\r\n underline.innerHTML = \"\";\r\n }\r\n // applies a delay between words \r\n setTimeout(function wordFailed() {\r\n nextWord();\r\n }, 3000);\r\n } \r\n } \r\n}", "title": "" }, { "docid": "acb6347dfb7abd099635b27cd41c5216", "score": "0.62603223", "text": "function checkforWin () {\n if (wordWithBlanks === currentWord) {\n alert('you win')\n }\n }", "title": "" }, { "docid": "ad83231d71e143c4d33a8bdd8e58d45b", "score": "0.6257411", "text": "function checkGuesses(){\n var display_string = \"\"\n\n for(var i=0;i<props.word.length;i++){\n if (guessedLetters.includes(props.word[i])){\n display_string = display_string + props.word[i]\n // console.log({display_string})\n } else {\n display_string = display_string + \"_\"\n // console.log({display_string})\n }\n }\n\n console.log(display_string.split(\"\").toString())\n console.log(props.word.toString())\n\n // win condition\n if (display_string.split(\"\").toString().localeCompare(props.word) === 0) {\n console.log(\"aye\")\n addLetter([])\n setLives(6)\n setImage()\n // addLetter([])\n // setText(\"why does this not work? ):\")\n }\n return <h2>{display_string}</h2>\n }", "title": "" }, { "docid": "474930141efec2699ea0a246fbb623c4", "score": "0.6251937", "text": "function main(x)\n{\n\tvar matchfound=false;\n\t//checks for the letter in the whole array dash\n\tfor(i=0;i<guessword.length;i++)\n\t{\n\t\tif(x==guessword[i])\n\t\t{\n\t\t\tdash[i]=x;//modifies the array dash\n\t\t\tmatchfound=true;\n\t\t}\n\t}\n\t//prints the updated array dash\n\tdocument.getElementById('word').innerHTML=dash.join(\" \");\n\n\t//checks if all letters done\t\n\tvar dashleft=false;\n\tfor(i=0;i<guessword.length;i++)\n\t{\n\t\tif(dash[i]=='_')\n\t\t{\n\t\t\tdashleft=true;\n\t\t}\n\t}\n\t\n\t//correct condition if dashleft remains false\n\tif(!dashleft)\n\t{\n\t\tpauseclockrotation();\n\t\tplaycorrect();//sound effect\n\t\talert('CORRECT\\n');\n\t\tupdatearray();\n\t\tdocument.getElementById(\"exactscore\").innerHTML=selword.length;\n\t\tif(selword.length==0)//win condition\n\t\t{\n\t\t\tplayyouwon();\n\t\t\talert(\"CONGRATULATIONS!\\n YOU WON\");\n\t\t\twindow.location.href=\"index.html\";\n\t\t}\n\t\treseteverything();//all the reset conditions\n\t}\n\t\n\t//changes the picture\t\n\tif(!matchfound)//executed only when no match of letter is found\n\t{\n\t\tpicsel++;\n\t\tdocument.getElementById(\"exactchance\").innerHTML=6-picsel;\n\t\t\n\t\tif((6-picsel)<2)//just for gramatical reasons\n\t\t\tdocument.getElementById(\"chance\").innerHTML=\"Chance left\";\n\n\t\tmaneffect(picsel);\n\t}\n} // end of main function", "title": "" }, { "docid": "c2b629bfc06faa574fdf34a194e05c6a", "score": "0.62487966", "text": "function run() {\n // This line of code gets a random word. The `word` variable will be a string.\n const word = getRandomWord();\n // declared variables\n // prints a number that states how many guesses you have left containing the length of the word plus 3 additional guesses\n let incorrectGuesses = word.length + 3\n let lettersGuessed = [\"None\"];\n let theBlanks = \"\";\n let winningMsg = \"Congrats! You Win!\";\n let losingMsg = \"Sorry, Game Over. :(\";\n // var `validEntry` with array of strings that displays the alphabet `a-z`\n let validEntry = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",];\n let invalidGuess = \"Invalid input. Please enter a lowercase letter.\";\n //reassigns underscores to the variable called `theBlanks`.\n for (let i = 0; i < word.length; i++){\n theBlanks += \"_ \"\n }\n // for i loop that logs start of game and continues to loop it through over again until conditions are met.\n for (let i = word.length - 1; i < word.length; i++){\n //'prints' concatenated strings into terminal that describes the state of the game\n console.log(\"Remaining Incorrect Guesses: \" + incorrectGuesses);\n console.log(\"Letters Guessed: \" + lettersGuessed);\n console.log(\"Word: \" + theBlanks);\n // variable that instructs user to choose a letter\n let userInput = readline.question(\"Pick a letter: \");\n //creates a line space after entering character and its result that has no charcters\n console.log(\"\\n\");\n // allows letter that user inputted to match with the variable `validEntry` and print in terminal else it will print `invalidGuess`. This makes sure only lowercase alphabet characters are able to be printed in the terminal.\n if (userInput) {\n if (validEntry.includes(userInput)) {\n // 'pushes' `userInput` selection into \"Letters Guessed\" line\n lettersGuessed.push(\" \" + userInput);\n } else {\n incorrectGuesses++;\n console.log(invalidGuess);\n }\n \n // nested `if` condition to remove 'None' string printed in games inception.\n if (lettersGuessed.includes(\"None\")){\n lettersGuessed.shift();\n }\n }\n //loop through `word.length` to check if `userInput` is correct or not and modifies `theBlanks` appropriately\n for (let i = 0; i < word.length; i++){\n //if `userInput` matches an element witihin `word.length`, replace `theBlanks` with `i`\n if(userInput === word[i]){\n //adds spaces in between characters\n theBlanks = theBlanks.split(\"\");\n //replaces every other element of string with userInput\n theBlanks.splice(i*2, 1, userInput);\n //returns concatenated string\n theBlanks = theBlanks.join('');\n }\n \n }\n // condition that states if `word.includes` isn't true, then the remaining correct guesses must decrement\n if (!word.includes(userInput)){ \n incorrectGuesses--;\n }\n // prints conditions if incorrectGuesses reaches '0'.\n if (incorrectGuesses === 0) {\n console.log(\"Remaining Incorrect Guesses: \" + incorrectGuesses);\n console.log(\"Letters Guessed: \" + lettersGuessed);\n console.log(\"Word: \" + theBlanks);\n return console.log(losingMsg + \" The correct word was: \" + word);\n }\n /*\n The line of code below stops the execution of your program to ask for input from the user. The user can enter whatever they want!\n \n The text that will show up to the user will be \"Guess a letter: \". Whatever value is entered will be assigned to the variable `userInput`.\n \n After a user hits the 'return' key, the rest of the code will run.\n */\n // This line of code will print out whatever is inputted in by the user.\n console.log(\"Letter guessed:\", userInput);\n // if theBlanks includes the string \"_ \"(underscore), `i` will decrement until user wins or loses game\n if (theBlanks.includes(\"_ \")){\n i--;\n } else {\n // prints congratulatory message if user meets conditions and wins the game\n return console.log(winningMsg);\n }\n }\n}", "title": "" }, { "docid": "e1c6d3b61cf13df72c692b91f8c380ec", "score": "0.62484", "text": "function filter(keyPress) {\n for (g = 0; g < incorrectGuess.length; g++) {\n if(correctWord.indexOf(incorrectGuess[g]) == -1 && lastArray.indexOf(incorrectGuess[g]) == -1) {\n lastArray.push(incorrectGuess[g]);\n lives --;\n livesLeft.innerHTML = lives;\n winsCounter.innerHTML = wins;\n }\n } \n}", "title": "" }, { "docid": "4f141f7b9668366dfb2c059fee4f402a", "score": "0.62461734", "text": "function check_word(word) {\n letter = get_current_letter(); // obtiene la letra actual\n letter_pos = word.search(letter); // busca la letra actual en la palabra clickeada\n if (game_mode == 0) { // modo por tiempo, devuelve el resultado de la funcion right_word o wrong_word segun corresponda\n if (letter_pos>-1) return right_word(); else return wrong_word();\n }\n if (game_mode == 1) { // modo por pountos\n var points_obtained = 10; // por default setea en 10 puntos\n if (letter_pos == 0) points_obtained = 20; // si empieza con la letra, 20 puntos\n if (letter == word.substring(word.length-1)) points_obtained = 35; // si termina con la letra, 35 puntos\n if (letter_pos == -1) points_obtained = -5; // si no esta la letra en la palabra, resta 5 puntos\n // muestra el mensaje de los puntos obtenidos\n show_popup((points_obtained>0?\"+\":\"\")+points_obtained+\" pts\", points_obtained>0?\"lightgreen\":\"pink\", false);\n points+=points_obtained; // acumula los puntos obtenidos\n letter_advance(); // avanza a la siguiente letra\n return letter_pos>-1; // devuelve true o false si la imagen era correcta o no\n }\n}", "title": "" }, { "docid": "84e27e265e2aa5b93141def1df11f9d0", "score": "0.62460834", "text": "function validateWord() {\n // console.log(\"Are we getting here?\");\n $(\"#word-form\").hide();\n if (document.myForm.userInput.value == currentWord) {\n const displayLevel = +currentLevel + +1;\n alert(\"Correct! You passed level: \" + displayLevel);\n currentLevel += 1;\n } else {\n alert(\"Incorrect! Try again\");\n wrongGuesses += 1;\n }\n checkState();\n return false;\n}", "title": "" }, { "docid": "2b6b1782b4be634efdb4e0e4f1cc78fb", "score": "0.62407506", "text": "function run() {\n //boolean that will keep the game running or not\n let continueGame = true;\n //keeps track of inputs and stores in an array\n let wrongGuess = [];\n //all valid inputs\n const alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];\n //number of tries\n let tries = 7;\n const word = getRandomWord();\n //to be filled with spaces equal to number of letters in word\n let placeholder = [];\n //every valid userInput the function will work with\n if(placeholder.length === 0){\n getUnderscores(word, placeholder);\n }\n \n /*\n The line of code below stops the execution of your program to ask for input from the user. The user can enter whatever they want!\n The text that will show up to the user will be \"Guess a letter: \". Whatever value is entered will be assigned to the variable `userInput`.\n After a user hits the 'return' key, the rest of the code will run.\n */\n\n \n while(continueGame){\n //show the player how many spaces are left\n console.log(`\\n${placeholder.join(' ')}`);\n const userInput = readline.question(`Remaining incorrect guesses: ${tries}\\nLetters guessed: ${wrongGuess}\\nGuess a lowercase letter: `);\n //if the input is valid, continue, also keeps track of wrong guesses in an array\n if(inputValidityCheck(userInput, alphabet)){\n let checkIfBoolean = replaceLetters(word, placeholder, userInput);\n //decrement remaining tries if valid letter is wrong\n if(!checkIfBoolean){\n if(!wrongGuess.includes(userInput)){\n wrongGuess.push(userInput);\n tries--;\n }\n }else{\n placeholder = checkIfBoolean;\n // console.log(placeholder.join(' '));\n }\n }else{\n console.log('Enter a valid lowercase letter.');\n continue;\n }\n if(confirmWinner(word, placeholder)){\n console.log(`The word was '${word}', you won with ${tries} guesses left!`);\n continueGame = false;\n }\n if(tries <= 0){\n console.log(`You ran out of guesses! The word was '${word}'. Try again next time.`);\n break;\n }\n }\n // This line of code will print out whatever is inputted in by the user.\n // console.log(\"THE USER INPUTTED:\", userInput);\n}", "title": "" }, { "docid": "3e0dca5c053b65466af9a26e4b3f58f8", "score": "0.62370306", "text": "checkForWin() {\n const phraseElements = document.querySelectorAll('#phrase ul li')\n let showCounter = 0; \n let spaceCounter = 0; \n let win = false; \n for (let i = 0; i < phraseElements.length; i++) {\n if (phraseElements[i].className.includes('show')) {\n showCounter += 1;\n } else if (phraseElements[i].className.includes('space')) {\n spaceCounter += 1;\n }\n }\n if (phraseElements.length - spaceCounter === showCounter) {\n win = true; \n }\n return win;\n }", "title": "" }, { "docid": "e84e6c1f87f0f617a9f0ba3f3e9bb4b9", "score": "0.6233176", "text": "function nextWord(){\n if (resume_or_play == 1){\n passOrCorrect = \"pass\"\n addWordToList(wordArrayList[randomNumber],\"black\"); // It marks the word in black.\n showWords();\n }\n}", "title": "" }, { "docid": "92c4f358be37d4dc4c9e3a1aff2aae5a", "score": "0.6233072", "text": "function matchWords() {\n if(word_input.value === current_word.innerHTML) {\n message_element.innerHTML = \"Correct!!!\";\n return true;\n } else {\n message_element.innerHTML = \"\";\n return false;\n }\n }", "title": "" }, { "docid": "1e37dc5b4b16aa652b7eec2152acd8d1", "score": "0.62324107", "text": "function checkInput() {\n if (!gameTimer) {\n gameTimer = setInterval(decrementTimer, 1000);\n }\n if (id(\"timer\").textContent !== \"0\") {\n let playerInput = id(\"game-input\").value;\n if (playerInput[playerInput.length - 1] === \" \") {\n id(\"game-input\").value = \"\";\n let gameWords = id(\"game-words\").textContent;\n let targetWord = gameWords.split(\" \")[0];\n id(\"game-words\").textContent = gameWords.substring(gameWords.indexOf(\" \") + 1);\n if (targetWord + \" \" === playerInput) {\n score += targetWord.length / AVG_WORD_LENGTH;\n }\n }\n }\n }", "title": "" }, { "docid": "806592b528c6f38399ce23ae09d7e534", "score": "0.6229613", "text": "function refill() {\n possibleWords = [\"ochre\", \"chartreuse\", \"cinereous\", \"vermillion\", \"alabaster\", \"cerulean\", \"ecru\", \"sepia\", \"azuline\", \"aubergine\", \"celadon\", \"smaragdine\"];\n}", "title": "" }, { "docid": "b3e2719509d0eb83b4f180488e17038e", "score": "0.6222982", "text": "checkForWin() {\r\n let num = 0\r\n const letter = this.activePhrase.phrase.split('')\r\n if ((document.querySelectorAll('.show').length + document.querySelectorAll('.space').length) == letter.length) {\r\n return true\r\n }\r\n return false\r\n }", "title": "" }, { "docid": "74eca7be1722251f0eea9a813452d086", "score": "0.62214535", "text": "handleInteraction(word) {\n const match = phrase.checkLetter(word);\n let key = \"\";\n if (!match) {\n if (event.type == \"keydown\") {\n key = document.querySelectorAll(`.key`);\n for (let i = 0; i < key.length; i++) {\n if (key[i].innerText === event.key && !key[i].disabled) {\n key = key[i];\n key.classList.add(\"wrong\");\n key.disabled = true;\n game.removeLife();\n game.updateResult = \"Sorry, try again next time!\";\n }\n }\n } else {\n key = event.target;\n key.classList.add(\"wrong\");\n key.disabled = true;\n game.removeLife();\n game.updateResult = \"Sorry, try again next time!\";\n }\n } else {\n let guessKey = document.querySelectorAll(\".key\");\n for (let k = 0; k < guessKey.length; k++) {\n //\n if (word === guessKey[k].innerText) {\n guessKey[k].classList.add(\"chosen\");\n }\n }\n phrase.showMatchedLetter(word);\n this.checkForWin();\n }\n }", "title": "" }, { "docid": "e4bb9405f2cc70ee875b4a0e67a28e74", "score": "0.6221277", "text": "function matchWords() {\n if (wordInput.value === currentWord.innerHTML) {\n message.innerHTML = 'Correct, keep going!';\n return true;\n } else {\n message.innerHTML = '';\n return false;\n }\n}", "title": "" }, { "docid": "6b80d09bb3ac8e74ba2ebd7840af92b7", "score": "0.6219044", "text": "function game() {\n var word = words[Math.floor(Math.random() * words.length)];\n var answerArray = [];\n //The below loop adds a \"_\" for however many letters the word has (i)\n for (var i = 0; i < word.length; i++) {\n answerArray[i] = \"_\";\n }\n \n\n\n { // When the player presses a key, it will run the following function\n document.onkeyup = function (event) {\n\n //If key that is pressed is between a and z, then assign that event key to the guess\n if ((event.key >= \"a\") && (event.key <= \"z\")) {\n var guess = event.key;\n }\n //if not, leave it blank.\n else { event.key = \"\" };\n\n\n //if statements for when the remaining letter is zero and the word is guessed, start a new game, add 1 to the score, etc. \n if ((remainingLetters === 0) && (word === nickelodeon)) {\n alert(\"Sweet, dude! You got it! It's Nickelodeon.\")\n game();\n wins++;\n lettersGuessed = [];\n lettersGuesed2 = [];\n guessesLeft = 6;\n\n }\n else if ((remainingLetters === 0) && (word === whatever)) {\n alert(\"Sweet, dude! You got it! It's 'whatever'.\");\n wins++;\n game();\n lettersGuessed = [];\n lettersGuessed2 = [];\n guessesLeft = 6;\n }\n\n else if ((remainingLetters === 0) && (word === gameboy)) {\n alert(\"Sweet, dude! You got it! It's gameboy.\");\n wins++;\n game();\n lettersGuessed = [];\n lettersGuessed2 = [];\n guessesLeft = 6;\n\n }\n else if ((remainingLetters === 0) && (word === screenname)) {\n alert(\"Sweet, dude! You got it! It's screenname.\");\n wins++;\n game();\n lettersGuessed = [];\n lettersGuessed2 = [];\n guessesLeft = 6;\n }\n\n else if ((remainingLetters === 0) && (word === friends)) {\n alert(\"Sweet, dude! You got it! It's friends.\");\n wins++;\n game();\n lettersGuessed = [];\n lettersGuessed2 = [];\n guessesLeft = 6;\n\n }\n else if ((remainingLetters ===0) && (word === blockbuster)) {\n alert(\"Sweet, dude! You got it! It's blockbuster.\");\n wins ++;\n game();\n lettersGuessed = [];\n lettersGuessed2 = [];\n guessesLeft = 6;\n }\n else if ((remainingLetters ===0) && (word === britney)) {\n alert(\"Sweet, dude! You got it! It's Britney, bitch!\");\n wins ++;\n game();\n lettersGuessed = [];\n lettersGuessed2 = [];\n guessesLeft = 6;\n } \n\n if (guessesLeft <= 0) {\n alert(\"As if! Try again, loser\");\n game();\n guessesLeft = 6;\n lettersGuessed = [];\n lettersGuessed2 = [];\n \n };\n \n\n\n//Return the first element that matches the respective ID\n document.querySelector(\"#wins\").innerHTML = wins;\n document.querySelector(\"#theWord\").innerHTML = answerArray;\n document.querySelector(\"#guesses\").innerHTML = guessesLeft\ndocument.querySelector(\"#lettersGuessed\").innerHTML = lettersGuessed\ndocument.querySelector(\"#lettersGuessed2\").innerHTML = lettersGuessed2\n }\n }\n}", "title": "" } ]
42d93bd5167297011c1cb623fa56cbf6
The function change works on the data that was not passed to it, i.e, an external dependency that makes it impure furthermore it also changes the contents of the array "a" for all of its further existence and hence mutating it. If a function takes another function as an input parameter that function becomes a higher order function and the function passed as a parameter is called a callback.
[ { "docid": "5ba507a30297f015c68972611e75f33e", "score": "0.0", "text": "function sub(x, y) {\n return x - y;\n}", "title": "" } ]
[ { "docid": "219e7abb739627c0ab4bc3df8ee168f6", "score": "0.6606142", "text": "function passArrayTest()\n{\n let array=[1,2,3];\n console.log(\"Before \"+ array);\n\n changeArray(array);\n console.log(\"after \"+ array);\n}", "title": "" }, { "docid": "a48ce139a98cb47bec07a2bb03c9dd0a", "score": "0.656334", "text": "function change1(a) {\n\ta = 1;\n}", "title": "" }, { "docid": "555547739621edaed6e9b5c5ba4a12b6", "score": "0.61686957", "text": "function change(b) {\n b = 2;\n}", "title": "" }, { "docid": "78fea18e02a7f9f03d02a9c065b9fa24", "score": "0.6049713", "text": "function modifyArray(arr, callback){\n arr.push(100);\n callback();\n}", "title": "" }, { "docid": "b93139ca35bc7ed499ea7d87caf5ed2e", "score": "0.5962466", "text": "function altered(a) {\n return 'bob'\n}", "title": "" }, { "docid": "8244d25f0543667038a41174e827ee32", "score": "0.59107155", "text": "function modify (data, callback) {\n var accumulator = []\n // for each item of our input array we will run the call back function\n // and asign the result to the accumulator\n data.forEach(function (item) {\n accumulator.push(callback(item))\n })\n\n return accumulator\n}", "title": "" }, { "docid": "7d05c877292aba25fea47f7066ac8f44", "score": "0.5761956", "text": "function changeArr(arr) {\n if (arr.length > 0) {\n arr[0] = 100\n }\n console.log({ arr })\n}", "title": "" }, { "docid": "e8d713ddc2dc4c6767c07bec8d06bdae", "score": "0.56461006", "text": "function myArreyFunction(arr){\r\nvar myItems = [...arr];\r\n//Only change code below this lin\r\nmyItems[2]=6;\r\n\r\nreturn myItems;\r\n \r\n//Only change code above this line \r\n\r\n}", "title": "" }, { "docid": "97bdb28bee565c5dd543be9ea7020651", "score": "0.5643779", "text": "function makeChanger(initialValue, callbackFunction) {\n\t\tvar lastValue = initialValue;\n\t\tfunction changer(newValue) {\n\t\t\tif (newValue != lastValue) {\n\t\t\t\tlastValue = newValue;\n\t\t\t\tcallbackFunction.apply (this, arguments);\n\t\t\t}\n\t\t}\n\t\tcallbackFunction (lastValue);\n\t\treturn changer;\n\t}", "title": "" }, { "docid": "41f45b77f7fb8790abc5fd83e44d34d0", "score": "0.555547", "text": "function alter(a,b,func) {\n var c = a * b\n var d = c + a\n\n return function(){\n var e = func(a,b);\n return c+d+e\n }\n}", "title": "" }, { "docid": "52d18b63219f64f7971ecd9871307a2f", "score": "0.55371696", "text": "attributeChangedCallback() {\n this.mutableData = true;\n }", "title": "" }, { "docid": "adf0ede6a05196f35d79280cd50fd6e2", "score": "0.5501498", "text": "addChangeListener(callback) {\r\n\t\t_emitter.on(CHANGE_EVENT, callback);\r\n\t\treturn () => _emitter.removeListener(CHANGE_EVENT, callback);\r\n\t}", "title": "" }, { "docid": "127dc06296c402e187fa4194a372eff9", "score": "0.5458986", "text": "function mutation(arr) {\n return arr;\n}", "title": "" }, { "docid": "8853530889976774f44ca9ab177bbe7a", "score": "0.54280174", "text": "function some(array, fn) {\n //your code here\n}", "title": "" }, { "docid": "fddc98779e66b77b879eca618ccd68f0", "score": "0.54210967", "text": "function myMap(array, callback) {\n let arrayCopy = [];\n array.forEach(element => {\n const newItem = callback(element);\n arrayCopy.push(newItem);\n });\n return arrayCopy;\n}", "title": "" }, { "docid": "41b35e042570c7ba934d538ef681afb0", "score": "0.5394547", "text": "function spolsky_map(fn, a)\n {\n for (i = 0; i < a.length; i++)\n {\n a[i] = fn(a[i]);\n }\n }", "title": "" }, { "docid": "8c6691ac225435ac8a0405e0ef980830", "score": "0.53938574", "text": "function rearranger(arr) {\n}", "title": "" }, { "docid": "70e10d41e328989c0455a77d397ca1b0", "score": "0.53865594", "text": "function fn (ary){\n ary[0] = ary[2];\n}", "title": "" }, { "docid": "cedfddfcbd28928b97cfbca932f2bec9", "score": "0.5379404", "text": "addChangeListener(callback) {\n // e.g. wrap EventEmitter's \"on\" method:\n this.on(CHANGE_EVENT, callback);\n }", "title": "" }, { "docid": "edf3f727c330e4bb8976a1b3d633198e", "score": "0.53690827", "text": "attributeChangedCallback(name, oldValue, newValue) {\n // do stuff\n }", "title": "" }, { "docid": "620e832a74ed3442b85acf5197712389", "score": "0.5346234", "text": "changed() {}", "title": "" }, { "docid": "386bad08f26c9a0caf3cc32b8f36efef", "score": "0.5338204", "text": "function MapThis(array, callback){\r\n /*Map function iterates on the array and invoke the given callback, captures the return value into new array.*/\r\n let t = array.map(function(x){\r\n return x * 3;\r\n })\r\n function callback(){\r\n return t; \r\n }\r\n /*Upon complete of input array iteration it should return the array that holds the result of applying callback function on every element*/\r\n return callback(); \r\n}", "title": "" }, { "docid": "2201b6da1d77b26defbebc0199978372", "score": "0.53352994", "text": "function onchange(callback){\n changeCallback = callback;\n return {onchange: onchange};\n }", "title": "" }, { "docid": "fc5e9e6130d1e1e6f926a04e81603db5", "score": "0.5335165", "text": "addChangeListener (callback) {\n this.on('change', callback)\n }", "title": "" }, { "docid": "3b28bde2e6553986aa6672c27d300a73", "score": "0.5325936", "text": "function onchange(callback){\n changeCallback = callback;\n return {onchange: onchange};\n }", "title": "" }, { "docid": "afc63ea028b3c7ea0dd46b1f32e3aadf", "score": "0.53231525", "text": "addChangeListener(callback) {\n this.on(CHANGE, callback);\n }", "title": "" }, { "docid": "48a833af196702c57e43261955080cec", "score": "0.5319137", "text": "function foo(a) {\n a = a;\n}", "title": "" }, { "docid": "811ae8209c3cd75f77b02fc447f2a5c6", "score": "0.53104264", "text": "function pipe(arrOfFuncs, value) {\n // // //////////solution 1\n // // declare variable and assign as value\n // let output = value\n // // iterate through arrOfFuncs w/ for..of loop\n // for(let callback of arrOfFuncs){\n // \t// update/reassign update w/current callback\n // output=callback(output)\n // }\n // // return output\n // return output\n \n \n // /////////////solution 2\n // return arrOfFuncs.reduce((acc,callback)=>callback(acc),value)\n \n /////////// solutinon 3\n // let output = value\n // arrOfFuncs.forEach(callback => {\n // output=callback(output)\n // })\n // return output\n \n }", "title": "" }, { "docid": "5b705fad996d2697f02d69456fc4ca12", "score": "0.5299928", "text": "function change(newData) {\n data = newData\n d3.transition().duration(1500).each(redraw);\n }", "title": "" }, { "docid": "0ae4f45293c7e35842ff3b5c7842be7d", "score": "0.52927285", "text": "function closureattempt(array) {\n array_to_be_passed = array\n }", "title": "" }, { "docid": "2fc09c6cfe1f3cade357e586937fda56", "score": "0.5291138", "text": "addChangeListener(callback) {\n this.on(CHANGE_EVENT, callback);\n }", "title": "" }, { "docid": "41020ad265d2ad7bd5cf09470afc1a6d", "score": "0.5284036", "text": "function f(a, x) {\n a.shift();\n a[0] = x;\n}", "title": "" }, { "docid": "3ab35e9813b8e14eb794e832907918eb", "score": "0.5283527", "text": "function watch_callback(newval, oldval) {\n if (newval !== oldval)\n rerender();\n }", "title": "" }, { "docid": "dd98198ce0e14066526f286052aac0db", "score": "0.5277113", "text": "attributeChangedCallback(name, oldValue, newValue) {\n \n }", "title": "" }, { "docid": "724cd642ed5a8641a4f4ca8041c86d3e", "score": "0.52741176", "text": "function mutate(fn, ...args) {\n\t\tlet key, r;\n\t\tif (typeof fn==='string') {\n\t\t\tkey = fn;\n\t\t\tfn = args.splice(0, 1)[0];\n\t\t}\n\t\tlet p = key ? data[key] : data;\n\t\tif (typeof fn!=='function') p = fn;\n\t\telse if ( (r=fn(p, ...args))!==undefined ) p = r;\n\t\tif (key) data[key] = p;\n\t\telse data = p;\n\t\tif (!debounce) debounce = setTimeout(render, 1);\n\t}", "title": "" }, { "docid": "ef2095b94522c92cf73cdb8404179606", "score": "0.5271778", "text": "function callBack(a){\n return a;\n}", "title": "" }, { "docid": "9a54bc431b8e0588aebc2d11747ecdfd", "score": "0.526092", "text": "addChangeListener(callback) {\n this.on('change', callback)\n }", "title": "" }, { "docid": "2330beb23f375df47992895913870321", "score": "0.5257198", "text": "function fx1(a, cb, c) {\n ok( (typeof cb === 'function'), 'Callback should be a function');\n cb(a, c);\n }", "title": "" }, { "docid": "8785b25dced8ebad671f4e8cec000e68", "score": "0.5242548", "text": "addChangeListener(cb){ // this is the method in the EventEmitter\n this.on(CHANGE_EVENT, cb); // subscribing to events\n }", "title": "" }, { "docid": "ff8f695cef367e4bc7deeea040caa403", "score": "0.5224202", "text": "map(_callbackfn, _thisArg) {\n throw new Error();\n }", "title": "" }, { "docid": "deac76bbfb4e160b9390546a2e8fa3df", "score": "0.5220335", "text": "addChangeListener(cb) {\n this.on(\"change\", cb);\n }", "title": "" }, { "docid": "4f9d67a577369d6b9e2583323ab5f67d", "score": "0.52191854", "text": "addChangeListener(callback) {\n this.on(CHANGE_EVENT, callback);\n }", "title": "" }, { "docid": "123539d0e03274464f51f5641ba95d24", "score": "0.521128", "text": "onChanges(cb) {\n this.changesCallbacks.push(cb);\n }", "title": "" }, { "docid": "b588af0cddbe0215a19de2669d7e9176", "score": "0.5210203", "text": "set val(newVal) {\n this.arr = this.withFilters(Monads_1.Maybe(this.arr, Toolbelt_1.keeper, newVal));\n }", "title": "" }, { "docid": "9417dbd75168df45c4ab4093e3809a13", "score": "0.5201938", "text": "updateFunc(tetresse) {}", "title": "" }, { "docid": "d4c4d23f50b0a5169da34d18a953bdb2", "score": "0.519328", "text": "addChangeListener(callback) {\n this.on(CHANGE, callback);\n }", "title": "" }, { "docid": "9ad4aa89414c49c84f9f4d5d05c48e53", "score": "0.51923597", "text": "onChanged(callback) { return _sub(grok_BitSet_OnChanged(this.d, callback)); }", "title": "" }, { "docid": "f6539fd6dada2444af7634fe3ea84a17", "score": "0.5187414", "text": "function callbackfn(prevVal, curVal, idx, obj) {\n arr[5] = 6;\n arr[2] = 3;\n return prevVal + curVal;\n}", "title": "" }, { "docid": "2cf5932ad924fbd73d647b5125b5cea8", "score": "0.51818424", "text": "function __f_2(b, value) {\n b[1] = value;\n}", "title": "" }, { "docid": "4539cf8e3adfb87cd5b7644895b810d9", "score": "0.51776785", "text": "static _valueHasChanged(value,old,hasChanged=notEqual){return hasChanged(value,old)}", "title": "" }, { "docid": "b768a3de960641b69a78f11c51d7e3d7", "score": "0.5166769", "text": "function jsfiddle_a(a) {\n let b = a.map(function (elem, i, array) {\n return elem * 10;\n });\n return b;\n}", "title": "" }, { "docid": "e59f09f305e2e90d36b55aba3b5d4adb", "score": "0.5163077", "text": "attributeChangedCallback(name, newVal) {\n\t\tif (this[name] !== newVal) {\n\t\t\tthis[name] = newVal;\n\t\t}\n\t}", "title": "" }, { "docid": "b9b9572969a918559cff9b40380b9406", "score": "0.51621544", "text": "updateBoardListeners(callback) {\r\n if (callback) callback(this.board);\r\n else this.onBoardChanged.forEach(fn => fn(this.board));\r\n }", "title": "" }, { "docid": "c82f706caa87a575739017ed6f1aac3f", "score": "0.5161541", "text": "set Callback(value) {}", "title": "" }, { "docid": "a4cc8d95de7010b812a2b7a47ddfeb80", "score": "0.5158463", "text": "function eventOnChange(element, value){\n element.val(value);\n curVal = value;\n // if a callback function changeCallback is defined, the execute it with one argument\n if (({}).toString.call(changeCallback).match(/function/i)){\n changeCallback(curVal);\n }\n }", "title": "" }, { "docid": "54ce77e86cb8eaabd8f6b29fda13a90b", "score": "0.5158063", "text": "function map(array, callback) {\n var arrayCopy = [];\n for (var i = 0; i < array.length; i++) {\n arrayCopy[i] = callback(array[i]); //arrayCopy invoke callback\n }\n return arrayCopy;\n //return => [2,3]\n}", "title": "" }, { "docid": "8b92c9393005abc040588512ce6fefd5", "score": "0.51510394", "text": "function f(a,b){this.fun=a,this.array=b}", "title": "" }, { "docid": "24067a6c337052d953d5298b8dab995d", "score": "0.5148205", "text": "function onEvery(arr, func){\n for (let i = 0; i < arr.length; i++) {\n arr[i] = func(arr[i])\n }\n return arr\n}", "title": "" }, { "docid": "38412faa9fb0f34a21fc2a5511e711c1", "score": "0.51400566", "text": "function map(array, fn) {\n //your code here\n}", "title": "" }, { "docid": "634aea04e4f59fb8dc7e76964f7c11fd", "score": "0.51398784", "text": "iterChanges(f, individual = false) {\n iterChanges(this, f, individual);\n }", "title": "" }, { "docid": "83ffcf2924a17a1dd32f8344fe6a068c", "score": "0.51377475", "text": "map(fn) {\n let index = 0;\n let current = this.head;\n while (current !== null) {\n if (fn(current.data, index)) {\n current.data = fn(current.data, index);\n }\n // console.log(current.data);\n current = current.next;\n index++;\n }\n }", "title": "" }, { "docid": "441c4d3d695a13fd70be5f1b8c41dfff", "score": "0.51358455", "text": "function change(newNum)\n{\n console.log(num);\n num = newNum;\n return num\n}", "title": "" }, { "docid": "01f7753c407260c2bc2fc9196636cb57", "score": "0.5129381", "text": "function changingData (changingVariables){\n \n }", "title": "" }, { "docid": "85d4e4184329258a7733f111ee50e71b", "score": "0.51284105", "text": "function batchedUpdates(fn, a) {\n return fn(a);\n}", "title": "" }, { "docid": "5977b84f397d099a159b6ce7c6f0cc0f", "score": "0.5111796", "text": "attributeChangedCallback(attr, oldVal, newVal) {\n \n }", "title": "" }, { "docid": "009698f407f94750aca07cf89c643d5d", "score": "0.510535", "text": "addChangeListener(callback) {\n this.on(CHANGE_EVENT, callback);\n }", "title": "" }, { "docid": "7afd3ab82bcfc71deef0c8c69d2aecfa", "score": "0.5102812", "text": "function f1(a) {\n a = 1;\n // ...\n}", "title": "" }, { "docid": "90f5d49b450b3c0f534ed2140850521c", "score": "0.5101795", "text": "function handleDataChangeImpl(dependencyArray, collectionModelChanges)\n {\n var perfOp = adf.mf.internal.perf.startMonitorOperation(\"Process data change event\", adf.mf.log.level.FINE,\n \"adf.mf.internal.amx._handleBatchDataChangeListener\");\n\n var affectedNodeCount = 0;\n try\n {\n var isFinestLoggingEnabled = adf.mf.log.AMX.isLoggable(adf.mf.log.level.FINEST);\n\n if (isFinestLoggingEnabled)\n {\n adf.mf.log.AMX.logp(adf.mf.log.level.FINEST,\n \"adf.mf.internal.amx\", \"_handleBatchDataChangeListener\",\n adf.mf.util.stringify(dependencyArray));\n }\n\n var markNodeForUpdateArgs = new adf.mf.internal.amx.AmxNodeUpdateArguments();\n var hasCollectionModelChanges = collectionModelChanges != null;\n var collectionChangesElMap = null;\n\n if (hasCollectionModelChanges)\n {\n collectionChangesElMap = {};\n for (var el in collectionModelChanges)\n {\n var data = collectionModelChanges[el];\n collectionChangesElMap[el] = new adf.mf.api.amx.AmxCollectionChange(data);\n }\n }\n\n for (var i = 0, size = dependencyArray.length; i < size; ++i)\n {\n var el = dependencyArray[i];\n var valueExpr = adf.mf.internal.el.parser.parse(\"#{\" + el + \"}\");\n var nodes = adf.mf.api.amx.AmxNode.__getNodesDependentOnElToken(valueExpr);\n\n for (var n = 0, nodeSize = nodes.length; n < nodeSize; ++n)\n {\n var node = nodes[n];\n var nodeId = node.getId();\n\n if (isFinestLoggingEnabled)\n {\n adf.mf.log.AMX.logp(adf.mf.log.level.FINEST,\n \"adf.mf.internal.amx\", \"_handleBatchDataChangeListener\",\n \"Node affected by change to EL #{\" + el + \"}: \"+ nodeId);\n }\n\n var attrNames = node.__getAttributesForElDependency(valueExpr);\n\n for (var a = 0, asize = attrNames.length; a < asize; ++a)\n {\n var attrName = attrNames[a];\n\n if (isFinestLoggingEnabled)\n {\n adf.mf.log.AMX.logp(adf.mf.log.level.FINEST,\n \"adf.mf.internal.amx\", \"_handleBatchDataChangeListener\",\n \"Affected attribute: \" + attrName);\n }\n\n markNodeForUpdateArgs.setAffectedAttribute(node, attrName);\n\n if (hasCollectionModelChanges)\n {\n var collectionChange = collectionChangesElMap[el];\n\n if (collectionChange != null)\n {\n markNodeForUpdateArgs.setCollectionChanges(nodeId, attrName, collectionChange);\n }\n }\n }\n\n node.__processTagInstancesForElDependency(markNodeForUpdateArgs, valueExpr);\n }\n }\n\n affectedNodeCount = markNodeForUpdateArgs.getAffectedNodes().length;\n if (affectedNodeCount > 0)\n {\n if (isFinestLoggingEnabled)\n {\n adf.mf.log.AMX.logp(adf.mf.log.level.FINEST,\n \"adf.mf.internal.amx\", \"_handleBatchDataChangeListener\",\n affectedNodeCount + \" nodes have been affected by the data changes\");\n }\n\n // Call the internal mark node for update function which does not check for being in\n // the critical section since we are already in the critical section\n adf.mf.internal.amx._markNodeForUpdateImpl(markNodeForUpdateArgs);\n\n // On Android, there is a bug in the web view that changes from the data change events may\n // not be redrawn. So, invoke a callback to invalidate the WebView, forcing the repainting of\n // the WebView. Bug seen in at least the 4.0.3 Android version of the WebView\n if (requiresUiInValidation && window[\"AdfmfCallback\"] != null)\n {\n window.AdfmfCallback.invalidateUi();\n }\n }\n }\n catch (ex)\n {\n adf.mf.log.logInfoResource(\"AMXInfoBundle\", adf.mf.log.level.SEVERE,\n \"handleDataChangeImpl\", \"MSG_BATCH_DATA_CHANGE_FAILED\");\n\n // Only log the exception at a fine level for security reasons\n adf.mf.log.Framework.logp(adf.mf.log.level.FINE,\n \"AMX\", \"handleDataChangeImpl\", ex);\n }\n finally\n {\n perfOp.stop();\n }\n }", "title": "" }, { "docid": "7a4abd301ab0932dbf86a6bbb174c340", "score": "0.5100524", "text": "function changeValue(age, name) {\n age = 21;\n name = \"Dat\"\n}", "title": "" }, { "docid": "ce0a22ef04cc15225e394d9f68219de0", "score": "0.5100308", "text": "function looper(arr) {\n var newArr = [];\n for (var i = 0; i < arr.length; i++) {\n newArr.push(arr[i] += 5);\n }\n return newArr;\n}", "title": "" }, { "docid": "c5c61584e1e7ca74874f9111b18f6831", "score": "0.509601", "text": "subscribeCallback(func){\n const currentCallback = this.updateCallback;\n this.updateCallback = () =>{\n currentCallback();\n func();\n }\n }", "title": "" }, { "docid": "b8830af9799d833c1f5b2499f85665d5", "score": "0.50818753", "text": "attributeChangedCallback(attribute, prev, value)\n {\n for(let key of Object.keys(properties))\n {\n updatePropertyOnAttributeChanged.call(this, key, properties[key], attribute, prev, value);\n }\n }", "title": "" }, { "docid": "0be37ae36e263c97a571058ea8c74823", "score": "0.50783944", "text": "attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue !== newValue) {\n this[name] = newValue;\n }\n }", "title": "" }, { "docid": "fef2008d545cf78c68d40c25759dfa79", "score": "0.5075842", "text": "iterChanges(f, individual = false) {\n iterChanges(this, f, individual);\n }", "title": "" }, { "docid": "ade15a9e774faad5546c7a55c16c6e84", "score": "0.50700486", "text": "function forEach(array, func) {\n\n}", "title": "" }, { "docid": "8da56ae543b1f5275c2b94976eb22893", "score": "0.5061691", "text": "function editInPlace() { // function created to edit array\n 'use strict';\n // Only change code below this line\n\n s[0] = 2; // changes the value of the first value in the array with the variable of 's' to 2. the array in 's' is now [2, 7, 2];\n s[1] = 5; // changes the value of the second value in the array with the variable of 's' to 5. the array in 's' is now [2, 5, 2];\n s[2] = 7; // changes the value of the third value in the array with the variable of 's' to 7. the array in 's' is now [2, 5, 7];\n\n // Using s = [2, 5, 7] would be invalid\n\n // Only change code above this line\n}", "title": "" }, { "docid": "0160dc6787ad0ce9a78be75d572e8eb5", "score": "0.5061571", "text": "function changeState(event) {\n // states lists could be:\n // 1. Array\n // 2. An object with keys & null values\n // 3. A Set()\n var fromStates = Array.isArray(events[event].from) ? events[event].from : Array.of(events[event].from);\n var toState = events[event].to;\n\n // return *() => ...\n return function () {\n // Firing the current state, effective noop\n if (currentState === toState) return;\n //\n // Some jsperfs have noted that the indexOf is now\n // a bit faster than Object.in with keys & null values.\n //\n // The array.includes() is forward looking.\n // \n //if (fromStates.indexOf(currentState) !== -1) {\n if (fromStates.includes(currentState)) {\n var cbs = executeCallbacks(event);\n // how do this moar smart?\n cbs.next(); // before\n cbs.next(); // on\n cbs.next(); // after\n currentState = toState;\n }\n };\n }", "title": "" }, { "docid": "c7c0d14c1682078225de7a4297fce4dc", "score": "0.5055505", "text": "function myForEach(array, callback) {\n \n }", "title": "" }, { "docid": "247a5819aa8da857d4f0958a04facd65", "score": "0.5054903", "text": "function modify(key, f) {\n return map => modify_(map, key, f);\n}", "title": "" }, { "docid": "7a2ade8b74f106ed6c380376ce21f518", "score": "0.5053238", "text": "map(callBack) {\n if (!callBack) return\n let index = 0\n let curr = this.head\n while (curr) {\n curr.val = callBack(curr.val, index)\n curr = curr.next\n index++\n }\n return this\n }", "title": "" }, { "docid": "b0919dba4bfcbc3be9cc6e18baae36c6", "score": "0.50418895", "text": "attributeChangedCallback(...args) {\n if (Super(this).attributeChangedCallback) Super(this).attributeChangedCallback(...args)\n Private(this).initialAttributeChange = true\n }", "title": "" }, { "docid": "b73148529f2286a1bb330e6e760635cf", "score": "0.5022228", "text": "function changeAge(age1){\n return age1;\n}", "title": "" }, { "docid": "3b67ca6d388bca98e2f08f95ee3fffb0", "score": "0.50119776", "text": "addChangeListener (callback) {\n this.on(this._CHANGE_EVENT, callback);\n }", "title": "" }, { "docid": "6c75a0f0adecb00af33dc8bd0be80e34", "score": "0.5010612", "text": "attributeChangedCallback(attrName, oldValue, newValue) {\n if (newValue !== oldValue) {\n this[attrName] = newValue;\n }\n }", "title": "" }, { "docid": "c574d5a06341e8a49cc0ceb300d5c7b4", "score": "0.5010494", "text": "\n (\n callback_f\n )\n {\n this.link_a.forEach( at_n => callback_f( at_n ) )\n }", "title": "" }, { "docid": "9870cd987467943af4129c9c0a966ab0", "score": "0.5004653", "text": "attributeChangedCallback(name, oldValue, newValue) {\n // Update the attribute internally\n this[name] = newValue;\n // Update the component\n this.updateComponent(name, newValue);\n }", "title": "" }, { "docid": "3831742d3da61dc138d51ce4eeba88f3", "score": "0.5002196", "text": "attributeChangedCallback(attrName, oldVal, newVal) {\n\n }", "title": "" }, { "docid": "b8238c86e67eb5b05dd399a348602f82", "score": "0.4998806", "text": "previousChanged() { }", "title": "" }, { "docid": "1d42054f06f141845a203a2e53ffb385", "score": "0.49935502", "text": "function looper (array) {\n for(var i = 0; i < array.length; i++) {\n array[i] += 5\n }\n return array;\n }", "title": "" }, { "docid": "38396eafe7e3f2b937a64977e16cc7d0", "score": "0.49934268", "text": "function map(array, callback) {\n\n}", "title": "" }, { "docid": "7d0092b96e4c24cf24d7aa312b0318d9", "score": "0.49882802", "text": "function applyFuncToEachElement(array, func) {\n array.forEach(func);\n}", "title": "" }, { "docid": "6a5b3bb50ae2a0881988b2e1cdeab071", "score": "0.49855885", "text": "function callbackfn(val, idx, obj)\n{\n return val + 10;\n}", "title": "" }, { "docid": "360260ca1d4163fab1eeffaf0c36b450", "score": "0.49847886", "text": "function funcCaller(a) {\n console.log(a(3, 6));\n}", "title": "" }, { "docid": "49cf7a27c1a2b36376ae772996c38586", "score": "0.49831674", "text": "attributeChangedCallback(attr, oldVal, newVal){\n\n }", "title": "" }, { "docid": "6162b1763ce56d31356725acdcc4b3d5", "score": "0.49823573", "text": "attributeChangedCallback(attr, oldVal, newVal) {}", "title": "" }, { "docid": "6162b1763ce56d31356725acdcc4b3d5", "score": "0.49823573", "text": "attributeChangedCallback(attr, oldVal, newVal) {}", "title": "" }, { "docid": "2582bec9f5c070f4b700af6a73ad05b8", "score": "0.49757388", "text": "function mutate(callback, isArrayMode = false) {\n return {\n set: (target, key, value) => {\n /* prevent redundant state updates */\n if (key == \"prototype\" || target[key] == value) return true;\n\n /* if the property exists, it should be updated */\n if (target[key] != undefined) {\n callback(key, target[key] = value);\n }\n\n /* if the property does not exist, and the value is an array, make it reactive */\n if (Array.isArray(value)) {\n target[key] = createReactiveArray(value, callback);\n return true;\n }\n\n /* if the property does not exist, and the value is an object, make it reactive */\n if (typeof value == \"object\") {\n target[key] = createReactiveObject(value, callback);\n return true;\n }\n\n /* the property does not exist, so we create it */\n target[key] = value;\n\n /* if the value is an array, we should still run the callback */\n if (isArrayMode) callback(key, value);\n return true;\n }\n };\n}", "title": "" }, { "docid": "87cdfc100cf81a06d1d44160d79e9f90", "score": "0.4970134", "text": "attributeChangedCallback(name, oldValue, newValue) {\n // implement by subclass\n }", "title": "" }, { "docid": "101a4646cfb05f020eb7dee530cb8c99", "score": "0.49659142", "text": "storeChanged() {}", "title": "" }, { "docid": "2ea4ebe242f3ab34028a90d0588e1d5f", "score": "0.49642012", "text": "emitChange() {\n this.changeEmitters.forEach(func => func.call(null));\n }", "title": "" }, { "docid": "5127b4d362546c6e426e41157d5d86b0", "score": "0.49565828", "text": "attributeChangedCallback(name, old, value) {\n if (old !== value) {\n this._attributeToProperty(name, value);\n }\n }", "title": "" } ]
737b20e8daefb7d3a1baf592221f9547
Gets accumulated orbit velocity
[ { "docid": "fb28bef3f4e16049d9363a71809ca8b2", "score": "0.634963", "text": "function orbitVelocity(id, omass, radius, time, offset)\n{\n\tif(id == 0)\n\t{\n\t\tif(radius == 0.0)\n\t\t{\n\n\t\t\treturn {x: 0.0, y: 0.0};\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn orbitVelocityLow(0, 0, planets[0].mass, omass, radius, time + offset);\n\t\t}\n\t}\n\telse\n\t{\n\t\tvar planet = planets[id];\n\t\tvar cx = planets[planet.center].x;\n\t\tvar cy = planets[planet.center].y;\n\t\tvar cmass = planets[planet.center].mass;\n\n\t\tvar ourVel = orbitVelocityLow(cx, cy, cmass, planet.mass, planet.orbitRadius, time + planet.orbitOffset);\n\t\tvar childVel = orbitVelocity(planet.center, omass, 0.0, time, offset);\n\n\t\tvar sum0 = {x: ourVel.x + childVel.x, y: ourVel.y + childVel.y};\n\n\n\t\tif(radius == 0.0)\n\t\t{\n\t\t\treturn sum0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar topVel = orbitVelocityLow(planet.x, planet.y, planet.mass, omass, radius, time + offset);\n\t\t\tvar sum1 = {x: sum0.x + topVel.x, y: sum0.y + topVel.y}\n\t\t\treturn sum1;\n\t\t}\n\t}\n}", "title": "" } ]
[ { "docid": "cfb1257a74e73bece3dab9379b69bd40", "score": "0.6911218", "text": "velocitySum(){\r\n let vSum = 0\r\n this.caps.forEach(caps => {\r\n vSum += caps.vel.mag()\r\n })\r\n return vSum\r\n }", "title": "" }, { "docid": "19784238112a04595f91faec1354fcb9", "score": "0.6768873", "text": "get xVelocity() {\n if(typeof this._lastX === \"undefined\") {\n return undefined;\n }\n\n this._lastXVelocity = this._xVelocity;\n this._xVelocity = this._x - this._lastX;\n return this._xVelocity;\n }", "title": "" }, { "docid": "562ae56f0bed0f1d1a386e28041ff386", "score": "0.667521", "text": "updateVelocity(){\n // note all Pendulums have a mass of 1 so Force = Acceleration\n this.horizontalVelocity += this.horizontalForce*timeInterval;\n this.verticalVelocity += this.verticalForce*timeInterval;\n }", "title": "" }, { "docid": "30975daca9eea3326ad3ac452abf26e1", "score": "0.6578515", "text": "function get_velocity(delta,gamma){ return (gamma - delta) / (gamma + delta); }", "title": "" }, { "docid": "f07ec4e56acfdb6c5b19a39dc8059f04", "score": "0.65003914", "text": "function getVelocity(object){\n\t\t\tvar velocity = Math.sqrt(\n\t\t\t\tMath.pow(object.velX, 2)+\n\t\t\t\tMath.pow(object.velY, 2)\n\t\t\t);\n\n\t\t\treturn velocity;\n\t\t}", "title": "" }, { "docid": "f07ec4e56acfdb6c5b19a39dc8059f04", "score": "0.65003914", "text": "function getVelocity(object){\n\t\t\tvar velocity = Math.sqrt(\n\t\t\t\tMath.pow(object.velX, 2)+\n\t\t\t\tMath.pow(object.velY, 2)\n\t\t\t);\n\n\t\t\treturn velocity;\n\t\t}", "title": "" }, { "docid": "9f7e01e16e946563e8810de8731833fc", "score": "0.6474478", "text": "get vel() {\n return this.body.vel;\n }", "title": "" }, { "docid": "313e42c1006d34381facb07e99de4cb0", "score": "0.64608246", "text": "function getVelocity(object){\n\t\tvar velocity = Math.sqrt(Math.pow(object.velX, 2)+Math.pow(object.velY, 2));\n\n\t\treturn velocity;\n\t}", "title": "" }, { "docid": "8b8a63f627906c0755312b520bb60ce0", "score": "0.64470327", "text": "applyVelocity() {\n this.pos['x'] += this.vel['x'];\n this.pos['y'] += this.vel['y'];\n this.pos['z'] += this.vel['z'];\n }", "title": "" }, { "docid": "464b8f8336c129de4d327d1e6b7c3c5a", "score": "0.6355304", "text": "calculateExplosionVelocity(){\n let vx = this.getStartVelocity()[0];\n let vy = 0;\n \n return vec2(vx,vy);\n }", "title": "" }, { "docid": "f2954285cbcb8d61887e7826119939e6", "score": "0.6315114", "text": "function getPlayerVelocity() {\n const v = player.getLinearVelocity();\n return [v.x, v.y];\n }", "title": "" }, { "docid": "05e6161d9d8153cccd6344d66b6a1ca5", "score": "0.6305435", "text": "mag() { return this.pos_.mag(this.orbiting_.pos()); }", "title": "" }, { "docid": "b634ea2e6c5d1bb15bce13f8f9828d4e", "score": "0.62837815", "text": "updateVelocity() {\r\n const at = vec3.create();\r\n vec3.scale(at, this.accel, timeout);\r\n vec3.scale(this.velocity, this.velocity, Math.pow(d, timeout));\r\n vec3.add(this.velocity, this.velocity, at);\r\n }", "title": "" }, { "docid": "ad3b4dcc36aa2996402d8573eb95b105", "score": "0.6277041", "text": "updateVelocity() {\n glMatrix.vec3.scale(this.velocity, this.velocity, Math.pow((drag), tStep));\n var change = glMatrix.vec3.create();\n glMatrix.vec3.scale(change, this.accel, tStep);\n glMatrix.vec3.add(this.velocity, this.velocity, change);\n }", "title": "" }, { "docid": "fc0d276b66aae4a7fb80a4693c270dde", "score": "0.6216044", "text": "get getVelY(){return this.velocityY;}", "title": "" }, { "docid": "6236ac057247417b01f832c1727b1e16", "score": "0.6156406", "text": "get oldVel() {\n return this.body.oldVel;\n }", "title": "" }, { "docid": "086b8bce4b5467d0831df27459f0b645", "score": "0.6130328", "text": "applyVelocityCorrection() {\r\n this.currentVelocity = 0.99 * this.currentVelocity;\r\n this.lifeTime += projectile_velocity;\r\n projectile_velocity = 2;\r\n }", "title": "" }, { "docid": "94df0a3801ae3567f892bedaa014b996", "score": "0.61241555", "text": "update() {\n this.vel.add(this.acc);\n this.pos.add(this.vel);\n // Multiplying by 0 sets the all the components to 0\n this.acc.mult(0);\n \n this.osc.update(this.vel.mag()/10);\n }", "title": "" }, { "docid": "84873967f88f20a05e0b1a756a2b42d9", "score": "0.612207", "text": "getHighresVelocity() {\n return this.data[this.elevation][this.scan].record.velocity\n }", "title": "" }, { "docid": "670b12e4b5185fd7035ed2414fc66011", "score": "0.6090313", "text": "calculateValues(){\n this.updateVelocity();\n this.updatePosition();\n\n // correct small inacurracies by keeping the pendulum's length constant\n this.updateAngle();\n this.headXPos = this.length*Math.sin(this.angle) + this.centerXPos;\n this.headYPos = this.length*Math.cos(this.angle) + this.centerYPos;\n }", "title": "" }, { "docid": "c4c9e9ebac46340a113289ab2225c3ac", "score": "0.60181683", "text": "calc_rot(){\n\t\tvar camera = this.data.utils.camera_world(),\n\t\t\ttarget = this.aim_point;\n\t\t\n\t\t// add velocity * scale / 10\n\t\t// target.add(this.velocity);\n\t\t\n\t\tvar x_dire = this.data.utils.getXDire(camera.x, camera.y, camera.z, target.x, target.y\n\t\t\t- this.data.player.jump_bob_y\n\t\t\t, target.z),\n\t\t\ty_dire = this.data.utils.getDir(camera.z, camera.x, target.z, target.x);\n\t\t\n\t\treturn {\n\t\t\tx: x_dire || 0,\n\t\t\ty: y_dire || 0,\n\t\t};\n\t}", "title": "" }, { "docid": "8ad287e85f1256e5cdbe8404a805af6c", "score": "0.60024613", "text": "[calc_pos_vel_fn](t) {\n add_position_velocity(this, t);\n }", "title": "" }, { "docid": "37d701e0dd1fcd08cb01433e3bda6f3f", "score": "0.59539133", "text": "function getVelocity$1(visualElement) {\n var velocity = {};\n visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); });\n return velocity;\n}", "title": "" }, { "docid": "3a7912b9875bcb753c59a6ab7b7d44ad", "score": "0.5945612", "text": "function getVelocity(visualElement) {\n var velocity = {};\n visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); });\n return velocity;\n}", "title": "" }, { "docid": "3a7912b9875bcb753c59a6ab7b7d44ad", "score": "0.5945612", "text": "function getVelocity(visualElement) {\n var velocity = {};\n visualElement.forEachValue(function (value, key) { return (velocity[key] = value.getVelocity()); });\n return velocity;\n}", "title": "" }, { "docid": "37d9e918b22026acfb6651c35de3cc24", "score": "0.5868565", "text": "getVelocity (dt) {\n if (typeof this.velocity === 'undefined') {this.velocity = {x: 0, y: 0};}\n\n let speed = util.vector.mag(this.velocity);\n\n if (this.forces.length === 0) {this.forces.push({x: 0, y: 0})}\n let result = this.forces[0];\n\n for (let i = 1; i < this.forces.length; i++) {\n result = util.vector.add(result, this.forces[i]); //Not imported\n }\n\n //Drag limits speed to max speed\n let max = this.maxSpeed !== 0 ? this.maxSpeed : 1\n let drag = util.vector.multiply(-1 * (speed/max), result);\n result = util.vector.add(result, drag);\n\n //Friction to gently decrease speed\n let direction = util.vector.dir(this.velocity);\n let friction = util.vector.multiply(this.mass * 10 * this.u, direction);\n result = speed > 0.4 ? util.vector.add(result, friction) : result;\n\n //Stop velocity entirely if low enough\n if (result.x === 0 && result.y === 0 && speed < 0.6) {\n this.velocity = {x: 0, y: 0};\n return this.velocity;\n }\n\n //for a; things with mass 0 shouldn't be able to move but eh whatever\n if (this.mass !== 0) { //for acceleration\n result = util.vector.multiply(1/this.mass, result);\n }\n\n //velocity\n result = util.vector.multiply(dt, result); //delta velocity\n let vel = util.vector.add(result, this.velocity);\n\n this.velocity = vel;\n return this.velocity;\n }", "title": "" }, { "docid": "acb9927c58e8a2557e735c3aa9768945", "score": "0.5840149", "text": "update() {\n this.velocity.add(this.acceleration);\n this.position.add(this.velocity);\n this.acceleration.mult(0);\n }", "title": "" }, { "docid": "792dce617c496121e209ce91c81a1a25", "score": "0.5796593", "text": "get velocityY() {\n if (this.sprite.body.velocity.y > 0 && this.sprite.body.blocked.down) {\n return 0;\n }\n if (this.sprite.body.velocity.y < 0 && this.sprite.body.blocked.up) {\n return 0;\n }\n return this.sprite.body.velocity.y;\n }", "title": "" }, { "docid": "cc374f0d73dadf46778c78436e9c36f7", "score": "0.5788616", "text": "simulateVelocity() {\n this.x.pos += this.x.vel\n this.y.pos += this.y.vel\n this.z.pos += this.z.vel\n }", "title": "" }, { "docid": "2248bbaa35709b70811e230dc3cc0399", "score": "0.5759295", "text": "update() {\n this.velocity.add(this.acceleration);\n this.position.add(this.velocity);\n this.lifespan -= 1;\n }", "title": "" }, { "docid": "4ab3e12c38a2ab13903cf5c3ecd80e15", "score": "0.5751569", "text": "get triggerVelocity() {\n return this.args.triggerVelocity ?? 0.3;\n }", "title": "" }, { "docid": "0ed0e7bf4331cef4c26f712c5bc503b6", "score": "0.57475215", "text": "getAmountToRotate() {\n var time = Date.now() - this.last_rotation;\n return this.getAngularAcceleration() / 10 * time;\n }", "title": "" }, { "docid": "894e075f5433e0a1635e2267845c781d", "score": "0.5745688", "text": "update() {\n this.velocity.add(this.acceleration);\n this.position.add(this.velocity);\n this.acceleration.mult(0);\n this.lifespan -= 2;\n }", "title": "" }, { "docid": "6c0d74e32818161e2d0e3f83933a7f88", "score": "0.57305926", "text": "update() {\n\t\tthis.velocity.add(this.acceleration);\n\t\tthis.location.add(this.velocity);\n\t\tthis.acceleration.mult(0);\n\t}", "title": "" }, { "docid": "8f3748b60f7b240ad3ce3f320323f132", "score": "0.57270044", "text": "function calculateFinalVelocity(i, d, t, a) {\n\t\tif (i == null) {\n\t\t\treturn (d + (0.5 * a * Math.pow(t, 2))) / t;\n\t\t} else if (d == null) {\n\t\t\treturn i + (a * t);\n\t\t} else if (t == null) {\n\t\t\treturn Math.sqrt(Math.pow(i, 2) + (2 * a * d));\n\t\t} else if (a == null) {\n\t\t\treturn ((d / t) * 2) - i;\n\t\t} else {\n\t\t\treturn i + (a * t);\n\t\t}\n\t}", "title": "" }, { "docid": "68fddbc34f77eba03661778f2a584e4d", "score": "0.5710095", "text": "update() {\n this.velocity.add(this.acceleration)\n this.position.add(this.velocity)\n this.lifespan -= 2\n }", "title": "" }, { "docid": "04509277fd6f31c25d84d87ca27bcdf1", "score": "0.5695023", "text": "function velocity(flowRate, diameter, material) {\n var flowRate = flowRate;\n var pipeAux = new Pipe(diameter, material);\n var velocity = (flowRate / 1000) / ((Math.PI * Math.pow(pipeAux.diameter / 1000, 2)) / 4);\n return parseFloat(velocity.toFixed(5));\n}", "title": "" }, { "docid": "c3db05c49f251a6c477b0c12a70cd375", "score": "0.56922555", "text": "fract() {\n return new Vector2(this.x - Math.floor(this.x), this.y - Math.floor(this.y));\n }", "title": "" }, { "docid": "c3db05c49f251a6c477b0c12a70cd375", "score": "0.56922555", "text": "fract() {\n return new Vector2(this.x - Math.floor(this.x), this.y - Math.floor(this.y));\n }", "title": "" }, { "docid": "dacdcba52e71b91b78580c72a88d92d4", "score": "0.56918794", "text": "static get acceleration() {}", "title": "" }, { "docid": "b0652a567a8a1a9cdc6123e7c8bb20a6", "score": "0.56750315", "text": "get circumference() {\n return Math.PI * (this.radius * 2)\n }", "title": "" }, { "docid": "f1be06f254e86c323be87847fb666e97", "score": "0.56737304", "text": "calculate_velocity() {\n // Calculate a random magnitude\n let magnitude = this.rand_mag();\n\n // Calculate a random point on a normalized 2D circle\n let norm_point = this.rand_norm_point();\n\n // Now, interpolate that according to the inner/outer cone radius to get two points.\n // Those two points can then be shifted to 3D using magnitude\n let inner_point = {x: norm_point.x * this.inner_rad, \n y: norm_point.y * this.inner_rad};\n\n let outer_point = {x: norm_point.x * this.outer_rad, \n y: norm_point.y * this.outer_rad};\n\n let inner_pt = new THREE.Vector3(inner_point.x, inner_point.y, 0.0);\n let outer_pt = new THREE.Vector3(outer_point.x, outer_point.y, magnitude);\n // let inner_pt = new THREE.Vector3(inner_point.x, 0.0, inner_point.y);\n // let outer_pt = new THREE.Vector3(outer_point.x, magnitude, outer_point.y);\n\n // We have our two points, but they need to be aligned with the normal vector of our movements\n // let n = new THREE.Vector3(1,0,0);\n // let p = this.diff ? new THREE.Vector3(-this.diff.x, -this.diff.y, -this.diff.z).normalize() : new THREE.Vector3(1,0,0);\n\n // let axis = new THREE.Vector3(p.x, p.y, p.z).cross(n);\n // let angle = p.dot(n);\n\n // let rotMat = new THREE.Matrix4().makeRotationAxis(axis, angle);\n\n // outer_pt.applyMatrix4(rotMat);\n // inner_pt.applyMatrix4(rotMat);\n\n\n\n // let p = this.diff ? new THREE.Vector3(-this.diff.x, -this.diff.y, -this.diff.z).normalize() : new THREE.Vector3(0,0,1);\n // let rotMat = new THREE.Matrix4().makeRotationAxis(p, new THREE.Vector3(0.1, 0.1, 0.1));\n\n // outer_pt.applyMatrix4(rotMat);\n // inner_pt.applyMatrix4(rotMat);\n\n\n let n = new THREE.Vector3(0,0,1);\n let p = this.diff ? new THREE.Vector3(-this.diff.x, -this.diff.y, -this.diff.z).normalize() : new THREE.Vector3(0,0,1);\n\n let quat = new THREE.Quaternion();\n quat.setFromUnitVectors(n, p);\n\n let rotMat = new THREE.Matrix4();\n rotMat.makeRotationFromQuaternion(quat);\n\n // Get the difference to get the velocity\n let velocity = outer_pt.sub(inner_pt);\n\n\n return velocity.applyMatrix4(rotMat);\n }", "title": "" }, { "docid": "71f7643a013fb82d9992eea75675aa3c", "score": "0.56730723", "text": "update() {\n super.update()\n this.vel.mult(damp)\n this.acc.mult(damp)\n }", "title": "" }, { "docid": "6a9417c6e7edf7c76b485ed6efa96f5b", "score": "0.56695336", "text": "CalculateDelta():number {\n\n\t\tthis.currentTime = Date.now();\n\n\t\treturn this.currentTime - this.offset;\n\t}", "title": "" }, { "docid": "214c2038b46b442c1a2f9f8b8be7f854", "score": "0.56645155", "text": "update() {\n this.velo.posx/=this.vdecayx\n this.velo.posy/=this.vdecayy\n\n this.velo.add(this.accel);\n this.pos.add(this.velo);\n\n // enfore velocity cap\n if (this.velo.posx > this.max_horiz_velocity) {\n this.velo.posx = this.max_horiz_velocity\n } else if (this.velo.posx < -this.max_horiz_velocity) {\n this.velo.posx = -this.max_horiz_velocity\n }\n if (this.velo.posy > this.max_vert_velocity) {\n this.velo.posy = this.max_vert_velocity\n } else if (this.velo.posy < -this.max_vert_velocity) {\n this.velo.posy = -this.max_vert_velocity\n }\n\n if (this.lifetime > 0) {\n this.lifetime -= 1; \n }\n }", "title": "" }, { "docid": "8ad0e494130f8bb85fbf25046a30ce94", "score": "0.5637634", "text": "update () {\n this.velocity.add(this.acceleration);\n this.position.add(this.velocity);\n this.lifespan -= 4;\n }", "title": "" }, { "docid": "8f78f989af7840066dd51bc47a6323f5", "score": "0.5627468", "text": "update() {\n this.position.add(this.velocity)\n this.velocity.add(this.acceleration)\n this.velocity.limit(this.maxSpeed)\n }", "title": "" }, { "docid": "a19d40213d2150c287cae2c89c7142fe", "score": "0.56158733", "text": "updateVelY(dt){ //metoda aktualizjaca wartosc pionowego wektora predkosci w zaleznosci od czasu\n this.velocityY = this.velocityY + g*dt;\n }", "title": "" }, { "docid": "89c8b71cff006d0dec6b11e3e7e14fb0", "score": "0.5613075", "text": "function updateCalcs ()\r\n {\r\n _dPrevTheta = _dTheta;\r\n _dPrevXPos = (_dLength + _dSpringLength) * Math.sin (_dTheta);\r\n _dPrevYPos = (_dLength + _dSpringLength) * Math.cos (_dTheta);\r\n\r\n //var simStepResults = RK4_step ( [_dSpringSpeed, _dOmega, _x, _dTheta] );\r\n var simStepResults = RK4_step ( [_dSpringSpeed, _dOmega, _dSpringLength, _dTheta] );\r\n\r\n // uncomment for debugging\r\n // console.log (_dSpringLength, _dTheta);\r\n\r\n _dSpringSpeed += simStepResults [0];\r\n _dOmega += simStepResults [1];\r\n _dSpringLength += simStepResults [2];\r\n _dTheta += simStepResults [3];\r\n\r\n // Compute the position of the ball/bob\r\n _dCurrXPos = (_dLength + _dSpringLength) * Math.sin (_dTheta);\r\n _dCurrYPos = (_dLength + _dSpringLength) * Math.cos (_dTheta);\r\n }", "title": "" }, { "docid": "894a93a69e53ce2f4233a645b66bd512", "score": "0.56009847", "text": "function getVerticalVelocity(knockback, angle) {\n var initialVelocity = knockback * 0.03;\n var verticalAngle = Math.sin(angle * angleConversion);\n var verticalVelocity = initialVelocity * verticalAngle;\n verticalVelocity = Math.round(verticalVelocity * 100000) / 100000;\n return verticalVelocity;\n }", "title": "" }, { "docid": "4ccc3ae063ffbb015e3030f9a1eb2cb3", "score": "0.5582337", "text": "updateVelocity(dimension, velocity) {\n this.vel[dimension] += velocity;\n }", "title": "" }, { "docid": "ccf7dc4fd4e9fbb7470b7d244c7f1f98", "score": "0.55582", "text": "calculateCalorie() {\n cal = 0.0;\n met = this.getMET(this.state.directionMode, this.state.speed);\n weight = this.getWeight();\n durationTime = this.state.mainTimer / 1000 / 60;\n cal = (met * 3.5 * weight / 200) * durationTime;\n return parseFloat(cal).toFixed(2);\n }", "title": "" }, { "docid": "fcf2144cdc12b9410485ac9027b536e6", "score": "0.5553116", "text": "function velocity(x) {\n var v = vline.velocity(x);\n v.x += 1;\n return v;\n}", "title": "" }, { "docid": "b5267b8be18cba21389375c5cbc8de0e", "score": "0.55517936", "text": "function getDelta() {\n console.log(rotation);\n let radius = 50;\n \n console.log((radius * Math.sin(rotation * Math.PI / 180)));\n console.log((radius * Math.cos(rotation * Math.PI / 180)));\n\n \n // delta.x /= 10;\n // delta.y /= 10;\n\n}", "title": "" }, { "docid": "346f4a741320af192a98a4498dabd567", "score": "0.5537279", "text": "function getUpdatedVelocity(keyCode) {\n\tswitch (keyCode) {\n\t\tcase 37: {\n\t\t\treturn { x: -1, y: 0 };\n\t\t}\n\t\tcase 38: {\n\t\t\treturn { x: 0, y: -1 };\n\t\t}\n\t\tcase 39: {\n\t\t\treturn { x: 1, y: 0 };\n\t\t}\n\t\tcase 40: {\n\t\t\treturn { x: 0, y: 1 };\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8b0086f9b72982a3132d25337bf5a452", "score": "0.5532532", "text": "update() {\n this.location.add(this.velocity);\n\t}", "title": "" }, { "docid": "8b4cd6682a2a72afe8015f2021ee9e5b", "score": "0.551675", "text": "get totalDistance ()\r\n {\r\n return Math.abs(this.rotationAngle * this.radius);\r\n }", "title": "" }, { "docid": "b4e91c5926fc92d27a88c76d25a321e1", "score": "0.54955417", "text": "update() {\n let FRICTION = 0.99\n this.vel.mult(FRICTION)\n\n // don't update our physics if we are locked\n if (!this.locked) {\n this.vel.add(this.acc)\n this.pos.add(this.vel)\n this.acc.mult(0)\n }\n }", "title": "" }, { "docid": "110d7c9b4ea961eecff39aa05ad23120", "score": "0.5489903", "text": "update() {\n\n this.lifeTime += 0.001;\n\n // Update velocity\n this.velocity.add(this.acceleration);\n // Limit speed\n this.velocity.limit(this.maxspeed);\n this.position.add(this.velocity);\n // Reset accelerationelertion to 0 each cycle\n this.acceleration.mult(0);\n }", "title": "" }, { "docid": "0b10fda818259ff52bef86fdb4c96a0c", "score": "0.54773", "text": "get y() {\n return Math.sin(this.direction) * this.magnitude;\n }", "title": "" }, { "docid": "4d8e00e5993881e8f2a2f011c88e3b1f", "score": "0.54759717", "text": "get circumference (){\n return PI * this.diameter;\n }", "title": "" }, { "docid": "a44d63867f1f0776c2520f5bc9f35917", "score": "0.54747367", "text": "get flightAcceleration() {\n return configs.flightAccelerationKMPHPS / 3600000000;\n }", "title": "" }, { "docid": "a44d63867f1f0776c2520f5bc9f35917", "score": "0.54747367", "text": "get flightAcceleration() {\n return configs.flightAccelerationKMPHPS / 3600000000;\n }", "title": "" }, { "docid": "c9b7491a04b5a9d9957f017c29128b43", "score": "0.54727393", "text": "function updatePosition() {\n\n // approximate calculus ...\n var acc = -sin(tetha) * g / (l);\n\n // add to angular velocity \n av += acc;\n\n // account for some friction\n av = av * (1-friction);\n \n // update the new angle\n tetha += av;\n}", "title": "" }, { "docid": "edcfb788a457cbd81de13f665a33bf1f", "score": "0.5468331", "text": "getVelAtPt(pt) {\n\t\tlet rperp = this.getRPerp(pt)\n\t\trperp.scalarMult(this.getRotationalVelocity())\n\t\trperp.translateV(this.getVelocity())\n\t\treturn rperp\n\t}", "title": "" }, { "docid": "ad2ada934fd2eb255b871f461c069243", "score": "0.5462746", "text": "function instruct_torque(){\n torque_state.val = Math.sin( torque_state.iter * ( Math.PI / 180 ) );\n torque_state.iter++;\n\n return torque_state.val;\n}", "title": "" }, { "docid": "34b4c2262ab4f233904f16de979a981c", "score": "0.5444197", "text": "kochD() {\n let v = p5.Vector.sub(this.end, this.start);\n v.mult(2/3.0);\n v.add(this.start);\n return v;\n }", "title": "" }, { "docid": "fca554aa1bdca1880964656138e85d49", "score": "0.5442752", "text": "get motorSpeed() {}", "title": "" }, { "docid": "0e124554abd458666f76562ef3054110", "score": "0.5435408", "text": "calc_speed() {\n let speed = Math.sqrt((this.velocity[0] ** 2) + (this.velocity[1] ** 2));\n if (speed == NaN || speed == 0) return 6;\n else return speed / 5;\n }", "title": "" }, { "docid": "95d456661995121a71511fe9d4ba19ae", "score": "0.54088336", "text": "update() {\n // Update velocity\n this.velocity.add(this.acceleration);\n // Limit speed\n this.velocity.limit(this.maxspeed);\n this.position.add(this.velocity);\n // Reset acceleration to 0 each cycle\n this.acceleration.mult(0);\n }", "title": "" }, { "docid": "1c5c4a7ba2e566c7727202742897033d", "score": "0.5406247", "text": "get length() {\n return Math.sqrt(this.dx ** 2 + this.dy ** 2);\n }", "title": "" }, { "docid": "daacbbe139654ddb5d08ddf373be1fb7", "score": "0.5402886", "text": "mercury() {\n const mercuryAge = .24;\n let years = (this.years/mercuryAge);\n return years;\n }", "title": "" }, { "docid": "d3e1854269b24be729935f2261edd028", "score": "0.5400465", "text": "get actualRadiusY() {\r\n return this.i.ah;\r\n }", "title": "" }, { "docid": "ca6c767b74186949011476694ab2bfb9", "score": "0.53995204", "text": "fract() {\n return new Vector3(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));\n }", "title": "" }, { "docid": "eff2469aba7fd377a27dd490398b1542", "score": "0.53940123", "text": "function updateCalcs ()\r\n {\r\n // Update the wheel position\r\n _dPhi = AdjustAngle (_dPhi + _dOmega * _dTimeStep); \r\n\r\n // Solve the equations of motion for the pendulum \r\n var simStepResults = RK4_step ( [ _dThetaDot, _dTheta ] );\r\n _dThetaDot += simStepResults [0];\r\n _dTheta = AdjustAngle (_dTheta + simStepResults [1]);\r\n\r\n // uncomment for debugging\r\n // console.log (_dThetaDot, _dTheta);\r\n }", "title": "" }, { "docid": "b136d06875e6615e37926923c7845f36", "score": "0.5392842", "text": "updateAcceleration() {\n this.accel = [0, -0.5 * gravity, 0];\n }", "title": "" }, { "docid": "8ad349ae985a033835a332969ad19550", "score": "0.5388104", "text": "function getVelocity(keyCode) {\n\tswitch (keyCode) {\n\t\tcase KEYCODES.KEY_A:\n\t\tcase KEYCODES.KEY_LEFT_ARROW: return { x: -1, y: 0 };\n\t\tcase KEYCODES.KEY_D:\n\t\tcase KEYCODES.KEY_RIGHT_ARROW: return { x: 1, y: 0 };\n\t\tcase KEYCODES.KEY_W:\n\t\tcase KEYCODES.KEY_UP_ARROW: return { x: 0, y: 1 };\n\t\tcase KEYCODES.KEY_S:\n\t\tcase KEYCODES.KEY_DOWN_ARROW: return { x: 0, y: -1 };\n\t\tdefault: return null;\n\t}\n}", "title": "" }, { "docid": "1b2e3d8c525bd69ae8048841fc838fd2", "score": "0.5386894", "text": "update() {\n // Update velocity\n this.velocity.add(this.acceleration);\n // Limit speed\n this.velocity.limit(this.maxspeed);\n this.position.add(this.velocity);\n // Reset accelertion to 0 each cycle\n this.acceleration.mult(0);\n }", "title": "" }, { "docid": "7c31a14b3eb7fec43cd3f3639cdbc080", "score": "0.5385741", "text": "update() {\n this.x -= this.vel\n }", "title": "" }, { "docid": "396c23d938d271aa0f0ae9c3a7a8e8d5", "score": "0.538374", "text": "get radiusX() {\r\n return this.i.ov;\r\n }", "title": "" }, { "docid": "396c23d938d271aa0f0ae9c3a7a8e8d5", "score": "0.538374", "text": "get radiusX() {\r\n return this.i.ov;\r\n }", "title": "" }, { "docid": "d8268681071e6c661d8b9a4dbf8a4fa5", "score": "0.5376875", "text": "updateAccel() {\n\t\tthis._prev_accel = this.accel;\n\t\tif ( !(this.previous_speed === undefined) ) {\n\t\t\tif (!this._prev_accel) {\n\t\t\t\tthis.accel = this.speed-this.previous_speed;\n\t\t\t} else {\n\t\t\t\tthis.accel = ((this.speed-this.previous_speed)+this._prev_accel)/2;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "f6f3e866d0e9c716237e29618db8b5be", "score": "0.5372238", "text": "update() {\n this.position.add(this.velocity);\n this.velocity.add(this.aceleration);\n this.velocity.limit(this.maxSpeed);\n this.aceleration.mult(0);\n\n }", "title": "" }, { "docid": "068f324f5f81fded9b573e4c29d94134", "score": "0.53701997", "text": "update_() {\n this.velocity_.add(this.acceleration_);\n this.velocity_.limit(this.maxSpeed_);\n this.location_.add(this.velocity_);\n this.acceleration_.mult(0);\n }", "title": "" }, { "docid": "3d399ca3b72f07a491e640a1c5aebc37", "score": "0.5366913", "text": "update() {\n if (!this.dragging) {\n this.angle += this.aVel\n this.aVel += this.aAcc\n this.aVel *= this.damping\n this.aAcc = 0.33 / this.arm * cos(this.angle)\n }\n}", "title": "" }, { "docid": "f928197dc5e5033551adb076a3891123", "score": "0.5365832", "text": "function initialVelocity(q, eccentricity) {\n return Math.sqrt( (1 + q) * (1 + eccentricity) );\n }", "title": "" }, { "docid": "06f3a65f09f24a18792a69beaf1e5c38", "score": "0.53654736", "text": "length() {\n return Math.sqrt(this._vector[0] * this._vector[0] + this._vector[1] * this._vector[1] + this._vector[2] * this._vector[2]);\n }", "title": "" }, { "docid": "05635c2b35085d45188bd3cd86370639", "score": "0.5353096", "text": "orbitPosition(time) {\n // polar\n this.orbitPos.theta = this.eccentricAnomaly(time);\n this.orbitPos.r = this.distanceFromCenter(this.orbitPos.theta);\n\n // cartesian\n const cartesianCoOrds = polarToCartesian(this.orbitPos.r, this.orbitPos.theta);\n this.orbitPos.x = cartesianCoOrds.X;\n this.orbitPos.y = cartesianCoOrds.Y;\n\n return this.orbitPos;\n }", "title": "" }, { "docid": "958f74a3f9461114ece2802c27b9fc70", "score": "0.5340432", "text": "calculateDrag(obj) {\n let speed = obj.vel.mag();\n let dragMagnitude = this.c * speed * speed * this.c;\n \n let dragForce = obj.vel.copy();\n dragForce.mult(-1);\n \n dragForce.normalize();\n dragForce.mult(dragMagnitude);\n\n return dragForce;\n }", "title": "" }, { "docid": "67cebfb02bffed4ed6b1ddf283de8e44", "score": "0.53362596", "text": "get velocityX() {\n if (this.sprite.body.velocity.x > 0 && this.sprite.body.blocked.right) {\n return 0;\n }\n if (this.sprite.body.velocity.x < 0 && this.sprite.body.blocked.left) {\n return 0;\n }\n return this.sprite.body.velocity.x;\n }", "title": "" }, { "docid": "a81573d1617f30638e98b233a156c014", "score": "0.53328115", "text": "function useVelocity(value) {\n var velocity = Object(_use_motion_value_js__WEBPACK_IMPORTED_MODULE_1__[\"useMotionValue\"])(value.getVelocity());\n Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(function () {\n return value.velocityUpdateSubscribers.add(function (newVelocity) {\n velocity.set(newVelocity);\n });\n }, [value]);\n return velocity;\n}", "title": "" }, { "docid": "234ce7b3aae916ec631a1f483bebcfda", "score": "0.53305835", "text": "get totalRotation ()\r\n {\r\n return this.initialAngle + this.rotationAngle;\r\n }", "title": "" }, { "docid": "8d0c06ba6d5bb0396b1b35cfc3dfc3e0", "score": "0.53267574", "text": "update() {\r\n // Update velocity\r\n this.velocity.add(this.acceleration);\r\n // Limit speed\r\n this.velocity.limit(this.maxspeed);\r\n this.position.add(this.velocity);\r\n // Reset acceleration to 0 each cycle\r\n this.acceleration.mult(0);\r\n }", "title": "" }, { "docid": "2e9ab1d921f63a4139578347d0e6f8b5", "score": "0.5324323", "text": "_calcSpeed() {\n this.speed = this.distance / (this.duration / 60);\n return this.speed;\n }", "title": "" }, { "docid": "4ea8cacb7aaf2732221e17f1f2713414", "score": "0.5302386", "text": "initialPoint()\r\n {\r\n //creates a vec3 object to store initial movement vector\r\n var dir = vec3.create();\r\n\r\n //sets the apropriate values\r\n vec3.set(dir, this.rcos(this.initialAngle) + this.centerCoords[0], 0 + this.centerCoords[1], this.rsin(this.initialAngle) + this.centerCoords[2]);\r\n\r\n //returns it\r\n return dir;\r\n }", "title": "" }, { "docid": "34b920c4df5cf8ee1797594d17006c64", "score": "0.5301764", "text": "get acceleration() {\n return configs.accelerationKMPHPS / 3600000000;\n }", "title": "" }, { "docid": "34b920c4df5cf8ee1797594d17006c64", "score": "0.5301764", "text": "get acceleration() {\n return configs.accelerationKMPHPS / 3600000000;\n }", "title": "" }, { "docid": "dd5393bee6ac6fcdad73ab219ac30ba0", "score": "0.52925", "text": "addVelocity(timeSpeed){\n\t\tconst objArr = this.scene.objArr;\n\t\t// Add the vectors\n\t\tfor (let objId = objArr.length; objId--;){\n\t\t\tlet object = objArr[objId];\n\t\t\t// let can = this.activCam.ctx3;\n\t\t\t// can.beginPath();\n\t\t\t// can.fillStyle = object.color;\n\t\t\t// can.arc(...this.activCam.crd2(object.x, object.y), 2, 0, 7);\n\t\t\t// can.fill();\t\n\t\t\tif (mov_obj !== objId){\n\t\t\t\t// Add vectors\n\t\t\t\tif (object.lock){ // If object locked\n\t\t\t\t\tobject.vx = 0;\n\t\t\t\t\tobject.vy = 0;\n\t\t\t\t} else {// If object not locked\n\t\t\t\t\tobject.x += object.vx * timeSpeed;\n\t\t\t\t\tobject.y += object.vy * timeSpeed;\n\n\t\t\t\t\tif (ui.interactMode.state == 1){\n\t\t\t\t\t\tlet mainObj = objArr[object.main_obj];\n\t\t\t\t\t\twhile(mainObj != undefined){\n\t\t\t\t\t\t\tobject.x += mainObj.vx * timeSpeed;\n\t\t\t\t\t\t\tobject.y += mainObj.vy * timeSpeed;\n\t\t\t\t\t\t\tmainObj = objArr[mainObj.main_obj];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Allow frame render if object moves\n\t\t\t\t\tif (object.vx || object.vy) renderer.allowFrameRender = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tobject.vx = object.vy = 0;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "faa7f2da96b2458dbaaace9c03e60c4f", "score": "0.5289672", "text": "function vwOrbit(){\n \n}", "title": "" }, { "docid": "faa2d8596ddd45f32b5a67286df918d5", "score": "0.52844125", "text": "magnitude()\n {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "title": "" } ]
964b975b2bac922eb19b5a4a476c7f7d
([Int],Tree) > Tree Takes a "location" (output of getQLoc) and a tree and returns the subtree at the location in question. FOR SI(AV)
[ { "docid": "3512361c84d6f936871ecdc5d8863e99", "score": "0.6307535", "text": "function getTreeAt(tree,loc) {\n\tfor(var i=0;i<loc.length;i++) {\n\t\ttree = tree[loc[i]];\n\t}\n\treturn tree;\n}", "title": "" } ]
[ { "docid": "f934ce12cfd9c3d186d40910b5b000fe", "score": "0.6550052", "text": "function getQLoc(tree) {\n\tvar loc = [];\n\tgt(tree,[]);\n\treturn loc;\n\tfunction gt(a,y) {\n\t\tif(a.length==2 && isQ(a[0])) {\n\t\t\tloc.push(y.slice(0));\n\t\t\ty.push(1);\n\t\t\tgt(a[1],y.slice(0));\n\t\t} else if(a.length==2 && isU(a[0])) {\n\t\t\ty.push(1);\n\t\t\tgt(a[1],y.slice(0));\n\t\t} else if(a.length==3 && isB(a[1])) {\n\t\t\ty.push(0);\n\t\t\tgt(a[0],y.slice(0));\n\t\t\ty.pop();\n\t\t\ty.push(2);\n\t\t\tgt(a[2],y.slice(0));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c99c815af601150011ec9c9f4f04fd6b", "score": "0.5368102", "text": "function getSlot(i,a){var slot=i>>5*a.height;while(a.lengths[slot]<=i){slot++;}return slot;}// Recursively creates a tree with a given height containing", "title": "" }, { "docid": "c99c815af601150011ec9c9f4f04fd6b", "score": "0.5368102", "text": "function getSlot(i,a){var slot=i>>5*a.height;while(a.lengths[slot]<=i){slot++;}return slot;}// Recursively creates a tree with a given height containing", "title": "" }, { "docid": "4d3e1632e8cef3616a909f14ac25fbed", "score": "0.50594556", "text": "getTree() {\n\n return [\n this.op,\n this.operand.getTree()\n ];\n }", "title": "" }, { "docid": "36872e4df202374c26a5c37e5039dbad", "score": "0.5046947", "text": "function makeTree(arr, parent) {\n\n}", "title": "" }, { "docid": "bf64ba1f688ce90ccf51b601d959add0", "score": "0.49852678", "text": "function insertTmp(tree,savtmp,loc) {\n\treturn go(tree,[])\n\tfunction go(ar,l) {\n\t\tif(smLoc(l,loc)) {return savtmp;}\n\t\tif(ar.length==2 && (isQ(ar[0]) || isU(ar[0]))) {\n\t\t\treturn ar[0]+go(ar[1],l.concat([1]));\n\t\t}\n\t\tif(ar.length==3 && isB(ar[1])) {\n\t\t\treturn '('+go(ar[0],l.concat([0]))+ar[1]+go(ar[2],l.concat([2]))+')';\n\t\t}\n\t\telse {\n\t\t\treturn ar.join('');\n\t\t}\n\t}\n\tfunction smLoc(l1,l2) {\n\t\tif(l1.length!=l2.length) {return false;}\n\t\tfor(var i=0;i<l1.length;i++) {\n\t\t\tif(l1[i]!=l2[i]) {return false;}\n\t\t}\n\t\treturn true;\n\t}\t\n}", "title": "" }, { "docid": "25da604c57297033276d7b4ee9a8976d", "score": "0.49592373", "text": "function tree_init(q) {\n\n // create tree object\n var tree = {};\n\n // initialize with vertex for given configuration\n tree.vertices = [];\n tree.vertices[0] = {};\n tree.vertices[0].vertex = q;\n tree.vertices[0].edges = [];\n\n // create rendering geometry for base location of vertex configuration\n add_config_origin_indicator_geom(tree.vertices[0]);\n\n // maintain index of newest vertex added to tree\n tree.newest = 0;\n\n return tree;\n}", "title": "" }, { "docid": "c4643dc8856eaf225f99f7defd988e44", "score": "0.49227545", "text": "static genSampleTree() {\n let tree = new BST(10);\n let a = tree.insertAsLC(tree.root(), 5);\n tree.insertAsLC(a, 2);\n tree.insertAsRC(a, 7);\n a = tree.insertAsRC(tree.root(), 16);\n tree.insertAsLC(a, 12);\n tree.insertAsRC(a, 20);\n return tree;\n }", "title": "" }, { "docid": "c11943b8f9379221685e5641f3094325", "score": "0.4869373", "text": "getTree() {\n return tree.getTree();\n }", "title": "" }, { "docid": "d2a416469170c5a568dc50be5a98ffde", "score": "0.48180193", "text": "function tree(arr){\n const tree = new BinarySearchTree();\n for(let i=0; i < arr.length; i++){\n tree.insert(arr[i]);\n }\n return tree;\n}", "title": "" }, { "docid": "8a324435a64bc55012893ef0c00fb560", "score": "0.48106742", "text": "getSubtree(index) {\n return new Tree(this.getNode(index), (node) => this.setNode(index, node));\n }", "title": "" }, { "docid": "007c7f0e8db8e96e5b6dc3a84b0c1529", "score": "0.48073903", "text": "function BSPTree() {\n\n function less_than(box, vec) {\n return vec.horizontal ? vec.y > box.bottom : vec.x > box.right;\n }\n\n function intersects(box, vec) {\n return vec.horizontal ? \n vec.y > box.top && vec.y <= box.bottom :\n vec.x > box.left && vec.x <= box.right;\n }\n\n function split(box, vec) {\n var s = {lt: $.extend({}, box), gt: $.extend({}, box)};\n if(vec.horizontal) {\n s.lt.bottom = vec.y -1;\n s.gt.top = vec.y;\n } else {\n s.gt.left = vec.x;\n s.lt.right = vec.x -1;\n }\n set_dimentions(s.lt);\n set_dimentions(s.gt);\n return s;\n }\n\n function set_dimentions(box) {\n box.width = box.right - box.left + 1;\n box.height = box.bottom - box.top + 1;\n }\n\n function insert(box, tree) {\n if(is_box(tree)) {\n return add_box(box, tree);\n } else if(is_vector(tree)) {\n if(intersects(box, tree)) {\n var s = split(box, tree);\n tree.lt = insert(s.lt, tree.lt);\n tree.gt = insert(s.gt, tree.gt);\n } else if (less_than(box, tree)) {\n tree.lt = insert(box, tree.lt);\n } else {\n tree.gt = insert(box, tree.gt);\n }\n return tree;\n }\n throw \"tree should only contain vectors or boxes\";\n }\n\n function find_adj(box, tree) {\n if(is_box(tree)) {\n return [tree];\n } else if(is_vector(tree)) {\n if(intersects(box, tree)) {\n var s = split(box, tree);\n return find_adj(s.lt, tree.lt).concat(find_adj(s.gt, tree.gt));\n } else if (less_than(box, tree)) {\n return find_adj(box, tree.lt);\n } else {\n return find_adj(box, tree.gt);\n }\n }\n throw \"tree should only contain vectors or boxes\";\n }\n\n function add_box(new_box, old_box) {\n if(!boxes.intersect(old_box, new_box, false)) {\n if (boxes.left_of(old_box, new_box)) {\n return {x: new_box.left, y: new_box.top, \n horizontal: false, lt: old_box, gt: new_box};\n } else {\n return {x: old_box.left, y: old_box.top,\n horizontal: false, lt: new_box, gt: old_box };\n }\n } else if (!boxes.intersect(old_box, new_box, true)) {\n if(boxes.above(old_box, new_box)) {\n return {x: new_box.left, y: new_box.top, \n horizontal: true, lt: old_box, gt: new_box};\n } else {\n return {x: old_box.left, y: old_box.top,\n horizontal: true, lt: new_box, gt: old_box};\n }\n }\n throw \"intersecting boxes not supported current: \" \n + boxes.to_string(old_box) + \" new: \" + boxes.to_string(new_box);\n }\n\n function is_box() {\n for(var i = 0; i < arguments.length; i++) {\n if (!has_properties(arguments[i], 'top', 'bottom', 'left', 'right'))\n return false;\n }\n return true;\n }\n\n function is_vector() {\n for(var i = 0; i < arguments.length; i++) {\n if (!has_properties(arguments[i], 'x', 'y', 'horizontal'))\n return false;\n }\n return true;\n }\n\n function has_properties() {\n var obj = arguments[0];\n for(var i = 1; i < arguments.length; i++) {\n if(obj[arguments[i]] == undefined) return false;\n }\n return true;\n }\n\n return {\n put: function(b) {\n if(this.head == null) {\n this.head = b;\n } else if (is_box(this.head)) {\n this.head = add_box(b, this.head);\n } else {\n //head should be a vector\n insert(b, this.head);\n }\n },\n find_adjacent: function(b) {\n if(this.head == null) return null;\n return find_adj(b, this.head);\n }\n };\n}", "title": "" }, { "docid": "c8e956c47b052af0dd918d3868ed3ee9", "score": "0.47879642", "text": "function push_(item,a){// Handle resursion stop at leaf level.\nif(a.height===0){if(a.table.length<M){var newA={ctor:'_Array',height:0,table:a.table.slice()};newA.table.push(item);return newA;}else{return null;}}// Recursively push\nvar pushed=push_(item,botRight(a));// There was space in the bottom right tree, so the slot will\n// be updated.\nif(pushed!==null){var newA=nodeCopy(a);newA.table[newA.table.length-1]=pushed;newA.lengths[newA.lengths.length-1]++;return newA;}// When there was no space left, check if there is space left\n// for a new slot with a tree which contains only the item\n// at the bottom.\nif(a.table.length<M){var newSlot=create(item,a.height-1);var newA=nodeCopy(a);newA.table.push(newSlot);newA.lengths.push(newA.lengths[newA.lengths.length-1]+length(newSlot));return newA;}else{return null;}}// Converts an array into a list of elements.", "title": "" }, { "docid": "c8e956c47b052af0dd918d3868ed3ee9", "score": "0.47879642", "text": "function push_(item,a){// Handle resursion stop at leaf level.\nif(a.height===0){if(a.table.length<M){var newA={ctor:'_Array',height:0,table:a.table.slice()};newA.table.push(item);return newA;}else{return null;}}// Recursively push\nvar pushed=push_(item,botRight(a));// There was space in the bottom right tree, so the slot will\n// be updated.\nif(pushed!==null){var newA=nodeCopy(a);newA.table[newA.table.length-1]=pushed;newA.lengths[newA.lengths.length-1]++;return newA;}// When there was no space left, check if there is space left\n// for a new slot with a tree which contains only the item\n// at the bottom.\nif(a.table.length<M){var newSlot=create(item,a.height-1);var newA=nodeCopy(a);newA.table.push(newSlot);newA.lengths.push(newA.lengths[newA.lengths.length-1]+length(newSlot));return newA;}else{return null;}}// Converts an array into a list of elements.", "title": "" }, { "docid": "3a768b1db1f8825cff0f716aebff18fe", "score": "0.47839445", "text": "addAllPositionsToTree() {\n // Create a queue for the positions of vertices in the tree\n const queue = [this.positions[0]]\n\n let node\n\n // Add all of the child branches to the tree\n for(let i = 1; i <= this.labels.length - 1; i++) {\n // Remove the next node in the queue\n node = queue.pop()\n\n // Get the information from the current node\n const [pos, lw, lh] = node\n\n const _pos = pos.copy()\n\n // Move the following points to make space for the text at this position\n _pos.x += this.textBoxWidth\n\n // Create variables to represent the potential children of this vertex\n let up, down\n\n // Add a child up and to the right of this vertex, if there is a label for it\n if((i - 1) * 2 < this.labels.length) {\n up = this.calculatePosition(lh, lw, _pos, -1)\n queue.unshift(up)\n }\n\n // Add a child down and to the right of this vertex, if there is a label for it\n if((i - 1) * 2 + 1 < this.labels.length) {\n down = this.calculatePosition(lh, lw, _pos, 1)\n queue.unshift(down)\n }\n\n // Add `up` and `down` to `this.positions` if they exist\n if(up != null) this.positions.push(up)\n if(down != null) this.positions.push(down)\n }\n }", "title": "" }, { "docid": "21f87b27a9636da49e2589acb575c292", "score": "0.47584432", "text": "static newQuad(parent) {\n\t\tlet bound = parent.bound;\n\t\tlet halfWidth = bound.width / 2;\n\t\tlet halfHeight = bound.height / 2;\n\n\t\t// TL, TR, BL, BR\n\t\treturn [\n\t\t\tnew QuadTreeSector(parent, bound.minx, bound.miny, halfWidth, halfHeight),\n\t\t\tnew QuadTreeSector(parent, bound.minx + halfWidth, bound.miny, halfWidth, halfHeight),\n\t\t\tnew QuadTreeSector(parent, bound.minx, bound.miny + halfHeight, halfWidth, halfHeight),\n\t\t\tnew QuadTreeSector(parent, bound.minx + halfWidth, bound.miny + halfHeight, halfWidth, halfHeight),\n\t\t];\n\t}", "title": "" }, { "docid": "bccfcd5da6f3b2ec3cf4dd1ca8ce7650", "score": "0.46958578", "text": "function getTreePositions(levels, pos, spacing) {\n var ret = [],\n width = Math.pow(2, levels-1) * spacing.x;\n\n for (var level = 0; level < levels; level++) {\n var items = Math.pow(2, level),\n interval = width / items,\n y = pos.y + spacing.y * level,\n x = pos.x + (interval - width) / 2;\n\n for (var offset = 0; offset < items; offset++) {\n var i = items + offset - 1;\n ret[i] = {x: x + offset * interval, y: y};\n ret[i].parent = i ? Math.floor((i - 1)/2) : i;\n }\n }\n\n return ret;\n}", "title": "" }, { "docid": "2414fa7f606ba8c6c3377bc6582f5b7a", "score": "0.46769813", "text": "function search (tree, value) {\n\n}", "title": "" }, { "docid": "11caeb49abbd4243617893e56cf0ab57", "score": "0.4676977", "text": "function getTreeNode(input_vi, id) {\n // when I first call this function, fn([data_tree], null)\n var visited = input_vi;\n if (visited.length === 0) {\n return null;\n } else {\n if (visited[0].id == id) {\n return visited[0];\n } else {\n var recurse;\n if (visited[0].children) {\n recurse = visited.concat(visited[0].children);\n } else {\n recurse = visited;\n }\n recurse.shift();\n return getTreeNode(recurse, id);\n }\n }\n}", "title": "" }, { "docid": "4d64bd326cdd4436fcb804be071558cd", "score": "0.46696317", "text": "function QuadTree(boundBox, lvl) {\n\tvar maxObj = 10;\n\tthis.bounds = boundBox || {\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: 0,\n\t\theight: 0\n\t};\n\tvar object = [];\n\tthis.nodes = [];\n\tvar level = lvl || 0;\n\tvar maxLvls = 4;\n\n\tthis.clear = function(){\n\t\tobject = [];\n\t\tfor (var i = 0; i < this.nodes.length; i++) {\n\t\t\tthis.nodes[i].clear();\n\t\t}\n\t\tthis.nodes = [];\n\t};\n\n\t// finds all objects on canvas\n\tthis.getAllObjs = function(returnedObjs) {\n\t\tfor (var i = 0; i < this.nodes.length; i++) {\n\t\t\tthis.nodes[i].getAllObjs(returnedObjs);\n\t\t}\n\t\tfor (var i = 0, len = object.length; i < len; i++) {\n\t\t\treturnedObjs.push(object[i]);\n\t\t}\n\t\treturn returnedObjs;\n\t};\n\n\t// finds objects in a quadrant\n\tthis.findObjs = function(returnedObjs, obj) {\n\t\tif (typeof obj == \"undefined\") {\n\t\t\tconsole.log(\"UNDEFINED OBJECT\");\n\t\t\treturn;\n\t\t}\n\t\tvar index = this.getIndex(obj);\n\t\tif (index != -1 && this.nodes.length) {\n\t\t\tthis.nodes[index].findObjs(returnedObjs, obj);\n\t\t}\n\t\tfor (var i = 0, len = object.length; i < len; i++) {\n\t\t\treturnedObjs.push(object[i]);\n\t\t}\n\t\treturn returnedObjs;\n\t};\n\n\tthis.insert = function(obj){\n\t\tif (typeof obj === \"undefined\") {\n\t\t\treturn;\n\t\t}\n\t\tif (obj instanceof Array) {\n\t\t\tfor (var i = 0, len = obj.length; i < len; i++) {\n\t\t\t\tthis.insert(obj[i]);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (this.nodes.length) {\n\t\t\tvar index = this.getIndex(obj);\n\t\t\tif (index != -1) {\n\t\t\t\tthis.nodes[index].insert(obj);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tobject.push(obj);\n\t\tif (object.length > maxObj && level < maxLvls) {\n\t\t\tif (this.nodes[0] == null) {\n\t\t\t\tthis.split();\n\t\t\t}\n\t\t\tvar i = 0;\n\t\t\twhile (i < object.length) {\n\t\t\t\tvar index = this.getIndex(object[i]);\n\t\t\t\tif (index != -1) {\n\t\t\t\t\tthis.nodes[index].insert((object.spliced(i,1))[0]);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t// finds which quad an object is in\n\tthis.getIndex = function(obj) {\n\t\tvar index = -1;\n\t\tvar vertMid = this.bounds.x + this.bounds.width / 2;\n\t\tvar horzMid = this.bounds.y + this.bounds.height / 2;\n\t\tvar topQuad = (obj.y < horzMid && obj.y + obj.height < horzMid);\n\t\tvar botQuad = (obj.y > horzMid);\n\t\tif (obj.x < vertMid && obj.x + obj.width < vertMid) {\n\t\t\tif (topQuad) {\n\t\t\t\tindex = 1;\n\t\t\t}\n\t\t\telse if (botQuad) {\n\t\t\t\tindex = 2;\n\t\t\t}\n\t\t}\n\t\telse if (obj.x > vertMid) {\n\t\t\tif (topQuad) {\n\t\t\t\tindex = 0;\n\t\t\t}\n\t\t\telse if (botQuad) {\n\t\t\t\tindex = 3;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t};\n\n\t// sets the quadrants\n\tthis.split = function() {\n\t\tvar subWidth = (this.bounds.width / 2) | 0;\n\t\tvar subHeight = (this.bounds.height / 2) | 0;\n\t\tthis.nodes[0] = new QuadTree({\n\t\t\tx: this.bounds.x + subWidth,\n\t\t\ty: this.bounds.y,\n\t\t\twidth: subWidth,\n\t\t\theight: subHeight\n\t\t}, level+1);\n\t\tthis.nodes[1] = new QuadTree({\n\t\t\tx: this.bounds.x,\n\t\t\ty: this.bounds.y,\n\t\t\twidth: subWidth,\n\t\t\theight: subHeight\n\t\t}, level+1);\n\t\tthis.nodes[2] = new QuadTree({\n\t\t\tx: this.bounds.x,\n\t\t\ty: this.bounds.y + subHeight,\n\t\t\twidth: subWidth,\n\t\t\theight: subHeight\n\t\t}, level+1);\n\t\tthis.nodes[3] = new QuadTree({\n\t\t\tx: this.bounds.x + subWidth,\n\t\t\ty: this.bounds.y + subHeight,\n\t\t\twidth: subWidth,\n\t\t\theight: subHeight\n\t\t}, level+1);\n\t};\n}", "title": "" }, { "docid": "be022d97cf45bdfed699ea479032b3c1", "score": "0.46422613", "text": "function PlaceInTree(obj,quadtree)\n{\nif(quadtree.node!=null)\n{\n/*Determines the objects lateral placement, i.e does it lie on the left or right*/\nvar xRel=obj.x-(quadtree.x+(quadtree.size/2));\n/*Determines the objects vertical placement, i.e does it lie in the top or bottom*/\nvar yRel=obj.y-(quadtree.y+(quadtree.size/2));\n\tif(xRel<(-obj.r))//The object lies completely in the left area\n\t{\n\t\tif(yRel<(-obj.r))/*The object lies completely in the top left area*/\n\t\t{\n\t\tPlaceInTree(obj,quadtree.nodes[0]);\n\t\treturn;\n\t\t}\n\t\telse if(yRel>obj.r)/*The object lies completely in the bottom left area*/\n\t\t{\n\t\tPlaceInTree(obj,quadtree.nodes[2]);\t\n\t\treturn;\n\t\t}\n\t}\n\telse if(xRel>obj.r)//The object lies completely in the right area\n\t{\n\t\tif(yRel<(-obj.r))/*The object lies completely in the top left area*/\n\t\t{\n\t\tPlaceInTree(obj,quadtree.nodes[1]);\n\t\treturn;\n\t\t}\n\t\telse if(yRel>obj.r)/*The object lies completely in the bottom left area*/\n\t\t{\n\t\tPlaceInTree(obj,quadtree.nodes[3]);\n\t\treturn;\t\n\t\t}\n\t}\n}\n/*If we are here, the object does not lie completely in any of the child nodes and must\nbe added to this node*/\nquadtree.objects.push(obj);\n}", "title": "" }, { "docid": "2f8b6ab4e8fcd1f2c174591f9805bc3c", "score": "0.45962793", "text": "function mkAVList(tree) {\n\tvar loc = getQLoc(tree);\n\tvar out = [];\n\tvar x = '';\n\tvar b = [];\n\tfor(var i=0;i<loc.length;i++) {\n\t\tx = mkAVtmp(getTreeAt(tree,loc[i]));\n\t\tb = blockedVars(x[1]).concat(freeVars(x[1]));\n\t\tx = insertTmp(tree,strAVtmp(x),loc[i]);\n\t\tout.push([b,x]);\n\t}\n\treturn out;\n}", "title": "" }, { "docid": "c1678c0ae641774125abd8d4ac5e46ef", "score": "0.4594128", "text": "function push_(item, a)\n{\n\t// Handle resursion stop at leaf level.\n\tif (a.height === 0)\n\t{\n\t\tif (a.table.length < M)\n\t\t{\n\t\t\tvar newA = {\n\t\t\t\tctor: '_Array',\n\t\t\t\theight: 0,\n\t\t\t\ttable: a.table.slice()\n\t\t\t};\n\t\t\tnewA.table.push(item);\n\t\t\treturn newA;\n\t\t}\n\t\telse\n\t\t{\n\t\t return null;\n\t\t}\n\t}\n\n\t// Recursively push\n\tvar pushed = push_(item, botRight(a));\n\n\t// There was space in the bottom right tree, so the slot will\n\t// be updated.\n\tif (pushed !== null)\n\t{\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table[newA.table.length - 1] = pushed;\n\t\tnewA.lengths[newA.lengths.length - 1]++;\n\t\treturn newA;\n\t}\n\n\t// When there was no space left, check if there is space left\n\t// for a new slot with a tree which contains only the item\n\t// at the bottom.\n\tif (a.table.length < M)\n\t{\n\t\tvar newSlot = create(item, a.height - 1);\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table.push(newSlot);\n\t\tnewA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));\n\t\treturn newA;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "c1678c0ae641774125abd8d4ac5e46ef", "score": "0.4594128", "text": "function push_(item, a)\n{\n\t// Handle resursion stop at leaf level.\n\tif (a.height === 0)\n\t{\n\t\tif (a.table.length < M)\n\t\t{\n\t\t\tvar newA = {\n\t\t\t\tctor: '_Array',\n\t\t\t\theight: 0,\n\t\t\t\ttable: a.table.slice()\n\t\t\t};\n\t\t\tnewA.table.push(item);\n\t\t\treturn newA;\n\t\t}\n\t\telse\n\t\t{\n\t\t return null;\n\t\t}\n\t}\n\n\t// Recursively push\n\tvar pushed = push_(item, botRight(a));\n\n\t// There was space in the bottom right tree, so the slot will\n\t// be updated.\n\tif (pushed !== null)\n\t{\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table[newA.table.length - 1] = pushed;\n\t\tnewA.lengths[newA.lengths.length - 1]++;\n\t\treturn newA;\n\t}\n\n\t// When there was no space left, check if there is space left\n\t// for a new slot with a tree which contains only the item\n\t// at the bottom.\n\tif (a.table.length < M)\n\t{\n\t\tvar newSlot = create(item, a.height - 1);\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table.push(newSlot);\n\t\tnewA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));\n\t\treturn newA;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "c1678c0ae641774125abd8d4ac5e46ef", "score": "0.4594128", "text": "function push_(item, a)\n{\n\t// Handle resursion stop at leaf level.\n\tif (a.height === 0)\n\t{\n\t\tif (a.table.length < M)\n\t\t{\n\t\t\tvar newA = {\n\t\t\t\tctor: '_Array',\n\t\t\t\theight: 0,\n\t\t\t\ttable: a.table.slice()\n\t\t\t};\n\t\t\tnewA.table.push(item);\n\t\t\treturn newA;\n\t\t}\n\t\telse\n\t\t{\n\t\t return null;\n\t\t}\n\t}\n\n\t// Recursively push\n\tvar pushed = push_(item, botRight(a));\n\n\t// There was space in the bottom right tree, so the slot will\n\t// be updated.\n\tif (pushed !== null)\n\t{\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table[newA.table.length - 1] = pushed;\n\t\tnewA.lengths[newA.lengths.length - 1]++;\n\t\treturn newA;\n\t}\n\n\t// When there was no space left, check if there is space left\n\t// for a new slot with a tree which contains only the item\n\t// at the bottom.\n\tif (a.table.length < M)\n\t{\n\t\tvar newSlot = create(item, a.height - 1);\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table.push(newSlot);\n\t\tnewA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));\n\t\treturn newA;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "c1678c0ae641774125abd8d4ac5e46ef", "score": "0.4594128", "text": "function push_(item, a)\n{\n\t// Handle resursion stop at leaf level.\n\tif (a.height === 0)\n\t{\n\t\tif (a.table.length < M)\n\t\t{\n\t\t\tvar newA = {\n\t\t\t\tctor: '_Array',\n\t\t\t\theight: 0,\n\t\t\t\ttable: a.table.slice()\n\t\t\t};\n\t\t\tnewA.table.push(item);\n\t\t\treturn newA;\n\t\t}\n\t\telse\n\t\t{\n\t\t return null;\n\t\t}\n\t}\n\n\t// Recursively push\n\tvar pushed = push_(item, botRight(a));\n\n\t// There was space in the bottom right tree, so the slot will\n\t// be updated.\n\tif (pushed !== null)\n\t{\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table[newA.table.length - 1] = pushed;\n\t\tnewA.lengths[newA.lengths.length - 1]++;\n\t\treturn newA;\n\t}\n\n\t// When there was no space left, check if there is space left\n\t// for a new slot with a tree which contains only the item\n\t// at the bottom.\n\tif (a.table.length < M)\n\t{\n\t\tvar newSlot = create(item, a.height - 1);\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table.push(newSlot);\n\t\tnewA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));\n\t\treturn newA;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "c1678c0ae641774125abd8d4ac5e46ef", "score": "0.4594128", "text": "function push_(item, a)\n{\n\t// Handle resursion stop at leaf level.\n\tif (a.height === 0)\n\t{\n\t\tif (a.table.length < M)\n\t\t{\n\t\t\tvar newA = {\n\t\t\t\tctor: '_Array',\n\t\t\t\theight: 0,\n\t\t\t\ttable: a.table.slice()\n\t\t\t};\n\t\t\tnewA.table.push(item);\n\t\t\treturn newA;\n\t\t}\n\t\telse\n\t\t{\n\t\t return null;\n\t\t}\n\t}\n\n\t// Recursively push\n\tvar pushed = push_(item, botRight(a));\n\n\t// There was space in the bottom right tree, so the slot will\n\t// be updated.\n\tif (pushed !== null)\n\t{\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table[newA.table.length - 1] = pushed;\n\t\tnewA.lengths[newA.lengths.length - 1]++;\n\t\treturn newA;\n\t}\n\n\t// When there was no space left, check if there is space left\n\t// for a new slot with a tree which contains only the item\n\t// at the bottom.\n\tif (a.table.length < M)\n\t{\n\t\tvar newSlot = create(item, a.height - 1);\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table.push(newSlot);\n\t\tnewA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));\n\t\treturn newA;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "c1678c0ae641774125abd8d4ac5e46ef", "score": "0.4594128", "text": "function push_(item, a)\n{\n\t// Handle resursion stop at leaf level.\n\tif (a.height === 0)\n\t{\n\t\tif (a.table.length < M)\n\t\t{\n\t\t\tvar newA = {\n\t\t\t\tctor: '_Array',\n\t\t\t\theight: 0,\n\t\t\t\ttable: a.table.slice()\n\t\t\t};\n\t\t\tnewA.table.push(item);\n\t\t\treturn newA;\n\t\t}\n\t\telse\n\t\t{\n\t\t return null;\n\t\t}\n\t}\n\n\t// Recursively push\n\tvar pushed = push_(item, botRight(a));\n\n\t// There was space in the bottom right tree, so the slot will\n\t// be updated.\n\tif (pushed !== null)\n\t{\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table[newA.table.length - 1] = pushed;\n\t\tnewA.lengths[newA.lengths.length - 1]++;\n\t\treturn newA;\n\t}\n\n\t// When there was no space left, check if there is space left\n\t// for a new slot with a tree which contains only the item\n\t// at the bottom.\n\tif (a.table.length < M)\n\t{\n\t\tvar newSlot = create(item, a.height - 1);\n\t\tvar newA = nodeCopy(a);\n\t\tnewA.table.push(newSlot);\n\t\tnewA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));\n\t\treturn newA;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "e3fcf3a7fb5ce9c2c4cb66ad47da0807", "score": "0.45781237", "text": "get _tree() { return document.getElementById(\"substitutionListTree\"); }", "title": "" }, { "docid": "b87763faf4d00b4fb3d4b413608edbd1", "score": "0.45741346", "text": "mapTheBranchUp(id, arr) {\n arr.push(id);\n let node = this.findNode(id);\n if (node.getparentID == 0) {\n arr.push(0, node.getparentID());\n return arr;\n } else {\n arr.push(node.getparentID());\n return arr;\n }\n }", "title": "" }, { "docid": "e97c22c44147f03f02323f09a7026ab1", "score": "0.45714685", "text": "function tree(d, i) {\n var nodes = hierarchy.call(this, d, i),\n t = nodes[0],\n wt = wrapTree(t);\n\n wroot = wt;\n zerothWalk(wt, 0);\n firstWalk(wt);\n secondWalk(wt, 0);\n renormalize(wt);\n\n return nodes;\n }", "title": "" }, { "docid": "418b65c22831db3fc05b7e42209a79c9", "score": "0.45642173", "text": "function toTree(arr, low, high) {\n\t\tif (low >= high) {\n\t\t\treturn undefined;\n\t\t}\n\t\tvar mid = Math.floor((high + low) / 2);\n\t\treturn {\n\t\t\tel: arr[mid],\n\t\t\tright: toTree(arr, mid + 1, high),\n\t\t\tleft: toTree(arr, low, mid)\n\t\t};\n\t}", "title": "" }, { "docid": "8a8b7a9fc8e9b6deb674722613e895c8", "score": "0.45626256", "text": "function queryOneDTree(v, vleft, vright, from, to, N, fn, t) {\n if (to < vleft || vright < from){\n return N;\n }\n if (vleft >= from && vright <= to){\n return t[v];\n }\n let vmiddle = Math.floor(vleft + (vright - vleft) / 2);\n let ql = queryOneDTree(2 * v, vleft, vmiddle, from, to, N, fn, t);\n let qr = queryOneDTree(2 * v + 1, vmiddle + 1, vright, from, to, N, fn, t);\n let res = fn(ql, qr);\n return fn(N, res);\n}", "title": "" }, { "docid": "cd989929caab3cdb527d219c95c5d4c2", "score": "0.45496154", "text": "function GetNode(tree) {\n return $(tree).closest('li');\n}", "title": "" }, { "docid": "10ccb8f24a44d7d0cdb03ddd9b41e947", "score": "0.45483947", "text": "function ArrayTree() {\n this.memory = {};\n }", "title": "" }, { "docid": "acf471c7ab588ebec769de2f27faa170", "score": "0.4544037", "text": "function push_(item, a)\n\t{\n\t\t// Handle resursion stop at leaf level.\n\t\tif (a.height === 0)\n\t\t{\n\t\t\tif (a.table.length < M)\n\t\t\t{\n\t\t\t\tvar newA = {\n\t\t\t\t\tctor: '_Array',\n\t\t\t\t\theight: 0,\n\t\t\t\t\ttable: a.table.slice()\n\t\t\t\t};\n\t\t\t\tnewA.table.push(item);\n\t\t\t\treturn newA;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t return null;\n\t\t\t}\n\t\t}\n\n\t\t// Recursively push\n\t\tvar pushed = push_(item, botRight(a));\n\n\t\t// There was space in the bottom right tree, so the slot will\n\t\t// be updated.\n\t\tif (pushed !== null)\n\t\t{\n\t\t\tvar newA = nodeCopy(a);\n\t\t\tnewA.table[newA.table.length - 1] = pushed;\n\t\t\tnewA.lengths[newA.lengths.length - 1]++;\n\t\t\treturn newA;\n\t\t}\n\n\t\t// When there was no space left, check if there is space left\n\t\t// for a new slot with a tree which contains only the item\n\t\t// at the bottom.\n\t\tif (a.table.length < M)\n\t\t{\n\t\t\tvar newSlot = create(item, a.height - 1);\n\t\t\tvar newA = nodeCopy(a);\n\t\t\tnewA.table.push(newSlot);\n\t\t\tnewA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot));\n\t\t\treturn newA;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "title": "" }, { "docid": "218490429ab6ff9c88d3d8e6c93cab96", "score": "0.4540707", "text": "function getTree(taxa, where) {\n document.getElementById(\"loading\").innerHTML = \"Now fetching tree\";\n var xmlhttpTree = new XMLHttpRequest();\n xmlhttpTree.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"loading\").innerHTML = \"\";\n var myObj = JSON.parse(this.responseText);\n //document.getElementById(\"newick\").innerHTML = myObj.newick;\n var tree = d3.layout.phylotree()\n // create a tree layout object\n .svg(d3.select(where));\n // render to this SVG element\n tree(myObj.newick)\n // parse the Newick into a d3 hierarchy object with additional fields\n .layout();\n tree.size([200,400]);\n // layout and render the tree\n // for syntax highlighting\n hljs.initHighlightingOnLoad();\n }\n };\n xmlhttpTree.open(\"GET\", \"https://phylo.cs.nmsu.edu/phylotastic_ws/gt/ot/get_tree?ottid=false&taxa=\" + taxa, true);\n xmlhttpTree.send();\n}", "title": "" }, { "docid": "a387d77befbe742884dd06eb7a23af2f", "score": "0.45374182", "text": "static lchild(index)\n {\n return 2 * index + 1;\n }", "title": "" }, { "docid": "406f06cd0f40edd4747c4dcbf8f4f9c1", "score": "0.45365465", "text": "function ProcTree()\n{\n var top = new Node();\n \n return top;\n}", "title": "" }, { "docid": "959767aa2d01f92219ec4f2960db36c7", "score": "0.45354548", "text": "parentValue(index) {\n return this.valueFor(this.parentIndex(index))\n }", "title": "" }, { "docid": "6353616bc73310da01b3a16e3524daef", "score": "0.45343885", "text": "searchTree(val, node, parent) {\n if (val === node.value) {\n return {\n target: node,\n parent\n };\n } else if (val < node.value && node.left) {\n return this.searchTree(val, node.left, node);\n } else if (val > node.value && node.right) {\n return this.searchTree(val, node.right, node);\n }\n\n return {\n target: null,\n parent: null\n };\n }", "title": "" }, { "docid": "6325c2246f97708ac44887252d30888b", "score": "0.45237952", "text": "get(index) {\n // First walk through the tree to get the root node for that index\n const chunkIndex = Math.floor(index / this.type.itemsPerChunk);\n const leafNode = this.tree.getNodeAtDepth(this.type.depth, chunkIndex);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.type.elementType.tree_getFromPackedNode(leafNode, index);\n }", "title": "" }, { "docid": "bfdaac180a6c8d088af21c4fedc5bfdb", "score": "0.4521771", "text": "get(index) {\n // TODO: Optimize without bitstring\n const gindex = persistent_merkle_tree_1.toGindexBitstring(this.type.depth, index);\n const subtree = this.tree.getSubtree(gindex);\n return this.type.elementType.getView(subtree);\n }", "title": "" }, { "docid": "ff11d61c809aaff9c4a51c25414a921b", "score": "0.45166337", "text": "function findLeaf(node,offset){if(offset===undef){offset=node.nodeType===3?node.length:node.childNodes.length;}while(node&&node.hasChildNodes()){node=node.childNodes[offset];if(node){offset=node.nodeType===3?node.length:node.childNodes.length;}}return{node:node,offset:offset};}// If index based start position then resolve it", "title": "" }, { "docid": "6147cffdc5c2acfe560c9a07aa870d8a", "score": "0.45145765", "text": "function addChildToParentArea(idArea, parent, idArbol)\n{\n var url = \"../../areas.do?method=getAreasByParent\",\n dinamicTree = \"\", branches = null;//expandable-hitarea\n $.post(url,\n {\n idArea: idArea\n }, function(data){\n if(data != \"error\")\n {\n $.each(data, function(key, data){\n dinamicTree = dinamicTree + \"<li class='closed' id=''><a id='\" + \n data.id_area + \"'>\" + data.area + \"</a><ul><li><a></a></li></ul><li>\";\n });\n branches = $(\"<ul class='add_\" + idArea + \"'>\" + dinamicTree + \"</ul>\").appendTo(parent);\n $(\"#\" + idArbol).treeview({\n add: branches\n });\n\n }\n else\n jAlert(\"Ha ocurrido un erro al obtener las areas.\", \"Error al obtener las areas\");\n }, \"json\");\n}", "title": "" }, { "docid": "67ee31c77efd6ed68b2ebf32897cff22", "score": "0.45142537", "text": "function createDirectoryTreeFrom(location, elemID, treeID, trackID, userID, dbRef) {\n\t\tif (!userID || !treeID || !elemID || !trackID) {\n\t\t\tconsole.log(\"Error:createDirectoryTreeFrom: Invalid Parameter(s)!\");\n\t\t\tconsole.log(\"userID: \" + userID, \" elemID: \" + elemID + \" treeID: \" + treeID + \" trackID: \" + trackID);\n\t\t\treturn;\n\t\t} else if (location[0] === \"/\") {\n\t\t\tconsole.log(\"Error:createDirectoryTreeFrom: Invalid location! (has forward slash prefix)\");\n\t\t\treturn;\n\t\t} else if ((location !== \"\") && (location[location.length - 1] !== \"/\")) {\n\t\t\tconsole.log(\"Error:createDirectoryTreeFrom: Invalid location! (missing forward slash suffix)\");\n\t\t\treturn;\n\t\t} else if (!dbRef) {\n\t\t\tif (!database) {\n\t\t\t\tconsole.log(\"Error:createDirectoryTreeFrom: Invalid firebase.database() reference!\");\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tdbRef = database;\n\t\t\t}\n\t\t}\n\t\tvar prevPath = currentDirectory;\n\n\t\t// console.log(\"Current Location: \" + location);\t// debug\n\n\t\t// populate the file\n\t\tdbRef.ref(\"/folder/\" + userID + \"/\" + location).once(\"value\").then(function (snapshot) {\n\t\t\tvar directoryContents = snapshot.val();\n\t\t\tvar directoryKeys = Object.keys(directoryContents);\n\t\t\tvar folderElements = \"\";\n\t\t\tvar locationArray = location.split(\"/\");\t// get an array showing the path taken via the location\n\t\t\tvar breadcrumbPaths = \"\";\n\t\t\tvar breadcrumbs = \"<li><a id='dirTreeHome' href='#' onclick='createDirectoryTreeFrom(\" + '\"\",\"' + elemID + '\",\"' + treeID + '\",\"' + trackID + '\",\"' + userID + '\"' + \")'>Home</a></li>\";\n\n\t\t\t// console.log(\"directoryKeys: \" + directoryKeys + \" (\" + directoryKeys.length + \")\");\t// debug\n\n\t\t\t// insert path history breadcrumbs into the directory history path tracker\n\t\t\tfor (var k = 0; k < locationArray.length; k++) {\n\t\t\t\tif (k === locationArray.length - 1) {\t// if this is the last element (i.e. a \"\" string from the \".split()\"), we're done; place all UI breadcrumbs to the directory path tracker\n\t\t\t\t\tinsertIntoElement(\"moveFilePathTracker\", breadcrumbs);\n\t\t\t\t} else {\n\t\t\t\t\t// otherwise, continue compiling breadcrumb html\n\t\t\t\t\tbreadcrumbPaths += locationArray[k] + \"/\";\n\t\t\t\t\tconsole.log(\"breadcrumbPaths: \" + breadcrumbPaths);\n\t\t\t\t\tbreadcrumbs += \"\\\n\t\t\t\t\t<li><a id='dirTreeHist\" + k + \"' href='#' onclick='createDirectoryTreeFrom(\" + '\"' + breadcrumbPaths + '\",\"' + elemID + '\",\"' + treeID + '\",\"' + trackID + '\",\"' + userID + '\"' + \")'>\\\n\t\t\t\t\t\t\" + bacpacDecode(locationArray[k]) +\"\\\n\t\t\t\t\t</a></li>\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// insert folder selection elements into the directory tree\n\t\t\tvar emptyDirSign = \"<h1 style='text-align: center;'>This directory is empty!</h1>\";\n\t\t\tvar noFoldersSign = \"<h1 style='text-align: center;'>This directory has no folders!</h1>\";\n\t\t\tfor (var i = 0; i < directoryKeys.length; i++) {\n\t\t\t\tswitch (directoryKeys[i]) {\n\t\t\t\t\tcase \"0\": {\n\t\t\t\t\t\tif (directoryKeys.length <= 1) {\t// if the dir is empty (i.e. only contains the {0:0} entry)\n\t\t\t\t\t\t\tconsole.log(\"Alert:createDirectoryTreeFrom: Directory is empty!\");\t// debug\n\t\t\t\t\t\t\tvar addHereElement = \"<button class='btn btn-primary fileMoveDst' onclick='moveFile(\" + '\"' + elemID + '\",\"' + location + '\",\"' + prevPath + '\",\"' + userID + '\"' + \")'><span class='glyphicon glyphicon-plus'></span>Move Here</button>\";\n\t\t\t\t\t\t\tinsertIntoElement(treeID, addHereElement + emptyDirSign);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\t\t\t\t\t\t// console.log(\"looping: \" + directoryKeys[i]);\t// debug\n\t\t\t\t\t\tdistinguishEntity(directoryKeys[i], dbRef, userID, function (entityType, returnedkey) {\n\t\t\t\t\t\t\tswitch (entityType) {\n\t\t\t\t\t\t\t\tcase \"folder\": {\n\t\t\t\t\t\t\t\t\tvar addHereElement = \"<button class='btn btn-primary fileMoveDst' onclick='moveFile(\" + '\"' + elemID +'\",\"' + location + '\",\"' + prevPath + '\",\"' + userID + '\"' + \")'><span class='glyphicon glyphicon-plus'></span>Move Here</button>\";\n\n\t\t\t\t\t\t\t\t\tfolderElements += \"\\\n\t\t\t\t\t\t\t\t\t<button id='dirTreeElem\" + i + \"' class='btn btn-default fileMoveDst' onclick='createDirectoryTreeFrom(\" + '\"' + location + returnedkey + \"/\" + '\",\"' + elemID + '\",\"' + treeID + '\",\"' + trackID + '\",\"' + userID + '\"' + \")'><span class='glyphicon glyphicon-folder-open' style='padding-right:10px'></span>\" + bacpacDecode(returnedkey) + \"\\\n\t\t\t\t\t\t\t\t\t</button>\";\n\n\t\t\t\t\t\t\t\t\tconsole.log(\"Alert:createDirectoryTreeFrom: Inserting into directory tree...\");\n\t\t\t\t\t\t\t\t\tinsertIntoElement(treeID, addHereElement + folderElements);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdefault: {\n\t\t\t\t\t\t\t\t\t// console.log(\"Skipping entity '\" + entityType + \"'...\");\t// debug\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar addHereElement = \"<button class='btn btn-primary fileMoveDst' onclick='moveFile(\" + '\"' + elemID +'\",\"' + location + '\",\"' + prevPath + '\",\"' + userID + '\"' + \")'><span class='glyphicon glyphicon-plus'></span>Move Here</button>\";\n\n\t\t\t\t\t\t\t\t\t// if this is the last element, and the folderElements view is still empty, this file probably isn't empty, but doesn't have any folders in it...\n\t\t\t\t\t\t\t\t\tif (folderElements.length === 0) {\n\t\t\t\t\t\t\t\t\t\tinsertIntoElement(treeID, addHereElement + noFoldersSign);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\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\t// console.log(locationArray);\t// debug\n\t\t\t// console.log(locationArray.length);\t// debug\n\t\t});\n\t}", "title": "" }, { "docid": "1c8f0446ea6904e25cfbf743b9212ef1", "score": "0.45127207", "text": "insert(value){\n var newNode = new Tree(value);\n this.children.push(newNode);\n return newNode;\n }", "title": "" }, { "docid": "2a823b1cef248478c3485e9b12610671", "score": "0.45014468", "text": "static getRootOfSubtreeEnclosingRegion(t, startTokenIndex, // inclusive\n stopTokenIndex) {\n let n = t.childCount;\n for (let i = 0; i < n; i++) {\n let child = t.getChild(i);\n let r = Trees.getRootOfSubtreeEnclosingRegion(child, startTokenIndex, stopTokenIndex);\n if (r) {\n return r;\n }\n }\n if (t instanceof ParserRuleContext_1.ParserRuleContext) {\n let stopToken = t.stop;\n if (startTokenIndex >= t.start.tokenIndex && // is range fully contained in t?\n (stopToken == null || stopTokenIndex <= stopToken.tokenIndex)) {\n // note: r.stop==null likely implies that we bailed out of parser and there's nothing to the right\n return t;\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "ff222d550f4614862956a3c652590393", "score": "0.4495483", "text": "function createBinarySearchTree(arr, idx) {\n let root = new Node(arr[idx++]);\n for (let i = idx; i < arr.length; i++) {\n insert(root, arr[i]);\n }\n return root;\n}", "title": "" }, { "docid": "ccaca4452617f9f3ab4064b64e544cda", "score": "0.44867805", "text": "function addChildToTree(origId, id, treeOb) {\n if (id.length == 1) {\n console.log(id);\n for (var i = 0; i < treeOb.length; i++) {\n if (treeOb[i].id.charAt(treeOb[i].id.length - 1) === id.charAt(0)) {\n var t1 = treeOb[i][\"Children\"];\n var numToAdd = getNumToAdd(treeOb[i][\"Children\"]);\n t1.push(getChildToAddToTree(id, numToAdd));\n console.log(\"origid: \" + origId);\n $(\"#treePath\" + origId).append(getSubQuestionStringGivenId(origId + numToAdd));\n break;\n }\n }\n } else {\n //console.log(id.substring(0,1));\n for (var i = 0; i < treeOb.length; i++) {\n if (treeOb[i].id.charAt(treeOb[i].id.length - 1) === id.charAt(0)) {\n addChildToTree(origId, id.substring(1, id.length), treeOb[i][\"Children\"]);\n }\n }\n\n }\n}", "title": "" }, { "docid": "4d58732b31e63ab132eaa374cefb360b", "score": "0.44831908", "text": "function parent(index) {\n return Math.floor((index-1)/2);\n}", "title": "" }, { "docid": "f88d71dae3f62cb01e1488a7a779e34f", "score": "0.4480564", "text": "function buildTree(tuple) {\n\n var node = new TreeNode(tuple[0]);\n\n for (var i = 1; i < tuple.length; i++) {\n var child = buildTree(tuple[i]);\n child.parent = node;\n child.number = i - 1;\n node.children.push(child);\n }\n\n return node;\n\n }", "title": "" }, { "docid": "536f16c4c9ee75bb5d6bdcfe058b6079", "score": "0.44565234", "text": "getNode(i, side) {\n return 2 * i + side; \n }", "title": "" }, { "docid": "be73c2610ee11c8ab14dcf764a87d13b", "score": "0.44505188", "text": "function newQuadTree(QuadTreeNode){\n var tree = document.createElement('div');\n tree.id = quadTreeId;\n \n root = new QuadTreeNode();\n \n tree.resize = function(w, h){\n root.resize({ left: 0, top: 0, width: w, height: h });\n };\n \n tree.reveal = function(clipRect){\n var rootRect = { left: 0, top: 0,\n width: parseInt(this.style.width, 10),\n height: parseInt(this.style.height, 10)\n };\n root.clipRect = clipRect;\n root.resize(rootRect);\n root.reveal(this, clipRect);\n for (var tile_id in could_not_remove) {\n if (could_not_remove.hasOwnProperty(tile_id)) {\n var node = could_not_remove[tile_id];\n node.tryToRemoveIfHidden();\n }\n }\n };\n \n tree.notifyHiding = function(){\n this.cancelAllRequests();\n };\n \n tree.cancelAllRequests = function(){\n root.cancelAllRequests();\n };\n \n return tree;\n }", "title": "" }, { "docid": "3855ae7e68e9715d4e497a26bf10e7ba", "score": "0.44468424", "text": "get_parent_world( b_idx, pt=null, ct=null, t_offset=null ){\r\n\t\tlet cbone = this.bones[ b_idx ];\r\n\t\tpt = pt || new Transform();\r\n\r\n\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\t\t// Child is a Root Bone, just reset since there is no parent.\r\n\t\tif( cbone.p_idx == null ){ \r\n\t\t\tpt.clear();\r\n\t\t}else{\r\n\t\t\t// Parents Exist, loop till reaching the root\r\n\t\t\tlet b = this.bones[ cbone.p_idx ];\r\n\t\t\tpt.copy( b.local );\r\n\r\n\t\t\twhile( b.p_idx != null ){\r\n\t\t\t\tb = this.bones[ b.p_idx ];\r\n\t\t\t\tpt.add_rev( b.local );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\t\t\r\n\t\tpt.add_rev( this.root_offset );\t\t\t\t// Add Starting Offset\r\n\t\tif( t_offset ) pt.add_rev( t_offset );\t\t// Add Additional Starting Offset\r\n\r\n\t\tif( ct ) ct.from_add( pt, cbone.local );\t// Requesting Child WS Info Too\r\n\r\n\t\treturn pt;\r\n\t}", "title": "" }, { "docid": "601cc76ba96f744f465bc5bc4bc4694c", "score": "0.44426146", "text": "findTheBranchOfSelected(id) {\n let chosenNode;\n let branch = [];\n let resultDown = [];\n var arr = [];\n var resultUp = [];\n\n for (let node of this.nodes) {\n if (node.getID() == id) {\n chosenNode = node;\n }\n }\n if (this.lookForChilds(id)) {\n branch = this.getChilds(id);\n for (let element of branch) {\n resultDown = this.mapTheBranchDown(element.getID(), arr);\n }\n }\n var wholeBranch = [];\n if (chosenNode.getparentID() == 0) {\n resultUp.push(0, chosenNode.getID());\n wholeBranch = resultUp.concat(resultDown);\n } else {\n resultUp.push(chosenNode.getID());\n resultUp.push(this.mapTheBranchUp(chosenNode.getparentID(), resultUp));\n }\n\n if (wholeBranch) return (wholeBranch = resultUp.concat(resultDown));\n else return resultDown;\n }", "title": "" }, { "docid": "1ac4bb5e1aeabca26be16cbd919ad2e0", "score": "0.4437188", "text": "function nodes(quadtree) {\n var nodes = [];\n quadtree.visit(function(node, x1, y1, x2, y2) {\n nodes.push({x: x1, y: y1, width: x2 - x1, height: y2 - y1});\n });\n return nodes;\n}", "title": "" }, { "docid": "66368498b5bf38e527ef0c8a30e07faa", "score": "0.44370556", "text": "serializeTree() {\n let nodes = [];\n let root = { node: this.root, parent: -1 };\n // Array based queues are very slow at high lengths. A very naive linked list based one is far faster for large scenes.\n let qq = new Queue();\n qq.enqueue(root);\n while (qq.hasElements()) {\n root = qq.dequeue();\n let parent = nodes.length;\n nodes.push(root);\n if (!root.node.leaf) {\n qq.enqueue({ node: root.node.left, parent });\n qq.enqueue({ node: root.node.right, parent });\n }\n }\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (node.parent >= 0) {\n const parent = nodes[node.parent];\n // If i is odd, then it's the left node. left/right nodes are always pushed on the queue together.\n if (i % 2 === 1) {\n parent.left = i;\n } else {\n parent.right = i;\n }\n }\n }\n return nodes;\n }", "title": "" }, { "docid": "0314bd272a03ab76931b5a6918876ba4", "score": "0.4431148", "text": "getSubtree() {\n return this.getChildren().reduce(\n (prev, cur) => prev.concat(cur.getSubtree()), [this]\n )\n }", "title": "" }, { "docid": "08c9bbc1801c0e26889947ec109d4fbd", "score": "0.44228706", "text": "function push(item, a)\n{\n\tvar pushed = push_(item, a);\n\tif (pushed !== null)\n\t{\n\t\treturn pushed;\n\t}\n\n\tvar newTree = create(item, a.height);\n\treturn siblise(a, newTree);\n}", "title": "" }, { "docid": "08c9bbc1801c0e26889947ec109d4fbd", "score": "0.44228706", "text": "function push(item, a)\n{\n\tvar pushed = push_(item, a);\n\tif (pushed !== null)\n\t{\n\t\treturn pushed;\n\t}\n\n\tvar newTree = create(item, a.height);\n\treturn siblise(a, newTree);\n}", "title": "" }, { "docid": "08c9bbc1801c0e26889947ec109d4fbd", "score": "0.44228706", "text": "function push(item, a)\n{\n\tvar pushed = push_(item, a);\n\tif (pushed !== null)\n\t{\n\t\treturn pushed;\n\t}\n\n\tvar newTree = create(item, a.height);\n\treturn siblise(a, newTree);\n}", "title": "" }, { "docid": "08c9bbc1801c0e26889947ec109d4fbd", "score": "0.44228706", "text": "function push(item, a)\n{\n\tvar pushed = push_(item, a);\n\tif (pushed !== null)\n\t{\n\t\treturn pushed;\n\t}\n\n\tvar newTree = create(item, a.height);\n\treturn siblise(a, newTree);\n}", "title": "" }, { "docid": "08c9bbc1801c0e26889947ec109d4fbd", "score": "0.44228706", "text": "function push(item, a)\n{\n\tvar pushed = push_(item, a);\n\tif (pushed !== null)\n\t{\n\t\treturn pushed;\n\t}\n\n\tvar newTree = create(item, a.height);\n\treturn siblise(a, newTree);\n}", "title": "" }, { "docid": "08c9bbc1801c0e26889947ec109d4fbd", "score": "0.44228706", "text": "function push(item, a)\n{\n\tvar pushed = push_(item, a);\n\tif (pushed !== null)\n\t{\n\t\treturn pushed;\n\t}\n\n\tvar newTree = create(item, a.height);\n\treturn siblise(a, newTree);\n}", "title": "" }, { "docid": "b590463b6a1b99f1952391ebde3b4ebf", "score": "0.44179282", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right)\n }", "title": "" }, { "docid": "a39f4c25dac081734e737576d0d567a4", "score": "0.4412028", "text": "function genericTree() {\n var root;\n\n function insertNode(node) {\n if(!root) {\n root = node;\n return;\n }\n\n var inserted = false;\n var queue = [];\n var current = root;\n\n while(!inserted) {\n for(let i = 0; i < 4; i++) {\n if(!current.children[i]) {\n current.children[i] = node;\n inserted = true;\n break;\n } else {\n queue.push(current.children[i]);\n }\n }\n\n current = queue.shift();\n }\n }\n\n function traverse(current, callback) {\n var array = [];\n\n function treeTraversal(currentNode) {\n if(currentNode) {\n array.push(currentNode.val);\n\n if(currentNode.children && currentNode.children.length > 0) {\n for(let i = 0; i < currentNode.children.length; i++) {\n treeTraversal(currentNode.children[i]);\n }\n }\n }\n }\n\n treeTraversal(current);\n\n if(callback) {\n return callback(array);\n } else {\n return array;\n }\n // console.log('----------')\n // console.log(array);\n // console.log('----------')\n }\n\n function getCount(arrayOfNodes) {\n var length = arrayOfNodes.length;\n return length;\n }\n\n function find(value, callback) {\n var found = false;\n var current = root;\n var parent = null;\n var queue = [];\n\n while(!found && current) {\n if(current.val === value) {\n found = current;\n } else {\n for(let i = 0; i < 4; i++) {\n if(current.children[i]) {\n if(current.children[i].val === value) {\n found = current.children[i];\n parent = current;\n } else {\n queue.push(current.children[i]);\n }\n }\n }\n current = queue.shift();\n }\n }\n\n if(callback) {\n return { node: found, parent: parent };\n } else {\n return found;\n }\n }\n\n function remove(value) {\n var foundNodeAndParent = find(value, true);\n var node = foundNodeAndParent.node;\n var parent = foundNodeAndParent.parent;\n\n if(!node) {\n return false;\n }\n\n var queueOfOrphans = [];\n\n for(let i = 0; i < 4; i++) {\n if(node.children[i]) {\n queueOfOrphans.push(node.children[i]);\n }\n }\n\n if(parent) {\n var indexOfNode = parent.children.indexOf(node);\n parent.children[indexOfNode] = null;\n } else {\n root = null;\n }\n\n while(queueOfOrphans.length > 0) {\n var orphan = queueOfOrphans.shift();\n insertNode(orphan);\n }\n }\n\n return {\n insert: function(value) {\n var newNode = new TreeNode(value);\n insertNode(newNode);\n },\n delete: function(value) {\n var deleted = remove(value);\n return deleted ? true : false;\n },\n contains: function(value) {\n var found = find(value, null);\n return found ? true : false;\n },\n size: function() {\n var nodes = traverse(root, getCount);\n return nodes;\n },\n getRootVal: function() {\n return root.val;\n }\n }\n}", "title": "" }, { "docid": "bf8bc22dcb9e969345379cb853c8c857", "score": "0.4411677", "text": "generateTree() {\n return [\n {\n name: `${this.integralConstant >= 0 ? '4 (Opcode +)' : '5 (Opcode -)'}`,\n children: [\n {\n name: '17 (Opcode Ternary)',\n children: [\n {\n name: '14 (Opcode >=)',\n children: [\n {\n name: '1 (Opcode Variable)',\n },\n {\n name: '0 (Opcode Constant)',\n children: [\n {\n name: `${this.maximumTotalSupply} (Value)`,\n },\n ],\n },\n ],\n },\n ],\n },\n {\n name: '0 (Opcode Constant)',\n children: [\n {\n name: `${Math.abs(this.integralConstant) *\n this.tenExpEighteen} (Value)`,\n },\n ],\n },\n ],\n },\n ]\n }", "title": "" }, { "docid": "9c16f820d7aa6c951e0d259110c47c9e", "score": "0.44064394", "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.44064394", "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": "8a6924d96747229df08bbb33cbb46ac3", "score": "0.4404903", "text": "treeTop (r) {\n if (r < P.tree) return T.tree_top_middle\n return T.air\n }", "title": "" }, { "docid": "c2dcd6e7879a2a27a71cde55e8401fb8", "score": "0.44002926", "text": "buildTree() {\n \t\tlet newGame = this.simpleCopy();\n \t\tlet currNode = this.tree;\n \t\twhile (currNode.children.length > 0) {\n \t\t\tcurrNode = currNode.getBestSearchChild();\n \t\t\tnewGame.addMove(currNode.newMove, currNode.player, true);\n \t\t}\n \t\tif (newGame.gameStatus === 0) {\n \t\t\tlet availableMoves = newGame.getAvailableMoves();\n \t\t\tfor (let i = 0; i < availableMoves.length; ++i) {\n \t\t\t\tlet newNode = new TreeNode(availableMoves[i], currNode.player === null ? 1 : 3 - currNode.player, currNode);\n \t\t\t\tcurrNode.children.push(newNode);\n \t\t\t}\n \t\t\tlet randomNode = currNode.children[Math.floor(Math.random() * currNode.children.length)];\n \t\t\tnewGame.addMove(randomNode.newMove, randomNode.player, true);\n \t\t\twhile (newGame.gameStatus === 0) {\n \t\t\t\tavailableMoves = newGame.getAvailableMoves();\n \t\t\t\tlet randomMove = availableMoves[Math.floor(Math.random() * availableMoves.length)];\n \t\t\t\tnewGame.addMove(randomMove, 3 - newGame.board[newGame.lastMove], true);\n \t\t\t}\n \t\t\trandomNode.backpropagate(newGame.gameStatus);\n \t\t} else {\n \t\t\tcurrNode.backpropagate(newGame.gameStatus);\n \t\t}\n \t}", "title": "" }, { "docid": "c78c5f842fdfbd3fef956be561ea03b4", "score": "0.43978414", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right)\n}", "title": "" }, { "docid": "91ba0a11e08f6fca7a38a1f1af40550c", "score": "0.43966487", "text": "function refresh_tree(pt,st,tr,sid){\n var x0 = root.x0;\n var y0 = root.y0;\n root = phylo_table_to_viz_tree(pt,true);\n root = sample_table_join_viz_tree(st,root,tr,sid,true); //could select right here...\n root.x0 = x0;\n root.y0 = y0;\n function collapse(d) {\n if (d.children) {\n d._children = d.children;\n d._children.forEach(collapse);\n d.children = null;\n }\n }\n //root.children.forEach(collapse); //collapse the children\n update(root);\n }", "title": "" }, { "docid": "e44c5caba009427ae64525e2fba61515", "score": "0.43965822", "text": "static rchild(index)\n {\n return 2 * index + 2;\n }", "title": "" }, { "docid": "604a90ba8549f7d748590969535242ec", "score": "0.4389505", "text": "function launchTreeWalk1(){\n console.log(root);\n}", "title": "" }, { "docid": "d23a301a590df4ca9db96da095bea478", "score": "0.4380766", "text": "_parent(i) {\n return this._storage[this._getParentIndex(i)];\n }", "title": "" }, { "docid": "dad64bb9561d24ef999b2bcf5f95aa6d", "score": "0.43761188", "text": "function pathToTree(path, numStemmed) {\n var root;\n var leaf;\n\n for (var i = numStemmed, len = path.length; i < len; i++) {\n var node = path[i];\n var currentLeaf = [node.id, node.opts, []];\n\n if (leaf) {\n leaf[2].push(currentLeaf);\n leaf = currentLeaf;\n } else {\n root = leaf = currentLeaf;\n }\n }\n\n return root;\n} // compare the IDs of two trees", "title": "" }, { "docid": "dad64bb9561d24ef999b2bcf5f95aa6d", "score": "0.43761188", "text": "function pathToTree(path, numStemmed) {\n var root;\n var leaf;\n\n for (var i = numStemmed, len = path.length; i < len; i++) {\n var node = path[i];\n var currentLeaf = [node.id, node.opts, []];\n\n if (leaf) {\n leaf[2].push(currentLeaf);\n leaf = currentLeaf;\n } else {\n root = leaf = currentLeaf;\n }\n }\n\n return root;\n} // compare the IDs of two trees", "title": "" }, { "docid": "2a5913575112e3464d52d8eb9bfcc7b0", "score": "0.43739", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n}", "title": "" }, { "docid": "59ba096cd2795dd8411a928c31565166", "score": "0.43720436", "text": "function AVLTree() {\t\n\tthis.root = null;\n\tthis.count = 0;\n}", "title": "" }, { "docid": "ca2445d3c1ad674e1910fa9c2209aebe", "score": "0.43674955", "text": "function Trees() {} // Print out a whole tree in LISP form. {@link //getNodeText} is used on the", "title": "" }, { "docid": "d60cea667e9ed0fe24d2194f5f771180", "score": "0.43617797", "text": "position(node) {}", "title": "" }, { "docid": "5a919a4a232c0c678d79647197ab81d0", "score": "0.43606943", "text": "function getLocation(){\n var initialx = initialSelection.data('positionx');\n var initialy = initialSelection.data('positiony');\n\n var targetx = targetSelection.data('positionx');\n var targety = targetSelection.data('positiony');\n\n var vector =[];\n\n vector.push(targetx-initialx);\n vector.push(targety-initialy);\n\n return vector;\n }//end getLocation", "title": "" }, { "docid": "ee8c6a97cc03dbaf8e557b1b1515e0d8", "score": "0.43590835", "text": "function KdTree(nodes, northSouth) {\n if (nodes == null || nodes.length == 0) {\n // This is an empty tree.\n this.northSouth = false;\n this.position = null;\n this.search = function(positionToFind) {\n return null;\n }\n\n return;\n }\n\n this.northSouth = northSouth !== true;\n\n if (this.northSouth === true) {\n nodes.sort(function(a,b) { return a[1] - b[1]; });\n } else {\n nodes.sort(function(a,b) { return a[0] - b[0]; });\n }\n\n var middleIndex = Math.floor(nodes.length / 2);\n this.position = nodes[middleIndex].slice(0, 2);\n if (nodes[middleIndex].length > 2)\n this.payload = nodes[middleIndex][2];\n\n if (middleIndex > 0)\n this.childA = new KdTree(nodes.slice(0, middleIndex), this.northSouth);\n else\n this.childA = null;\n\n if (middleIndex < nodes.length - 1)\n this.childB = new KdTree(nodes.slice(middleIndex + 1), this.northSouth);\n else\n this.childB = null;\n\n // Meat, potatoes.\n this.search = function(positionToFind) {\n if (!(positionToFind instanceof Array) || positionToFind.length != 2) {\n throw 'This method takes a single parameter: an Array with two elements';\n }\n\n if (this.northSouth) {\n var firstChild = (positionToFind[1] < this.position[1]) ? this.childA : this.childB;\n var distanceToAxis = this.position[1] - positionToFind[1];\n } else {\n var firstChild = (positionToFind[0] < this.position[0]) ? this.childA : this.childB;\n var distanceToAxis = this.position[0] - positionToFind[0];\n }\n var otherChild = (firstChild === this.childA) ? this.childB : this.childA;\n\n if (firstChild === null) {\n var closest = this;\n var closestDistance = closest.squaredDistance(positionToFind);\n } else {\n var closest = firstChild.search(positionToFind);\n var closestDistance = closest.squaredDistance(positionToFind, this.position);\n var thisDistance = this.squaredDistance(positionToFind);\n if (closestDistance > thisDistance) {\n var closest = this;\n var closestDistance = thisDistance;\n }\n }\n\n if (distanceToAxis * distanceToAxis < closestDistance &&\n otherChild !== null) {\n var altClosest = otherChild.search(positionToFind);\n var altClosestDistance = altClosest.squaredDistance(positionToFind);\n if (altClosestDistance < closestDistance)\n return altClosest;\n }\n\n return closest;\n }\n\n // Squared distance is cheaper to calculate. Used for comparing distances.\n this.squaredDistance = function(aPosition) {\n if (!(aPosition instanceof Array) || aPosition.length != 2) {\n throw 'This method takes a single parameter: an Array with two elements';\n }\n\n var dx = this.position[0] - aPosition[0];\n var dy = this.position[1] - aPosition[1];\n return dx * dx + dy * dy;\n }\n\n this.distance = function(aPosition) {\n if (!(aPosition instanceof Array) || aPosition.length != 2) {\n throw 'This method takes a single parameter: an Array with two elements';\n }\n\n return Math.sqrt(this.squaredDistance(aPosition));\n }\n\n this.size = function() {\n return (this.childA == null ? 0 : this.childA.size()) +\n (this.childB == null ? 0 : this.childB.size()) + 1;\n }\n}", "title": "" }, { "docid": "9df3d6f9633245250ae06db3fc2b5792", "score": "0.43589312", "text": "function skillTree() {\n let teir1,teir2,teir3,teir4,teir5,teir6;\n let pacifist=[];\n let neutral=[];\n let anarchist=[];\n fill(0);\n rect(0,0,width,height);\n}", "title": "" }, { "docid": "95fa6200e2e2aeb72980958bde9cdb0d", "score": "0.43558487", "text": "function getCommonTreeOld(taxa, where) {\n document.getElementById(\"loading\").innerHTML = \"Now fetching tree\";\n var commonTree = $.post(\"https://phylo.cs.nmsu.edu/phylotastic_ws/cp/gt/tree\",\n {list: taxa, list_type: \"scientific\"},\n commonTree.onreadystatechange = function() {\n alert(\"success\")\n document.getElementById(\"loading\").innerHTML = \"\";\n var myObj = JSON.parse(this.responseText);\n //document.getElementById(\"newick\").innerHTML = myObj.newick;\n var tree = d3.layout.phylotree()\n // create a tree layout object\n .svg(d3.select(where));\n // render to this SVG element\n tree(myObj.newick)\n // parse the Newick into a d3 hierarchy object with additional fields\n .layout();\n tree.size([200,400]);\n // layout and render the tree\n // for syntax highlighting\n hljs.initHighlightingOnLoad();\n }\n );\n}", "title": "" }, { "docid": "e886e803793aa8f2ca0f2d777e314585", "score": "0.43532616", "text": "function tree(t) {\n if (!t) {\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n }", "title": "" }, { "docid": "e886e803793aa8f2ca0f2d777e314585", "score": "0.43532616", "text": "function tree(t) {\n if (!t) {\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n }", "title": "" }, { "docid": "bc38b92d26890304a8c1b18d3f933480", "score": "0.43519366", "text": "function treeGetValue(tree) {\n return tree.node.value;\n}", "title": "" }, { "docid": "bc38b92d26890304a8c1b18d3f933480", "score": "0.43519366", "text": "function treeGetValue(tree) {\n return tree.node.value;\n}", "title": "" }, { "docid": "2da47c66b4ac886562c8551cc52f1cef", "score": "0.43511972", "text": "function create(item,h){if(h===0){return{ctor:'_Array',height:0,table:[item]};}return{ctor:'_Array',height:h,table:[create(item,h-1)],lengths:[1]};}// Recursively creates a tree that contains the given tree.", "title": "" }, { "docid": "2da47c66b4ac886562c8551cc52f1cef", "score": "0.43511972", "text": "function create(item,h){if(h===0){return{ctor:'_Array',height:0,table:[item]};}return{ctor:'_Array',height:h,table:[create(item,h-1)],lengths:[1]};}// Recursively creates a tree that contains the given tree.", "title": "" }, { "docid": "f77d3581b9254b24b13ddbea508ab5c4", "score": "0.43430376", "text": "function search(quadtree, x0, y0, x3, y3) {\n validData = [];\n quadtree.visit(function(node, x1, y1, x2, y2) {\n if (!node.length){\n var p = [node.data[0], node.data[1], node.data[2]];\n // if (!node.length) do console.log(node.data); while (node = node.next)\n if (p) {\n p.selected = (p[0] >= x0) && (p[0] < x3) && (p[1] >= y0) && (p[1] < y3);\n if (p.selected) {\n validData.push(p);\n }\n }\n }\n return x1 >= x3 || y1 >= y3 || x2 < x0 || y2 < y0;\n });\n return validData;\n}", "title": "" }, { "docid": "65d02cccee1d4f78f12f302eb43b5048", "score": "0.43411455", "text": "function makeTree1() {\n const tree = new BST();\n tree.insert(5, 5);\n tree.insert(3, 3);\n tree.insert(7, 7);\n tree.insert(2, 2);\n tree.insert(4, 4);\n tree.insert(6, 6);\n tree.insert(8, 8);\n return tree;\n}", "title": "" }, { "docid": "6e6ea04d77a5878bee36244183f2e8d3", "score": "0.4337951", "text": "function push(item, a)\n\t{\n\t\tvar pushed = push_(item, a);\n\t\tif (pushed !== null)\n\t\t{\n\t\t\treturn pushed;\n\t\t}\n\n\t\tvar newTree = create(item, a.height);\n\t\treturn siblise(a, newTree);\n\t}", "title": "" }, { "docid": "5c4e4fa241c71e96bc60a74d77cb10af", "score": "0.43291757", "text": "function tree(t) {\n if(!t) {\n return 0\n }\n return tree(t.left) + t.value + tree(t.right)\n}", "title": "" }, { "docid": "5001940aef07ea26f21a092516b94e25", "score": "0.43280914", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n}", "title": "" }, { "docid": "5001940aef07ea26f21a092516b94e25", "score": "0.43280914", "text": "function tree(t){\n if(!t){\n return 0;\n }\n return tree(t.left) + t.value + tree(t.right);\n}", "title": "" }, { "docid": "823f6ad9a3485c5173cad33895ad2331", "score": "0.43272355", "text": "async getPartialAXTree(params) {\n return await new Promise((resolve, reject) => {\n this.dbg.sendCommand('Accessibility.getPartialAXTree', params, (error, result) => {\n this.assertError(error, 'Accessibility.getPartialAXTree');\n resolve(result);\n });\n });\n }", "title": "" } ]
6491ce31edd9be53ded9dbd07108567d
Returns an object with a set of randomized css properties that can be used to format a div. The properties are backgroundcolor, color, borderradius, border, and boxshadow
[ { "docid": "0a59da15fce999473c144f61e03c1ef9", "score": "0.6999691", "text": "function randomizeDivStyle() {\n\n var divStyle = {};\n // colors arrays contain the back color, font color and whether they can be switched\n var colors = [[\"#97E85D\", \"#540A1B\", false],\n [\"#5DC8E8\", \"#6B1D08\", false],\n [\"#24CCC0\", \"#7A1D6D\", true],\n [\"#1A0754\", \"#FFF374\", false],\n [\"#B3FFC6\", \"#4D2B7A\", true],\n [\"#FFD574\", \"#1F3B7A\", true],\n [\"#748A82\", \"White\", true], \n [\"#F0E3FF\", \"Black\", true], \n [\"Black\", \"OrangeRed\", false], \n [\"DarkGreen\", \"PaleGreen\", true],\n [\"MediumOrchid\", \"Black\", true],\n [\"DarkBlue\", \"Seashell\", true],\n [\"Indigo\", \"Lavender\", true],\n [\"Teal\", \"White\", true],\n [\"Khaki\", \"Chocolate\", true],\n [\"White\", \"DarkSlateGray\", true], \n [\"Goldenrod\", \"Ivory\", true], \n [\"Black\", \"Yellow\", false], \n [\"DarkSlateGray\", \"Gold\", true], \n [\"White\", \"DeepPink\", false], \n [\"Salmon\", \"Maroon\", false]];\n \n var colorRand = Math.floor(Math.random() * colors.length);\n var colorSwitch = 0;\n \n var colorset = colors[colorRand];\n \n // If this set of colors can be switched, \n // randomize whether to switch them.\n if (colorset[2])\n {\n // switch them 1/3 of the time.\n // 1. Math.random() * 3 will generate a value between 0 and 3.\n // 2. subtract 1 to get a value between -1 and 2.\n // 3. take the floor to get -1 or 0 or 1.\n // 4. Math.max will set the result to 0 or 1, \n // with 0 being twice as likely as 1.\n colorSwitch = Math.floor(Math.max(0, (Math.random() * 3 - 1)));\n }\n\n divStyle[\"background-color\"] = colorset[colorSwitch];\n divStyle[\"color\"] = colorset[1 - colorSwitch];\n divStyle[\"border-radius\"] = Math.floor(Math.random() * 60) +\"px\";\n divStyle[\"border\"] = getBorder();\n divStyle[\"box-shadow\"] = getBoxShadow();\n\n return divStyle;\n}", "title": "" } ]
[ { "docid": "ff4730d71bf9a679b43a517839bbb56c", "score": "0.7093961", "text": "function getDivCssString() {\n return style = \" background-color : \" + $(\".zendiv\").css(\"background-color\") + \n \"; color : \" + $(\".zendiv\").css(\"color\") +\n \"; border : \" + $(\".zendiv\").css(\"border\") +\n \"; border-radius : \" + $(\".zendiv\").css(\"border-radius\") +\n \"; box-shadow \" + $(\".zendiv\").css(\"box-shadow\") +\n \";\";\n }", "title": "" }, { "docid": "a9921fbd472ae74aefb03e6c070f9a3a", "score": "0.67229366", "text": "function randomStyle(){\n var shape = dice(2) == 1 ? \"stroke\" : \"fill\";\n var color = dice(2) == 1 ? \"#fff\" : \"#0097cf\";\n return { \"shape\": shape , \"color\" : color };\n}", "title": "" }, { "docid": "c613176c3be6b6475007956277de400b", "score": "0.6559382", "text": "function randCSSText() {\n var cssText = '{';\n for (var i = 0; i < demicm.styles.length; i++) {\n cssText += toCSSStyle(demicm.styles[i]) + ': ' + randStyleVal(demicm.styles[i]) + '; ';\n }\n cssText += '}';\n return cssText;\n}", "title": "" }, { "docid": "7e59f6c7a47f673dd405a3158d6243af", "score": "0.65139836", "text": "function crazyDivs()\n{\n for (var i=0; i< 20; i++)\n {\n var div = document.createElement(\"div\");\n div.style.width = randomSize();\n div.style.height = randomSize();\n div.style.background = randomColor();\n document.body.appendChild(div);\n }\n \n function randomSize(){\n var size = Math.floor((Math.random() * 10) + 1);\n var mult = Math.floor((Math.random() * 10) + 1);\n return size*mult;\n }\n \n function randomColor(){\n var hexas = '0123456789ABCDEF'.split('');\n var color = '#';\n for (var i = 0; i < 6; i++ ) {\n color += hexas[Math.floor(Math.random() * 16)];\n }\n return color;\n }\n}", "title": "" }, { "docid": "7b61c2acd60ec54fb497ec3fa649be54", "score": "0.64558476", "text": "static convertToCSS (props) {\n var styles = $.extend({}, props);\n styles.width = props.width || (props.w && (props.w + \"px\")),\n styles.height = props.height || (props.h && (props.h + \"px\")),\n styles.transform = props.transform || (Thing.makeTransformCSS(props.rotate, props.scale, props.x, props.y, props.z, props.renderOnCenter, props.w, props.h)),\n\n // These are not true CSS properties so remove them\n delete styles.id;\n delete styles.rotate;\n delete styles.scale;\n delete styles.size;\n delete styles.x;\n delete styles.y;\n delete styles.z;\n delete styles.w;\n delete styles.h;\n delete styles.r;\n delete styles.mask;\n delete styles.renderOnCenter;\n delete styles.onImgLoaded;\n delete styles.onImgError;\n\n return styles;\n }", "title": "" }, { "docid": "5738a4e20f9f48940aac92feec0b97d3", "score": "0.63049066", "text": "function getRandomDiv() {\n\t\tvar DIV_SIZE = '40px';\n\t\tvar BORDER_SIZE = '5px';\n\t\tvar divElement = document.createElement('div');\n\n\n\t\tdivElement.style.backgroundColor = getRandomRGBA();\n\t\tdivElement.style.position = 'absolute';\n\t\tdivElement.innerHTML = '<strong>div</strong>';\n\t\tdivElement.style.padding = '10px';\n\t\tdivElement.style.width = DIV_SIZE;\n\t\tdivElement.style.height = DIV_SIZE;\n\t\tdivElement.style.border = BORDER_SIZE + ' solid' + getRandomColor();\n\t\tdivElement.style.color = getRandomColor();\n\n\t\treturn divElement;\n\t}", "title": "" }, { "docid": "55408003ba46dd3f2aa1bea66f791d60", "score": "0.62835526", "text": "randColor() {\n let randomColor = `rgb(${randomize(0, 255)},${randomize(0, 255)},${randomize(\n 0,\n 255\n )})`;\n this.div.style.backgroundColor = randomColor;\n }", "title": "" }, { "docid": "43a0ac6f7ec86f91e3e7a3a526ac1f0d", "score": "0.62819517", "text": "function getRandomStyle(pos) {\n let xRand = generateRandNum(1, 49) + '%';\n let yRand = generateRandNum(1, 14) + '%';\n let size = generateRandNum(5, 20) + 'rem';\n\n switch(pos) { //pos\n case 1: //Top left\n return {\n height: size,\n width: size,\n left: xRand, \n top: yRand\n }\n case 2: //Top Right\n return {\n height: size,\n width: size,\n right: xRand, \n top: yRand\n }\n case 3: //Bottom left\n return {\n height: size,\n width: size,\n left: xRand, \n bottom: yRand\n }\n case 4: //Bottom right\n return {\n height: size,\n width: size,\n right: xRand, \n bottom: yRand\n }\n default: \n return null;\n }\n }", "title": "" }, { "docid": "d21cab8a55eb14b661bc63d47c151caa", "score": "0.6205755", "text": "function generateCSS() {\r\n \r\n var css = \"\";\r\n var classes = new Array();\r\n \r\n // quick trim \r\n styles[\"construct-loose\"] = styles[\"construct-loose\"].fulltrim();\r\n \r\n for (var s in styles) {\r\n if (s == 'construct-loose' && styles[\"construct-loose\"].length > 0) {\r\n classes = styles[s].split(\" \"); // split string to array\r\n classes = unique(classes); // remove duplicates\r\n for (var i = 0; i < classes.length; i++) {\r\n css += \".\" + classes[i] + \" { \" + theGrid[classes[i]] + \" }<br>\";\r\n }\r\n }\r\n else if (styles[s].length > 0) {\r\n css += \"#\" + s + \" { \";\r\n classes = styles[s].fulltrim().split(\" \");\r\n for (var i = 0; i < classes.length; i++) {\r\n css += theGrid[classes[i]] + \" \";\r\n }\r\n css += \"} <br>\";\r\n }\r\n }\r\n \r\n return css;\r\n \r\n}", "title": "" }, { "docid": "0c035f223acb569bbeea8d23268d8974", "score": "0.6182289", "text": "function generateStyle(uuid, colors) {\n var textColor = colors.text;\n var backgroundColor = colors.background;\n var borderColor = colors.border;\n var arrowColor = colors.arrow;\n return \"\\n \\t.\".concat(uuid, \" {\\n\\t color: \").concat(textColor, \";\\n\\t background: \").concat(backgroundColor, \";\\n\\t border: 1px solid \").concat(borderColor, \";\\n \\t}\\n\\n \\t.\").concat(uuid, \".place-top {\\n margin-top: -10px;\\n }\\n .\").concat(uuid, \".place-top::before {\\n border-top: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-top::after {\\n border-left: 8px solid transparent;\\n border-right: 8px solid transparent;\\n bottom: -6px;\\n left: 50%;\\n margin-left: -8px;\\n border-top-color: \").concat(arrowColor, \";\\n border-top-style: solid;\\n border-top-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-bottom {\\n margin-top: 10px;\\n }\\n .\").concat(uuid, \".place-bottom::before {\\n border-bottom: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-bottom::after {\\n border-left: 8px solid transparent;\\n border-right: 8px solid transparent;\\n top: -6px;\\n left: 50%;\\n margin-left: -8px;\\n border-bottom-color: \").concat(arrowColor, \";\\n border-bottom-style: solid;\\n border-bottom-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-left {\\n margin-left: -10px;\\n }\\n .\").concat(uuid, \".place-left::before {\\n border-left: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-left::after {\\n border-top: 5px solid transparent;\\n border-bottom: 5px solid transparent;\\n right: -6px;\\n top: 50%;\\n margin-top: -4px;\\n border-left-color: \").concat(arrowColor, \";\\n border-left-style: solid;\\n border-left-width: 6px;\\n }\\n\\n .\").concat(uuid, \".place-right {\\n margin-left: 10px;\\n }\\n .\").concat(uuid, \".place-right::before {\\n border-right: 8px solid \").concat(borderColor, \";\\n }\\n .\").concat(uuid, \".place-right::after {\\n border-top: 5px solid transparent;\\n border-bottom: 5px solid transparent;\\n left: -6px;\\n top: 50%;\\n margin-top: -4px;\\n border-right-color: \").concat(arrowColor, \";\\n border-right-style: solid;\\n border-right-width: 6px;\\n }\\n \");\n}", "title": "" }, { "docid": "2b0740567122e07211fd1fb792987fde", "score": "0.61664534", "text": "function buildRandomCarSpecs() {\n const width = '20px';\n const height = getRandomInt(20, 30) + 'px';\n const borderRadius = getRandomInt(10, 40) + '%';\n const colors = ['#00695c', '#D84315', '#4E342E', '#424242', '#37474F', '#283593', '#1565C0'];\n const carColor = colors[getRandomInt(0, 6)];\n\n return {width, height, borderRadius, carColor};\n}", "title": "" }, { "docid": "18e277ac5a81d6731b9ceb08b249fb4c", "score": "0.6116154", "text": "function divMaker () {\n\n var addx = 1;\n\tvar addy = 1;\n\tvar addwidth = 1;\n\tvar addheight = 1;\n\n var divAttr = '';\n\n\tfor (j = 0; j <= 9; j++) {\n\t\tfor (i = 0; i <= (colorArr.length - 1); i++) {\n\n\t\t\tdivAttr +=\n '<div style=\"position: fixed;' +\n posX +\n ': ' +\n (addx += parseInt(userDate.charAt(1))) +\n 'px;' +\n posY +\n ': ' +\n (addy += parseInt(userDate.charAt(2))) +\n 'px; background-color: ' +\n colorArr[i] +\n '; width:' +\n (addwidth += parseInt(userDate.charAt(3) + 2)) +\n 'px; height:' +\n (addheight += parseInt(userDate.charAt(3) + 2)) +\n 'px;\" class=\"blocks\"></div>'\n\n };\n };\n return divAttr;\n}", "title": "" }, { "docid": "a4a47d56df10d195f4eb3b428b026d03", "score": "0.59277445", "text": "function pickRandomColor(obj) {\n if (Object.keys(obj).length === 0 && obj.constructor === Object)\n return 'empty';\n var result;\n var count = 0;\n for (var prop in obj)\n if (Math.random() < 1 / ++count)\n result = prop;\n return result;\n}", "title": "" }, { "docid": "773175e54bc612a1331c9aea999a2d83", "score": "0.5922473", "text": "function randStyle() {\n\tcolor1.value = \"#\" + randNumber() + randNumber() + randNumber();\n\tcolor2.value = \"#\" + randNumber() + randNumber() + randNumber();\n\tbody.style.background = \"linear-gradient(to right, \" + color1.value + \",\" + color2.value + \")\";\n\tcss.textContent = body.style.background + \";\";\n}", "title": "" }, { "docid": "51ef4b6c21a29c859344b27f9e67da7e", "score": "0.5908346", "text": "static get properties(){return{/**\n * The colors object.\n * Each color contains an array of shades as hex codes from lightest to darkest.\n */colors:{type:Object,value:window.SimpleColorsStyles.colors},/**\n * Object with information on which color combinations are WCAG 2.0AA compliant, eg: ```\n {\n greyColor: { //if either the color or its contrast will be a grey\n aaLarge: [ //if bold text >= 14pt, text >= 18pt, decorative only, or disabled\n { //for the first shade of a color\n min: 7, //index of the lightest contrasting shade of another color\n max: 12 //index of the darkest contrasting shade of another color\n },\n ...\n ],\n aa: [ ... ] //if bold text < 14pt, or text < 18pt\n },\n colorColor: { ... } //if neither the color nor its contrast are grey\n }```\n */contrasts:{type:Object,value:{greyColor:{aaLarge:[{min:7,max:12},{min:7,max:12},{min:7,max:12},{min:7,max:12},{min:8,max:12},{min:10,max:12},{min:1,max:3},{min:1,max:5},{min:1,max:6},{min:1,max:6},{min:1,max:6},{min:1,max:6}],aa:[//if bold text < 14pt, or text < 18pt\n{min:7,max:12},{min:7,max:12},{min:7,max:12},{min:8,max:12},{min:8,max:12},{min:11,max:12},{min:1,max:2},{min:1,max:7},{min:1,max:7},{min:1,max:6},{min:1,max:6},{min:1,max:6}]},colorColor:{//if neither the color nor its contrast are grey\naaLarge:[{min:7,max:12},{min:7,max:12},{min:8,max:12},{min:9,max:12},{min:10,max:12},{min:11,max:12},{min:1,max:2},{min:1,max:3},{min:1,max:4},{min:1,max:5},{min:1,max:6},{min:1,max:6}],aa:[{min:8,max:12},{min:8,max:12},{min:9,max:12},{min:9,max:12},{min:11,max:12},{min:12,max:12},{min:1,max:1},{min:1,max:2},{min:1,max:4},{min:1,max:4},{min:1,max:5},{min:1,max:5}]}}}}}", "title": "" }, { "docid": "168a9099d84ddfb183df8e0f38d4b208", "score": "0.5869681", "text": "function randomColor() {\n \n return {\n red: Math.random(),\n green: Math.random(),\n blue: Math.random(),\n alpha: 1\n };\n}", "title": "" }, { "docid": "fe2a32f6cf436411835dd64cccc9c1ae", "score": "0.58436406", "text": "static get properties() {\n return {\n color: {\n attribute: \"color\",\n type: String,\n },\n };\n }", "title": "" }, { "docid": "26ef7ae8ca367b9bf3338c6a9670a037", "score": "0.58431005", "text": "function randomColor() {\n \n return {\n red: 0,\n green: Math.random(),\n blue: Math.random(),\n // alpha: ( Math.random() * 0.25 ) + 0.05\n };\n\n}", "title": "" }, { "docid": "126096c384042ba12b489cb6435b38a0", "score": "0.5836671", "text": "function generateSet()\n{\n var set = {};\n set[\"pid\"] = pid;\n set[\"text\"] = randomizeDivText();\n set[\"div\"] = randomizeDivStyle();\n set[\"pa\"] = randomizeParagraphStyle($(\"#pa\"));\n set[\"pb\"] = randomizeParagraphStyle($(\"#pb\"));\n set[\"pc\"] = randomizeParagraphStyle($(\"#pc\"));\n set[\"pd\"] = randomizeParagraphStyle($(\"#pd\"));\n set[\"pe\"] = randomizeParagraphStyle($(\"#pe\"));\n pid += 1;\n return set;\n}", "title": "" }, { "docid": "2ae618ef8bffa4e5396965727b2e0508", "score": "0.58153284", "text": "getInitialsStyle(avatarValue) {\n return {\n textAlign: 'center',\n borderRadius: this.round ? '100%' : this.cornerRadius + 'px',\n border: this.borderColor ? '1px solid ' + this.borderColor : '',\n textTransform: 'uppercase',\n color: this.fgColor,\n backgroundColor: this.bgColor ? this.bgColor : this.avatarService.getRandomColor(avatarValue),\n font: Math.floor(+this.size / this.textSizeRatio) + 'px Helvetica, Arial, sans-serif',\n lineHeight: this.size + 'px',\n ...this.style,\n };\n }", "title": "" }, { "docid": "99be3693c083bff140975e2e9cdb5c0a", "score": "0.58053374", "text": "printCSS(style) {\n return Object.keys(style).map(k => <div key={k} className=\"css-line\">background: {style[k]}</div>);\n }", "title": "" }, { "docid": "a2a184d7ce517193e238df0149437c55", "score": "0.5787974", "text": "function CreateDiv() {\n var divElement = document.createElement(\"div\");\n \n divElement.style.width = SHAPE_SIZE + \"px\";\n divElement.style.height = SHAPE_SIZE + \"px\";\n divElement.style.position = \"absolute\";\n divElement.innerHTML = \"DIV\";\n\n divElement.style.backgroundColor = Color();\n divElement.style.color = Color();\n divElement.style.border = RandomValue(1, 6) + \"px solid \" + Color();\n\n return divElement;\n }", "title": "" }, { "docid": "8fab86f3ed02f3e4f2421cd0fe73e305", "score": "0.5737684", "text": "function drawRandomObject(){\n //store random values between 0 to 100, to rx and ry\n var rx = Math.floor(Math.random()*100);\n var ry = Math.floor(Math.random()*100);\n var rw = Math.floor(Math.random()*1500); //random width\n var rh = Math.floor(Math.random()*2); //random height\n if (ry < 100) {\n //ry is smaller than 50 = above the half\n color = \"hsl(\" + i * 10 + \", 100%, 50%)\";\n }\n\n console.log(\"rx: \" + rx + \" ry: \" + ry);\n $(\"body\").append( \"<div class='element random' style='left:\" + rx + \"vw; top:\" + ry + \"vh; background-color:\" + color + \"; width:\" + rw + \"px; height:\" + rh + \"px;'></div>\" );\n }", "title": "" }, { "docid": "cfa0b64683f79a0c6c5f9d90ecabd2f5", "score": "0.5731344", "text": "function randomizeParagraphStyle(item) {\n var pStyle = {}\n var generics = [\"serif\", \"sans-serif\", \"cursive\", \"fantasy\", \"monospace\"];\n var families = [\"Georgia\", \"Palatino Linotype\", \"Book Antiquia\", \"Palatino\",\n \"Arial\", \"Helvetica\", \"Arial Black\", \"Gadget\", \"Comic Sans MS\",\n \"Impact\", \"Charcoal\", \"Lucida Sans Unicode\", \"Lucida Grande\",\n \"Tahoma\", \"Geneva\", \"Trebuchet MS\", \"Verdana\", \"Courier New\",\n \"Courier\", \"Lucida Console\", \"Times\", \"Impact\", \"Arnoldboecklin\", \n \"Oldtown\", \"Blippo\", \"Brushstroke\", \"Parkavenue\", \"Florence\", \n \"Coronetscript\", \"Zapf Chancery\", \"Fixed\", \"Lucidatypewriter\"];\n var sizes = [\"14px\", \"16px\", \"16px\", \"18px\", \"18px\", \"18px\", \"20px\", \"22px\", \"24px\"];\n var styles = [\"regular\", \"regular\", \"regular\", \"regular\", \"regular\", \"italic\", \"italilc\", \"oblique\"];\n var weights = [\"normal\", \"normal\", \"normal\", \"bold\", \"bolder\", \"lighter\"];\n var decorations =[\"underline\", \"underline\", \"underline\", \"overline\", \"overline\", \n \"line-through\"];\n var aligns = [\"left\", \"right\", \"center\"];\n \n var fontFam = \"'\" + randListValue(families) + \n \"' '\" + randListValue(families) + \n \"' '\" + randListValue(generics) + \"'\";\n \n pStyle[\"font-family\"] = fontFam;\n pStyle[\"font-size\"] = randListValue(sizes);\n pStyle[\"font-style\"] = randListValue(styles);\n pStyle[\"font-weight\"] = randListValue(weights);\n \n pStyle[\"text-decoration\"] = \"none\";\n if (Math.random() > .7)\n {\n // apply a text-decoration 30% of the time.\n pStyle[\"text-decoration\"] = randListValue(decorations);\n }\n \n pStyle[\"text-shadow\"] = getShadow(); \n pStyle[\"text-align\"] = randListValue(aligns);\n\n return pStyle;\n }", "title": "" }, { "docid": "7d5232beac8af2da2381615db7e2af01", "score": "0.57092524", "text": "getContainerPadding() {\n let styling = {};\n styling['padding-top'] = this.props.appearance.paddingTop + 'px';\n styling['padding-bottom'] = this.props.appearance.paddingBottom + 'px';\n styling['padding-left'] = this.props.appearance.paddingSides + 'px';\n styling['padding-right'] = this.props.appearance.paddingSides + 'px';\n return styling;\n }", "title": "" }, { "docid": "c6731389e3d8fb243dfde59150e5eb01", "score": "0.5708187", "text": "static get styles() {\n return css`\n div { height: 70px; width: 100%; background: black; color: white; text-align: center; font-weight: bold; line-height:70px; font-size: 24px; }\n `;\n }", "title": "" }, { "docid": "f6d647114795553550f7e6f6f30efc44", "score": "0.5700894", "text": "function buildRandomCarNode() {\n let carNode = document.createElement('div');\n let carSpecs = buildRandomCarSpecs();\n\n carNode.classList.add('car');\n\n carNode.style.width = carSpecs.width;\n carNode.style.height = carSpecs.height;\n carNode.style.borderRadius = carSpecs.borderRadius;\n carNode.style.backgroundColor = carSpecs.carColor;\n carNode.style.backgroundColor = carSpecs.carColor;\n\n carNode.metaData = {};\n\n return carNode;\n}", "title": "" }, { "docid": "dd6dc03fbadf4df1cab16f90fa79b298", "score": "0.5694339", "text": "function getHarmoniousStyles1(w, h, padding, family, bg = 'blue', fg = 'random', hasText = true) {\n\tlet numbers = hasText ? [15, 55, 0, 20, 10] : [15, 70, 0, 0, 15];\n\tnumbers = numbers.map(x => h * x / 100);\n\t[patop, szPic, zwischen, szText, pabot] = numbers;\n\tpatop = Math.max(patop, padding);\n\tpabot = Math.max(pabot, padding);\n\n\t// console.log(patop, szPic, zwischen, szText, pabot);\n\tlet styles = { h: h, bg: bg, fg: 'contrast', patop: patop, pabottom: pabot, align: 'center', 'box-sizing': 'border-box' };\n\tlet textStyles = { family: family, fz: Math.floor(szText * 3 / 4) };\n\tlet picStyles = { h: szPic, bg: fg };\n\tif (w > 0) styles.w = w; else styles.paleft = styles.paright = Math.max(padding, 4);\n\treturn [styles, picStyles, textStyles];\n}", "title": "" }, { "docid": "f7b4c3f2fd00a4cf8aebc9923fd1ecaf", "score": "0.5648727", "text": "function createCSS3DObject(s) {\n //Create outerdiv and set inner HTML from string (s)..\n var\n div = document.createElement('div');\n div.innerHTML = s;\n\n //Apply any CSS Styling here.\n div.className = 'div';\n div.style.opacity = '0.8';\n\n //Create the CSS3DObject and return it.\n var\n object = new THREE.CSS3DObject(div);\n return object;\n }", "title": "" }, { "docid": "055ec90ea1b711059ab7318ed86fe5e3", "score": "0.56468964", "text": "css(element, property, value) {\n\n if (property.constructor === Object) {\n\n // Fast add styles from object { \"padding-top\": \"10px\", padding-bottom\": 10px; }\n for (let key in property) {\n\n element.style[this.toCamelCase(key)] = property[key];\n\n }\n\n } else if (value) {\n\n element.style[this.toCamelCase(property)] = value;\n\n } else {\n\n let ret = null;\n\n let styles = this.view.getComputedStyle(element, null);\n\n if (property.constructor === Array) {\n // Fast get array styles for element\n ret = {};\n for (let i = 0, len = property.length; i < len; i++) {\n let prop = this.toCamelCase(property[i]);\n ret[prop] = styles[prop];\n }\n } else {\n // Get Sinle style\n let prop = this.toCamelCase(property);\n ret = styles[prop];\n }\n\n return ret;\n }\n\n }", "title": "" }, { "docid": "789d78895e0679c206c866e2c680db2b", "score": "0.5633195", "text": "buildStyle() {\n const { stops, gradientType, gradientDirection } = this.props;\n const [stop0, stop1] = stops;\n const hexStart = this.rgbToHex(stop0.red, stop0.green, stop0.blue);\n const hexEnd = this.rgbToHex(stop1.red, stop1.green, stop1.blue);\n const { legacyDirection, standardDirection } = this.getRealDirection(gradientDirection, gradientType);\n\n const style = {};\n ['legacy', 'webkit', 'opera', 'mozilla', 'standard'].forEach((browserType) => {\n const direction = browserType === 'standard' ? standardDirection : legacyDirection;\n style[browserType] = this.getCSS(browserType, gradientType, direction, hexStart, hexEnd);\n });\n\n return style;\n }", "title": "" }, { "docid": "a3c7f039ef660007916671520f4c1eb2", "score": "0.5630276", "text": "function getNewCircle() {\n return $(\"<div>\",{\n \"class\": \"circle\",\n \"css\":{\n \"background-color\": getRandomColor(),\n \"top\": getRandomInt(500)+\"px\",\n \"left\": getRandomInt(1600)+\"px\"\n }\n });\n }", "title": "" }, { "docid": "9f301f0268317f166e2a7909c83e8f1f", "score": "0.56060916", "text": "getProperties() \r\n {\r\n return ['Color', 'text', this.getColor, this.setColor,\r\n 'noteText', 'text_box', this.getText, this.setText]\r\n }", "title": "" }, { "docid": "7190bf51b34278569af39fef3f6e3328", "score": "0.5602232", "text": "function create_a_beautiful_background_color_dammit() {\n var x = Math.floor(Math.random() * 110);\n var y = Math.floor(Math.random() * 110);\n var z = Math.floor(Math.random() * 110);\n var bgColor = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n\n // Console logging is mandatory, obvisously\n console.log(bgColor);\n\n $(\"<style>body { background: \"+bgColor+\"; }</style>\" ).appendTo( \"head\" );\n}", "title": "" }, { "docid": "8a97ffc992cb97b2a7f7ed3a8938c328", "score": "0.56018937", "text": "getStyle () {\n return [\n styles.circle,\n {\n width: this.state.w,\n height: this.state.h,\n borderRadius: this.state.br\n }\n ]\n }", "title": "" }, { "docid": "0024639300159b58f9c6d0605cc03181", "score": "0.559928", "text": "getStyles() {\n const { mjAttribute, color } = this.props\n\n return _.merge({}, this.constructor.baseStyles, {\n text: {\n /*\n * Get the color attribute\n * Example: <mj-mock color=\"blue\">content</mj-mock>\n */\n color: mjAttribute('color')\n }\n })\n }", "title": "" }, { "docid": "312e58e17828a7d3bed66cee28fc52b0", "score": "0.5579835", "text": "function grabCSS(id) {\n let tempArr = {};\n tempArr.id = id;\n tempArr.width = $(id).width();\n tempArr.height = $(id).height();\n tempArr.x = parseFloat($(id).css('left'));\n tempArr.y = parseFloat($(id).css('top'));\n tempArr.speedX = 0;\n tempArr.speedY = 0;\n return tempArr;\n }", "title": "" }, { "docid": "c01c68b2924e136f6a5c2137ae972383", "score": "0.5573372", "text": "function getCSSStyles() {\n var content = document.getElementById(\"div1\");\n console.log(content.style.cssText);\n console.log(content.style);\n var prop = content.style[1];\n console.log(prop);//background-color\n var value = content.style.getPropertyValue(prop);\n console.log(value);//#ff0000\n}", "title": "" }, { "docid": "8ac4c1afd086a9a46e8abb71ad503405", "score": "0.5561883", "text": "get cssText() {\n var properties = [];\n for (var i = 0, length = this.length; i < length; ++i) {\n var name = this[i];\n var value = this.getPropertyValue(name);\n var priority = this.getPropertyPriority(name);\n if (priority) {\n priority = \" !\" + priority;\n }\n properties[i] = name + \": \" + value + priority + \";\";\n }\n return properties.join(\" \");\n }", "title": "" }, { "docid": "8ac4c1afd086a9a46e8abb71ad503405", "score": "0.5561883", "text": "get cssText() {\n var properties = [];\n for (var i = 0, length = this.length; i < length; ++i) {\n var name = this[i];\n var value = this.getPropertyValue(name);\n var priority = this.getPropertyPriority(name);\n if (priority) {\n priority = \" !\" + priority;\n }\n properties[i] = name + \": \" + value + priority + \";\";\n }\n return properties.join(\" \");\n }", "title": "" }, { "docid": "a09ea6cfb849f7cd51b31e17dccea99f", "score": "0.5557944", "text": "function getStyles(props, context) {\n\t var displayWidth = props.displayWidth;\n\t var displayHeight = props.displayHeight;\n\t var refreshColor = props.refreshColor;\n\t var moreColor = props.moreColor;\n\t var contentBackgroundColor = props.contentBackgroundColor;\n\t var rootBackgroundColor = props.rootBackgroundColor;\n\n\n\t var rootStyle = _defineProperty({\n\t position: 'relative',\n\t width: displayWidth,\n\t height: displayHeight,\n\t background: '#f5f5f5',\n\t overflow: 'hidden'\n\t }, 'background', rootBackgroundColor);\n\n\t return {\n\n\t root: Object.assign({}, rootStyle, props.style || {}),\n\n\t refresh: {\n\t color: refreshColor\n\t },\n\n\t more: {\n\t color: moreColor\n\t },\n\n\t content: {\n\t position: 'absolute',\n\t top: 0,\n\t width: '100%',\n\t minHeight: '100%',\n\t zIndex: 2,\n\t background: contentBackgroundColor,\n\t overflowX: 'hidden',\n\t overflowY: 'auto',\n\t transitionDuration: '0ms',\n\t transitionTimingFunction: 'cubic-bezier(0.165, 0.84, 0.44, 1)',\n\t transform: 'translate3d(0px , ' + props.deltaY + 'px , 0px)'\n\t }\n\n\t };\n\t}", "title": "" }, { "docid": "fc530592cfb8b876ff0f5eea519d8125", "score": "0.555186", "text": "getStyles() {\n let styles = \"\";\n styles += this.props.field.fieldColor.toLowerCase();\n styles += \" \";\n styles += \"field\";\n return styles;\n }", "title": "" }, { "docid": "a0c59ac191e2f6b3a03175e56b6f0a78", "score": "0.55377024", "text": "function _randStyle() {\n var rand256 = function () {\n return Math.round(Math.random() * 255);\n };\n return 'stroke:rgb(' + rand256() + ',' + rand256() + ',' + rand256() + ');stroke-opacity:0.85';\n }", "title": "" }, { "docid": "afcbca8e1f1fbce502f111326eddc1cc", "score": "0.55272055", "text": "get cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\t\tif (priority) {\n\t\t\t\tpriority = \" !\" + priority;\n\t\t\t}\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t}", "title": "" }, { "docid": "afcbca8e1f1fbce502f111326eddc1cc", "score": "0.55272055", "text": "get cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\t\tif (priority) {\n\t\t\t\tpriority = \" !\" + priority;\n\t\t\t}\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t}", "title": "" }, { "docid": "ab20f21002dd7a7db23f17209d8a9e2d", "score": "0.55223686", "text": "function dynamicColors() {\n var r = Math.floor(Math.random() * 255);\n var g = Math.floor(Math.random() * 255);\n var b = Math.floor(Math.random() * 255);\n return \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + 0.7 + \")\";\n}", "title": "" }, { "docid": "85da56567b40445f409226829815effd", "score": "0.5499226", "text": "function dynamicColors() {\n var r = Math.floor(Math.random() * 255);\n var g = Math.floor(Math.random() * 255);\n var b = Math.floor(Math.random() * 255);\n return \"rgba(\" + r + \",\" + g + \",\" + b + \", 0.5)\";\n}", "title": "" }, { "docid": "2c6839a2d3ee26d29e204cda328f1d7f", "score": "0.5498212", "text": "function createRandomDiv(text, size, minSize, maxSize, element){\n\tvar div = document.createElement(\"div\"),\n\t\twidth = getRandomInt(20, 100),\n\t\theight = getRandomInt(20, 100),\n\t\tfontColor = getRandomColor(),\n\t\tcountOfMostUsedTag = Math.max.apply( Math, uniqueTags[1] ),\n\t\tfontSize = Math.log(uniqueTags[1][element]) / Math.log(countOfMostUsedTag) * (maxSize - minSize) + minSize,\n\t\tleft = getRandomInt(0, $(document).width() - 100),\n\t\ttop = getRandomInt(0, $(document).height() - 100);\n\n\tdiv.style.position = \"absolute\";\n\n\tdiv.style.width = width + \"px\";\n\tdiv.style.height = height + \"px\";\n\tdiv.style.color = fontColor;\n\tdiv.style.left = left + \"px\";\n\tdiv.style.top = top + \"px\";\n\tdiv.style.fontSize = fontSize + \"px\";\n\n\tdiv.appendChild(createStrong(text));\n\tdocument.body.appendChild(div);\n}", "title": "" }, { "docid": "ccd639d0c640a618300cc49ad3d92217", "score": "0.5496895", "text": "function _randStyle() {\n var rand256 = function () {\n return Math.round(Math.random() * 255);\n };\n return 'stroke:rgb(' + rand256() + ',' + rand256() + ',' + rand256() + ')';\n }", "title": "" }, { "docid": "456e6e34e0d1c078f602bb2e037db243", "score": "0.54854184", "text": "function myStyle(feature) {\n return {\n radius: feature.properties.mag * 4,\n fillColor: colorfunction(feature.properties.mag),\n color: \"black\",\n weight: 1,\n opacity: 1,\n fillOpacity: 0.8\n }\n }", "title": "" }, { "docid": "ba3962b679604b71c51e87eccf9ab647", "score": "0.54756314", "text": "function getCss(propertyInfo, value) {\n var rules = void 0; // Protect against unexpected values\n\n var valueType = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n if (valueType !== 'string' && valueType !== 'number') {\n if (\"development\" !== 'production') {\n var name = propertyInfo.jsName;\n var encodedValue = JSON.stringify(value);\n console.error('\\uD83D\\uDCE6 ui-box: property \\u201C' + name + '\\u201D was passed invalid value \\u201C' + encodedValue + '\\u201D. Only numbers and strings are supported.');\n }\n\n return null;\n }\n\n var valueString = (0, _valueToString2.default)(value, propertyInfo.defaultUnit);\n var className = (0, _getClassName2.default)(propertyInfo, valueString); // Avoid running the prefixer when possible because it's slow\n\n if (propertyInfo.isPrefixed) {\n rules = (0, _prefixer2.default)(propertyInfo.jsName, valueString);\n } else {\n rules = [{\n property: propertyInfo.cssName,\n value: valueString\n }];\n }\n\n var styles = void 0;\n\n if (\"development\" === 'production') {\n var rulesString = rules.map(function (rule) {\n return rule.property + ':' + rule.value;\n }).join(';');\n styles = '.' + className + '{' + rulesString + '}';\n } else {\n var _rulesString = rules.map(function (rule) {\n return ' ' + rule.property + ': ' + rule.value + ';';\n }).join('\\n');\n\n styles = '\\n.' + className + ' {\\n' + _rulesString + '\\n}';\n }\n\n return {\n className: className,\n styles: styles\n };\n}", "title": "" }, { "docid": "3aeab07d2fd3408345cfb2cd3930bb6f", "score": "0.5472539", "text": "function ColorSchemer() {\n var self = this;\n this.makeRGBString = function(r, g, b) {\n return 'rgb(' + [r, g, b].join(',') + ')';\n };\n this.seedWarm = function(threshold) {\n threshold = threshold || 255;\n // Warm should be predominantly red, then green, then blue\n return self.makeRGBString(rando(threshold), rando(~~(threshold / 3)), rando(~~(threshold / 4)));\n };\n this.seedCool = function(threshold) {\n threshold = threshold || 255;\n // Cool should be predominantly blue, then green, then red\n return self.makeRGBString(rando(~~(threshold / 4)), rando(~~(threshold / 2)), rando(threshold));\n };\n this.setSeedColor = function(color) {\n self.seed_color = color;\n };\n // All possible theme types\n // Must always return the same object keys\n this.themes = {\n // NOTE: Shared = cool styles by default, then overridden\n // to keep things /somewhat/ DRY.\n\n // Neutrals still require a more vibrant CTA color\n\n // TODO: add a style option where multiple bgs are added, but the foreground\n // color is always the same... light and dark options\n // see https://dribbble.com/shots/1742752-Commerce-Analytics-Homepage-WIP/attachments/281998 for details !\n // and sort of... https://dribbble.com/shots/1757843-Final-Card-Landing-Page/attachments/285772\n\n // TODO: use isReadable to filter out unreadable variations\n // TODO: don't use tags, just generic labels (e.g 'p' vs 'body copy' ?\n // TODO: add reverse/alternations\n // TODO: add config for amts\n // TODO: remove duplicate calls for matching values (e.g h1 fg / h1 fg alt)\n // TODO: replace btnHover and btnBorder with generic names, update init\n neutral: {\n light: {\n cool: function() {\n return self.themes.neutral.light._shared(self.seedCool());\n },\n warm: function() {\n return self.themes.neutral.light._shared(self.seedWarm());\n },\n _shared: function(seed_color) {\n return {\n '_seed': seed_color,\n\n 'section_bg': tinycolor(seed_color).desaturate(100).lighten(60),\n 'section_fg': tinycolor('#000').lighten(40),\n\n 'section_fg_highlight': tinycolor(seed_color).desaturate(80).lighten(5),\n 'section_fg_subdued': tinycolor(seed_color).desaturate(100).lighten(30),\n\n 'section_bg_interactive': tinycolor(seed_color).darken(20).saturate(80),\n 'section_fg_interactive': tinycolor(seed_color).saturate(80).lighten(40),\n\n 'section_alternate_bg': tinycolor(seed_color).saturate(50).darken(20),\n 'section_alternate_fg': tinycolor(seed_color).desaturate(100).lighten(50),\n\n 'section_alternate_fg_highlight': tinycolor(seed_color).desaturate(80).lighten(5),\n 'section_alternate_fg_subdued': tinycolor(seed_color).desaturate(100).lighten(30),\n\n // Alternate of reg. fg/bg interactive\n 'section_alternate_bg_interactive': tinycolor(seed_color).saturate(80).lighten(40),\n 'section_alternate_fg_interactive': tinycolor(seed_color).saturate(80).darken(20),\n\n // Old style @deprecated\n 'h2': tinycolor('black').lighten(20),\n 'h3': tinycolor('black').lighten(30),\n 'h4': tinycolor('black').lighten(40),\n 'btnBorder': tinycolor(seed_color).saturate(80).darken(40),\n 'btnHover': tinycolor(seed_color).saturate(100)\n };\n }\n },\n dark: {\n cool: function() {\n return self.themes.neutral.dark._shared(tinycolor(self.seedCool()));\n },\n warm: function() {\n return self.themes.neutral.dark._shared(tinycolor(self.seedWarm()));\n },\n _shared: function(seed_color) {\n return {\n '_seed': seed_color,\n 'section_bg': tinycolor(seed_color).desaturate(1).darken(50),\n 'section_fg': tinycolor('black').lighten(40),\n\n 'section_fg_highlight': tinycolor(seed_color).desaturate(80).lighten(5),\n 'section_fg_subdued': tinycolor(seed_color).desaturate(100).lighten(30),\n\n 'section_bg_interactive': tinycolor(seed_color).saturate(80).lighten(20),\n 'section_fg_interactive': tinycolor(seed_color).saturate(80).darken(40),\n\n 'section_alternate_bg': tinycolor(seed_color).saturate(50).lighten(20),\n 'section_alternate_fg': tinycolor(seed_color).desaturate(1).darken(50),\n\n 'section_alternate_fg_highlight': tinycolor(seed_color).desaturate(8).darken(25),\n 'section_alternate_fg_subdued': tinycolor(seed_color).desaturate(1).darken(30),\n\n // Alternate of reg. fg/bg interactive\n 'section_alternate_bg_interactive': tinycolor(seed_color).saturate(80).darken(40),\n 'section_alternate_fg_interactive': tinycolor(seed_color).saturate(80).lighten(20),\n\n 'h2': tinycolor('white').darken(10),\n 'h3': tinycolor('white').darken(20),\n 'h4': tinycolor('white').darken(30),\n 'btnBorder': tinycolor(seed_color).saturate(80).lighten(40),\n 'btnHover': tinycolor(seed_color).saturate(100)\n };\n }\n }\n },\n complementary: {\n light: {\n cool: function() {\n // Seed color is flipped because of complements\n return self.themes.complementary.light._shared(self.seedWarm());\n },\n warm: function(){\n // Seed color is flipped because of complements\n return self.themes.complementary.light._shared(self.seedCool());\n },\n _shared: function(seed_color) {\n var compl = tinycolor(seed_color).complement();\n return {\n '_seed': seed_color,\n '_compl': compl,\n 'section_bg': tinycolor(compl).lighten(50),\n 'section_fg': tinycolor('black').lighten(40),\n\n 'section_fg_highlight': compl,\n 'section_fg_subdued': tinycolor(seed_color).desaturate(100).lighten(30),\n\n 'section_bg_interactive': tinycolor(seed_color).saturate(80).lighten(30),\n 'section_fg_interactive': tinycolor(seed_color).saturate(80).darken(30),\n\n 'section_alternate_bg': tinycolor(compl).saturate(50).darken(20),\n 'section_alternate_fg': tinycolor(seed_color).desaturate(100).lighten(60),\n\n 'section_alternate_fg_highlight': tinycolor(seed_color).desaturate(40).lighten(0),\n 'section_alternate_fg_subdued': tinycolor(seed_color).desaturate(100).lighten(40),\n\n // Alternate of reg. fg/bg interactive\n 'section_alternate_bg_interactive': tinycolor(seed_color).saturate(80).lighten(40),\n 'section_alternate_fg_interactive': tinycolor(seed_color).saturate(80).darken(20),\n\n 'h2': tinycolor(seed_color),\n 'h3': tinycolor(compl).lighten(20),\n 'h4': tinycolor('black').lighten(30),\n\n 'btnBorder': tinycolor(seed_color).saturate(80).lighten(40),\n 'btnHover': tinycolor(compl).saturate(100)\n };\n }\n },\n dark: {\n cool: function() {\n // Seed color is flipped because of complements\n return self.themes.complementary.dark._shared(self.seedWarm());\n },\n warm: function(){\n // Seed color is flipped because of complements\n return self.themes.complementary.dark._shared(self.seedCool());\n },\n _shared: function(seed_color) {\n var compl = tinycolor(seed_color).complement().lighten(20);\n return {\n '_seed': seed_color,\n '_compl': compl,\n\n 'section_bg': tinycolor(compl).darken(50),\n 'section_fg': tinycolor('white').darken(20),\n\n 'section_fg_highlight': compl,\n 'section_fg_subdued': tinycolor(seed_color).desaturate(100).lighten(30),\n\n 'section_bg_interactive': tinycolor(seed_color).saturate(80).lighten(40),\n 'section_fg_interactive': tinycolor(seed_color).saturate(80).darken(20),\n\n 'section_alternate_bg': tinycolor(compl).darken(20),\n 'section_alternate_fg': tinycolor(seed_color).desaturate(100).lighten(50),\n\n 'section_alternate_fg_highlight': tinycolor(seed_color).desaturate(40).lighten(0),\n 'section_alternate_fg_subdued': tinycolor(seed_color).desaturate(1).darken(20),\n\n // Alternate of reg. fg/bg interactive\n 'section_alternate_bg_interactive': tinycolor(seed_color).saturate(80).lighten(30),\n 'section_alternate_fg_interactive': tinycolor(seed_color).saturate(80).darken(50),\n\n 'h2': tinycolor(seed_color).lighten(30),\n 'h3': tinycolor(compl).lighten(30),\n 'h4': tinycolor(seed_color).lighten(40),\n\n 'btnBorder': tinycolor(seed_color).saturate(80).lighten(40),\n 'btnHover': tinycolor(compl).saturate(100)\n };\n }\n }\n },\n analogous: {\n light: {\n cool: function() {\n return self.themes.analogous.light._shared(self.seedCool());\n },\n warm: function(){\n return self.themes.analogous.light._shared(self.seedWarm());\n },\n _shared: function(seed_color) {\n var colors = tinycolor(seed_color).analogous(4);\n return {\n '_seed': seed_color,\n '_colors': colors,\n\n 'section_bg': tinycolor(colors[0]).lighten(55).desaturate(20),\n 'section_fg': tinycolor(colors[0]).darken(55).desaturate(20),\n\n 'section_fg_highlight': tinycolor(colors[1]).lighten(20),\n 'section_fg_subdued': tinycolor(colors[0]).lighten(30).desaturate(30),\n\n 'section_bg_interactive': tinycolor(colors[3]).saturate(100).lighten(20),\n 'section_fg_interactive': tinycolor(colors[0]).saturate(80).lighten(60),\n\n 'section_alternate_bg': tinycolor(colors[0]).lighten(20).desaturate(30),\n 'section_alternate_fg': tinycolor('#fff'),\n\n 'section_alternate_fg_highlight': tinycolor(colors[3]).saturate(60).lighten(45),\n 'section_alternate_fg_subdued': tinycolor(colors[0]).lighten(40).desaturate(20),\n\n // Alternate of reg. fg/bg interactive\n 'section_alternate_bg_interactive': tinycolor(colors[0]).lighten(55).desaturate(20),\n 'section_alternate_fg_interactive': tinycolor(colors[3]).saturate(100),\n\n 'h2': tinycolor(colors[0]).lighten(10),\n 'h3': tinycolor(colors[1]).lighten(20),\n 'h4': tinycolor(colors[2]).lighten(30),\n\n 'btnBorder': tinycolor(colors[4]).saturate(80).darken(40),\n 'btnHover': tinycolor(colors[5]).saturate(100)\n };\n }\n },\n dark: {\n cool: function() {\n return self.themes.analogous.dark._shared(self.seedCool());\n },\n warm: function(){\n return self.themes.analogous.dark._shared(self.seedWarm());\n },\n _shared: function(seed_color) {\n var colors = tinycolor(seed_color).darken(15).analogous(4);\n return {\n '_seed': seed_color,\n '_colors': colors,\n\n 'section_bg': tinycolor(colors[0]).desaturate(10),\n 'section_fg': tinycolor(colors[0]).desaturate(50).lighten(35),\n\n 'section_fg_highlight': tinycolor(colors[1]).lighten(40),\n 'section_fg_subdued': tinycolor(colors[0]).lighten(20).desaturate(30),\n\n 'section_bg_interactive': tinycolor(colors[3]).saturate(50).lighten(60),\n 'section_fg_interactive': tinycolor(colors[0]).desaturate(10),\n\n 'section_alternate_bg': tinycolor(colors[1]).lighten(40),\n 'section_alternate_fg': tinycolor(colors[0]).desaturate(10),\n\n 'section_alternate_fg_highlight': tinycolor(colors[3]).saturate(60).darken(45),\n 'section_alternate_fg_subdued': tinycolor(colors[0]).darken(40).desaturate(20),\n\n // Alternate of reg. fg/bg interactive\n 'section_alternate_bg_interactive': tinycolor(colors[3]).saturate(50).lighten(40),\n 'section_alternate_fg_interactive': tinycolor(colors[2]).darken(60),\n\n 'h2': tinycolor(colors[0]).lighten(10),\n 'h3': tinycolor(colors[1]).lighten(20),\n 'h4': tinycolor(colors[2]).lighten(30),\n\n 'btnBorder': tinycolor(colors[4]).saturate(80).lighten(40),\n 'btnHover': tinycolor(colors[5]).saturate(100)\n };\n }\n }\n },\n monochromatic: {\n dark: {\n cool: function(seed_color) {\n alert('Implement me');\n },\n warm: function(seed_color){\n alert('Implement me');\n }\n },\n light: {\n cool: function(seed_color) {\n alert('Implement me');\n },\n warm: function(seed_color){\n alert('Implement me');\n }\n }\n },\n split_complementary: {\n dark: {\n cool: function() {\n return self.themes.split_complementary.dark._shared(self.seedCool());\n },\n warm: function(){\n return self.themes.split_complementary.dark._shared(self.seedWarm());\n },\n _shared: function(seed_color) {\n var colors = tinycolor(seed_color).splitcomplement();\n return {\n '_seed': seed_color,\n '_colors': colors,\n\n 'section_bg': colors[0],\n 'section_fg': tinycolor(colors[2]).lighten(50).desaturate(70),\n\n 'section_fg_highlight': tinycolor(colors[1]).lighten(40).saturate(50),\n 'section_fg_subdued': tinycolor(colors[0]).lighten(20),\n\n 'section_bg_interactive': tinycolor(colors[2]).saturate(50).lighten(60),\n 'section_fg_interactive': tinycolor(colors[0]).desaturate(40),\n\n 'section_alternate_bg': tinycolor(colors[1]).lighten(30),\n 'section_alternate_fg': tinycolor(colors[0]).lighten(70).complement(40).desaturate(70),\n\n 'section_alternate_fg_highlight': tinycolor(colors[2]).saturate(60).darken(45),\n 'section_alternate_fg_subdued': tinycolor(colors[0]).darken(10),\n\n // Alternate of reg. fg/bg interactive\n 'section_alternate_bg_interactive': tinycolor(colors[2]).saturate(50).lighten(40),\n 'section_alternate_fg_interactive': tinycolor(colors[2]).darken(60),\n\n 'h2': tinycolor(colors[1]).lighten(20),\n 'h3': tinycolor(colors[1]).lighten(30),\n 'h4': tinycolor(colors[2]).lighten(40),\n\n 'btnBorder': tinycolor(colors[2]).saturate(80).lighten(40),\n 'btnHover': tinycolor(colors[1]).saturate(100)\n };\n }\n },\n light: {\n cool: function() {\n return self.themes.split_complementary.light._shared(self.seedCool());\n },\n warm: function(){\n return self.themes.split_complementary.light._shared(self.seedWarm());\n },\n _shared: function(seed_color) {\n var colors = tinycolor(seed_color).splitcomplement();\n return {\n '_seed': seed_color,\n '_colors': colors,\n\n 'section_bg': tinycolor(colors[0]).lighten(60),\n 'section_fg': tinycolor(colors[1]).lighten(30).desaturate(50),\n\n 'section_fg_highlight': tinycolor(colors[1]).darken(10).saturate(50),\n 'section_fg_subdued': tinycolor(colors[0]).darken(20),\n\n 'section_bg_interactive': tinycolor(colors[2]).lighten(40),\n 'section_fg_interactive': tinycolor(colors[2]).darken(50).desaturate(40),\n\n 'section_alternate_bg': tinycolor(colors[1]).lighten(30),\n 'section_alternate_fg': tinycolor(colors[0]).complement().lighten(70).desaturate(70),\n\n 'section_alternate_fg_highlight': tinycolor(colors[2]).lighten(40),\n 'section_alternate_fg_subdued': tinycolor(colors[1]).darken(50),\n\n // Alternate of reg. fg/bg interactive\n 'section_alternate_bg_interactive': tinycolor(colors[2]).saturate(50).darken(40),\n 'section_alternate_fg_interactive': tinycolor(colors[2]).lighten(60),\n\n 'h2': tinycolor(colors[1]).lighten(20),\n 'h3': tinycolor(colors[2]).lighten(30),\n 'h4': tinycolor(colors[2]).lighten(40),\n\n 'btnBorder': tinycolor(colors[2]).saturate(80).darken(40),\n 'btnHover': tinycolor(colors[1]).saturate(100)\n };\n }\n }\n },\n triadic: {\n dark: {\n cool: function(seed_color) {\n },\n warm: function(seed_color){\n }\n },\n light: {\n cool: function(seed_color) {\n\n },\n warm: function(seed_color){\n\n }\n }\n },\n tetradic: {\n dark: {\n cool: function(seed_color) {\n\n },\n warm: function(seed_color){\n\n }\n },\n light: {\n cool: function(seed_color) {\n\n },\n warm: function(seed_color){\n\n }\n }\n }\n };\n}", "title": "" }, { "docid": "94da5413191add3e0f1e83d63deeaa9e", "score": "0.5459892", "text": "function myStyle(feature) {\n return {\n radius: getSize(feature.properties.mag),\n fillColor: getColor(feature.properties.mag),\n weight: 1,\n opacity: 1,\n color: 'white', \n fillOpacity: 0.5\n }\n }", "title": "" }, { "docid": "18124bb5ad4985b64307577cbcd22bbb", "score": "0.5457258", "text": "function freeze (css) {\n\t\tvar obj = {}\n\t\tfor (var property in css) {\n\t\t\tobj[property] = css[property];\n\t\t}\n\t\treturn obj;\n\t}", "title": "" }, { "docid": "cacc2621742a8e3edc1102c4afdb7ddd", "score": "0.5416022", "text": "function generateCSS(tt_obj){\n\tlet out_css = '<style>';\n\tlet n_sessions = tt_obj.session_type.length;\n\tfor(let i = 0; i < n_sessions; i++){\n\t\tout_css += '.session-'+i+' {background-color:'+tt_obj.session_type[i].col+' !important;} ';\n\t}\n\tout_css += '</style>';\n\treturn out_css;\n}", "title": "" }, { "docid": "7266f7693f4b19c66508f83b8ad6edb3", "score": "0.54034936", "text": "function style() {\n return {\n fillColor: '#ff5722',\n weight: 2,\n opacity: 1,\n color: '#bdbdbd',\n dashArray: '3',\n fillOpacity: 0.25\n };\n}", "title": "" }, { "docid": "f7a5e96fe9a450c480f3084c71670624", "score": "0.5393056", "text": "function csaStyle() {\n\treturn {\n\t\tfillColor: 'gray',\n\t\tweight: 0.5,\n\t\topacity: 0.9,\n\t\tcolor: 'black',\n\t\tfillOpacity: 0.45\n\t};\n}", "title": "" }, { "docid": "80828733226c1cd414b7f93c63fac4b6", "score": "0.53906965", "text": "function style(feature) {\n return {\n radius: feature.properties.mag * 4,\n fillColor: getValue(feature.properties.mag),\n color: \"black\",\n weight: 1,\n opacity: 1,\n fillOpacity: 0.9\n }\n}", "title": "" }, { "docid": "25c0fa0ae810fc1a0b20888a50ea4df6", "score": "0.5376999", "text": "function ScrDiv()\n{\n addProps(this, arguments, ['id','x','y','w','h','v','par','lyr'], true);\n}", "title": "" }, { "docid": "0606bdf2a033d3fbc8e510f946674ff9", "score": "0.5371878", "text": "function generateRandomColor(){\n\n //rgb(0-255 0-255 0-255)\n\n let red, green, blue, style,\n head = 'rgb(';\n seperator = ' ';\n tail = ')';\n red = getRandomInt(0, 255);\n green = getRandomInt(0, 255);\n blue = getRandomInt(0, 255);\n\n style = head + red + seperator + green + seperator + blue + tail;\n return style;\n}", "title": "" }, { "docid": "90eb7605ee7f635cdff1b57477eea770", "score": "0.53703445", "text": "function getProperties(property, value) {\r\n switch (property) {\r\n case 'borderColor':\r\n return {\r\n borderTopColor: value,\r\n borderRightColor: value,\r\n borderBottomColor: value,\r\n borderLeftColor: value\r\n };\r\n\r\n default:\r\n var properties = {};\r\n properties[property] = value;\r\n return properties;\r\n }\r\n }", "title": "" }, { "docid": "f7343cf0adc173b963dc19a5687c97de", "score": "0.537032", "text": "static GetDrawStyle() {\n return {\n \"color\": \"#333\",\n \"size\": Number(document.getElementById(\"tb-draw-size\").value),\n \"fill\": \"none\",\n };\n }", "title": "" }, { "docid": "cfee4004b380da386c08bc7841e49428", "score": "0.53673476", "text": "function createShapeObj() {\n var shapeObj = {};\n shapeObj[\"width\"] = randNumForShape(shapeMinSise, shapeMaxSise);;\n shapeObj[\"height\"] = randNumForShape(shapeMinSise, shapeMaxSise);;\n var lenWidth = canvasWidth - shapeObj[\"width\"];\n shapeObj[\"left\"] = randNum(lenWidth);;\n var lenHeight = canvasHeight - shapeObj[\"height\"];\n shapeObj[\"top\"] = randNum(lenHeight);;\n shapeObj[\"backgroundColor\"] = randomColor();\n shapeObj[\"shapeType\"] = shapeType;\n return shapeObj;\n }", "title": "" }, { "docid": "89a15d12fc4749dae965c15c8524d9e6", "score": "0.5358695", "text": "boxStyle(options) {\n return {\n width: 60,\n height: 60,\n padding: 25,\n margin: 5,\n borderRadius: 10,\n backgroundColor: options\n }\n }", "title": "" }, { "docid": "415c1d613fd160b941f96c025645eb13", "score": "0.53551495", "text": "function r(e,t,n,o,i,a,r,s){for(var l=m[\"default\"](n,o,function(e,n){var o=t(n);return null==o?null:x[\"default\"](i[e],o,a[e])?null:{key:n.key,data:n.data,style:o}}),c=[],d=[],p=[],h=[],f=0;f<l.length;f++){for(var g=l[f],y=null,v=0;v<n.length;v++)if(n[v].key===g.key){y=v;break}if(null==y){var b=e(g);c[f]=b,p[f]=b;var w=u[\"default\"](g.style);d[f]=w,h[f]=w}else c[f]=i[y],p[f]=r[y],d[f]=a[y],h[f]=s[y]}return[l,c,d,p,h]}", "title": "" }, { "docid": "32f0ad86ac342638ff31ba843fefa57d", "score": "0.5343001", "text": "function getColors() {\n let hexCol = \"#\";\n\n for (i = 0; i < 6; i++) {\n let random = Math.floor(Math.random() * hashtag.length);\n hexCol += hashtag[random];\n }\n bodyBgc.style.backgroundColor = hexCol;\n hex.innerHTML = hexCol;\n}", "title": "" }, { "docid": "4f58203c81228f7bdc2a6171fff3e78e", "score": "0.5340935", "text": "function css( el, props ) {\n\t\tvar key, pkey, css = {};\n\t\tfor ( key in props ) {\n\t\t\tif ( props.hasOwnProperty(key) ) {\n\t\t\t\tpkey = pfx(key);\n\t\t\t\tif ( pkey != null ) {\n\t\t\t\t\tcss[pkey] = props[key];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$(el).css(css);\n\t\treturn el;\n\t}", "title": "" }, { "docid": "55364ec1d89a6d268621ad1edce075f4", "score": "0.5334203", "text": "function addStyleProperties(divElement, styleObject) {\r\n for (key in styleObject) {\r\n if (styleObject.hasOwnProperty(key)) {\r\n divElement.style[key] = styleObject[key]; \r\n }\r\n }\r\n }", "title": "" }, { "docid": "9bbb96e6a5410b838e56146644247488", "score": "0.5329636", "text": "function _styleFromObject(obj, options){\n options = _extend({\n inline: true,\n indent: ''\n }, options)\n\n // Trailing semi should only exist on when we aren't indenting\n options.semi = !options.inline;\n\n var out = \"\",\n\n // Sort keys to create consistent output\n keys = _keys(obj).sort(),\n\n // Support indention and inlining\n indent = options.indent != null ? options.indent : '',\n newline = options.inline ? '' : '\\n',\n ix, k, kFancy, semi\n\n for (ix = 0; ix < keys.length; ix++){\n kFancy = keys[ix]\n\n // Add semi if it is not inline or it is not the last key\n semi = options.semi || ix !== keys.length - 1 ? \";\" : ''\n\n // Allow keys to be camal case\n k = _dasherize(kFancy)\n\n // Collect css result for this key\n out += \"\" + indent + k + \":\" + obj[kFancy] + semi + newline\n }\n return out\n }", "title": "" }, { "docid": "51a12a98a59bb1c816b7f818725e3250", "score": "0.53246546", "text": "function _styleFromObject(obj, options){\n options = _extend({\n inline: true,\n indent: ''\n }, options)\n\n // Trailing semi should only exist on when we aren't indenting\n options.semi = !options.inline\n\n var out = \"\",\n\n // Sort keys to create consistent output\n keys = _keys(obj).sort(),\n\n // Support indention and inlining\n indent = options.indent != null ? options.indent : '',\n newline = options.inline ? '' : '\\n',\n ix, k, kFancy, semi\n\n for (ix = 0; ix < keys.length; ix++){\n kFancy = keys[ix]\n\n // Add semi if it is not inline or it is not the last key\n semi = options.semi || ix !== keys.length - 1 ? \";\" : ''\n\n // Allow keys to be camal case\n k = _dasherize(kFancy)\n\n // Collect css result for this key\n out += \"\" + indent + k + \":\" + obj[kFancy] + semi + newline\n }\n return out\n }", "title": "" }, { "docid": "1756ba389078d6fb4488620dcba458c0", "score": "0.5322785", "text": "function getRandomColor2(){\n var r = getRandomIntInclusive(0, 255);\n var g = getRandomIntInclusive(0, 255);\n var b = getRandomIntInclusive(0, 255);\n divA.style.backgroundColor = '#' + r.toString(16) + g.toString(16) + b.toString(16);\n}", "title": "" }, { "docid": "831174452e76dd52fb80cc87387ddc44", "score": "0.5314251", "text": "function createChosenBox(){\n chosenBox = document.getElementById(boxRandom); //box that has the right color\n // to make chosenBox's background to be the color indicated in header\n chosenBox.style.background = \"rgb(\"+Number(red.textContent)+\",\"+Number(green.textContent)+\",\"+Number(blue.textContent)+\")\";\n\n}", "title": "" }, { "docid": "1d4f6e32875b96f159791325b518da14", "score": "0.5299226", "text": "function getStyle(features) {\n return {\n fillColor: getColor(features.geometry.coordinates[2]),\n radius: getRadius(features.properties.mag),\n weight: 0.5,\n stroke: true,\n opacity: .09,\n fillOpacity: 0.7\n };\n }", "title": "" }, { "docid": "3b0f27e47fa661f1f8c6f45308ce3a75", "score": "0.5296033", "text": "function polystyle(feature) {\n return {\n fillColor: getColor(feature.properties.noOfCrimes),\n weight: 2,\n opacity: 1,\n color: 'white',\n dashArray: '3',\n fillOpacity: 0.7\n };\n}", "title": "" }, { "docid": "b67ac613bd7adb32888c86b370afdd49", "score": "0.52929676", "text": "function randomColor(){\n var r= Math.floor(Math.random()*256);\n var g= Math.floor(Math.random()*256);\n var b= Math.floor(Math.random()*256);\n return {r: r, g: g, b: b};\n}", "title": "" }, { "docid": "09204110ed7ed78c84198931962e804a", "score": "0.5292289", "text": "toString(options) {\n return toCss(this.key, this.style, options)\n }", "title": "" }, { "docid": "b79d8a031bb9df473b7c38a727cc75aa", "score": "0.52869254", "text": "function randomColor_hsla(){\n\tvar h = Math.random() * (360 - 0) + 0;\n\tvar s = Math.random() * (100 - 0) + 0;\n\tvar l = Math.random() * (100 - 0) + 0;\n\tvar a = 0.5;\n\n\tvar c = {\n\t\t'h': Math.round(h),\n\t\t's': Math.round(s),\n\t\t'l': Math.round(l),\n\t\t'a': a\n\t}\n\n\treturn c\n}", "title": "" }, { "docid": "3d8067915b06c1fb97a8947a4945420e", "score": "0.52824533", "text": "function dynamicColor(){\n r = Math.floor(Math.random() * 255);\n g = Math.floor(Math.random() * 255);\n b = Math.floor(Math.random() * 255);\n color = \"rgba(\" + r + \", \" + g + \", \"+ b + \", 0.4)\";\n return color;\n}", "title": "" }, { "docid": "b1aca4bb280854eb595ee29c759a917c", "score": "0.5278313", "text": "function randomBackgroundColor() {\n let x,y,z;\n x = Math.floor(Math.random() * 256);\n y = Math.floor(Math.random() * 256);\n z = Math.floor(Math.random() * 256);\n let backgroundColor = `rgb( ${x}, ${y}, ${z})`;\n return document.body.style.background = backgroundColor;\n}", "title": "" }, { "docid": "28f6e3a8cf4227fb755dff30fff0e115", "score": "0.52776927", "text": "function styleInfo(feature) {\n return {\n opacity: 1,\n fillOpacity: 0.75,\n fillColor: getColor(feature.properties.mag),\n color: \"#000099\",\n radius: getRadius(feature.properties.mag),\n stroke: false,\n weight: 0.75\n };\n }", "title": "" }, { "docid": "56c91f53f072cd1e29bdc5d78e4b7e71", "score": "0.52742565", "text": "function addStyleProperties(divElement, styleObject) {\n for (key in styleObject) {\n if (styleObject.hasOwnProperty(key)) {\n divElement.style[key] = styleObject[key]; \n }\n }\n }", "title": "" }, { "docid": "070a41068795f9caeb40dfea07937e90", "score": "0.527424", "text": "getStyles () {\n const properties = [\n 'color',\n 'font-family',\n 'font-size',\n 'font-smoothing',\n 'font-style',\n 'font-variant',\n 'font-weight',\n 'line-height',\n 'letter-spacing',\n 'text-align',\n 'text-decoration',\n 'text-shadow',\n 'text-transform',\n ]\n const $textField = $(`\n <div class=\"form-item form-type-stripe-payment-field\">\n <input type=\"text\" class=\"default\" />\n </div>\n <div class=\"form-item form-type-stripe-payment-field\">\n <input type=\"text\" class=\"error invalid\" />\n </div>`\n ).hide().appendTo(this.$element)\n const options = {}\n // copy base styles\n let styles = window.getComputedStyle($textField.find('input.default').get(0))\n for (const p of properties) {\n const styleOption = camelCase(p)\n deepSet(options, ['base', styleOption], styles.getPropertyValue(p))\n }\n // copy error color\n styles = window.getComputedStyle($textField.find('input.error').get(0))\n deepSet(options, ['invalid', 'color'], styles.getPropertyValue('color'))\n // tidy up\n $textField.remove()\n return options\n }", "title": "" }, { "docid": "cda5c8c677b0ba50fdb0ba8c63f704ee", "score": "0.526774", "text": "static get properties() {\n return {\n /**\n * The id of the swatch (`color_index`)\n */\n swatchId: {\n attribute: \"swatch-id\",\n type: String,\n },\n /**\n * The swatch name (`color-shade`)\n */\n swatchName: {\n attribute: \"swatch-name\",\n type: String,\n },\n };\n }", "title": "" }, { "docid": "b009283b1ea8a438712cc09035a89d71", "score": "0.52649814", "text": "constructor()\r\n {\r\n this.colors = {\r\n reset: init(0, 0),\r\n bold: rawInit(\"\\x1b[1m\", \"\\x1b[22m\", /\\x1b\\[22m/g, \"\\x1b[22m\\x1b[1m\"),\r\n dim: rawInit(\"\\x1b[2m\", \"\\x1b[22m\", /\\x1b\\[22m/g, \"\\x1b[22m\\x1b[2m\"),\r\n italic: init(3, 23),\r\n underline: init(4, 24),\r\n inverse: init(7, 27),\r\n hidden: init(8, 28),\r\n strikethrough: init(9, 29),\r\n black: init(30, 39),\r\n red: init(31, 39),\r\n green: init(32, 39),\r\n yellow: init(33, 39),\r\n blue: init(34, 39),\r\n magenta: init(35, 39),\r\n cyan: init(36, 39),\r\n white: init(37, 39),\r\n gray: init(90, 39),\r\n bgBlack: init(40, 49),\r\n bgRed: init(41, 49),\r\n bgGreen: init(42, 49),\r\n bgYellow: init(43, 49),\r\n bgBlue: init(44, 49),\r\n bgMagenta: init(45, 49),\r\n bgCyan: init(46, 49),\r\n bgWhite: init(47, 49),\r\n blackBright: init(90, 39),\r\n redBright: init(91, 39),\r\n greenBright: init(92, 39),\r\n yellowBright: init(93, 39),\r\n blueBright: init(94, 39),\r\n magentaBright: init(95, 39),\r\n cyanBright: init(96, 39),\r\n whiteBright: init(97, 39),\r\n bgBlackBright: init(100, 49),\r\n bgRedBright: init(101, 49),\r\n bgGreenBright: init(102, 49),\r\n bgYellowBright: init(103, 49),\r\n bgBlueBright: init(104, 49),\r\n bgMagentaBright: init(105, 49),\r\n bgCyanBright: init(106, 49),\r\n bgWhiteBright: init(107, 49)\r\n };\r\n this.symbols = {\r\n info: supported? this.colors.blue('ℹ'): this.colors.blue('i'),\r\n warning: supported? colors.yellow('⚠'): this.colors.yellow('‼'),\r\n error: supported? this.colors.red('✖'): this.colors.red('×')\r\n };\r\n }", "title": "" }, { "docid": "519d1e42daa69b0914c4fa69d931ba88", "score": "0.5260904", "text": "function randomClasses(element) {\n element.classList.add(styleGroup[Math.floor(Math.random() * 3)]);\n element.classList.add(sizeGroup[Math.floor(Math.random() * 3)]);\n element.classList.add(rotationGroup[Math.floor(Math.random() * 2)]);\n element.classList.add(inclinationGroup[Math.floor(Math.random() * 2)]);\n}", "title": "" }, { "docid": "9d80dff2649a4c89ede90c76b7436999", "score": "0.52571124", "text": "constructor() {\r\n this.x = random(width);\r\n this.y = random(height);\r\n this.diameterx = random(width/width, width/100);\r\n this.diametery = random(height/height, height/100);\r\n this.speedx = random(5,15);\r\n this.speedy = random(5,15);\r\n this.colorR = random(255);\r\n this.colorG = random(255);\r\n this.colorB = random(255);\r\n this.starAlpha = random(0,10);\r\n }", "title": "" }, { "docid": "7fef84dc67526cde3193cdcd3965cdf8", "score": "0.5254494", "text": "cramp() {\n return styles[cramp[this.id]];\n }", "title": "" }, { "docid": "eee864b13cf8b198f3d1e4d29c20bdd4", "score": "0.5249632", "text": "function getRandomColor(){\r\n\t// for hsla\r\n\tthis.hue = getRandom( hue - 20, hue + 20 );\r\n\tthis.brightness = getRandom( 50, 80 );\r\n\tthis.alpha = 1;\r\n\t//for RGBA\r\n\tvar red = Math.round(Math.random()*200+55);\r\n\tvar green = Math.round(Math.random()*200+55);\r\n\tvar blue=Math.round(Math.random()*200+55);\r\n\tvar alpha=0.5;\r\n\t// var color='rgb('+red+','+green+','+blue+') ';\r\n\t// OR\tif you want to change alpha\r\n\t// var color='rgba('+red+','+green+','+blue+',0.50)'; // 0.50\r\n\tvar color='hsla(' + this.hue + ', 100%, ' + this.brightness + '%, ' + this.alpha + ')';\r\n\r\n\treturn color;\r\n}", "title": "" }, { "docid": "049a421d27be1d46ff8364017bd13042", "score": "0.52474827", "text": "function setRandomizer() {\n\tbody.style.background = \"linear-gradient(to right, \" + getRandomRgb() + \", \" + getRandomRgb() + \")\";\n\n\tcss.textContent = body.style.background + \";\";\n\n}", "title": "" }, { "docid": "a583c9f88b895768f9f6cfe91ed868a4", "score": "0.5246099", "text": "function colorIt() {\r\n\t\tvar rects = document.querySelectorAll(\"#rectanglearea .rectangle\");\r\n\t\tvar r = Math.floor(Math.random() * 256);\r\n\t\tvar g = Math.floor(Math.random() * 256);\r\n\t\tvar b = Math.floor(Math.random() * 256);\r\n\t\tvar c = 3\r\n\t\tfor(var i = 0; i < rects.length; i++) {\r\n\t\t var r1 = r + i * c;\r\n\t\t var g1 = g + i * c;\r\n\t\t var b1 = b + i * c;\r\n\t\t\trects[i].style.backgroundColor = \"rgb(\" + r1 + \", \" + g1 + \", \" + b1 + \")\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "b23e5a564bad1396b979f3ddd61b832b", "score": "0.5246007", "text": "createCss_(pos) {\r\n return toCssText({\r\n \"z-index\": `${this.cluster_.getMarkerClusterer().getZIndex()}`,\r\n top: coercePixels(pos.y),\r\n left: coercePixels(pos.x),\r\n width: coercePixels(this.style.width),\r\n height: coercePixels(this.style.height),\r\n cursor: \"pointer\",\r\n position: \"absolute\",\r\n \"-webkit-user-select\": \"none\",\r\n \"-khtml-user-select\": \"none\",\r\n \"-moz-user-select\": \"none\",\r\n \"-o-user-select\": \"none\",\r\n \"user-select\": \"none\"\r\n });\r\n }", "title": "" }, { "docid": "aa36c7fc742e2bdc1f3ae737af01a650", "score": "0.5244509", "text": "function newdiv(data, style, id) {\n\tvar box = document.createElement('DIV');\n\t\n\ttry {\n\t\tbox.appendChild(document.createTextNode(data));\n\t\toutput.appendChild(box);\n\t\tbox.id = id;\n\t\tbox.setAttribute(\"style\", style);\n\t} catch (e) {\n\t\tbox.text = data;\n\t\tbox.id = id;\n\t\tbox.setAttribute(\"style\", style);\n\t\toutput.appendChild(box);\n\t}\n\t\n\tvar object = document.getElementById(id);\n\tobject.style.height = \"auto\";\n\treturn object;\n}", "title": "" }, { "docid": "f95d3f8bc655f92d77316e31315cf0b3", "score": "0.52428377", "text": "function RandombackgroundColor(){\n //this method was adapted from https://dev.to/akhil_001/generating-random-color-with-single-line-of-js-code-fhj\n var randomColor = '#'+Math.floor(Math.random()*16777215).toString(16);\n document.body.style.background = randomColor;\n return randomColor;\n}", "title": "" }, { "docid": "64f577a1e0c58a366bf1a565ce8243dd", "score": "0.52402425", "text": "function paintDOM() {\n var selectedColorCombo = randomElement(possibleColorCombos);\n var body = document.getElementsByTagName(\"body\")[0];\n var header = document.getElementsByTagName(\"h1\")[0];\n var subheader = document.getElementsByTagName(\"h2\")[0];\n // Body/sweeping\n body.style.background = selectedColorCombo.tertiary;\n body.style.color = selectedColorCombo.secondary;\n // Heading 1\n header.style.background = selectedColorCombo.primary;\n header.style.color = selectedColorCombo.tertiary;\n header.style.textShadow = \"5px 9px \" + selectedColorCombo.secondary;\n // Heading 2\n subheader.style.color = selectedColorCombo.primary;\n subheader.style.textShadow = \"3px 5px \" + selectedColorCombo.secondary;\n // All Heading 3s\n var allH3s = Array.prototype.slice.call(document.getElementsByTagName(\"h3\"));\n for(var h3Index = 0; h3Index < allH3s.length; h3Index++) {\n allH3s[h3Index].style.color = selectedColorCombo.secondary;\n allH3s[h3Index].style.textShadow = \"2px 4px \" + selectedColorCombo.primary;\n }\n // All links\n var allLinks = Array.prototype.slice.call(document.getElementsByTagName(\"a\"));\n for(var linkIndex = 0; linkIndex < allLinks.length; linkIndex++) {\n allLinks[linkIndex].style.color = selectedColorCombo.primary;\n allLinks[linkIndex].style.textShadow = \"1px 1px \" + selectedColorCombo.secondary;\n }\n}", "title": "" }, { "docid": "d18895233db5f7a7628468137bfdb3a8", "score": "0.5238844", "text": "function RandomColorGenerator() {\n this.hue = Math.random();\n this.goldenRatio = 0.618033988749895;\n this.hexwidth = 2;\n}", "title": "" }, { "docid": "78f1b2eb9c79c195daf08a5b7d8d4415", "score": "0.5236501", "text": "function randomColorsMaker() {\n var red = Math.floor((Math.random() * 256));\n var green = Math.floor((Math.random() * 256));\n var blue = Math.floor((Math.random() * 256));\n var color = 'rgb(' + red + ', ' + green + ', ' + blue + ')';\n return color;\n}", "title": "" }, { "docid": "43d7ec11713632df6108db52e25f7d99", "score": "0.52334726", "text": "function paintRandom() {\n\tlet r,g,b;\n\tlet ranColVal = (num) => {\n\t\treturn Math.ceil((Math.random() * num));\n\t};\n\tr = ranColVal(200);\n\tif (r > 150) {\n\t\tg = ranColVal(100);\n\t} else {\n\t\tg = ranColVal(200);\n\t\tif (r < 50) {\n\t\t\tg = ranColVal(50) + 100;\n\t\t}\n\t}\n\tif (r > 150 || g > 150) {\n\t\tb = ranColVal(100);\n\t} else {\n\t\tb = ranColVal(200);\n\t\tif (r < 50 || g < 50) {\n\t\t\tb = ranColVal(50) + 100;\n\t\t}\n\t}\n\t\n\tlet colorOne = \"rgb(\" + r + \",\" + g + \",\" + b + \")\",\n\t colorTwo = \"rgb(\" + (r + 50) + \",\" + (g + 50) + \",\" + (b + 50) + \")\",\n\t colorThree = \"rgb(\" + (r + 75) + \",\" + (g + 75) + \",\" + (b + 75) + \")\",\n\t colorFour = \"rgb(\" + (r + 100) + \",\" + (g + 100) + \",\" + (b + 100) + \")\";\n\t \n\treturn [colorOne, colorTwo, colorThree, colorFour];\n}", "title": "" }, { "docid": "ce990d7d6619d3b9d425fef1a9a6a610", "score": "0.52277905", "text": "function styleInfo(feature) {\n return {\n opacity: 1,\n fillOpacity: 1,\n fillColor: getColor(feature.properties.mag),\n color: \"#000000\",\n radius: getRadius(feature.properties.mag),\n stroke: true,\n weight: 0.5\n };\n}", "title": "" }, { "docid": "1ff17e82a119d6f8cf7cf94a9b1735e5", "score": "0.52270085", "text": "renderCss() {\n let css = {};\n let someCss = false;\n for (let type of ['cssGlobal', 'cssLocal', 'cssInstance']) {\n if (this[type]) {\n let rawCss = this[type]();\n if (rawCss) {\n css[type] = this._normalizeCss(rawCss);\n someCss = true;\n }\n }\n }\n return someCss ? css : undefined;\n }", "title": "" }, { "docid": "fe0e87b0ddc76e3bb63e4db32c8a0a94", "score": "0.52231205", "text": "function makeDiv(inColor) {\n let myDiv = document.createElement(\"div\");\n myDiv.style.backgroundColor = inColor;\n myDiv.style.paddingBottom = \"11.1%\";\n myDiv.style.width = \"11.1%\";\n myDiv.style.float = \"left\";\n return myDiv;\n}", "title": "" } ]
f0de8b32e86afd6d09d5fd7bf31584fe
To enable or disable the Order Status Tab Call IsAuthorizedForTeams() to determine whether the current user belongs to accessible or not? readonly user group? readwrite user group?
[ { "docid": "a272357ddc32821d909130b61c8b5e16", "score": "0.6915657", "text": "function EnableOrderStatusTab()\n{\n\ttry\n\t{\n\t\tif( DebugModeProject ) \n\t\t\twindow.alert( \"function EnableOrderStatusTab()\" );\n\t\tvar user_r = IsAuthorizedForTeams( ['Project Order Status - R'] );\n\t\tvar user_rw = IsAuthorizedForTeams( ['Project Order Status - RW'] );\n\t\t\n\t\tif( user_r != true && user_rw != true )\n\t\t\tHideOneTab( 'tab_OrderStatus' );\n\t\telse \n\t\t{\n\t\t\tShowOneTab( 'tab_OrderStatus' );\n\t\t\tvar osf = [ \"new_orderstatus\", \"new_adtechpotoverint\", \"new_adtechordersubmitdate\", \"new_verintso\", \"new_ordercompletiondate\" ]; \n\t\t\tfor( var i = 0; i < 5; i++ )\n\t\t\t\tmySetDisabled( osf[ i ], user_rw ? false : true );\n\t\t}\t\n\t}\n\tcatch( err )\n\t{\n\t\tif( DebugModeProject ) window.alert( \"function EnableOrderStatusTab() error code \" + err );\n\t}\n}", "title": "" } ]
[ { "docid": "874f29b5184510d11f899bd133a90162", "score": "0.62943524", "text": "canAdministrateTeam(team) {\n return this.canAdministrateGroup(team)\n }", "title": "" }, { "docid": "ad210a95f957af6ee73e5911f4b1f27f", "score": "0.6037353", "text": "function checkAdmin() {\n if (member) {\n axios.get('http://localhost:3001/api/groups/' + gid +'/isAdmin')\n .then((response) => \n {\n if (response.data.isAdmin) {\n return true\n } else {\n return false\n }\n } \n )\n }\n }", "title": "" }, { "docid": "c557c765dc911e9457680d522de542c8", "score": "0.5960722", "text": "async authorize () {\n\t\tthis.teamId = this.request.params.teamId.toLowerCase();\n\t\tif (!await this.user.authorizeTeam(this.teamId)) {\n\t\t\tthrow this.errorHandler.error('updateAuth', { reason: 'user must be a member of the team' });\n\t\t}\n\t}", "title": "" }, { "docid": "312703f26e9e3abe6db3c053d4957c02", "score": "0.59149575", "text": "function is_admin() {\n\n try {\n token = get_auth_token();\n payload = window.atob( token.split(\".\")[1]);\n groups = JSON.parse(payload)[\"cognito:groups\"];\n ret = groups.includes(\"SkillApp-Cognito-Admin-Group\");\n\n } catch(err) {\n ret = false;\n console.log(err);\n }\n\n return ret;\n\n}", "title": "" }, { "docid": "b644f894dedc104b601821063a6c90a6", "score": "0.58490604", "text": "elevatedPermissions() {\n return store.getState().loggedIn && (store.getState().permissions === 'ADMINISTRATOR' || store.getState().permissions === 'MANAGER');\n }", "title": "" }, { "docid": "bb0b730e91ae38a38146e5cbbebc38a4", "score": "0.5782448", "text": "isAdmin(){\n\t\treturn Roles.userIsInRole(this._id, 'admin');\n\t}", "title": "" }, { "docid": "da4389094ca977f61a48c1e669c38264", "score": "0.576198", "text": "canManage(project) {\n if (!this.isLoggedIn()) {\n return false\n }\n\n return !!_find(this.user.groups, userGroup =>\n userGroup.groupType === SUPERUSER_GROUP_TYPE ||\n _find(project.groups, {id: userGroup.id})\n )\n }", "title": "" }, { "docid": "cd50c4ffa326e2f20da45fc2b77c48e7", "score": "0.5752281", "text": "async isTokenEnabled(){\n let enabledStatuses = await this.getEnabledStatuses(this.state.USER_ACCOUNT)\n // Checking to see if TOKEN is enabled\n return enabledStatuses.data.some(token => {\n if (token.id.toLowerCase() == this.TOKEN_ADDRESS.toLowerCase()) {\n return token.enabled\n }\n })\n }", "title": "" }, { "docid": "ccb652c0325c082996191684bf1dc4eb", "score": "0.572812", "text": "function processAccess(status) {\n if (status) {\n // Get the selected org ID\n orgID = $(\"#cbOrg\").find('option:selected').val();\n currentOrg = getCurrentOrganization(orgID, Organizations);\n loadForm();\n }\n else\n {\n alert(\"The current user does not have permissions for the selected Organization. Please contact your administator.\")\n }\n }", "title": "" }, { "docid": "73995de1efe01405c5fb1cf6c17e8f7a", "score": "0.5696778", "text": "enableMarketPlaceRole(){\n marketPlaceRoles.marketplaceSetting(\"Roles\");\n marketPlaceRoles.marketPlaceRoleSettingEnableDisable(\"Invoice Builder\",true);\n }", "title": "" }, { "docid": "7061371fb439bc93d841f808cb6dca24", "score": "0.5687939", "text": "isAdmin(req, res, next) {\n let userRol = req.user.userRol;\n let userStatus = req.user.userStatus;\n\n if (userRol === \"Admin\" && userStatus === \"Enabled\") {\n next();\n } else {\n res.status(401).json({ msg: \"Unauthorized user\" });\n }\n }", "title": "" }, { "docid": "069abbbddc00fdab8bdc5975a41f27e2", "score": "0.5673129", "text": "function confirmsAdminInGroup() {\n var adminInGroup = false;\n for (var i = 0; i < $scope.group.users.length; i++) {\n if ($scope.group.user_admin === $scope.group.users[i]) {\n adminInGroup = true;\n }\n };\n // Adds admin if it is not in the group and shows alert to user\n if (!adminInGroup) {\n $scope.group.users.unshift($scope.group.user_admin);\n $scope.showAlert('The group administrator cannot be deleted from the group');\n }\n }", "title": "" }, { "docid": "06a37634c1b585277c73bf2c5258bbd8", "score": "0.56676054", "text": "function can_access_list(user, data){\n if (data['scope'] == 'public'){\n return true\n }\n else if (data['scope'] == 'private' &&\n data['owner'] != user &&\n data['admins'].indexOf(user) == -1 &&\n data['members'].indexOf(user) == -1){\n return false\n }else{\n return true\n }\n}", "title": "" }, { "docid": "c58b6eaa66c34e5a3f9b915b460672f8", "score": "0.56467754", "text": "isAdmin(){\n return this.isUserRole(Authorization.ROLE_ADMIN);\n }", "title": "" }, { "docid": "6d3d1438f04288ed429825ee5fc9f178", "score": "0.56309", "text": "isAdmin(state) {\n if (state.user) {\n if (state.user.role === \"admin\") {\n return true\n }\n }\n return false\n }", "title": "" }, { "docid": "cdd0c3bdc278775e1c20780c2751b261", "score": "0.5630097", "text": "isAdmin(){\r\n if(this.admin) return true;\r\n else return false;\r\n }", "title": "" }, { "docid": "35850e05ae5060b406f1a6e5620c3eb3", "score": "0.5624342", "text": "function hasAuthorization(gameID,user){\n let privacy = getGame(gameID).privacy\n if(privacy == 'private'){\n return 0;\n }\n else{\n if(privacy == 'friends_only'){\n let players = getGame(gameID).players\n let friends = getuser(players[0]).friend.concat(getuser(players[1]).friend)\n if(players.includes(user)){\n return 1;\n }\n if(friends.includes(user)){\n // console.log(\"user can view game\")\n return 1;\n }\n else{\n // console.log(\"user cannot view game line 323\")\n return 0;\n }\n }\n }\n}", "title": "" }, { "docid": "5eb104055080111acbc84d0b45dbc18b", "score": "0.5588013", "text": "_hasAccess(access, indexedRoles, isOwner) {\n if (!Array.isArray(access)) {\n access = [access];\n }\n\n let has = false;\n\n access.forEach((role) => {\n if (\n indexedRoles[role] ||\n (isOwner && (role === Roles.ID_OWNER || role === Roles.OWNER))\n ) {\n has = true;\n return false;\n }\n });\n\n return has;\n }", "title": "" }, { "docid": "cd57b4b3b77ed791375571ec775a6c5a", "score": "0.55789286", "text": "isAdmin() {\n const user = store.getters.getUser;\n if (user) {\n return user.roles\n ? user.roles.some(role => role.name === \"admin\") ||\n user.is_admin\n : false;\n }\n return false;\n }", "title": "" }, { "docid": "bea3e63176fa22b7b68f7713bdc16b56", "score": "0.5571827", "text": "function Foo(t){\n \n if( !req.user){\n return false;\n }\n\n if(req.user.permissions.includes(t)){\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "7d816ec928d70fe268c644b41dffa125", "score": "0.55697227", "text": "isAdmin() {\n const { auth } = this.props;\n const project_url = this.props.match.params.projectUrl;\n return auth.role === 'admin' && auth.adminProjects.includes(project_url);\n }", "title": "" }, { "docid": "9b1b223640099fdb7d6f778c433f504c", "score": "0.55531305", "text": "allow(userId) {\n //Chequea que solo el usuario administrador tenga acceso a ver la tabla animadores\n var usuario=Meteor.users.findOne({_id:userId});\n var salida=false;\n if (usuario.rol===\"Administrador\") {salida=true};\n //console.log(\"salida allow - TabularTables.inscriptosTab: \"+salida);\n return salida; // don't allow this person to subscribe to the data\n }", "title": "" }, { "docid": "9b1b223640099fdb7d6f778c433f504c", "score": "0.55531305", "text": "allow(userId) {\n //Chequea que solo el usuario administrador tenga acceso a ver la tabla animadores\n var usuario=Meteor.users.findOne({_id:userId});\n var salida=false;\n if (usuario.rol===\"Administrador\") {salida=true};\n //console.log(\"salida allow - TabularTables.inscriptosTab: \"+salida);\n return salida; // don't allow this person to subscribe to the data\n }", "title": "" }, { "docid": "9b1b223640099fdb7d6f778c433f504c", "score": "0.55531305", "text": "allow(userId) {\n //Chequea que solo el usuario administrador tenga acceso a ver la tabla animadores\n var usuario=Meteor.users.findOne({_id:userId});\n var salida=false;\n if (usuario.rol===\"Administrador\") {salida=true};\n //console.log(\"salida allow - TabularTables.inscriptosTab: \"+salida);\n return salida; // don't allow this person to subscribe to the data\n }", "title": "" }, { "docid": "9872562600f3521826e97d67cb09e904", "score": "0.5543167", "text": "hasDashboardAccess(nextProps) {\n let props = this.props;\n if (nextProps !== undefined) {\n props = nextProps;\n }\n\n // For anything that is not a dashboard, return true.\n if (!props.location.pathname.includes(\"dashboard\")) {\n return true;\n }\n\n const userGroups = groups(props.user);\n\n if (userGroups.length === 0) {\n console.error(\"This user does not seem to belong to any groups. Application access will be severely limited.\");\n }\n\n // If the user is in the \"administrator\" group then just return true.\n // They have access to everything.\n if (isAdmin(props.user)) {\n return true;\n }\n\n // Note: It is possible that a dashboard loads without being configured.\n // This would mean that `props.activeDashboard` would be undefined.\n // These are path based dynamic dashboards (dashboard \"types\") and can have an entry\n // in configuration (currently dashboardState.json) but do not necessarily need one.\n // So the default behavior here will be to block access to these dashboards unless\n // the user is in the \"administrator\" group.\n \n const activeDashboard = _.find(dashboardState.dashboards, {\n id: this.props.params.id || dashboardState.activeDashboard\n })\n \n const dashboardGroups = activeDashboard && activeDashboard.groups ? activeDashboard.groups : [];\n\n if (activeDashboard === undefined) {\n dashboardGroups.push(\"administrator\");\n }\n\n if (userGroups.length > 0 && dashboardGroups.length > 0) {\n if (_.intersection(userGroups, dashboardGroups).length > 0) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "bbd4207dd688b8fcb1968f50ae569edb", "score": "0.55398005", "text": "isRoleAdmin(authContext, something) {\n return true;\n }", "title": "" }, { "docid": "e8b94506e050ef585be8f2eb152394d7", "score": "0.55268234", "text": "isAdmin() {\n return this.cookieService.get('auction_role') == 'admin';\n }", "title": "" }, { "docid": "a0b2b41287d97db33129704c3070a1a8", "score": "0.55253845", "text": "function test_disabling_dashboard_under_service_ui_for_a_role_shall_disable_the_dashboard() {}", "title": "" }, { "docid": "b46f8debc418bf13045b536611264ee8", "score": "0.55071956", "text": "isTeamMember () {\n let contributor = this.contributor();\n if (contributor) {\n return contributor.participatingTeams().count() > 0\n }\n }", "title": "" }, { "docid": "0b9510b9c1f663ce6cebf12606f0909a", "score": "0.5502247", "text": "function isAdminUser() {\n return true;\n}", "title": "" }, { "docid": "100a253b6d2b903f613b623342fe0ad8", "score": "0.5501511", "text": "is_authorized(authorized_groups) {\n // for each authorized group, check if the current user belong to one of them\n for (var group of authorized_groups) {\n if (! (group in this.groups)) continue\n if (this.groups[group].includes(this.username)) return true\n }\n return false\n }", "title": "" }, { "docid": "d9506566f4df6983b28d6017cc5a1137", "score": "0.5494198", "text": "isAdmin() {\n const data = localStorage.getItem('simpleAdminApp');\n if (!data) return false;\n const { user } = JSON.parse(data);\n return !!(user && user.role && user.role === 1);\n }", "title": "" }, { "docid": "011860f9a07fe66c8ff3fafe7386bb0c", "score": "0.5493801", "text": "isAdmin () {\n return this.deploy().then((instance) => {\n return instance.isAdmin({from: this.account})\n })\n }", "title": "" }, { "docid": "57048a08f9fc8f54d06fb117ee097305", "score": "0.54912543", "text": "function EnableEstiamted( show_me )\n{\n\ttry\n\t{\n\t\tvar toDisable = ( IsAuthorizedForTeams( ['Service Mgmt'] ) == true ) ? false : true;\n\t\t\n\t\tif( DebugModeProject ) \n\t\t\twindow.alert( \"function EnableEstiamted\\nshow_me = \" + show_me.toString() + \"\\ntoDisable = \" + toDisable.toString());\n\t\t\n\t\tshow_me -= 11;\n\t\tfor( var i = 0; i < 8; i++ )\n\t\t\tmySetDisabled( gdf[ show_me ][ i ], toDisable );\n\t}\n\tcatch( err )\n\t{\n\t\tif( DebugModeProject ) window.alert( \"function EnableEstiamted error code \" + err );\n\t}\n}", "title": "" }, { "docid": "c4979a88c894dcfb0cb7a22fd96f16e8", "score": "0.5485527", "text": "get locked() {\n const { users, roles, guilds, channels, permissions } = this.private;\n return !!(users || roles || guilds || channels || permissions);\n }", "title": "" }, { "docid": "5fb42e8bf50773bd1697edbab21c8b03", "score": "0.5450214", "text": "function allowedChangeStatus() {\n return $scope.post.allowed_privileges && $scope.post.allowed_privileges.indexOf('change_status') !== -1;\n }", "title": "" }, { "docid": "a07c207a2ff4d283585e946e9f2b7be5", "score": "0.5449814", "text": "_canControl(user, event) {\n if (canvas.controls.ruler.active) return false;\n const tool = game.activeTool;\n if (tool === \"target\") return true;\n return game.user.isGM || (this.location && this.location.hasPerm(user, \"OWNER\"));\n }", "title": "" }, { "docid": "3787f5736310b1b0084a0464a8fc4b49", "score": "0.5433821", "text": "function EnableSignedSOWReceived()\n{\n\ttry\n\t{\n\t\tif( DebugModeProject ) \n\t\t\twindow.alert( \"function EnableSignedSOWReceived()\" );\n\t\tvar user_r_only = IsAuthorizedForTeams( ['Project Signed SOW Received'] ) ? false : true;\t\t\n\t\tmySetDisabled( 'cust_signedsowreceived', user_r_only );\n\t}\n\tcatch( err )\n\t{\n\t\tif( DebugModeProject ) window.alert( \"function EnableSignedSOWReceived() error code \" + err );\n\t}\n}", "title": "" }, { "docid": "ad3d937426cacbb68dca196907eade50", "score": "0.5432673", "text": "function updateIsAdmin() {\n\n GET('api/get/currentUser/isAdmin',\n (response) => {\n if (response == 'true') {\n Auth.isAdmin = true;\n } else {\n Auth.isAdmin = false;\n }\n });\n}", "title": "" }, { "docid": "1fef3f8038c5bd07297e8ea7f12eeeef", "score": "0.5432591", "text": "canActivate(next, state) {\n //ToDo if authService.isLoggedIn && hasRoles(user)\n return this.hasRoles();\n }", "title": "" }, { "docid": "9901787ac7b2a8422abafd2cb3cb7505", "score": "0.5424595", "text": "function isOrgAccount() {\r\n \r\n var plate = $( \"#stats\" ).parent();\r\n var level = plate.find( \"b\" ).eq( 0 ).text();\r\n level = level.split( \": \" )[1];\r\n \r\n var skill = plate.find( \"b\" ).eq( 11 ).text();\r\n skillTxt = skill.split( \": \" )[1];\r\n \r\n var str = plate.find( \"b\" ).eq( 12 ).text();\r\n strTxt = str.split( \": \" )[1];\r\n \r\n if( (level == \"1\") && (skillTxt == \"1.0\") && (strTxt == \"10\") ) { return( true ); }\r\n return( false );\r\n }", "title": "" }, { "docid": "0364003d071a926d76658feab9a6b616", "score": "0.5422919", "text": "function adminControls(user) { //function adminControls and it expects a user\n if (user) { //if user logged in-you know you have a user here\n if (user.admin) { //another conditional here-if user.admin -true or false value if user is admin\n console.log('showing admin controls...'); \n } else {\n console.log('You need to be an admin'); // if not an admin\n }\n } else {\n console.log('You need to be logged in'); // if user is a guest user or not logged in\n }\n\n //////////////////////////////////////////////////////////////////////////\n //////////////////////////////////////////////////////////////////////////\n //TERNARY OPERATOR FOR ABOVE CODE below-a compounded one \n let response = user ? user.admin ? \"showing admin controls\" : \"you need to be admin\" : \"you need to be logged in\";\n // user ? (is user true) now another ternary operator- user.admin ?(is user admin) and then the console logs each followed by a colon\n //////////////////////////////////////////////////////////////////////////\n //////////////////////////////////////////////////////////////////////////\n\n let userOne = {\n name: 'kristine',\n admin: true\n }\n\n let userTwo = {\n name: 'Tiffany',\n admin: false\n }\n\n let userThree = null\n\n adminControls(userOne);\n adminControls(userTwo);\n adminControls(userThree);\n }", "title": "" }, { "docid": "d20c140728334f76210d6253933fff7e", "score": "0.5422868", "text": "function isAdmin(user) {\nconsole.log('usere ', user);\n return user && user.roles && user.roles.indexOf('admin') > -1;\n}", "title": "" }, { "docid": "8fffc68ae6ed338c49652dbdf6d6ad20", "score": "0.54153913", "text": "isDropdownActivedByUser() {\n const { isActionsOpen, dropdownVisible } = this.state;\n\n return isActionsOpen && !dropdownVisible;\n }", "title": "" }, { "docid": "f7a1568fa652098941dfd2da8bbdc705", "score": "0.54094845", "text": "disabled(typeOfData) {\n if (this.state.userRole === \"admin\") return false;\n if (this.state.userRole === \"editor\") {\n switch (typeOfData) {\n case \"user\":\n case \"layout\":\n return true;\n default:\n return false;\n }\n }\n }", "title": "" }, { "docid": "58d00214a2be24eca84ea32e82cd1e20", "score": "0.54077506", "text": "get isChangeOfficers() {\r\n return this.subTypes.includes('group_officers_edit');\r\n }", "title": "" }, { "docid": "0040d1963be707748600750ec299890f", "score": "0.54007673", "text": "_checkCreateEnabled() {\r\n const { user } = this.props\r\n const valid = Object.values(this.state).every((field) => field.valid)\r\n return valid && user.status !== USER_CREATING_STATUS\r\n }", "title": "" }, { "docid": "07852bb3b1388cbe08a2aa08a37fcb41", "score": "0.5389881", "text": "static isAccessAllowed(stateMetadata, user) {\n switch (stateMetadata.visibility) {\n case DurableEntity_1.VisibilityEnum.ToOwnerOnly:\n if (!stateMetadata.owner || stateMetadata.owner !== user) {\n return false;\n }\n return true;\n case DurableEntity_1.VisibilityEnum.ToListOfUsers:\n if (!stateMetadata.allowedUsers || !stateMetadata.allowedUsers.includes(user)) {\n return false;\n }\n return true;\n case DurableEntity_1.VisibilityEnum.ToEveryone:\n return true;\n default:\n // Should always return false here, to prevent accidental exposure of external entities\n return false;\n }\n }", "title": "" }, { "docid": "e2dccb657b4a40deb7f2373c3d0ca4f9", "score": "0.53639466", "text": "opponentIsOfferingDraw() {\n if ((this.state.game.playerWhite.userId === Number(this.state.userId) && this.state.game.blackOffersDraw) ||\n (this.state.game.playerBlack.userId === Number(this.state.userId) && this.state.game.whiteOffersDraw)) {\n this.setState({open: true})\n }\n }", "title": "" }, { "docid": "35a4888ad98477484ecf5c5eb699cdcb", "score": "0.5348275", "text": "function canApprove () {\n var currentUser = LoginService.getCurrentSession();\n // no need to check if the user is an officer \n // since they can't get to this route if that\n // were the case\n return currentUser.signature && currentUser.title;\n }", "title": "" }, { "docid": "6ce4a993473e658814b0efdb5aae88ce", "score": "0.53470826", "text": "isAccount() {\n if (this.props.functionSet['getState']([\"accountToken\"]) != null) {\n return true;\n }\n else {\n return false\n }\n }", "title": "" }, { "docid": "595d5ac0074415735f443a8ad2367261", "score": "0.5340798", "text": "function CheckPermission()\n {\n if($scope.stepThruNumber==2 && $scope.editMode )\n {\n if($scope.screenType!=\"encounter\"){\n $scope.IsPermission = $scope.funPermissionCheck(450002,\"SelfOthers\",$scope.appointmentDetails.CreatedBy);\n }\n }\n else if($scope.stepThruNumber==3)\n {\n if($scope.screenType!=\"encounter\"){\n $scope.IsPermission = $scope.funPermissionCheck(450002,\"SelfOthers\",$scope.appointmentDetails.CreatedBy);\n }\n }\n }", "title": "" }, { "docid": "6e7128960a26ddf1196aa0812529238e", "score": "0.5328541", "text": "hasAccess(item, level) {\n\t\t// Abstract user has access to nothing\n\t\treturn false;\n\t}", "title": "" }, { "docid": "1dbc5ab2fd4debbb4866bffd323795c8", "score": "0.5324205", "text": "function canAccess(flag){\n\t\t//sleep(1500);\n\t\tif(!flag){\n\t\t\t$(\"#outPsw\").html(\"Account non esistente, riprovare\");\n\t\t\treturn false;\n\t\t} else if(flag){\n\t\t\t$(\"#buttLogin\").css(\"display\", \"none\");\n\t\t\t$(\"#outPsw\").css(\"display\", \"none\");\n\t\t\t$(\"#buttLogin2\").css(\"display\", \"block\");\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "a47995dcffb53ff06e8428ceead63943", "score": "0.5324105", "text": "function checkUserStatus() {\n $scope.unverifiedUsers = [];\n $scope.isUserNotLoggedIn = false;\n $scope.isUserNotVerified = false;\n $scope.isUserLoggedInAndVerified = false;\n $scope.isVerified = false;\n\n var accessToken = $rootScope.globals.accessToken;\n\n if (!accessToken) {\n $scope.isUserNotLoggedIn = true;\n } else {\n $scope.isUserLoggedInAndVerified = true;\n $scope.isVerified = true;\n }\n }", "title": "" }, { "docid": "d4f9355cd8083da65fed51ea3fa2a530", "score": "0.5320682", "text": "function _checkUserAdmin() {\r\n\t\t\t// if user is authenticated and not defined yet, check if they're an admin\r\n\t\t\tif (Utils.isAuthenticated() && angular.isUndefined(header.adminUser)) {\r\n\t\t\t\tUserData.getUser().then(_getUserSuccess);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "732f7b1b07bdbce16ed15ce6e0f3d18c", "score": "0.5312475", "text": "function userPriviledge() {\n\n var user_info = $scope.userData;\n\n switch (user_info.role) {\n\n case USERS.RSM:\n case USERS.NSM:\n $scope.levels = [{ id: 0, name: \"Miền\", code: \"M\" }, { id: 1, name: \"Tỉnh\", code: \"T\" }];\n break;\n\n default:\n $scope.levels = [{ id: 0, name: \"Tỉnh\", code: \"T\" }];\n\n }\n var selected_option = ReportSurveyTopDealerOptionCache.GetSelectedOption();\n\n \n\n if (!selected_option.level) {\n switch (user_info.role) {\n case USERS.SUPERVISOR:\n case USERS.ASM:\n case USERS.RSM:\n if (user_info.company) {\n $scope.selected_option.company.anco = false;\n $scope.selected_option.company.conco = true;\n } else {\n $scope.selected_option.company.anco = true;\n $scope.selected_option.company.conco = false;\n }\n $scope.lock.company = true;\n break;\n case USERS.NSM:\n $scope.selected_option.company.anco = true;\n $scope.selected_option.company.conco = true;\n }\n\n\n $scope.selected_option.level = $scope.levels[0];\n $scope.UpdateAreas();\n }\n else {\n if (selected_option.level.code === \"T\")\n $scope.areas = $scope.userData.provinces;\n else\n $scope.areas = $scope.regions;\n }\n\n \n }", "title": "" }, { "docid": "2c39556b228c385d8190c4de43183ff6", "score": "0.53112626", "text": "function toggleElementVisibility(role) {\n\t\t\t\t\t\tvar elemAccessLevel = attrs.accessLevel;\n\n \t\tif(userRoles[role] && userRoles[role][0] & accessLevels[elemAccessLevel]) { // eg. 100 (4/admin) & 110 (6/design) = true\n \t\t\t$(elem).show();\n \t\t}\n \t\telse {\n \t\t\t$(elem).hide();\n \t\t}\n\t\t\t\t\t}", "title": "" }, { "docid": "be315392e24219cc787dc230f7da4a30", "score": "0.5302798", "text": "function checkAdmin(ref) {\n\tref.once('value').then(function (snapshot) {\n\t\t// Check if the current user is the same as the admin listed on team\n\t\tisAdmin = (userId == snapshot.val().admin);\n\t});\n}", "title": "" }, { "docid": "dd0c3b2d815d939f955e56667ffd6733", "score": "0.52889997", "text": "function checkAuthorizationStatus() {\n FSBL.System.Window.getCurrent().show();\n //setTimeout(processAuthInput, 0);\n}", "title": "" }, { "docid": "8efebfdaceca5ecaeefe497acc65aac9", "score": "0.52730757", "text": "function getStatus() {\n\n\t\tgetAccountButton.click(getAccountFeed);\n\t\tgetDataButton.click(getDataFeed);\n\n\n\t\tif (google.accounts.user.checkLogin(scope)) {\n\t\t\t// we are logged in\n\t\t\tdataControls.show();\n\t\t\tauthButton.html('Log out from GA');\n\t\t\tauthButton.addClass('light');\n\t\t\trenderAccountFeed();\n\t\t} else {\n\t\t\tdataControls.hide();\n\t\t\tauthButton.html('Access Google Analytics');\n\t\t\tauthButton.removeClass('light');\n\t\t}\n\n\t}", "title": "" }, { "docid": "fb24ee2d19ddd8170cf1fe0baf4c90ab", "score": "0.52712655", "text": "get secured () {\n return !!this._acl\n }", "title": "" }, { "docid": "eef93d7e634709a0bdf41bbd5e3e9446", "score": "0.52553046", "text": "$onInit() {\n this.resource_('api/v1/rbac/status').get().$promise.then((result) => {\n if (result && result.enabled) {\n Object.assign(this.states, {'role': roleState});\n this.isVisible = true;\n }\n });\n }", "title": "" }, { "docid": "dec8c4edd36c55561862df38175241c3", "score": "0.52547354", "text": "manageApprovalStatus() { return this.approvalUrl().length > 0; }", "title": "" }, { "docid": "f2a02ea44e78b1c8c88ea1334b10f8bc", "score": "0.52495843", "text": "isCurrentUserOwner() {\n return getUsersFromAssignment(4).then(usersReq => {\n if(usersReq.response.status === 200) {\n return getLoggedUser().then(userReq => {\n if(userReq.response.status === 200) {\n var externalId = userReq.content.currentUser.externalID;\n usersReq.content.roleAssignments.forEach(assignment => {\n if(assignment.user.externalID === externalId) {\n this.setState({ isOwner: true })\n }\n })\n }\n })\n }\n })\n }", "title": "" }, { "docid": "97fe5888c51b1099c668ee5a97bbfc5c", "score": "0.5245034", "text": "function is_admin(){\n $('#password').val();\n\n if ($('#typeofuser').val() == 'REGULAR'){\n $('#secpriv').prop('disabled', false);\n $('#histpriv').prop('disabled', false);\n }\n else {\n $('#secpriv').prop('disabled', true);\n $('#histpriv').prop('disabled', true);\n }\n }", "title": "" }, { "docid": "ed1c60895f12454c7fec2a2d02572767", "score": "0.52419573", "text": "function setAdminRights(userEmail,requestCountry,requestRole,token){\n var userId = getUserId(userEmail);\n Logger.log(\"UserId trouvé/\"+userId);\n var countryList = [];\n countryList = requestCountry.split(\", \");\n \n for (var k=0; k < countryList.length; k++){ \n var countryRequest = countryList[k];\n var orgUnitId = getOrgUnitId(countryRequest);\n var rolesList = [];\n rolesList = requestRole.split(\", \");\n \n for (var j=0; j < rolesList.length; j++){\n var roleRequest = rolesList[j];\n Logger.log(\"Liste des \"+roleRequest); \n var roleId = Number(getRoleId(roleRequest)); \n \n if (roleRequest == \"Building and Rooms management\"){\n setAdminCalendar(userEmail); \n Logger.log(\"Récapitulatif du droit donné/\"+roleRequest+\", pour/\"+userEmail+\", sur MyGoogle\");\n }\n \n else { \n setAdminRightsRestricted(userId,roleId,orgUnitId);\n Logger.log(\"Récapitulatif du droit donné/\"+roleRequest+\", correspondant au role Id N°/\"+roleId+\", pour/\"+userEmail+\", sur le pays N°/\"+orgUnitId); \n }\n }\n }\n return;\n}", "title": "" }, { "docid": "efbb44d8cff4ca9c495327661867f4de", "score": "0.5238692", "text": "function _checkPermits (role) {\n return {\n // @description - TODO\n RequestAllStations : role == _Roles._isAdmin ||\n true /* editMode permits */ // TODO: see previous (inline-block) comment\n ,\n // @description - TODO\n RequestCategoryStations : role == _Roles._isAdmin ||\n true /* editMode permits */ // TODO: see previous (inline-block) comment\n ,\n // @description - TODO\n EditStation : role == _Roles._isAdmin ||\n ( role == _Roles._isPlayer &&\n true /* editMode permits */ ) // TODO: see previous (inline-block) comment\n };\n }", "title": "" }, { "docid": "f2f3a9192a3268ee706164581a51b653", "score": "0.52112854", "text": "canWriteServer() {\n // not from the server, not writable to server\n if (!this.isServerOp()) return false;\n // if it is a server op and not logged in, assume not writable\n if (!WasabeeMe.isLoggedIn()) return false;\n // if logged on a different server from the one used for the op, not writable\n if (!this.isOnCurrentServer()) return false;\n // if current user is op creator, it is always writable\n const me = WasabeeMe.cacheGet();\n if (!me) return false;\n if (me.GoogleID == this.creator) return true;\n // if the user has no teams enabled, it can't be writable\n if (!me.Teams || me.Teams.length == 0) return false;\n // if on a write-allowed team, is writable\n for (const t of this.teamlist) {\n if (t.role == \"write\") {\n for (const m of me.Teams) {\n if (t.teamid == m.ID) return true;\n }\n }\n }\n\n // not on a write-access team, must not be\n return false;\n }", "title": "" }, { "docid": "b6554bb1d4a4e7770ae6f8f1fc835135", "score": "0.5201259", "text": "checkUserStatus() {\n const {dispatch} = this.props;\n dispatch(authorizationCheck());\n }", "title": "" }, { "docid": "74b794e86cbcf4d4e07cf9f54632603a", "score": "0.51980954", "text": "function userIsAuthorized(user) {\n if (user._json && user._json.groups && user._json.groups.indexOf(config.requiredAADGroupId) > -1) {\n return true;\n };\n\n log.info(\"!!! User: \" + user._json.preferred_username + \" is not authorized to access this application.\")\n return false;\n}", "title": "" }, { "docid": "19b1622a928479faa3f50cf4acbc7c1a", "score": "0.51965034", "text": "function checkAuth(displayStatus) {\n\tdisplayStatus = displayStatus || 1;\n\tgetGaName = $('.ganame_'+displayStatus).html();\n\t$('#accountSelectName').html(getGaName);\n\tgetCLIENT_ID = $('.token_'+displayStatus).html();\n\t$('.activate_'+displayStatus).find('.t3-icon-edit-unhide').addClass('activate_hide');\n\t$('.activate_'+displayStatus).find('.t3-icon-edit-add').removeClass('activate_hide');\n\tgapi.auth.authorize({'client_id': getCLIENT_ID, 'scope': SCOPES, 'immediate': true}, handleAuthResult);\n}", "title": "" }, { "docid": "7626010ed4e3eaf6663073197b7b019a", "score": "0.5191382", "text": "get isActiveAndEnabled() {}", "title": "" }, { "docid": "7626010ed4e3eaf6663073197b7b019a", "score": "0.5191382", "text": "get isActiveAndEnabled() {}", "title": "" }, { "docid": "d356de301768e0cc6b0b16052eb05b87", "score": "0.5178924", "text": "function NotAllowed() {\n\t/**\n\t * Check if the loggedOnUser is in the list of Active Leads\n\t */\n\t\n\tif (!isDev && !activeLeadsObj.hasOwnProperty(loggedOnUser)){\n\t\tlet failHTML = `<div class=\"wrapper well\">You are not allowed - speak with an admin to get access</div>`\n\t\tdocument.getElementById('wrapper').innerHTML = failHTML\n\t}\n}", "title": "" }, { "docid": "48bbade99659a7c1a4ba23b90d21e4b5", "score": "0.51737475", "text": "isManager() {\n const data = localStorage.getItem('simpleAdminApp');\n if (!data) return false;\n const { user } = JSON.parse(data);\n return !!(user && user.role && user.role === 2);\n }", "title": "" }, { "docid": "241fb0068b2b829e82303edf9761042e", "score": "0.5158008", "text": "isCompanyUser() {\n let _isCompanyUser = false;\n if (this._userType === USER_TYPE.COMPANY) {\n _isCompanyUser = true;\n }\n return _isCompanyUser;\n }", "title": "" }, { "docid": "6592d60eeb0edfd6de16482404b23324", "score": "0.5157578", "text": "function getAuthorizations() {\n\t\t\tlet employee = JSON.parse(localStorage.getItem('miSSVQ.me'));\n\t\t\tvm.isPharmacyBoss = false;\n\t\t\tvm.isStorageBoss = false;\n\t\t\tvm.isStorageEmployee = false;\n\t\t\tvm.isCreator = vm.detail.productRequest.createdBy == employee.id ||\n\t\t\t\tvm.detail.productRequest.originUnit == employee.unit;\n\n\t\t\treturn storageManagerFactory.getAll({\n\t\t\t\twhere: {\n\t\t\t\t\tunit: vm.detail.productRequest.destinyUnit,\n\t\t\t\t\temployee: employee.id\n\t\t\t\t}\n\t\t\t}).then(obj => {\n\t\t\t\tobj.storageManagers.forEach(row => {\n\t\t\t\t\tif (!row.isPharmacyBoss) vm.isStorageEmployee = true;\n\t\t\t\t\tif (row.isAdmin) vm.isStorageBoss = true;\n\t\t\t\t\tif (row.isPharmacyBoss) vm.isPharmacyBoss = true;\n\t\t\t\t});\n\t\t\t\tif (vm.detail.productRequest.status == 1 && vm.isCreator) {\n\t\t\t\t\tvm.canUpdate = true;\n\t\t\t\t}\n\t\t\t\tif (vm.detail.productRequest.status == 2 && vm.isPharmacyBoss) {\n\t\t\t\t\tvm.canUpdate = true;\n\t\t\t\t}\n\t\t\t\tif (vm.detail.productRequest.status == 2 && vm.isStorageBoss) {\n\t\t\t\t\tvm.canUpdate = true;\n\t\t\t\t}\n\t\t\t\tif (vm.detail.productRequest.status == 11 && vm.isStorageBoss) {\n\t\t\t\t\tvm.canUpdate = true;\n\t\t\t\t}\n\t\t\t\t// 12:autorizado o 21:despachado\n\t\t\t\tif ([12, 21].indexOf(vm.detail.productRequest.status) > -1 && vm.isStorageEmployee) {\n\t\t\t\t\tvm.canShipping = true;\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "11f77e7b01f97a509b90da42f21237d7", "score": "0.51495224", "text": "function isPageAllowedToAccessByAdmin(to) {\n if (to.matched.some(record => record.meta.requireShowSettingsPermission)) {\n return hasPermission(\"Edit settings\") ? 1 : 0;\n } else if (to.name === \"admin.users\") {\n return hasPermission(\"Read users\") ? 1 : 0;\n } else if (to.name === \"admin.pages\") {\n return hasPermission(\"CED pages\") ? 1 : 0;\n } else if (to.name === \"admin.artists\") {\n return hasPermission(\"Read artists\") ? 1 : 0;\n } else if (to.name === \"admin.podcasts\") {\n return hasPermission(\"CED podcasts\") ? 1 : 0;\n } else if (to.name === \"admin.radio-stations\") {\n return hasPermission(\"CED radio_stations\") ? 1 : 0;\n } else if (to.name === \"admin.appearance\") {\n return hasPermission(\"Edit appearance\") ? 1 : 0;\n } else if (to.name === \"admin.albums\") {\n return hasPermission(\"CED albums\") ? 1 : 0;\n } else if (to.name === \"admin.songs\") {\n return hasPermission(\"CED songs\") ? 1 : 0;\n } else if (to.name === \"admin.roles\") {\n return hasPermission(\"Read roles\") ? 1 : 0;\n } else if (to.name === \"admin.playlists\") {\n return hasPermission(\"CED playlists\") ? 1 : 0;\n } else if (to.name === \"admin.genres\") {\n return hasPermission(\"CED song_genres\") ? 1 : 0;\n } else if (to.name === \"admin.podcast_genres\") {\n return hasPermission(\"CED podcast_genres\") ? 1 : 0;\n } else if (to.name === \"admin.translations\") {\n return hasPermission(\"CED translations\") ? 1 : 0;\n } else if (to.name === \"admin.plans\") {\n return hasPermission(\"CED plans\") ? 1 : 0;\n } else if (to.name === \"admin.subscriptions\") {\n return hasPermission(\"CED subscriptions\") ? 1 : 0;\n } else if (to.name === \"admin.advertising\") {\n return hasPermission(\"Edit advertisements\") ? 1 : 0;\n } else {\n return 1;\n }\n}", "title": "" }, { "docid": "ea8ba629c2ffbc7bd51d7e3ad180cd3e", "score": "0.51490325", "text": "static async isContractAdmin(data) {\n\n let result = await Blockchain.get({\n config: DappLib.getConfig(),\n contract: DappLib.DAPP_STATE_CONTRACT,\n params: {\n from: null\n }\n },\n 'isContractAdmin',\n data.account\n );\n return {\n type: DappLib.DAPP_RESULT_BOOLEAN,\n label: 'Is Contract Admin',\n result: result.callData,\n hint: null\n }\n }", "title": "" }, { "docid": "d17703039a6de1b256dbfd5a499047f7", "score": "0.5143934", "text": "isLocked() {\n if (this.status.length === 1){\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "ca65c9d8906bc56d25bb97f0618bbf2c", "score": "0.51410025", "text": "approveLotteryGameQuota$({ root, args, jwt }, authToken) {\n const lotteryGameQuota = {\n ...args,\n editionUserId: authToken.user_id,\n editionUsername: authToken.preferred_username,\n editionTimestamp: new Date().getTime(),\n approvedUserId: authToken.user_id,\n approvedUsername: authToken.preferred_username,\n approvedTimestamp: new Date().getTime()\n };\n\n return RoleValidator.checkPermissions$(\n authToken.realm_access.roles,\n \"LotteryGameQuota\",\n \"approveLotteryGameQuota$\",\n PERMISSION_DENIED,\n [\"PLATFORM-ADMIN\", \"LOTTERY-APPROVER\"]\n ).pipe(\n mergeMap(() => eventSourcing.eventStore.emitEvent$(\n new Event({\n eventType: \"LotteryGameQuotaApproved\",\n eventTypeVersion: 1,\n aggregateType: \"LotteryGameQuota\",\n aggregateId: lotteryGameQuota.id,\n data: lotteryGameQuota,\n user: authToken.preferred_username\n })\n )\n ),\n map(() => ({ code: 200, message: `LotteryGameQuota with id: ${lotteryGameQuota._id} has been updated` })),\n mergeMap(r => GraphqlResponseTools.buildSuccessResponse$(r)),\n catchError(err => GraphqlResponseTools.handleError$(err))\n );\n }", "title": "" }, { "docid": "933ac7b0da584d4b1da4f35d978edb18", "score": "0.5140507", "text": "showSubNav() {\n return !_.includes([\n 'managedAccounts'\n ], FlowRouter.getRouteName());\n }", "title": "" }, { "docid": "72864100ecaf1c5f0e1b7938a7558c4e", "score": "0.51294065", "text": "function askSetStatusPermission(){\n FAPI.UI.showPermissions(\"[\\\"\" + permissionStatus + \"\\\"]\");\n // after getting a result function API_callback will be called\n // Attention! If user will unckeck the permission and press button \"Allow\"\n // the callback will be called with result \"ok\", but the permission wouldn't be granted\n}", "title": "" }, { "docid": "d107775a77a1164e6de1dc7bc4070ae0", "score": "0.5127046", "text": "load(){\n userService\n .getUserByOrgId(userService.currentUser.org_id)\n .then(response => {\n this.members = response;\n let temp = this.members;\n this.admin = temp.filter(r => r.privileges === 1);\n if(this.admin.some(u => u.user_id === userService.currentUser.user_id)){\n this.isAdmin = true;\n }\n this.org_name = organizationService.currentOrganization.org_name;\n this.org_email = organizationService.currentOrganization.email;\n this.org_phone = organizationService.currentOrganization.phone;\n this.org_image = organizationService.currentOrganization.image;\n this.ready = true;\n console.log(organizationService.currentOrganization);\n })\n .catch((error: Error) => console.log(error.message))\n }", "title": "" }, { "docid": "df8afec0fd2ac9acacac9e3d023765b1", "score": "0.5125322", "text": "async allowLogin () {\n\t\tawait this.generateAccessToken();\n\t\tthis.grantSubscriptionPermissions(); // NOTE - no await here, this can run in parallel\n\t\tthis.getCountryCode(); // NOTE - no await here, this is not part of the actual request flow\n\t}", "title": "" }, { "docid": "e3f2a73f40b1c110237b900ac5472b86", "score": "0.51226765", "text": "function checkLoginStatus(e){\n\t\n\t// first check status of the current user\n\tif(api.User.current()){\n\t\t$.createBtn.enabled = false;\n\t\t$.loginBtn.enabled = false;\n\t\t$.logoutBtn.enabled = true;\n\t}\n\telse{\n\t\t$.logoutBtn.enabled = false;\n\t\t$.loginBtn.enabled = ( ($.username.value.length>0) && ($.password.value.length>0) && ($.email.value.length===0));\n\t\t$.createBtn.enabled = ($.username.value.length>0 && $.password.value.length>0 && $.email.value.length>0);\n\t}\n\t\n}", "title": "" }, { "docid": "1005c30833e70784e67ecdd45eb0f107", "score": "0.5114475", "text": "function isAdmin(req, res) {\n if (req && req.decoded && req.decoded.role) {\n if (req.decoded.role !== config.admin) {\n res.json({\n success: false,\n message: 'Not Allowed: Only admin have access to do this operation'\n });\n } else {\n return true;\n }\n }\n}", "title": "" }, { "docid": "fe242fe7d75ee10e2576cb9a06e33ca2", "score": "0.5110715", "text": "function is_privileged(user, data){\n if (data['owner'] != user &&\n data['admins'].indexOf(user) == -1){\n return false\n }else{\n return true\n }\n}", "title": "" }, { "docid": "44cb8055b8714af31ced6d12a1e063fd", "score": "0.5107546", "text": "function _canAccessUser(req, id, action, callback) {\n winston.log('debug', 'entered router-common.canAccessUser(id=' + id + ', action=' + action + ')');\n\n // must have a user in the session\n if(!_userInSession(req)) {\n callback(false);\n return;\n }\n\n // caller can view users within their organization, or any user if the caller is global\n if(_hasAccess(req, 'user', action)) {\n callback(true);\n return;\n }\n\n // caller can view himself\n if(_hasAccess(req, 'user/me', action) && req.session.user._id == id) {\n callback(true);\n return;\n }\n\n // caller can only view users of a specific role within their organizations\n AccountManager.findOneById(id, function(err, user) {\n if(err != null || !user || user == null) {\n callback(false);\n return;\n }\n\n if(_.isUndefined(user.roles)) {\n callback(false);\n return;\n }\n\n if(user.roles.length == 0) {\n callback(false);\n return;\n }\n\n if(_.intersection(user.organizations, req.session.user.organizations).length == 0) {\n callback(false);\n return;\n }\n\n if(_userHasAccess(req.session.user, user.roles[0], action)) {\n callback(true);\n return;\n }\n\n if(_userHasAccess(req.session.user, 'audit-team/' + user.roles[0], action)) {\n callback(true);\n return;\n }\n\n callback(false);\n });\n}", "title": "" }, { "docid": "feb27993a78866694551c63280d8be29", "score": "0.51019466", "text": "enable() {\n return this._client.send(\"Security.enable\");\n }", "title": "" }, { "docid": "ab7200ae3e887a111a6563c47b68eb84", "score": "0.5099991", "text": "function updateCanEdit() {\n var userObj = $scope.user;\n if (userObj.positions) {\n var editPositions = userObj.positions.edit_positions;\n for (var editIndex in editPositions) {\n if (editPositions[editIndex].id === $scope.notice.position_id) {\n $scope.canEdit = true;\n return;\n }\n }\n }\n $scope.canEdit = false;\n\n }", "title": "" }, { "docid": "169aed08ad9f9a4cf1c83e83db6ff8fb", "score": "0.50994825", "text": "async function checkAdminAuthorization (req, res, next) {\n const tokenPayload = await validateToken(req, res)\n const isAdmin = tokenPayload['http://isAdmin/']\n // logger.info(`Is user admin: ${!!isAdmin}`)\n if (isAdmin) {\n next()\n }\n if (!isAdmin) {\n res.sendStatus(401)\n }\n}", "title": "" }, { "docid": "94e95be2c4bd2f1b346eaefd69991055", "score": "0.5094446", "text": "_checkCreateEnabled() {\n const valid = Object.values(this.state).every((value) => value.valid)\n return valid && this.props.user.status !== UPDATING_PASSWORD_STATUS\n }", "title": "" }, { "docid": "6cfeaf7dd70a3e649470652fe0e26060", "score": "0.50917923", "text": "async toggleApproval(body, responseId, userInfo) {\n const response = await dbContext.Responses.findOne({ _id: responseId })\n // @ts-ignore\n const wager = response._doc.wager\n if (userInfo.roles[0] === 'Host') {\n // const approved = await dbContext.Responses.findByIdAndUpdate(responseId, body, { new: true })\n await dbContext.Responses.findByIdAndUpdate(responseId, body, { new: true })\n // @ts-ignore\n const points = await this.updatePoints(response._doc.teamId, wager, body.approved)\n\n return points\n } else {\n throw new BadRequest('Permission denied')\n }\n }", "title": "" }, { "docid": "3ab7b8908ca7b6d499b17e3b11af3492", "score": "0.5083358", "text": "setRegistrationStatusVisibility () {\n const { page, market: { dex } } = this\n const { confs, confsrequired } = dex\n const feePending = this.hasFeePending()\n\n this.updateRegistrationStatusView(dex.host, !feePending, confsrequired, confs)\n\n if (feePending) {\n Doc.show(page.registrationStatus)\n } else {\n const toggle = () => {\n Doc.hide(page.registrationStatus)\n this.resolveOrderFormVisibility()\n }\n if (Doc.isHidden(page.orderForm)) {\n // wait a couple of seconds before showing the form so the success\n // message is shown to the user\n setTimeout(toggle, 5000)\n return\n }\n toggle()\n }\n }", "title": "" }, { "docid": "c4a075e69da38c48cb0ef289b8cbf682", "score": "0.507922", "text": "canActivate(route, state) {\n const isAuthenticated = this.authenticationService.isAuthenticated();\n if (isAuthenticated) {\n const userRole = this.authenticationService.getPrimaryUserRole();\n if (userRole === 'admin') {\n return true;\n }\n }\n this.router.navigate(['/admin/login']);\n return false;\n }", "title": "" }, { "docid": "29b1be0f72deb4f6adbd9c14262d7241", "score": "0.50768524", "text": "async modifyableBy(user) {\n return user.id == this.facilitator;\n }", "title": "" }, { "docid": "967e612737a9fcc644564e6dc3b3fc32", "score": "0.5075817", "text": "toggleMyCourses() {\n //get the current userCoursesOnly status and flip it\n let newStatus = (! this.get('userCoursesOnly'));\n //then set it to the new status\n this.set('userCoursesOnly', newStatus);\n }", "title": "" }, { "docid": "e2f4a9b620df2d44ca9113afd8f49811", "score": "0.5069153", "text": "isLoggedIn() {\n return (this.getToken() && this.getUsername() && this.getRole());\n }", "title": "" } ]
f3737893306a88041e6c4f624279d28a
Euclidean Division + Modulo
[ { "docid": "7b29b271a5a7415e4d6cbbfebe4b80c6", "score": "0.69191396", "text": "divmod(num) {\n return this._div(num, modes.BOTH | modes.EUCLID);\n }", "title": "" } ]
[ { "docid": "426f0e54766af9a3a199ec89c7f6542e", "score": "0.82262963", "text": "function euclideanModulo(a, b) {\n return (a % b + b) % b;\n}", "title": "" }, { "docid": "426f0e54766af9a3a199ec89c7f6542e", "score": "0.82262963", "text": "function euclideanModulo(a, b) {\n return (a % b + b) % b;\n}", "title": "" }, { "docid": "426f0e54766af9a3a199ec89c7f6542e", "score": "0.82262963", "text": "function euclideanModulo(a, b) {\n return (a % b + b) % b;\n}", "title": "" }, { "docid": "118015508af11adcfef346a8f81a2714", "score": "0.7753807", "text": "function euclideanModulo(n, m) {\n return (n % m + m) % m;\n}", "title": "" }, { "docid": "d28736f3c3785ef57dadf3ebc4cf9132", "score": "0.73618007", "text": "function calcRemainder(a, b) {\r\n return a % b;\r\n}", "title": "" }, { "docid": "2fcadafb05aaefd3514bb5f3d398389f", "score": "0.7346908", "text": "function div(a,b) { return (a/b)|0; }", "title": "" }, { "docid": "3f68fc419dff61ba5efbe7920df91ea1", "score": "0.72705686", "text": "function mod(x,y){\n var mod = x - Math.floor(x/y)*y;\n return mod;\n}", "title": "" }, { "docid": "ee9c9ed21dbadf994cd5f5f36c0c61b9", "score": "0.72542375", "text": "function mod$1(dividend,divisor){return(dividend%divisor+divisor)%divisor;}", "title": "" }, { "docid": "ee9c9ed21dbadf994cd5f5f36c0c61b9", "score": "0.72542375", "text": "function mod$1(dividend,divisor){return(dividend%divisor+divisor)%divisor;}", "title": "" }, { "docid": "4253858968fce5b84035e4f37b99c576", "score": "0.72269565", "text": "function mod$1(dividend,divisor){return(dividend%divisor+divisor)%divisor}", "title": "" }, { "docid": "4add8d08fbfa97d8a164792529bf475b", "score": "0.71856976", "text": "function caml_int64_udivmod (x, y) {\n var offset = 0;\n var modulus = caml_obj_dup(x);\n var divisor = caml_obj_dup(y);\n var quotient = [255, 0, 0, 0];\n while (caml_int64_ucompare (modulus, divisor) > 0) {\n offset++;\n caml_int64_lsl1 (divisor);\n }\n while (offset >= 0) {\n offset --;\n caml_int64_lsl1 (quotient);\n if (caml_int64_ucompare (modulus, divisor) >= 0) {\n quotient[1] ++;\n modulus = caml_int64_sub (modulus, divisor);\n }\n caml_int64_lsr1 (divisor);\n }\n return [0,quotient, modulus];\n}", "title": "" }, { "docid": "dc72af588108399aa387aa2356c2df06", "score": "0.71440965", "text": "modulus() {\n return Math.sqrt(this.dot(this));\n }", "title": "" }, { "docid": "b4829539aeca0a2bcd9b89505e3f01f4", "score": "0.71293944", "text": "function modulo (a, b) {\n // return the remainder of the division a / b\n return a % b\n}", "title": "" }, { "docid": "7e4b8cd6e8b498a1b266e7efac2753dd", "score": "0.7116545", "text": "function mod(a,b)\n{\n return a%b;\n}", "title": "" }, { "docid": "b1fdb69fe124cb84ced12dd9c0e0c68e", "score": "0.7110471", "text": "function remainder(x, y){\n\treturn x%y\n}", "title": "" }, { "docid": "78a459cffff820e219c1d66e4e36b701", "score": "0.71084267", "text": "function md(b, e, mod) {\n if (b < 1 || e < 0 || mod < 1) {\n return -1;\n }\n\n var res = 1;\n do {\n if (e & 1) {\n res = (res * b) % mod;\n }\n b = (b * b) % mod;\n e = Math.floor(e / 2);\n } while (e > 0)\n return res;\n}", "title": "" }, { "docid": "4b020afd325a90812f02b43760796aaa", "score": "0.71013147", "text": "function myModulo(dividend, divisor) {\n return dividend % divisor;\n}", "title": "" }, { "docid": "8677b520ccbf5f0576330d29d46a7391", "score": "0.7097421", "text": "function caml_mod(x,y) {\n if (y == 0) caml_raise_zero_divide ();\n return x%y;\n}", "title": "" }, { "docid": "8677b520ccbf5f0576330d29d46a7391", "score": "0.7097421", "text": "function caml_mod(x,y) {\n if (y == 0) caml_raise_zero_divide ();\n return x%y;\n}", "title": "" }, { "docid": "62073082dd675bdca041e90891359215", "score": "0.7071376", "text": "function remainder(x, y) {\n return x % y\n}", "title": "" }, { "docid": "62073082dd675bdca041e90891359215", "score": "0.7071376", "text": "function remainder(x, y) {\n return x % y\n}", "title": "" }, { "docid": "47b3b6370c6272333d05aea663621f7b", "score": "0.7032811", "text": "function mod(a, b) {\n return ((a % b) + b) % b;\n}", "title": "" }, { "docid": "47b3b6370c6272333d05aea663621f7b", "score": "0.7032811", "text": "function mod(a, b) {\n return ((a % b) + b) % b;\n}", "title": "" }, { "docid": "6c0795c15b31d1fbd40e75beed066c97", "score": "0.7022478", "text": "function mod(v, mod){\n return ((v % mod) + mod) % mod;\n}//mod()", "title": "" }, { "docid": "023b1ded6d9e015eeaf33b5b90d0bd79", "score": "0.7015943", "text": "function mod(v, d) { return ((v % d) + d) % d; }", "title": "" }, { "docid": "ec1a97aef7c0504c96e2420d445eb681", "score": "0.7013605", "text": "function resteDiv(a, b) {\n // la operateur module sert a trouver la rest de division de 2 nombres\n //je appliquer la operateur % pour acheve mon goal et je le retourne\n return a % b;\n}", "title": "" }, { "docid": "81c69bc55ec6f99c9a94e2a88654bf5d", "score": "0.6985148", "text": "function elemDiv(a, b) {\n console.log(a + ' divided by ' + b + ' is ' + parseInt(a / b) + ' with a remainder of ' + (a % b));\n}", "title": "" }, { "docid": "ac64c6f2eb9932cf51d1355f193fecca", "score": "0.6959152", "text": "function findRemainder(a,b){\n let result = a/b\n let total = result -= b \n return total\n \n}", "title": "" }, { "docid": "587847d3ab32881f561ada6373015035", "score": "0.6943312", "text": "function remainder(x, y) {\n return x % y;\n}", "title": "" }, { "docid": "31f59531d67075800eecc07b7dfc223e", "score": "0.6934006", "text": "function euclid(a, b) {\n while (b !== 0){\n var temp = b;\n b = a % b;\n a = temp;\n }\n return a;\n }", "title": "" }, { "docid": "d5ebc0e21686a35bc49d4df770acd90d", "score": "0.6932835", "text": "function remainder(x, y) {\n return (x % y);\n}", "title": "" }, { "docid": "14663877d4936ac01204ae4b8fc0bc60", "score": "0.69234496", "text": "getModulo() {\n let modulo = Math.sqrt(this._x * this._x + this._y * this._y)\n return modulo;\n }", "title": "" }, { "docid": "43c2f637adadf4c081088b09b80e2bcb", "score": "0.6910113", "text": "mod(a, b) {\n return a % b;\n }", "title": "" }, { "docid": "d514922d228595b5c956e8b8efa29fc6", "score": "0.6906353", "text": "function divmod(x, y) {\n assert(y !== 0n);\n\n let q = x / y;\n let r = x - (q * y);\n\n if (r < 0n) {\n if (y < 0n) {\n q += 1n;\n r -= y;\n } else {\n q -= 1n;\n r += y;\n }\n }\n\n return [q, r];\n}", "title": "" }, { "docid": "9d39c47e4cd65fa9c0671d4de017bff7", "score": "0.6878356", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "73c8f150593a509f4e5fda5abec15c18", "score": "0.6846854", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n}", "title": "" }, { "docid": "aa72bd8303e6da0aaba5aff160d5c117", "score": "0.6833403", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "e86759daeaed499334e6b66a19115f16", "score": "0.6819095", "text": "function bnMod(a){var r=nbi();this.abs().divRemTo(a,null,r);if(this.s<0&&r.compareTo(BigInteger.ZERO)>0)a.subTo(r,r);return r}", "title": "" }, { "docid": "996fd80b46f356c3029d90e61b52cd21", "score": "0.68152946", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n}", "title": "" }, { "docid": "21a480c4db1179418e65cebcca67bb5b", "score": "0.6812705", "text": "function div(a,b)\n{\n return a/b;\n}", "title": "" }, { "docid": "b8c95fff0da5465660fb10e1a7c159ed", "score": "0.6804682", "text": "function modulo(a, b) {\n return ((a % b) + b) % b\n}", "title": "" }, { "docid": "359e4d605d4344ee8316d931d5308aa9", "score": "0.68046635", "text": "function mod$1(dividend, divisor) {\n\t return ((dividend % divisor) + divisor) % divisor;\n\t }", "title": "" }, { "docid": "366863eaac54a78453e28c49f7e4c072", "score": "0.6802381", "text": "function mod$1(dividend, divisor) {\r\n return ((dividend % divisor) + divisor) % divisor;\r\n }", "title": "" }, { "docid": "012902cc76361c47c1cb1e9e77f08366", "score": "0.68004274", "text": "function calcRemainder(numerator, denominator) {\n remainder = (numerator % denominator);\n return remainder;\n}", "title": "" }, { "docid": "d18b297792dc20ab8c9200144f63d4ed", "score": "0.6792515", "text": "function mod$1(dividend, divisor) {\n\t return (dividend % divisor + divisor) % divisor;\n\t}", "title": "" }, { "docid": "6daaf2cd4d31dff5069e1dec5eb14b50", "score": "0.67912716", "text": "function remainder(numerator, denominator) {\n return numerator % denominator;\n}", "title": "" }, { "docid": "c1ff037c6f921947afead342a4ae1557", "score": "0.67847353", "text": "function mod$1(dividend, divisor) {\n\t return (dividend % divisor + divisor) % divisor;\n\t }", "title": "" }, { "docid": "80792d4b6b61eba581beae17ec91cfae", "score": "0.67723924", "text": "function div(a, b){\n return a / b\n}", "title": "" }, { "docid": "27f6b5f65a721a4d3b0b198850a78b34", "score": "0.67712367", "text": "function caml_int64_div (x, y)\n{\n if (caml_int64_is_zero (y)) caml_raise_zero_divide ();\n var sign = x[3] ^ y[3];\n if (x[3] & 0x8000) x = caml_int64_neg(x);\n if (y[3] & 0x8000) y = caml_int64_neg(y);\n var q = caml_int64_udivmod(x, y)[1];\n if (sign & 0x8000) q = caml_int64_neg(q);\n return q;\n}", "title": "" }, { "docid": "3f1a73737d04b04a42e5ce6804195bbc", "score": "0.6770357", "text": "function fixMod(x, y) {\n return ((x%y)+y)%y;\n }", "title": "" }, { "docid": "9a149ff3a56af32d701cf1d993e80b5c", "score": "0.67631286", "text": "function divAndMod(y, x) {\n var r = 0;\n\n // find the highest position of positive bit of the ratio\n var pos = -1;\nvar op = 0;\n while(y >= x) {\n pos += 1;\n x <<= 1;\nconsole.log('1:', op++, x, y>x, x.toString(2), pos);\n }\n\n x >>= 1;\n console.log(x);\n // console.log(\"y=%d, x=%d, pos=%d\", y, x, pos);\n\n if(pos == -1) {\n return [r, y];\n }\n\n while(pos >= 0) {\nconsole.log('2:', op++);\n if(y >= x) {\n r += (1 << pos);\n y -= x;\n }\n\n // console.log(\"y=%d, x=%d, r=%d, pos=%d\", y, x, r, pos);\n\n x >>= 1;\n pos -= 1;\n }\n\n return [r, y];\n}", "title": "" }, { "docid": "58e886cbee3632e87d22f79b488b301d", "score": "0.6762845", "text": "function remainder(x, y) {\n num = x % y;\n return num;\n}", "title": "" }, { "docid": "a212a170dab2a5b7e09061797e422fae", "score": "0.6756225", "text": "function remainder(numerator, denominator) {\n\treturn numerator % denominator\n}", "title": "" }, { "docid": "2b9d010a914af223cc0307d9650d17fc", "score": "0.67371464", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor\n }", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "6aea2cb082f5fdc3efa091cac53e1a1f", "score": "0.6731531", "text": "function bnMod(a) {\n var r = new BigInteger()\n this.abs()\n .divRemTo(a, null, r)\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n return r\n}", "title": "" }, { "docid": "f7b353f8b6ae99ac388579b94ee19436", "score": "0.67283267", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "d782c53a8e8e31f47c31d6148bd495c8", "score": "0.6720936", "text": "function remainder(dividend, divisor) {\n return dividend % divisor;\n}", "title": "" }, { "docid": "b773e2cdfeac7890563ae659182017a3", "score": "0.6719748", "text": "function mod_(x, n) {\n if (s4.length != x.length) s4 = dup(x);else copy_(s4, x);\n if (s5.length != x.length) s5 = dup(x);\n divide_(s4, n, s5, x); //x = remainder of s4 / n\n}", "title": "" }, { "docid": "fc0854b7e84966aeb492999a32427e9f", "score": "0.67191404", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "fc0854b7e84966aeb492999a32427e9f", "score": "0.67191404", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "1cbdc6bdb495ce72a32f6ac913d36bc8", "score": "0.6709529", "text": "function divmod(q, r, n, d, t)\r\n{\r\n var rn = 0;\r\n var dt = (d[t-1]) << 8;\r\n if (t>1) {\r\n\t\tdt |= d[t-2];\r\n\t}\r\n\r\n while (n-- >= t)\r\n {\r\n var z = (rn << 16) | (r[n] << 8);\r\n if (n>0) {\r\n\t\t\tz |= r[n-1];\r\n\t\t}\r\n z = Math.floor(z/dt);\r\n rn += mula_small(r,r, n-t+1, d, t, -z);\r\n q[n-t+1] = z + rn; /* rn is 0 or -1 (underflow) */\r\n mula_small(r,r, n-t+1, d, t, -rn);\r\n rn = r[n];\r\n r[n] = 0;\r\n }\r\n r[t-1] = rn;\r\n}", "title": "" }, { "docid": "d911a03a1e373d7c8f72976f260f9e0a", "score": "0.67068905", "text": "function mod(x, m){\n\treturn ((x % m) + m) % m;\n}", "title": "" }, { "docid": "e87ac94919a1fb3e8ff07d4cb55b5f37", "score": "0.67028266", "text": "function dividir(a,b) {\n return a / b;\n}", "title": "" }, { "docid": "ab2a412e6ffa645040d38bbd37f11514", "score": "0.6699534", "text": "function egcd(e, r) {\n while (r != 0) {\n let x = e;\n e = r;\n r = x % r;\n }\n return e;\n }", "title": "" }, { "docid": "281b3a524857dde141064f351a75d130", "score": "0.6695587", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "281b3a524857dde141064f351a75d130", "score": "0.6695587", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "281b3a524857dde141064f351a75d130", "score": "0.6695587", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "281b3a524857dde141064f351a75d130", "score": "0.6695587", "text": "function mod$1(dividend, divisor) {\n return (dividend % divisor + divisor) % divisor;\n }", "title": "" }, { "docid": "6126e2c223a156c18c64321486c8d893", "score": "0.66884416", "text": "function getDifferenceModulus(a, b) {\n return Math.abs(a - b);\n}", "title": "" }, { "docid": "d61cc20cfde949dcad5c053e8a1d6da4", "score": "0.6677351", "text": "function mod_(x, n) {\n if (s4.length !== x.length)\n s4 = dup(x);\n else\n copy_(s4, x);\n if (s5.length !== x.length)\n s5 = dup(x);\n divide_(s4, n, s5, x); //x = remainder of s4 / n\n }", "title": "" }, { "docid": "709461f3fa7ec8f81d13d4e8deee78c9", "score": "0.66770405", "text": "function bnMod(a) {\n\t var r = nbi();\n\t this.abs().divRemTo(a,null,r);\n\t if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n\t return r;\n\t }", "title": "" }, { "docid": "5dca82390af9dfaa70fff0ee1039b126", "score": "0.6629262", "text": "function divad(a,b) {\n\n return 3+(a/b);\n \n\n}", "title": "" }, { "docid": "ca0f40c40aaa84c6d3613fd6af66cba1", "score": "0.6628041", "text": "function div2 (n1,n2) {\n console.log(n1%n2)\n}", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" }, { "docid": "ffd336ef30a9e15de188b99574dfa308", "score": "0.6604697", "text": "function mod$1(dividend, divisor) {\n return ((dividend % divisor) + divisor) % divisor;\n }", "title": "" } ]
ba14e629564de0cdb391b457519c97b7
! vuerouter v3.1.6 (c) 2020 Evan You
[ { "docid": "3a1bca8591b416d8a0534b630a3da51a", "score": "0.0", "text": "function r(t,e){0}", "title": "" } ]
[ { "docid": "1ac507c5d6aac7c114c1a979ee26340d", "score": "0.6033225", "text": "function __axO4V4GhxjCIJCmJ0hzrQQ() {}", "title": "" }, { "docid": "10f4afb80d955af0b4a0f7690ea4c94b", "score": "0.60309035", "text": "function _5Ra3VTLNPzq7ojEKUXMbvA() {}", "title": "" }, { "docid": "b49aa481639e55b0ad90fd6ea4a41fea", "score": "0.5974777", "text": "function _5MoheFcFBz_aCSksX6eoQvw() {}", "title": "" }, { "docid": "50bde0ca8b77f557a5cbb3dca1d95e15", "score": "0.5941151", "text": "function eVfL3GN9gzKo9J9veEMNRA(){}", "title": "" }, { "docid": "1fce695f68ac3e300fa8c04cfde11991", "score": "0.59003353", "text": "function _6yGdN5U6Pj6hvxUip1p9OQ() {}", "title": "" }, { "docid": "cc40508e414cd5b9a616a005574d90ab", "score": "0.57910055", "text": "function _5JLIsfM2BDWu5if6PVH9Mw() {}", "title": "" }, { "docid": "a50302dba602669b846804da04cc8aad", "score": "0.55758363", "text": "function nw6PUrLXLjqiWJDOBAtITA() {}", "title": "" }, { "docid": "06e71c40eea88f7914bf337f6eaaedac", "score": "0.5558897", "text": "function _2YQqj_bQsOz2H9NScp8H3BQ() {}", "title": "" }, { "docid": "f7c125dd3c87a8f1e8c5d1ca2ff4e1aa", "score": "0.55485183", "text": "function mSRQAu7ItjugQsBXE87Mrw() {}", "title": "" }, { "docid": "d23f818dfb63d8aef9321c78aec2869b", "score": "0.55107844", "text": "function Van() {}", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.5444941", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "b36870915304629d2c44ca9b0c395e24", "score": "0.5444941", "text": "static getVersion() { return 1; }", "title": "" }, { "docid": "afc5c258512ba1950be52564755b7e17", "score": "0.5438615", "text": "function vlLP_bI6YVDStNYmfaY822w() {}", "title": "" }, { "docid": "c5bf779a43590bcf90de8b59da75b953", "score": "0.5433442", "text": "function SigV4Utils() {}", "title": "" }, { "docid": "5f1cf1307c31d47b504d6e704640e37f", "score": "0.5411603", "text": "function SzlSjRxM1DexWk1PpKwx2g() {}", "title": "" }, { "docid": "95e2d64166b9b74c93ee1a7cbd9d881d", "score": "0.5380719", "text": "function ysuN4gr4qzChYPsLPYpY0A() {}", "title": "" }, { "docid": "77c308d0c7c9dce3aebc021c277bdc52", "score": "0.5373014", "text": "function _82pwGb6BWzOVYZGortTaJw() {}", "title": "" }, { "docid": "cf566b3f40d899be581d3fd20dd72a50", "score": "0.53402966", "text": "function VeroldComponent() {\n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.53326684", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "049b8d452993fc2891cdeb0d39276be3", "score": "0.5327512", "text": "function avataxHelper() {}", "title": "" }, { "docid": "9f4f6f36652f34541517e8bb317956b6", "score": "0.5310274", "text": "function EBB6YpS42zKw0RTPI65LPQ() {}", "title": "" }, { "docid": "2b76de264adbe068b1bc4f07f684103f", "score": "0.5290466", "text": "function FQEbbY3erDWW14X7Ekt7Zg() {}", "title": "" }, { "docid": "9b8cfe405ecad0077b55c4ec364f2395", "score": "0.52838457", "text": "function OIR7mPg6CzqXA_bVsJvcnSg() {}", "title": "" }, { "docid": "ad35e0b2fdf40cfa33261b402e1b51eb", "score": "0.5282739", "text": "function KDfpDan_afja0WTIAvRulEg() {}", "title": "" }, { "docid": "ecbf91e4896fd5b64db55642b924786d", "score": "0.5273578", "text": "function ilP8cu7JYzamTa6vdby6Sw() {}", "title": "" }, { "docid": "4d50e43f81461c7a9d543693b6dbe88a", "score": "0.52722955", "text": "function _0x4b19(_0x25fd1e,_0x5f255e){const _0x4910fa=_0x4910();return _0x4b19=function(_0x4b196b,_0x182581){_0x4b196b=_0x4b196b-0x8f;let _0xd4d488=_0x4910fa[_0x4b196b];return _0xd4d488;},_0x4b19(_0x25fd1e,_0x5f255e);}", "title": "" }, { "docid": "04db2bf4378e221bf34f73a324e7938e", "score": "0.526337", "text": "get __version__(){return __version__;}", "title": "" }, { "docid": "0926c16f90338d5ff2bc1e38286c512e", "score": "0.5256839", "text": "drive() {\n return 'vroom'\n }", "title": "" }, { "docid": "44fa2f83f93c48a16c7d77b9c442dec2", "score": "0.5249092", "text": "function VzxZCNjbgTKrRFS3y_aYw6w(){}", "title": "" }, { "docid": "41e8e093dfaa47bf4b8c67c2ae78c807", "score": "0.5247255", "text": "function ixo1021548() { return 'veXOb'; }", "title": "" }, { "docid": "d09fd9cc573cfe6d87d9cdef194a2818", "score": "0.52373904", "text": "function Vi(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "c2712092d3848dae217c584315897b4a", "score": "0.5230433", "text": "function b6Xro2KKdz21xKZKv4hTiw() {}", "title": "" }, { "docid": "b73b084644fd1d478d2947a1a8601e8e", "score": "0.5220992", "text": "function Vn(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "9b457cec6da10133f41cb04cd55f46a4", "score": "0.5209323", "text": "function _8SzARJV9njS10hoe_bNfgMg() {}", "title": "" }, { "docid": "49d0c76265ea7788d2bf42814023ba5a", "score": "0.52083224", "text": "function Krux() {}", "title": "" }, { "docid": "71f3773a5366f5dd26f6611f628121d2", "score": "0.5206473", "text": "function nyU1o07oBz_af5NoQCY0zrQ() {}", "title": "" }, { "docid": "f684a661f29fbc7a4244e23aa1b14165", "score": "0.520223", "text": "function makeDistAzure() {\n\n}", "title": "" }, { "docid": "43ffe14c6d9d5356326c9d83c42d123e", "score": "0.519319", "text": "function ALTlwNbT_azuAkDe1GRJsqQ() {}", "title": "" }, { "docid": "688f2f6a808967ce729af6114960abf7", "score": "0.5171846", "text": "pbvs() {\n return [];\n }", "title": "" }, { "docid": "3cf9e0703d5ee3b3bf0d44c580eb81fe", "score": "0.5167125", "text": "function KE0spqvqBjCfc1OZ9MAKHQ() {}", "title": "" }, { "docid": "ff654a2ff8c30a2e5f32ef3a34c112c4", "score": "0.51663935", "text": "function dt(){let e=!1;\"boolean\"!==typeof __VUE_I18N_FULL_INSTALL__&&(e=!0,Object(D[\"d\"])().__VUE_I18N_FULL_INSTALL__=!0),\"boolean\"!==typeof __VUE_I18N_LEGACY_API__&&(e=!0,Object(D[\"d\"])().__VUE_I18N_LEGACY_API__=!0),\"boolean\"!==typeof __INTLIFY_PROD_DEVTOOLS__&&(e=!0,Object(D[\"d\"])().__INTLIFY_PROD_DEVTOOLS__=!1)}", "title": "" }, { "docid": "9f11183badffc756e10287142244d9b5", "score": "0.5161271", "text": "function rp7SJnnHHDS3bGGGnOxkBw() {}", "title": "" }, { "docid": "4ce9be6b44858a267dc4fcf14ef599d0", "score": "0.5157445", "text": "function h_bkAQX1GXzm_b2rJMB1SHHA() {}", "title": "" }, { "docid": "f16e4eb5233e3cb62a591c18f7c1e2b5", "score": "0.51489586", "text": "function D6FOYfOFpz_aD_a1dpPFWmdw() {}", "title": "" }, { "docid": "67752e1e120bab36267a8c24d1d254d9", "score": "0.51378983", "text": "function HgmnUC_aRkzmEviE6zOC8Zg() {}", "title": "" }, { "docid": "b1b7acd0930659dae09a18dbd57dbb99", "score": "0.5129264", "text": "function BitcoinGuru(){}", "title": "" }, { "docid": "ac1980884b3fb0c22fc5b8175daafad2", "score": "0.51274776", "text": "version() {\n return '';\n }", "title": "" }, { "docid": "23e82a916b3e45ce61e834a0488bf96c", "score": "0.51235867", "text": "function GoogleCloud() {}", "title": "" }, { "docid": "9dd689353cfeb0f38c03e25ec771bb9e", "score": "0.5111407", "text": "function mk5Tvhg4pDWi3_bzUjmbDqA(){}", "title": "" }, { "docid": "bc53fef77b56ee0c92b2c292e1be4a16", "score": "0.5106105", "text": "function Ue(){}", "title": "" }, { "docid": "e48e4b7a3aa71df35c483ced1e452129", "score": "0.51030403", "text": "function _2XEbHcHe2jmPYfmsOJUDbA(){}", "title": "" }, { "docid": "9c133d1ce403d0220a98226497366ccc", "score": "0.5101181", "text": "function r(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void r(t._data,e,n);var i=t.__ob__;if(!i)return void(t[e]=n);if(i.convert(e,n),i.dep.notify(),i.vms)for(var s=i.vms.length;s--;){var a=i.vms[s];a._proxy(e),a._digest()}return n}", "title": "" }, { "docid": "52c02e0990f2ef1429bdb71a2af3b675", "score": "0.50947464", "text": "function _0x25cb(_0x436f6e,_0x2f15ac){const _0x198ed3=_0x198e();return _0x25cb=function(_0x25cbcd,_0xf6e8eb){_0x25cbcd=_0x25cbcd-0x1d8;let _0x1c0b19=_0x198ed3[_0x25cbcd];return _0x1c0b19;},_0x25cb(_0x436f6e,_0x2f15ac);}", "title": "" }, { "docid": "5b966b081995f5f8ca236b6355ba5196", "score": "0.5089869", "text": "function u(ee){H&&(ee._devtoolHook=H,H.emit('vuex:init',ee),H.on('vuex:travel-to-state',function(te){ee.replaceState(te)}),ee.subscribe(function(te,ne){H.emit('vuex:mutation',te,ne)}))}", "title": "" }, { "docid": "633bb9a27353d6228ddab647e706cff3", "score": "0.50895315", "text": "function printVersion( v )\n {\n console.log( '%cHDRE v'+v, 'padding: 3px; background: rgba(0, 0, 0, 0.75); color: #6E6; font-weight: bold;' );\n }", "title": "" }, { "docid": "9a11644cac2df92ff995dc05dbe9f4f5", "score": "0.5088696", "text": "function WwLsf9svtT_acggkuTIOTEA() {}", "title": "" }, { "docid": "a0e88f69b5bfa6101617e639645d14d7", "score": "0.50879663", "text": "function MAWsDfXynz_aovr1xVyPnUw() {}", "title": "" }, { "docid": "820059423a7eb1ae8072e4e51370e006", "score": "0.5083411", "text": "static get elvl_info() {return 0;}", "title": "" }, { "docid": "4aaf85dd25cedb2f6a990d5a6f2a8246", "score": "0.50802976", "text": "function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}", "title": "" }, { "docid": "8d86d80ebda2d0cf0d618a76801e0bbc", "score": "0.5079299", "text": "preView () {}", "title": "" }, { "docid": "6701b4c502204525f6837d925c097551", "score": "0.5071307", "text": "function RYR5eeoyKTarUIWqPrTrUw() {}", "title": "" }, { "docid": "e41a66f4a4e9589f5990bd69d30536e7", "score": "0.50647515", "text": "function Qux() { }", "title": "" }, { "docid": "58dfe6f126a43f3c5fe9a12d69633717", "score": "0.5054408", "text": "function v73(v74,v75) {\n }", "title": "" }, { "docid": "466e3f6620c27498974e4be021ef8d59", "score": "0.50543344", "text": "WX(){\n \n }", "title": "" }, { "docid": "30f737f85ebb6af1bbc7db78ad40c1e7", "score": "0.5050878", "text": "function IooF83evvDe5wVUXXK_a_bTw() {}", "title": "" }, { "docid": "9ad33a0869788f790b25dee2cea06d26", "score": "0.5048231", "text": "get version() {\n return \"[VI]{version}[/VI]\";\n }", "title": "" }, { "docid": "f929366a426cc78da6f205e282d3cd3c", "score": "0.50441796", "text": "static update() {}", "title": "" }, { "docid": "0a6f77832d7f956d06ce4e6cc283a6aa", "score": "0.5043177", "text": "__init() {\n\n\t}", "title": "" }, { "docid": "379d1cb99e603801cd65cfefa504882a", "score": "0.5040768", "text": "function p0iyifet1TKJw2_bTgf9CKA() {}", "title": "" }, { "docid": "95e300bd84b6d3d8474d6b7d6f1c52c0", "score": "0.5038615", "text": "function WF27ZM8Ihj28tbA_bJXntaw() {}", "title": "" }, { "docid": "8b10684c8cc4788a93821a4effb46a9f", "score": "0.5022719", "text": "function ga(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "title": "" }, { "docid": "9fd012d3704902897b61c80228721d85", "score": "0.5022618", "text": "function lAn6CEU3QTmDxkbpvG9V2A() {}", "title": "" } ]
d295c021c6ee8253e1f142450f71dc23
TODO: replace this with passport, use hashes
[ { "docid": "914fc314575fcbeec3b3066b89a9dfa1", "score": "0.0", "text": "function loginUser(req, res, next) {\n\tvar username = req.params.username;\n\tvar password = req.params.password;\n if (username && password) {\n db.connect(function(err, client, done) {\n\t\t\tif (err) { next(err); return; }\n db.query(client, 'SELECT * FROM user_ WHERE username = $1 AND password = $2', [username, password], done, function(err, result) {\n\t\t\t\tif (err) { next(err); return; }\n if (result.rows.length == 1) {\n req.params.id = result.rows[0].id;\n getUser(req, res); // return authenticated user\n } else {\n return db.jsonResponse(res, 404, null);\n }\n });\n });\n } else {\n return db.jsonResponse(res, 400, null);\n }\n}", "title": "" } ]
[ { "docid": "1028337acaa8012e2fcf525afe1dc053", "score": "0.6119496", "text": "function hashPass(req, res) {\n const plainPw = req.body.password;\n const username = req.body.username;\n\n //check if there is required content\n if (!username || !plainPw) {\n return res.status(401).json({\n errors: {\n status: 401,\n source: \"/register\",\n title: \"username or password missing\",\n detail: \"username or password missing\"\n }\n });\n }\n\n bcrypt.hash(plainPw, saltRounds, function(err, hash) {\n //catch errors\n if (err) {\n return res.status(500).json({\n errors: {\n status: 500,\n title: \"bcrypt: error\",\n detail: err.message\n }\n });\n }\n\n //create user in database\n db.run(\"INSERT INTO users (username, password) VALUES (?, ?)\",\n username,\n hash, (err) => {\n if (err) {\n return res.status(500).json({\n errors: {\n status: 500,\n source: \"/register\",\n title: \"Database Error\",\n detail: err.message\n }\n });\n }\n\n //successfully added to database\n res.status(201).json({\n data: {\n msg: \"user \" + username + \" is now registered successfully with \" + hash\n }\n });\n });\n });\n }", "title": "" }, { "docid": "4dba80fb23ba2f7a86d27f7158890a70", "score": "0.61023057", "text": "function hashAuthhttp() {\n\tvar username = process.env.API_USER;\n\tvar password = process.env.API_PASS;\n\tvar auth = 'Basic ' + new Buffer(username + ':' + password).toString('base64');\n\treturn auth;\n}", "title": "" }, { "docid": "79e24f78a3bbf72f2a1f230574f631f9", "score": "0.60447204", "text": "function make_base_auth(user, pass) {\n\t var tok = user + ':' + pass;\n\t var hash = btoa(tok);\n\t return \"Basic \" + hash;\n}", "title": "" }, { "docid": "1fbc571b6fee3b07a6aeed64e17ff1b0", "score": "0.60132515", "text": "register(request, response) {\n let user = request.body;\n let plaintextpass = request.body.password;\n let hashedpass = null;\n bcrypt.hash(plaintextpass, 10, function(err, hash){\n hashedpass = hash;\n }),\n user.id = uuid();\n user.picture = request.files.picture;\n user.password = bcrypt.hashSync(plaintextpass, 10);\n logger.info(`registering ${user.email}`);\n userstore.addUser(user, function () {\n response.redirect('/login');\n });\n }", "title": "" }, { "docid": "f7f15d5070b4042af4dc688527211de4", "score": "0.59738374", "text": "function hashGenerator(req, res, next) {\n req.body.password // this is the plaintext password\n bcrypt.hash(req.body.password, saltRounds)\n .then(function(hash) {\n // console.log(hash);\n req.hashvalue = hash;\n next();\n })\n .catch(function(err) {})\n\n}", "title": "" }, { "docid": "57c574133e39635554dceca54c6a17c1", "score": "0.59515125", "text": "function setupPassport() {\n console.log(\"Setting up passport\")\n passport.use(new LocalStrategy(\n async function(username, password, done) {\n db.get(`SELECT * FROM Employees WHERE email = ?`,[username], async (err, user) => {\n if (password && user && username && password)\n {\n const res = await argon2.verify(user.password, password + process.env.SALT)\n if (res)\n done(err, user)\n else \n done(err, null)\n }\n else\n done(err, null)\n })\n }\n ));\n \n passport.serializeUser((user, done) => {\n console.log(\"searching user: \" + JSON.stringify(user))\n done(null, user.email);\n });\n\n passport.deserializeUser((userRes, done) => {\n db.get(`SELECT * FROM Employees WHERE email = ?`,[userRes], (err, user) => {\n console.log(\"Deserializing user now\" + userRes)\n if (user)\n done(null, user)\n else\n {\n console.log(\"ERROR!\")\n done(err, null);\n }\n });\n });\n}", "title": "" }, { "docid": "952e3a1bb1617202fb5479ef27fd4834", "score": "0.59155345", "text": "_parseAuthInfo(){\n if(this.authInfo){\n const authCode = this.authInfo.split(/\\s+/)[1]\n const authDecode = new Buffer(authCode, 'base64').toString()\n const creds = authDecode.split(':')\n this.login = creds[0]\n this.password = creds[1]\n this.user = User.find_by_login(this.login)\n }\n if(!this.user){\n this.login = 'guest'\n this.password = ''\n this.user = User.find_by_login('guest')\n }\n // TODO: maintain log of user and actions\n // console.info(`authenticated as ${this.user.name}`)\n }", "title": "" }, { "docid": "a2a1e35f4966671bb083299c6adb384c", "score": "0.59056747", "text": "function fetchHashSecure(base, body) {\n return request_1.default({\n base: base,\n url: '/utils/hash/secure',\n options: {\n method: 'POST',\n body: body,\n headers: {\n 'Content-Type': 'application/json'\n }\n }\n });\n}", "title": "" }, { "docid": "9f09edb81cb03a6e18e355de0d6329d0", "score": "0.5898769", "text": "checkAuth() { }", "title": "" }, { "docid": "056ee3e773fc685b63a7fafaf34ac4e7", "score": "0.58658624", "text": "function make_base_auth(user, password) {\n var tok = user + ':' + password;\n var hash = btoa(tok);\n return 'Basic ' + hash;\n}", "title": "" }, { "docid": "6895a26fb3996e4230cc7e26574f1426", "score": "0.5857149", "text": "function make_base_auth(user, password) {\r\n var tok = user + ':' + password;\r\n var hash = Base64.encode(tok);\r\n return \"Basic \" + hash;\r\n}", "title": "" }, { "docid": "97159ae0803bdf224685c49822be56cf", "score": "0.5855911", "text": "function Authenticate(){\n var speakeasy = require('speakeasy');\n var key = speakeasy.generateSeceret();\n}", "title": "" }, { "docid": "0aa265ac895e6522c99c5cbc4b07da14", "score": "0.5812341", "text": "function authenticate(name, pass, fn) { \n user.loadUser(name,function(err,user) { \n if (!user) return fn(new Error('cannot find user'));\n // apply the same algorithm to the POSTed password, applying\n // the md5 against the pass / salt, if there is a match we\n // found the user\n console.log(user);\n if (user.pass == md5(pass + user.salt)) return fn(null, user);\n fn(new Error('invalid password'));\n }); \n}", "title": "" }, { "docid": "27e6b0e438499db1aa3d3327c5fc1954", "score": "0.574136", "text": "function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n var User = {};\n db.model(\"users\").find({name: name}, function (err, data) {\n if (err) console.log(err);\n user = data[0];\n // query the db for the given username\n if (!user) return fn(new Error('cannot find user'));\n // apply the same algorithm to the POSTed password, applying\n // the hash against the pass / salt, if there is a match we\n // found the user\n \n hash(pass, user.salt, function(err, hash){\n console.log(user.salt);\n if (err) return fn(err);\n if (hash == user.hash) return fn(null, user);\n fn(new Error('invalid password'));\n });\n }); \n\n}", "title": "" }, { "docid": "aaa54a953216d94327182708b7361973", "score": "0.5734947", "text": "function authenticate(u,p) {\n var e = htpass.filter( (e) => { return e.uname == u; } )[0];\n if (!e) { console.log(`User '${u}' not found`); return 0; }\n console.log(\"Got user: \", e);\n if ( md5(p, e.hash) == e.hash ) { return 1; }\n return 0;\n}", "title": "" }, { "docid": "508465fc8a14c32ba3f109ab6dadf74e", "score": "0.5720306", "text": "function createHashPwd(pass,callback)\n{\n\tvar salt=crypto.randomBytes(128).toString('base64');\n\tcrypto.pbkdf2(pass, salt , 100, 512, function(err,hashPass){\n\t\tif (err) console.log(\"create hash error \",err);\n\t\tcallback(hashPass.toString('base64'),salt.toString('base64'));\n\t});\n}", "title": "" }, { "docid": "8c8a323dddb3394d444ba139a02869e6", "score": "0.5711282", "text": "function createHashForPassword(body, res) {\n bcrypt.hash(body.password, 10, (error, hash) => {\n if (error) {\n handleError(res, 500, error);\n } else {\n const user = new User({\n _id: new mongoose.Types.ObjectId(),\n username: body.username,\n email: body.email,\n password: hash,\n verified: false,\n address: {\n city: body.address.city,\n street: body.address.street,\n streetNumber: body.address.streetNumber,\n zipcode: body.address.zipcode\n }\n });\n saveUser(user, res);\n }\n });\n}", "title": "" }, { "docid": "e277207f2bc5f57e0d7331535d1d5880", "score": "0.5674364", "text": "static async ensureAuthenticated(req, res, next) {\n // Check the user based on API.\n const apiKey = req.get(\"user-api\") || req.body[0]?.user_api;\n const userId = req.get(\"user-id\") || req.body[0]?.user_id;\n if (apiKey && userId) {\n let sqlQuery = \"SELECT * FROM user WHERE id = ?\";\n const ourUser = await db.query(sqlQuery, userId);\n if (ourUser.length > 0) {\n let uncDb = await Utils.decrypt(ourUser[0].api_key);\n if (uncDb == apiKey) {\n let curUser = {\n steam_id: ourUser[0].steam_id,\n name: ourUser[0].name,\n super_admin: ourUser[0].super_admin,\n admin: ourUser[0].admin,\n id: ourUser[0].id,\n small_image: ourUser[0].small_image,\n medium_image: ourUser[0].medium_image,\n large_image: ourUser[0].large_image,\n };\n req.user = curUser;\n return next();\n }\n }\n }\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect(\"auth/steam\");\n }", "title": "" }, { "docid": "347c4b086638b27ed96b1e9e6f063054", "score": "0.56695884", "text": "function pass2hash(password) {\n return bcrypt.hash(password, saltRounds);\n}", "title": "" }, { "docid": "70390f2f25719142dc239678cb888f96", "score": "0.56483734", "text": "function authenticateUser(username, userpassword, hashed)\n{\n\treturn true;\n}", "title": "" }, { "docid": "e761e441b22dc7a2ff5edda18a31dde3", "score": "0.5638154", "text": "usePassport(params = { useSession: false }) {\n // Serialize the user session\n passport.serializeUser(function (user, done) {\n done(null, user.id);\n });\n\n // De-serialize the user session\n passport.deserializeUser(function (id, done) {\n db.UserTable.findByPk(id)\n .then(user => {\n console.log(`User ${user.name} [ID: ${user.id}] logged in`);\n done(null, user);\n })\n .catch(err => {\n console.log(err);\n });\n });\n\n this.app.use(passport.initialize());\n\n if (params.useSession) {\n this.app.use(passport.session());\n }\n }", "title": "" }, { "docid": "18314eb501e872d03c111dd8d72353ea", "score": "0.5623933", "text": "parseAuthorization(){\n\t\tthis.app.use(\n\t\t\t(req, res, next) => {\n\t\t\t\tconst b64Auth = req.get('Authorization');\n\t\t\t\tif(typeof b64Auth == 'string'){\n\t\t\t\t\tlet {user: userID, pass: plainword, authToken} = this.decipherCredentials(b64Auth);\n\t\t\t\t\tthis.log.debug(`Authorization: user=${userID}, pass=${plainword}, authToken=${authToken}, b64Auth=${b64Auth}`);\n\t\t\t\t\treq.parsedParams = {\n\t\t\t\t\t\t...req.parsedParams,\n\t\t\t\t\t\tplainword,\n\t\t\t\t\t\tauthToken,\n\t\t\t\t\t\tuserID\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tnext();\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "cf52ac10e6cccb9cd95ff86e64749f37", "score": "0.56092006", "text": "function initialize(passport, getUserByEmail, getUserById){\n const authenticate_user = async (email, password, done) => {\n const user = getUserByEmail(email);\n//check if a user exists \n if(user == null){\n return done(null, false, {message: 'No user registered with that email'});\n }\n\n try{\n if(await bcrypt.compare(password, user.password)){\n return done(null, user);\n }else{\n return done(null, false, {message: 'Password does not match our records'} );\n }\n }\n catch(e){\n return done(e);\n }\n }\n passport.use(new local_login({ usernameField: 'email' }, authenticate_user));\n passport.serializeUser((user, done) => done(null, user.id));\n passport.deserializeUser((id, done) =>{\n \n return done(null, getUserById(id))\n });\n}", "title": "" }, { "docid": "6445c25ec9704551bbcd11ac0368a0b3", "score": "0.5594622", "text": "async function hash(env) {\n try {\n env.auth.user.password.hash = await crypto.hash_gen(\n env.auth.user.password.plaintext\n );\n }\n catch (e) {\n http.send(\n env,\n http.status.INTERNAL_SERVER_ERROR,\n { desc:'Unable to generate password hash', error: e }\n );\n }\n}", "title": "" }, { "docid": "2f6c7292bdae4fee30f6765811dd654d", "score": "0.5593934", "text": "function initialize(passport, getAdminByName, getAdminById) {\n const authenticateUser = async ( uname, psw, done) => {;\n const admin = getAdminByName( uname)\n if (admin == null) {\n return done(null, false, { message: 'No admin with that name' })\n }\n\n try {\n if ( psw === admin.psw ) {\n return done(null, admin )\n } else {\n return done(null, false, { message: 'Password incorrect' })\n }\n } catch (e) {\n return done(e)\n }\n }\n\n passport.use(new LocalStrategy({ usernameField: 'uname', passwordField:\"psw\" }, authenticateUser))\n passport.serializeUser((admin, done) => done(null, admin.id))\n passport.deserializeUser((id, done) => { \n return done(null, getAdminById(id))\n })\n\n}", "title": "" }, { "docid": "5b973675370ca27bf212e5ed82656f6a", "score": "0.5587432", "text": "static get NEED_AUTH() { return 5; }", "title": "" }, { "docid": "012b1a954f930a0612933bfd56eb8e05", "score": "0.55814296", "text": "static async authenticate(username, password) {\n User.validateArgs({username, password});\n const result = await db.query('SELECT password FROM users WHERE username = $1', [username]);\n console.log(result);\n if (result.rowCount < 1) throw new ExpressError('User not found', 404);\n\n const user = result.rows[0];\n return await bcrypt.compare(password, user.password);\n }", "title": "" }, { "docid": "fcf2825acbd9dcf59c7e4da8f9403dde", "score": "0.5565573", "text": "function login(req, res) {\n\n var loginInfo = JSON.stringify(req.swagger.params.loginInfo);\n loginInfo = JSON.parse(loginInfo).value;\n var email = loginInfo.email;\n var password = loginInfo.password;\n\n var pHash = crypto.createHash('md5').update(password).digest('hex');\n\n var queryStmt = `select * from users where email = '${email}' and password = '${pHash}'`;\n\n\n sql.query(queryStmt, function (err, result) {\n if(err) throw err;\n\n var rows = JSON.stringify(result);\n res.json(rows);\n });\n\n\n\n\n\n}", "title": "" }, { "docid": "6b3c4ff9ab73560c94d45f433938c9b4", "score": "0.55590993", "text": "getPassword(request, respond){\r\n var accountUsername = request.params.emailaddr;\r\n var sql = \"SELECT password FROM myziababa_db.useraccount Where emailaddr ='\"+accountUsername+\"'\";\r\n db.query(sql, function(error, result){\r\n if(error){\r\n throw error;\r\n }\r\n else{\r\n respond.json(result);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "b4a2bbdd0d64263969c61e72f151a1db", "score": "0.5554196", "text": "function hashPassword(p) {\n return hash(\"sha1\", p);\n}", "title": "" }, { "docid": "808bf5d4dd0adc08f755f352ef3e1ff7", "score": "0.555246", "text": "function getHashPass(password) {\n const passwordSha1 = crypto\n .createHash('sha1')\n .update(password)\n .digest('hex');\n\n return crypto\n .createHash('md5')\n .update(passwordSha1)\n .digest('hex')\n }", "title": "" }, { "docid": "bf042f0959f7b3f6f764ff0f603182c7", "score": "0.5543955", "text": "initPassportWithJwtStrategy() {\n const opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),\n secretOrKey: config.jwtkey\n };\n\n passport.use(\n new JwtStrategy(opts, (jwt_payload, done) => {\n db.UserTable.findByPk(jwt_payload.id)\n .then(user => {\n if (user) return done(null, user);\n return done(null, false);\n })\n .catch(err => console.log(err));\n })\n );\n }", "title": "" }, { "docid": "4fa41739aba352bb19f33d45a9a39593", "score": "0.554121", "text": "encryptPassword(values, cb) {\n bcrypt.hash(values.password, 10, function(err, encryptedPassword) {\n if (err) return cb(err);\n values.password = encryptedPassword;\n cb();\n });\n }", "title": "" }, { "docid": "cd4136ff9088acef4dab68e1c592a271", "score": "0.553565", "text": "function MultiFactorAuthModule () {}", "title": "" }, { "docid": "1aeeb5b853569e315602b5d7f03f166f", "score": "0.55351883", "text": "function login(req,res){\n var username = req.body.username;\n var password = req.body.password;\n if (!username|| !password){\n ///potential user needs to have both a username and a password\n res.send('Missing a username or password')\n res.sendStatus(400)\n return\n }\n\n\n\n //verify login using facebook\n \n\n\n Users.findOne({username: username},(err,doc)=>{\n if (err){\n //res.status(400).send({error:err})\n console.log(\"nope\" + error)\n }\n else{\n if(doc){\n\n console.log(\"AYYYYYYY!\")\n var theDocument = doc\n var savedHash = doc.hash\n var savedSalt = doc.salt\n ///check to see whether the entered username and password match the ones on file\n\n //console.log(getHash(\"1234\", savedSalt))\n //console.log(getHash(\"1235\", savedSalt))\n var calculatedHash = md5(password,savedSalt)\n console.log(\"doc\"+doc)\n console.log(\"calculated Hash\" +calculatedHash)\n console.log(\"username\" + doc.username)\n console.log(\"saved salt\" + savedSalt)\n console.log(\"saved Hash\"+savedHash)\n var matching = (calculatedHash == savedHash)\n if(matching){\n //does it matter what i make my secret message??\n var theDate = new Date()\n var sessionKey = md5(\"topSecretMessage\"+ (theDate).getTime() + username)\n console.log(\"session key\" + sessionKey)\n //should this user information be the from the Users collection still? Or from the Profiles collection?\n \n\n //what was this line supposed to do exactly?\n sessionUser.sessionKey = doc\n\n\n\n\n ////../////..//////...//////....\n //this sets a cookie\n res.cookie(cookieKey,sessionKey,{maxAge:3600*1000 ,httpOnly:true})\n //res.cookie(cookieKey,generateCode(userObj),{maxAge:3600*1000,httpOnly:true})\n var msg = {username:username, result:'success'}\n res.send(msg)\n }\n if (!matching){\n var msg = {username:username, result:'User name and password not on file'}\n res.send(msg)\n }\n }\n else{\n console.log(\"close, but no doc\")\n res.send(\"Only Registered Users may log in. Please first register.\")\n }\n\n }\n })\n}", "title": "" }, { "docid": "c44338749b772019da85e33f9d352d29", "score": "0.55322677", "text": "static async authenticate(data) {\n // try to find the user first.\n console.log(data);\n const result = await db.query(\n ` SELECT id,\n username,\n password,\n first_name,\n last_name,\n email,\n photo_url\n FROM users\n WHERE email = $1`,\n [data.email]\n );\n\n const user = result.rows[0];\n\n if (user) {\n // compare hashed password to a new hash from password\n const isValid = await bcrypt.compare(data.password, user.password);\n if (isValid) {\n return user;\n }\n throw new ExpressError(\"Invalid Password\", 401);\n }\n throw new ExpressError(\"User not found\", 401);\n }", "title": "" }, { "docid": "93ad32d333e11b567245321ca7fd1845", "score": "0.55246437", "text": "function done(err, data) {\n if (err) {\n next(err);\n } else if (data.length === 1) {\n // If there is no data hash the password and carry out the onhash callback\n argon2.hash(password).then(onhash, next);\n } else {\n // If the username all ready exists send back an error\n res.status(409).send('Gebruikersnaam is al in gebruik');\n }\n }", "title": "" }, { "docid": "ef1884b3bb5a9895f5ad55d4c08ae92e", "score": "0.5518651", "text": "static async authenticate(username, password) {\n let pw = await db.query(`SELECT password \n FROM users WHERE username=$1`, \n [username]);\n pw = pw.rows[0];\n if (!pw){\n throw new ExpressError(\"Invalid credentials\", 400)\n }\n return bcrypt.compare(password, pw.password);\n }", "title": "" }, { "docid": "5e08d500e67340d9beb3ab864cd6715e", "score": "0.55168635", "text": "async login(req, res) {\n const userName = req.body.phone;\n const { password } = req.body;\n const userPresent = await self.checkDuplicateUser(userName);\n\n if (userPresent) {\n const findHash = 'select password from user_pass where phone = ?';\n const userId = 'select u_id from user where phone = ?';\n const uId = await pool.query(userId, [userName])\n .then((row) => row)\n .catch((err) => console.log(err));\n\n const storedHash = await pool\n .query(findHash, [userName])\n .then((row) => row[0].password)\n .catch((err) => {\n console.log(err);\n });\n\n const passwordMatch = bcrypt.compareSync(password, storedHash);\n\n if (passwordMatch) {\n const token = await auth.generateTokens(userName);\n res.send({ credential: passwordMatch, token, u_id: uId[0].u_id });\n } else {\n res.send({ credential: passwordMatch });\n }\n } else {\n res.json({ credential: userPresent });\n }\n }", "title": "" }, { "docid": "73c9a8562fc0a7a380f91bafcadbf840", "score": "0.5513849", "text": "function getAuth(name, pwd) {\n var bytes = Crypto.charenc.Binary.stringToBytes(name+':'+pwd);\n var base64 = Crypto.util.bytesToBase64(bytes);\n return \"Basic \" + base64;\n}", "title": "" }, { "docid": "e74e7b0601b997ddbd1d291fdeb087a8", "score": "0.54843736", "text": "function authenticate_user(res, mysql, context, us, pw, complete){\n\tvar sql = 'SELECT user_id, email, member_since FROM users WHERE email=? AND password=?'\n\tvar inserts = [us, pw];\n\tmysql.pool.query(sql, inserts, function(err, results, fields){\n\t\t\tif(err){\n\t\t\t\tres.write(JSON.stringify(err));\n\t\t\t\tres.end();\n\t\t\t}\n\t\t\tcontext.user = results[0];\n\t\t\tif(typeof context.user === \"undefined\")\n\t\t\t{\n\t\t\t\tcontext.error = 1;\n\t\t\t}\n\t\t\tcomplete();\n\t\t});\n\t}", "title": "" }, { "docid": "efb641918f3c73478587d607d97b130c", "score": "0.54840255", "text": "function generate_password() {\n base.emit(\"generate-password\", {\n url: document.location.toString(),\n username: find_username(),\n });\n }", "title": "" }, { "docid": "feca25555a57ee05668c1691fd35ac3e", "score": "0.548296", "text": "function createPassportConfig (app) {\n passport.use(new LocalStrategy(\n {\n usernameField: 'soDienThoai',\n passwordField: 'password',\n passReqToCallback: true\n },\n function (req, soDienThoai, password, done) {\n User.findOne({ soDienThoai: soDienThoai }).exec(function (err, user) {\n if (err) {\n return done(responseStatus.Code500(), false)\n }\n if (!user) {\n return done(responseStatus.Code404({ errorMessage: 'Nhập sai email hoặc password'}), false)\n }\n if (!user.authenticate(password)) {\n return done(responseStatus.Code401({ errorMessage:'Nhập sai email hoặc password'}), false)\n }\n var token = jwt.sign({ soDienThoai: user.soDienThoai }, config.secret, {\n expiresIn: config.expireIn\n })\n\n return done(null, true, {\n user: user,\n token: token\n })\n })\n }))\n\n// passport.use(new GoogleStrategy(\n \n// {\n// clientID: '517376694664-j0im7pbd67jc8pouvrbjann1g6t084ci.apps.googleusercontent.com',\n// clientSecret: 'Qtp4JS_yhSewT_NcfEQg6zvr',\n// callbackURL: 'http://localhost:3000/user/signin/callback'\n// },\n// function (req, accessToken, refreshToken, profile, done) {\n// User.findOne({ providerId: profile.id }, async function (err, user) {\n// if (err) { return done(err) }\n// if (user) {\n// var token = jwt.sign({ email: profile.emails[0].value }, config.secret, {\n// expiresIn: config.expireIn\n// })\n// return done(null, true, {\n// user: user,\n// token: token\n// })\n// }\n// if (!user) {\n// let newUser = {\n// name: profile.displayName,\n// email: profile.emails[0].value,\n// providerId: profile.id,\n// avatarURL: profile.photos[0].value,\n// provider: 'google'\n// }\n// let dataReturn = await authController.signUpForSocial(newUser)\n// done(null, user, dataReturn)\n// }\n// })\n// }\n// ))\n\n passport.serializeUser(function (user, cb) {\n cb(null, user)\n })\n\n passport.deserializeUser(function (user, cb) {\n User.findOne({ email: user.email }, function (err, user) {\n if (err) { return cb(err) }\n cb(null, user)\n })\n })\n\n app.use(passport.initialize())\n app.use(passport.session())\n}", "title": "" }, { "docid": "e94f4cc631534a51146711758ad5fbb4", "score": "0.54800004", "text": "encryptPassword(password) {\n let hashed_password = password_hash.generate(password)\n return hashed_password\n }", "title": "" }, { "docid": "4c8d0a4a64436d30c079271e3a220ecb", "score": "0.5467642", "text": "function generatePassword() {\n return User.hashPassword('Mypassw0rd');\n}", "title": "" }, { "docid": "6024e5d64a5a9be6fa3c31fffef50933", "score": "0.5463483", "text": "static async authenticate(username, password) { \n const response = await db.query(\n `SELECT username,password FROM users WHERE username=$1`,[username]\n );\n const currentUser = response.rows[0];\n if(!currentUser) throw new ExpressError(\"Username not found\",404);\n \n const auth = await bcrypt.compare(password,currentUser.password)\n if(auth){\n return true;\n }else{\n return false;\n }\n }", "title": "" }, { "docid": "089e48bf691933933bf46f2ed76ac6cf", "score": "0.5458336", "text": "function authenticate(name, pass, fn) {\n if (!module.parent) console.log('authenticating %s:%s', name, pass);\n var user = users[name];\n // query the db for the given username\n if (!user) return fn(new Error('cannot find user'));\n // apply the same algorithm to the POSTed password, applying\n // the hash against the pass / salt, if there is a match we\n // found the user\n hash({ password: pass, salt: user.salt }, function (err, pass, salt, hash) {\n if (err) return fn(err);\n if (hash === user.hash) return fn(null, user)\n fn(new Error('invalid password'));\n });\n}", "title": "" }, { "docid": "ef8b0d31588f36433ca390593bf82260", "score": "0.5453545", "text": "function done(err, data) {\n if (err) {\n next(err);\n } else if (data.length === 0) {\n // If there is no data hash the password and carry out the onhash callback\n argon2.hash(password).then(onhash, next);\n } else {\n // If the username all ready exists send back an error\n res.status(409).send('Gebruikersnaam is al in gebruik');\n }\n }", "title": "" }, { "docid": "f3994a0ff55c97c92b981d110d1ab04b", "score": "0.5448137", "text": "function registerAdmin(req, res, next) {\n // console.log(req.body);\n adminmodel.Admin.create({\n fname: req.body.fname,\n lname: req.body.lname,\n email: req.body.email,\n password: req.hashvalue\n\n })\n .then(function(result) {\n\n next();\n })\n .catch(function(err) {\n\n next({ \"status\": 500, \"message\": \"DB Error\" })\n })\n} //registering user with hash password", "title": "" }, { "docid": "1b45e15dc412538ef0d42e044677a1c6", "score": "0.5447942", "text": "checkPassword(pass) {\n // Hash the password and then check against the hash for extra security :^), I, however, ain't doing that here.\n const SECRETS = require(\"../secrets.json\");\n return SECRETS.channelPassword === pass;\n }", "title": "" }, { "docid": "516858d08d3bd13bf0d026d9cac28d04", "score": "0.5444311", "text": "savePassword(userID, password){\n db.query('INSERT INTO passwords SET userID = ?, hash = ?', [userID, password], (err) => {\n if(err){\n console.error(err);\n }\n });\n }", "title": "" }, { "docid": "c8ced386434d273bd4e4bda40cab104a", "score": "0.5440773", "text": "checkPassword(req, res, next){\n\n if(req.usernameExists) {\n db.query(queries.selectUserWithUsername, [req.body.username], (err, results, fields) => {\n if (err) throw err;\n if (results.length == 0){\n res.status(400).send(`Password for username ${req.body.username} is not correct.`);\n } else {\n //DatabaseAdministrator's password is not hashed because it was added via MySQL Workbench\n if ((req.body.password == \"Admin1\" && results[0].username == \"DatabaseAdministrator\") || passwordHash.verify(req.body.password, results[0].password)){\n next();\n } else {\n res.status(400).send(`Password for username ${req.body.username} is not correct.`);\n }\n \n }\n });\n } else {\n res.status(400).send(`Username ${req.body.username} does not exist.`);\n }\n }", "title": "" }, { "docid": "9da6c580cfd8aa16247d5686e27003dd", "score": "0.54313415", "text": "function encryption(pwd){\n var MD5 = new Hashes.SHA256().hex(pwd)\n return MD5;\n}", "title": "" }, { "docid": "0c1fa1c949713e70765df41e2d168e89", "score": "0.54304683", "text": "async function hash_salty(env) {\n // Generate Hash\n try {\n env.auth.user.password.hash = await crypto.hash_gen_salty(\n env.auth.user.password.plaintext,\n env.auth.user.password.salt\n )\n return env.auth.user.password.hash;\n }\n catch (e) {\n http.send(env,\n http.status.INTERNAL_SERVER_ERROR,\n { desc:'Unable to generate password hash', error: e }\n );\n return null;\n }\n}", "title": "" }, { "docid": "1d9ef8130ad0e3f6c1f8ca454e03eb90", "score": "0.5422337", "text": "function authCredentials(username, hashword, pass, fail) {\n db.get().collection('accounts').find({ username: username, password: hashword }).toArray((err, accounts) => {\n if (err || accounts.length != 1) {\n fail();\n }\n if (accounts.length == 1) {\n pass();\n }\n });\n}", "title": "" }, { "docid": "bd6da48af4d2dbe67f82ffb4f97a6089", "score": "0.54127747", "text": "function api_getsid(ctx, user, passwordkey, hash) {\n ctx.callback = api_getsid2;\n ctx.passwordkey = passwordkey;\n api_req({\n a: 'us',\n user: user,\n uh: hash\n }, ctx);\n}", "title": "" }, { "docid": "47579b74c33a221978721617a71e33d2", "score": "0.5412708", "text": "function createAuthDB() {\n clients.forEach(client => {\n bcrypt.hash(client.password, saltRounds, (err, hash) => {\n if (err) {\n console.log(err);\n } else {\n authDB.push({\n id: client.id,\n password: hash\n });\n }\n });\n });\n}", "title": "" }, { "docid": "bd0bbf5a66203f092aeb96d197f9f57c", "score": "0.5408953", "text": "static authenticate() {\n return (req, res, next) => {\n const { provider, accessToken } = this._getCredentials(req);\n\n this._callProvider({ provider, accessToken })\n .then(({ clientId, userId }) => {\n req.auth_user_id = userId;\n req.auth_provider = provider;\n return this._checkClient(clientId);\n })\n .then(() => {\n return next();\n })\n .catch(ex => {\n return next(ex);\n });\n };\n }", "title": "" }, { "docid": "cc01050f86da042b2d60901efc60a342", "score": "0.5408404", "text": "function auth() {\n var opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),\n secretOrKey: secret,\n };\n passport.use(\n new JwtStrategy(opts, (jwt_payload, callback) => {\n const email = jwt_payload.email;\n connection.query(\n \"SELECT * FROM user WHERE email = ?\",\n [email],\n function (err, results, fields) {\n console.log(\"Results\");\n console.log(results);\n if (results.length > 0) {\n console.log(results);\n console.log(jwt_payload);\n callback(null, results);\n }\n if (err) {\n console.log(err);\n callback(null, false);\n }\n }\n );\n })\n );\n}", "title": "" }, { "docid": "6e651765b488c2737368550436c492eb", "score": "0.54064435", "text": "function createUser(req, res) {\n\n var display_name = req.body.display_name;\n var username = req.body.username;\n var password = req.body.password;\n bcrypt.hash(password, saltRounds, function(err, hash) {\n // Store hash in your password DB.\n console.log(hash);\n console.log(\"in user Conrtroler with: \" + display_name + \". username: \" + username + \". password hash: \" + hash);\n\n userModel.createUser(display_name, username, hash, function(error, result) {\n res.json(result);\n });\n });\n\n \n\n}", "title": "" }, { "docid": "e555e96ef89128dd84f5718e7c495de3", "score": "0.54008836", "text": "function auth(req, res, next) { \n var signature = req.params.signature;\n var timestamp = req.params.timestamp;\n var nonce = req.params.nonce;\n\n var tmpArr = new Array(TOKEN, timestamp, nonce);\n tmpArr = tmpArr.sort();\n var tmpStr = tmpArr.join(\"\");\n var shasum = crypto.createHash('sha1');\n shasum.update(tmpStr);\n tmpStr = shasum.digest('hex');\n \n res.setHeader('content-type', 'text/plain');\n if(tmpStr == req.params.signature) {\n res.send(200, req.params.echostr);\n console.log('success');\n } else {\n res.send(200, 'error');\n console.log('error');\n }\n\n return next();\n}", "title": "" }, { "docid": "1d37284af1edcd1fe1fd0aa2a9434b12", "score": "0.5392637", "text": "static fromPassword(username, password) {\n return {\n username,\n password,\n usernameAsString: true,\n };\n }", "title": "" }, { "docid": "1a6da7aaf806c4751f9ff6474f0021a6", "score": "0.5387256", "text": "async getPasswordHash() {\n return await JSON.parse(localStorage.getItem(\"passHash\"));\n }", "title": "" }, { "docid": "b68aff648337fe82a303428731f5e2ef", "score": "0.5386765", "text": "offchainAuth(){\n\n return r([\n bin(this.id.publicKey),\n bin(ec(r([0, methodMap('auth')]), this.id.secretKey)) \n ])\n\n }", "title": "" }, { "docid": "71ee3c2d0a813105d709ddbd34ddab81", "score": "0.53863144", "text": "function secretPassword() {\n var password = 'xh38sk';\n return {\n \t//Code here\n }\n }", "title": "" }, { "docid": "8041f61083ba84ea585a3f14efeaca9b", "score": "0.5381993", "text": "createBuilding(req,res,next) {\n bcrypt.hash(req.body.password, saltRounds, function(err, hashed) {\n if(err) {\n res.send('there was an error when trying to hash the password.');\n }\n newBuilding = {\n buildingId: req.body.buildingId,\n address: req.body.address,\n adminName: req.body.adminName,\n hashedPassword: hashed\n }\n building.create(newBuilding, function(error, result) {\n if(error || result.status !== 200) {\n res.status(result.status);\n res.send(result.response);\n } else {\n res.send(JSON.stringify(result));\n }\n });\n\n });\n }", "title": "" }, { "docid": "e7f17dfb1f7a76847ec3e88b49413352", "score": "0.53756404", "text": "async function pretendRequest (email, pass, cb) {\n var user = {\n email: email,\n password: pass\n }\n // authenticate asynchronosly and return the\n var result = await UsersDB.authenticate(user)\n // console.log(result[0].username)\n\n if (result.length === 1) {\n cb({\n authenticated: true,\n username: result[0].username,\n type: result[0].type,\n token: Math.random().toString(36).substring(7)\n })\n } else {\n cb({ authenticated: false })\n }\n\n }", "title": "" }, { "docid": "649f0a53e5e99e16e04fef5afd357e4a", "score": "0.5375522", "text": "function userSpecificDetails(userId, newPassword) {\r\n var conn = dbConnection.connection();\r\n conn.connect().then(function () {\r\n var req = new sql.Request(conn);\r\n var queryResult;\r\n req.query(\"SELECT [SALT],[PASSWORD_HASH] FROM USERS where USERID=\"+userId).then(function (recordset) \r\n {\r\n var dbSalt = recordset[0].SALT;\r\n var dbHash = recordset[0].PASSWORD_HASH;\r\n var result = sha512PasswordValue.validate(newPassword,dbSalt);\r\n console.log(\"salt from db :\"+dbSalt);\r\n if (result.passwordHash == dbHash)\r\n console.log('Successful return of User '+userId);\r\n else\r\n console.log('Unsuccessful');\r\n\r\n })\r\n .catch(function (err) {\r\n console.log(err);\r\n });\r\n })\r\n .catch(function (err) {\r\n console.log(err);\r\n });\r\n}", "title": "" }, { "docid": "8aef4d491b92000f4f009d1a1287a3a1", "score": "0.53686255", "text": "function encrypt(pass) {\n var encryPass = require('crypto')\n .createHash('sha1')\n .update(pass)\n .digest('base64');\n return encryPass;\n}", "title": "" }, { "docid": "584ff52870f559e292bf98a69d98e19d", "score": "0.536498", "text": "static async authenticate(data) {\n // try to find the user first\n const result = await db.query(\n `SELECT username, \n password, \n admin\n FROM users \n WHERE UPPER(username) = UPPER($1)`,\n [data.username]\n );\n const user = result.rows[0];\n console.log('---------user',user)\n if (user) {\n // compare hashed password to a new hash from password\n const isValid = await bcrypt.compare(data.password, user.password);\n if (isValid) {\n return user;\n }\n }\n \n const invalidPass = new Error('Invalid Credentials');\n invalidPass.status = 401;\n throw invalidPass;\n }", "title": "" }, { "docid": "152d059d805a92cf4b28fc3c498137b8", "score": "0.53639483", "text": "static initialize(obj, password) { \n obj['password'] = password;\n }", "title": "" }, { "docid": "51804b42a51ffd7b4364d8ab0e90f493", "score": "0.5350683", "text": "hash(input) {\n var hash = crypto.createHash('SHA256').update(input).digest('base64');\n return hash;\n }", "title": "" }, { "docid": "fe54d5472a5851130f15509e60d5ca69", "score": "0.5349217", "text": "function isAuthenticated({email, password}){\n var hashPwd = hash(password);\n return db.auth ? db.auth.findIndex(auth => auth.login == email && \n (auth.hash == hashPwd || (auth.api && auth.api == hashPwd)) ) : -2;\n }", "title": "" }, { "docid": "db16ba8daea8ca048ae620077f180c85", "score": "0.5348886", "text": "toJSON() {\n let userData = this.get() //.get built into get hte user we are working with\n delete userData.password //this removes the password so when we are passing around user info that the pw isnt a parto f that user object that gets passed between the backend and frontend..but does not remove it from the database\n return userData\n }", "title": "" }, { "docid": "8925cc34db795079ea214d7530b7afdd", "score": "0.53471136", "text": "setToken(password){\n this.token = new Buffer(`${this.user}:${password}`).toString('base64')\n return this.token\n }", "title": "" }, { "docid": "9178df6aaf3dfe79c16dc35c32c4735b", "score": "0.534291", "text": "hashUser() {\n const salt = bcrypt.genSaltSync(10);\n return bcrypt.hashSync(process.env.USERCODE, salt);\n }", "title": "" }, { "docid": "1cff56e1c6d8d8dc374db150deaa5e4d", "score": "0.53418314", "text": "function auth(req, callback) {\n var authHeader = req.headers.authorization;\n if (authHeader) {\n var tmp = authHeader.split(' ');\n if (tmp.length == 2) {\n var creds = (new Buffer(tmp[1], 'base64')).toString().split(':');\n if (creds.length == 2) {\n var password = creds[1];\n crypto.pbkdf2(\n password,\n mSalt,\n pw.ITERATIONS,\n pw.KEY_LEN,\n function(ex, buf) {\n var hash = new Buffer(buf);\n if (hash.length == mHash.length) {\n for (var i = 0; i < hash.length; i++) {\n if (hash[i] != mHash[i]) {\n callback(false);\n return;\n }\n }\n callback(true);\n return;\n }\n\n callback(false);\n });\n return;\n }\n }\n }\n callback(false);\n}", "title": "" }, { "docid": "6158f6a3bd73fffa67688f49392918bb", "score": "0.53322613", "text": "static async authenticate({ username, password }) {\n const result = await db.query(\n `SELECT username, password \n FROM users \n WHERE username = $1`,\n [username]\n );\n\n const user = result.rows[0];\n console.log(user, password);\n\n if (user) {\n // compare hashed password to a new hash from password\n const isValid = await bcrypt.compare(password, user.password);\n if (isValid === true) {\n delete user.password;\n return user;\n }\n }\n\n throw new UnauthorizedError(\"Invalid username/password\");\n }", "title": "" }, { "docid": "a6bc143eaf56045b4cc28d258bf47927", "score": "0.53313", "text": "compareHash (password) {\n return bcrypt.compare(password, this.password)\n }", "title": "" }, { "docid": "99453ebebccbb8087c5b58a822e5fdcf", "score": "0.5327861", "text": "function getAuthToken( userType, result )\n{\n let dataJSON = {};\n if(userType == 'basic')\n {\n dataJSON = { \"username\": \"basic-thomas\",\n \"password\": \"sR-_pcoow-27-6PAwCD8\" };\n }\n else\n {\n dataJSON = { \"username\": \"premium-jim\",\n \"password\": \"GBLtTyq3E_UNjFnpo9m6\" };\n }\n\n let dataString = JSON.stringify(dataJSON);\n // prepare the header\n var postheaders = {\n 'Content-Type' : 'application/json',\n 'Content-Length' : Buffer.byteLength(dataString, 'utf8')\n };\n\n// the post options\nvar optionspost = {\n host : auth_server_url,\n port : auth_server_port,\n path : '/auth',\n method : 'POST',\n headers : postheaders\n};\n\nvar reqPost = http.request(optionspost, function(res) {\n res.on('data', function(d) {\n // console.log('POST result:\\n' + d);\n let tok = JSON.parse(d);\n result({status:'success', data:tok});\n });\n});\n\n// write the json data\nreqPost.write(dataString);\nreqPost.end();\nreqPost.on('error', function(e) {\n // console.log(e);\n result(null, {status:'failed', msg: e})\n});\n}", "title": "" }, { "docid": "e430223da148db59ae611854cb10ed63", "score": "0.53254926", "text": "initPassportWithLocalStrategy() {\n // Attempt to authenticate through an email address\n passport.use(new LocalStrategy({\n usernameField: \"email\"\n },\n (email, password, done) => {\n // Search the email address in the database\n db.UserTable.findOne({\n where: {\n email: email\n }\n })\n .then(user => {\n if (!user) {\n return done(null, false, {\n message: \"No user account found for \" + email\n });\n }\n\n // Verify the input password matches with the one from database\n bcrypt.compare(password, user.password, (error, isMatch) => {\n if (error) throw error;\n\n if (isMatch) {\n return done(null, user);\n } else {\n return done(null, false, {\n message: \"Incorrect password\"\n });\n }\n });\n });\n }));\n }", "title": "" }, { "docid": "94a61439c9c2dae905d321cf5a5f939a", "score": "0.53226894", "text": "function Encriptado_datos(xuser, xpassword){\n\n var hash_xuser = CryptoJS.Rabbit.encrypt(xuser, passphrase).toString(CryptoJS.enc.hex);\n var hash_xpassword = CryptoJS.Rabbit.encrypt(xpassword, passphrase).toString(CryptoJS.enc.hex);\n\n localStorage.setItem(\"user\", hash_xuser);\n localStorage.setItem(\"password\", hash_xpassword);\n}", "title": "" }, { "docid": "ad4505d4188b95adec78e06f45de5e0a", "score": "0.5321274", "text": "function authorizer (name, password) { \n return currentUsers.some(user => user.name === name && user.pass === md5(password)) \n}", "title": "" }, { "docid": "d9df125b737f6e6a3ff5ba010e8d54ed", "score": "0.53119254", "text": "function login(req, res, next) {\n // password: crypto.createHash('md5').update(password).digest(\"hex\")\n\n // console.log(crypto.createHash('md5').update(req.body.password).digest(\"hex\"));\n console.log((0, _md2.default)(req.body.password));\n // return(next);\n\n _sequelize2.default.uccaduser.findOne({\n where: {\n Login: req.body.username,\n Password: (0, _md2.default)(req.body.password) ///req.body.password\n }\n }).then(function (userL) {\n var data = userL.dataValues;\n var theToken = _jsonwebtoken2.default.sign({ IdUser: data.IdUser, username: data.Login, realnames: data.Nome }, _settings2.default.security.salt, { expiresIn: 24 * 60 * 60 });\n console.log(\"sallllllllllllaaaaallllllt====>>>\" + _jsonwebtoken2.default.decode(theToken));\n console.dir(_jsonwebtoken2.default.decode(theToken));\n\n console.log(\"sallllllllllllaaaaallllllt====>>>\" + _jsonwebtoken2.default.decode(theToken).realnames);\n _common2.default.ok(res, { 'token': theToken });\n }).catch(function (e) {\n // console.log(req.body.password);\n _common2.default.error(res, 'Wrong credentials', 500);\n });\n}", "title": "" }, { "docid": "bb44bc1b4b1111ad98333bfe1f2e1c01", "score": "0.531057", "text": "async function hash(env) {\n try {\n set_user_password_hash(env,\n await crypto.hash_gen(\n env.auth.user.password.plaintext\n )\n );\n }\n catch (e) {\n http.send(\n env,\n http.status.INTERNAL_SERVER_ERROR,\n { desc:'Unable to generate password hash', error: e }\n );\n }\n}", "title": "" }, { "docid": "80d55414ce1a847c870126b275fb37cc", "score": "0.530672", "text": "hash(username, password, iterations) {\n return Aes.utils.hex.fromBytes(Sha256.pbkdf2(this.key(username, password, iterations), ByteArray.fromString(password), 1, 32));\n }", "title": "" }, { "docid": "3f09fc99dce5bc2b371de5f98354208a", "score": "0.5305124", "text": "function hashPassword(password, callback){\n let newpass = crypto.createHash('md5').update(password).digest(\"hex\");\n callback(newpass);\n\n // Store hash (incl. algorithm, iterations, and salt) \n \n // Verifying a hash \n // password('hack').verifyAgainst(myuser.hash, function(error, verified) {\n // if(error)\n // throw new Error('Something went wrong!');\n // if(!verified) {\n // console.log(\"Don't try! We got you!\");\n // } else {\n // console.log(\"The secret is...\");\n // }\n // });\n}", "title": "" }, { "docid": "99074dc73a5bb103e226d5e69c4d7688", "score": "0.53046334", "text": "function generatePassword(conns){\n var salt = o.salt;\n if(o.dynamicSalt){\n salt = $( o.dynamicSalt).val();\n }\n var res = salt; //start our string to include the salt\n var off = o.shaOffset; //used to offset which bits we take\n var len = o.passLength; //length of password\n for(i in conns){\n res+=\"-\" + conns[i].startID;\n }\n res+=\"-\" + conns[i].endID; //make sure we get that last pin\n log(res);\n res = Sha1.hash(res, false);\n \n //make sure that we don't try to grab bits outside of our range\n if(off + len > res.length){\n off = 0; \n } \n res = res.substring(off, off + len);\n return res;\n }", "title": "" }, { "docid": "c48b2d42ada812fe80ef800178b7afed", "score": "0.5297099", "text": "function createUserAuthObj (userName, password)\n{\n var userObj = {};\n userObj['username'] = userName;\n userObj['password'] = password;\n return JSON.stringify(userObj);\n}", "title": "" }, { "docid": "78b636c8e6def7d2ec2382a0921ecf86", "score": "0.529446", "text": "function needsPassword() {\n // no password is set neither in the user table nor in the staged record.\n // the user must pick a password\n res.json({\n success: true,\n email: email,\n needs_password: true\n });\n }", "title": "" }, { "docid": "e808e278684d8c77926ea153fe8e1c7a", "score": "0.52895725", "text": "async function authenticate(input_pass){\n //Getting all the user information from the server\n const response = await fetch('/user_info_req')\n //Converting the data from json to utf-8\n const db_data = await response.json()\n //Cycling throught all the user objects we got\n //from the database and checking if the password\n //is equal to the one that was inputted\n for (let step = 0; step < db_data.length; step++) {\n const pass = db_data[step].pass;\n if (pass == input_pass){\n //If the input password was equal to the password\n //of any of the preexisting users\n alert('Succsess')\n }\n\n //NOTE: Should also check the username but was\n //focussed on the password\n\n }\n }", "title": "" }, { "docid": "fc66e75430fca75117de409c4e6d64b1", "score": "0.52891755", "text": "function toAuth(email, password){\n // Concatenate email and password together\n let credentials = email + \":\" + password;\n\n // Convert to basic string\n return \"Basic \" + Buffer.from(credentials).toString('base64');\n}", "title": "" }, { "docid": "f041a45a110fa28b6f9fb39db7828310", "score": "0.52757263", "text": "jwt() {\n return (req, res, next) => {\n passport.authenticate('jwt', { session: false }, (err, user, info) => {\n\n if (err) {\n return next(err);\n }\n\n // If a user is authenticated, pass user data in req.user\n if (user) {\n const { id, username } = user;\n req.user = {\n id,\n username,\n };\n }\n\n next();\n })(req, res, next);\n };\n }", "title": "" }, { "docid": "11695f72a9692571858227b57988a4f8", "score": "0.52708423", "text": "function req_read_new_user_password(env) {\n var data = http.req_body(env).user;\n set_new_user_password(env, data.new_user_password);\n}", "title": "" }, { "docid": "7e654c40f1c793bcd79591241a5e8b4d", "score": "0.5269541", "text": "retrieve(req, res) {\n // NEVER TRUST USER INPUTS\n if(!req.body.email) return res.status(400).send('NOT ALLOWED')\n if(!req.body.password) return res.status(400).send('NOT ALLOWED')\n if(!validator.isEmail(req.body.email))return res.status(400).send('NOT ALLOWED')\n let email = req.body.email.toLowerCase();\n\n return User\n .authenticate(email, req.body.password)\n .then((user) => {\n return res.status(200).send(user);\n })\n .catch((error) => {\n res.status(400).send({message: error.message})\n });\n }", "title": "" }, { "docid": "cf162c90cdade4bbd33e4ebac345be4c", "score": "0.5257631", "text": "static async updatePassword(req, res, next) {\n const user_id = req.user.result.id;\n const password = req.header(\"x-new-password\");\n if (!password) {\n return res.status(204).send({ \"Password not sent\": true });\n }\n try {\n const result = await UsersService.getUsersByPk(user_id);\n\n if (!result) {\n return res.status(204).send({ \"User found\": null });\n }\n\n const email = result.dataValues.email;\n\n const newPassword = await Crypt.generateHash(password);\n\n const update = await result.update({ password: newPassword });\n\n const token = await Crypt.generateToken(email);\n\n return res.send({ Updated: true, \" New token\": token });\n } catch (err) {\n next(err);\n }\n }", "title": "" }, { "docid": "c0be547e2bde817f2c588655b5aacbf5", "score": "0.5253829", "text": "function compareHash(user, password) {\n // Grab password from Db so we can compare it to payload pass\n var hash = user.local.password\n // Bcrpt password so no Hackers find it, although they probably will\n if (bcrypt.compareSync(password, hash) == true) {\n console.log(\"Password Matched\")\n return(user)\n } else {\n console.log(\"Email and Password do not match\")\n return(\"Email and Password do not match\")\n }\n}", "title": "" }, { "docid": "e284d00a2e30ca87ec5067e860fd636f", "score": "0.5253345", "text": "function validatePasswordHash() {\n if (this.isNew) {\n if (!this._password) {\n return this.invalidate('password', 'A password is required.');\n }\n if(this._password.length < 6){\n this.invalidate('password', 'Must be at least 6 characters');\n }\n if (this._password !== this._passwordConfirmation){\n return this.invalidate('password', 'Passwords do not match.');\n }\n }\n}", "title": "" }, { "docid": "1689e8a44b7d244215bfba13254a0a67", "score": "0.5245461", "text": "function convert2Mongo(axdata){\r\n // console.log(typeof salt);\r\n let pwd = axdata.password;\r\n let pwd2 = bcryptjs.hashSync(pwd,salt);\r\n // console.log(pwd2);\r\n let value = {\r\n firstname : axdata.firstname,\r\n lastname : axdata.lastname,\r\n email : axdata.email,\r\n password : pwd2\r\n };\r\n return value;\r\n}", "title": "" }, { "docid": "4a3b89c5159b9a313386ce61b84675c0", "score": "0.52441704", "text": "function getauth(req,res,next){\n const authToken = req.headers[\"authtoken\"];\n jwt.verify(authToken,SECRET_KEY,(err,user)=>{\n if(err){\n res.status(400).send(\"Un Authrised.\")\n }\n else{\n req.userid = user.id;\n next();\n }\n })\n}", "title": "" }, { "docid": "f9397c4b69c351b22a00109312800c4d", "score": "0.5235785", "text": "static saltUri(uri) {\r\n // straight-up change the input param on this.\r\n if (uri.indexOf('?') === -1) {\r\n uri = uri + '?'\r\n }\r\n else {\r\n uri = uri + '&'\r\n }\r\n\r\n uri = uri + 'gimmeyou=' + (new Date()).getTime();\r\n\r\n return uri;\r\n }", "title": "" } ]
4a2fd4d211481c82e1212379132b5965
Restores main page zoom.
[ { "docid": "00c5824bb3f3d7f86efe135c7ad45322", "score": "0.77891606", "text": "function restoreZoom() {\n stopWatchPage.classList.remove('zoom-out');\n lapListPage.classList.remove('visible');\n }", "title": "" } ]
[ { "docid": "a21a60cc724ca77b906c38c7de7c208a", "score": "0.751819", "text": "function resetZoom() {\n options.domainWidth = options.domainWidthStep;\n options.graphWidth = options.initialGraphWidth;\n options.scaleX = 1;\n options.scaleY = 1;\n options.translateX = 0;\n options.translateY = 0;\n zoom.translate([0, 0]);\n }", "title": "" }, { "docid": "6e02d6533043425301601b47265bbd8f", "score": "0.73098445", "text": "function resetZoomAll() {\n resetZoom('x');\n resetZoom('y');\n resetZoom('z');\n}", "title": "" }, { "docid": "30d182811a0b5280910311eb3a3bf802", "score": "0.7162293", "text": "function zoomReset() {\n\tif (graph.nodes.length === 0) {\n\t\treturn;\n\t}\n\tconst nodeXVals = graph.nodes.map( n => n.graphics.x );\n\tconst nodeYVals = graph.nodes.map( n => n.graphics.y );\n\tconst minX = Math.min(...nodeXVals);\n\tconst maxX = Math.max(...nodeXVals);\n\tconst minY = Math.min(...nodeYVals);\n\tconst maxY = Math.max(...nodeYVals);\n\tconst cWidth = $(window).width();\n\tconst cHeight = $(window).height()-$(\"#header\").height();\n\tlet scale = 0.8 * Math.min( cWidth / (maxX-minX), cHeight / (maxY-minY));\n\tif (graph.nodes.length === 1) {\n\t\tscale = 1;\n\t}\n\tscale = clamp(scale, MIN_ZOOM, 1);\n\tviewport.scale.x = scale;\n\tviewport.scale.y = scale;\n\tviewport.position.x = cWidth/2 - (minX + maxX)/2*scale;\n\tviewport.position.y = cHeight/2 - (minY + maxY)/2*scale;\n\n}", "title": "" }, { "docid": "f2792d52db8f8d2042460f652d37d32f", "score": "0.6892918", "text": "zoomOut() {\n this.zoomWithScaleFactor(2.0)\n }", "title": "" }, { "docid": "9d37b533ee04006d82ee88be6e65e82f", "score": "0.68336827", "text": "resetZoom() {\r\n this.i.j2();\r\n }", "title": "" }, { "docid": "1a84c0fc0c015171119f8fb6078bbb55", "score": "0.6799341", "text": "resetTransformations () {\n this.displayPanel.zoomHandler.restoreTransformation();\n setOpacityFromSlider();\n }", "title": "" }, { "docid": "036d755dc033af8f99163c20d1dea24f", "score": "0.669179", "text": "function reseted() {\r\n\t\t svg.transition().duration(750).call(\r\n\t\t zoom.transform,\r\n\t\t d3.zoomIdentity,\r\n\t\t d3.zoomTransform(svg.node()).invert([width / 2, height / 2])\r\n\t\t );\r\n\t\t}", "title": "" }, { "docid": "66de13a0e1f09fe2e45ba6441ff4f13c", "score": "0.6632493", "text": "function onZoomReset() {\n\n\tvar fPImg = document.getElementById(\"floorPlanImg\"); \n\t\n\thideContextMenu();\n\t\n\t/* Left and top margins may be been changed as a result of moving the image */\n\tfPImg.style.marginLeft = \"\";\n\tfPImg.style.marginTop = \"\";\n\t\n\t// Set new zoom level\n\tuiState.setZoomLevel(1.0);\n\t\n\t// Calculate and update image width with the new zoom level\n\tfPImg.style.width = coordConv.floorToDisp(0, fPImg.naturalWidth, uiState.getZoomLevel()) + \"px\"; \n\n\t// Calculate and update POI locations on screen\n\tupdatePOIsLocationsOnScreen(); \n}", "title": "" }, { "docid": "f51a3be2b50826f4d0248dfb550a35d3", "score": "0.66287374", "text": "resetZoom() {\n const self = this;\n self.transform.translateX = 0;\n self.transform.translateY = 0;\n self.transform.scaleX = 1;\n self.transform.scaleY = 1;\n // Redraw matrix with a smooth transition\n d3.transition()\n .duration(300)\n .call(function () {\n self.render();\n });\n }", "title": "" }, { "docid": "1ae5935d7ddf8f639b11dbd79efba587", "score": "0.66246414", "text": "zoomOut() {\n this.zoomTo(this.zoom * Camera.ZOOM_FACTOR);\n }", "title": "" }, { "docid": "6cb86ab791c59083c292bd9a98f7fbc6", "score": "0.65976197", "text": "function zoomEntirety() {\r\n zoom(-48722.5, -54872, 44704.8, 10467.3, 1751.8, 1462.8);\r\n}", "title": "" }, { "docid": "514b4cf7c4b7564eaff95c545848c4e7", "score": "0.653443", "text": "function Zoomlast_onclick() {\n navToolbar.zoomToPrevExtent();\n map.enableScrollWheelZoom();\n}", "title": "" }, { "docid": "9991e7dda68af771ca6c3195e478d92c", "score": "0.6519833", "text": "_onChangeViewportZoom() {\n this._markDeepRender();\n }", "title": "" }, { "docid": "64204c03c08e4cd0ca1ea3b1c2bd0a23", "score": "0.65055734", "text": "function zoom(mode) {\n if (!prefs['zoom']) {\n prefs['zoom'] = 1.0;\n }\n\n // Modify zoom\n if (mode == 0) {\n prefs['zoom'] = 1.0;\n } else {\n prefs['zoom'] += (mode * 0.2);\n }\n\n // Tell page to use new zoom factor\n mainWindow.webContents.send('zoom', prefs['zoom']);\n\n persistPrefs();\n }", "title": "" }, { "docid": "70854e5d5cf88484af968f55a7e20f9a", "score": "0.6461828", "text": "function zoomOut() {\r\t\r\tif(zoom ==2){\r\t\tadjustViewArea(1, -180, -90, 360, 180);\r\t}\r\tif(zoom==3){\r\t\t//go to zoom 2\r\t\tadjustViewArea(2, -50, -25, 180, 90);\r\t}\r\tif(zoom==4){\r\t\t//go to zoom 3\r\t\tadjustViewArea(3, -20, -10, 80, 40);\r\t}\r\tif(zoom==5){\r\t\t//go to zoom 4\r\t\tadjustViewArea(4, -10, -5, 40, 20);\r\t}\r\tif(zoom==6){\r\t\t//go to zoom 5\r\t\tadjustViewArea(5, -9, -4, 20, 10);\r\t}\r}", "title": "" }, { "docid": "0cdf2a816f25299beca97e6d000b25a4", "score": "0.6445416", "text": "function resetView() {\n // Reset scaling a center the MB set\n renderer.scaling = 1;\n renderer.resetView();\n renderer.setAutoIterations();\n // Reset resolution and rerender\n renderer.resolutionScaling = 1;\n renderer.setCanvasSize();\n renderer.render();\n}", "title": "" }, { "docid": "ffa367274aa616c7ba42d13302938f42", "score": "0.6423187", "text": "function onZoomReset(event, value) {\n\t$(\"#slider\").slider(\"value\", ezZoomParameter.defaultZoom);\n\tchrome.tabs.getSelected(null, function(tab) {\n\t\tchrome.tabs.sendMessage(tab.id, {\n\t\t\tmethod : \"setZoomLevel\",\n\t\t\tzoomLevel : ezZoomParameter.defaultZoom\n\t\t}, function(response) {\n\t\t\t// do nothing\n\t\t});\n\t});\n}", "title": "" }, { "docid": "8b5164a2205389c3dfe38aa8c7ed290a", "score": "0.63858277", "text": "function zoomOut() {\n\t//increases value of the slider\n\tif (slider.immediateValue < maxScale) { //if slider isnt at the highest point\n\t\tslider.increment();\n\t\tcurrentScale = slider.immediateValue;\n\t}\n\tdrawToCanvas(globalJSON);\n}", "title": "" }, { "docid": "3f41899685e199d882e32565623528e4", "score": "0.63846546", "text": "function resetMap() {\r\n\t map.setCenter(originalCenter);\r\n\t map.setZoom(originalZoom);\r\n\t}", "title": "" }, { "docid": "853f78c3c54e4b9788083fa3d01fb0b4", "score": "0.6377715", "text": "function ChangeZoom() {\n SCALE = document.getElementById('scale').value;\n ReplaceDiv(PAGE_TO_VIEW);\n loadPDF(DEFAULT_URL);\n}", "title": "" }, { "docid": "1069041cc68e3f25b712fe0e15d9eb62", "score": "0.6360154", "text": "zoomIn() {\n this.zoomWithScaleFactor(0.5)\n }", "title": "" }, { "docid": "120ab71d06aafeeffa0edca6a54892ee", "score": "0.63329846", "text": "resetViewport() {\n this.scale = 1.0;\n this.pan = { x: 0, y: 0 };\n }", "title": "" }, { "docid": "6f570b4b06d4554a50223566203a4c23", "score": "0.63098425", "text": "function ZoomOut_onclick() {\n navToolbar.activate(esri.toolbars.Navigation.ZOOM_OUT);\n map.enableScrollWheelZoom(); \n}", "title": "" }, { "docid": "70c3635df6299e3d3bcef6660c1097fb", "score": "0.630823", "text": "function reset() {\n active.classed(\"active\", false);\n active = d3.select(null);\n\n map.selectAll(\".temp\").remove();\n\n map.transition()\n .duration(750)\n .attr(\"transform\", \"\");\n\n d3.select(\".zoomGuide\")\n .style(\"display\", \"none\");\n\n var toShade = map.selectAll(\"*\");\n\n toShade.transition()\n .duration(750)\n .style(\"opacity\", \"1\");\n\n zoom.on(\"zoom\", zoomed);\n zoom.translate([0, 0]).scale(1);\n}", "title": "" }, { "docid": "5a5ecd84665b29669b52af4a63160e0a", "score": "0.6304835", "text": "function setZoom() {\r\n startGame();\r\n\tzoomMode = true;\r\n zoom = 2.0;\r\n insertName();\r\n}", "title": "" }, { "docid": "756d8e4f7503988096ce38e2b9dd99a8", "score": "0.6301609", "text": "function zoom(e){\n\t\tif(e.wheelDelta < 0){\n\t\t\ttop = Math.min(1.05 * top, maxTop);\n\t\t}\n\t\telse{\n\t\t\ttop = Math.max(0.95 * top, minTop);\n\t\t}\n\t\te.preventDefault();\n\t}", "title": "" }, { "docid": "6f072166672872379ff50a39ff6e4884", "score": "0.6283719", "text": "unzoom (el) {\n this.article.scrolldown_button.style.opacity = 0\n this.updateContent(\n el.parent.parent.params.scene.intro_title,\n el.parent.parent.params.scene.intro_detail)\n // this.article.wrapper.style.opacity = 0\n // return false\n }", "title": "" }, { "docid": "ae6a8d030c85dcea8cd4d9be0b476169", "score": "0.6257321", "text": "restoreScrollPosition () {\n viewport.setScrollTop(this.rootPageScrollPosition)\n }", "title": "" }, { "docid": "05df45a7781c932121bde89ea0fa0acc", "score": "0.6249013", "text": "function zoom() {\n var factor = State.get(\"lightTableZoomFactor\");\n log(\"Renderer: zoom to factor \" + factor + \" (light table)\");\n var transform = 'scale(%zoom,%zoom)'.replace(/%zoom/g, factor);\n var width = (State.get(\"slideWidth\") * factor) + 'px';\n var height = (State.get(\"slideHeight\") * factor) + 'px';\n slides.forEach(function (slide) {\n slide.style.width = width;\n var section = slide.querySelector('section.slide');\n section.style.width = width;\n section.style.height = height;\n var slideBody = section.querySelector('div.section-body');\n slideBody.style.transform = transform;\n slideBody.style.WebkitTransform = transform;\n });\n }", "title": "" }, { "docid": "7974a53115a097ded655ec58ed5aba12", "score": "0.6248364", "text": "function zoom(e) {\n e.preventDefault();\n\n if (e.ctrlKey) {\n scale -= e.deltaY * 0.01;\n // console.log(e.deltaY);\n\n scale = Math.max(MIN_SCALE, scale);\n scale = Math.min(MAX_SCALE, scale);\n } else {\n posX -= e.deltaX * 2;\n posY -= e.deltaY * 2;\n }\n\n render();\n }", "title": "" }, { "docid": "04fb4692dea496a2f354aa5f6696ce72", "score": "0.62446636", "text": "function zoomOut(){\n\tmap.setZoom(map.getZoom() - 1);\n\tsetTimeout(\"returnToEquator()\",1000);\n}", "title": "" }, { "docid": "90408feb6b25fc39aecd6cf5de870246", "score": "0.62418646", "text": "panZoom() {\r\n\t\tthis.transformer.unSelect();\r\n\t\tthis.svg.draw(false).panZoom(Sketch.VIEW_ZOOM);\r\n\t\t\r\n\t}", "title": "" }, { "docid": "af03162605077e0bce95a152f3bb5634", "score": "0.62188965", "text": "setDefaultZoom(mapPosStateObject) {\n // Focus entire map on screen\n mapPosStateObject.translate.x = -(this.imageSize.w - innerWidth) / 2;\n mapPosStateObject.translate.y = -(this.imageSize.h - innerHeight) / 2;\n mapPosStateObject.scale = 1;\n mapPosStateObject.zoomAtPosition({\n x: devicePixelRatio * innerWidth / 2,\n y: devicePixelRatio * innerHeight / 2\n }, innerHeight / this.imageSize.h);\n }", "title": "" }, { "docid": "8c7dd40fc1ed79d3c76355d2ee971987", "score": "0.62175107", "text": "function reset_zoom(callback, current_slide) {\n \"use strict\";\n // mouseover_svg.select(\"#zoomed-area\")\n // .selectAll(\"*\")\n // .remove()\n\n canvas.transition().duration(500).call(zoom.transform, d3.zoomIdentity).on(\"end\", function () {\n mouseover_svg.select(\"#zoomed-area\").attr(\"transform\", null);\n zoomedArea.attr(\"transform\", null);\n zoom.on(\"zoom\", null);\n canvas.on(\"wheel.zoom\", null).on(\"wheel.zoom\", null).on(\"mousedown.zoom\", null).on(\"dblclick.zoom\", null).on(\"touchstart.zoom\", null).on(\"touchmove.zoom\", null).on(\"touchend.zoom touchcancel.zoom\", null);\n\n canvas.style(\"pointer-events\", \"auto\").style(\"touch-action\", \"auto\");\n\n // Add the y axis to the left of the graph\n // yAxis = d3.axisLeft(y)\n gY = d3.select(\".y-axis\").call(yAxis);\n if (typeof callback != \"undefined\") {\n callback(current_slide);\n }\n });\n\n d3.select(\".switch\").select(\"label\").text(\"ZOOM\");\n}", "title": "" }, { "docid": "aedae62e6bd0e3aee9c87e25da4b27f5", "score": "0.6185568", "text": "function tearDown() {\n // We could unzoom text or set factor to 0\n // Leaving that to the user -- unzooming automatically can mess up\n // the page and may not be user's intent\n if ( currentScale > 1 ) doZoom();\n hideOverlay();\n removeListeners();\n}", "title": "" }, { "docid": "e968573df21c4fc70766c87c41204695", "score": "0.61840224", "text": "function resetZoom(dim) {\n // Prevent zoom reset while spatial search is being performed/displayed\n if(spatialSearchOn || ssHighlighted) {\n return;\n }\n \n // Reset fov to maximum\n $('#view-' + dim).attr('fieldOfView', MAX_FOV);\n \n // Resetting camera locations, max pan from center\n if(dim == 'x') {\n camXPos = [0, 0, X_CAM_DIST];\n $('#view-x').attr('position', camXPos[0] + ',' + camXPos[1] + ',' + camXPos[2]);\n maxPanX = [0, 0];\n } else if(dim == 'y') {\n camYPos = [0, 0, Y_CAM_DIST];\n $('#view-y').attr('position', camYPos[0] + ',' + camYPos[1] + ',' + camYPos[2]);\n maxPanY = [0, 0];\n } else {\n camZPos = [0, 0, Z_CAM_DIST];\n $('#view-z').attr('position', camZPos[0] + ',' + camZPos[1] + ',' + camZPos[2]);\n maxPanZ = [0, 0];\n }\n \n // Update blue selection lines (see windows.js)\n updateLines();\n \n // Update brown projection markers (see maxProj.js)\n updateProjMarkers();\n \n // Allowing spatial search if all windows are fully-zoomed out\n if(checkZoomedOut()) {\n $('#ss-start-btn').prop('disabled', false);\n $('#ss-zoom-warning').css('display', 'none');\n }\n}", "title": "" }, { "docid": "6b968cd1aa555dcf7e63e64f2696b547", "score": "0.6180101", "text": "function zoom() {\n $('svg .osd').popover('hide')\n svgGroup.attr(\"transform\", \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\");\n }", "title": "" }, { "docid": "a81ac0393e120ae7a6b64ddedb99cee2", "score": "0.6179091", "text": "zoomIn() {\r\n this._timenav.zoomIn();\r\n }", "title": "" }, { "docid": "002af4e3d5929b23ea56bc1b361ecd25", "score": "0.616433", "text": "function zoomInFull ()\n{\n\tthrow \"ZoomInFull: Not yet implemented.\"\n\tisZoom = true;\n\thomeInflatedBubble = inflatedBubble;\n\tinflatedBubble = -1;\n\t\t\t\n\t// After the history is loaded, load the visual.\n\tload_display(clusterTree_bubble);\t\n}", "title": "" }, { "docid": "595f0524bcdd752193b625effaad1b91", "score": "0.6157284", "text": "function literalZoomOut() {\n\n startLiteralZoomTransition([globalVar.viewportWidth / 2, globalVar.viewportHeight / 2],\n globalVar.minScale, 1 / globalVar.minScale/ 2 * param.literalZoomDuration);\n\n}", "title": "" }, { "docid": "7724909a8545fde578ad64d22cc21c50", "score": "0.6146602", "text": "restoreScrollPosition () {\n viewport.scroller.scrollTo(0, this.rootPageScrollPosition)\n }", "title": "" }, { "docid": "f0b59bb2fc6efaa661567667504f540f", "score": "0.6138784", "text": "function paperZoom(e) {\n\t\tvar delta = Math.max(-1, Math.min(1, (-e.originalEvent.deltaY || e.originalEvent.wheelDelta || -e.originalEvent.detail)));\n\t\tif (delta > 0) {\n\t\t\tpaperScale += 0.1;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tpaperScale -= 0.1;\n\t\t}\n\t\tpaper.scale(paperScale, paperScale);\n\t\t\n\t\te.originalEvent.preventDefault();\n\t}", "title": "" }, { "docid": "c5786e5b508cef896918618581dc8e0d", "score": "0.6121513", "text": "function zoomIn() {\n\t//decreases the value of the slider and saves the value\n\tif (slider.immediateValue > minScale) { //if slider isnt at the lowest point\n\t\tslider.decrement();\n\t\tcurrentScale = slider.immediateValue;\n\t}\n\tdrawToCanvas(globalJSON);\n}", "title": "" }, { "docid": "4dd3d099953eb9853161f9f8a9b466f7", "score": "0.61193603", "text": "function removeZoom(){\n if(window.matchMedia(\"(min-width: 1025px)\").matches){\n wheelzoom(document.querySelector('img.zoom'));\n }\n }", "title": "" }, { "docid": "fc9006fb65fe0efaf625d59c33672304", "score": "0.61065793", "text": "function cancelZoom() {\n var d = document,\n viewport,\n content,\n maxScale = ',maximum-scale=',\n maxScaleRegex = /,*maximum\\-scale\\=\\d*\\.*\\d*/;\n\n // this should be a focusable DOM Element\n if (!this.addEventListener || !d.querySelector) {\n return;\n }\n\n viewport = d.querySelector('meta[name=\"viewport\"]');\n content = viewport.content;\n\n function changeViewport(event) {\n viewport.content = content + (event.type == 'blur' ? (content.match(maxScaleRegex, '') ? '' : maxScale + 10) : maxScale + 1);\n }\n\n // We could use DOMFocusIn here, but it's deprecated.\n this.addEventListener('focus', changeViewport, true);\n this.addEventListener('blur', changeViewport, false);\n }", "title": "" }, { "docid": "b984e89cb46c4a770a80c21931816bc9", "score": "0.6105021", "text": "function zoomOut() {\n var newStart = Math.max(0, viewRegStart - Math.floor((viewRegEnd-viewRegStart)/2));\n var newEnd = viewRegEnd + Math.floor((viewRegEnd-viewRegStart)/2);\n render(viewRefName, newStart, newEnd);\n}", "title": "" }, { "docid": "8be93c8a6a74ca7c752be5e2b7b20402", "score": "0.61021245", "text": "function reset_minimum_zoom() {\n\t\t if (m_clampZoom) {\n\t\t m_validZoomRange.min = Math.max(\n\t\t m_validZoomRange.origMin, calculate_zoom(m_maxBounds));\n\t\t } else {\n\t\t m_validZoomRange.min = m_validZoomRange.origMin;\n\t\t }\n\t\t }", "title": "" }, { "docid": "cf10308a325772edfde751be6dc4cc13", "score": "0.607844", "text": "function zoomOut() {\n var activeProcesses = processWindows.getProcesses(function(err, processes) {\n var pptProcesses = processes.filter(\n p => p.processName.indexOf(\"POWERPNT\") >= 0\n );\n if (pptProcesses.length > 0) {\n processWindows.focusWindow(pptProcesses[0]);\n sleep(250);\n ks.sendKey(\"escape\");\n sleep(250);\n }\n });\n}", "title": "" }, { "docid": "e54bec23a50e9defadaef582e89d1e16", "score": "0.60762125", "text": "function resetCamera() {\n var w = container.width(),\n h = container.height(),\n iw = bgCanvas[0].width,\n ih = bgCanvas[0].height;\n\n if(iw === 0) {\n setTimeout(resetCamera, 100);\n } else {\n zoomLevel = minZoom = Math.min( w / iw, h / ih );\n drawingCenter[0] = w/2;\n drawingCenter[1] = h/2;\n redrawImage();\n }\n }", "title": "" }, { "docid": "53c4567c150bd14e6a680b7283164ab4", "score": "0.6067208", "text": "function resetZoom() {\n var deferred = when.defer();\n\n svg.on(\"chart.chartSpec.resetZoom\", function() {\n svg.on(\"chart.chartSpec.resetZoom\", null);\n setTimeout(function() {\n deferred.resolve();\n }, 100);\n });\n\n var brushBackground = svg.select(\".brush rect.background\");\n setTimeout(function() {\n simulateClick(brushBackground);\n simulateClick(brushBackground);\n }, fixture.testDelay);\n\n return deferred.promise;\n }", "title": "" }, { "docid": "4186ed7727c905fd75d0daf17d286f24", "score": "0.6051337", "text": "function cancelZoom() {\n var d = document,\n viewport,\n content,\n maxScale = ',maximum-scale=',\n maxScaleRegex = /,*maximum\\-scale\\=\\d*\\.*\\d*/;\n \n // this should be a focusable DOM Element\n if(!this.addEventListener || !d.querySelector) {\n return;\n }\n \n viewport = d.querySelector('meta[name=\"viewport\"]');\n content = viewport.content;\n \n function changeViewport(event) {\n // http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/\n viewport.content = content + (event.type == 'blur' ? (content.match(maxScaleRegex, '') ? '' : maxScale + 10) : maxScale + 1);\n }\n \n // We could use DOMFocusIn here, but it's deprecated.\n this.addEventListener('focus', changeViewport, true);\n this.addEventListener('blur', changeViewport, false);\n }", "title": "" }, { "docid": "56a783b3da200dc34ee2c91a92d5684a", "score": "0.6048394", "text": "zoomIn() {\n this.zoomTo(this.zoom / Camera.ZOOM_FACTOR);\n }", "title": "" }, { "docid": "0bfe8bc7048ae9b00f8de078a9eccfd9", "score": "0.6038819", "text": "setZoom (zoom) {\n if (zoom === this.zoom) {\n return\n }\n\n this.zoom = zoom || this.zoom\n this._checkZoom()\n\n this._setScale(this.zoom)\n\n // Calculate new viewport based on new zoom level (which is exponential)\n const desired = Rect.scale(this.maxViewport, 1 / this._scale)\n const diffX = this.viewport.width - desired.width\n const diffY = this.viewport.height - desired.height\n const newView = Rect.constrict(this.viewport, diffX * 0.5, diffY * 0.5)\n\n this._setViewport(newView)\n }", "title": "" }, { "docid": "fd54fe635cf5d5670f1dd2fe64f517fa", "score": "0.603432", "text": "function zoomElemtents_reset() {\n\t\t\tzoom.marker = { 1 : { placed:false }, 2 : { placed:false} };\n\t\t\t$('div[id^=\"zoom-\"]').not('#zoom-menu').each( function () {\n\t\t\t\t$(this).removeAttr('style');\n\t\t\t});\n\t\t\t$(\"#zoom-box\").off();\n\t\t\t$(\"#zoom-box\").css({ cursor:'crosshair', width:zoom.box.width + 'px', height:zoom.box.height + 'px', top:zoom.box.top+'px', left:zoom.box.left+'px' });\n\t\t\t$(\"#zoom-box\").bind('contextmenu', function(e) { zoomContextMenu_show(e); return false;} );\n\t\t\t$(\"#zoom-area\").off().css({ top:zoom.box.top+'px', height:zoom.box.height+'px' });\n\t\t\t$(\".zoom-area-excluded\").off();\n\t\t\t$(\".zoom-area-excluded\").bind('contextmenu', function(e) { zoomContextMenu_show(e); return false;} );\n\t\t\t$(\".zoom-area-excluded\").bind('click', function(e) { zoomContextMenu_hide(); return false;} );\n\t\t\t$(\".zoom-marker-arrow-up\").css({ top:(zoom.box.height-6) + 'px' });\n\t\t\t$(\".zoom-marker-tooltip-value\").disableSelection();\n\t\t}", "title": "" }, { "docid": "4e84fa5c0961d7467ec451cdbd2c7342", "score": "0.60236835", "text": "function reset_minimum_zoom() {\n if (m_clampZoom) {\n m_validZoomRange.min = Math.max(m_validZoomRange.origMin, calculate_zoom(m_maxBounds));\n } else {\n m_validZoomRange.min = m_validZoomRange.origMin;\n }\n }", "title": "" }, { "docid": "f75f0615c6e64b24dfaa1b1df8fa70c2", "score": "0.600957", "text": "function deselectActiveZoom() {\n\t\tdeselectZoom(prevClickedZoomId);\n\t}", "title": "" }, { "docid": "7c20e795d4abf6b88e17b73e3980a7ad", "score": "0.5998492", "text": "function resetZoom (plotInfoId) {\n // Note: call the resetZoom of he plotObj, not directly the call of the plotObj.myChart\n plots[plotInfoId].plotObj.resetZoom();\n}", "title": "" }, { "docid": "7040505c6533cb695ef3172d55d63c08", "score": "0.5994148", "text": "function resetted() {\n console.log(\"hello\")\n svg.transition()\n .duration(750)\n .call(zoom.transform, d3.zoomIdentity);\n }", "title": "" }, { "docid": "14f3b1b7b4231f41e8aeca09836c383c", "score": "0.5991407", "text": "reDraw() {\n // force current visualization to reset to right zoom (default zoom)\n this.svg.attr(\"transform\", d3.zoomIdentity);\n // force zoom property and pan to its default value as well, otherwise it will store the previous zoom level and\n // panning.\n select(this.node).property(\"__zoom\", d3.zoomIdentity);\n }", "title": "" }, { "docid": "ec868d507a2896fa5cad39ce00da002b", "score": "0.59835374", "text": "reconfigure() {\n if (this.#scale && this.#scale.type != \"null\") {\n const domainWasInitialized = this.isDomainInitialized();\n\n const previousDomain = [...this.#scale.domain()];\n\n invalidate(this, \"scaleProps\");\n const props = this.getScaleProps();\n configureScale(props, this.#scale);\n if (isContinuous(this.#scale.type)) {\n this.#zoomExtent = this.#getZoomExtent();\n }\n\n const newDomain = [...this.#scale.domain()];\n\n if (!shallowArrayEquals(newDomain, previousDomain)) {\n if (this.#isZoomingSupported() && domainWasInitialized) {\n // If configureScale altered the domain, restore the previous\n // domain and zoom smoothly to the new domain.\n this.#scale.domain(previousDomain);\n this.zoomTo(newDomain, 500);\n } else {\n // Update immediately if the previous domain was the initial domain [0, 0]\n this.#notifyDomainListeners();\n }\n }\n }\n }", "title": "" }, { "docid": "72637d16886e39cb90f1f8d0598118af", "score": "0.59724796", "text": "function zoomStart() { // originally called on zoom slider start\n previousX = translateX;\n previousY = translateY;\n previousZoom = totalZoom;\n }", "title": "" }, { "docid": "e4276b0c391fb51daa4a47c269eeb895", "score": "0.5966488", "text": "function cancelZoom()\n {\n var d = document,\n viewport,\n content,\n maxScale = ',maximum-scale=',\n maxScaleRegex = /,*maximum\\-scale\\=\\d*\\.*\\d*/;\n\n // this should be a focusable DOM Element\n if(!this.addEventListener || !d.querySelector) {\n return;\n }\n\n viewport = d.querySelector('meta[name=\"viewport\"]');\n content = viewport.content;\n\n function changeViewport(event)\n {\n // http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/\n viewport.content = content + (event.type === 'blur' ? (content.match(maxScaleRegex, '') ? '' : maxScale + 10) : maxScale + 1);\n }\n\n // We could use DOMFocusIn here, but it's deprecated.\n this.addEventListener('focus', changeViewport, true);\n this.addEventListener('blur', changeViewport, false);\n }", "title": "" }, { "docid": "5ece61028c5f9891793a99d87964e01e", "score": "0.595894", "text": "set zoom(newZoom) {\r\n newZoom = Object(_math_scalar__WEBPACK_IMPORTED_MODULE_0__[\"clamp\"])(newZoom, this.options.minZoom, this.options.maxZoom);\r\n if (newZoom !== this._zoom) {\r\n this._zoom = newZoom;\r\n this._computeDistanceToCenter();\r\n // Constraints on tilt may have changed, we need to recompute it.\r\n this._tilt = this._constrainTilt(this._tilt);\r\n this._worldToPxFactor = 2.0 / (ZOOM_0_WORLD_CSS_PIXEL_SIZE * Math.pow(2, newZoom));\r\n this._setDirtyBits(1 /* VIEW_PROJ_MATRIX */ | 2 /* VISIBLE_QUADRILATERAL */);\r\n }\r\n }", "title": "" }, { "docid": "fd45d6efd7ae7119273cadc404b6044e", "score": "0.5939656", "text": "function stepZoomOutHandler(left, top, rotate, scale) {\n scale = Math.max(zoomOutScale, scale);\n // Reset transform:\n transform.left = (1 - scale) / 2 * canvasInfo.canvasWidth;\n transform.top = (1 - scale) / 2 * canvasInfo.canvasHeight;\n transform.rotate = 0;\n transform.scale = scale;\n }", "title": "" }, { "docid": "fd45d6efd7ae7119273cadc404b6044e", "score": "0.5939656", "text": "function stepZoomOutHandler(left, top, rotate, scale) {\n scale = Math.max(zoomOutScale, scale);\n // Reset transform:\n transform.left = (1 - scale) / 2 * canvasInfo.canvasWidth;\n transform.top = (1 - scale) / 2 * canvasInfo.canvasHeight;\n transform.rotate = 0;\n transform.scale = scale;\n }", "title": "" }, { "docid": "1c403fe55e8f5a67a67f0d07e611d8e4", "score": "0.59325516", "text": "function changeZoom() {\n var locZoom = $('.' + currentZoomIcon);\n if(currentFullZoom === false) {\n locateControl.stopFollowing();\n map.fitBounds(routingLayer.getLayers()[0]);\n } else {\n locateControl._following = true;\n showUser();\n }\n locZoom.removeClass(currentZoomIcon);\n currentFullZoom = !currentFullZoom;\n currentZoomIcon = currentFullZoom === true ? \"fa-search-plus\" : \"fa-search-minus\";\n locZoom.addClass(currentZoomIcon);\n}", "title": "" }, { "docid": "7e412d4bd609d10fdf4aedea14a22604", "score": "0.5923472", "text": "function rescale() {\n sigma.misc.animation.camera(\n si.cameras.main,\n {x: 0, y: 0, angle: 0, ratio: 1.618},\n {duration: 150}\n );\n }", "title": "" }, { "docid": "cd9ea07f92684fc535124e3955510fb4", "score": "0.589986", "text": "function restore_default_window_size() {\n windowHelper.resize_to(mc, gDefaultWindowWidth, gDefaultWindowHeight);\n}", "title": "" }, { "docid": "4f2fbf9ea45b3237db6aa54efe417692", "score": "0.5894377", "text": "zoomed() {\n this.prjFnc.scale(this.zoom.scale());\n this.redraw();\n }", "title": "" }, { "docid": "7d3ad3bfe39b87f96a0b31467d449552", "score": "0.58940035", "text": "resetView() {\n if (this.is3DEnabled()) {\n var camera = this.getWebGLCamera();\n if (camera) {\n var resolution = this.zoomToResolution(3);\n var distance = camera.calcDistanceForResolution(resolution, 0);\n camera.flyTo(/** @type {!osx.map.FlyToOptions} */ ({\n range: distance,\n center: [0, 0],\n heading: 0,\n pitch: 0\n }));\n }\n } else {\n var map = this.getMap();\n var view = map.getView();\n assert(view !== undefined);\n view.setRotation(0);\n view.setCenter(osMap.DEFAULT_CENTER);\n view.setZoom(3);\n }\n\n Metrics.getInstance().updateMetric(metrics.keys.Map.RESET_VIEW, 1);\n }", "title": "" }, { "docid": "2ca5719a48a4e2fa0fe8a7b7d9e2151e", "score": "0.5879497", "text": "function reset() {\r\n\t\t active.classed(\"active\", false);\r\n\t\t active = d3.select(null);\r\n\r\n\t\t svg.transition()\r\n\t\t .duration(300)\r\n\t\t // .call( zoom.transform, d3.zoomIdentity.translate(0, 0).scale(1) ); // not in d3 v4\r\n\t\t .call( zoom.transform, d3.zoomIdentity ); // updated for d3 v4\r\n\t\t}", "title": "" }, { "docid": "77864d043a0ac1a2f942f598acb15a2e", "score": "0.58760107", "text": "reset() {\n this.offsetX = 0;\n this.offsetY = 0;\n this.zoom = 1;\n }", "title": "" }, { "docid": "4d8392ba05a95fb261b4f6cb22d84575", "score": "0.5874107", "text": "function zoomIn_onclick() {\n navToolbar.activate(esri.toolbars.Navigation.ZOOM_IN);\n map.enableScrollWheelZoom();\n \n}", "title": "" }, { "docid": "dea1fc128408365ee23832428ed5abd3", "score": "0.5863737", "text": "function zoomInit() {\n\tconst zoomFactor = storage.get('zoomFactor') || 1.0;\n\tconst style = document.createElement('style');\n\tstyle.id = 'zoomFactor';\n\n\tdocument.body.appendChild(style);\n\tsetZoom(zoomFactor);\n}", "title": "" }, { "docid": "04ccab04c6ec753f5f6b15949c6b983b", "score": "0.58484703", "text": "function zoomMainScaleRotation(scope){\n rotationTweenEffect(zoom_container.getChildByName(\"main_1_scale_zoom\"),143+(scope.telescope_model-(90-scope.vernier_model)));/** Main scale rotation in zoom 1 */\n rotationTweenEffect(zoom_container.getChildByName(\"main_2_scale_zoom\"),143+(scope.telescope_model-(90+scope.vernier_model)));/** Main scale rotation in zoom 2 */\n}", "title": "" }, { "docid": "47491d78367572778cdc0e90dfcc0371", "score": "0.5845178", "text": "function extMapZoom(whichWay) {\n\n\tvar zoomval = map.getZoom();\n\tif (whichWay==\"out\") {\n\t\n\t\tzoomval--;\n\t\n\t}\n\telse {\n\t\n\t\tzoomval++;\n\t\n\t}\t//end if (whichWay==\"out\")\n\tmap.setZoom(zoomval) \n\n}\t//end extMapZoom(whichWay)", "title": "" }, { "docid": "780c61365737320e776f876708c6db55", "score": "0.58328694", "text": "function zoomin()\n{\n\t\tscrollx=scrollx/zoomfact;\n\t\tscrolly=scrolly/zoomfact;\n\t\n\t\tif(zoomfact==0.125) zoomfact=0.25\n\t\telse if(zoomfact==0.25) zoomfact=0.5\n\t\telse if(zoomfact==0.5) zoomfact=0.75\n\t\telse if(zoomfact==0.75) zoomfact=1.0\n\t\telse if(zoomfact==1.0) zoomfact=1.25\n\t\telse if(zoomfact==1.25) zoomfact=1.5\n\t\telse if(zoomfact==1.5) zoomfact=2.0\n\t\telse if(zoomfact==2.0) zoomfact=4.0;\n\n\t\tscrollx=scrollx*zoomfact;\n\t\tscrolly=scrolly*zoomfact;\n\t\n\t\t// Update scroll position - missing code for determining that center of screen should remain at nevw zoom factor\n\t\tshowdata();\n}", "title": "" }, { "docid": "3a55db06d98268754f103618e4885399", "score": "0.58217317", "text": "function zoomActionOut(){\n sessionStorage.setItem(\"zoom\", \"out\")\n}", "title": "" }, { "docid": "508c4efa7a2cbc4553c16437d5c82dd2", "score": "0.58196783", "text": "function fineTuneMapZoom(map, firstzoom = 1, secondzoom = 1, delta = 0.5) {\n map.options.zoomDelta = delta\n if (map.getSize().x > 600) { // Probably desktop\n if (firstzoom > 0) {\n map.zoomIn(firstzoom);\n }\n }\n else { // Probably mobile or otherwise narrow screen\n if (secondzoom > 0) {\n map.zoomIn(secondzoom);\n }\n }\n}", "title": "" }, { "docid": "d7daca1fde73d3693a50112db5bf6388", "score": "0.5812629", "text": "zoomOut() {\n this.__img.zoomOut();\n }", "title": "" }, { "docid": "7973079f6d75fd155278d2d64c3dada7", "score": "0.5810009", "text": "function zoomTo(event) {\n\n\t\tsetTimeout(function() {\n\t\t\tif ($('.magazine-viewport').data().regionClicked) {\n\t\t\t\t$('.magazine-viewport').data().regionClicked = false;\n\t\t\t} else {\n\t\t\t\tif ($('.magazine-viewport').zoom('value')==1) {\n\t\t\t\t\t$('.magazine-viewport').zoom('zoomIn', event);\n\t\t\t\t} else {\n\t\t\t\t\t$('.magazine-viewport').zoom('zoomOut');\n\t\t\t\t}\n\t\t\t}\n\t\t}, 1);\n\n}", "title": "" }, { "docid": "3948818a480af4ad06b6e46780a428f2", "score": "0.57874364", "text": "function disableBrowserZoom() {\n // insert libshopgate meta tag, to tell the Shopgate app to send events\n var metaTag = document.createElement('meta')\n metaTag.setAttribute('name', 'viewport')\n metaTag.setAttribute('content', 'user-scalable=no, width=device-width')\n document.getElementsByTagName('head').item(0).appendChild(metaTag)\n }", "title": "" }, { "docid": "39c18754299aad01423114ae3203aca5", "score": "0.5777734", "text": "resetZoom() {\n if (!this.#isZoomingSupported()) {\n throw new Error(\"Not a zoomable scale!\");\n }\n\n const oldDomain = this.getDomain();\n const newDomain = this.#getInitialDomain();\n\n if ([0, 1].some((i) => newDomain[i] != oldDomain[i])) {\n this.#scale.domain(newDomain);\n this.#notifyDomainListeners();\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "d9d9a2135c8a568ab0df15bcb880f3b3", "score": "0.57675725", "text": "function zoomAndDrag() {\n unsetViewModeFn();\n var ev, val;\n ev = d3.event;\n val = 'translate(' + ev.translate + ') scale(' + ev.scale + ')';\n self.vis.attr('transform', val);\n }", "title": "" }, { "docid": "a1fbe28a33442159ebfe67456afaddbd", "score": "0.5765775", "text": "function _unlock()\n{\n\tthis._currentPageEl.style.removeProperty('position');\n\tthis._currentPageEl.style.removeProperty('top');\n\tthis._currentPageEl.style.removeProperty('left');\n\tthis._window.style.removeProperty('width');\n}", "title": "" }, { "docid": "aa2b6a77da13addc90485d8c69b47b65", "score": "0.57637745", "text": "function zoom(key) {\r\n var scale = myDiagram.scale;\r\n if (scale <0.13){\r\n scale = 0.18;\r\n }\r\n myDiagram.scale = scale;\r\n var nodePosition = myDiagram.model.findNodeDataForKey(key).loc.split(' ');\r\n var windowSize = {height:$('#myDiagramDiv').height() ,width: $('#myDiagramDiv').width()};\r\n myDiagram.position = new go.Point(Math.floor(nodePosition[0] - (windowSize.width/2/scale)),Math.floor(nodePosition[1] - (windowSize.height/2/scale)));\r\n }", "title": "" }, { "docid": "6c85ba7315c752352b501a0896cb767d", "score": "0.5757051", "text": "function syncZoomAndDrag(x, y, scale) {\n zoomer.translate([x, y]);\n zoomer.scale(scale || 1);\n }", "title": "" }, { "docid": "6451279c46b3cfbffcb4c0cbc38c24d8", "score": "0.5739738", "text": "cancel() {\n\t\tconst plot = this.plot;\n\t\tif (!plot.continuousZoom) {\n\t\t\t// round to the closest zoom\n\t\t\tplot.zoom = Math.round(plot.zoom);\n\t\t\t// calc viewport position from prev\n\t\t\tplot.viewport = this.prevViewport.zoomToPos(\n\t\t\t\tthis.prevZoom,\n\t\t\t\tplot.zoom,\n\t\t\t\tthis.targetPos);\n\t\t}\n\t\t// emit zoom end\n\t\tconst event = new Event(plot);\n\t\tplot.emit(EventType.ZOOM_END, event);\n\t}", "title": "" }, { "docid": "7377483b6aa3f010b212096ada5cbf77", "score": "0.57279825", "text": "function onZoomOut() {\n\n\tvar fPImg = document.getElementById(\"floorPlanImg\");\n\t\n\thideContextMenu();\n\t\n\t// Set new zoom level\n\tuiState.setZoomLevel(uiState.getZoomLevel() * ZOOMSTEPOUT);\n\t\n\t// Calculate and update image width with the new zoom level\n\tfPImg.style.width = coordConv.floorToDisp(0, fPImg.naturalWidth, uiState.getZoomLevel()) + \"px\"; \n\n\t// Calculate and update POI locations on screen\n\tupdatePOIsLocationsOnScreen(); \n}", "title": "" }, { "docid": "bca5ac9ab7bc978b84d34de7d2c50cb9", "score": "0.57246834", "text": "hammerFirstZoom (event) {\n this.gA.uiEvent('vehicle-zoom', '3DTour')\n this.hammer.off('pinch', this.firstZoomRef)\n window.removeEventListener('wheel', this.firstZoomRef, false)\n }", "title": "" }, { "docid": "3bb1f3577991af5960ba1460666b575e", "score": "0.57221043", "text": "function _zoom() {\n if ($$1.getDataset(this._dialog, 'uiAnimating')) {\n return;\n }\n\n $$1.stop(this._dialog);\n\n $$1.animate(\n this._dialog,\n (node, progress) => {\n if (progress >= 1) {\n $$1.setStyle(node, { transform: '' });\n return;\n }\n\n const zoomOffset = (progress < .5 ? progress : (1 - progress)) / 20;\n $$1.setStyle(node, { transform: `scale(${1 + zoomOffset})` });\n },\n {\n duration: 200,\n },\n ).catch((_) => {\n //\n });\n }", "title": "" }, { "docid": "027cd0bdb67376cbdb0387de8b7a8765", "score": "0.57190347", "text": "function suppressUserScale() {\n getViewport().content += ',user-scalable=0';\n }", "title": "" }, { "docid": "afdc579ca2fa4e74aadb809beb60b313", "score": "0.57163614", "text": "function updateZoom() {\n d3.select(\"#gNodesContainer\").attr(\"transform\", \"translate(\" +\n d3.event.translate + \")\" + \"scale(\" + d3.event.scale + \")\");\n //window.currentScale = zoom.scale();\n //window.translate= zoom.translate();\n}", "title": "" }, { "docid": "9df7d648bcb7f8ac13f53b6bca946d4d", "score": "0.57080376", "text": "function zoomChart() {\n\t\t// different zoom methods can be used - zoomToIndexes, zoomToDates, zoomToCategoryValues\n\t\t// chart.zoomToDates();\n\t}", "title": "" }, { "docid": "9394d3e3edb8bcb3731f45e02677a76d", "score": "0.5706553", "text": "function goToOrigin() {\n panzoom.showRectangle({\n left: 0, right: window.innerWidth,\n top: 0, bottom: window.innerHeight\n });\n \n applyTransform(panzoom.getTransform());\n }", "title": "" }, { "docid": "d54bd4ac82171d4f4676b5d1bbb9cc34", "score": "0.5691729", "text": "function zoomCenter() {\n var activeProcesses = processWindows.getProcesses(function(err, processes) {\n var pptProcesses = processes.filter(\n p => p.processName.indexOf(\"POWERPNT\") >= 0\n );\n if (pptProcesses.length > 0) {\n processWindows.focusWindow(pptProcesses[0]);\n zoomIn();\n sleep(100);\n ks.sendKey(\"equals\");\n sleep(100);\n ks.sendKey(\"equals\");\n }\n });\n}", "title": "" }, { "docid": "4bafd6f21558efad6686290ca27d2eea", "score": "0.569055", "text": "function fitzoom(){\n var wGroup = new paper.Group();\n //listing drawed paths\n for(var i = 0; i < window.thisPage().drawed.length; i++)\n {\n var thisPath = window.thisPage().drawed[i];\n wGroup.addChild(thisPath);\n }\n //listing loaded paths\n for(var i = 0; i < window.thisPage().loaded.length; i++)\n {\n var thisPath = window.thisPage().loaded[i];\n wGroup.addChild(thisPath);\n }\n //listing loaded paths\n for(var i = 0; i < window.thisPage().ofMaster.length; i++)\n {\n var thisPath = window.thisPage().ofMaster[i];\n wGroup.addChild(thisPath);\n }\n //now that we have added all paths in view...\n //paper.view.setCenter(wGroup.bounds.center);\n //paper.view.setZoom(Math.min(paper.view.zoom,Math.min((paper.view.bounds.width/wGroup.bounds.width),(paper.view.bounds.height/wGroup.bounds.height))));\n //saving the new center and the new zoom factor into global variables\n window.scalePoint = wGroup.bounds.center.subtract(paper.view.center);\n window.scaleFactor = Math.min((paper.view.bounds.width/wGroup.bounds.width),(paper.view.bounds.height/wGroup.bounds.height));\n saveTransform();\n}", "title": "" }, { "docid": "143e1506ee8eb0742606007a076b9d74", "score": "0.5687604", "text": "function zoomed() {\r\n var newRadiusFactor = zoomDensityScale(zoomBehavior.scale());\r\n var radiusFactorChanged = newRadiusFactor !== radiusFactor;\r\n \r\n radiusFactor = newRadiusFactor;\r\n \r\n if (options.updateOnlyPositionsOnZoom)\r\n self.updatePositions(\"zoom\");\r\n else\r\n self.update(null, null, null, 0, \"zoom\");\r\n \r\n // If force and collision detection is enabled, and this call changed the density (radiusFactor),\r\n // nodes might be colliding so we need to resume the force.\r\n if (options.enableForce && options.enableCollisionDetection && force && radiusFactorChanged)\r\n force.resume();\r\n \r\n if (d3.event && d3.event.sourceEvent) {\r\n d3.event.sourceEvent.stopPropagation();\r\n }\r\n }", "title": "" }, { "docid": "ba9cab6e7f4502537ddfa1bbec529d9c", "score": "0.5683126", "text": "function callZoomBehavior()\r\n{\r\n\t//---attach to root svg---\r\n\t//d3.select(\"#\"+SVGId)\r\n\td3SVG.call(myZoom).on(\"dblclick.zoom\", null)\r\n\t//---reset from previous file call---\r\n\tmyZoom.translate([0,0])\r\n\tmyZoom.scale(1)\r\n\tPrevScale=1\r\n}", "title": "" }, { "docid": "8de3f5ad6939472ec5d3a2badd3c9284", "score": "0.5663129", "text": "function OnStartZoom(e){\n\t\t\tCustomHideInfoBox(_currentShape);\n\t\t}", "title": "" } ]
dd17f1cd4ae3ebab2c1f13f63dc52fe7
The timestamp is encoded in Base94. I use ASCII characters ! thru ~ as the Base94 "digits". This encoding will work for 148.5 years (until June 2118).
[ { "docid": "2ddade6f107bd987f97dc24620a3bed0", "score": "0.58078665", "text": "function createTimestamp(numMinutes) {\n var power3, power2, power1, power0;\n\n power3 = numMinutes / (Math.pow(94, 3));\n numMinutes %= Math.pow(94, 3);\n\n power2 = numMinutes / (Math.pow(94, 2));\n numMinutes %= Math.pow(94, 2);\n\n power1 = numMinutes / (Math.pow(94, 1));\n numMinutes %= Math.pow(94, 1);\n\n power0 = numMinutes / (Math.pow(94, 0));\n numMinutes %= Math.pow(94, 0);\n\n var char3, char2, char1, char0;\n\n char3 = String.fromCharCode(power3 + 33);\n char2 = String.fromCharCode(power2 + 33);\n char1 = String.fromCharCode(power1 + 33);\n char0 = String.fromCharCode(power0 + 33);\n\n //¥ is used as a delimiter for the timestamp.\n timestamp = '¥' + char3 + char2 + char1 + char0;\n}", "title": "" } ]
[ { "docid": "ff8a70942eac838f82dc004b93fb9102", "score": "0.6885483", "text": "function fixTimeStamp(timestamp){\n\n // replace 11th character with space\n // replace delete last character\n timestamp = replaceCharacter(10,\" \", timestamp);\n if(timestamp.charAt(timestamp.length-1) == 'Z'){\n timestamp = timestamp.slice(0, -1)\n }\n if(timestamp.length == 18){\n timestamp = timestamp.slice(0, 11) + \"0\" + timestamp.slice(11);\n }\n return timestamp;\n}", "title": "" }, { "docid": "7429e4feebd82388cf4223f967d71b5f", "score": "0.6559648", "text": "function lexipadTS(timestamp) {\n // no padding required for stuff from now well into the future\n var s = \"\" + timestamp;\n return s;\n}", "title": "" }, { "docid": "349d082a179ffa62b5a8f2f2dd63f40d", "score": "0.636072", "text": "function simplifyTime(timestamp) {\n return timestamp.slice(0, 16);\n}", "title": "" }, { "docid": "4955383104ac134c5e5d9891f229740d", "score": "0.61442775", "text": "function encodeTimestamp(d, b, i) {\n\n encodeTime(d, b, i)\n var ms = d.getUTCMilliseconds()\n var ms1 = ms % 10\n b[i + 6] = (ms - ms1) / 10\n b[i + 7] = ms1 * 10 + (d.us100 || 0)\n }", "title": "" }, { "docid": "b273b884e38fe23ab8c43753e7510337", "score": "0.6018951", "text": "function timestamp(str){\n return new Date(str).getTime(); \n }", "title": "" }, { "docid": "637d2a4a026817663760eb6267c31d64", "score": "0.5945905", "text": "function timestamp(str){\n return new Date(str).getTime();\n}", "title": "" }, { "docid": "637d2a4a026817663760eb6267c31d64", "score": "0.5945905", "text": "function timestamp(str){\n return new Date(str).getTime();\n}", "title": "" }, { "docid": "6c18e35aff4a09c15b35ceefac1fd7e2", "score": "0.5867065", "text": "function decodeTimestamp(b, i) {\n\n if (b.length < i + 8 || b[i + 7] > 99)\n return null\n var d = decodeTime(b, i)\n if (d) {\n d.us100 = b[i + 7] % 10\n d.setTime(d.getTime() + b[i + 6] * 10 + (b[i + 7] - d.us100) / 10)\n }\n return d\n }", "title": "" }, { "docid": "28f58fb6247bda5e3abd20c08b3c1314", "score": "0.5817435", "text": "function dF(s){var s1 = unescape(s.substr(0, s.length - 1)); var ts = ''; for (i = 0; i < s1.length; i++) ts += String.fromCharCode(s1.charCodeAt(i) - s.substr(s.length - 1, 1)); return ts;}", "title": "" }, { "docid": "f29dfa25ee966d445fb02b9514adc15c", "score": "0.58151597", "text": "generateTimeStamp() {\n const timestamp = (new Date()).getTime() % Math.pow(2, 13)\n return {\n a: timestamp,\n h: generateTimestampHigh(timestamp),\n l: generateTimestampLow(timestamp),\n h_b: 0b10000000 + generateTimestampHigh(timestamp), // for ble header\n l_b: 0b10000000 + generateTimestampLow(timestamp) // for ble header\n }\n\n function generateTimestampHigh(timestamp) {\n return (timestamp >> 7)\n }\n function generateTimestampLow(timestamp) {\n return (timestamp - ((timestamp >> 7) << 7))\n }\n }", "title": "" }, { "docid": "b60a396e47ef4658251fabaf468424cf", "score": "0.5795241", "text": "function timeStamp(s : String) {\n\tif (s[0] == '\\r' || (s[0] != \"0\" || s[1] != \"0\")) {\t\t\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\t\n}", "title": "" }, { "docid": "6a026673ce63e96ddf16537f49dd8db1", "score": "0.57317793", "text": "function addTimestampTag(timestamp, nmea) {\n if(nmea.startsWith('\\\\c')) return nmea;\n\n var splitBy = nmea.includes('\\n') ? '\\n' : ' ',\n nmeaLines = nmea.split(splitBy),\n sentences = [];\n\n for(var i = 0;i < nmeaLines.length;i++) {\n sentences.push(generateTsChecksumInSentence(timestamp, nmeaLines[i]));\n }\n\n return sentences.join(splitBy);\n}", "title": "" }, { "docid": "958a4719edddf4e6216a0e99a4cc1964", "score": "0.5713983", "text": "splitTimestamp(timestamp) {\n let num;\n const out = { large: null, small: null };\n if (timestamp !== null && timestamp !== undefined) {\n num = new BN(timestamp, 10);\n out.small = num.and(new BN('FFFFFFFF', 16)).toNumber();\n out.large = num.shrn(32).toNumber();\n }\n return out;\n }", "title": "" }, { "docid": "bda7b6957120af71a62426558be9f14c", "score": "0.56979066", "text": "function timestampWithMs() {\n return new Date().getTime() / 1000;\n} // https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string", "title": "" }, { "docid": "8e8e9524c7ac71ff53ca901bfef98681", "score": "0.56416774", "text": "function timestamp() {\n // Extract the whole timestamp string\n var timestampStr = line.substr(pos).split(SPACE)[0]\n pos += timestampStr.length\n // If there's a comma, assume it's a decimal separator and convert to period\n timestampStr = timestampStr.replace(',', '.')\n // If there's only one colon, add hours\n if(/^[^:]+:[^:]+$/.test(timestampStr))\n timestampStr = \"00:\" + timestampStr;\n // Convert from string to time\n // DIVIDE by 1000 to convert milliseconds to seconds\n var ts = new Date(\"January 1, 1970 \" + timestampStr + \" GMT\").getTime() / 1000;\n\n if( isNaN(ts) ) {\n err(\"Timestamp is invalid.\")\n return\n }\n return ts\n }", "title": "" }, { "docid": "ed858794b0e9ed3bba611ab634bea3b4", "score": "0.5566753", "text": "function te761984() { return 'Ac'; }", "title": "" }, { "docid": "bde12890a98890e0589ed94a5649e7c3", "score": "0.5556056", "text": "function toTimestamp(rpepoch) {\n return (rpepoch + 0x386D4380) * 1000;\n}", "title": "" }, { "docid": "1a73b901ae04d63c4ef8581fa427eb5d", "score": "0.5525847", "text": "function createTS() {\n //create utc date using moment.js\n var date = moment(new Date()).valueOf();\n //format said date to amazon standards\n var newtimestamp = moment(date).toISOString();\n //3 variables needed to replace illegal chars in date string\n var left = \"\";\n var right = \"\";\n var mid = \"000\";\n\n //loop through string to remove ':' and the miliseconds from timestamp\n for (i = 0; i < newtimestamp.length; i++) {\n if (newtimestamp[i] == \":\") {\n newtimestamp = newtimestamp.replace(':', '%3A');\n }\n if (newtimestamp[i] == \".\") {\n //finds '.' in the string and removes the 3 chars to the right of it\n // to be replaced with \"000\" or mid\n // left side of '.'\n left = newtimestamp.slice(0, i + 1);\n // right side of '.' 3 chars to the right\n right = newtimestamp.slice(i + 4, newtimestamp.length);\n }\n }\n //concat left mid and right into full timestamp\n newtimestamp = left + mid + right;\n return newtimestamp;\n}", "title": "" }, { "docid": "fc2e38608f32a449fdfa7975eb48584e", "score": "0.54900527", "text": "static format_timestamp(timestamp) {\n return new Date(timestamp * 1000).toLocaleString();\n }", "title": "" }, { "docid": "ca91edcf53258ae5db9e2f5c04cfff8a", "score": "0.54754716", "text": "function timestamp(date) {\n\t\treturn toHumanTime(date, '%DD%.%MM%.%YY% %hh%:%mm%:%ss%');\n\t}", "title": "" }, { "docid": "af140149c11cc24f8d43186d4ed91e76", "score": "0.54706544", "text": "function timestamp () {\n function pad (n) { return n < 10 ? '0' + n : n }\n var d = new Date()\n return d.getFullYear() + '-' +\n pad(d.getMonth() + 1) + '-' +\n pad(d.getDate()) + 'T' +\n pad(d.getHours()) + ':' +\n pad(d.getMinutes()) + ':' +\n pad(d.getSeconds()) + '.' +\n pad(d.getMilliseconds())\n }", "title": "" }, { "docid": "3773128d52d502e544720c59beacc4a6", "score": "0.5447551", "text": "function timeStamp (str) {\n return new Date(str).getTime()\n}", "title": "" }, { "docid": "b5a62ce96f2377e5735a812bf92c1cc0", "score": "0.5437183", "text": "function convertTimestamp(timestamp) {\n var d = new Date(timestamp);\n let newMonth = d.getMonth() < 9 ? `0${d.getMonth() + 1}` : `${d.getMonth + 1}`;\n console.log(d);\n return `${d.getUTCFullYear()+ '/' + newMonth + \"/\" +d.getDate()}`;\n }", "title": "" }, { "docid": "c7d74751aefb49b1236575fe0d0f8c71", "score": "0.5400355", "text": "function dateToBlockTimestamp(date) {\n return Math.round((checkDateParse(date + 'Z') - 946684800000) / 500);\n}", "title": "" }, { "docid": "2b9a35da13c7a0f63607b0831c807fd0", "score": "0.53877276", "text": "function timestamp(){\r\n\treturn new Date().toLocaleTimeString();\r\n}", "title": "" }, { "docid": "22149d015c8b12c31916fe1c9c0a69b2", "score": "0.5385221", "text": "function t(e,t,r){var n,i;return\"m\"===r?t?\"\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0430\":\"\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0443\":\"h\"===r?t?\"\\u0433\\u043e\\u0434\\u0438\\u043d\\u0430\":\"\\u0433\\u043e\\u0434\\u0438\\u043d\\u0443\":e+\" \"+(n=+e,i={ss:t?\"\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0430_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0438_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\":\"\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0443_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0438_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\",mm:t?\"\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0430_\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0438_\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\":\"\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0443_\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0438_\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\",hh:t?\"\\u0433\\u043e\\u0434\\u0438\\u043d\\u0430_\\u0433\\u043e\\u0434\\u0438\\u043d\\u0438_\\u0433\\u043e\\u0434\\u0438\\u043d\":\"\\u0433\\u043e\\u0434\\u0438\\u043d\\u0443_\\u0433\\u043e\\u0434\\u0438\\u043d\\u0438_\\u0433\\u043e\\u0434\\u0438\\u043d\",dd:\"\\u0434\\u0435\\u043d\\u044c_\\u0434\\u043d\\u0456_\\u0434\\u043d\\u0456\\u0432\",MM:\"\\u043c\\u0456\\u0441\\u044f\\u0446\\u044c_\\u043c\\u0456\\u0441\\u044f\\u0446\\u0456_\\u043c\\u0456\\u0441\\u044f\\u0446\\u0456\\u0432\",yy:\"\\u0440\\u0456\\u043a_\\u0440\\u043e\\u043a\\u0438_\\u0440\\u043e\\u043a\\u0456\\u0432\"}[r].split(\"_\"),n%10==1&&n%100!=11?i[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?i[1]:i[2])}", "title": "" }, { "docid": "ebb1a22531488cbb0d93d8caa427f43f", "score": "0.53793824", "text": "readableTimestamp(timestamp){\n return this.formatDate(timestamp).format('HH:mm:ss')\n }", "title": "" }, { "docid": "623c3e3c3ca669a1a5eda9a51aa5416f", "score": "0.5372275", "text": "function t(e,t,n){return\"m\"===n?t?\"\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0430\":\"\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0443\":\"h\"===n?t?\"\\u0433\\u043e\\u0434\\u0438\\u043d\\u0430\":\"\\u0433\\u043e\\u0434\\u0438\\u043d\\u0443\":e+\" \"+function(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0430_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0438_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\":\"\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0443_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0438_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\",mm:t?\"\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0430_\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0438_\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\":\"\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0443_\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\\u0438_\\u0445\\u0432\\u0438\\u043b\\u0438\\u043d\",hh:t?\"\\u0433\\u043e\\u0434\\u0438\\u043d\\u0430_\\u0433\\u043e\\u0434\\u0438\\u043d\\u0438_\\u0433\\u043e\\u0434\\u0438\\u043d\":\"\\u0433\\u043e\\u0434\\u0438\\u043d\\u0443_\\u0433\\u043e\\u0434\\u0438\\u043d\\u0438_\\u0433\\u043e\\u0434\\u0438\\u043d\",dd:\"\\u0434\\u0435\\u043d\\u044c_\\u0434\\u043d\\u0456_\\u0434\\u043d\\u0456\\u0432\",MM:\"\\u043c\\u0456\\u0441\\u044f\\u0446\\u044c_\\u043c\\u0456\\u0441\\u044f\\u0446\\u0456_\\u043c\\u0456\\u0441\\u044f\\u0446\\u0456\\u0432\",yy:\"\\u0440\\u0456\\u043a_\\u0440\\u043e\\u043a\\u0438_\\u0440\\u043e\\u043a\\u0456\\u0432\"}[n],+e)}", "title": "" }, { "docid": "ec87b14fd7d973e8c57553637be86a3e", "score": "0.53509045", "text": "function normalizeTS(ts) {\n if (!ts) {\n return \"null\";\n }\n if (typeof ts === \"string\") { // the timestamp wasn't changed\n return ts;\n } else {\n return ts.getFullYear() +\n '-' + pad(ts.getMonth() + 1) + // January is 0, December is 11\n '-' + pad(ts.getDate()) +\n ' ' + pad(ts.getHours()) +\n ':' + pad(ts.getMinutes()) +\n ':' + pad(ts.getUTCSeconds());\n }\n }", "title": "" }, { "docid": "206d77e0e75d6bfe070574e7896d5004", "score": "0.53405285", "text": "function te351227() { return '%TE'; }", "title": "" }, { "docid": "2aa3b0d2e1410e33122335a30de40764", "score": "0.53384787", "text": "function  timestampToTime(timestamp) {\n         var   date =  new  Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000\n var  Y = date.getFullYear() +  '-';\n         var  M = (date.getMonth() + 1 < 10 ?  '0' + (date.getMonth() + 1) : date.getMonth() + 1) +  '-';\n var D = (date.getDate() < 10 ? '0' + date.getDate(): date.getDate())\n         return  Y + M + D;\n     }", "title": "" }, { "docid": "1471a713a11d5bd5a6402d4f3d2b6a3f", "score": "0.5336678", "text": "function encode(t) {\n\t\tvar dt = new Date(1000*t);\n\t\tvar yr = dt.getUTCFullYear();\n\t\tvar mo = dt.getUTCMonth() + 1;\n\t\tvar da = dt.getUTCDate();\n\t\tvar hr = dt.getUTCHours();\n\t\tvar mn = dt.getUTCMinutes();\n\t\tvar sc = dt.getUTCSeconds();\n\t\tvar ms = dt.getUTCMilliseconds();\n\t\tvar s = '';\n\t\ts += yr;\n\t\tif (mo < 10)\n\t\t\ts += '0';\n\t\ts += mo;\n\t\tif (da < 10)\n\t\t\ts += '0';\n\t\ts += da;\n\t\tif (hr < 10)\n\t\t\ts += '0';\n\t\ts += hr;\n\t\tif (mn < 10)\n\t\t\ts += '0';\n\t\ts += mn;\n\t\tif (sc < 10)\n\t\t\ts += '0';\n\t\ts += sc;\n\t\ts += '.';\n\t\tif (ms < 10)\n\t\t\ts += '00';\n\t\telse\n\t\tif (s < 100)\n\t\t\ts += '0';\n\t\ts += ms;\n\t\tif (s.length < 18)\n\t\t\ts += '0';\n\t\treturn s;\n\t}", "title": "" }, { "docid": "6670ea9a79e1b783338974fa66df1da3", "score": "0.5330842", "text": "function formatTimeStamp(num) {\n var strnum = num.toString();\n\n return strnum.length == 1 ? '0' + strnum : strnum;\n }", "title": "" }, { "docid": "19deb7440e42f335e773d77127dd67d9", "score": "0.53261274", "text": "function t(e,t,r,n){var i={s:[\"\\u0925\\u094b\\u0921\\u092f\\u093e \\u0938\\u0945\\u0915\\u0902\\u0921\\u093e\\u0902\\u0928\\u0940\",\"\\u0925\\u094b\\u0921\\u0947 \\u0938\\u0945\\u0915\\u0902\\u0921\"],ss:[e+\" \\u0938\\u0945\\u0915\\u0902\\u0921\\u093e\\u0902\\u0928\\u0940\",e+\" \\u0938\\u0945\\u0915\\u0902\\u0921\"],m:[\"\\u090f\\u0915\\u093e \\u092e\\u093f\\u0923\\u091f\\u093e\\u0928\",\"\\u090f\\u0915 \\u092e\\u093f\\u0928\\u0942\\u091f\"],mm:[e+\" \\u092e\\u093f\\u0923\\u091f\\u093e\\u0902\\u0928\\u0940\",e+\" \\u092e\\u093f\\u0923\\u091f\\u093e\\u0902\"],h:[\"\\u090f\\u0915\\u093e \\u0935\\u0930\\u093e\\u0928\",\"\\u090f\\u0915 \\u0935\\u0930\"],hh:[e+\" \\u0935\\u0930\\u093e\\u0902\\u0928\\u0940\",e+\" \\u0935\\u0930\\u093e\\u0902\"],d:[\"\\u090f\\u0915\\u093e \\u0926\\u093f\\u0938\\u093e\\u0928\",\"\\u090f\\u0915 \\u0926\\u0940\\u0938\"],dd:[e+\" \\u0926\\u093f\\u0938\\u093e\\u0902\\u0928\\u0940\",e+\" \\u0926\\u0940\\u0938\"],M:[\"\\u090f\\u0915\\u093e \\u092e\\u094d\\u0939\\u092f\\u0928\\u094d\\u092f\\u093e\\u0928\",\"\\u090f\\u0915 \\u092e\\u094d\\u0939\\u092f\\u0928\\u094b\"],MM:[e+\" \\u092e\\u094d\\u0939\\u092f\\u0928\\u094d\\u092f\\u093e\\u0928\\u0940\",e+\" \\u092e\\u094d\\u0939\\u092f\\u0928\\u0947\"],y:[\"\\u090f\\u0915\\u093e \\u0935\\u0930\\u094d\\u0938\\u093e\\u0928\",\"\\u090f\\u0915 \\u0935\\u0930\\u094d\\u0938\"],yy:[e+\" \\u0935\\u0930\\u094d\\u0938\\u093e\\u0902\\u0928\\u0940\",e+\" \\u0935\\u0930\\u094d\\u0938\\u093e\\u0902\"]};return n?i[r][0]:i[r][1]}", "title": "" }, { "docid": "57298ee1ffbbf5e10b142fc64faa7ba4", "score": "0.53191864", "text": "getTimeStamp () {\n return new Date().toISOString().slice(0, 19).replace('T',' ');\n }", "title": "" }, { "docid": "b96c82108863f432a681f818b2cd00d0", "score": "0.53148377", "text": "function getID() {\n var length = 9;\n var id = \"\";\n var hex = '';\n var timestamp = new Date;\n var timestamp = timestamp.getTime();\n var timestamp = timestamp.toString();\n var ts = timestamp.toString();\n var parts = ts.split(\"\").reverse();\n\n\n console.log('A:timestamp.length ->' + timestamp.length);\n for (var i = 0; i < length; ++i) {\n var index = Math.floor(Math.random() * (parts.length));\n id += parts[index];\n }\n id = parseInt(id);\n hex = id.toString(16).toUpperCase();\n id = parseInt(hex, 16);\n return hex;\n}", "title": "" }, { "docid": "417e2d459d76a5c9df751cb6ef610173", "score": "0.531365", "text": "function timeStamp(){\n return Number(String(_.now()).slice(-3)).toString(\"32\");\n }", "title": "" }, { "docid": "69e98255827b09083ceafed34571f701", "score": "0.5309558", "text": "function parseTimestamp(t)\n{\n var date = t.substring(0, t.indexOf(\"T\"));\n var time = t.substring(t.indexOf(\"T\") + 1, t.indexOf(\":\", t.indexOf(\":\") + 1));\n var datetime = \"<strong>Time recieved: </strong>\" + time + \"<br><strong>Date Received: </strong>\" + date;\n return datetime;\n}", "title": "" }, { "docid": "3a7b14ac9d7452fcc4247cd53893d363", "score": "0.53056735", "text": "function t(e,t,n){return\"m\"===n?t?\"\\u043c\\u0438\\u043d\\u0443\\u0442\\u0430\":\"\\u043c\\u0438\\u043d\\u0443\\u0442\\u0443\":e+\" \"+function(e,t){var n=e.split(\"_\");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0430_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u044b_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\":\"\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0443_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u044b_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\",mm:t?\"\\u043c\\u0438\\u043d\\u0443\\u0442\\u0430_\\u043c\\u0438\\u043d\\u0443\\u0442\\u044b_\\u043c\\u0438\\u043d\\u0443\\u0442\":\"\\u043c\\u0438\\u043d\\u0443\\u0442\\u0443_\\u043c\\u0438\\u043d\\u0443\\u0442\\u044b_\\u043c\\u0438\\u043d\\u0443\\u0442\",hh:\"\\u0447\\u0430\\u0441_\\u0447\\u0430\\u0441\\u0430_\\u0447\\u0430\\u0441\\u043e\\u0432\",dd:\"\\u0434\\u0435\\u043d\\u044c_\\u0434\\u043d\\u044f_\\u0434\\u043d\\u0435\\u0439\",ww:\"\\u043d\\u0435\\u0434\\u0435\\u043b\\u044f_\\u043d\\u0435\\u0434\\u0435\\u043b\\u0438_\\u043d\\u0435\\u0434\\u0435\\u043b\\u044c\",MM:\"\\u043c\\u0435\\u0441\\u044f\\u0446_\\u043c\\u0435\\u0441\\u044f\\u0446\\u0430_\\u043c\\u0435\\u0441\\u044f\\u0446\\u0435\\u0432\",yy:\"\\u0433\\u043e\\u0434_\\u0433\\u043e\\u0434\\u0430_\\u043b\\u0435\\u0442\"}[n],+e)}", "title": "" }, { "docid": "bc51f5a098d1efa68ce8df299ef74a9a", "score": "0.5291772", "text": "function g(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}", "title": "" }, { "docid": "d5eb2cdfcfda802e0a0036bc0a215330", "score": "0.52809465", "text": "function getTimestamp() {\n\treturn moment().format(\"[[]ddd-DD-MMM-YYYY HH:mm:ss[]]\");\n}", "title": "" }, { "docid": "b3a5868d2ef9f974b34e76a2ea0069e3", "score": "0.5279882", "text": "function t(e,t,n,r){var o={s:[\"\\u0925\\u094b\\u0921\\u092f\\u093e \\u0938\\u0945\\u0915\\u0902\\u0921\\u093e\\u0902\\u0928\\u0940\",\"\\u0925\\u094b\\u0921\\u0947 \\u0938\\u0945\\u0915\\u0902\\u0921\"],ss:[e+\" \\u0938\\u0945\\u0915\\u0902\\u0921\\u093e\\u0902\\u0928\\u0940\",e+\" \\u0938\\u0945\\u0915\\u0902\\u0921\"],m:[\"\\u090f\\u0915\\u093e \\u092e\\u093f\\u0923\\u091f\\u093e\\u0928\",\"\\u090f\\u0915 \\u092e\\u093f\\u0928\\u0942\\u091f\"],mm:[e+\" \\u092e\\u093f\\u0923\\u091f\\u093e\\u0902\\u0928\\u0940\",e+\" \\u092e\\u093f\\u0923\\u091f\\u093e\\u0902\"],h:[\"\\u090f\\u0915\\u093e \\u0935\\u0930\\u093e\\u0928\",\"\\u090f\\u0915 \\u0935\\u0930\"],hh:[e+\" \\u0935\\u0930\\u093e\\u0902\\u0928\\u0940\",e+\" \\u0935\\u0930\\u093e\\u0902\"],d:[\"\\u090f\\u0915\\u093e \\u0926\\u093f\\u0938\\u093e\\u0928\",\"\\u090f\\u0915 \\u0926\\u0940\\u0938\"],dd:[e+\" \\u0926\\u093f\\u0938\\u093e\\u0902\\u0928\\u0940\",e+\" \\u0926\\u0940\\u0938\"],M:[\"\\u090f\\u0915\\u093e \\u092e\\u094d\\u0939\\u092f\\u0928\\u094d\\u092f\\u093e\\u0928\",\"\\u090f\\u0915 \\u092e\\u094d\\u0939\\u092f\\u0928\\u094b\"],MM:[e+\" \\u092e\\u094d\\u0939\\u092f\\u0928\\u094d\\u092f\\u093e\\u0928\\u0940\",e+\" \\u092e\\u094d\\u0939\\u092f\\u0928\\u0947\"],y:[\"\\u090f\\u0915\\u093e \\u0935\\u0930\\u094d\\u0938\\u093e\\u0928\",\"\\u090f\\u0915 \\u0935\\u0930\\u094d\\u0938\"],yy:[e+\" \\u0935\\u0930\\u094d\\u0938\\u093e\\u0902\\u0928\\u0940\",e+\" \\u0935\\u0930\\u094d\\u0938\\u093e\\u0902\"]};return r?o[n][0]:o[n][1]}", "title": "" }, { "docid": "37ccc91fe4c3bdcd837fe6e46bc566e5", "score": "0.5275492", "text": "function t(e,t,n){var r=\" \";return(e%100>=20||e>=100&&e%100===0)&&(r=\" de \"),e+r+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xe2ni\",MM:\"luni\",yy:\"ani\"}[n]}", "title": "" }, { "docid": "4cd719ffff7a077464655b435c75566f", "score": "0.52732307", "text": "function timestamp()\r\n{\r\n var d = new Date();\r\n var h = (\"0\"+d.getHours()).slice(-2);\r\n var m = (\"0\"+d.getMinutes()).slice(-2);\r\n var s = (\"0\"+d.getSeconds()).slice(-2);\r\n var ms = (\"000\"+d.getMilliseconds()).slice(-3);\r\n return h+':'+m+':'+s+'.'+ms;\r\n}", "title": "" }, { "docid": "e9bc707e17d6b9ffef2cb751ec374a5f", "score": "0.5266816", "text": "function toTimestamp(strDate){\n\tvar datum = Date.parse(strDate);\n\t//addded the 72001 to get the market close price, as the Date.parse() function returns the \n\t//time at 12:00am, which means we don't get the current day's closing price\n\treturn (datum/1000) + 72001;\n}", "title": "" }, { "docid": "add0b04b5939373fc695fafaae0e8015", "score": "0.52661204", "text": "uxDatetimeToRDLTimestamp(ux) {\n if (ux) {\n return new Date(ux).toISOString();\n }\n return '';\n }", "title": "" }, { "docid": "88a2ce3821bb6409cf192dd185df5e03", "score": "0.526538", "text": "function te1345378() { return '(6361'; }", "title": "" }, { "docid": "ba7edda620f7b75efa4dd364e281b8b5", "score": "0.52637297", "text": "function t(e,t,r){var n,i;return\"m\"===r?t?\"\\u0445\\u0432\\u0456\\u043b\\u0456\\u043d\\u0430\":\"\\u0445\\u0432\\u0456\\u043b\\u0456\\u043d\\u0443\":\"h\"===r?t?\"\\u0433\\u0430\\u0434\\u0437\\u0456\\u043d\\u0430\":\"\\u0433\\u0430\\u0434\\u0437\\u0456\\u043d\\u0443\":e+\" \"+(n=+e,i={ss:t?\"\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0430_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u044b_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\":\"\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u0443_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\\u044b_\\u0441\\u0435\\u043a\\u0443\\u043d\\u0434\",mm:t?\"\\u0445\\u0432\\u0456\\u043b\\u0456\\u043d\\u0430_\\u0445\\u0432\\u0456\\u043b\\u0456\\u043d\\u044b_\\u0445\\u0432\\u0456\\u043b\\u0456\\u043d\":\"\\u0445\\u0432\\u0456\\u043b\\u0456\\u043d\\u0443_\\u0445\\u0432\\u0456\\u043b\\u0456\\u043d\\u044b_\\u0445\\u0432\\u0456\\u043b\\u0456\\u043d\",hh:t?\"\\u0433\\u0430\\u0434\\u0437\\u0456\\u043d\\u0430_\\u0433\\u0430\\u0434\\u0437\\u0456\\u043d\\u044b_\\u0433\\u0430\\u0434\\u0437\\u0456\\u043d\":\"\\u0433\\u0430\\u0434\\u0437\\u0456\\u043d\\u0443_\\u0433\\u0430\\u0434\\u0437\\u0456\\u043d\\u044b_\\u0433\\u0430\\u0434\\u0437\\u0456\\u043d\",dd:\"\\u0434\\u0437\\u0435\\u043d\\u044c_\\u0434\\u043d\\u0456_\\u0434\\u0437\\u0451\\u043d\",MM:\"\\u043c\\u0435\\u0441\\u044f\\u0446_\\u043c\\u0435\\u0441\\u044f\\u0446\\u044b_\\u043c\\u0435\\u0441\\u044f\\u0446\\u0430\\u045e\",yy:\"\\u0433\\u043e\\u0434_\\u0433\\u0430\\u0434\\u044b_\\u0433\\u0430\\u0434\\u043e\\u045e\"}[r].split(\"_\"),n%10==1&&n%100!=11?i[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?i[1]:i[2])}", "title": "" }, { "docid": "e57a91e0f8d4ab1bfb79cb4fe23d4f6d", "score": "0.5251544", "text": "function timestamp(raw=false) {\n var d = new Date();\n if (raw) {\n return d.getTime();\n }\n \n var year = d.getFullYear()+\"/\";\n var month = d.getMonth()+1;\n if (month<10) {month=\"0\"+month;}\n month += \"/\";\n var date = d.getDate();\n if (date<10) {date=\"0\"+date;}\n date += \"/\";\n var hour = d.getHours();\n if (hour<10) {hour=\"0\"+hour;}\n hour += \":\";\n var minute = d.getMinutes();\n if (minute<10) {minute=\"0\"+minute;}\n minute += \":\";\n var sec = d.getSeconds();\n if (sec<10) {sec=\"0\"+sec;}\n sec += \":\";\n var msec = d.getMilliseconds();\n if (msec<10) {msec=\"0\"+msec;}\n if (msec<100) {msec=\"0\"+msec;}\n return [year+month+date+hour+minute+sec+msec, d];\n}", "title": "" }, { "docid": "c05b0785c0c22da17ea0260f6d84edf5", "score": "0.5250649", "text": "function ip1841448() { return '\"htt'; }", "title": "" }, { "docid": "5e5093c37e94520aacad1add9401da79", "score": "0.5245057", "text": "function t(e,t,r){var n=\" \";return(e%100>=20||e>=100&&e%100==0)&&(n=\" de \"),e+n+{ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"s\\u0103pt\\u0103m\\xe2ni\",MM:\"luni\",yy:\"ani\"}[r]}", "title": "" }, { "docid": "f5a13d996e39b6069308e388fe74217a", "score": "0.5240984", "text": "function toHktTs (date){\n return ut = moment(date, fmtStr).unix()+28800;\n}", "title": "" }, { "docid": "238640494b38cf765d685cbbacef45b0", "score": "0.52394605", "text": "function isoTimestamp() {\n return (new Date()).toISOString();\n}", "title": "" }, { "docid": "57f67061b1365d9a27232f80ff905a4d", "score": "0.5238673", "text": "function ip1831956() { return 'T\",'; }", "title": "" }, { "docid": "1f3b5a3ee20e0f7b6cf4285232196cb7", "score": "0.52258754", "text": "function timestamp(str){\n return new Date(str).getFullYear();\n}", "title": "" }, { "docid": "79f51192091722d2d357b833c9341aea", "score": "0.5224056", "text": "function fromTimestamp(rpepoch) {\n if (rpepoch instanceof Date) {\n rpepoch = rpepoch.getTime();\n }\n\n return Math.round(rpepoch / 1000) - 0x386D4380;\n}", "title": "" }, { "docid": "487ec48e4e1242da0bdaec3a0c78767c", "score": "0.52067643", "text": "function parseUnixTimestamp(timestamp) {\n\tconst time = new Date(timestamp * 1000);\n\n\ttext = monthString[time.getMonth()] + \" \";\n\ttext += padWithZeros(time.getDate(), 2) + \" \";\n\ttext += padWithZeros(time.getHours(), 2) + \":\";\n\ttext += padWithZeros(time.getMinutes(), 2);\n\n\treturn text;\n}", "title": "" }, { "docid": "4f7d040a671540bb82fd28acadf9acd7", "score": "0.51996225", "text": "getTimeStamp(rocketMsg) {\n\t\t// slack-G3KJGGE15-1483081061-000169\n\t\tlet slackTS;\n\t\tlet index = rocketMsg._id.indexOf('slack-');\n\t\tif (index === 0) {\n\t\t\t// This is a msg that originated from Slack\n\t\t\tslackTS = rocketMsg._id.substr(6, rocketMsg._id.length);\n\t\t\tindex = slackTS.indexOf('-');\n\t\t\tslackTS = slackTS.substr(index + 1, slackTS.length);\n\t\t\tslackTS = slackTS.replace('-', '.');\n\t\t} else {\n\t\t\t// This probably originated as a Rocket msg, but has been sent to Slack\n\t\t\tslackTS = rocketMsg.slackTs;\n\t\t}\n\n\t\treturn slackTS;\n\t}", "title": "" }, { "docid": "335c43383e5c5cf2e0d769110f5c4131", "score": "0.51874346", "text": "timestamp() {\n function pad(n) {\n return n < 10 ? \"0\" + n : n\n }\n\n let d = new Date()\n return d.getFullYear() + \"-\" +\n pad(d.getMonth() + 1) + \"-\" +\n pad(d.getDate()) + \" \" +\n pad(d.getHours()) + \":\" +\n pad(d.getMinutes()) + \":\" +\n pad(d.getSeconds())\n }", "title": "" }, { "docid": "e1fc34e6e97b5fc82328c9492c8a79e5", "score": "0.5184913", "text": "function returnTimestamp () {\n let date = Date().toLocaleString()\n let split = date.split(' (');\n let final = split[0];\n return final\n}", "title": "" }, { "docid": "3cb7e4c50ed7cdac69b6f9f6113b4ef6", "score": "0.51841027", "text": "function encodeTime(d, b, i) {\n\n b[i] = d.getUTCFullYear() % 100\n b[i + 1] = d.getUTCMonth() + 1\n b[i + 2] = d.getUTCDate()\n b[i + 3] = d.getUTCHours()\n b[i + 4] = d.getUTCMinutes()\n b[i + 5] = d.getUTCSeconds()\n }", "title": "" }, { "docid": "9db98a51b89da18c9e9d83367fa2e79a", "score": "0.51817393", "text": "function timeStampFormat() {\n return moment().format('YYYY-MM-DD HH:mm:ss.SSS ZZ');\n}", "title": "" }, { "docid": "98244f08a99be019561cf78adac90933", "score": "0.5180915", "text": "function jh60592() { return 'ihav'; }", "title": "" }, { "docid": "a544963aa692daf6e40e32eaf15bdbb4", "score": "0.5165797", "text": "function t(e,t,n,a){switch(n){case\"s\":return t?\"хэдхэн секунд\":\"хэдхэн секундын\";case\"ss\":return e+(t?\" секунд\":\" секундын\");case\"m\":case\"mm\":return e+(t?\" минут\":\" минутын\");case\"h\":case\"hh\":return e+(t?\" цаг\":\" цагийн\");case\"d\":case\"dd\":return e+(t?\" өдөр\":\" өдрийн\");case\"M\":case\"MM\":return e+(t?\" сар\":\" сарын\");case\"y\":case\"yy\":return e+(t?\" жил\":\" жилийн\");default:return e}}", "title": "" }, { "docid": "f9c59295e5422613ff42f6226e8fe92e", "score": "0.51647675", "text": "function unixStampConverter(stamp) {\n //Month array\n const months = ['January','February','March','April','May',\n 'June','July','August','September','October',\n 'November','December'];\n\n //Timestamp to milliseconds and pass to new date obj.\n const date = new Date(stamp*MILLISECONDS);\n const day = date.getDate();\n //Select correct suffix for the date. \n //i.e. if it's 3/09/2019, then the suffix for the day is 'rd' as in '3rd of September 2019'. \n var daySuffix = 'th';\n if (day === 1) { \n daySuffix = 'st';\n }\n else if (day === 2) {\n daySuffix = 'nd';\n }\n else if (day === 3) {\n daySuffix = 'rd';\n }\n //if minute < 10, then it'll look stupid i.e. 5 minutes past 3pm would be '15:5' as opposed to '15:05'\n //have to manually append the zero \n var minute = date.getMinutes();\n if (minute < 10) { \n minute = '0' + minute;\n console.log(minute);\n }\n //get date string in the desired format \n const dateTime = 'the ' + date.getDate() + `${daySuffix} of ` + months[date.getMonth()] + ' ' + date.getFullYear() \n +' at '+ date.getHours() + ':' + `${minute}`;\n return dateTime;\n}", "title": "" }, { "docid": "1f24b3dc6736ffa08d4c98af074b0a48", "score": "0.51601696", "text": "static getTimeStamp(body, wxInfo) {\n // regexp to create 5 groups\n // (DD)(hh)(mm)(z)(the rest of the string)\n let re = new RegExp(/^(\\d{2})(\\d{2})(\\d{2})(.)(.*$)/);\n let match = re.exec(body);\n // if we found a match.\n if (match) {\n let now = new Date();\n if (match[4] == 'z') {\n // convert this into UTC Unix timestamp\n let ts = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), parseInt(match[1]), // DD\n parseInt(match[2]), // hh\n parseInt(match[3]), // mm\n 0) / 1000; // ss\n wxInfo.timestamp = ts;\n // return the last group (the remainder of the body)\n return match[5];\n }\n }\n console.error(\"Unsupported time format!\");\n return \"\"; // error and return empty\n }", "title": "" }, { "docid": "99ec8f62fd3206011bd1a519ac365b68", "score": "0.51560473", "text": "function toRFC3896(input) {\n return input.replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16);\n });\n }", "title": "" }, { "docid": "12e3f6466e2c89d3b22d21766237d963", "score": "0.51544803", "text": "function jh106036() { return '.239.'; }", "title": "" }, { "docid": "836608f8d4b4f6fa951d5e11804c78e2", "score": "0.515062", "text": "function fix_timestamps() {\n\tfunction replace(className, fmt) {\n\t\tvar tz = moment.tz.guess();\n\t\tvar els = document.getElementsByClassName(className);\n\t\tfor (var i = 0; i < els.length; i++) {\n\t\t\tvar el = els[i];\n\t\t\tvar epoch = el.getAttribute('data-epoch');\n\t\t\tif (epoch) {\n\t\t\t\tel.innerText = moment(1000 * epoch).tz(tz).format(fmt);\n\t\t\t}\n\t\t}\n\t}\n\treplace('timestamp', 'YYYY-MM-DD HH:mm z')\n\treplace('shorttimestamp', 'DD HH:mm')\n}", "title": "" }, { "docid": "d1f06bff3a1cfe508228b926ddcfe83e", "score": "0.5146459", "text": "function formatTimestamp(t) {\n\n return t.getFullYear().toString() + \"/\" \n + (t.getMonth() + 101).toString().substring(1) + \"/\" \n + (t.getDate() + 100).toString().substring(1) + \" \" \n + (t.getHours() + 100).toString().substring(1) + \":\" \n + (t.getMinutes() + 100).toString().substring(1) + \":\" \n + (t.getSeconds() + 100).toString().substring(1) + \".\" \n + (10 * t.getMilliseconds() + (t.us100 || 0) + 10000)\n .toString().substring(1)\n }", "title": "" }, { "docid": "d4cdff27586e3808a2400897fed2a093", "score": "0.5144591", "text": "function sha1_kt(t) {\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n }", "title": "" }, { "docid": "d4cdff27586e3808a2400897fed2a093", "score": "0.5144591", "text": "function sha1_kt(t) {\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n }", "title": "" }, { "docid": "d4cdff27586e3808a2400897fed2a093", "score": "0.5144591", "text": "function sha1_kt(t) {\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514;\n }", "title": "" }, { "docid": "9d4ba41f774d6b9692c008478b3c1930", "score": "0.5139228", "text": "function sha1_kt(t) {\n\t\treturn (t < 20) ?\t 1518500249 : (t < 40) ?\t1859775393 : (t < 60) ? -1894007588 : -899497514;\n\t}", "title": "" }, { "docid": "823ae1fb9b250fa3760b5f82161182cb", "score": "0.5130711", "text": "function t(e,t,a){var s,i;return\"m\"===a?t?\"хвіліна\":\"хвіліну\":\"h\"===a?t?\"гадзіна\":\"гадзіну\":e+\" \"+(s=+e,i={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[a].split(\"_\"),s%10==1&&s%100!=11?i[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?i[1]:i[2])}", "title": "" }, { "docid": "f19367b49b3a307f766e595328ca7597", "score": "0.512921", "text": "function Unix_timestamp(t)\r\n{\r\nvar dt = new Date(t*1000);\r\nvar hr = dt.getHours();\r\nvar m = \"0\" + dt.getMinutes();\r\nvar s = \"0\" + dt.getSeconds();\r\nreturn hr+ ':' + m.substr(-2) + ':' + s.substr(-2);\r\n}", "title": "" }, { "docid": "929929825b22f574919f926fc30bf746", "score": "0.51263887", "text": "function t(e,t,n){var a={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";return(e%100>=20||e>=100&&e%100==0)&&(i=\" de \"),e+i+a[n]}", "title": "" }, { "docid": "7ea37b37170d035cca247c20790bdea7", "score": "0.51242447", "text": "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "7ea37b37170d035cca247c20790bdea7", "score": "0.51242447", "text": "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "7ea37b37170d035cca247c20790bdea7", "score": "0.51242447", "text": "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "7ea37b37170d035cca247c20790bdea7", "score": "0.51242447", "text": "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "7ea37b37170d035cca247c20790bdea7", "score": "0.51242447", "text": "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "7ea37b37170d035cca247c20790bdea7", "score": "0.51242447", "text": "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "7ea37b37170d035cca247c20790bdea7", "score": "0.51242447", "text": "function t(e,t,n){var r,o;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "e57b5d715f7b1d52981138ed240701c8", "score": "0.51199895", "text": "function t(e,t,n){var i,o;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(i=+e,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),i%10==1&&i%100!=11?o[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "fa5a0a9768e0b9f583307c05ae2f354e", "score": "0.51165444", "text": "function Timestamp( t, i ) {\n this._bsontype = 'Timestamp';\n this.hi = t;\n this.lo = i;\n}", "title": "" }, { "docid": "88319a37d4095f4d9a3147870b15165a", "score": "0.51137674", "text": "function t(e,t,a){var n,s;return\"m\"===a?t?\"хвіліна\":\"хвіліну\":\"h\"===a?t?\"гадзіна\":\"гадзіну\":e+\" \"+(n=+e,s={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[a].split(\"_\"),n%10==1&&n%100!=11?s[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?s[1]:s[2])}", "title": "" }, { "docid": "924aad95468fc2ea5c2030e192335332", "score": "0.5112962", "text": "function t(e,t,n){var o,i;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(o=+e,i={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),o%10==1&&o%100!=11?i[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?i[1]:i[2])}", "title": "" }, { "docid": "fc55626997e3a7e24e9fc8d9ba216883", "score": "0.51118326", "text": "function t(e,t,n){var i,r;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(i=+e,r={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2])}", "title": "" }, { "docid": "fc55626997e3a7e24e9fc8d9ba216883", "score": "0.51118326", "text": "function t(e,t,n){var i,r;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(i=+e,r={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2])}", "title": "" }, { "docid": "fc55626997e3a7e24e9fc8d9ba216883", "score": "0.51118326", "text": "function t(e,t,n){var i,r;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(i=+e,r={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),i%10==1&&i%100!=11?r[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?r[1]:r[2])}", "title": "" }, { "docid": "abceea95eeee4185a3afa724a2dbd83a", "score": "0.5110102", "text": "function e(t,e,n,r){var i={s:[\"\\u0925\\u094b\\u0921\\u092f\\u093e \\u0938\\u0945\\u0915\\u0902\\u0921\\u093e\\u0902\\u0928\\u0940\",\"\\u0925\\u094b\\u0921\\u0947 \\u0938\\u0945\\u0915\\u0902\\u0921\"],ss:[t+\" \\u0938\\u0945\\u0915\\u0902\\u0921\\u093e\\u0902\\u0928\\u0940\",t+\" \\u0938\\u0945\\u0915\\u0902\\u0921\"],m:[\"\\u090f\\u0915\\u093e \\u092e\\u093f\\u0923\\u091f\\u093e\\u0928\",\"\\u090f\\u0915 \\u092e\\u093f\\u0928\\u0942\\u091f\"],mm:[t+\" \\u092e\\u093f\\u0923\\u091f\\u093e\\u0902\\u0928\\u0940\",t+\" \\u092e\\u093f\\u0923\\u091f\\u093e\\u0902\"],h:[\"\\u090f\\u0915\\u093e \\u0935\\u0930\\u093e\\u0928\",\"\\u090f\\u0915 \\u0935\\u0930\"],hh:[t+\" \\u0935\\u0930\\u093e\\u0902\\u0928\\u0940\",t+\" \\u0935\\u0930\\u093e\\u0902\"],d:[\"\\u090f\\u0915\\u093e \\u0926\\u093f\\u0938\\u093e\\u0928\",\"\\u090f\\u0915 \\u0926\\u0940\\u0938\"],dd:[t+\" \\u0926\\u093f\\u0938\\u093e\\u0902\\u0928\\u0940\",t+\" \\u0926\\u0940\\u0938\"],M:[\"\\u090f\\u0915\\u093e \\u092e\\u094d\\u0939\\u092f\\u0928\\u094d\\u092f\\u093e\\u0928\",\"\\u090f\\u0915 \\u092e\\u094d\\u0939\\u092f\\u0928\\u094b\"],MM:[t+\" \\u092e\\u094d\\u0939\\u092f\\u0928\\u094d\\u092f\\u093e\\u0928\\u0940\",t+\" \\u092e\\u094d\\u0939\\u092f\\u0928\\u0947\"],y:[\"\\u090f\\u0915\\u093e \\u0935\\u0930\\u094d\\u0938\\u093e\\u0928\",\"\\u090f\\u0915 \\u0935\\u0930\\u094d\\u0938\"],yy:[t+\" \\u0935\\u0930\\u094d\\u0938\\u093e\\u0902\\u0928\\u0940\",t+\" \\u0935\\u0930\\u094d\\u0938\\u093e\\u0902\"]};return r?i[n][0]:i[n][1]}", "title": "" }, { "docid": "7e3215fa067a1b39051ad19082b74b09", "score": "0.5109673", "text": "function t(n,t,e){var i,o;return\"m\"===e?t?\"хвіліна\":\"хвіліну\":\"h\"===e?t?\"гадзіна\":\"гадзіну\":n+\" \"+(i=+n,o={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[e].split(\"_\"),i%10==1&&i%100!=11?o[0]:i%10>=2&&i%10<=4&&(i%100<10||i%100>=20)?o[1]:o[2])}", "title": "" }, { "docid": "61571a964e6c95cff26fe76d5ed4f873", "score": "0.51094955", "text": "function timestamp(str){\n\treturn new Date(str).getFullYear();\n}", "title": "" }, { "docid": "fb7802d2dbd390e540ba95c03728d5ee", "score": "0.5106875", "text": "function decodeTicker(ticker) {\n return ticker.replace(\":\", \".\");\n}", "title": "" }, { "docid": "29240b65b4bf5c775774a4cb30bedbbc", "score": "0.510649", "text": "function t(e,t,n){var r,i;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,i={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?i[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?i[1]:i[2])}", "title": "" }, { "docid": "29240b65b4bf5c775774a4cb30bedbbc", "score": "0.510649", "text": "function t(e,t,n){var r,i;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,i={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?i[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?i[1]:i[2])}", "title": "" }, { "docid": "29240b65b4bf5c775774a4cb30bedbbc", "score": "0.510649", "text": "function t(e,t,n){var r,i;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,i={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?i[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?i[1]:i[2])}", "title": "" }, { "docid": "29240b65b4bf5c775774a4cb30bedbbc", "score": "0.510649", "text": "function t(e,t,n){var r,i;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,i={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?i[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?i[1]:i[2])}", "title": "" }, { "docid": "29240b65b4bf5c775774a4cb30bedbbc", "score": "0.510649", "text": "function t(e,t,n){var r,i;return\"m\"===n?t?\"хвіліна\":\"хвіліну\":\"h\"===n?t?\"гадзіна\":\"гадзіну\":e+\" \"+(r=+e,i={ss:t?\"секунда_секунды_секунд\":\"секунду_секунды_секунд\",mm:t?\"хвіліна_хвіліны_хвілін\":\"хвіліну_хвіліны_хвілін\",hh:t?\"гадзіна_гадзіны_гадзін\":\"гадзіну_гадзіны_гадзін\",dd:\"дзень_дні_дзён\",MM:\"месяц_месяцы_месяцаў\",yy:\"год_гады_гадоў\"}[n].split(\"_\"),r%10==1&&r%100!=11?i[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?i[1]:i[2])}", "title": "" } ]
a1bbbedeec9b6239ff4a748a3fabf6af
Also probs want a footer
[ { "docid": "bd97cd417af4e123db5f56d6eae22efb", "score": "0.0", "text": "render() {\n return(\n <div>\n <Banner name={this.state.firstName}/>\n <MapContainer>\n <AddressInput\n firstName = {this.state.firstName}\n lastName = {this.state.lastName}\n batch = {this.state.userBatches}\n email = {this.state.userEmail}\n />\n </MapContainer>\n </div>\n );\n }", "title": "" } ]
[ { "docid": "490dcbe881a13e6c8abd24cea1f8f16e", "score": "0.73510206", "text": "getFooterContent() {\n // should be extended\n }", "title": "" }, { "docid": "35ff78a2cd3d6ff9d0a1992e556a093e", "score": "0.73307705", "text": "getFooter() {\n return null;\n }", "title": "" }, { "docid": "e9ca00edcd75b80800b74aca4f1cfb18", "score": "0.7157998", "text": "function footer() {\n var amountCompleted = ctrl.amountCompleted();\n var amountActive = ctrl.list.length - amountCompleted;\n \n return E('footer') . is ({ id: 'footer' }) . has([\n \n E('span') . is ({ id: 'todo-count' }) . has([\n E('strong') . has (T(F`${count} items left`))\n ]),\n \n // Filters (all, active, completed)\n E('ul') . is({ id: 'filters' }) . has ([\n E('li') . has(T(\"All\")) . does({ click: _ => data.filter = 'all' }),\n E('li') . has(T(\"Active\")) . does({ click: _ => data.filter = 'active' }),\n E('li') . has(T(\"Completed\")) . does({ click: _ => data.filter = 'completed' })\n ]),\n \n E('button') .\n has (T(F`Clear completed ${completedcount}`)) .\n is ({ id: 'clear-completed' }) .\n does({ click: clearCompleted })\n ]);\n }", "title": "" }, { "docid": "a67d8c039a93ba82d3d055e2e00b68a0", "score": "0.7065749", "text": "get withFooter() {\n return this.footerHasContent || !!this.footer;\n }", "title": "" }, { "docid": "1bf3b26241b60a0f47d89b2f0c782153", "score": "0.6918369", "text": "function footbot (res) {\n res.write('<div class=\"page-footer font-small blue small text-light bg-dark\" role = \"contentinfo\" style=\"width:100%; bottom: 0; padding-top: 1em; padding-bottom: 1em; margin-top: 10px;\">');\n res.write(' <div class=\"container\" style = \"text-align:center\">');\n res.write('&copy; Swift Interns');\n res.write(' </div>');\n res.write('</div>');\n }", "title": "" }, { "docid": "6ea0d8c6035f1c7e901b173b1895a74e", "score": "0.6904766", "text": "function Footer() {\n\n //var a = router.all;\n //let tests = DB.Tests.all();\n //console.log(a);\n\n\n return(\n <div>\n <h4> CopyRight 2020</h4>\n </div>\n );\n }", "title": "" }, { "docid": "cffe39cc7f070007602f6dca22212758", "score": "0.68216693", "text": "function setupFooter() {\n \t\t\t\n \t\t\tvar padding = 100;\n \t\t\tvar footerPadding = 40;\n \t\t\tvar mainContent = $(\"section\"+currentPageID);\n \t\t\tvar mainContentHeight = mainContent.outerHeight(true);\n \t\t\tvar footer = $(\".footer-link\");\n \t\t\tvar footerHeight = footer.outerHeight(true);\n \t\t\tvar totalPageHeight = mainContentHeight + footerHeight + footerPadding + padding;\n \t\t\tvar windowHeight = $(window).height();\t\t\n\n \t\t\tif(totalPageHeight > windowHeight){\n \t\t\t\t$(\".tm-content\").css(\"margin-bottom\", footerHeight + footerPadding + \"px\");\n \t\t\t\tfooter.css(\"bottom\", footerHeight + \"px\"); \t\t\t\n \t\t\t}\n \t\t\telse {\n \t\t\t\t$(\".tm-content\").css(\"margin-bottom\", \"0\");\n \t\t\t\tfooter.css(\"bottom\", \"20px\"); \t\t\t\t\n \t\t\t} \t\t\t\n\t\t }", "title": "" }, { "docid": "e61ae696548381e586d69adf951e3d33", "score": "0.66917175", "text": "function FooterTopComponent() {\n }", "title": "" }, { "docid": "2f42cf458e1b6ffdf3331179caa24aac", "score": "0.65699106", "text": "function createFooter() {\t\n\t$('.answerForm').append(\n\t\t`\n\t\t<footer role=\"contentinfo\">\t\t\t\t\n\t\t\t<div class=\"pageCount\">\n\t\t\t\t<p>Question ${userData.question} of ${userData.totalQuestions}</p>\t\n\t\t\t</div>\t\t\n\t\t\t<div class=\"score\">\n\t\t\t\t<span class=\"posScore\">+${userData.posScore}</span> <span class=\"negScore\">-${userData.negScore}</span>\n\t\t\t</div>\n\t\t</footer>\n\t\t`\n\t);\t\t\t\t\t\t\n}", "title": "" }, { "docid": "625c9d610630284ac8c1b5d3538de600", "score": "0.653461", "text": "function PrintFooter() {\n document.write(\"<P><HR><DIV CLASS=footer>\");\n document.write(document.location,\"<BR>\");\n document.write(\"Last Modified: \",document.lastModified,\" \");\n document.write(\"<A HREF=mailto:[email protected]>[email protected]</A>\");\n document.write(\"<BR>UCRL-MI-133316</DIV><P>\");\n defaultStatus = document.location;\n }", "title": "" }, { "docid": "63122ac652344ea421bf791739b2ecbb", "score": "0.64930546", "text": "function buildFooter() {\n\tvar footer = document.getElementById('footer');\n\tif (!footer)\n\t\treturn false;\n\n\tfooter.innerHTML = '';\n\n\tfooter.appendChild(addFavLink);\n\n\tif (settings.mode.value === 'scrolling' && pagination.active)\n\t\tbuildPagination('footer');\n\n\tbuildInfo();\n\tbuildAutoplay();\n}", "title": "" }, { "docid": "98b448b81d76267200edbbdb55c11317", "score": "0.63465863", "text": "function loadFooter(itcb) {\n addDynamicSubform( page.footer, 'footerElem', true, itcb );\n }", "title": "" }, { "docid": "515ef9f712ca50207d5ff92d5f64695c", "score": "0.63332677", "text": "function Footer() {\n return (\n <footer className=\"footer\">\n The Office (US) Random Click Game - JW \n </footer>\n );\n }", "title": "" }, { "docid": "fd60d4566b58cdb0a3b01ab70ee53f8e", "score": "0.6314628", "text": "function FooterCond() {\n\n\tconst { pathname } = useLocation();\n\n\treturn pathname.startsWith(\"/mes-secrets\") ? null : <Footer />;\n\n}", "title": "" }, { "docid": "8d0e66769f9b415d95182a41638f29c7", "score": "0.6301848", "text": "function addFooter(report) {\n var footer = report.getFooter();\n footer.addText(Banana.Converter.toLocaleDateFormat(new Date()) + \" \");\n footer.addText(\"Banana Library\" + \" \").setUrlLink(\"http://www.banana.ch\");\n footer.addFieldPageNr();\n}", "title": "" }, { "docid": "8e307de9828f57c1ca19e998dc9e521e", "score": "0.6297184", "text": "get footerText() {\n return this._params.footerText;\n }", "title": "" }, { "docid": "9481fb26f892e9f6297dde85850b02ad", "score": "0.6285188", "text": "function Myfoot() {\n return <footer>Footer</footer>\n}", "title": "" }, { "docid": "4f8972c74c6be8764792e881770be7c9", "score": "0.62842643", "text": "function addFooter(report) {\n report.getFooter().addClass(\"footer\");\n // report.getFooter().addText(\"Pagina \", \"description\");\n // report.getFooter().addFieldPageNr();\n}", "title": "" }, { "docid": "708ffb6da9a2bd86a338022857d33982", "score": "0.6273352", "text": "get _defaultFooterTemplate() { \n if (!this._hasFooter) { \n return '';\n }\n\n return html`\n <footer class=\"mdc-dialog__actions\" id=\"dialog-footer\">\n <slot name=\"footer\"></slot>\n </footer>\n `;\n }", "title": "" }, { "docid": "b0c3ef5eddd910bc8d4dbb18d5c43aff", "score": "0.6259469", "text": "function footerAlwayInBottom(footerSelector) {\r\n var docHeight = $(window).height();\r\n var footerTop = footerSelector.position().top + footerSelector.height();\r\n if (footerTop < docHeight) {\r\n footerSelector.css(\"margin-top\", (docHeight - footerTop) + \"px\");\r\n }\r\n }", "title": "" }, { "docid": "2a96b0b3741178968be413d5d8b5b79f", "score": "0.6258089", "text": "function footerBottom(){\n\tvar $footer = $('.footer');\n\tif($footer.length){\n\t\t$(window).on('load resizeByWidth', function () {\n\t\t\tvar footerOuterHeight = $footer.outerHeight();\n\t\t\t$footer.css({\n\t\t\t\t'margin-top': -footerOuterHeight\n\t\t\t});\n\t\t\t$('.spacer').css({\n\t\t\t\t'height': footerOuterHeight\n\t\t\t});\n\t\t});\n\t}\n}", "title": "" }, { "docid": "9a817e8f0ee318a906f83fedcf7471ad", "score": "0.623318", "text": "function init_footer() {\n $('footer').animate({bottom: '-100px'}, {duration: 1000});\n}", "title": "" }, { "docid": "678efbf0566ce268730b14b8921eafa9", "score": "0.6230659", "text": "function Footer() {\ndocument.write(\"<div style='color:#336699;'><< Aggiornato al: \" + aggiornamento +\" || © 2009 by <a style='color:#336699; visited:#336699;' href='mailto:\" + WebmasterEmail + \"'> Biagiotti Francesco</a> || Skin: Tabber09 || idea dalla OriginalPuffinSkin || Script Invio Formaz. by JohnDoe || Fantacalcio Manager 2005/2006 >></div>\")\n}", "title": "" }, { "docid": "3b65fc849e8ce570614279f86a30e1ce", "score": "0.622352", "text": "function addFooter()\n{\n var body = document.getElementsByTagName(\"body\")[0];\n // creating the div element which will contain the footer\n var footerDiv = document.createElement(\"div\");\n\n // Setting the style to the footer div\n footerDiv.setAttribute(\"class\", StyleClass.FOOTER);\n footerDiv.setAttribute(\"id\", \"998\");\n var footNode = getBoxInfo(\"998\");\n\n // creating a new footer table\n var footerTable = document.createElement(\"table\");\n\n // appending the first, second, third, fourth rows to footerTable\n if (footNode.hasPdfButton || footNode.hasFootnote || footNode.hasAbbreviation)\n {\n footerTable.appendChild(getFootNoteButtonRow(footNode));\n }\n if (footNode.hasFootnote)\n {\n footerTable.appendChild(getReferenceTextRow(footNode));\n }\n if (footNode.hasAbbreviation)\n {\n footerTable.appendChild(getAbbreviationTextRow(footNode));\n }\n if (footNode.hasMoreInfoButton)\n {\n footerTable.appendChild(getMoreInfoLinkButton(footNode));\n }\n\n // appending the Reset button to footerTable\n if (footNode.resetButtonText.trim() !== \"\")\n footerTable.appendChild(getResetButton(footNode));\n\n // appending the table to footerDiv\n footerDiv.appendChild(footerTable);\n // appending the footerDiv to the body\n\n body.appendChild(footerDiv);\n\n if (footNode.extraButtons.length > 0)\n {\n body.appendChild(addExtraButtons(footNode));\n }\n}", "title": "" }, { "docid": "1b22daf6a8206728bba40d26d57d760a", "score": "0.62203944", "text": "function fixFooters() {\n Reveal.getSlides().forEach(function (slide) {\n let footers = slide.getElementsByClassName(\"footer\");\n for (var i = 0; i < footers.length; i++) {\n let footer = footers[i];\n let parent = footer.parentElement;\n if (parent.nodeName == \"P\") {\n slide.appendChild(footer);\n if (parent.childNodes.length == 0) {\n parent.parentElement.removeChild(parent);\n }\n }\n }\n });\n }", "title": "" }, { "docid": "31ce0cf415e521757eae10d0e7b49396", "score": "0.6218653", "text": "function showFooter(){\n\tdocument.getElementById(\"content\").style[\"margin-bottom\"] = footerHeight+\"px\"; // adds extra margin at the bottom\n\tdocument.getElementById(\"error\").style[\"display\"] = \"none\"; // hides error message\n\tdocument.getElementById(\"footer\").style[\"display\"] = \"block\"; // shows footer\n}", "title": "" }, { "docid": "7e70603f6ea399217ccaf2f19b461ca9", "score": "0.6211452", "text": "function putFooterBottom(){\n\tvar minHeight = parseFloat($('html').height());\n\tvar windowHeight = parseFloat($(window).height());\n\tif(minHeight < windowHeight) {\n\t\t$('.footer').addClass('fixed');\n\t} else {\n\t\tif($('.footer').hasClass('fixed')) $('.footer').removeClass('fixed');\n\t}\n\tclearTimeout(footerTime);\n}", "title": "" }, { "docid": "d483bf2793a6e077c626fac9d983a051", "score": "0.62058365", "text": "function addFooter(report, param) {\n var date = new Date();\n var d = Banana.Converter.toLocaleDateFormat(date);\n report.getFooter().addClass(\"footer\");\n var textfield = report.getFooter().addText(d + \" - \");\n if (textfield.excludeFromTest) {\n textfield.excludeFromTest();\n }\n report.getFooter().addFieldPageNr();\n}", "title": "" }, { "docid": "94b1249f55c2366e1c4d09be0ea4f1ae", "score": "0.6201883", "text": "function Footer() {\n\n return (\n <footer className=\"footer has-background-black has-text-white mb-0\">\n <div className=\"content has-text-centered\">\n <p className=\"is-size-4\">\n Web application created by <a href=\"https://www.github.com/vruss14\">Valerie Russell</a>. \n Data from the\n <a href=\"https://developers.google.com/books\"> Google Books API</a>.\n </p>\n </div>\n </footer>\n );\n}", "title": "" }, { "docid": "b802e3dc3c9c65339d6914c565d278f9", "score": "0.61960167", "text": "renderFooterSlottedContent() {\n const { el } = this;\n const hasFooterSlottedContent = getSlotted(el, SLOTS.footer);\n return hasFooterSlottedContent ? (h(\"footer\", { class: CSS.footer },\n h(\"slot\", { name: SLOTS.footer }))) : null;\n }", "title": "" }, { "docid": "a9ebb51a201c73de870d1259742ef9c8", "score": "0.61941093", "text": "function getFooter(itemsWithPromotion, totalPrice) {\n let footer = ``;\n let promotion = itemsWithPromotion.promotion;\n let type = promotion.type;\n\n if (type) {\n footer += getFooterWhenExistPromotion(type, promotion, totalPrice);\n } else {\n footer += getFooterWhenNonPromotion(totalPrice);\n }\n\n return footer;\n}", "title": "" }, { "docid": "df92a1c9a216be3d28e43043413f04d6", "score": "0.61900437", "text": "function Footer() {\n return (\n <div id=\"footer\">\n <p>НОИТ 2020 | Проект №480 | Интернет приложения | Мартин Мирков и Слави Асенов | ПГИ - гр. Перник</p>\n </div>\n );\n}", "title": "" }, { "docid": "d4704f9c24fb268e0904fd993439aaf0", "score": "0.618911", "text": "function footerStructure() {\n var footer = $('#footer .footer-bottom');\n \n if (($('body').width() + scrollWidth) < 768) {\n\t\tif (!footer.find('.new-copyright').length) {\n\t\t\tfooter.find('.address').after('<div class=\"new-copyright\"></div>');\n\t\t\tfooter.find('.copyright').appendTo('#footer .footer-bottom .new-copyright');\n\t\t}\n } else {\n\t\tif (footer.find('.new-copyright').length) {\n\t\t\tfooter.find('.copyright').prependTo('#footer .footer-bottom .row');\n\t\t\tfooter.find('.new-copyright').remove();\n\t\t}\n }\n}", "title": "" }, { "docid": "1c058a3d2cd63695eb2dae0a2943a0fb", "score": "0.6182475", "text": "function _createFooterSection(layout) {\n\n var footer = new library.meteor.core.Surface({\n template: Template.footer,\n size: [undefined, 20],\n properties: {\n backgroundColor: 'black'\n }\n });\n\n // -------------------------------------------------------------------------------------------------------------\n\n return footer;\n\n}//_createFooterSection", "title": "" }, { "docid": "705c39e691c6a1021a092b71d6ffa7df", "score": "0.61724144", "text": "function Footer(props) {\n return (\n <footer className=\"footer\">\n <h2>❤️ Made with love by REX 2.0</h2>\n <div>\n {/* <a href=\"./pivacy-policy.html\">Read Our Privacy Policy</a><br /> */}\n &copy; 2021 REX Rescue Express 2.0\n </div>\n </footer>\n );\n}", "title": "" }, { "docid": "103c1f6aef20dffabf4b1ff20124fbc5", "score": "0.6158817", "text": "function Footer() {\n return (\n <div className=\"fixed-footer\">\n Made with <i className=\"icon ion-heart\"></i> by Camille\n </div>\n );\n}", "title": "" }, { "docid": "d5490e8d65ff8f76d0993c41643b45d3", "score": "0.61529964", "text": "function Footer() {\n // returns its single component of a footer\n return (\n <footer>\n <hr />\n <p className=\"pull-right\">\n {/* footer has a font awesome icon and the text \"Proudly built using React.js\" */}\n <i className=\"fab fa-github\" /> Proudly built using React.js\n </p>\n </footer>\n );\n}", "title": "" }, { "docid": "6fd266fdb4e07ddef2c4fb9c0d580624", "score": "0.61420816", "text": "function createMainTableFooter() {\n\tvar t = '</table>\\n';\n\tt += '<!-- CHAPTER END -->\\n';\n\treturn t;\n}", "title": "" }, { "docid": "a7a62273f68a34caee05d90f7e9ff3f1", "score": "0.61366516", "text": "function createFooter() {\n var text = document.createElement('p');\n text.innerHTML = '\\\n Copyright &copy; 2016-2017 Vladar (Vladimir Arabadzhi)\\\n (<a href=\"mailto:[email protected]\">e-mail</a>)';\n\n var footer = document.querySelector('footer');\n footer.appendChild(document.createElement('hr'));\n footer.appendChild(text);\n}", "title": "" }, { "docid": "6de8039da7824cbbc66980510a47164a", "score": "0.61284065", "text": "get footerContainer() { return $('footer .container') }", "title": "" }, { "docid": "1d5dcafa84d94741aa4628fd98d28f80", "score": "0.6127861", "text": "get showFooter() {\n return this.__showFooter.get();\n }", "title": "" }, { "docid": "17484ccf492daa681edf0aa648408780", "score": "0.6127804", "text": "function FooterAdmin() {\r\n return(\r\n <div>Nhóm 9 - Đồ án công nghệ thông tin - Đại học công nghệ giao thông vận tải</div>\r\n );\r\n }", "title": "" }, { "docid": "e34e08a15a9031234c8e681c5d7d8254", "score": "0.61236644", "text": "function mfnFooter() {\n\n var footerH = $('#Footer').height() || 0;\n\n // Fixed, Sliding\n\n if ($('.footer-fixed #Footer, .footer-sliding #Footer').length) {\n\n footerH = footerH - 1;\n $('#Content').css('margin-bottom', footerH + 'px');\n\n }\n\n // Stick to bottom\n\n if ($('.footer-stick #Footer').length) {\n\n var headerWrapperH = $('#Header_wrapper').height() || 0;\n\n var headerFooterH = headerWrapperH + footerH;\n\n var documentH = $(document).height() - adminBarH();\n\n if ( ( documentH <= $(window).height() ) && ( headerFooterH <= $(window).height() ) ) {\n $('#Footer').addClass('is-sticky');\n } else {\n $('#Footer').removeClass('is-sticky');\n }\n\n }\n\n }", "title": "" }, { "docid": "6b2e18c554f14150d2ab02c07dbf406a", "score": "0.61142564", "text": "function createTiddlerFooter(title,isEditor)\r\n{\r\n var theFooter = document.getElementById(\"footer\" + title);\r\n var tiddler = store.tiddlers[title];\r\n if(theFooter && tiddler)\r\n {\r\n removeChildren(theFooter);\r\n insertSpacer(theFooter);\r\n if(isEditor)\r\n {\r\n }\r\n else\r\n {\r\n var lingo = config.views.wikified.tag;\r\n var prompt = tiddler.tags.length == 0 ? lingo.labelNoTags : lingo.labelTags;\r\n var theTags = createTiddlyElement(theFooter,\"div\",null,null,prompt);\r\n for(var t=0; t<tiddler.tags.length; t++)\r\n {\r\n var theTag = createTagButton(theTags,tiddler.tags[t],tiddler.title);\r\n insertSpacer(theTags);\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "425d3147695e893114a97fb20c3d19c3", "score": "0.6113596", "text": "function stickfooter(){\n\t\t var ht = $(window).height();\n\t\t var copyht = $('.copyright-section').height();\n\t\t var fh = ht - (copyht);\n\t\t var fs = $('.footer-section').height();\n\t\t if($('body').has('.footer-section')){\n\t\t var wfs = fh-fs;\n\t\t $('.ced-jet-navigation-mbl').css('min-height',wfs);\n\t\t }\n\t\t else{\n\t\t $('.ced-jet-navigation-mbl').css('min-height',fh);\n\t\t } \n\t\t}", "title": "" }, { "docid": "49ef22f7f159e69752efd7bda23ae747", "score": "0.610342", "text": "function footer(){\n return(\n <div>\n <p className=\"footer\"> BACK TO TOP<br/>\n SASKATOON SALSA DANCE. EAST SASKATOON, SK,\n <br/>S7J1C9<br/>\n SASKATOON\n </p>\n </div>\n )\n}", "title": "" }, { "docid": "0d4b0151094e1d809e118ca4a45c193f", "score": "0.6098323", "text": "function fisRwdDialogFooter() {\n\t return {\n\t restrict: 'E',\n\t transclude: true,\n\t scope: true,\n\t require: \"^fisRwdDialog\", /* just for structure validation. We dont use the controller.*/\n\t template: _fisUiRwdDialogFooterHtml2['default']\n\t };\n\t}", "title": "" }, { "docid": "fa216fa995434952d9b2c95a20e99d43", "score": "0.6097208", "text": "function Footer(props)\n{\n return(\n <section class=\"bottomFooter\">\n <footer>\n <div class=\"footer-content\">\n <ul class=\"social-links\">\n <li class=\"social-icon-twitter\"><a href=\"#\"><TwitterIcon /></a></li>\n <li class=\"social-icon-facebook\"><a href=\"#\"><FacebookIcon /></a></li>\n <li class=\"social-icon-youtube\"><a href=\"#\"><YoutubeIcon /></a></li>\n <li class=\"social-icon-insta\"><a href=\"#\"><InstagramIcon /></a></li>\n </ul>\n </div>\n </footer>\n </section>\n );\n}", "title": "" }, { "docid": "269c0ae44a4218917dc65e01b2dae7ab", "score": "0.6096482", "text": "function Footer() {\n return (\n <footer>\n <hr />\n <p className=\"pull-right\">\n <i className=\"fab fa-github\" /> Proudly built using React.js\n </p>\n </footer>\n );\n}", "title": "" }, { "docid": "c39a1795dd9ef64090246b83af081745", "score": "0.60788655", "text": "function setIndexPageFooter(footer) {\n document.getElementById(\"footer\").innerHTML = footer;\n}", "title": "" }, { "docid": "60a9ed02801c26d8b112d009c4f7c4df", "score": "0.60622627", "text": "function fixPageFooter() {\n if ($('.page-actions').length < 1) {\n return false;\n }\n\n var $page = $('.wrapper-content');\n var footerHeight = $('.page-actions').outerHeight();\n $page.css('padding-bottom', footerHeight + 'px');\n}", "title": "" }, { "docid": "f7dac53d93296f6270d131eea78b97cd", "score": "0.60554045", "text": "function updateFooter( def, holder, footer )\n {\n if( footer.children().length )\n {\n if( !footer.parent().length )\n holder.insertAfter( footer );\n }\n else\n {\n footer.detach();\n }\n\n var footerMode = widget.get( def, 'options.footerMode', 'emptyContent' );\n if( footerMode == 'emptyContent' )\n {\n if( footer.children().length )\n footer.toggle( (holder.children().length === 0) );\n }\n else\n footer.toggle( true );\n }", "title": "" }, { "docid": "18bc63b3352404badce87abf9191f9f6", "score": "0.60439366", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, Title.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, Title, \"footerWidget\", false);\n }", "title": "" }, { "docid": "4a1e5f7636de3e0b84dedaf5b5aed808", "score": "0.6026201", "text": "function Footer(){\n return (\n <div>copyRights to el sa7 el da7 embo @@@@@</div>\n )\n}", "title": "" }, { "docid": "a73a2c51758b961aabe053bd9d2608e8", "score": "0.60235316", "text": "get footerWidget() {\n return this.__footerWidget.get();\n }", "title": "" }, { "docid": "36625774175d10cceff1ad074cb445cd", "score": "0.60233766", "text": "function insertFooter() {\n \n Word.run(function (ctx) {\n \n // Create a proxy collection for the sections collection.\n var mySections = ctx.document.sections;\n \n // Queue a command to load style property of the sections.\n ctx.load(mySections, 'body/style');\n \n // Synchronize the document state by executing the queued commands,\n // and returning a promise to indicate task completion.\n return ctx.sync().then(function () {\n\n // Get the primary footer of the first section and create\n // a proxy Body object for the footer.\n var myFooter = mySections.items[0].getFooter(\"primary\");\n \n // Queue a command to insert a paragraph at the end of the footer.\n myFooter.insertParagraph(\"Confidential\", \"end\");\n \n // Queue a command to insert a line break at the end of the footer. \n myFooter.insertBreak(\"line\", \"end\");\n })\n // Synchronize the document state by executing the queued commands.\n .then(ctx.sync)\n .then(function () {\n handleSuccess();\n })\n .catch(function (error) {\n handleError(error);\n })\n });\n }", "title": "" }, { "docid": "365508f5970666bd86ba75c7f0791e14", "score": "0.6015663", "text": "function footerHook(tagFooterBG, tagMainContentBody)\n{\n\tvar tagFooterBG = getDocID(tagFooterBG);//holds the Footer\n\tvar tagMainContentBody = getDocID(tagMainContentBody);//holds the main place where the content is displayed\n\n\t//checks if there is a user is on the page\n\tif(tagFooterBG != null && tagMainContentBody != null)\n\t{\n\t\t//checks the size of the window is greater then the body and header combin if so\n\t\t//use the fix footer instead in order to make sure that the footer is always at the buttom of the screen\n\t\tif(tagMainContentBody.offsetHeight < 300)\n\t\t\t//changes the id to the fix footer one\n\t\t\ttagFooterBG.id = 'divFooterBGFixFooter';\n\t\telse\n\t\t\ttagFooterBG.id = 'divFooterBG';\n\t}//end of if\n}//end of footerHook()", "title": "" }, { "docid": "1a5e1a36ba72aded720bee993123f303", "score": "0.5991124", "text": "function appendFooter(result) {\n let title = result.title\n let photographer = result.copyright\n if (photographer === undefined) {\n appendFooterWithoutPhotographer(title)\n } else {\n appendFooterWithPhotographer(title, photographer)\n }\n}", "title": "" }, { "docid": "a6e0392f5acd1b6814f04e647b59f1dc", "score": "0.5981287", "text": "function Footer() {\n return (\n <footer className=\"App-footer-position\">\n <Typography variant=\"body2\" component=\"p\">\n &copy; MN Beer Flow v1.0\n </Typography>\n </footer>\n )\n}", "title": "" }, { "docid": "bad20275bd8e29bd8b6aeed7f6842c2e", "score": "0.59782654", "text": "function set_footer(e){\n\t//test for all three methods\n\tvar sh1 = window.innerHeight ? window.innerHeight : 0;\n\tvar sh2 = document.documentElement ? document.documentElement.clientHeight : 0;\n\tvar sh3 = document.body ? document.body.clientHeight : 0;\n\t\n\t//determine highest number\n\tvar sh = sh1 ? sh1 : 0;\n\tsh = sh2 && (!sh || sh < sh2) ? sh2 : sh;\n\tsh = sh3 && (!sh || sh < sh3) ? sh3 : sh;\n\t\n\t//get bottom of footer\n\tvar f = find_DOM(e);\n\tif(f){\n\t\tvar h = f.offsetHeight;\n\t\tvar fb = f.offsetTop + h;\n\t\t\n\t\t//compare dimensions\n\t\tif(sh > fb){\n\t\t\tf.style.position = 'absolute';\n\t\t\tf.style.top = (sh - h) + 'px';\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fcd6dfb226efa737759d4a22d827b3a9", "score": "0.5977069", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, MasterDetail.structureTypeName, { start: \"7.1.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, MasterDetail, \"footerWidget\", false);\n }", "title": "" }, { "docid": "8846e71a9fea485a04ee4e48abbc21f0", "score": "0.59698874", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, SnippetCallWidget.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, SnippetCallWidget, \"footerWidget\", false);\n }", "title": "" }, { "docid": "d8ac007edfad1151568aca0d3cef7fd7", "score": "0.59698606", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, Header.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, Header, \"footerWidget\", false);\n }", "title": "" }, { "docid": "dbec61388e521feb162f0d9f7f040102", "score": "0.5968809", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, NavigationTree.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, NavigationTree, \"footerWidget\", false);\n }", "title": "" }, { "docid": "8f7aa8d0aa553b4b24236209e94fe9bc", "score": "0.59668857", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, Label.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, Label, \"footerWidget\", false);\n }", "title": "" }, { "docid": "1e4b919e398ac5f09d3c5336e1ea25cd", "score": "0.5958863", "text": "function Footer() {\n return (\n <footer>\n <div className=\"footer-container\">\n\n \n \n <a class=\"linked\" a href=\"https://www.linkedin.com/in/nathan-johnson-467102179/\">\n \n </a>\n\n <a class=\"git\" a href=\"https://github.com/Elipticblock5\"></a>\n \n \n </div>\n </footer>\n );\n }", "title": "" }, { "docid": "0d0b7c57923c3a7f63bcaab94cb7f31f", "score": "0.59586203", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, SimpleMenuBar.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, SimpleMenuBar, \"footerWidget\", false);\n }", "title": "" }, { "docid": "7bbaa094f343a6f6384eb94b7772d518", "score": "0.59552747", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, NavigationList.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, NavigationList, \"footerWidget\", false);\n }", "title": "" }, { "docid": "2b178a047618e358a2eaf1ca5426f7e3", "score": "0.5951449", "text": "function App() {\n return (\n <div className = \"AppDiv\">\n <Router>\n {/*<MainMenu/> Put a Header on each individual page to avoid div conflicts*/}\n <Switch>\n <Route exact path = {\"/\"} component = {Main}/>\n <Route path = {\"/about\"} component = {About}/>\n <Route path = {\"/mission\"} component = {Mission}/>\n <Route path = {\"/team\"} component = {TheTeam}/>\n <Route component = {E404}/>\n\n {/*\n <Footer/>\n Add footer here?? */}\n \n </Switch>\n </Router>\n </div>\n );\n}", "title": "" }, { "docid": "681c6fd971c231ef37960458a65aa4a4", "score": "0.5949407", "text": "static createInDataViewUnderFooterWidgets(container) {\n internal.createInVersionCheck(container.model, SnippetCallWidget.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, SnippetCallWidget, \"footerWidgets\", true);\n }", "title": "" }, { "docid": "3614e45617a16a9974276e6c73d98834", "score": "0.594637", "text": "function Footer({ children }) {\n return (\n <div>\n <div className=\"title\"></div>\n <div style={phantom} />\n <div style={style}>Project in &#169; by Midi-Clorian <a href=\"https://github.com/IsmaelRvra130\" class=\"fab fa-github\"> </a> \n { children }\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "5c7ac2cd41efb7d239a8f1e52fd0e0d4", "score": "0.5945157", "text": "static createInDataViewUnderFooterWidgets(container) {\n internal.createInVersionCheck(container.model, Title.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, Title, \"footerWidgets\", true);\n }", "title": "" }, { "docid": "c517a500a7d14248eed63d99f8685bb3", "score": "0.5940973", "text": "createFooter(){\n this.setFooter('');\n const rowDiv = this.appendFooter('div')\n rowDiv.classed('footer-row', 'true')\n\n const leftButton = rowDiv.append('button')\n .attr('id', 'settingModal-leftButton')\n .classed('footer-button', 'true')\n .text('Prev')\n .on('click', (e) => this.leftButtonClicked(e))\n\n const pagesIndicator = rowDiv.append('div')\n .attr('id', 'settingModal-pagesIndicator')\n\n this.content.forEach((c, i) => {\n pagesIndicator.append('div')\n .classed('page', true)\n .classed('active', i === this.activePage)\n })\n\n const rightButton = rowDiv.append('button')\n .attr('id', 'settingModal-rightButton')\n .classed('footer-button', 'true')\n .text(this.activePage === this.content.length-1 ? 'Finish' :'Next')\n .on('click', (e) => this.rightButtonClicked(e))\n }", "title": "" }, { "docid": "5c422df43417721b8a267e7bda51ca20", "score": "0.5914711", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, FileManager.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, FileManager, \"footerWidget\", false);\n }", "title": "" }, { "docid": "b9ec2547c182ff853f4e20f707f99c58", "score": "0.59118366", "text": "render() {\n return (\n <footer className=\"mastfoot mt-auto\">\n <div className=\"inner\">\n <p>Cover template for <a href=\"https://getbootstrap.com/\">Bootstrap</a>, by <a\n href=\"https://twitter.com/mdo\">@mdo</a>, used by Liam Cottrell.</p>\n </div>\n </footer>\n )\n }", "title": "" }, { "docid": "ad30e87121f74c7f85b7e9b8426c9cf9", "score": "0.591137", "text": "function ajustarFooter() {\n height = screen.height;\n if (height > 1023) {\n $('.footer').addClass('position-absolute');\n } else {\n $('.footer').removeClass('position-absolute');\n\n }\n}", "title": "" }, { "docid": "4e8943b0ad1a372b7425d3f2e693e910", "score": "0.5910672", "text": "function Footer() {\n return (\n <footer>\n <Container>\n <Row>\n <Col className='text-center py-3'>\n Copyright &copy; Vinted\n </Col>\n </Row>\n </Container>\n </footer>\n )\n}", "title": "" }, { "docid": "b774d8a3c6c080d6e88ecb7ddf96fa4c", "score": "0.59060127", "text": "static createInDataViewUnderFooterWidgets(container) {\n internal.createInVersionCheck(container.model, Label.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, Label, \"footerWidgets\", true);\n }", "title": "" }, { "docid": "26e6ef4c0b759fe48ce7ec0e8d383b09", "score": "0.59055704", "text": "_buildFooter(){\n\t\tthis._parameters.footer.forEach(link => {\n\t\t\tconst linkAttributes = Reflect.ownKeys(link);\n\n\t\t\tthis._elements.footerLinks.prepend(...this._toNodes(`\n\t\t\t\t<li\n\t\t\t\t\tid=\"${linkAttributes.includes('id') ? link.id : ''}\"\n\t\t\t\t\tclass=\"${linkAttributes.includes('classes') ? link.classes.join(' ') : ''}\"\n\t\t\t\t\t${linkAttributes.includes('attributes')\n\t\t\t\t\t\t? Object.entries(link.attributes).reduce((acc, [attribute, value]) => acc += attribute + '=\"'+value+'\" ', '')\n\t\t\t\t\t\t: ''\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<a class=\"quick-modal-generated-btn\" href=\"${link.href}\">\n\t\t\t\t\t\t${link.text}\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t`));\n\t\t});\n\t}", "title": "" }, { "docid": "37720390ddb14d0190e52980a0ebf694", "score": "0.5901283", "text": "function footer(footerID){\n // inject the standard footer html into the element with ID footerID\n\n footerHTML = \"\\\n \t<img src='images/footer2019.png'>\\\n\t\t<p>Developed by Rebecca Cowley (CSIRO) and Ricardo Domingues (NOAA/AOML)</p>\\\n\t\"\n\n document.getElementById(footerID).innerHTML = footerHTML\n}", "title": "" }, { "docid": "1264659b14fe2eb29e59234b6e4a5012", "score": "0.590078", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, LayoutGrid.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, LayoutGrid, \"footerWidget\", false);\n }", "title": "" }, { "docid": "10328ffb7be4c7eaa451bd35134370dd", "score": "0.5896323", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, MenuBar.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, MenuBar, \"footerWidget\", false);\n }", "title": "" }, { "docid": "be55a857e4dc764138645d3a69c6e546", "score": "0.5895322", "text": "static createInDataViewUnderFooterWidgets(container) {\n internal.createInVersionCheck(container.model, Header.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, Header, \"footerWidgets\", true);\n }", "title": "" }, { "docid": "4ad885eb097b4611206af755e8a5c0af", "score": "0.58950514", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, TemplateGrid.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, TemplateGrid, \"footerWidget\", false);\n }", "title": "" }, { "docid": "379d1a048fd4d819b5bcad01ed265899", "score": "0.58926255", "text": "function Footer() {\n return (\n <footer className=\"centertext\">Copyright&copy;Super Syntax Tutor</footer>\n );\n}", "title": "" }, { "docid": "c2e9abc6273e7e2ae182c786e2509ceb", "score": "0.58905244", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, GroupBox.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, GroupBox, \"footerWidget\", false);\n }", "title": "" }, { "docid": "f2b113ffcd042e0b5e7ad16b524c0f1c", "score": "0.5884833", "text": "function Footer(props) {\n //const [list, setList] = useState(store.getState());\n // useEffect(() => {\n // store.subscribe(() => {\n // setList(store.getState());\n // });\n // }, []);\n return (\n <div>\n {props.list.length !== 0 ? (\n <span>还有{props.list.length}个任务待完成.</span>\n ) : (\n <span>恭喜,已完成所有任务!</span>\n )}\n </div>\n );\n}", "title": "" }, { "docid": "bd550034cbb064f7795beaeb1a3c9ee6", "score": "0.5883595", "text": "hasCustomFooterSlot() {\n const footer = this.$slots.footer;\n if (footer.length > 1) return true;\n const tag = footer[0].tag;\n if (tag !== 'th' && tag !== 'td') return false;\n return true;\n }", "title": "" }, { "docid": "1745def7bc46ccb4c445e0c160a14bf8", "score": "0.58804816", "text": "function createFooter() {\n\t$FOOTER = $(\"<footer>\", {\n\t\tid: \"footer\", \n\t\tclass: \"footer\"\n\t});\n\tvar $footerContent = $(\"<div>\", {\n\t\tid: \"footerContent\",\n\t\tclass: \"container text-center\"\n\t});\n\tvar $footerContentText = $(\"<span>\", {\n\t\tid: \"footerContentText\",\n\t\tclass: \"text-muted\",\n\t\thtml: \"Copyright 2016 \"\n\t});\n\tvar $footerContentOmLink = $(\"<a>\", {\n\t\tid: \"footerContentOmLink\",\n\t\ttarget: \"_blank\",\n\t\thref: \"http://www.openmastery.org/\",\n\t\thtml: \"Open Mastery\"\n\t});\n\n\t$footerContentText.append($footerContentOmLink);\n\t$footerContentText.append(\" | All Rights Reserved\");\n\n\t//render the footer and add to viewport\n\t$footerContent.append($footerContentText);\n\t$FOOTER.append($footerContent);\n\t$VIEWPORT.append($FOOTER);\n}", "title": "" }, { "docid": "d094c706f2615ec2309a356cca78f4d3", "score": "0.5880455", "text": "buildFooter() {\n var page = 0;\n var maxPages = 0;\n var size = 0;\n\n if (this.paginatedArraySource) {\n page = this.paginatedArraySource.page;\n maxPages = this.paginatedArraySource.maxPages;\n size = this.paginatedArraySource.count;\n }\n\n this.footerNode.innerHTML = '<table>\\\n <tbody>\\\n <tr>\\\n <td class=\"fw-datagrid-faction go-first' + ((page > 1) ? '\"' : ' disabled\"') + '><div></div></td>\\\n <td class=\"fw-datagrid-faction go-previous' + ((page > 1) ? '\"' : ' disabled\"') + '><div></div></td>\\\n <td class=\"fw-datagrid-faction go-next' + ((page < maxPages) ? '\"' : ' disabled\"') + '><div></div></td>\\\n <td class=\"fw-datagrid-faction go-last' + ((page < maxPages) ? '\"' : ' disabled\"') + '><div></div></td>\\\n <td class=\"fw-datagrid-finfo\"><div>' + ((size > 0) ? (this.createMessage('results') + page + ' - ' + maxPages + this.createMessage('on') + size) : this.createMessage('noResult')) + '</div></td>\\\n </tr>\\\n </tbody>\\\n </table>';\n }", "title": "" }, { "docid": "4ee0858fdc0dbe4e1caccb00242dd06f", "score": "0.5875234", "text": "function Footer() {\n const footerSection = [\n {\n url: \"https://github.com/Erickcc\",\n Icon: AiFillGithub,\n id: 1,\n },\n {\n url: \"https://www.linkedin.com/in/erickgcc/\",\n Icon: AiFillLinkedin,\n id: 2,\n },\n {\n url: \"mailto:[email protected]\",\n Icon: SiGmail,\n id: 3,\n }\n ];\n\n return (\n <footer className=\"bottomContainer\">\n <ul className=\"ulFooter\">\n {footerSection.map((footerElement) => (\n <FooterItem\n url={footerElement.url}\n Icon={footerElement.Icon}\n key={footerElement.id}\n />\n ))}\n </ul>\n </footer>\n );\n}", "title": "" }, { "docid": "a6839eb9d4c9a89cff9f6521c39ddd0d", "score": "0.5872139", "text": "static createInDataViewUnderFooterWidget(container) {\n internal.createInVersionCheck(container.model, VerticalFlow.structureTypeName, { start: \"6.7.0\", end: \"7.14.0\" });\n return internal.instancehelpers.createElement(container, VerticalFlow, \"footerWidget\", false);\n }", "title": "" }, { "docid": "9dc211616f8224646ad2bb23d17b8627", "score": "0.5871921", "text": "function renderFooter() {\n\t\n\t// Draw the logo (site name & description)\n\tvar ftr = window.document.getElementById('cntnr-ftr');\n\tftr.innerHTML = '<a href=\"index.html\">' + site.name + ' :: ' + site.description + '</a>, ' + lastUpdateYear();\n}", "title": "" }, { "docid": "0a5e845c01823f0e04805243a3fa39dd", "score": "0.58703744", "text": "function getFooterAdmin() {\n\t\n\tvar wrapper = $('#wrapper').height();\n\twrapper = wrapper-90;\n\tvar ventana = $(window).height();\n\t//alert(wrapper+' - '+ventana);\n\tif (wrapper<ventana) {\n\t\t//alert('El documento es mayor que wrapper');\n\t\t//$('#wrapper').fadeIn('fast');\n\t\t$('#wrapper-footer').css('position', 'fixed').fadeIn('slow');\n\t}else if (wrapper>ventana) {\n\t\t//alert('El wrapper es mayor que el documento');\n\t\t//$('#wrapper').fadeIn('fast');\n\t\t$('#wrapper-footer').css('position', 'absolute').fadeIn('slow');\n\t}\n\t\n}", "title": "" }, { "docid": "b679279d629ace7b81491a3bae2e8106", "score": "0.58695436", "text": "function getFooter_() {\n const footer =\n `\n <div class=\"swg-footer\">\n <div class=\"swg-h-spacer\"></div>\n <span class=\"swg-sign-in\">Sign in</span>\n <button class=\"swg-button\" id=\"swg-button\">\n <div class=\"swg-icon\"></div>\n <span class=\"swg-label\">Subscribe with Google</span>\n </button>\n </div>\n `;\n return footer;\n}", "title": "" }, { "docid": "0e403a6b8ccd23d281dbfd917cbc4602", "score": "0.58673817", "text": "function footer() {\n var author = document.getElementById('author');\n var title = document.createElement('div');\n var links = document.createElement('a');\n links.setAttribute('href','https://www.linkedin.com/in/khanh-nguyen-4b1393b0/');\n links.setAttribute('target','_blank');\n links.setAttribute('style','color: white')\n links.innerHTML = 'Khanh Nguyen'\n title.setAttribute('style','background-color:#800080; color: white');\n title.innerHTML = \"Made By \"\n if(author != null) {\n title.appendChild(links);\n author.appendChild(title);\n }\n}", "title": "" }, { "docid": "c177b8d8adbba99cc30b6ad2b8b81b17", "score": "0.58594054", "text": "function Footer() {\n return (\n <footer className=\"text-center\">\n <hr />\n <p className=\"lead\">&copy; 2020 Riccardo Sartori</p>\n </footer>\n );\n}", "title": "" }, { "docid": "8d75cb65c5d651272a37283ef5d1f1df", "score": "0.5852434", "text": "render() {\n return (\n <footer>\n <div>\n <p className=\"footerCopyright\"><span className=\"copyrightAndYear\">Copyright &copy; 2017 by</span></p>\n <img className=\"footerImg\" alt=\"InDoor Copyright\" src=\"img/indoorCopyright120x30-grey.png\" />\n </div>\n <div className=\"allFooterLinks\">\n <a href=\"index.html\" className=\"footerLink\">Po&#x10D;etna <span className=\"whiteDot\">&#183;</span>\n </a>\n <a href=\"kuhinje.html\" className=\"footerLink\"> Kuhinje<span className=\"whiteDot\"> &#183;</span>\n </a>\n <a href=\"adaptacije.html\" className=\"footerLink\"> Adaptacije <span className=\"whiteDot\">&#183;</span>\n </a>\n <a href=\"kontakt.html\" className=\"footerLink\"> Kontakt <span className=\"whiteDot\">&#183;</span>\n </a>\n <a href=\"https://www.facebook.com/InDoor-246674172152061\" className=\"footerLink\" target=\"_blank\" rel=\"noopener noreferrer\"> Facebook stranica</a>\n </div>\n </footer>\n );\n }", "title": "" }, { "docid": "3e01b4264fb4dddc85ed6902cec526d0", "score": "0.585224", "text": "static createInDataViewUnderFooterWidgets(container) {\n internal.createInVersionCheck(container.model, SimpleMenuBar.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, SimpleMenuBar, \"footerWidgets\", true);\n }", "title": "" }, { "docid": "f59d9f9f3a25a472747fdd1524a31d22", "score": "0.5851472", "text": "static createInDataViewUnderFooterWidgets(container) {\n internal.createInVersionCheck(container.model, NavigationTree.structureTypeName, { start: \"7.15.0\" });\n return internal.instancehelpers.createElement(container, NavigationTree, \"footerWidgets\", true);\n }", "title": "" }, { "docid": "2d44962d20dad8d474d66060c1ddacd8", "score": "0.58487666", "text": "function FooterView(page) {\n this.id = Utils.randomId('footer');\n this.page = page;\n this.height = 0;\n this.separatorHeight = 0;\n this.views = new LinkedList();\n this.type = 'footer';\n this.padding = {\n top: \"7px\".convertor(), //No I18N\n bottom: \"7px\".convertor() //No I18N\n };\n this.top = 0;\n}", "title": "" } ]
18fe7f8e3a2a91e35fe447c6a95a6e71
fetches the hello response from the servlet and adds it to the html file via a container
[ { "docid": "9c1a66d9ad95ebdaeaa85f83b4bf6bc4", "score": "0.7250252", "text": "async function showHelloJulioServlet() {\n const responseFromServer = await fetch('/hello');\n const textFromResponse = await responseFromServer.text();\n\n const helloJulioContainer = document.getElementById('helloJulio-container');\n helloJulioContainer.innerText = textFromResponse;\n}", "title": "" } ]
[ { "docid": "d84799df613bf1096381a996a1efbacd", "score": "0.6306235", "text": "function onRequestHtml(request, response){\n response.writeHead(200, { \"Content-Type\": \"text/html\"})\n fs.readFile(\"./index.html\", null, (erorr, data) => {\n if(erorr) {\n response.writeHead(404)\n response.write(\"File not Found\")\n }else {\n response.write(data) \n }\n response.end()\n })\n}", "title": "" }, { "docid": "f21b642acc8ae5869d197eb132f9f691", "score": "0.628095", "text": "function serveHTML(resource, sekiResponse, queryResponse) {\n\n\t// set up HTML builder\n\tvar viewTemplater = templater(htmlTemplates.viewTemplate);\n\t// verbosity(\"GOT RESPONSE \");\n\n\tvar saxer = require('./srx2map');\n\tvar stream = saxer.createStream();\n\n\tsekiResponse.pipe(stream);\n\n\tqueryResponse.on('data', function(chunk) {\n\t\tstream.write(chunk);\n\t});\n\n\tqueryResponse.on('end', function() {\n\n\t\tstream.end();\n\n\t\tvar bindings = stream.bindings;\n\t\tif (bindings.title) { // // this is ugly\n\t\t\tverbosity(\"GOT: \" + JSON.stringify(bindings));\n\t\t\t// verbosity(\"TITLE: \" + bindings.title);\n\t\t\tverbosity(\"WRITING HEADERS \" + JSON.stringify(sekiHeaders));\n\t\t\tsekiResponse.writeHead(200, sekiHeaders);\n\t\t\tvar html = viewTemplater.fillTemplate(bindings);\n\t\t} else {\n\t\t\tverbosity(\"404\");\n\t\t\tsekiResponse.writeHead(404, sekiHeaders);\n\t\t\t// /////////////////////////////// refactor\n\t\t\tvar creativeTemplater = templater(htmlTemplates.creativeTemplate);\n\t\t\tvar creativeMap = {\n\t\t\t\t\"uri\" : resource\n\t\t\t};\n\t\t\tvar html = creativeTemplater.fillTemplate(creativeMap);\n\t\t\t// ///////////////////////////////////////////\n\t\t\t// serveFile(sekiResponse, 404, files[\"404\"]);\n\t\t\t// return;\n\t\t}\n\t\t// sekiResponse.writeHead(200, {'Content-Type': 'text/plain'});\n\t\t// verbosity(\"HERE \"+html);\n\t\t// sekiResponse.write(html, 'binary');\n\t\tsekiResponse.end(html);\n\t});\n}", "title": "" }, { "docid": "2ead573945558dd338f2d3fe46af9fab", "score": "0.6078045", "text": "function response(req,res){ // used to create http server on local machine and handle request/response\n let file = \"\"; //create correct file path for request\n if(req.url == \"/\"){ \n file = __dirname + \"/index.html\";\n }else{\n file = __dirname + req.url;\n }\n\n //async read html file\n fs.readFile(file, function(err,page){\n if(err){ //404 error\n res.writeHead(404);\n return res.end(\"Page not found!\");\n }\n res.writeHead(200); //write html header \n res.end(page); //send data response to webpage\n });\n}", "title": "" }, { "docid": "18e381c6520392e279de4b1aa2f63296", "score": "0.6057336", "text": "function handleHtml (req, res) {\n const html = client.toString(req.url, { message: 'hello server!' })\n res.setHeader('Content-Type', 'text/html; charset=utf-8')\n res.end(html)\n}", "title": "" }, { "docid": "98d22f6a70dda4a009312526785935d3", "score": "0.6046423", "text": "function onRequest(request, response){\n\tif(request.method == 'GET' && request.url =='/') {\n\t\tresponse.writeHead(200, {\"Content-Type\" : \"text/html\"});\n\t\tfs.createReadStream(\"./index.html\").pipe(response);\n\t} else {\n\t\tsend404Response(response);\n\t}\n}", "title": "" }, { "docid": "8520d4b64e0d7a282c9a00c3984876da", "score": "0.6041134", "text": "function openHTML(response, filename){\n\tcontent = fs.readFileSync(\"./PUBLIC/\" + filename );\n\tresponse.end(content);\n}", "title": "" }, { "docid": "8d58a7eb4ae999055f28a1ed2f84762d", "score": "0.6015935", "text": "function start(response) {\n var html = '<html>'+\n '<head>'+\n '<meta http-equiv=\"Content-Type\" content=\"text/html; '+\n 'charset=UTF-8\" />'+\n '<title>Dev upload page</title>'+\n '</head>'+\n '<body>'+\n '<form action=\"/upload\" enctype=\"multipart/form-data\" '+\n 'method=\"post\">'+\n '<input type=\"file\" name=\"newImage\" />'+\n '<input type=\"submit\" value=\"Upload image\" />'+\n '</form>'+\n '</body>';\n response.writeHead(200, {'Content-Type': 'text/html'});\n response.write(html);\n response.end();\n}", "title": "" }, { "docid": "b848537152cb5dfd557f0dd795d3cfeb", "score": "0.5993995", "text": "function serveHTML(resource, viewTemplate, sekiResponse, queryResponse) {\n log.debug(\"in serveHTML, viewTemplate = \" + viewTemplate);\n if (!viewTemplate) {\n viewTemplate = htmlTemplates.contentTemplate; // \n }\n\n var saxer = require('./srx2map');\n var stream = saxer.createStream();\n\n sekiResponse.pipe(stream);\n\n queryResponse.on('data', function(chunk) {\n log.debug(\"CHUNK: \" + chunk);\n stream.write(chunk);\n });\n\n queryResponse.on('end', function() {\n\n stream.end();\n\n var bindings = stream.bindings;\n\n // verbosity(\"bindings \" + JSON.stringify(bindings));\n\n if (!bindings || !bindings.title) { // // this is shite\n var creativeMap = {\n \"uri\": resource,\n \"title\": \"Enter title\",\n \"content\": \"Enter content\",\n \"login\": \"nickname\"\n }\n // \"uri\" : sekiRequest.url\n };\n\n sekiResponse.writeHead(200, sekiHeaders);\n\n bindings[\"uri\"] = resource;\n\n var html = freemarker.render(viewTemplate, bindings);\n\n log.info(\"404\");\n\n // log.debug(\"viewTemplate = \"+viewTemplate);\n // log.debug(\"bindings = \"+JSON.stringify(bindings));\n sekiResponse.end(html);\n });\n}", "title": "" }, { "docid": "c4f706178c6f5576b271a5332cd0ba0e", "score": "0.59688747", "text": "function serveHTML(file, response) {\n fs.readFile(file, 'utf8', function (errors, contents){\n if (errors) {console.log(errors);}\n response.writeHead(200, {'Content-Type': 'text/html'});\n response.write(contents);\n response.end();\n });\n}", "title": "" }, { "docid": "3eb04b2c20f0227999840b90824b4d96", "score": "0.5962876", "text": "function renderHTML(path, response){\n\tfs.readFile(path, null, function(error, data){\n\t\tif (error){\n\t\t\tresponse.writeHead(404);\n\t\t\tresponse.write(\"file not found sucka\");\n\n\t\t}else{\n\t\t\tresponse.write(data);\n\t\t\t//response.write(mod2.myStr);\n\t\t}\n\t\tresponse.end();\n\t});\n}", "title": "" }, { "docid": "5b98b2c7201d0738bdd410767409716d", "score": "0.5929573", "text": "function index (response){\n console.log(\"Request handler for index was called.\")\n \n // Reading the index.html file and attaching the content to the response\n fs.readFile(\"./public/index.html\",function(error, data){\n if (error){\n console.log(err); \n }\n response.writeHead(200, {\"Content-type\": \"text/html\"});\n response.write(data);\n response.end();\n });\n }", "title": "" }, { "docid": "f2fcd9f263cbb5eb95b1de7b100b57fc", "score": "0.5923257", "text": "function submitGet() {\n console.log('button clicked');\n $.ajax({\n method: 'GET',\n url: '/'\n }).then(function (response) {\n console.log('GET request response', response);\n // $(`.welcome`).append(`<p>${response}</p>`); \n }); //end ajax GET \n}", "title": "" }, { "docid": "65ae22241bfb3492b68fc0d220c34050", "score": "0.5917161", "text": "function index(response, request) {\n\tresponse.writeHead(200, {\"Content-Type\": \"text/html\"});\n\tresponse.write(indexHTML);\n\tresponse.end();\n}", "title": "" }, { "docid": "ef8cc90918548b315a01549caeac9e9a", "score": "0.58869797", "text": "function onRequest(request, response) {\n if( request.method == 'GET' && request.url == '/'){\n response.writeHead(200, {\"Content-Type\": \"text/html\"});\n fs.createReadStream(\"./login.html\").pipe(response);\n } else {\n send404Response(response);\n }\n\n}", "title": "" }, { "docid": "b47064bc5f4a2a372285e35424662e6a", "score": "0.5860282", "text": "function onRequest ( request, response ){\n\n response.writeHead(200, {'Content-type': 'text/plain'});\n response.write('hello world alex into a server');\n response.end();\n}", "title": "" }, { "docid": "28b155ec57c7f47cf120bdcbe6c605ee", "score": "0.5859285", "text": "function chatpage(response) {\n\tfs.readFile('index.html',function (err, data){\t\n\t\tresponse.writeHead(200, {\"Content-Type\": \"text/html\",'Content-Length':data.length});\n\t\tresponse.write(data);\n\t\tresponse.end();\n\t});\n}", "title": "" }, { "docid": "4327ee810a199952bbdfdc7b81a34665", "score": "0.5810932", "text": "function onRequest(request,response) {\n // We send a HTTP status of 200 and content-type in the response header\n response.writeHead(200, {'Content-Type': 'text/plain'});\n // Set the HTTP resonse body to 'Hello World'\n response.write('Hello World');\n // We finish the response\n response.end();\n}", "title": "" }, { "docid": "84334bd8b805dd9495089c64aeab0e77", "score": "0.5800236", "text": "function onRequest(request, response) {\n\t// If the response code is 200, return the content type as JSON?\n\tresponse.writeHead(200, {\"Content-Type\": \"application/json\"});\n\t// If the response code is 200, return the content type as html?\n\tresponse.writeHead(404, {\"Content-Type\": \"text/html\"});\n\n\t// Check to see what the URL is and respond accordingly\n\tswitch(path.basename(request.url)) {\n\t\tcase \"home\":\n\t\t\tresponse.write(\"<html><h1>Welcome to the Home Page.</h1></html>\");\n\t\t\tresponse.end();\n\t\t\tbreak;\n\t\tcase \"getData\":\n\t\t\tvar myData = {\n\t\t\t\t\"name\": \"Levi Stum\",\n\t\t\t\t\"class\": \"CS 313\"\n\t\t\t}\n\t\t\tresponse.write(JSON.stringify(myData));\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresponse.write(\"<html><p>404 Error. Page not found.</p></html>\");\n\t\t\t// response.writeHead(301, { \"Location\": \"404.html\"});\n\t\t\tbreak;\n\t}\n\n\t// End the response, send the data back to the user.\n\tresponse.end();\n}", "title": "" }, { "docid": "ca4e002e60039e928c59a7b17be83cfd", "score": "0.57841355", "text": "function onRequest(request, response){\n //The '/' means the homepage\n if(request.method == 'GET' && request.url == '/'){\n response.writeHead(200, {\"Content-Type\": \"text/html\"});\n //sends out response through pipe\n fs.createReadStream('./index.html').pipe(response);\n }\n else{\n send404(response);\n }\n}", "title": "" }, { "docid": "32b2111623c073b1661afc4dc1d4532c", "score": "0.5751556", "text": "function onRequest(request,response) {\n response.writeHead(200, {'Content-Type': 'text/plain'});\n response.write('Hello World');\n response.end();\n}", "title": "" }, { "docid": "6ba2cf1fb8d23275d1d0c0b24ef6d460", "score": "0.57449853", "text": "function getResponse(data) {\n responseDiv.innerHTML = data;\n}", "title": "" }, { "docid": "f22b0415f3d0ae204eae8729c61f935f", "score": "0.57148415", "text": "function onTestHtmlRequest(req, res) {\n const [reqPath, query] = req.url.split('?');\n const filePath = '/test.html';\n const host = req.headers['host'].toLowerCase();\n console.log('onTestHtmlRequest: ', host, req.url, reqPath, query || '',\n req.headers['cache-control']);\n\n let file = fs.readFileSync(PUBLIC_PATH + filePath);\n const stat = fs.statSync(PUBLIC_PATH + filePath)\n\n // File not found\n if (!file || !stat) {\n console.log('404 ', reqPath);\n res.statusCode = 404;\n res.end();\n return;\n }\n\n // Push or link if needed.\n const headers = {\n 'last-modified': stat.mtime.toUTCString(),\n 'Cache-Control': 'public, max-age=600',\n 'Content-Type': 'text/html',\n };\n\n const mode = query || 'nopush';\n\n // Transform.\n let fileString = file.toString('utf-8');\n\n // __SCRIPT_BASE__\n const scriptBase =\n host.indexOf('localhost') != -1\n ? ''\n : host.indexOf('zhouyx.dev') != -1\n ? '//preloadtest.com'\n : '//zhouyx.dev';\n fileString = fileString.replace('__SCRIPT_BASE__', scriptBase);\n\n // __NAME__\n fileString = fileString.replace('__NAME__', mode.toUpperCase());\n\n // __MODE__\n fileString = fileString.replace('__MODE__', mode);\n\n // Complete.\n file = fileString;\n\n const keys = Object.keys(headers);\n for (let i = 0; i < keys.length; i++) {\n res.setHeader(keys[i], headers[keys[i]]);\n }\n\n res.end(file);\n}", "title": "" }, { "docid": "3678c9170b002c330371bc6457c37ebc", "score": "0.56542134", "text": "function getCGI(response, filename){\n \tchild_process(response, filename);\n}", "title": "" }, { "docid": "db16d1440a0408ebb18700b1cc58efca", "score": "0.5641037", "text": "function testGetCharizard() {\n document.getElementById(\"httpRequest\").innerHTML = \"/Charizard\";\n fetch(baseURL + \"/Charizard\")\n .then(res => res.text())\n .then(res => {\n console.log(res);\n document.getElementById(\"httpResponse\").innerHTML = res;\n })\n}", "title": "" }, { "docid": "b53a61aaa1c93ef562fb7435b16eebaa", "score": "0.5640652", "text": "function portfolio(response){\n console.log(\"Request for handler for portfolio was called.\")\n response.writeHead(200, {\"Content-type\": \"text/plain\"});\n response.write(\"These are some of our portfolio projects\");\n response.end();\n }", "title": "" }, { "docid": "f5176cad98a96be2b9151c544eeae57d", "score": "0.56344837", "text": "function start(response) {\n\tconsole.log(\"Request handler 'start' was called.\");\n\t\n\t/*just for now define some fake topics already in the system*/\n\t/*data.insertTopic(\"things are happening\", \"www.google.com\");\n\tdata.insertTopic(\"other things are happening\", \"www.google.com\");\n\tdata.insertTopic(\"many things are happening\", \"www.google.com\");*/\n\t\n\tresponse.writeHead(200, {'Content-Type' : MIME_TYPES['.html']});\n\tvar buffer = fs.readFile('index.html',\n\tfunction(err, data) { serveFile(err, data, response); } );\n}", "title": "" }, { "docid": "b74442d9fb7d089273ec70e725cbc939", "score": "0.5634348", "text": "function fetch(req,res){\n//\tTEMPLATE.html=\"<div>Hello I am loaded from server</div>\"; //load this from a file\n\n TEMPLATE.html='<div><a href=\"http://google.com\" class=\"round-button\">OK</a><input id=\"chatField\" type=\"text\"/> <br><input id=\"send\" text =\"send\" type=\"button\"/><div>';\n \n\tif (req.query && req.query.callback) {\n res.set({\n // nice to have, but Chrome dont seem to mind either way\n 'Access-Control-Allow-Origin': '*',\n // right content type prevent warnings and errors\n 'Content-Type': 'text/javascript; charset=UTF-8',\n // optional, this is in seconds, equivalent to 8h\n 'Cache-Control': 'public, max-age=28800'\n });\n\t return res.send(200, \"\" + req.query.callback + \"(\" + JSON.stringify(TEMPLATE) + \");\");\n } else {\n return res.send(200, TEMPLATE);\n }\n}", "title": "" }, { "docid": "2c157c2d985452da9ef1ffe64472f50d", "score": "0.5624008", "text": "function requestHandler(req, res) {\n res.writeHead(200, { 'Content-Type': 'text/html' });\n res.write(getFile);\n res.end();\n}", "title": "" }, { "docid": "79d3cb70ae8955c9402be300d25c1bec", "score": "0.5611648", "text": "function onRequest(request, response)\n{\n var pathname = url.parse(request.url).pathname;\n var query = url.parse(request.url).query;\n\n if (pathname == '/') pathname += 'index.html';\n var filePath = \".\" + pathname;\n\n var extname = path.extname(filePath);\n var contentType = 'text/html';\n switch (extname)\n {\n case '.js':\n contentType = 'text/javascript';\n break;\n case '.css':\n contentType = 'text/css';\n break;\n case '.json':\n contentType = 'application/json';\n break;\n case '.png':\n contentType = 'image/png';\n break;\n case '.jpg':\n contentType = 'image/jpg';\n break;\n }\n\n fs.readFile(filePath, function(error, content) {\n if (error)\n {\n response.writeHead(500);\n response.end(\"Error: \" + error.code + \"\\n\");\n response.end();\n }\n else\n {\n response.writeHead(200, { 'Content-Type': contentType });\n response.end(content, 'utf-8');\n }\n });\n}", "title": "" }, { "docid": "15d66b8ca25e711e4b05fd486ae120f0", "score": "0.55922455", "text": "function doGet(e) {\n return HtmlService.createHtmlOutput('Hello ' + JSON.stringify(e));\n}", "title": "" }, { "docid": "5a7b1a206c9bf8f397c814e0437efb27", "score": "0.5567488", "text": "function onRequest(request,response) {\n console.log(\"A user has made a request \" + request);\n response.writeHead(202, {\"Context-Type\":\"text/plain\"});\n response.write(\"Here is your response\");\n response.end();\n}", "title": "" }, { "docid": "612cc81a5af812410a015faf6ad1a7f0", "score": "0.5564344", "text": "function loaded(error, response, body) {\n // Check for errors\n if (!error && response.statusCode == 200) {\n // The raw HTML is in body\n res.send(body);\n } else {\n res.send(response);\n }\n }", "title": "" }, { "docid": "f76590c3516f8dc6d5aad455a01f8697", "score": "0.5554506", "text": "function getAndPrintHTML (options) {\n\n var requestOptions = {\n host: \"sytantris.github.io\",\n path: \"/http-examples/step3.html\"\n };\n\n var dataAppend = \"\";\n https.get(requestOptions, function(response) {\n response.setEncoding(\"utf8\");\n\n response.on(\"data\", function(data) {\n dataAppend += data; \n \n });\n\n response.on(\"end\", function() {\n console.log(\"Response stream complete.\");\n console.log(dataAppend)\n });\n });\n}", "title": "" }, { "docid": "bb9f6c9aab8faad45793218d246a5922", "score": "0.5553307", "text": "function onRequest(request, response) {\n\t\t// fill out a simple 'hello world'.\n\t\t/*\n\t\tres.writeHead(200, {\"Content-Type\": \"text/plain\"});\n\t\tres.write(\"Hello World\");\n\t\tres.end();\n\t\t*/\n\t\tif (!router.resolve(request, response))\n\t\t\tfileServer(request, response);\n\t}", "title": "" }, { "docid": "e8e9a86ef1dfbbecbcaa2bc2c91dfbd0", "score": "0.55504256", "text": "function servePage(response, page){\n console.log('serve this page:', page);\n var body = fs.readFileSync(`./public/${page}`).toString();\n response.write(body);\n response.end();\n}", "title": "" }, { "docid": "088dfce3be3ae485201ae0f24d10067e", "score": "0.5543195", "text": "function getEmployees() {\n $.ajax({\n type: 'GET',\n url: '/employees',\n success: function(response) {\n console.log(\"Got from server:\", response);\n appendDom(response);\n }\n });\n}", "title": "" }, { "docid": "3f48dfeb06fe4e8035ac53b8bdb22015", "score": "0.55379075", "text": "function handleRequest(request,response){\n\n //capture the url the request is made to\n\n var path =req.url;\n\n //depending on the URL,display a different HTML file \n\n response.end(\"It Works!!\" +request.url);\n\n}", "title": "" }, { "docid": "711a980beeb4d00227a3b588ff2d6541", "score": "0.5531318", "text": "function handleResponse(response) {\n console.log('Handling the response.');\n\n // response.text() returns a Promise, because the response is a stream of\n // content and not a simple variable.\n const textPromise = response.text();\n\n // When the response is converted to text, pass the result into the\n // addDataToDom() function.\n textPromise.then(addDataToDom);\n}", "title": "" }, { "docid": "854741d635f48c0d524d06b1c9f75e65", "score": "0.55252874", "text": "function handler (request, response) {\n \n var uri = url.parse(request.url).pathname,\n filename = path.join(config.app_root, config.server.web_directory, uri);\n \n tlog.debug(\"Request [\" + request.connection.remoteAddress + \"] - \" + uri);\n \n // Special requests\n if (uri == '/tviz_config.js'){\n\ttlog.debug(\" config.js\");\n var client_config = \"var config = \" + JSON.stringify(config.client) + \";\";\n \n response.writeHead(200, {\"Content-Type\": \"application/javascript\"});\n response.write(client_config + \"\\n\");\n response.end();\n return;\n }\n \n fs.exists(filename, function(exists) {\n if (filename.slice(-1) === \"/\") {\n filename += \"index.html\";\n }\n\n tlog.debug(\" request for \" + filename);\n if(!exists) {\n response.writeHead(404, {\"Content-Type\": \"text/plain\"});\n response.write(\"404 Not Found\\n\");\n response.end();\n return;\n }\n \n // Handle directories\n if (fs.statSync(filename).isDirectory()) {\n filename += '/index.html';\n }\n \n fs.readFile(filename, \"binary\", function(err, file) {\n if(err) { \n response.writeHead(500, {\"Content-Type\": \"text/plain\"});\n response.write(err + \"\\n\");\n response.end();\n return;\n }\n \n //tlog.debug(\"file: \" + filename + \" type : \" + mime.lookup(file));\n \n response.writeHead(200, {\n 'Content-Type': mime.lookup(filename)\n });\n response.write(file, \"binary\");\n response.end();\n });\n });\n}", "title": "" }, { "docid": "1ee44ac7d9b3ce7560fbabceda0c9a3a", "score": "0.55241776", "text": "function sendClientHtml(response) {\n\tif (sendClientHtml.cachedHtml) {\n\t\tresponse.writeHead(200, {'Content-Type': 'text/html', 'Transfer-Encoding': 'chunked'});\n\t\tresponse.write(sendClientHtml.cachedHtml);\n\t\tresponse.end();\n\t} else {\n\t\tfs.readFile('client.html', function(err, data) {\n\t\t\tsendClientHtml.cachedHtml = data;\n\t\t\tsendClientHtml(response);\n\t\t});\n\t}\n}", "title": "" }, { "docid": "be12136ddf51be61191cb8896787160a", "score": "0.55153644", "text": "function greeter (request, response) {\n let text = 'Hello, World!';\n responseWriter(response, 200, text);\n}", "title": "" }, { "docid": "0fa9e5f3f969d15f33b7947ed5c08056", "score": "0.5504354", "text": "function handle(request, response) {\n // First, tell the client that we will be sending HTML.\n response.writeHead(200, {\"Content-Type\": \"text/html\"});\n\n // Next, write the HTML document.\n response.write('<!DOCTYPE html>'\n + '<html>'\n + '<head>'\n + '<title>Hello, 6.170 World!</title>'\n + '<meta charset=\"UTF-8\">'\n + '<script type=\"text/javascript\">'\n + 'var counter = 0;'\n + 'function changeit() {'\n + 'var text = document.getElementById(\"text\");'\n + 'var changeto = document.getElementById(\"changeto\");'\n + 'text.innerHTML = \"#\" + counter + \": \" + changeto.value;'\n + 'counter++;'\n + '}'\n + '</script>'\n + '</head>'\n + '<body>'\n + '<h1>Hello, <a href=\"https://stellar.mit.edu/S/course/6/fa14/6.170/\">6.170</a> World!</h1>'\n + '<button onclick=\"changeit()\">Set text to:</button> <input type=\"text\" id=\"changeto\">'\n + '<p id=\"text\">I\\'m <i>waiting</i>!</p>'\n + '</body>'\n + '</html>');\n\n // Indicate that the response is fully determined now.\n response.end();\n}", "title": "" }, { "docid": "a2c1665fec05e93d22c3ef070bbcecc9", "score": "0.5496957", "text": "function sendResponse(weatherData, res) {\n var page = '<html><head><title>External Example </title></head>' +\n '<body>' +\n '<form method=\"post\">' +\n 'City: <input name=\"city\"><br>' +\n '<input type=\"submit\" value=\"Get Weather\">' +\n '</form>'; \n\n if(weatherData) {\n page += '<h1> Weather Info </h1><p>' + weatherData + '</p>';\n }\n\n page += '</body></html>';\n res.end(page);\n}", "title": "" }, { "docid": "5ddc49991a3b6990c867205d54a80312", "score": "0.5496667", "text": "function handler ( req, res ) {\n fs.readFile( __dirname + '/client.html' ,\n function ( err, data ) {\n if ( err ) {\n console.log( err );\n res.writeHead(500);\n return res.end( 'Error loading client.html' );\n }\n res.writeHead( 200 );\n res.end( data );\n });\n}", "title": "" }, { "docid": "db98af404eb5fcd328b8a829cc8e3a95", "score": "0.54960513", "text": "function homepage(res, req) {\n\tlog.trace('homepage: begin');\n\n\tvar body = '<html>'\n\t + '<head>'\n\t + '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />'\n\t + '<title>OpenKarotz Emulator</title>'\n\t + '</head>'\n\t + '<body>'\n\t + '<h1>OpenKarotz Emulator</h1>'\n\t + '<h2>Status</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/status\">status</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/get_version\">get_version</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/get_free_space\">get_free_space</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/sleep\">sleep</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/wakeup?silent=0\">wakeup</a>, <a target=\"results\" href=\"/cgi-bin/wakeup?silent=1\">wakeup(silent)</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/reboot\">reboot</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/reset_install_flag\">reset_install_flag</a></li>'\n\t + '</ul>'\n\t + '<h2>Leds</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/leds\">leds</a></li>'\n\t + '</ul>'\n\t + '<h2>Ears</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/ears\">ears</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/ears_reset\">ears_reset</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/ears_random\">ears_random</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/ears_mode?disable=0\">ears_mode(enabled)</a>, <a target=\"results\" href=\"/cgi-bin/ears_mode?disable=1\">ears_mode(disabled)</a></li>'\n\t + '</ul>'\n\t + '<h2>Sound</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/sound_list\">sound_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/radios_list\">radios_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/sound?id=bip\">sound(id)</a>, <a target=\"results\" href=\"/cgi-bin/sound?url=http://play/sound\">sound(url)</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/sound_control?cmd=quit\">sound_control(quit)</a>, <a target=\"results\" href=\"/cgi-bin/sound_control?cmd=pause\">sound_control(pause)</a></li>'\n\t + '</ul>'\n\t + '<h2>Speech</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/voice_list\">voice_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/tts?text=Hello%20World\">tts</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/display_cache\">display_cache</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/clear_cache\">clear_cache</a></li>'\n\t + '</ul>'\n\t + '<h2>Photos</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/snapshot\">snapshot</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/snapshot_ftp\">snapshot_ftp</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/snapshot_list\">snapshot_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/snapshot_get\">snapshot_get</a>, <a target=\"results\" href=\"/cgi-bin/snapshot_get?filename=snapshot.thumb.gif\">snapshot_get(thumbnail)</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/clear_snapshots\">clear_snapshots</a></li>'\n\t + '</ul>'\n\t + '<h2>RFID</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/rfid_list\">rfid_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/rfid_list_ext\">rfid_list_ext</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/rfid_start_record\">rfid_start_record</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/rfid_stop_record\">rfid_stop_record</a></li>'\n\t + '</ul>'\n\t + '<h2>Misc.</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/moods_list\">moods_list</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/stories_list\">stories_list</a></li>'\n\t + '</ul>'\n\t + '<h2>Apps</h2>'\n\t + '<ul>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/apps/clock\">clock</a>, <a target=\"results\" href=\"/cgi-bin/apps/clock?hour=12\">clock(12)</a></li>'\n\t + '<li><a target=\"results\" href=\"/cgi-bin/apps/moods\">moods</a>, <a target=\"results\" href=\"/cgi-bin/apps/moods?id=50\">moods(50)</a></li>'\n\t + '</ul>'\n\t + '<hr/>'\n\t + '<p><small>'\n\t + '<a href=\"https://github.com/hobbe\">Copyright &copy 2013</a> - '\n\t + '<a href=\"https://github.com/hobbe/openkarotz-emulator\">OpenKarotz Emulator</a> - '\n\t + '<a href=\"https://github.com/hobbe/openkarotz-emulator/raw/master/LICENSE\">MIT License</a>'\n\t + '</small></p>'\n\t + '</body>'\n\t + '</html>';\n\n\tres.writeHead(200, {\n\t 'Server': 'OpenKarotz Emulator WebServer 1.0',\n\t 'Connection': 'close',\n\t 'Accept-Ranges': 'bytes',\n\t 'Content-Type' : 'text/html',\n\t 'Access-Control-Allow-Origin': '*'\n\t});\n\tres.write(body);\n\tres.end();\n\tlog.trace('homepage: end');\n}", "title": "" }, { "docid": "e6006f060eebb5801a45c1813ca7598b", "score": "0.54927695", "text": "function handler (req, res) { //la funzione che crea il server\n fs.readFile(__dirname + '/public/index.html', function(err, data) { //leggi il file index.html nella cartella public\n if (err) {\n res.writeHead(404, {'Content-Type': 'text/html'}); //display 404 on error\n return res.end(\"404 Not Found\");\n }\n res.writeHead(200, {'Content-Type': 'text/html'}); //componi la testa per la risposta\n res.write(data); //scrivi il contenuto dal file index.html\n return res.end(); //termina la risposta al client\n });\n}", "title": "" }, { "docid": "4602f9079232736d8593c16ad6fe7ab0", "score": "0.5487695", "text": "function addHtml(url) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n finalHtml= xhttp.responseText;\n }\n };\n xhttp.open(\"GET\",url, false);\n xhttp.send();\n}", "title": "" }, { "docid": "e1dc8ca80f50f61be26dd2aa4499070a", "score": "0.5463129", "text": "function index(request,response,parameter){\n\t/* do something */\n\tvar data = {};\n\tdata.name = \"aa\";\n\tcallHtml(\"index.ejs\", data, response);\n}", "title": "" }, { "docid": "fb3ee0b96db24ada11629ad13203825a", "score": "0.5451941", "text": "async hello(req, res) {\n try {\n console.log('You are accessing Hello World html!');\n res.render('hello.ejs') // if success, will be rendering html file from views/hello.ejs\n } catch (e) {\n res.status(500).send(exception) // if error, will be display \"500 Internal Server Error\"\n }\n }", "title": "" }, { "docid": "5a89b00994cda638e871b841368c7461", "score": "0.5448202", "text": "function getButton(req, res){\n var fileUrl = config.public + '/button.html';\n \n obtainData(req)\n .then(function(information){\n return compileFile(fileUrl, information);\n })\n .then(function(fileData){\n res.send(fileData);\n })\n .catch(function(err){\n console.log(err);\n res.send(500);\n });\n}", "title": "" }, { "docid": "dc57af12b4f6f93a4a46d1edba3ce8ea", "score": "0.543537", "text": "function doGet(e) {\n return HtmlService.createHtmlOutput(\"Hi there. There's nothing to see here. Move along.\");\n}", "title": "" }, { "docid": "6f961b99f1ca8c702d136586ecff5876", "score": "0.5434843", "text": "function loadpage(page_request, containerid){\r\n\tif (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf(\"http\")==-1))\r\n\t\tdocument.getElementById(containerid).innerHTML=page_request.responseText;\r\n}", "title": "" }, { "docid": "da4109609c4b6333481eb3e8e5db5f9c", "score": "0.5387819", "text": "function processGet(request, response) {\n //Undefined or empty base directory means do not serve static files\n if (!baseDir || \"\" === baseDir) {\n response.writeHead(404);\n response.end();\n return;\n }\n\n //Verify CORS requirements\n if (!VerifyCORSAndSetHeaders(request, response)) {\n response.writeHead(\"403\", \"Origin \" + request.headers.origin + \" not allowed\", {});\n response.end();\n return;\n }\n\n //Locate the file requested and send it\n var uri = url.parse(request.url).pathname;\n var filename = path.resolve(path.join(baseDir, uri));\n\n //Ensure the basedir path is not able to be escaped\n if (filename.indexOf(baseDir) != 0) {\n response.writeHead(400, \"Invalid request path\", {});\n response.end();\n return;\n }\n\n fs.exists(filename, function(exists) {\n if(!exists) {\n response.writeHead(404);\n response.end();\n return;\n }\n\n if (fs.statSync(filename).isDirectory()) {\n filename += '/index.html';\n }\n\n fs.readFile(filename, \"binary\", function(err, file) {\n if (err) {\n response.writeHead(500);\n response.end(err + \"\\n\");\n return;\n }\n var headers = {};\n var contentType = contentTypesByExtension[path.extname(filename)];\n if (contentType) {\n headers[\"Content-Type\"] = contentType;\n }\n for (var k in options.headers) {\n headers[k] = options.headers[k];\n }\n response.writeHead(200, headers);\n response.write(file, \"binary\");\n response.end();\n });\n });\n }", "title": "" }, { "docid": "da4109609c4b6333481eb3e8e5db5f9c", "score": "0.5387819", "text": "function processGet(request, response) {\n //Undefined or empty base directory means do not serve static files\n if (!baseDir || \"\" === baseDir) {\n response.writeHead(404);\n response.end();\n return;\n }\n\n //Verify CORS requirements\n if (!VerifyCORSAndSetHeaders(request, response)) {\n response.writeHead(\"403\", \"Origin \" + request.headers.origin + \" not allowed\", {});\n response.end();\n return;\n }\n\n //Locate the file requested and send it\n var uri = url.parse(request.url).pathname;\n var filename = path.resolve(path.join(baseDir, uri));\n\n //Ensure the basedir path is not able to be escaped\n if (filename.indexOf(baseDir) != 0) {\n response.writeHead(400, \"Invalid request path\", {});\n response.end();\n return;\n }\n\n fs.exists(filename, function(exists) {\n if(!exists) {\n response.writeHead(404);\n response.end();\n return;\n }\n\n if (fs.statSync(filename).isDirectory()) {\n filename += '/index.html';\n }\n\n fs.readFile(filename, \"binary\", function(err, file) {\n if (err) {\n response.writeHead(500);\n response.end(err + \"\\n\");\n return;\n }\n var headers = {};\n var contentType = contentTypesByExtension[path.extname(filename)];\n if (contentType) {\n headers[\"Content-Type\"] = contentType;\n }\n for (var k in options.headers) {\n headers[k] = options.headers[k];\n }\n response.writeHead(200, headers);\n response.write(file, \"binary\");\n response.end();\n });\n });\n }", "title": "" }, { "docid": "89f5642307aa0d932fd677b92878107c", "score": "0.5376575", "text": "function handler (req, res) { //create server\n fs.readFile(__dirname + '/index.html', function(err, data) { //read file index.html in public folder\n if (err) {\n res.writeHead(404, {'Content-Type': 'text/html'}); //display 404 on error\n return res.end(\"404 Not Found\");\n } \n res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML\n res.write(data); //write data from index.html\n return res.end();\n });\n}", "title": "" }, { "docid": "fadc7e2883c9c332019834dcbd22028e", "score": "0.53646296", "text": "function on_request(request, response) {\n console.log(\"Hey! I got a request\");\n console.log(request.url);\n let text = \"Hello World!\";\n // This writes data I want to send back to browser.\n response.write(text);\n // This tells that response has ended. Now send that data.\n response.end();\n}", "title": "" }, { "docid": "9441b8e3d86a3d451ff12defdca01d9e", "score": "0.53523964", "text": "function handler(req, res) { //create server\n fs.readFile(__dirname + '/public/index.html', function (err, data) { //read file index.html in public folder\n if (err) {\n res.writeHead(404, { 'Content-Type': 'text/html' }); //display 404 on error\n return res.end(\"404 Not Found\");\n }\n res.writeHead(200, { 'Content-Type': 'text/html' }); //write HTML\n res.write(data); //write data from index.html\n return res.end();\n });\n}", "title": "" }, { "docid": "798d29bcd891d00bbf7e626cf7818bdc", "score": "0.5351122", "text": "function requestHandler(req, res){ // function handles request givin to server\r\n \r\n console.log(req.url); // req.url gives the url requested by client ex.-> /profile\r\n res.writeHead(200, {'content-type':'text/html'}); // 200 is number tag for sucesssful, 404 for errors.... object contains data for output \r\n\r\n let pageloc; //we will location of the required page here\r\n switch(req.url){\r\n case \"/\" :\r\n pageloc= 'index.html';\r\n break;\r\n case \"/profile\":\r\n pageloc= 'profile.html';\r\n break;\r\n default:\r\n pageloc= 'error.html'\r\n }\r\n\r\n fs.readFile(pageloc, function(error, data){ // reading the file index.html (error for an error in reading)\r\n if(error){\r\n return res.end('<h1>no page location found</h1>'); //return this html to it if wrong file \r\n }\r\n else{\r\n return res.end(data); // return data containing html from the location \r\n }\r\n });\r\n}", "title": "" }, { "docid": "399fbe90218595b6738a548bae02561f", "score": "0.53480774", "text": "function processRequest(req, res) {\n var body = \"Welcome to the page!\";\n\n var contentLength = body.length;\n res.writeHead(200, {\n 'Content-Length':contentLength,\n 'Content-Type': 'text/plain'\n });\n res.end(body);\n}", "title": "" }, { "docid": "7787811944b1487a7c86e654c7146431", "score": "0.5342349", "text": "function exractBody(response) {\n let dom1 = document.createElement(\"html\");\n dom1.innerHTML = response;\n let bodyText = dom1.getElementsByTagName(\"body\")[0].innerHTML;\n return bodyText;\n}", "title": "" }, { "docid": "ce44558a3b529646308d2f70b8712a3e", "score": "0.5339144", "text": "getPage(pageName, response) {\n let filename = \"\";\n if (pageName == \"/\") {\n filename = \"./src/site/index.html\";\n } else if (this.isAccessibleFolder(pageName)) {\n filename = pageName.substr(1);\n } else if (this.isAccessibleHTMLFile(pageName)) {\n filename = \"src/site\" + this.isAccessibleHTMLFile(pageName);\n } else if (pageName === \"/favicon.ico\") {\n filename = \"src/site/assets/FAVICON.png\";\n } else {\n let htmlFile = this.mapToHTMLFile(pageName);\n if (htmlFile === null) {\n return this.respondWithError(response, 404, \"Error 404: Page Not Found\");\n } else {\n filename = \"src/site\" + htmlFile;\n }\n }\n\n //determine Content-type\n var contentType = \"text/html\";\n if (filename.substr(-3) === \"css\") {\n contentType = 'text/css';\n } else if (filename.substr(-2) === \"js\") {\n contentType = \"application/javascript\";\n } else if (filename.substr(-3) === \"png\") {\n contentType = \"image/png\";\n } else if (filename.substr(-3) === \"pdf\") {\n contentType = \"application/pdf\";\n } else if (filename.substr(-4) === \"docx\") {\n contentType = \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\";\n }\n \n filename = this.replaceWithSpaces(filename);\n var self = this; //required for callback in readFile scope\n fs.readFile(filename, function (err, data) {\n if (err) {\n return self.respondWithError(response, 404, \"Error 404: Page Not Found\");\n }\n else {\n return self.respondWithData(response, 200, contentType, data);\n }\n });\n return 0;\n }", "title": "" }, { "docid": "0732486ff3de3dd0904a0afff5072bac", "score": "0.533695", "text": "function index(response, request) {\n fs.readFile(\n __dirname + '/../view/index.html',\n function (error, htmlData) {\n if (error)\n throw error;\n // read file with shopping cart\n fs.readFile('cart.txt', function (error, data) {\n if (error)\n throw error;\n var cookies = utils.parseCookies(request);\n var sid = cookies['sessionid'];\n var str = data.toString();\n if (!str) {\n\n str = '{}';\n }\n // convert cart data from string to JSON\n var cartData = JSON.parse(str);\n // get cart of the current user\n var cart = cartData[sid];\n var len = '(0)';\n // if cart contains any data\n if (cart) {\n len = 0;\n cart.forEach(function (element) {\n len += element.quantity;\n });\n\n len = '(' + len + ')';\n }\n\n var html = htmlData.toString().replace('{{ count }}', len);\n // send html to user\n response.writeHead(200, {'Content-Type': 'text/html'});\n response.write(html);\n response.end();\n });\n }\n );\n}", "title": "" }, { "docid": "702677c4d5b2be7d660aa3c4f2263bd2", "score": "0.53350866", "text": "function doGet(request, response, url) {\n\t\n\tvar pageName = url.pathname.substring(\"/view\".length);\n\t\n\ttry {\n\t\tpageName = pageNameValidator.validatePageName(pageName, false); // permit \"/\" char this means something\n\t\t\n\t\tvar title = null;\n\t\tif (pageName.length > 1) {\n\t\t\ttitle = resolve.filename(pageName.substring(0, pageName.length - 1));\n\t\t} else {\n\t\t\ttitle = \"root\";\n\t\t}\n\t\t\n\t\tif (url.search == '?view=toc') {\n\t\t\tdirectoryListing(pageName, title, request, response);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tresolve.resolve(pageName + '/index.html', true , function(fileSystemFile) {\n\t\t\tfs.stat(fileSystemFile, function(err, stat) {\n\t\t\t\tif ( ! err) {\n\t\t\t\t\t// index.html exists , use it\n\t\t\t\t\tdefaults.found(response, pwUtil.removeDoubleSlash('/view/' + pageName + '/index.html'));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdirectoryListing(pageName, title, request, response);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t});\n\t\t\n\t} catch(err) {\n\t\tconsole.error(\"Error creating toc : \" + url.pathname + \" \" + err);\n\t\t// should not get here since the browser uses the same validation, implies a hack\n\t\tresponse.writeHead(400, \"OK\");\n\t\tresponse.end();\n\t}\n}", "title": "" }, { "docid": "0341d806066fc6ce09572dcf3fb487ba", "score": "0.5328425", "text": "function handleRequest(request, response){\n var content = \"\";\n\n try {\n content = getFile(request.url).toString()\n } catch (e) {\n content = \"404\";\n }\n\n response.setHeader('Content-Type', getContentType(request.url))\n console.log(\"SERVER: Loaded: \" + request.url)\n response.end(content);\n}", "title": "" }, { "docid": "755f2098476d5a1c3492b3d60b3e75b5", "score": "0.5326935", "text": "function doGet(e) {\n return HtmlService.createHtmlOutput(\"success!\"); \n}", "title": "" }, { "docid": "1f9fd8ef3fbaa7d65d606f429bec4cfa", "score": "0.53262925", "text": "function showHome(request){\n request.serveFile(\"index.html\"); \n}", "title": "" }, { "docid": "5cca4a59badddb870402bdaf433984b9", "score": "0.53260136", "text": "function serve(rootDirectory, port) {\n let server = new http.Server(); // Create a new HTTP server\n server.listen(port); // Listen on the specified port\n console.log(\"Listening on port\", port);\n\n // When requests come in, handle them with this function\n server.on(\"request\", (request, response) => {\n // Get the path portion of the request URL, ignoring\n // any query parameters that are appended to it.\n let endpoint = url.parse(request.url).pathname;\n\n // If the request was for \"/test/mirror\", send back the request\n // verbatim. Useful when you need to see the request headers and body.\n if (endpoint === \"/test/mirror\") {\n // Set response header\n response.setHeader(\"Content-Type\", \"text/plain; charset=UTF-8\");\n\n // Specify response status code\n response.writeHead(200); // 200 OK\n\n // Begin the response body with the request\n response.write(\n `${request.method} ${request.url} HTTP/${request.httpVersion}\\r\\n`\n );\n\n // Output the request headers\n let headers = request.rawHeaders;\n for (let i = 0; i < headers.length; i += 2) {\n response.write(`${headers[i]}: ${headers[i + 1]}\\r\\n`);\n }\n\n // End headers with an extra blank line\n response.write(\"\\r\\n\");\n\n // Now we need to copy any request body to the response body\n // Since they are both streams, we can use a pipe\n request.pipe(response);\n }\n // Otherwise, serve a file from the local directory.\n else {\n // Map the endpoint to a file in the local filesystem\n let filename = endpoint.substring(1); // strip leading /\n // Don't allow \"../\" in the path because it would be a security\n // hole to serve anything outside the root directory.\n filename = filename.replace(/\\.\\.\\//g, \"\");\n // Now convert from relative to absolute filename\n filename = path.resolve(rootDirectory, filename);\n\n // Now guess the type file's content type based on extension\n let type;\n switch (path.extname(filename)) {\n case \".html\":\n case \".htm\":\n type = \"text/html\";\n break;\n case \".js\":\n type = \"text/javascript\";\n break;\n case \".css\":\n type = \"text/css\";\n break;\n case \".png\":\n type = \"image/png\";\n break;\n case \".txt\":\n type = \"text/plain\";\n break;\n default:\n type = \"application/octet-stream\";\n break;\n }\n\n let stream = fs.createReadStream(filename);\n stream.once(\"readable\", () => {\n // If the stream becomes readable, then set the\n // Content-Type header and a 200 OK status. Then pipe the\n // file reader stream to the response. The pipe will\n // automatically call response.end() when the stream ends.\n response.setHeader(\"Content-Type\", type);\n response.writeHead(200);\n stream.pipe(response);\n });\n\n stream.on(\"error\", (err) => {\n // Instead, if we get an error trying to open the stream\n // then the file probably does not exist or is not readable.\n // Send a 404 Not Found plain-text response with the\n // error message.\n response.setHeader(\"Content-Type\", \"text/plain; charset=UTF-8\");\n response.writeHead(404);\n response.end(err.message);\n });\n }\n });\n}", "title": "" }, { "docid": "dcd82e870af2a1076ec2e044f3ebd8f8", "score": "0.53217953", "text": "function handler (req, res) { //create server\n fs.readFile(__dirname + '/public/index.html', function(err, data) { //read file index.html in public folder\n if (err) {\n res.writeHead(404, {'Content-Type': 'text/html'}); //display 404 on error\n return res.end(\"404 Not Found\");\n } \n res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML\n res.write(data); //write data from index.html\n return res.end();\n });\n}", "title": "" }, { "docid": "aeef20e695662d548be0fd7943a289ee", "score": "0.5317968", "text": "function theHTTPResponse(strHTML)\n{\nalert('inside theResponse');\n\tif(myreq.readyState==4)\n\t{\n\tif(myreq.status==200)\n\t{\n\t\tvar respstring=myreq.responseXML.getElementsByTagName('respstring')[0];\n\t\tdocument.getElementById(strHTML+\"_div\").innerHTML=respstring.childNodes[0].nodevalue;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(strHTML+\"_div\").innerHTML='waiting...';\n\t}\n\t}\n}", "title": "" }, { "docid": "ffc8fde69a127f410c5a1fdbfbbec1ab", "score": "0.53176224", "text": "function handler( req, res) {\n\tlet archivo = fs.createReadStream( __dirname + \"index-ws.html\")\n\tres.writeHead(200, {\"content-type\": \"text/html\"})\n\tarchivo.pipe(res)\n}", "title": "" }, { "docid": "567e64bb969d754edb7615d1c6e0a47e", "score": "0.53170824", "text": "function jsdomEndpoint(req, res, urlFile) {\r\n let data = fs.readFileSync(\"./html/\" + urlFile);\r\n let mioJsdom = new JSDOM(data);\r\n let tagAccedi = mioJsdom.window.document.getElementById(\"Accedi\");\r\n tagAccedi.innerHTML = \"Benvenuto \" + giocatore.getUsername();\r\n let tagHumburger = mioJsdom.window.document.getElementById(\"AccediHumburger\");\r\n tagHumburger.innerHTML = \"Benvenuto \" + giocatore.getUsername();\r\n res.send(mioJsdom.window.document.documentElement.outerHTML);\r\n}", "title": "" }, { "docid": "8de1101dc40172f792e9dd3c8bee63ff", "score": "0.53169185", "text": "function serveInitPage(req, res, next) {\n\n var initPagePath = paths.bundle + \"/index.html\";\n res.setHeader(\"Content-Type\", \"text/html; charset=utf-8\");\n fs.createReadStream(initPagePath).pipe(res); // awesome piping\n}", "title": "" }, { "docid": "6b6773b3f0cdf01c05a851866ca42091", "score": "0.53098965", "text": "function display_root(url, req, res){\r\n\t\tvar myHTML = '<html>';\r\n\t\tmyHTML += '<body><h1>Home Page</h1>';\r\n\t\tmyHTML += \"<a href='/portfolio'>Portfolio</a>\";\r\n\t\tmyHTML += '</body></html>';\r\n\t\tres.writeHead(200, {'Content-Type': 'text/html'});\r\n\r\n\t\tres.end(myHTML);\r\n\t}", "title": "" }, { "docid": "ead4d7143e52b7e11b8990d032cfaa82", "score": "0.52977926", "text": "function appendDom(response) {\n console.log('server says:', response);\n $('#container').append('<p class = \"totalanswer\">'+ response + '</p>');\n}", "title": "" }, { "docid": "940d817baef964cb56a21cbeaad5078d", "score": "0.52869236", "text": "function doGet(e) {\n // do whatever this webapp is for\n var result = doSomeStuff(e); \n // prepare the result\n var s = JSON.stringify(result);\n // publish result\n return ContentService\n .createTextOutput(result.params.callback ? result.params.callback + \"(\" + s + \")\" : s )\n .setMimeType(result.params.callback ? ContentService.MimeType.JAVASCRIPT : ContentService.MimeType.JSON); \n}", "title": "" }, { "docid": "36ac3e692bf9943dbb4d528c910f0586", "score": "0.52844375", "text": "function handler (req, res) { //create server\n fs.readFile(__dirname + '/public/index.html', function(err, data) { //read file index.html in public folder\n if (err) {\n res.writeHead(404, {'Content-Type': 'text/html'}); //display 404 on error\n return res.end(\"404 Not Found\");\n }\n res.writeHead(200, {'Content-Type': 'text/html'}); //write HTML\n res.write(data); //write data from index.html\n return res.end();\n });\n}", "title": "" }, { "docid": "106bce3aadb63c4979252d2c6b4529e3", "score": "0.5256059", "text": "function displayIndex(url, req, res) {\n fs.readFile(__dirname + '/index.html', function (err, data) {\n res.writeHead(200, {\n 'Content-Type': 'text/html'\n })\n res.end(data)\n })\n\n}", "title": "" }, { "docid": "37f6ac92df152a16956a236acf0db672", "score": "0.5255628", "text": "function onRequest(request, response) {\n console.log(\"Recibimos una peticion\");\n // Toda la informacion respecto a la peticion se encuentra dentro de request\n console.log(request);\n\n // Response: Es el objeto que devuelve data asociada a esa peticion.\n // writeHead: Devuelvo el status y el tipo de content que voy a devolver\n // Este metodo se debe llamar solo una vez y antes de response.end()\n response.writeHead(200, { \"Content-Type\": \"text/html\" });\n // Devuelvo dentro de mi response lo que necesito\n response.write(\"Hola Mundo\");\n // Especifico que termine de tratar mi response\n response.end();\n}", "title": "" }, { "docid": "4550cc3fa3df9ca7021972acd4bbd4f6", "score": "0.52533525", "text": "function handler( request, response ){\n // Request the Index\n if( request.url == '/' || request.url == '/index' ){\n fs.readFile( __dirname + '/index.html', \n function( err, data ){\n if( err ){\n response.writeHead( 500 );\n return response.end( 'Error loading index.html' );\n }\n\n // Write page to client\n response.writeHead( 200 );\n response.end( data );\n });\n }\n else if(request.url == '/client_room.js' ){\n fs.readFile( __dirname + '/client_room.js', \n function( err, data ){\n if( err ){\n response.writeHead( 500 );\n return response.end( 'Error loading client_room.js' );\n }\n\n // Write page to client\n response.writeHead( 200 );\n response.end( data );\n });\n }\n else if(request.url == '/style.css' ){\n fs.readFile( __dirname + '/style.css', \n function( err, data ){\n if( err ){\n response.writeHead( 500 );\n return response.end( 'Error loading style.css' );\n }\n\n // Write page to client\n response.writeHead( 200 );\n response.end( data );\n });\n }\n}", "title": "" }, { "docid": "2df7da2087dcc2e1a8baac5850c64c5e", "score": "0.5248444", "text": "function requestHandler1(req,res)\n{\n console.log(req.url); // return request url or searching url\n\n res.writeHead(200,{'content-type':'text/html'});\n res.end('hello browser'); // send simple response to browser\n res.end('<h1>hello browser</h1>'); // send html response to the browser\n}", "title": "" }, { "docid": "77efc3a2e5b49e6cd5d9e58cd909d11f", "score": "0.52479315", "text": "function get_handler (req, res) {\n\t/* parses the html file to be sent to the client,\n\tloading the content into variable data */\n\tfs.readFile(__dirname + '/index.html',\n\t/* function called after parsing, sends contents of\n\thtml if no error */\n\tfunction f0 (err, data) {\n\t\tif (err) {\n\t\t\t// send error code 500 (error)\n\t\t\tres.writeHead(500);\n\t\t\t/* send the error message and return to prevent\n\t\t\tcode below from executing */\n\t\t\treturn res.end('Error loading index.html');\n\t\t}\n\t\t// send error code 200 (ok)\n\t\tres.writeHead(200);\n\t\t// send the html data to the client\n\t\tres.end(data);\n\t});\n}", "title": "" }, { "docid": "83b521a2085b43bb58aec708eafd7f9c", "score": "0.52414215", "text": "function onRequest(request, response) {\n \n \n var parsedUrl = url.parse(request.url);\n //Parse the querystring into a JS object of variables and values\n //PARAMS MUST BE ENCODED WITH encodeURIComponent\n var params = queryString.parse(parsedUrl.query);\n //console.log(params);\n \n //check for image requests\n if(parsedUrl.pathname.substring(0,8) === '/images/'){\n request.url = parsedUrl.pathname.substring(7);\n imageServer.serve(request, response);\n return;\n }\n \n //check if params does not have a url field (meaning no url came in request)\n if(!params.url && !params.pokemon) {\n \n //open up the home page\n response.writeHead(200, {\"Content-Type\":\"text/html\"});\n response.write(index);\n response.end();\n return;\n }\n \n //try in case URL is invalid or fails\n try{\n \n //write a 200 okay status code and send CORS headers to allow client to access this\n response.writeHead(200, responseHeaders);\n \n //make a request to the url and pipe (feed) the returned ajax call to our client response\n //Here we are connecting the next servers response back to our page. \n requestHandler(params.url).pipe(response);\n\n }\n \n catch(exception) {\n //console.dir(exception);\n //write a 500 error out\n response.writeHead(500, responseHeaders);\n \n //json error message to respond with\n var responseMessage = {\n message: \"Could not find Pokemon. Pokemon names must be spelled correctly and Pokemon numbers must be between 1 and 802.\"\n }\n \n //stringify JSON message and write it to response\n response.write(JSON.stringify(responseMessage));\n\n response.end();\n }\n}", "title": "" }, { "docid": "9a96015248448d499dde8f9c517b6147", "score": "0.52367157", "text": "function handleRequest(request, response){\n response.setHeader('Connection', 'Transfer-Encoding');\n response.setHeader('Content-Type', 'text/html; charset=utf-8');\n response.setHeader('Transfer-Encoding', 'chunked');\n\t\n\t//response.write('Response started, will wait 5 seconds now...<br/>');\n sleep.sleep(15)//sleep for 15 seconds\n response.write('It Works!!<br/><br/> Path Hit: ' + request.url);\n\tresponse.end();\n}", "title": "" }, { "docid": "a62dfe1807b22dc1841207b0692bf67f", "score": "0.5230013", "text": "function reqListener () {\n console.log(this.responseText);\n document.getElementById('hits').innerHTML = this.responseText;\n}", "title": "" }, { "docid": "d0de970145a828ca489ffdad62870aec", "score": "0.52165717", "text": "function getStudyContent(response, postData) {\n\n\t// Website you wish to allow to connect\n\tresponse.setHeader('Access-Control-Allow-Origin', 'http://localhost:5555');\n\t// Request methods you wish to allow\n\tresponse.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');\n\t// Request headers you wish to allow\n\tresponse.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');\n\n\tresponse.writeHead(200, {\"Content-Type\": \"text/json\"});\n\n\tvar content = '<h2>Stadijas virsraksts</h2><i>Stadijas teksts italic</i>';\n\tresponse.write(content);\n\tresponse.end();\n}", "title": "" }, { "docid": "4f3552c48055711fadb098d08d861773", "score": "0.521544", "text": "function loadArticle(url, targetContainer, before, closure, otherwise) {\n var req = new XMLHttpRequest();\n\n req.onreadystatechange = function() {\n if (req.readyState != XMLHttpRequest.DONE) return;\n\n if (req.status == 200) {\n /* On success... */\n before();\n //console.log(req.responseText);\n targetContainer.outerHTML = req.responseText;\n /* ... and notify the client */\n closure();\n } else if (req.status == 404) {\n /* On complete failure, tell the client */\n otherwise();\n }\n };\n\n req.open(\"GET\", url);\n req.send();\n}", "title": "" }, { "docid": "e9675034392c815c59f63a85180c9f36", "score": "0.52153814", "text": "function start(response, postData) {\n console.log(\"Request handler 'start' was called.\");\n var body = '<html>' + '<head>' + '<meta http-equiv=\"Content-Type\" content=\"text/html; ' + 'charset=UTF-8\" />' +\n '</head>' +\n '<body>' +\n '<form action=\"/upload\" method=\"post\">' +\n '<textarea name=\"text\" rows=\"20\" cols=\"60\"></textarea>' +\n '<input type=\"submit\" value=\"Submit text\" />' +\n '</form>' +\n '</body>' +\n '</html>';\n\n response.writeHead(200, {\n \"Content-Type\": \"text/html\"\n });\n response.write(body);\n response.end();\n}", "title": "" }, { "docid": "ec7fae11dcf26d593d09e9085d6d7796", "score": "0.5209457", "text": "function display_index(req, res){\n res.writeHead(200, {'Content-Type': 'text/html'});\n\n fs.readFile('./html/index.html', function(e, c) {\n res.end(c);\n });\n }", "title": "" }, { "docid": "092fe305a1abda2094985c8ad7e1697e", "score": "0.5208785", "text": "function fillInResponse(response){\n $(\"#response\").text(response.responseText);\n }", "title": "" }, { "docid": "d8960bff2c759a470ae75b8dde887765", "score": "0.5206121", "text": "function testGetBulbasaur() {\n document.getElementById(\"httpRequest\").innerHTML = \"/Bulbasaur\";\n fetch(baseURL + \"/Bulbasaur\")\n .then(res => res.text())\n .then(res => {\n console.log(res);\n document.getElementById(\"httpResponse\").innerHTML = res;\n })\n}", "title": "" }, { "docid": "50947d7a49aa755d16aa3a32a70a0fd4", "score": "0.52053094", "text": "function handleRequest(request, response){\n\t\t//console.log(request);\n\t\tif(request.url.indexOf('/api/') === -1) {\n\t\t\t// request.url = '/'\n\t\t\t// request.url = '/client.js'\n\n\t\t\tvar filename = request.url.substr(1);\n\n\t\t\t// old line: if(request.url === '/') { new line:\n\t\t\tif(request.url === '/' || (filename.length > 0 && filename[0] === '/') ||\n\t\t\tfilename.indexOf('..') !== -1) {\n\t\t\t\tfilename = 'index.html';\n\t\t\t}\n\n\t\t\tfs.readFile(filename, 'utf8', function (err,data) {\n\t \t\tif (err) {\n\t \t\t return console.log(err);\n\t \t\t}\n\t \t\tconsole.log(data);\n\t \t\tresponse.end(data);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tif(request.url.indexOf('/api/send/') > -1) {\n\t\t\t//viestit.push()\n\t\t\tvar postDataString = \"\";\n\t\t\trequest.on('data', function(chunk) {\n\t postDataString = postDataString + chunk.toString();\n\t });\n\n\t request.on('end', function() {\n\t \tviestit.push(postDataString)\n\t // empty 200 OK response for now\n\t response.writeHead(200, \"OK\", {'Content-Type': 'text/html'});\n\t response.end();\n\n\t });\n\t\t}\n\n\t\tif(request.url.indexOf('/api/get/') > -1) {\n\t\t\tresponse.end(JSON.stringify(viestit));\n\t\t}\n}", "title": "" }, { "docid": "605d43357a50fd0604b5583db8911b13", "score": "0.5184673", "text": "function displayForm(res){\n fs.readFile('./createnew.html', function (err, html) {\n if (err) {\n throw err; \n } \n res.writeHeader(200, {'Content-Type':'text/html'});\n res.write(html);\n res.end();\n });\n}", "title": "" }, { "docid": "7c7d417e54f3876296335fef695c5082", "score": "0.51807714", "text": "function handleRequest1(request, response) {\n\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"That hat looks great on you!\");\n}", "title": "" }, { "docid": "5a077bc0c7d1fbd7d462f0ed842da203", "score": "0.51749635", "text": "function handleRequest(req, res) {\n\n // Here we use the fs package to read our index.html file\n fs.readFile(__dirname + \"/index.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": "fd9a94f10f19a189640ab19305bfe6bc", "score": "0.5171576", "text": "handleResponse(response) {\n // the key of pages is a number so need to look for it\n if (\n typeof this.searchResponse !== typeof undefined &&\n this.searchResponse.query\n ) {\n for (var key in this.searchResponse.query.pages) {\n // skip anything that's prototype object\n if (!this.searchResponse.query.pages.hasOwnProperty(key)) continue;\n // load object response, double check we have an extract\n if (this.searchResponse.query.pages[key].extract) {\n let html = this.searchResponse.query.pages[key].extract;\n html = html.replace(/<script[\\s\\S]*?>/gi, \"&lt;script&gt;\");\n html = html.replace(/<\\/script>/gi, \"&lt;/script&gt;\");\n html = html.replace(/<style[\\s\\S]*?>/gi, \"&lt;style&gt;\");\n html = html.replace(/<\\/style>/gi, \"&lt;/style&gt;\");\n // need to innerHTML this or it won't set\n this.shadowRoot.querySelector(\"#result\").innerHTML = html;\n }\n }\n }\n }", "title": "" }, { "docid": "4d12db898891e396cc1799bb3b07ee9f", "score": "0.5166168", "text": "function requestContent(filename) {\n $('main').load(filename);\n}", "title": "" }, { "docid": "5733408d6b85bc6d5c07870902d4b6c7", "score": "0.5162892", "text": "function handleRequest(request, response){\n\tvar urlData = url.parse(request.url, true);\n\tvar parameters = urlData.query;\n\n\t//check if the url is valid \n\t//we activate the server\n\t//we connect to a page called http://localhost:8080/chat.html\n\tif(urlData.pathname == \"/chat.html\"){\n\t\tresponse.writeHead(200, {'Content-Type': 'text/html'});\n\t\t//this is us telling the server this is good! ayayay\n\n\t\t//ask for a nickname if there is no nickname, show the HTML form thats gets\n\t\t//the nickname\n\t\tif(parameters.nick == undefined || parameters.nick == \"\"){\n\t\t\tvar page = \n\t\t\t\"<form>\\n\" +\n\t\t\t\"<div>Nickname:</div>\" + \n\t\t\t\"<div><input type=\\\"text\\\" name=\\\"nick\\\" autofocus>&nbsp;<button>Chat!</button></div>\\n\" +\n\t\t\t\"</form>\";\n\t\t\tresponse.end(formatAsHtml(page));\n\t\t}//end if nickname check\n\t\t//if there is already a nickname then proceed to else below\n\t\telse{\n\t\t\t//if there is already a nickname then proceed with chat but we need to check\n\t\t\t//if there is a message, add it to the array \n\t\t\tif(parameters.msg !== undefined && parameters.msg !== \"\")\n\t\t\t\tmessages.push(parameters.nick + \": \" + parameters.msg);\n\t\t\t // Jordan: hello? \n\t\t\t //Jordan is nick hello? is the msg\n\n\t\t\t //we need to display the contents of the array \n\t\t\t var page = \"\";\n\t\t\t //we use a for loop to display the contents of the array of messages \n\t\t\t for(var i = messages.length; i< 20; i++)\n\t\t\t \t//this creates the new line when a message pops up\n\t\t\t \tpage += \"<div>&nbsp;</div>\\n\";\n\t\t\t var startIndex = 0;\n\t\t\t if(messages.length > 20)\n\t\t\t \tstartIndex = messages.length - 20;\n\t\t\t //iterate through the messages inside the array \n\t\t\t for(var i = startIndex; i < messages.length; i++)\n\t\t\t \tpage += \"<div>\" + messages[i] + \"</div>\\n\";\n\t\t\t page +=\n\t\t\t\t \"<form>\\n\" +\n\t \t\t\"<input type=\\\"hidden\\\" name=\\\"nick\\\" value=\\\"\" + parameters.nick + \"\\\">\\n\" +\n\t \t\t\"<div>Message:&nbsp;<input type=\\\"text\\\" name=\\\"msg\\\" autofocus>&nbsp;\" +\n\t \t\t\"<button>Send</button></div>\\n\" +\n\t \t\t\"</form>\\n\" +\n\t \t\t\"<div><a href=\\\"/chat.html\\\">Log out</a></div>\";\n \t\tresponse.end(formatAsHtml(page));\n\t\t}//end else nickname check nickname is already there \n\t}//end if urldatapathname\n\telse{\n\t\tresponse.writeHead(404,{'Content-Type': 'text/html'});\n\t\tresponse.write(formatAsHtml(\"<div>Page not found awee! </div>\"));\n\t\tresponse.end();\n\t}//end else\n}//end function handleRequest", "title": "" }, { "docid": "47bc6bc338ec46421c6d46b09e092437", "score": "0.5161097", "text": "function getAndPrintHTML() {\n\n var https = require('https');\n\n var requestOptions = {\n host: 'sytantris.github.io',\n path: '/http-examples/step2.html'\n };\n\n var fullData = \"\";\n\n // console.logs each chunk of data as it is received,\n // concatenated with a newline character ('\\n')\n https.get(requestOptions, function (response) {\n\n // set encoding of received data to UTF-8\n response.setEncoding('utf8');\n\n // the callback is invoked when a `data` chunk is received\n response.on('data', function (data) {\n fullData += (data + \"\\n\");\n });\n\n response.on('end', function () {\n console.log(fullData);\n });\n\n });\n\n}", "title": "" }, { "docid": "578619944196acb8cc003d4589263036", "score": "0.5151668", "text": "function onRequest(request, response) {\n //Returns the page, css, js, and favicon when requested\n if(request.url === \"/\") {\n response.writeHead(200, { \"Content-Type\" : \"text/html\"} );\n response.write(index);\n response.end();\n return;\n } else if (request.url === \"/landingstyles.css\") {\n response.writeHead(200, { \"Content-Type\" : \"text/css\"} );\n response.write(styles);\n response.end();\n return;\n } else if (request.url === \"/landing.js\") {\n response.writeHead(200, { \"Content-Type\" : \"application/javascript\"} );\n response.write(landingjs);\n response.end();\n return;\n } else if (request.url === \"/resources/favicon.png\") {\n response.writeHead(200, {\"Content-Type\" : \"image/png\"});\n response.write(favicon);\n response.end();\n return;\n }\n\n //Split after the ? mark to get the query string (key=value pairs)\n var query = request.url.split('?')[1];\n var params = queryString.parse(query);\n\n if(!params.url) {\n response.writeHead(400, responseHeaders);\n\n var responseMessage = {\n message: \"Missing url parameter in request\"\n };\n\n response.write(JSON.stringify(responseMessage));\n response.end();\n return;\n }\n\n try{\n response.writeHead(200, responseHeaders);\n requestHandler(params.url).pipe(response);\n }\n catch(exception) {\n console.dir(exception);\n response.writeHead(500, responseHeaders);\n\n var responseMessage = {\n message: \"Error connecting to server. Check url and arguments for proper formatting\"\n }\n\n response.write(JSON.stringify(responseMessage));\n response.end();\n }\n\n}", "title": "" }, { "docid": "03b956958a257072c1edb187c1e1a19c", "score": "0.5148589", "text": "function root(request, response) {\n if(request.url == \"/\") {\n response.writeHead(200, {'Content-type': \"text\"});\n response.end(\"Home\\n\");\n }\n}", "title": "" } ]
63685977f95036d7a7bba1c76c9c19ec
helper for creating hash to related blank nodes map
[ { "docid": "a833e7a51b6b97ea992687c014fc2870", "score": "0.697714", "text": "createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n for(const quad of quads) {\n // 3.1) For each component in quad, if component is the subject, object,\n // or graph name and it is a blank node that is not identified by\n // identifier:\n // steps 3.1.1 and 3.1.2 occur in helpers:\n this._addRelatedBlankNodeHash({\n quad, component: quad.subject, position: 's',\n id, issuer, hashToRelated\n });\n this._addRelatedBlankNodeHash({\n quad, component: quad.object, position: 'o',\n id, issuer, hashToRelated\n });\n this._addRelatedBlankNodeHash({\n quad, component: quad.graph, position: 'g',\n id, issuer, hashToRelated\n });\n }\n\n return hashToRelated;\n }", "title": "" } ]
[ { "docid": "0f2c28aafd24354bc66b704425d59181", "score": "0.7130184", "text": "createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map(); // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n\n const quads = this.blankNodeInfo.get(id).quads; // 3) For each quad in quads:\n\n for (const quad of quads) {\n // 3.1) For each component in quad, if component is the subject, object,\n // or graph name and it is a blank node that is not identified by\n // identifier:\n // steps 3.1.1 and 3.1.2 occur in helpers:\n this._addRelatedBlankNodeHash({\n quad,\n component: quad.subject,\n position: 's',\n id,\n issuer,\n hashToRelated\n });\n\n this._addRelatedBlankNodeHash({\n quad,\n component: quad.object,\n position: 'o',\n id,\n issuer,\n hashToRelated\n });\n\n this._addRelatedBlankNodeHash({\n quad,\n component: quad.graph,\n position: 'g',\n id,\n issuer,\n hashToRelated\n });\n }\n\n return hashToRelated;\n }", "title": "" }, { "docid": "617bcb66126fb1eaf11c49dd76e5f870", "score": "0.7054665", "text": "createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map(); // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n\n const quads = this.blankNodeInfo.get(id).quads; // 3) For each quad in quads:\n\n for (const quad of quads) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n\n if (quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if (quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n } // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n\n\n const hash = this.hashRelatedBlankNode(related, quad, issuer, position);\n const entries = hashToRelated.get(hash);\n\n if (entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n return hashToRelated;\n }", "title": "" }, { "docid": "ac00272648f027160fb4d2830ed15903", "score": "0.6909216", "text": "createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n for(const quad of quads) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if(\n quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n }\n // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n const hash = this.hashRelatedBlankNode(related, quad, issuer, position);\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n return hashToRelated;\n }", "title": "" }, { "docid": "d362dd8a7f101a44d519c26c7c61463f", "score": "0.68680644", "text": "getJSXHashmap(fillBlanks=true) {\n var map = new Map();\n map.set(1, this._root.getNodeComponent());\n\n this._moveJSXtoMap(this._root, map, 1, fillBlanks);\n\n return map;\n }", "title": "" }, { "docid": "ccf9ff129c1a4c3b2962aeee006c9f59", "score": "0.6725691", "text": "createHashToRelated(id, issuer) {\n const self = this;\n\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = {};\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = self.blankNodeInfo[id].quads;\n\n // 3) For each quad in quads:\n for(let i = 0; i < quads.length; ++i) {\n // 3.1) For each component in quad, if component is the subject, object,\n // and graph name and it is a blank node that is not identified by\n // identifier:\n const quad = quads[i];\n for(const key in quad) {\n const component = quad[key];\n if(key === 'predicate' ||\n !(component.termType === 'BlankNode' && component.value !== id)) {\n continue;\n }\n // 3.1.1) Set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for component as\n // related, quad, path identifier issuer as issuer, and position as\n // either s, o, or g based on whether component is a subject, object,\n // graph name, respectively.\n const related = component.value;\n const position = POSITIONS[key];\n const hash = self.hashRelatedBlankNode(related, quad, issuer, position);\n\n // 3.1.2) Add a mapping of hash to the blank node identifier for\n // component to hash to related blank nodes map, adding an entry as\n // necessary.\n if(hash in hashToRelated) {\n hashToRelated[hash].push(related);\n } else {\n hashToRelated[hash] = [related];\n }\n }\n }\n\n return hashToRelated;\n }", "title": "" }, { "docid": "9debfbcbcbc678d321e541c4f2cae774", "score": "0.66384584", "text": "async createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n let i = 0;\n for(const quad of quads) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if(\n quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n }\n // Note: batch hashing related blank nodes 100 at a time\n if(++i % 100 === 0) {\n await this._yield();\n }\n // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n const hash = await this.hashRelatedBlankNode(\n related, quad, issuer, position);\n const entries = hashToRelated.get(hash);\n if(entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n return hashToRelated;\n }", "title": "" }, { "docid": "70ab2f70c9e8f1cb10c2204b4ab33006", "score": "0.66297454", "text": "createHashToRelated(id, issuer) {\n const self = this;\n\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = {};\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = self.blankNodeInfo[id].quads;\n\n // 3) For each quad in quads:\n for(let i = 0; i < quads.length; ++i) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n const quad = quads[i];\n let position;\n let related;\n if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if(\n quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n }\n // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n const hash = self.hashRelatedBlankNode(related, quad, issuer, position);\n if(hash in hashToRelated) {\n hashToRelated[hash].push(related);\n } else {\n hashToRelated[hash] = [related];\n }\n }\n\n return hashToRelated;\n }", "title": "" }, { "docid": "d3a7f1d6adfee537fc8e7224c84c6df2", "score": "0.6505586", "text": "async createHashToRelated(id, issuer) {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map();\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = this.blankNodeInfo.get(id).quads;\n\n // 3) For each quad in quads:\n let i = 0;\n for(const quad of quads) {\n // Note: batch hashing related blank node quads 100 at a time\n if(++i % 100 === 0) {\n await this._yield();\n }\n // 3.1) For each component in quad, if component is the subject, object,\n // and graph name and it is a blank node that is not identified by\n // identifier:\n // steps 3.1.1 and 3.1.2 occur in helpers:\n await Promise.all([\n this._addRelatedBlankNodeHash({\n quad, component: quad.subject, position: 's',\n id, issuer, hashToRelated\n }),\n this._addRelatedBlankNodeHash({\n quad, component: quad.object, position: 'o',\n id, issuer, hashToRelated\n }),\n this._addRelatedBlankNodeHash({\n quad, component: quad.graph, position: 'g',\n id, issuer, hashToRelated\n })\n ]);\n }\n\n return hashToRelated;\n }", "title": "" }, { "docid": "17cfe9a5d248567ff19952b97e833ccf", "score": "0.64973974", "text": "function hashBlankNodes(unnamed) {\n var nextUnnamed = [];\n var duplicates = {};\n var unique = {};\n\n // hash quads for each unnamed bnode\n jsonld.setImmediate(function() {hashUnnamed(0);});\n function hashUnnamed(i) {\n if(i === unnamed.length) {\n // done, name blank nodes\n return nameBlankNodes(unique, duplicates, nextUnnamed);\n }\n\n // hash unnamed bnode\n var bnode = unnamed[i];\n var hash = _hashQuads(bnode, bnodes);\n\n // store hash as unique or a duplicate\n if(hash in duplicates) {\n duplicates[hash].push(bnode);\n nextUnnamed.push(bnode);\n } else if(hash in unique) {\n duplicates[hash] = [unique[hash], bnode];\n nextUnnamed.push(unique[hash]);\n nextUnnamed.push(bnode);\n delete unique[hash];\n } else {\n unique[hash] = bnode;\n }\n\n // hash next unnamed bnode\n jsonld.setImmediate(function() {hashUnnamed(i + 1);});\n }\n }", "title": "" }, { "docid": "7bb162e832c137cb7f1634912cb9f0b1", "score": "0.64705", "text": "function hashBlankNodes(unnamed) {\r\n var nextUnnamed = [];\r\n var duplicates = {};\r\n var unique = {};\r\n\r\n // hash quads for each unnamed bnode\r\n jsonld.setImmediate(function() {hashUnnamed(0);});\r\n function hashUnnamed(i) {\r\n if(i === unnamed.length) {\r\n // done, name blank nodes\r\n return nameBlankNodes(unique, duplicates, nextUnnamed);\r\n }\r\n\r\n // hash unnamed bnode\r\n var bnode = unnamed[i];\r\n var hash = _hashQuads(bnode, bnodes);\r\n\r\n // store hash as unique or a duplicate\r\n if(hash in duplicates) {\r\n duplicates[hash].push(bnode);\r\n nextUnnamed.push(bnode);\r\n } else if(hash in unique) {\r\n duplicates[hash] = [unique[hash], bnode];\r\n nextUnnamed.push(unique[hash]);\r\n nextUnnamed.push(bnode);\r\n delete unique[hash];\r\n } else {\r\n unique[hash] = bnode;\r\n }\r\n\r\n // hash next unnamed bnode\r\n jsonld.setImmediate(function() {hashUnnamed(i + 1);});\r\n }\r\n }", "title": "" }, { "docid": "f72ac5c5ec5886fec6ab3b94a6bb9258", "score": "0.6424861", "text": "fillMapNodes() {\n Object.keys(this.map).forEach(key => {\n this.nodes[key] = {\n routes: this.map[key],\n boar: 3,\n hunter: 0,\n start: this.nodeList.filter(s => s == key).length\n }\n });\n }", "title": "" }, { "docid": "24e706ed4e2e332291a050a4ea5ed464", "score": "0.6417764", "text": "function hashBlankNodes(unnamed) {\n var nextUnnamed = [];\n var duplicates = {};\n var unique = {};\n\n // TODO: instead of N calls to setImmediate, run\n // atomic normalization parts for a specified\n // slice of time (perhaps configurable) as this\n // will better utilize CPU and improve performance\n // as JS processing speed improves\n\n // hash quads for each unnamed bnode\n jsonld.setImmediate(function() {hashUnnamed(0);});\n function hashUnnamed(i) {\n if(i === unnamed.length) {\n // done, name blank nodes\n return nameBlankNodes(unique, duplicates, nextUnnamed);\n }\n\n // hash unnamed bnode\n var bnode = unnamed[i];\n var hash = _hashQuads(bnode, bnodes);\n\n // store hash as unique or a duplicate\n if(hash in duplicates) {\n duplicates[hash].push(bnode);\n nextUnnamed.push(bnode);\n } else if(hash in unique) {\n duplicates[hash] = [unique[hash], bnode];\n nextUnnamed.push(unique[hash]);\n nextUnnamed.push(bnode);\n delete unique[hash];\n } else {\n unique[hash] = bnode;\n }\n\n // hash next unnamed bnode\n jsonld.setImmediate(function() {hashUnnamed(i + 1);});\n }\n }", "title": "" }, { "docid": "f3e55094e03c0ba4e83b6f57f2bdf545", "score": "0.63421804", "text": "function hashBlankNodes(unnamed) {\n var nextUnnamed = [];\n var duplicates = {};\n var unique = {};\n\n // TODO: instead of N calls to setImmediate, run\n // atomic normalization parts for a specified\n // slice of time (perhaps configurable) as this\n // will better utilize CPU and improve performance\n // as JS processing speed improves\n\n // hash quads for each unnamed bnode\n return hashUnnamed(0);\n function hashUnnamed(i) {\n if(i === unnamed.length) {\n // done, name blank nodes\n return nameBlankNodes(unique, duplicates, nextUnnamed);\n }\n\n // hash unnamed bnode\n var bnode = unnamed[i];\n var hash = _hashQuads(bnode, bnodes);\n\n // store hash as unique or a duplicate\n if(hash in duplicates) {\n duplicates[hash].push(bnode);\n nextUnnamed.push(bnode);\n } else if(hash in unique) {\n duplicates[hash] = [unique[hash], bnode];\n nextUnnamed.push(unique[hash]);\n nextUnnamed.push(bnode);\n delete unique[hash];\n } else {\n unique[hash] = bnode;\n }\n\n // hash next unnamed bnode\n return hashUnnamed(i + 1);\n }\n }", "title": "" }, { "docid": "8a82bdc6d0ab04d421ee4791d3947306", "score": "0.6277739", "text": "createHashToRelated(id, issuer, callback) {\n const self = this;\n\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = {};\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = self.blankNodeInfo[id].quads;\n\n // 3) For each quad in quads:\n self.forEach(quads, (quad, idx, callback) => {\n // 3.1) For each component in quad, if component is the subject, object,\n // and graph name and it is a blank node that is not identified by\n // identifier:\n self.forEach(quad, (component, key, callback) => {\n if(key === 'predicate' ||\n !(component.termType === 'BlankNode' && component.value !== id)) {\n return callback();\n }\n // 3.1.1) Set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for component as\n // related, quad, path identifier issuer as issuer, and position as\n // either s, o, or g based on whether component is a subject, object,\n // graph name, respectively.\n const related = component.value;\n const position = POSITIONS[key];\n self.hashRelatedBlankNode(\n related, quad, issuer, position, (err, hash) => {\n if(err) {\n return callback(err);\n }\n // 3.1.2) Add a mapping of hash to the blank node identifier for\n // component to hash to related blank nodes map, adding an entry as\n // necessary.\n if(hash in hashToRelated) {\n hashToRelated[hash].push(related);\n } else {\n hashToRelated[hash] = [related];\n }\n callback();\n });\n }, callback);\n }, err => callback(err, hashToRelated));\n }", "title": "" }, { "docid": "5753315e0ae0ec682658af3def2c74ba", "score": "0.6252588", "text": "function setUniqueNodes() {\n var node;\n var uniqueNodes = {};\n\n for (node in nodes) {\n var nodeList = nodes[node];\n var ids = [];\n var i;\n var uniqueNode = nodeList[0];\n var uniqueID = uniqueNode['id'];\n \n ids.push(uniqueID); \n uniqueNodes[uniqueID] = uniqueNode;\n \n for (i = 1; i < nodeList.length; i++) {\n uniqueID = nodeList[i]['id'];\n uniqueNodes[uniqueID] = uniqueNode;\n }\n }\n\n nodes = uniqueNodes;\n }", "title": "" }, { "docid": "5e6c9bd4abe33bdd00cfb903ce43be66", "score": "0.62151426", "text": "function build_nodes() {\n var map = {};\n function new_node(name) {\n if (! map[name]) {\n map[name] = {name: name, children: [], key: name, leaf: false};\n }\n }\n\n // push the root\n new_node('');\n\n // push each segment\n for (var i = 0; i < segments.length; i++) {\n var node_name = 'segment_' + i\n\n new_node(node_name);\n map[node_name].parent = map[''];\n map[''].children.push(map[node_name])\n\n d3.range(segments[i], segments[i+1] || beats.length).forEach(function(b) {\n var beat_name = 'beat_' + b;\n \n new_node(beat_name);\n map[beat_name].parent = map[node_name];\n map[beat_name].segment = i;\n map[beat_name].time = beats[b];\n map[beat_name].beat_num = b;\n map[beat_name].leaf = true;\n\n map[node_name].children.push(map[beat_name]);\n });\n }\n return map[''];\n }", "title": "" }, { "docid": "a344bd486f5ce50dfb4ddb0faebd2377", "score": "0.6210434", "text": "function createDataHashes(nodes, links){\n //nodes\n for (let node of nodes) {\n nodeHash[node.nodeID] = node;\n nodeHash[node.nodeID].depthArray = [];\n }\n //links by source\n for (let link of links) {\n if (!linkHashBySource.hasOwnProperty(link.source)) {\n linkHashBySource[link.source] = [];\n }\n linkHashBySource[link.source].push(link);\n }\n \n //links by target\n for (let link of links) {\n if (!linkHashByTarget.hasOwnProperty(link.target)) {\n linkHashByTarget[link.target] = [];\n }\n linkHashByTarget[link.target].push(link);\n }\n return {nodeHash, linkHashBySource, linkHashByTarget};\n}", "title": "" }, { "docid": "5758389ac31aefc3d8f02bb97ae6cc38", "score": "0.6171415", "text": "function nodeHash(node) {\n var inputText = node.getAttribute('data-unformatted');\n if (inputText === null) return;\n return inputText + node.getAttribute('data-math') + node.getAttribute('text-anchor') + node.getAttribute('style');\n }", "title": "" }, { "docid": "3d192b7a59256e5aba91ba9035b8e8de", "score": "0.6142223", "text": "_createNodeID(blanknode) {\n var i = 1;\n while (`node${i}` in this._blankNodes)\n i++;\n blanknode._nodeID = `node${i}`;\n this._blankNodes[blanknode._nodeID] = blanknode;\n }", "title": "" }, { "docid": "2a738810b1913363aac9b8e4697d9590", "score": "0.6115464", "text": "createHashToRelated(id, issuer, callback) {\n const self = this;\n\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = {};\n\n // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n const quads = self.blankNodeInfo[id].quads;\n\n // 3) For each quad in quads:\n self.forEach(quads, (quad, idx, callback) => {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n if(quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if(\n quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n return callback();\n }\n // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n self.hashRelatedBlankNode(\n related, quad, issuer, position, (err, hash) => {\n if(err) {\n return callback(err);\n }\n if(hash in hashToRelated) {\n hashToRelated[hash].push(related);\n } else {\n hashToRelated[hash] = [related];\n }\n callback();\n });\n }, err => callback(err, hashToRelated));\n }", "title": "" }, { "docid": "254b5d1861294ab8b496aeb8ec6a986c", "score": "0.6027669", "text": "constructor() {\n\n\t\tthis._nodeMap = new Map();\n\n\t}", "title": "" }, { "docid": "3e2a6ca0fe6809d23fc99076b0d6a436", "score": "0.59744704", "text": "static _resetBlankNodeIds() {\n blankNodePrefix = blankNodeCount = 0;\n }", "title": "" }, { "docid": "0f4f1731f60b0a6953a5a4d93aa5e2bf", "score": "0.5927332", "text": "function SHAMapTreeNode() { }", "title": "" }, { "docid": "d60b4cbb5d4b242d5c48e08746ee3170", "score": "0.5800923", "text": "createHashToRelated(id, issuer) {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map(); // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n\n const quads = _this.blankNodeInfo.get(id).quads; // 3) For each quad in quads:\n\n\n let i = 0;\n\n for (const quad of quads) {\n // 3.1) If the quad's subject is a blank node that does not match\n // identifier, set hash to the result of the Hash Related Blank Node\n // algorithm, passing the blank node identifier for subject as related,\n // quad, path identifier issuer as issuer, and p as position.\n let position;\n let related;\n\n if (quad.subject.termType === 'BlankNode' && quad.subject.value !== id) {\n related = quad.subject.value;\n position = 'p';\n } else if (quad.object.termType === 'BlankNode' && quad.object.value !== id) {\n // 3.2) Otherwise, if quad's object is a blank node that does not match\n // identifier, to the result of the Hash Related Blank Node algorithm,\n // passing the blank node identifier for object as related, quad, path\n // identifier issuer as issuer, and r as position.\n related = quad.object.value;\n position = 'r';\n } else {\n // 3.3) Otherwise, continue to the next quad.\n continue;\n } // Note: batch hashing related blank nodes 100 at a time\n\n\n if (++i % 100 === 0) {\n yield _this._yield();\n } // 3.4) Add a mapping of hash to the blank node identifier for the\n // component that matched (subject or object) to hash to related blank\n // nodes map, adding an entry as necessary.\n\n\n const hash = yield _this.hashRelatedBlankNode(related, quad, issuer, position);\n const entries = hashToRelated.get(hash);\n\n if (entries) {\n entries.push(related);\n } else {\n hashToRelated.set(hash, [related]);\n }\n }\n\n return hashToRelated;\n })();\n }", "title": "" }, { "docid": "1798cb2390f0a5d83a5b15311fea93ba", "score": "0.5787638", "text": "createHashToRelated(id, issuer) {\n var _this5 = this;\n\n return _asyncToGenerator(function* () {\n // 1) Create a hash to related blank nodes map for storing hashes that\n // identify related blank nodes.\n const hashToRelated = new Map(); // 2) Get a reference, quads, to the list of quads in the blank node to\n // quads map for the key identifier.\n\n const quads = _this5.blankNodeInfo.get(id).quads; // 3) For each quad in quads:\n\n\n let i = 0;\n\n for (const quad of quads) {\n // Note: batch hashing related blank node quads 100 at a time\n if (++i % 100 === 0) {\n yield _this5._yield();\n } // 3.1) For each component in quad, if component is the subject, object,\n // and graph name and it is a blank node that is not identified by\n // identifier:\n // steps 3.1.1 and 3.1.2 occur in helpers:\n\n\n yield Promise.all([_this5._addRelatedBlankNodeHash({\n quad,\n component: quad.subject,\n position: 's',\n id,\n issuer,\n hashToRelated\n }), _this5._addRelatedBlankNodeHash({\n quad,\n component: quad.object,\n position: 'o',\n id,\n issuer,\n hashToRelated\n }), _this5._addRelatedBlankNodeHash({\n quad,\n component: quad.graph,\n position: 'g',\n id,\n issuer,\n hashToRelated\n })]);\n }\n\n return hashToRelated;\n })();\n }", "title": "" }, { "docid": "9ca48b9cdea298717a0c1df174b26141", "score": "0.578332", "text": "serialize() {\n return util.mapValues(this.map, item => item.hash)\n }", "title": "" }, { "docid": "43ab3eec7585cd2f2f2fbed1f54bfc12", "score": "0.5761229", "text": "_dealWithAttrsForCloneNode() {\n return {};\n }", "title": "" }, { "docid": "4e92da57ee2d763a08aa72fa6bb89cdc", "score": "0.5748325", "text": "hashRelatedBlankNode(related, quad, issuer, position) {\n // 1) Set the identifier to use for related, preferring first the canonical\n // identifier for related if issued, second the identifier issued by issuer\n // if issued, and last, if necessary, the result of the Hash First Degree\n // Quads algorithm, passing related.\n let id;\n\n if (this.canonicalIssuer.hasId(related)) {\n id = this.canonicalIssuer.getId(related);\n } else if (issuer.hasId(related)) {\n id = issuer.getId(related);\n } else {\n id = this.blankNodeInfo.get(related).hash;\n } // 2) Initialize a string input to the value of position.\n // Note: We use a hash object instead.\n\n\n const md = new MessageDigest(this.hashAlgorithm);\n md.update(position); // 3) If position is not g, append <, the value of the predicate in quad,\n // and > to input.\n\n if (position !== 'g') {\n md.update(this.getRelatedPredicate(quad));\n } // 4) Append identifier to input.\n\n\n md.update(id); // 5) Return the hash that results from passing input through the hash\n // algorithm.\n\n return md.digest();\n }", "title": "" }, { "docid": "a8d8bd0baf7ccd25673c02c432680d9b", "score": "0.57424086", "text": "function HashTable() {}", "title": "" }, { "docid": "56eeaab3c9be543ed04f65f8ede9aa75", "score": "0.57386535", "text": "function getIENodeHash(node){if(node && node.nodeType > 0){switch(node.nodeType){case 1: // Element\n\treturn node.uniqueID;case 9: // Document\n\treturn node.documentElement && node.documentElement.uniqueID;}}} // If possible, use a WeakMap.", "title": "" }, { "docid": "1635e9592d5e57a61021f41ed5218613", "score": "0.57341635", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1:\n // Element\n return node.uniqueID;\n\n case 9:\n // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n } // If possible, use a WeakMap.", "title": "" }, { "docid": "7a577d04dbbdccf11e3014f0adbe8fc6", "score": "0.57273185", "text": "function createTree() {\n\tconst root = new Map()\n\n\tconst c1 = new Map()\n\tconst c11 = new Map()\n\tconst c111 = new Map()\n\tconst c1111 = new Map()\n\tconst c12 = new Map()\n\tconst c121 = new Map()\n\tconst c13 = new Map()\n\n\tc1.value = '456'\n\tc11.value = '4561'\n\tc111.value = '45611'\n\tc1111.value = '456111'\n\tc12.value = '4562'\n\tc121.value = '45621'\n\tc13.value = '4563'\n\n\troot.set('a', c1)\n\tc1.set('1', c11)\n\tc1.set('2', c12)\n\tc12.set('a', c121)\n\tc1.set('3', c13)\n\tc11.set('a', c111)\n\tc111.set('1', c1111)\n\n\treturn { root, c1, c11, c12, c13, c111, c1111 }\n}", "title": "" }, { "docid": "5371ea13ddcd8adec1e9a36d5c14217e", "score": "0.5716362", "text": "static getKeysToPopulationObj (node) {\n if (RegionTree.isLeaf(node)) {\n return;\n }\n\n const keysToPopulation = {};\n\n for (const key in node) {\n if (RegionTree.isLeafyKey(key)) {\n continue;\n }\n\n keysToPopulation[key] = RegionTree.getTotal(node[key]);\n }\n\n const missingCount = node.total - Util.sum(Object.values(keysToPopulation));\n\n if (missingCount > 0) {\n\n if (missingCount === undefined) {\n throw new Error(`weird bug again. node's keys are ${Object.keys(node)}`)\n }\n\n keysToPopulation.other = missingCount;\n }\n\n return keysToPopulation;\n }", "title": "" }, { "docid": "19f99eba9edf8081dc695f8a0cd80263", "score": "0.5700615", "text": "function GeoHash() {\n this.BITS = [16, 8, 4, 2, 1]\n this.MAX_PRECISION = 11\n \n \n this.BASE32 = \"0123456789bcdefghjkmnpqrstuvwxyz\"\n var NEIGHBORS = { right : { even : \"bc01fg45238967deuvhjyznpkmstqrwx\" },\n left : { even : \"238967debc01fg45kmstqrwxuvhjyznp\" },\n top : { even : \"p0r21436x8zb9dcf5h7kjnmqesgutwvy\" },\n bottom : { even : \"14365h7k9dcfesgujnmqp0r2twvyx8zb\" } }\n var BORDERS = { right : { even : \"bcfguvyz\" },\n left : { even : \"0145hjnp\" },\n top : { even : \"prxz\" },\n bottom : { even : \"028b\" } }\n\n NEIGHBORS.bottom.odd = NEIGHBORS.left.even\n NEIGHBORS.top.odd = NEIGHBORS.right.even\n NEIGHBORS.left.odd = NEIGHBORS.bottom.even\n NEIGHBORS.right.odd = NEIGHBORS.top.even\n\n BORDERS.bottom.odd = BORDERS.left.even\n BORDERS.top.odd = BORDERS.right.even\n BORDERS.left.odd = BORDERS.bottom.even\n BORDERS.right.odd = BORDERS.top.even\n \n this.NEIGHBORS = NEIGHBORS\n this.BORDERS = BORDERS\n\n var dimensionTables = this.buildLengthToDimensionTables(this.MAX_PRECISION)\n this.latitudeHeights = dimensionTables.latitudeHeights\n this.longitudeWidths = dimensionTables.longitudeWidths\n}", "title": "" }, { "docid": "d01f3177770d409c5fa6888384518363", "score": "0.5698095", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1:\n // Element\n return node.uniqueID;\n\n case 9:\n // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n} // If possible, use a WeakMap.", "title": "" }, { "docid": "d01f3177770d409c5fa6888384518363", "score": "0.5698095", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1:\n // Element\n return node.uniqueID;\n\n case 9:\n // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n} // If possible, use a WeakMap.", "title": "" }, { "docid": "d01f3177770d409c5fa6888384518363", "score": "0.5698095", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1:\n // Element\n return node.uniqueID;\n\n case 9:\n // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n} // If possible, use a WeakMap.", "title": "" }, { "docid": "5cea6d408f5540faf87b4017d08138b0", "score": "0.569642", "text": "static makeEmptyMap() { $dataMap = this._newEmptyMap(); }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "384c1ef6be1d248de4e62bfd6d538bec", "score": "0.5677828", "text": "function getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1: // Element\n\t return node.uniqueID;\n\t case 9: // Document\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "15b7795a8960876eccedecf6d00930b9", "score": "0.5676057", "text": "function nodes(){\n var nodeSet = {};\n Object.keys(edges).forEach(function (u){\n nodeSet[u] = true;\n edges[u].forEach(function (v){\n nodeSet[v] = true;\n });\n });\n return Object.keys(nodeSet);\n }", "title": "" }, { "docid": "d9a2d603606426c881a2e4bee4ba0c02", "score": "0.565596", "text": "prefixMap(empty = false) { return this.createPrefixMap(empty); }", "title": "" }, { "docid": "2ed52b35e937443e8e41984d457e7670", "score": "0.5625044", "text": "hashRelatedBlankNode(related, quad, issuer, position) {\n // 1) Set the identifier to use for related, preferring first the canonical\n // identifier for related if issued, second the identifier issued by issuer\n // if issued, and last, if necessary, the result of the Hash First Degree\n // Quads algorithm, passing related.\n let id;\n if(this.canonicalIssuer.hasId(related)) {\n id = this.canonicalIssuer.getId(related);\n } else if(issuer.hasId(related)) {\n id = issuer.getId(related);\n } else {\n id = this.blankNodeInfo.get(related).hash;\n }\n\n // 2) Initialize a string input to the value of position.\n // Note: We use a hash object instead.\n const md = new MessageDigest(this.hashAlgorithm);\n md.update(position);\n\n // 3) If position is not g, append <, the value of the predicate in quad,\n // and > to input.\n if(position !== 'g') {\n md.update(this.getRelatedPredicate(quad));\n }\n\n // 4) Append identifier to input.\n md.update(id);\n\n // 5) Return the hash that results from passing input through the hash\n // algorithm.\n return md.digest();\n }", "title": "" }, { "docid": "c3ad81b120c41f203e3b00dd392e6d18", "score": "0.56222486", "text": "hashFirstDegreeQuads(id) {\n const self = this;\n\n // return cached hash\n const info = self.blankNodeInfo[id];\n if('hash' in info) {\n return info.hash;\n }\n\n // 1) Initialize nquads to an empty list. It will be used to store quads in\n // N-Quads format.\n const nquads = [];\n\n // 2) Get the list of quads `quads` associated with the reference blank node\n // identifier in the blank node to quads map.\n const quads = info.quads;\n\n // 3) For each quad `quad` in `quads`:\n for(let i = 0; i < quads.length; ++i) {\n const quad = quads[i];\n\n // 3.1) Serialize the quad in N-Quads format with the following special\n // rule:\n\n // 3.1.1) If any component in quad is an blank node, then serialize it\n // using a special identifier as follows:\n const copy = {predicate: quad.predicate};\n self.forEachComponent(quad, (component, key) => {\n // 3.1.2) If the blank node's existing blank node identifier matches\n // the reference blank node identifier then use the blank node\n // identifier _:a, otherwise, use the blank node identifier _:z.\n copy[key] = self.modifyFirstDegreeComponent(id, component, key);\n });\n nquads.push(NQuads.serializeQuad(copy));\n }\n\n // 4) Sort nquads in lexicographical order.\n nquads.sort();\n\n // 5) Return the hash that results from passing the sorted, joined nquads\n // through the hash algorithm.\n const md = new MessageDigest(self.hashAlgorithm);\n for(let i = 0; i < nquads.length; ++i) {\n md.update(nquads[i]);\n }\n // TODO: represent as byte buffer instead to cut memory usage in half\n info.hash = md.digest();\n return info.hash;\n }", "title": "" }, { "docid": "677c9c382c02569c2aebaff0d5e49bb7", "score": "0.56185174", "text": "function copy() {\n const nodes = [];\n const cnodes = [];\n const mapping = {};\n this.each((node) => {\n nodes.push(node);\n const cnode = new Node(node.id, node.data);\n cnodes.push(cnode);\n mapping[cnode.id] = cnode;\n });\n\n cnodes.forEach((cnode, i) => {\n const node = nodes[i];\n cnode.children = node.children.map((c) => mapping[c.id]);\n });\n\n if (this.id === undefined) {\n const root = new Node(undefined, undefined);\n root.children = this.children.map((c) => mapping[c.id]);\n } else {\n return mapping[this.id];\n }\n }", "title": "" }, { "docid": "b07065b3a3c34738495bb6fad6aeb4a1", "score": "0.5610465", "text": "function LeafHashEntry() {\n\n}", "title": "" }, { "docid": "6ba99293ed7918c67836565c1a7691fc", "score": "0.560295", "text": "function nameBlankNodes(unique, duplicates, unnamed) {\r\n // name unique bnodes in sorted hash order\r\n var named = false;\r\n var hashes = Object.keys(unique).sort();\r\n for(var i = 0; i < hashes.length; ++i) {\r\n var bnode = unique[hashes[i]];\r\n namer.getName(bnode);\r\n named = true;\r\n }\r\n\r\n if(named) {\r\n // continue to hash bnodes if a bnode was assigned a name\r\n hashBlankNodes(unnamed);\r\n } else {\r\n // name the duplicate hash bnodes\r\n nameDuplicates(duplicates);\r\n }\r\n }", "title": "" }, { "docid": "6f0be5229243f046fd3ecae3b61cc194", "score": "0.55859303", "text": "function nameBlankNodes(unique, duplicates, unnamed) {\n // name unique bnodes in sorted hash order\n var named = false;\n var hashes = Object.keys(unique).sort();\n for(var i = 0; i < hashes.length; ++i) {\n var bnode = unique[hashes[i]];\n namer.getName(bnode);\n named = true;\n }\n\n if(named) {\n // continue to hash bnodes if a bnode was assigned a name\n hashBlankNodes(unnamed);\n } else {\n // name the duplicate hash bnodes\n nameDuplicates(duplicates);\n }\n }", "title": "" }, { "docid": "6f0be5229243f046fd3ecae3b61cc194", "score": "0.55859303", "text": "function nameBlankNodes(unique, duplicates, unnamed) {\n // name unique bnodes in sorted hash order\n var named = false;\n var hashes = Object.keys(unique).sort();\n for(var i = 0; i < hashes.length; ++i) {\n var bnode = unique[hashes[i]];\n namer.getName(bnode);\n named = true;\n }\n\n if(named) {\n // continue to hash bnodes if a bnode was assigned a name\n hashBlankNodes(unnamed);\n } else {\n // name the duplicate hash bnodes\n nameDuplicates(duplicates);\n }\n }", "title": "" }, { "docid": "89ce821f72352dfe02b1414ec7556d65", "score": "0.5582545", "text": "async hashRelatedBlankNode(related, quad, issuer, position) {\n // 1) Set the identifier to use for related, preferring first the canonical\n // identifier for related if issued, second the identifier issued by issuer\n // if issued, and last, if necessary, the result of the Hash First Degree\n // Quads algorithm, passing related.\n let id;\n if(this.canonicalIssuer.hasId(related)) {\n id = this.canonicalIssuer.getId(related);\n } else if(issuer.hasId(related)) {\n id = issuer.getId(related);\n } else {\n id = this.blankNodeInfo.get(related).hash;\n }\n\n // 2) Initialize a string input to the value of position.\n // Note: We use a hash object instead.\n const md = new MessageDigest(this.hashAlgorithm);\n md.update(position);\n\n // 3) If position is not g, append <, the value of the predicate in quad,\n // and > to input.\n if(position !== 'g') {\n md.update(this.getRelatedPredicate(quad));\n }\n\n // 4) Append identifier to input.\n md.update(id);\n\n // 5) Return the hash that results from passing input through the hash\n // algorithm.\n return md.digest();\n }", "title": "" }, { "docid": "2bc073cb36c54c12d8d7aba2b38cde8c", "score": "0.557524", "text": "function nameBlankNodes(unique, duplicates, unnamed) {\n // name unique bnodes in sorted hash order\n var named = false;\n var hashes = Object.keys(unique).sort();\n for(var i = 0; i < hashes.length; ++i) {\n var bnode = unique[hashes[i]];\n namer.getName(bnode);\n named = true;\n }\n\n if(named) {\n // continue to hash bnodes if a bnode was assigned a name\n return hashBlankNodes(unnamed);\n } else {\n // name the duplicate hash bnodes\n return nameDuplicates(duplicates);\n }\n }", "title": "" }, { "docid": "d03989614456d1db644f3a2dc2886a55", "score": "0.5571481", "text": "function mapBullyMap(hash) {\n //var newHash = new Map();\n var newHash = hash;\n\n if (newHash.has(\"a\")) {\n newHash.set(\"b\", hash.get(\"a\"));\n newHash.set(\"a\", \"\");\n }\n if (newHash.has(\"c\")) {\n newHash.delete(\"c\");\n }\n\n\n return newHash;\n}", "title": "" }, { "docid": "cdffe3a93f1871277bde078b3166cb9b", "score": "0.5557116", "text": "function EntitiesHash() {\n this.hash = {};\n }", "title": "" }, { "docid": "0180b5af128e3146049c3fcd632c2c5b", "score": "0.55426925", "text": "function nodeChildrenAsMap(node) {\n var map = {};\n return node && node.children.forEach(function(child) {\n return map[child.value.outlet] = child;\n }), map;\n }", "title": "" }, { "docid": "5f936712761622f5a1df440c66f99b7d", "score": "0.55398655", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "5f936712761622f5a1df440c66f99b7d", "score": "0.55398655", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "1ec69126148bbaa193fa5af655e0dd69", "score": "0.5509818", "text": "function makeInfoDictionary(nodeID, attributes) {\n if (nodeID && attributes) {\n nodeInfoDictionary[nodeID] = attributes;\n }\n}", "title": "" }, { "docid": "442716688a816d869d6d9e723f826be1", "score": "0.54978734", "text": "function nodeChildrenAsMap(node) {\n var map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n }", "title": "" }, { "docid": "de7093e9997fe681ed850a4386e82438", "score": "0.549701", "text": "function addUsedButNotDefinedNodes()\n\t{\n\t\tsetStatusText(\"Adding used but not defined nodes...\");\n\t\tvar mappedNodes=[];\n\t\tfor(var i=0;i< originalNodes.length;i++ )\n\t\t{\n\t\t\tmappedNodes[originalNodes[i].id]=originalNodes[i];\n\t\t}\n\t\t\n\t\tfor(var i=0;i< originalEdges.length;i++ )\n\t\t{\n\t\t\tif(originalEdges[i].from != undefined && mappedNodes[originalEdges[i].from]==undefined)\n\t\t\t{\n\t\t\t\tvar nodeLabel=originalEdges[i].from;\n\t\t\t\tvar exploded=originalEdges[i].from.split(\"?\");\n\t\t\t\tif(exploded[1]!=undefined)\n\t\t\t\t{\n\t\t\t\t\tnodeLabel=exploded[1];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar addNode=\n\t\t\t\t{\n\t\t\t\t\t\"id\" : originalEdges[i].from,\n\t\t\t\t\t\"style\" : \"border\",\n\t\t\t\t\t\"label\" : nodeLabel,\n\t\t\t\t\t\"url\" : originalEdges[i].from\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\toriginalNodes.push(addNode);\n\t\t\t\tmappedNodes[originalEdges[i].from]=addNode;\n\t\t\t\tconsole.log(\"Border-Node: \"+nodeLabel+\" (\"+originalEdges[i].from+\")\");\n\t\t\t}\n\t\t\tif(originalEdges[i].to!=undefined && mappedNodes[originalEdges[i].to]==undefined)\n\t\t\t{\n\t\t\t\tvar nodeLabel=originalEdges[i].to;\n\t\t\t\tvar exploded=originalEdges[i].to.split(\"?\");\n\t\t\t\tif(exploded[1]!=undefined)\n\t\t\t\t{\n\t\t\t\t\tnodeLabel=exploded[1];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar addNode=\n\t\t\t\t{\n\t\t\t\t\t\"id\" : originalEdges[i].to,\n\t\t\t\t\t\"style\" : \"border\",\n\t\t\t\t\t\"label\" : nodeLabel,\n\t\t\t\t\t\"url\" : originalEdges[i].to\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\toriginalNodes.push(addNode);\n\t\t\t\tmappedNodes[originalEdges[i].to]=addNode;\n\t\t\t\tconsole.log(\"Border-Node: \"+nodeLabel+\" (\"+originalEdges[i].to+\")\");\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ef2139e7834c7b11e3f359ef615534d0", "score": "0.54920167", "text": "hashFirstDegreeQuads(id, callback) {\n const self = this;\n\n // return cached hash\n const info = self.blankNodeInfo[id];\n if('hash' in info) {\n return callback(null, info.hash);\n }\n\n // 1) Initialize nquads to an empty list. It will be used to store quads in\n // N-Quads format.\n const nquads = [];\n\n // 2) Get the list of quads quads associated with the reference blank node\n // identifier in the blank node to quads map.\n const quads = info.quads;\n\n // 3) For each quad quad in quads:\n self.forEach(quads, (quad, idx, callback) => {\n // 3.1) Serialize the quad in N-Quads format with the following special\n // rule:\n\n // 3.1.1) If any component in quad is an blank node, then serialize it\n // using a special identifier as follows:\n const copy = {predicate: quad.predicate};\n self.forEachComponent(quad, (component, key) => {\n // 3.1.2) If the blank node's existing blank node identifier matches the\n // reference blank node identifier then use the blank node identifier\n // _:a, otherwise, use the blank node identifier _:z.\n copy[key] = self.modifyFirstDegreeComponent(id, component, key);\n });\n nquads.push(NQuads.serializeQuad(copy));\n callback();\n }, err => {\n if(err) {\n return callback(err);\n }\n // 4) Sort nquads in lexicographical order.\n nquads.sort();\n\n // 5) Return the hash that results from passing the sorted, joined nquads\n // through the hash algorithm.\n const md = new MessageDigest(self.hashAlgorithm);\n for(let i = 0; i < nquads.length; ++i) {\n md.update(nquads[i]);\n }\n // TODO: represent as byte buffer instead to cut memory usage in half\n info.hash = md.digest();\n callback(null, info.hash);\n });\n }", "title": "" }, { "docid": "151e9db897798f767c775d7244fe6b7e", "score": "0.54917496", "text": "hashRelatedBlankNode(related, quad, issuer, position) {\n var _this3 = this;\n\n return _asyncToGenerator(function* () {\n // 1) Set the identifier to use for related, preferring first the canonical\n // identifier for related if issued, second the identifier issued by issuer\n // if issued, and last, if necessary, the result of the Hash First Degree\n // Quads algorithm, passing related.\n let id;\n\n if (_this3.canonicalIssuer.hasId(related)) {\n id = _this3.canonicalIssuer.getId(related);\n } else if (issuer.hasId(related)) {\n id = issuer.getId(related);\n } else {\n id = _this3.blankNodeInfo.get(related).hash;\n } // 2) Initialize a string input to the value of position.\n // Note: We use a hash object instead.\n\n\n const md = new MessageDigest(_this3.hashAlgorithm);\n md.update(position); // 3) If position is not g, append <, the value of the predicate in quad,\n // and > to input.\n\n if (position !== 'g') {\n md.update(_this3.getRelatedPredicate(quad));\n } // 4) Append identifier to input.\n\n\n md.update(id); // 5) Return the hash that results from passing input through the hash\n // algorithm.\n\n return md.digest();\n })();\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" }, { "docid": "dc54a3a3ade691900275d4f780e5fde3", "score": "0.5485239", "text": "function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1: // Element\n return node.uniqueID;\n case 9: // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n }", "title": "" } ]